unpoly-rails 3.9.0 → 3.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/unpoly/unpoly.es6.js +21 -11
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +21 -11
- data/assets/unpoly/unpoly.min.js +1 -1
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +2 -2
data/assets/unpoly/unpoly.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
/***/ (() => {
|
6
6
|
|
7
7
|
window.up = {
|
8
|
-
version: '3.9.
|
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
|
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,
|
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
|
5988
|
-
|
5989
|
-
|
5990
|
-
|
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 =
|
6029
|
+
let layers = rememberOriginLayer(overrides);
|
6020
6030
|
if (preprocessedOptions.failOptions) {
|
6021
6031
|
return {
|
6022
6032
|
...preprocessedOptions.defaults,
|
@@ -9777,7 +9787,7 @@ up.link = (function () {
|
|
9777
9787
|
noInstantSelectors: ['[up-instant=false]', '[onclick]'],
|
9778
9788
|
preloadSelectors: ['[up-preload]'],
|
9779
9789
|
noPreloadSelectors: ['[up-preload=false]'],
|
9780
|
-
clickableSelectors: ['[up-clickable]', '[up-follow]', '[up-emit]', '[up-accept]', '[up-dismiss]', ATTRS_SUGGESTING_FOLLOW],
|
9790
|
+
clickableSelectors: ['[up-clickable]', '[up-follow]', '[up-emit]', '[up-accept]', '[up-dismiss]', `a:is(${ATTRS_SUGGESTING_FOLLOW})`],
|
9781
9791
|
noClickableSelectors: ['[up-clickable=false]', DEFAULT_INTERACTIVE_ELEMENT],
|
9782
9792
|
preloadDelay: 90,
|
9783
9793
|
}));
|