unpoly-rails 3.9.1 → 3.9.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.9.1'
8
+ version: '3.9.2'
9
9
  };
10
10
 
11
11
 
@@ -2949,7 +2949,7 @@ up.Change.FromContent = (_a = class FromContent extends up.Change {
2949
2949
  super(options);
2950
2950
  this._origin = options.origin;
2951
2951
  this._preview = options.preview;
2952
- this._layers = options.layers;
2952
+ this._layers = up.layer.getAll(options);
2953
2953
  }
2954
2954
  _getPlans() {
2955
2955
  let plans = [];
@@ -5158,7 +5158,10 @@ up.LayerLookup = (_a = class LayerLookup {
5158
5158
  }
5159
5159
  }
5160
5160
  _getOriginLayer() {
5161
- let { origin } = this._options;
5161
+ let { origin, originLayer } = this._options;
5162
+ if (originLayer) {
5163
+ return originLayer;
5164
+ }
5162
5165
  if (origin) {
5163
5166
  return this._forElement(origin);
5164
5167
  }
@@ -5944,6 +5947,7 @@ up.RenderOptions = (function () {
5944
5947
  'confirm',
5945
5948
  'feedback',
5946
5949
  'origin',
5950
+ 'originLayer',
5947
5951
  'baseLayer',
5948
5952
  'fail',
5949
5953
  'onError',
@@ -5974,6 +5978,11 @@ up.RenderOptions = (function () {
5974
5978
  return up.fragment.config.navigateOptions;
5975
5979
  }
5976
5980
  }
5981
+ function normalizeURL({ url }) {
5982
+ if (url) {
5983
+ return { url: u.normalizeURL(url) };
5984
+ }
5985
+ }
5977
5986
  function preloadOverrides(options) {
5978
5987
  if (options.preload) {
5979
5988
  return PRELOAD_OVERRIDES;
@@ -5982,13 +5991,14 @@ up.RenderOptions = (function () {
5982
5991
  function preprocess(options) {
5983
5992
  up.migrate.preprocessRenderOptions?.(options);
5984
5993
  const defaults = u.merge(GLOBAL_DEFAULTS, navigateDefaults(options));
5985
- return u.merge(u.omit(defaults, LATE_KEYS), { defaults }, { inputDevice: up.event.inputDevice }, options, lookupLayers(options), preloadOverrides(options));
5994
+ return u.merge(u.omit(defaults, LATE_KEYS), { defaults }, { inputDevice: up.event.inputDevice }, options, normalizeURL(options), rememberOriginLayer(options), preloadOverrides(options));
5986
5995
  }
5987
- function lookupLayers(options) {
5988
- return {
5989
- layers: up.layer.getAll(options),
5990
- normalizeLayerOptions: false,
5991
- };
5996
+ function rememberOriginLayer({ origin, originLayer }) {
5997
+ if (origin && !originLayer) {
5998
+ return {
5999
+ originLayer: up.layer.get(origin),
6000
+ };
6001
+ }
5992
6002
  }
5993
6003
  function finalize(preprocessedOptions, lateDefaults) {
5994
6004
  return u.merge(preprocessedOptions.defaults, lateDefaults, preprocessedOptions);
@@ -6016,7 +6026,7 @@ up.RenderOptions = (function () {
6016
6026
  }
6017
6027
  function deriveFailOptions(preprocessedOptions) {
6018
6028
  let overrides = failOverrides(preprocessedOptions);
6019
- let layers = lookupLayers(overrides);
6029
+ let layers = rememberOriginLayer(overrides);
6020
6030
  if (preprocessedOptions.failOptions) {
6021
6031
  return {
6022
6032
  ...preprocessedOptions.defaults,
@@ -6039,6 +6049,7 @@ up.RenderOptions = (function () {
6039
6049
  finalize,
6040
6050
  assertContentGiven,
6041
6051
  deriveFailOptions,
6052
+ lookupLayers: rememberOriginLayer,
6042
6053
  };
6043
6054
  })();
6044
6055