unpoly-rails 3.0.0 → 3.1.0
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-migrate.js +16 -9
- data/assets/unpoly/unpoly-migrate.min.js +1 -1
- data/assets/unpoly/unpoly.es6.js +67 -45
- data/assets/unpoly/unpoly.es6.min.js +1 -1
- data/assets/unpoly/unpoly.js +66 -44
- data/assets/unpoly/unpoly.min.js +1 -1
- data/lib/unpoly/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43b79641405aecb5cb963c79da11e06e50430fd5407d3064a99eda48d14de5f6
|
4
|
+
data.tar.gz: 4526d0f032d8d81c5c9d46711f9b0ee0151e59b2b6243b9ce0f8d1314a924921
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 404ccffc25c6e6f126cc4115495d386c38a185f0995406dfcebb457339cc6cecf3209f53c93d5afff3597def340c86ba48a72fb57c0d1e2ec2ab49c61ca112d4
|
7
|
+
data.tar.gz: 872e62f9a0bcbcde67eec1d2d42ccb6d4655099a7fccb8485074a8cbe968bbe30332cd38cfd3516b1fe3a5a5e34d9b9c670871573f9c8f2de73035ee0fa8ef8b
|
@@ -301,12 +301,20 @@ up.event.nobodyPrevents = function (...args) {
|
|
301
301
|
};
|
302
302
|
up.$on = function (...definitionArgs) {
|
303
303
|
let callback = definitionArgs.pop();
|
304
|
-
|
304
|
+
callback.upNativeCallback = function (event, element, data) {
|
305
305
|
let $element = jQuery(element);
|
306
306
|
callback.call($element, event, $element, data);
|
307
|
-
}
|
307
|
+
};
|
308
|
+
return up.on(...definitionArgs, callback.upNativeCallback);
|
309
|
+
};
|
310
|
+
up.$off = function (...definitionArgs) {
|
311
|
+
let $callback = definitionArgs.pop();
|
312
|
+
let nativeCallback = $callback.upNativeCallback;
|
313
|
+
if (!nativeCallback) {
|
314
|
+
up.fail('The callback passed to up.$off() was never registered with up.$on()');
|
315
|
+
}
|
316
|
+
return up.off(...definitionArgs, nativeCallback);
|
308
317
|
};
|
309
|
-
up.$off = up.event.off;
|
310
318
|
|
311
319
|
|
312
320
|
/***/ }),
|
@@ -340,16 +348,16 @@ up.migrate.targetMacro = function (queryAttr, fixedResultAttrs, callback) {
|
|
340
348
|
callback === null || callback === void 0 ? void 0 : callback();
|
341
349
|
});
|
342
350
|
};
|
343
|
-
up.$compiler = function (
|
351
|
+
up.$compiler = function (...definitionArgs) {
|
344
352
|
let $fn = definitionArgs.pop();
|
345
|
-
up.compiler(...definitionArgs, function (element, ...fnArgs) {
|
353
|
+
return up.compiler(...definitionArgs, function (element, ...fnArgs) {
|
346
354
|
let $element = jQuery(element);
|
347
355
|
return $fn($element, ...fnArgs);
|
348
356
|
});
|
349
357
|
};
|
350
|
-
up.$macro = function (
|
358
|
+
up.$macro = function (...definitionArgs) {
|
351
359
|
let $fn = definitionArgs.pop();
|
352
|
-
up.macro(...definitionArgs, function (element, ...fnArgs) {
|
360
|
+
return up.macro(...definitionArgs, function (element, ...fnArgs) {
|
353
361
|
let $element = jQuery(element);
|
354
362
|
return $fn($element, ...fnArgs);
|
355
363
|
});
|
@@ -482,9 +490,8 @@ up.migrate.postprocessReloadOptions = function (options) {
|
|
482
490
|
}
|
483
491
|
options.headers[up.protocol.headerize('reloadFromTime')] = legacyHeader;
|
484
492
|
};
|
485
|
-
const ATTR_SELECTOR_PATTERN = /\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;
|
486
493
|
up.migrate.resolveOrigin = function (target, { origin } = {}) {
|
487
|
-
let pattern =
|
494
|
+
let pattern = /"[^"]*"|'[^']*'|&|:origin\b/g;
|
488
495
|
return target.replace(pattern, function (variant) {
|
489
496
|
if (variant === ':origin' || variant === '&') {
|
490
497
|
if (variant === '&') {
|
@@ -1 +1 @@
|
|
1
|
-
(()=>{var e={294:()=>{up.browser.loadPage=function(...e){return up.migrate.deprecated("up.browser.loadPage()","up.network.loadPage()"),up.network.loadPage(...e)},up.browser.isSupported=function(...e){return up.migrate.deprecated("up.browser.isSupported()","up.framework.isSupported()"),up.framework.isSupported(...e)}},700:()=>{up.element.first=function(...e){return up.migrate.deprecated("up.element.first()","up.element.get()"),up.element.get(...e)},up.element.createFromHtml=function(...e){return up.migrate.deprecated("up.element.createFromHtml()","up.element.createFromHTML()"),up.element.createFromHTML(...e)},up.element.remove=function(e){return up.migrate.deprecated("up.element.remove()","Element#remove()"),e.remove()},up.element.matches=function(e,t){return up.migrate.deprecated("up.element.matches()","Element#matches()"),e.matches(t)},up.element.closest=function(e,t){return up.migrate.deprecated("up.element.closest()","Element#closest()"),e.closest(t)},up.element.replace=function(e,t){return up.migrate.deprecated("up.element.replace()","Element#replaceWith()"),e.replaceWith(t)},up.element.all=function(...e){up.migrate.deprecated("up.element.all()","Document#querySelectorAll() or Element#querySelectorAll()");const t=e.pop();return(e[0]||document).querySelectorAll(t)},up.element.toggleClass=function(e,t,r){const a=e.classList;return null==r&&(r=!a.contains(t)),r?a.add(t):a.remove(t)},up.element.toSelector=function(...e){return up.migrate.deprecated("up.element.toSelector()","up.fragment.toTarget()"),up.fragment.toTarget(...e)},up.element.isAttached=function(e){return up.migrate.deprecated("up.element.isAttached()","element.isConnected"),e.isConnected},up.element.isDetached=function(e){return up.migrate.deprecated("up.element.isDetached()","!element.isConnected"),!e.isConnected}},394:()=>{up.migrate.renamedPackage("bus","event"),up.event.nobodyPrevents=function(...e){return up.migrate.deprecated("up.event.nobodyPrevents(type)","!up.emit(type).defaultPrevented"),!up.emit(...e).defaultPrevented},up.$on=function(...e){let t=e.pop();up.on(...e,(function(e,r,a){let p=jQuery(r);t.call(p,e,p,a)}))},up.$off=up.event.off},729:()=>{up.migrate.renamedPackage("navigation","feedback"),up.migrate.renamedProperty(up.feedback.config,"navs","navSelectors")},305:()=>{up.migrate.renamedProperty(up.form.config,"fields","fieldSelectors"),up.migrate.renamedProperty(up.form.config,"submitButtons","submitButtonSelectors"),up.migrate.renamedProperty(up.form.config,"validateTargets","groupSelectors"),up.migrate.renamedProperty(up.form.config,"observeDelay","watchInputDelay"),up.migrate.migratedFormGroupSelectors=function(){return up.form.config.groupSelectors.map((e=>{let t=e.replace(/:has\(:origin\)$/,"");return e!==t&&up.migrate.warn('Selectors in up.form.config.groupSelectors must not contain ":has(:origin)". The suffix is added automatically where required. Found in "%s".',e),t}))},up.migrate.renamedAttribute("up-observe","up-watch"),up.migrate.renamedAttribute("up-fieldset","up-form-group"),up.migrate.renamedAttribute("up-delay","up-watch-delay",{scope:"[up-autosubmit]"}),up.migrate.renamedAttribute("up-delay","up-watch-delay",{scope:"[up-watch]"}),up.migrate.renamedAttribute("up-restore-scroll","up-scroll",{mapValue:e=>"true"===e?"restore":"reset"}),up.observe=function(...e){if(up.migrate.deprecated("up.observe()","up.watch()"),up.util.isList(e[0])&&e[0].length>1){let t=e.shift();up.migrate.warn("Calling up.observe() with a list of multiple elements is no longer supported by up.watch()");let r=up.util.map(t,(t=>up.watch(t,...e)));return up.util.sequence(r)}return up.watch(...e)}},354:()=>{const e=up.util;up.migrate.renamedPackage("flow","fragment"),up.migrate.renamedPackage("dom","fragment"),up.migrate.renamedProperty(up.fragment.config,"fallbacks","mainTargets"),up.migrate.handleResponseDocOptions=e=>up.migrate.fixKey(e,"html","document"),up.replace=function(e,t,r){return up.migrate.deprecated("up.replace(target, url)","up.navigate(target, { url })"),up.navigate(Object.assign(Object.assign({},r),{target:e,url:t}))},up.extract=function(e,t,r){return up.migrate.deprecated("up.extract(target, document)","up.navigate(target, { document })"),up.navigate(Object.assign(Object.assign({},r),{target:e,document:t}))},up.fragment.first=function(...e){return up.migrate.deprecated("up.fragment.first()","up.fragment.get()"),up.fragment.get(...e)},up.first=up.fragment.first,up.migrate.preprocessRenderOptions=function(t){e.isString(t.history)&&"auto"!==t.history&&(up.migrate.warn("Passing a URL as { history } option is deprecated. Pass it as { location } instead."),t.location=t.history,t.history="auto");for(let r of["target","origin"])e.isJQuery(t[r])&&(up.migrate.warn("Passing a jQuery collection as { %s } is deprecated. Pass it as a native element instead.",r),t[r]=up.element.get(t[r]));"auto"===t.fail&&(up.migrate.warn("The option { fail: 'auto' } is deprecated. Omit the option instead."),delete t.fail);let r=e.pluckKey(t,"solo");e.isString(r)?(up.migrate.warn("The up.render() option { solo } has been replaced with { abort } and { abort } no longer accepts a URL pattern. Check if you can use { abort: 'target'} or use up.network.abort(pattern) instead."),t.abort=e=>up.network.abort(r,e)):e.isFunction(r)?(up.migrate.warn("The up.render() option { solo } has been replaced with { abort } and { abort } no longer accepts a Function(up.Request): boolean. Check if you can use { abort: 'target'} or use up.network.abort(fn) instead."),t.abort=e=>{up.network.abort(r,e)}):!0===r?(up.migrate.deprecated("Option { solo: true }","{ abort: 'all' }"),t.abort="all"):!1===r&&(up.migrate.deprecated("Option { solo: false }","{ abort: false }"),up.migrate.warn("Unpoly 3+ only aborts requests targeting the same fragment. Setting [up-solo=false] or { solo: false } may no longer be necessary."),t.abort=!1),up.migrate.fixKey(t,"keep","useKeep"),up.migrate.fixKey(t,"hungry","useHungry"),up.migrate.fixKey(t,"failOnFinished","onFailFinished"),e.isString(t.reveal)?(up.migrate.deprecated(`Option { reveal: '${t.reveal}' }`,`{ scroll: '${t.reveal}' }`),t.scroll=t.reveal):!0===t.reveal?(up.migrate.deprecated("Option { reveal: true }","{ scroll: 'target' }"),t.scroll="target"):!1===t.reveal&&(up.migrate.deprecated("Option { reveal: false }","{ scroll: false }"),t.scroll=!1),e.isDefined(t.resetScroll)&&(up.migrate.deprecated("Option { resetScroll: true }","{ scroll: 'reset' }"),t.scroll="teset"),e.isDefined(t.restoreScroll)&&(up.migrate.deprecated("Option { restoreScroll: true }","{ scroll: 'restore' }"),t.scroll="restore")},up.migrate.postprocessReloadOptions=function(e){var t;let r,a=null===(t=e.headers)||void 0===t?void 0:t["If-Modified-Since"];r=a?Math.floor(.001*new Date(a)).toString():"0",e.headers[up.protocol.headerize("reloadFromTime")]=r};const t=/\[([\w-]+)(?:([~|^$*]?=)(["'])?([^\3\]]*?)\3)?]/g;up.migrate.resolveOrigin=function(e,{origin:r}={}){let a=new RegExp(t.source+"|&|:origin\\b","g");return e.replace(a,(function(t){return":origin"!==t&&"&"!==t?t:("&"===t&&up.migrate.deprecated("Origin shorthand '&'",":origin"),r?up.fragment.toTarget(r):void up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',t,e))}))},up.migrate.removedEvent("up:fragment:kept","up:fragment:keep");let r=up.fragment.config.runScripts,a=!1;Object.defineProperty(up.fragment.config,"runScripts",{get:()=>r,set(e){r=e,a=!0}}),up.on("up:framework:boot",(function(){a||up.migrate.warn("Scripts within fragments are now executed. Configure up.fragment.config.runScripts to remove this warning.")})),up.compiler("[up-keep]",(function(t){let r=up.element.booleanOrStringAttr(t,"up-keep");e.isString(r)&&(up.migrate.warn('The [up-keep] attribute no longer supports a selector value. Elements will be matched by their derived target. You may prevent keeping with [up-on-keep="if(condition) event.preventDefault()"]. '),up.element.setMissingAttr(t,"up-on-keep",`if (!newFragment.matches(${JSON.stringify(r)})) event.preventDefault()`),t.setAttribute("up-keep",""))}))},234:()=>{up.migrate.renamedEvent("up:app:booted","up:framework:booted")},869:()=>{up.migrate.renamedProperty(up.history.config,"popTargets","restoreTargets"),up.history.url=function(){return up.migrate.deprecated("up.history.url()","up.history.location"),up.history.location},up.migrate.renamedEvent("up:history:push","up:location:changed"),up.migrate.renamedEvent("up:history:pushed","up:location:changed"),up.migrate.renamedEvent("up:history:restore","up:location:changed"),up.migrate.renamedEvent("up:history:restored","up:location:changed"),up.migrate.renamedEvent("up:history:replaced","up:location:changed")},905:()=>{up.migrate.handleLayerOptions=function(e){up.migrate.fixKey(e,"flavor","mode"),up.migrate.fixKey(e,"closable","dismissable"),up.migrate.fixKey(e,"closeLabel","dismissLabel");for(let t of["width","maxWidth","height"])e[t]&&up.migrate.warn(`Layer option { ${t} } has been removed. Use { size } or { class } instead.`);e.sticky&&up.migrate.warn("Layer option { sticky } has been removed. Give links an [up-peel=false] attribute to prevent layer dismissal on click."),e.template&&up.migrate.warn("Layer option { template } has been removed. Use { class } or modify the layer HTML on up:layer:open."),"page"===e.layer&&(up.migrate.warn("Option { layer: 'page' } has been renamed to { layer: 'root' }."),e.layer="root"),"modal"!==e.layer&&"popup"!==e.layer||(up.migrate.warn(`Option { layer: '${e.layer}' } has been removed. Did you mean { layer: 'overlay' }?`),e.layer="overlay")},up.migrate.handleTetherOptions=function(e){const[t,r]=e.position.split("-");r&&(up.migrate.warn("The position value %o is deprecated. Use %o instead.",e.position,{position:t,align:r}),e.position=t,e.align=r)},up.migrate.registerLayerCloser=e=>e.registerClickCloser("up-close",((t,r)=>{up.migrate.deprecated("[up-close]","[up-dismiss]"),e.dismiss(t,r)})),up.migrate.handleLayerConfig=e=>up.migrate.fixKey(e,"historyVisible","history"),up.util.getter(up.Layer.prototype,"historyVisible",(function(){return up.migrate.deprecated("up.Layer#historyVisible","up.Layer#history"),this.history}))},969:()=>{up.migrate.parseFollowOptions=function(e){e.string("flavor"),e.string("width"),e.string("height"),e.boolean("closable"),e.booleanOrString("solo"),e.booleanOrString("reveal"),e.boolean("resetScroll"),e.boolean("restoreScroll"),e.booleanOrString("historyVisible"),e.booleanOrString("clearCache")},up.migrate.targetMacro("up-dash",{"up-preload":"","up-instant":""},(()=>up.migrate.deprecated("a[up-dash]","up.link.config.instantSelectors and up.link.config.preloadSelectors"))),up.migrate.renamedAttribute("up-delay","up-preload-delay",{scope:up.link.preloadSelector})},992:()=>{const e=up.util;up.migrate=function(){const t=new up.Config((()=>({logLevel:"warn"}))),r={},a={};function p(e){let t=r[e];if(t)return o(`Event ${e} has been renamed to ${t}`),t;if(e in a){let t=`Event ${e} has been removed`,r=a[e];return r&&(t+=`. Use ${r} instead.`),o(t),e}return e}const u={};function o(r,...a){const p=e.sprintf(r,...a);u[p]||(u[p]=!0,up.log[t.logLevel]("unpoly-migrate",r,...a))}return up.on("up:framework:reset",(function(){t.reset()})),{deprecated:function(e,t){o(`${e} has been deprecated. Use ${t} instead.`)},renamedPackage:function(e,t){Object.defineProperty(up,e,{get:()=>(o(`up.${e} has been renamed to up.${t}`),up[t])})},renamedProperty:function(t,r,a,p){const u=e.memoize((()=>p?o(p):o("Property { %s } has been renamed to { %s } (found in %o)",r,a,t)));Object.defineProperty(t,r,{get(){return u(),this[a]},set(e){u(),this[a]=e}})},removedProperty:function(t,r,a){const p=e.memoize((()=>a?o(a):o("Property { %s } has been removed without replacement (found in %o)",r,t)));let u=t[r];Object.defineProperty(t,r,{get:()=>(p(),u),set(e){p(),u=e}})},forbiddenPropertyValue:function(e,t,r,a){let p=e[t];Object.defineProperty(e,t,{get:()=>p,set(e){if(e===r)throw new Error(a);p=e}})},renamedAttribute:function(e,t,{scope:r,mapValue:a}={}){let p=r||`[${e}]`;up.macro(p,{priority:-1e3},(function(r){if(r.hasAttribute(e)){o("Attribute [%s] has been renamed to [%s] (found in %o)",e,t,r);let p=r.getAttribute(e);a&&(p=a(p)),r.setAttribute(t,p),r.removeAttribute(e)}}))},formerlyAsync:function(e){const t=Promise.resolve(),r=t.then;return t.then=function(){return o(`${e} no longer returns a promise`),r.apply(this,arguments)},t},renamedEvent:function(e,t){r[e]=t},removedEvent:function(e,t=null){a[e]=t},fixEventTypes:function(t){return e.uniq(e.map(t,p))},fixKey:function(t,r,a){e.isDefined(t[r])&&(o("Property { %s } has been renamed to { %s } (found in %o)",r,a,t),e.renameKey(t,r,a))},warn:o,loaded:!0,config:t}}()},413:()=>{const e=new Error("up.modal.flavors has been removed without direct replacement. You may give new layers a { class } or modify layer elements on up:layer:open.");up.modal={visit:(e,t={})=>(up.migrate.deprecated("up.modal.visit(url)",'up.layer.open({ url, mode: "modal" })'),up.layer.open(Object.assign(Object.assign({},t),{url:e,mode:"modal"}))),follow:(e,t={})=>(up.migrate.deprecated("up.modal.follow(link)",'up.follow(link, { layer: "modal" })'),up.follow(e,Object.assign(Object.assign({},t),{layer:"modal"}))),extract:(e,t,r={})=>(up.migrate.deprecated("up.modal.extract(target, document)",'up.layer.open({ document, mode: "modal" })'),up.layer.open(Object.assign(Object.assign({},r),{target:e,html:t,layer:"modal"}))),close:(e={})=>(up.migrate.deprecated("up.modal.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")),url:()=>(up.migrate.deprecated("up.modal.url()","up.layer.location"),up.layer.location),coveredUrl(){var e;return up.migrate.deprecated("up.modal.coveredUrl()","up.layer.parent.location"),null===(e=up.layer.parent)||void 0===e?void 0:e.location},get config(){return up.migrate.deprecated("up.modal.config","up.layer.config.modal"),up.layer.config.modal},contains:e=>(up.migrate.deprecated("up.modal.contains()","up.layer.contains()"),up.layer.contains(e)),isOpen:()=>(up.migrate.deprecated("up.modal.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()),get flavors(){throw e},flavor(){throw e}},up.migrate.renamedEvent("up:modal:open","up:layer:open"),up.migrate.renamedEvent("up:modal:opened","up:layer:opened"),up.migrate.renamedEvent("up:modal:close","up:layer:dismiss"),up.migrate.renamedEvent("up:modal:closed","up:layer:dismissed"),up.migrate.targetMacro("up-modal",{"up-layer":"new modal"},(()=>up.migrate.deprecated("a[up-modal]",'a[up-layer="new modal"]'))),up.migrate.targetMacro("up-drawer",{"up-layer":"new drawer"},(()=>up.migrate.deprecated("a[up-drawer]",'a[up-layer="new drawer"]')))},885:()=>{const e=up.util;up.migrate.renamedPackage("proxy","network"),up.migrate.renamedEvent("up:proxy:load","up:request:load"),up.migrate.renamedEvent("up:proxy:received","up:request:loaded"),up.migrate.renamedEvent("up:proxy:loaded","up:request:loaded"),up.migrate.renamedEvent("up:proxy:fatal","up:request:offline"),up.migrate.renamedEvent("up:request:fatal","up:request:offline"),up.migrate.renamedEvent("up:proxy:aborted","up:request:aborted"),up.migrate.renamedEvent("up:proxy:slow","up:network:late"),up.migrate.renamedEvent("up:proxy:recover","up:network:recover"),up.migrate.renamedEvent("up:request:late","up:network:late"),up.migrate.renamedEvent("up:request:recover","up:network:recover");const t=()=>up.migrate.deprecated("up.proxy.config.preloadDelay","up.link.config.preloadDelay");Object.defineProperty(up.network.config,"preloadDelay",{get:()=>(t(),up.link.config.preloadDelay),set(e){t(),up.link.config.preloadDelay=e}}),up.migrate.renamedProperty(up.network.config,"maxRequests","concurrency"),up.migrate.renamedProperty(up.network.config,"slowDelay","badResponseTime"),up.migrate.renamedProperty(up.network.config,"cacheExpiry","cacheExpireAge",'The configuration up.network.config.cacheExpiry has been renamed to up.network.config.cacheExpireAge. Note that Unpoly 3+ automatically reloads cached content after rendering to ensure users always see fresh data ("cache revalidation"). Setting a custom expiry may no longer be necessary.'),up.migrate.renamedProperty(up.network.config,"clearCache","expireCache"),up.migrate.forbiddenPropertyValue(up.network.config,"cacheSize",0,"Disabling the cache with up.network.config.cacheSize = 0 is no longer supported. To disable automatic caching during navigation, set up.fragment.config.navigateOptions.cache = false instead."),up.network.config.requestMetaKeys=[],up.migrate.removedProperty(up.network.config,"requestMetaKeys","The configuration up.network.config.requestMetaKeys has been removed. Servers that optimize responses based on request headers should instead set a Vary response header."),up.migrate.handleRequestOptions=function(e){up.migrate.fixKey(e,"clearCache","expireCache"),e.solo&&up.migrate.warn("The option up.request({ solo }) has been removed. Use up.network.abort() or up.fragment.abort() instead.")},up.ajax=function(...e){return up.migrate.deprecated("up.ajax()","up.request()"),up.request(...e).then((e=>e.text))},up.network.clear=function(){up.migrate.deprecated("up.proxy.clear()","up.cache.expire()"),up.cache.expire()},up.Request.Cache.prototype.clear=function(...e){up.migrate.deprecated("up.cache.clear()","up.cache.expire()"),this.expire(...e)},up.network.preload=function(...e){return up.migrate.deprecated("up.proxy.preload(link)","up.link.preload(link)"),up.link.preload(...e)},up.migrate.preprocessAbortArgs=function(t){2===t.length&&e.isString(t[1])&&(up.migrate.warn("up.network.abort() no longer takes a reason as a second argument. Pass it as { reason } option instead."),t[1]={reason:t[1]})},up.network.isIdle=function(){return up.migrate.deprecated("up.network.isIdle()","!up.network.isBusy()"),!up.network.isBusy()},up.Request.prototype.navigate=function(){up.migrate.deprecated("up.Request#navigate()","up.Request#loadPage()"),this.loadPage()},up.migrate.renamedProperty(up.Request.prototype,"preload","background"),up.Response.prototype.isSuccess=function(){return up.migrate.deprecated("up.Response#isSuccess()","up.Response#ok"),this.ok},up.Response.prototype.getHeader=function(e){return up.migrate.deprecated("up.Response#getHeader()","up.Response#header()"),this.header(e)},up.Response.prototype.isError=function(){return up.migrate.deprecated("up.Response#isError()","!up.Response#ok"),!this.ok};const r=up.network.config.progressBar;function a(){up.network.config.progressBar=function(){return function(){const t=up.EventListener.allNonDefault(document);return e.find(t,(e=>"up:network:late"===e.eventType))}()?(up.migrate.warn("Disabled the default progress bar as may have built a custom loading indicator with your up:network:late listener. Please set up.network.config.progressBar to true or false."),!1):r}}a(),up.on("up:framework:reset",a)},69:()=>{up.popup={attach:(e,t={})=>(e=up.fragment.get(e),up.migrate.deprecated("up.popup.attach(origin)","up.layer.open({ origin, layer: 'popup' })"),up.layer.open(Object.assign(Object.assign({},t),{origin:e,layer:"popup"}))),close:(e={})=>(up.migrate.deprecated("up.popup.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")),url:()=>(up.migrate.deprecated("up.popup.url()","up.layer.location"),up.layer.location),coveredUrl(){var e;return up.migrate.deprecated("up.popup.coveredUrl()","up.layer.parent.location"),null===(e=up.layer.parent)||void 0===e?void 0:e.location},get config(){return up.migrate.deprecated("up.popup.config","up.layer.config.popup"),up.layer.config.popup},contains:e=>(up.migrate.deprecated("up.popup.contains()","up.layer.contains()"),up.layer.contains(e)),isOpen:()=>(up.migrate.deprecated("up.popup.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()),sync:()=>(up.migrate.deprecated("up.popup.sync()","up.layer.sync()"),up.layer.sync())},up.migrate.renamedEvent("up:popup:open","up:layer:open"),up.migrate.renamedEvent("up:popup:opened","up:layer:opened"),up.migrate.renamedEvent("up:popup:close","up:layer:dismiss"),up.migrate.renamedEvent("up:popup:closed","up:layer:dismissed"),up.migrate.targetMacro("up-popup",{"up-layer":"new popup"},(()=>up.migrate.deprecated("[up-popup]",'[up-layer="new popup"]')))},677:()=>{up.migrate.clearCacheFromXHR=function(e){let t=e.getResponseHeader("X-Up-Clear-Cache");if(t)return up.migrate.deprecated("X-Up-Clear-Cache","X-Up-Expire-Cache"),"false"!==t&&t},up.migrate.titleFromXHR=function(e){let t=e.getResponseHeader("X-Up-Title");if(t){if("false"===t)return!1;if('"'!==t[0])return up.migrate.warn("X-Up-Title must now be a JSON-encoded string"),t}}},228:()=>{up.migrate.renamedProperty(up.radio.config,"hungry","hungrySelectors")},629:()=>{const e=up.util,t=up.element;up.migrate.postCompile=function(t,r){let a;if(a=r.keep){up.migrate.warn("The { keep: true } option for up.compiler() has been removed. Have the compiler set [up-keep] attribute instead.");const r=e.isString(a)?a:"";for(let e of t)e.setAttribute("up-keep",r)}},up.migrate.targetMacro=function(r,a,p){up.macro(`[${r}]`,(function(u){let o;const n=e.copy(a);(o=u.getAttribute(r))?n["up-target"]=o:n["up-follow"]="",t.setMissingAttrs(u,n),u.removeAttribute(r),null==p||p()}))},up.$compiler=function(e,...t){let r=t.pop();up.compiler(...t,(function(e,...t){let a=jQuery(e);return r(a,...t)}))},up.$macro=function(e,...t){let r=t.pop();up.macro(...t,(function(e,...t){let a=jQuery(e);return r(a,...t)}))}},197:()=>{up.macro("[up-tooltip]",(function(e){up.migrate.warn("[up-tooltip] has been deprecated. A [title] was set instead."),up.element.setMissingAttr(e,"title",e.getAttribute("up-tooltip"))}))},480:()=>{up.util.only=function(e,...t){return up.migrate.deprecated("up.util.only(object, ...keys)","up.util.pick(object, keys)"),up.util.pick(e,t)},up.util.except=function(e,...t){return up.migrate.deprecated("up.util.except(object, ...keys)","up.util.omit(object, keys)"),up.util.omit(e,t)},up.util.parseUrl=function(...e){return up.migrate.deprecated("up.util.parseUrl()","up.util.parseURL()"),up.util.parseURL(...e)},up.util.any=function(...e){return up.migrate.deprecated("up.util.any()","up.util.some()"),up.util.some(...e)},up.util.all=function(...e){return up.migrate.deprecated("up.util.all()","up.util.every()"),up.util.every(...e)},up.util.detect=function(...e){return up.migrate.deprecated("up.util.detect()","up.util.find()"),up.util.find(...e)},up.util.select=function(...e){return up.migrate.deprecated("up.util.select()","up.util.filter()"),up.util.filter(...e)},up.util.setTimer=function(...e){return up.migrate.deprecated("up.util.setTimer()","up.util.timer()"),up.util.timer(...e)},up.util.escapeHtml=function(...e){return up.migrate.deprecated("up.util.escapeHtml()","up.util.escapeHTML()"),up.util.escapeHTML(...e)},up.util.selectorForElement=function(...e){return up.migrate.deprecated("up.util.selectorForElement()","up.fragment.toTarget()"),up.fragment.toTarget(...e)},up.util.nextFrame=function(...e){return up.migrate.deprecated("up.util.nextFrame()","up.util.task()"),up.util.task(...e)},up.util.times=function(e,t){up.migrate.deprecated("up.util.times()","a `for` loop");for(let r=0;r<e;r++)t()},up.util.assign=function(...e){return up.migrate.deprecated("up.util.assign()","Object.assign()"),Object.assign(...e)},up.util.values=function(...e){return up.migrate.deprecated("up.util.values()","Object.values()"),Object.values(...e)}},338:()=>{up.migrate.renamedPackage("layout","viewport"),up.migrate.renamedProperty(up.viewport.config,"viewports","viewportSelectors"),up.migrate.renamedProperty(up.viewport.config,"snap","revealSnap"),up.migrate.removedProperty(up.viewport.config,"scrollSpeed"),up.viewport.closest=function(...e){return up.migrate.deprecated("up.viewport.closest()","up.viewport.get()"),up.viewport.get(...e)},up.viewport.scroll=function(e,t,r={}){return(e=up.fragment.get(e,r)).scrollTo(Object.assign(Object.assign({},r),{top:t})),up.migrate.formerlyAsync("up.scroll()")},up.scroll=up.viewport.scroll}},t={};function r(a){var p=t[a];if(void 0!==p)return p.exports;var u=t[a]={exports:{}};return e[a](u,u.exports,r),u.exports}up.framework.startExtension(),r(992),r(480),r(294),r(700),r(394),r(629),r(305),r(354),r(234),r(869),r(729),r(969),r(905),r(413),r(69),r(197),r(677),r(885),r(228),r(338),up.framework.stopExtension()})();
|
1
|
+
(()=>{var e={294:()=>{up.browser.loadPage=function(...e){return up.migrate.deprecated("up.browser.loadPage()","up.network.loadPage()"),up.network.loadPage(...e)},up.browser.isSupported=function(...e){return up.migrate.deprecated("up.browser.isSupported()","up.framework.isSupported()"),up.framework.isSupported(...e)}},700:()=>{up.element.first=function(...e){return up.migrate.deprecated("up.element.first()","up.element.get()"),up.element.get(...e)},up.element.createFromHtml=function(...e){return up.migrate.deprecated("up.element.createFromHtml()","up.element.createFromHTML()"),up.element.createFromHTML(...e)},up.element.remove=function(e){return up.migrate.deprecated("up.element.remove()","Element#remove()"),e.remove()},up.element.matches=function(e,t){return up.migrate.deprecated("up.element.matches()","Element#matches()"),e.matches(t)},up.element.closest=function(e,t){return up.migrate.deprecated("up.element.closest()","Element#closest()"),e.closest(t)},up.element.replace=function(e,t){return up.migrate.deprecated("up.element.replace()","Element#replaceWith()"),e.replaceWith(t)},up.element.all=function(...e){up.migrate.deprecated("up.element.all()","Document#querySelectorAll() or Element#querySelectorAll()");const t=e.pop();return(e[0]||document).querySelectorAll(t)},up.element.toggleClass=function(e,t,r){const a=e.classList;return null==r&&(r=!a.contains(t)),r?a.add(t):a.remove(t)},up.element.toSelector=function(...e){return up.migrate.deprecated("up.element.toSelector()","up.fragment.toTarget()"),up.fragment.toTarget(...e)},up.element.isAttached=function(e){return up.migrate.deprecated("up.element.isAttached()","element.isConnected"),e.isConnected},up.element.isDetached=function(e){return up.migrate.deprecated("up.element.isDetached()","!element.isConnected"),!e.isConnected}},394:()=>{up.migrate.renamedPackage("bus","event"),up.event.nobodyPrevents=function(...e){return up.migrate.deprecated("up.event.nobodyPrevents(type)","!up.emit(type).defaultPrevented"),!up.emit(...e).defaultPrevented},up.$on=function(...e){let t=e.pop();return t.upNativeCallback=function(e,r,a){let p=jQuery(r);t.call(p,e,p,a)},up.on(...e,t.upNativeCallback)},up.$off=function(...e){let t=e.pop().upNativeCallback;return t||up.fail("The callback passed to up.$off() was never registered with up.$on()"),up.off(...e,t)}},729:()=>{up.migrate.renamedPackage("navigation","feedback"),up.migrate.renamedProperty(up.feedback.config,"navs","navSelectors")},305:()=>{up.migrate.renamedProperty(up.form.config,"fields","fieldSelectors"),up.migrate.renamedProperty(up.form.config,"submitButtons","submitButtonSelectors"),up.migrate.renamedProperty(up.form.config,"validateTargets","groupSelectors"),up.migrate.renamedProperty(up.form.config,"observeDelay","watchInputDelay"),up.migrate.migratedFormGroupSelectors=function(){return up.form.config.groupSelectors.map((e=>{let t=e.replace(/:has\(:origin\)$/,"");return e!==t&&up.migrate.warn('Selectors in up.form.config.groupSelectors must not contain ":has(:origin)". The suffix is added automatically where required. Found in "%s".',e),t}))},up.migrate.renamedAttribute("up-observe","up-watch"),up.migrate.renamedAttribute("up-fieldset","up-form-group"),up.migrate.renamedAttribute("up-delay","up-watch-delay",{scope:"[up-autosubmit]"}),up.migrate.renamedAttribute("up-delay","up-watch-delay",{scope:"[up-watch]"}),up.migrate.renamedAttribute("up-restore-scroll","up-scroll",{mapValue:e=>"true"===e?"restore":"reset"}),up.observe=function(...e){if(up.migrate.deprecated("up.observe()","up.watch()"),up.util.isList(e[0])&&e[0].length>1){let t=e.shift();up.migrate.warn("Calling up.observe() with a list of multiple elements is no longer supported by up.watch()");let r=up.util.map(t,(t=>up.watch(t,...e)));return up.util.sequence(r)}return up.watch(...e)}},354:()=>{const e=up.util;up.migrate.renamedPackage("flow","fragment"),up.migrate.renamedPackage("dom","fragment"),up.migrate.renamedProperty(up.fragment.config,"fallbacks","mainTargets"),up.migrate.handleResponseDocOptions=e=>up.migrate.fixKey(e,"html","document"),up.replace=function(e,t,r){return up.migrate.deprecated("up.replace(target, url)","up.navigate(target, { url })"),up.navigate(Object.assign(Object.assign({},r),{target:e,url:t}))},up.extract=function(e,t,r){return up.migrate.deprecated("up.extract(target, document)","up.navigate(target, { document })"),up.navigate(Object.assign(Object.assign({},r),{target:e,document:t}))},up.fragment.first=function(...e){return up.migrate.deprecated("up.fragment.first()","up.fragment.get()"),up.fragment.get(...e)},up.first=up.fragment.first,up.migrate.preprocessRenderOptions=function(t){e.isString(t.history)&&"auto"!==t.history&&(up.migrate.warn("Passing a URL as { history } option is deprecated. Pass it as { location } instead."),t.location=t.history,t.history="auto");for(let r of["target","origin"])e.isJQuery(t[r])&&(up.migrate.warn("Passing a jQuery collection as { %s } is deprecated. Pass it as a native element instead.",r),t[r]=up.element.get(t[r]));"auto"===t.fail&&(up.migrate.warn("The option { fail: 'auto' } is deprecated. Omit the option instead."),delete t.fail);let r=e.pluckKey(t,"solo");e.isString(r)?(up.migrate.warn("The up.render() option { solo } has been replaced with { abort } and { abort } no longer accepts a URL pattern. Check if you can use { abort: 'target'} or use up.network.abort(pattern) instead."),t.abort=e=>up.network.abort(r,e)):e.isFunction(r)?(up.migrate.warn("The up.render() option { solo } has been replaced with { abort } and { abort } no longer accepts a Function(up.Request): boolean. Check if you can use { abort: 'target'} or use up.network.abort(fn) instead."),t.abort=e=>{up.network.abort(r,e)}):!0===r?(up.migrate.deprecated("Option { solo: true }","{ abort: 'all' }"),t.abort="all"):!1===r&&(up.migrate.deprecated("Option { solo: false }","{ abort: false }"),up.migrate.warn("Unpoly 3+ only aborts requests targeting the same fragment. Setting [up-solo=false] or { solo: false } may no longer be necessary."),t.abort=!1),up.migrate.fixKey(t,"keep","useKeep"),up.migrate.fixKey(t,"hungry","useHungry"),up.migrate.fixKey(t,"failOnFinished","onFailFinished"),e.isString(t.reveal)?(up.migrate.deprecated(`Option { reveal: '${t.reveal}' }`,`{ scroll: '${t.reveal}' }`),t.scroll=t.reveal):!0===t.reveal?(up.migrate.deprecated("Option { reveal: true }","{ scroll: 'target' }"),t.scroll="target"):!1===t.reveal&&(up.migrate.deprecated("Option { reveal: false }","{ scroll: false }"),t.scroll=!1),e.isDefined(t.resetScroll)&&(up.migrate.deprecated("Option { resetScroll: true }","{ scroll: 'reset' }"),t.scroll="teset"),e.isDefined(t.restoreScroll)&&(up.migrate.deprecated("Option { restoreScroll: true }","{ scroll: 'restore' }"),t.scroll="restore")},up.migrate.postprocessReloadOptions=function(e){var t;let r,a=null===(t=e.headers)||void 0===t?void 0:t["If-Modified-Since"];r=a?Math.floor(.001*new Date(a)).toString():"0",e.headers[up.protocol.headerize("reloadFromTime")]=r},up.migrate.resolveOrigin=function(e,{origin:t}={}){return e.replace(/"[^"]*"|'[^']*'|&|:origin\b/g,(function(r){return":origin"!==r&&"&"!==r?r:("&"===r&&up.migrate.deprecated("Origin shorthand '&'",":origin"),t?up.fragment.toTarget(t):void up.fail('Missing { origin } element to resolve "%s" reference (found in %s)',r,e))}))},up.migrate.removedEvent("up:fragment:kept","up:fragment:keep");let t=up.fragment.config.runScripts,r=!1;Object.defineProperty(up.fragment.config,"runScripts",{get:()=>t,set(e){t=e,r=!0}}),up.on("up:framework:boot",(function(){r||up.migrate.warn("Scripts within fragments are now executed. Configure up.fragment.config.runScripts to remove this warning.")})),up.compiler("[up-keep]",(function(t){let r=up.element.booleanOrStringAttr(t,"up-keep");e.isString(r)&&(up.migrate.warn('The [up-keep] attribute no longer supports a selector value. Elements will be matched by their derived target. You may prevent keeping with [up-on-keep="if(condition) event.preventDefault()"]. '),up.element.setMissingAttr(t,"up-on-keep",`if (!newFragment.matches(${JSON.stringify(r)})) event.preventDefault()`),t.setAttribute("up-keep",""))}))},234:()=>{up.migrate.renamedEvent("up:app:booted","up:framework:booted")},869:()=>{up.migrate.renamedProperty(up.history.config,"popTargets","restoreTargets"),up.history.url=function(){return up.migrate.deprecated("up.history.url()","up.history.location"),up.history.location},up.migrate.renamedEvent("up:history:push","up:location:changed"),up.migrate.renamedEvent("up:history:pushed","up:location:changed"),up.migrate.renamedEvent("up:history:restore","up:location:changed"),up.migrate.renamedEvent("up:history:restored","up:location:changed"),up.migrate.renamedEvent("up:history:replaced","up:location:changed")},905:()=>{up.migrate.handleLayerOptions=function(e){up.migrate.fixKey(e,"flavor","mode"),up.migrate.fixKey(e,"closable","dismissable"),up.migrate.fixKey(e,"closeLabel","dismissLabel");for(let t of["width","maxWidth","height"])e[t]&&up.migrate.warn(`Layer option { ${t} } has been removed. Use { size } or { class } instead.`);e.sticky&&up.migrate.warn("Layer option { sticky } has been removed. Give links an [up-peel=false] attribute to prevent layer dismissal on click."),e.template&&up.migrate.warn("Layer option { template } has been removed. Use { class } or modify the layer HTML on up:layer:open."),"page"===e.layer&&(up.migrate.warn("Option { layer: 'page' } has been renamed to { layer: 'root' }."),e.layer="root"),"modal"!==e.layer&&"popup"!==e.layer||(up.migrate.warn(`Option { layer: '${e.layer}' } has been removed. Did you mean { layer: 'overlay' }?`),e.layer="overlay")},up.migrate.handleTetherOptions=function(e){const[t,r]=e.position.split("-");r&&(up.migrate.warn("The position value %o is deprecated. Use %o instead.",e.position,{position:t,align:r}),e.position=t,e.align=r)},up.migrate.registerLayerCloser=e=>e.registerClickCloser("up-close",((t,r)=>{up.migrate.deprecated("[up-close]","[up-dismiss]"),e.dismiss(t,r)})),up.migrate.handleLayerConfig=e=>up.migrate.fixKey(e,"historyVisible","history"),up.util.getter(up.Layer.prototype,"historyVisible",(function(){return up.migrate.deprecated("up.Layer#historyVisible","up.Layer#history"),this.history}))},969:()=>{up.migrate.parseFollowOptions=function(e){e.string("flavor"),e.string("width"),e.string("height"),e.boolean("closable"),e.booleanOrString("solo"),e.booleanOrString("reveal"),e.boolean("resetScroll"),e.boolean("restoreScroll"),e.booleanOrString("historyVisible"),e.booleanOrString("clearCache")},up.migrate.targetMacro("up-dash",{"up-preload":"","up-instant":""},(()=>up.migrate.deprecated("a[up-dash]","up.link.config.instantSelectors and up.link.config.preloadSelectors"))),up.migrate.renamedAttribute("up-delay","up-preload-delay",{scope:up.link.preloadSelector})},992:()=>{const e=up.util;up.migrate=function(){const t=new up.Config((()=>({logLevel:"warn"}))),r={},a={};function p(e){let t=r[e];if(t)return n(`Event ${e} has been renamed to ${t}`),t;if(e in a){let t=`Event ${e} has been removed`,r=a[e];return r&&(t+=`. Use ${r} instead.`),n(t),e}return e}const u={};function n(r,...a){const p=e.sprintf(r,...a);u[p]||(u[p]=!0,up.log[t.logLevel]("unpoly-migrate",r,...a))}return up.on("up:framework:reset",(function(){t.reset()})),{deprecated:function(e,t){n(`${e} has been deprecated. Use ${t} instead.`)},renamedPackage:function(e,t){Object.defineProperty(up,e,{get:()=>(n(`up.${e} has been renamed to up.${t}`),up[t])})},renamedProperty:function(t,r,a,p){const u=e.memoize((()=>p?n(p):n("Property { %s } has been renamed to { %s } (found in %o)",r,a,t)));Object.defineProperty(t,r,{get(){return u(),this[a]},set(e){u(),this[a]=e}})},removedProperty:function(t,r,a){const p=e.memoize((()=>a?n(a):n("Property { %s } has been removed without replacement (found in %o)",r,t)));let u=t[r];Object.defineProperty(t,r,{get:()=>(p(),u),set(e){p(),u=e}})},forbiddenPropertyValue:function(e,t,r,a){let p=e[t];Object.defineProperty(e,t,{get:()=>p,set(e){if(e===r)throw new Error(a);p=e}})},renamedAttribute:function(e,t,{scope:r,mapValue:a}={}){let p=r||`[${e}]`;up.macro(p,{priority:-1e3},(function(r){if(r.hasAttribute(e)){n("Attribute [%s] has been renamed to [%s] (found in %o)",e,t,r);let p=r.getAttribute(e);a&&(p=a(p)),r.setAttribute(t,p),r.removeAttribute(e)}}))},formerlyAsync:function(e){const t=Promise.resolve(),r=t.then;return t.then=function(){return n(`${e} no longer returns a promise`),r.apply(this,arguments)},t},renamedEvent:function(e,t){r[e]=t},removedEvent:function(e,t=null){a[e]=t},fixEventTypes:function(t){return e.uniq(e.map(t,p))},fixKey:function(t,r,a){e.isDefined(t[r])&&(n("Property { %s } has been renamed to { %s } (found in %o)",r,a,t),e.renameKey(t,r,a))},warn:n,loaded:!0,config:t}}()},413:()=>{const e=new Error("up.modal.flavors has been removed without direct replacement. You may give new layers a { class } or modify layer elements on up:layer:open.");up.modal={visit:(e,t={})=>(up.migrate.deprecated("up.modal.visit(url)",'up.layer.open({ url, mode: "modal" })'),up.layer.open(Object.assign(Object.assign({},t),{url:e,mode:"modal"}))),follow:(e,t={})=>(up.migrate.deprecated("up.modal.follow(link)",'up.follow(link, { layer: "modal" })'),up.follow(e,Object.assign(Object.assign({},t),{layer:"modal"}))),extract:(e,t,r={})=>(up.migrate.deprecated("up.modal.extract(target, document)",'up.layer.open({ document, mode: "modal" })'),up.layer.open(Object.assign(Object.assign({},r),{target:e,html:t,layer:"modal"}))),close:(e={})=>(up.migrate.deprecated("up.modal.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")),url:()=>(up.migrate.deprecated("up.modal.url()","up.layer.location"),up.layer.location),coveredUrl(){var e;return up.migrate.deprecated("up.modal.coveredUrl()","up.layer.parent.location"),null===(e=up.layer.parent)||void 0===e?void 0:e.location},get config(){return up.migrate.deprecated("up.modal.config","up.layer.config.modal"),up.layer.config.modal},contains:e=>(up.migrate.deprecated("up.modal.contains()","up.layer.contains()"),up.layer.contains(e)),isOpen:()=>(up.migrate.deprecated("up.modal.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()),get flavors(){throw e},flavor(){throw e}},up.migrate.renamedEvent("up:modal:open","up:layer:open"),up.migrate.renamedEvent("up:modal:opened","up:layer:opened"),up.migrate.renamedEvent("up:modal:close","up:layer:dismiss"),up.migrate.renamedEvent("up:modal:closed","up:layer:dismissed"),up.migrate.targetMacro("up-modal",{"up-layer":"new modal"},(()=>up.migrate.deprecated("a[up-modal]",'a[up-layer="new modal"]'))),up.migrate.targetMacro("up-drawer",{"up-layer":"new drawer"},(()=>up.migrate.deprecated("a[up-drawer]",'a[up-layer="new drawer"]')))},885:()=>{const e=up.util;up.migrate.renamedPackage("proxy","network"),up.migrate.renamedEvent("up:proxy:load","up:request:load"),up.migrate.renamedEvent("up:proxy:received","up:request:loaded"),up.migrate.renamedEvent("up:proxy:loaded","up:request:loaded"),up.migrate.renamedEvent("up:proxy:fatal","up:request:offline"),up.migrate.renamedEvent("up:request:fatal","up:request:offline"),up.migrate.renamedEvent("up:proxy:aborted","up:request:aborted"),up.migrate.renamedEvent("up:proxy:slow","up:network:late"),up.migrate.renamedEvent("up:proxy:recover","up:network:recover"),up.migrate.renamedEvent("up:request:late","up:network:late"),up.migrate.renamedEvent("up:request:recover","up:network:recover");const t=()=>up.migrate.deprecated("up.proxy.config.preloadDelay","up.link.config.preloadDelay");Object.defineProperty(up.network.config,"preloadDelay",{get:()=>(t(),up.link.config.preloadDelay),set(e){t(),up.link.config.preloadDelay=e}}),up.migrate.renamedProperty(up.network.config,"maxRequests","concurrency"),up.migrate.renamedProperty(up.network.config,"slowDelay","badResponseTime"),up.migrate.renamedProperty(up.network.config,"cacheExpiry","cacheExpireAge",'The configuration up.network.config.cacheExpiry has been renamed to up.network.config.cacheExpireAge. Note that Unpoly 3+ automatically reloads cached content after rendering to ensure users always see fresh data ("cache revalidation"). Setting a custom expiry may no longer be necessary.'),up.migrate.renamedProperty(up.network.config,"clearCache","expireCache"),up.migrate.forbiddenPropertyValue(up.network.config,"cacheSize",0,"Disabling the cache with up.network.config.cacheSize = 0 is no longer supported. To disable automatic caching during navigation, set up.fragment.config.navigateOptions.cache = false instead."),up.network.config.requestMetaKeys=[],up.migrate.removedProperty(up.network.config,"requestMetaKeys","The configuration up.network.config.requestMetaKeys has been removed. Servers that optimize responses based on request headers should instead set a Vary response header."),up.migrate.handleRequestOptions=function(e){up.migrate.fixKey(e,"clearCache","expireCache"),e.solo&&up.migrate.warn("The option up.request({ solo }) has been removed. Use up.network.abort() or up.fragment.abort() instead.")},up.ajax=function(...e){return up.migrate.deprecated("up.ajax()","up.request()"),up.request(...e).then((e=>e.text))},up.network.clear=function(){up.migrate.deprecated("up.proxy.clear()","up.cache.expire()"),up.cache.expire()},up.Request.Cache.prototype.clear=function(...e){up.migrate.deprecated("up.cache.clear()","up.cache.expire()"),this.expire(...e)},up.network.preload=function(...e){return up.migrate.deprecated("up.proxy.preload(link)","up.link.preload(link)"),up.link.preload(...e)},up.migrate.preprocessAbortArgs=function(t){2===t.length&&e.isString(t[1])&&(up.migrate.warn("up.network.abort() no longer takes a reason as a second argument. Pass it as { reason } option instead."),t[1]={reason:t[1]})},up.network.isIdle=function(){return up.migrate.deprecated("up.network.isIdle()","!up.network.isBusy()"),!up.network.isBusy()},up.Request.prototype.navigate=function(){up.migrate.deprecated("up.Request#navigate()","up.Request#loadPage()"),this.loadPage()},up.migrate.renamedProperty(up.Request.prototype,"preload","background"),up.Response.prototype.isSuccess=function(){return up.migrate.deprecated("up.Response#isSuccess()","up.Response#ok"),this.ok},up.Response.prototype.getHeader=function(e){return up.migrate.deprecated("up.Response#getHeader()","up.Response#header()"),this.header(e)},up.Response.prototype.isError=function(){return up.migrate.deprecated("up.Response#isError()","!up.Response#ok"),!this.ok};const r=up.network.config.progressBar;function a(){up.network.config.progressBar=function(){return function(){const t=up.EventListener.allNonDefault(document);return e.find(t,(e=>"up:network:late"===e.eventType))}()?(up.migrate.warn("Disabled the default progress bar as may have built a custom loading indicator with your up:network:late listener. Please set up.network.config.progressBar to true or false."),!1):r}}a(),up.on("up:framework:reset",a)},69:()=>{up.popup={attach:(e,t={})=>(e=up.fragment.get(e),up.migrate.deprecated("up.popup.attach(origin)","up.layer.open({ origin, layer: 'popup' })"),up.layer.open(Object.assign(Object.assign({},t),{origin:e,layer:"popup"}))),close:(e={})=>(up.migrate.deprecated("up.popup.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")),url:()=>(up.migrate.deprecated("up.popup.url()","up.layer.location"),up.layer.location),coveredUrl(){var e;return up.migrate.deprecated("up.popup.coveredUrl()","up.layer.parent.location"),null===(e=up.layer.parent)||void 0===e?void 0:e.location},get config(){return up.migrate.deprecated("up.popup.config","up.layer.config.popup"),up.layer.config.popup},contains:e=>(up.migrate.deprecated("up.popup.contains()","up.layer.contains()"),up.layer.contains(e)),isOpen:()=>(up.migrate.deprecated("up.popup.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()),sync:()=>(up.migrate.deprecated("up.popup.sync()","up.layer.sync()"),up.layer.sync())},up.migrate.renamedEvent("up:popup:open","up:layer:open"),up.migrate.renamedEvent("up:popup:opened","up:layer:opened"),up.migrate.renamedEvent("up:popup:close","up:layer:dismiss"),up.migrate.renamedEvent("up:popup:closed","up:layer:dismissed"),up.migrate.targetMacro("up-popup",{"up-layer":"new popup"},(()=>up.migrate.deprecated("[up-popup]",'[up-layer="new popup"]')))},677:()=>{up.migrate.clearCacheFromXHR=function(e){let t=e.getResponseHeader("X-Up-Clear-Cache");if(t)return up.migrate.deprecated("X-Up-Clear-Cache","X-Up-Expire-Cache"),"false"!==t&&t},up.migrate.titleFromXHR=function(e){let t=e.getResponseHeader("X-Up-Title");if(t){if("false"===t)return!1;if('"'!==t[0])return up.migrate.warn("X-Up-Title must now be a JSON-encoded string"),t}}},228:()=>{up.migrate.renamedProperty(up.radio.config,"hungry","hungrySelectors")},629:()=>{const e=up.util,t=up.element;up.migrate.postCompile=function(t,r){let a;if(a=r.keep){up.migrate.warn("The { keep: true } option for up.compiler() has been removed. Have the compiler set [up-keep] attribute instead.");const r=e.isString(a)?a:"";for(let e of t)e.setAttribute("up-keep",r)}},up.migrate.targetMacro=function(r,a,p){up.macro(`[${r}]`,(function(u){let n;const o=e.copy(a);(n=u.getAttribute(r))?o["up-target"]=n:o["up-follow"]="",t.setMissingAttrs(u,o),u.removeAttribute(r),null==p||p()}))},up.$compiler=function(...e){let t=e.pop();return up.compiler(...e,(function(e,...r){let a=jQuery(e);return t(a,...r)}))},up.$macro=function(...e){let t=e.pop();return up.macro(...e,(function(e,...r){let a=jQuery(e);return t(a,...r)}))}},197:()=>{up.macro("[up-tooltip]",(function(e){up.migrate.warn("[up-tooltip] has been deprecated. A [title] was set instead."),up.element.setMissingAttr(e,"title",e.getAttribute("up-tooltip"))}))},480:()=>{up.util.only=function(e,...t){return up.migrate.deprecated("up.util.only(object, ...keys)","up.util.pick(object, keys)"),up.util.pick(e,t)},up.util.except=function(e,...t){return up.migrate.deprecated("up.util.except(object, ...keys)","up.util.omit(object, keys)"),up.util.omit(e,t)},up.util.parseUrl=function(...e){return up.migrate.deprecated("up.util.parseUrl()","up.util.parseURL()"),up.util.parseURL(...e)},up.util.any=function(...e){return up.migrate.deprecated("up.util.any()","up.util.some()"),up.util.some(...e)},up.util.all=function(...e){return up.migrate.deprecated("up.util.all()","up.util.every()"),up.util.every(...e)},up.util.detect=function(...e){return up.migrate.deprecated("up.util.detect()","up.util.find()"),up.util.find(...e)},up.util.select=function(...e){return up.migrate.deprecated("up.util.select()","up.util.filter()"),up.util.filter(...e)},up.util.setTimer=function(...e){return up.migrate.deprecated("up.util.setTimer()","up.util.timer()"),up.util.timer(...e)},up.util.escapeHtml=function(...e){return up.migrate.deprecated("up.util.escapeHtml()","up.util.escapeHTML()"),up.util.escapeHTML(...e)},up.util.selectorForElement=function(...e){return up.migrate.deprecated("up.util.selectorForElement()","up.fragment.toTarget()"),up.fragment.toTarget(...e)},up.util.nextFrame=function(...e){return up.migrate.deprecated("up.util.nextFrame()","up.util.task()"),up.util.task(...e)},up.util.times=function(e,t){up.migrate.deprecated("up.util.times()","a `for` loop");for(let r=0;r<e;r++)t()},up.util.assign=function(...e){return up.migrate.deprecated("up.util.assign()","Object.assign()"),Object.assign(...e)},up.util.values=function(...e){return up.migrate.deprecated("up.util.values()","Object.values()"),Object.values(...e)}},338:()=>{up.migrate.renamedPackage("layout","viewport"),up.migrate.renamedProperty(up.viewport.config,"viewports","viewportSelectors"),up.migrate.renamedProperty(up.viewport.config,"snap","revealSnap"),up.migrate.removedProperty(up.viewport.config,"scrollSpeed"),up.viewport.closest=function(...e){return up.migrate.deprecated("up.viewport.closest()","up.viewport.get()"),up.viewport.get(...e)},up.viewport.scroll=function(e,t,r={}){return(e=up.fragment.get(e,r)).scrollTo(Object.assign(Object.assign({},r),{top:t})),up.migrate.formerlyAsync("up.scroll()")},up.scroll=up.viewport.scroll}},t={};function r(a){var p=t[a];if(void 0!==p)return p.exports;var u=t[a]={exports:{}};return e[a](u,u.exports,r),u.exports}up.framework.startExtension(),r(992),r(480),r(294),r(700),r(394),r(629),r(305),r(354),r(234),r(869),r(729),r(969),r(905),r(413),r(69),r(197),r(677),r(885),r(228),r(338),up.framework.stopExtension()})();
|
data/assets/unpoly/unpoly.es6.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
/***/ (() => {
|
6
6
|
|
7
7
|
window.up = {
|
8
|
-
version: '3.
|
8
|
+
version: '3.1.0'
|
9
9
|
};
|
10
10
|
|
11
11
|
|
@@ -2352,7 +2352,12 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
|
|
2352
2352
|
let cursorProps = up.viewport.copyCursorProps(viewport);
|
2353
2353
|
return () => up.viewport.copyCursorProps(cursorProps, viewport);
|
2354
2354
|
});
|
2355
|
-
document.body
|
2355
|
+
if (this.willChangeElement(document.body)) {
|
2356
|
+
keepPlan.newElement.replaceWith(keepable);
|
2357
|
+
}
|
2358
|
+
else {
|
2359
|
+
document.body.append(keepable);
|
2360
|
+
}
|
2356
2361
|
keepPlans.push(keepPlan);
|
2357
2362
|
}
|
2358
2363
|
}
|
@@ -2456,6 +2461,9 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
|
|
2456
2461
|
const oldFragments = u.map(this.steps, 'oldElement');
|
2457
2462
|
return u.some(oldFragments, up.fragment.hasAutoHistory);
|
2458
2463
|
}
|
2464
|
+
willChangeElement(element) {
|
2465
|
+
return u.some(this.steps, (step) => step.oldElement.contains(element));
|
2466
|
+
}
|
2459
2467
|
},
|
2460
2468
|
(() => {
|
2461
2469
|
u.memoizeMethod(_a.prototype, [
|
@@ -3574,16 +3582,19 @@ up.FormValidator = class FormValidator {
|
|
3574
3582
|
this.honorAbort();
|
3575
3583
|
}
|
3576
3584
|
honorAbort() {
|
3577
|
-
up.fragment.onAborted(this.form, ({ target }) =>
|
3578
|
-
|
3579
|
-
|
3585
|
+
up.fragment.onAborted(this.form, { around: true }, ({ target }) => this.unscheduleSolutionsWithin(target));
|
3586
|
+
}
|
3587
|
+
unscheduleSolutionsWithin(container) {
|
3588
|
+
this.dirtySolutions = u.reject(this.dirtySolutions, ({ element }) => container.contains(element));
|
3580
3589
|
}
|
3581
3590
|
resetNextRenderPromise() {
|
3582
3591
|
this.nextRenderPromise = u.newDeferred();
|
3583
3592
|
}
|
3584
3593
|
watchContainer(fieldOrForm) {
|
3585
3594
|
let { event } = this.originOptions(fieldOrForm);
|
3586
|
-
|
3595
|
+
let guard = () => up.fragment.isAlive(fieldOrForm);
|
3596
|
+
let callback = () => up.error.muteUncriticalRejection(this.validate({ origin: fieldOrForm }));
|
3597
|
+
up.on(fieldOrForm, event, { guard }, callback);
|
3587
3598
|
}
|
3588
3599
|
validate(options = {}) {
|
3589
3600
|
let solutions = this.getSolutions(options);
|
@@ -3620,13 +3631,19 @@ up.FormValidator = class FormValidator {
|
|
3620
3631
|
if (u.isString(target) && target) {
|
3621
3632
|
up.puts('up.validate()', 'Validating target "%s"', target);
|
3622
3633
|
let simpleSelectors = up.fragment.splitTarget(target);
|
3623
|
-
return simpleSelectors.map(function (simpleSelector) {
|
3624
|
-
|
3625
|
-
|
3626
|
-
|
3627
|
-
|
3628
|
-
|
3629
|
-
|
3634
|
+
return u.compact(simpleSelectors.map(function (simpleSelector) {
|
3635
|
+
let element = up.fragment.get(simpleSelector, { origin });
|
3636
|
+
if (element) {
|
3637
|
+
return {
|
3638
|
+
element,
|
3639
|
+
target: simpleSelector,
|
3640
|
+
origin
|
3641
|
+
};
|
3642
|
+
}
|
3643
|
+
else {
|
3644
|
+
up.fail('Validation target "%s" does not match an element', simpleSelector);
|
3645
|
+
}
|
3646
|
+
}));
|
3630
3647
|
}
|
3631
3648
|
}
|
3632
3649
|
getElementSolutions(element) {
|
@@ -3662,7 +3679,7 @@ up.FormValidator = class FormValidator {
|
|
3662
3679
|
doRenderDirtySolutions() {
|
3663
3680
|
var _a;
|
3664
3681
|
return __awaiter(this, void 0, void 0, function* () {
|
3665
|
-
this.dirtySolutions = u.filter(this.dirtySolutions, ({ element, origin }) => element
|
3682
|
+
this.dirtySolutions = u.filter(this.dirtySolutions, ({ element, origin }) => up.fragment.isAlive(element) && up.fragment.isAlive(origin));
|
3666
3683
|
if (!this.dirtySolutions.length || this.rendering) {
|
3667
3684
|
return;
|
3668
3685
|
}
|
@@ -4707,13 +4724,13 @@ up.Layer.OverlayWithViewport = (_a = class OverlayWithViewport extends up.Layer.
|
|
4707
4724
|
var _a;
|
4708
4725
|
const e = up.element;
|
4709
4726
|
up.Layer.Root = (_a = class Root extends up.Layer {
|
4727
|
+
get element() {
|
4728
|
+
return e.root;
|
4729
|
+
}
|
4710
4730
|
constructor(options) {
|
4711
4731
|
super(options);
|
4712
4732
|
this.setupHandlers();
|
4713
4733
|
}
|
4714
|
-
get element() {
|
4715
|
-
return e.root;
|
4716
|
-
}
|
4717
4734
|
getFirstSwappableElement() {
|
4718
4735
|
return document.body;
|
4719
4736
|
}
|
@@ -5736,7 +5753,6 @@ up.RenderOptions = (function () {
|
|
5736
5753
|
saveFocus: true,
|
5737
5754
|
focus: 'keep',
|
5738
5755
|
abort: 'target',
|
5739
|
-
revalidate: 'auto',
|
5740
5756
|
failOptions: true,
|
5741
5757
|
};
|
5742
5758
|
const PRELOAD_OVERRIDES = {
|
@@ -5874,27 +5890,6 @@ up.RenderResult = class RenderResult extends up.Record {
|
|
5874
5890
|
var _a;
|
5875
5891
|
const u = up.util;
|
5876
5892
|
up.Request = (_a = class Request extends up.Record {
|
5877
|
-
constructor(options) {
|
5878
|
-
var _a;
|
5879
|
-
super(options);
|
5880
|
-
this.params = new up.Params(this.params);
|
5881
|
-
if (this.wrapMethod == null) {
|
5882
|
-
this.wrapMethod = up.network.config.wrapMethod;
|
5883
|
-
}
|
5884
|
-
this.normalize();
|
5885
|
-
if ((this.target || this.layer || this.origin) && !options.basic) {
|
5886
|
-
const layerLookupOptions = { origin: this.origin };
|
5887
|
-
this.layer = up.layer.get(this.layer, layerLookupOptions);
|
5888
|
-
this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
|
5889
|
-
this.context || (this.context = this.layer.context || {});
|
5890
|
-
this.failContext || (this.failContext = this.failLayer.context || {});
|
5891
|
-
this.mode || (this.mode = this.layer.mode);
|
5892
|
-
this.failMode || (this.failMode = this.failLayer.mode);
|
5893
|
-
}
|
5894
|
-
this.deferred = u.newDeferred();
|
5895
|
-
(_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
|
5896
|
-
this.addAutoHeaders();
|
5897
|
-
}
|
5898
5893
|
keys() {
|
5899
5894
|
return [
|
5900
5895
|
'method',
|
@@ -5937,6 +5932,27 @@ up.Request = (_a = class Request extends up.Record {
|
|
5937
5932
|
builtAt: new Date(),
|
5938
5933
|
};
|
5939
5934
|
}
|
5935
|
+
constructor(options) {
|
5936
|
+
var _a;
|
5937
|
+
super(options);
|
5938
|
+
this.params = new up.Params(this.params);
|
5939
|
+
if (this.wrapMethod == null) {
|
5940
|
+
this.wrapMethod = up.network.config.wrapMethod;
|
5941
|
+
}
|
5942
|
+
this.normalize();
|
5943
|
+
if ((this.target || this.layer || this.origin) && !options.basic) {
|
5944
|
+
const layerLookupOptions = { origin: this.origin };
|
5945
|
+
this.layer = up.layer.get(this.layer, layerLookupOptions);
|
5946
|
+
this.failLayer = up.layer.get(this.failLayer || this.layer, layerLookupOptions);
|
5947
|
+
this.context || (this.context = this.layer.context || {});
|
5948
|
+
this.failContext || (this.failContext = this.failLayer.context || {});
|
5949
|
+
this.mode || (this.mode = this.layer.mode);
|
5950
|
+
this.failMode || (this.failMode = this.failLayer.mode);
|
5951
|
+
}
|
5952
|
+
this.deferred = u.newDeferred();
|
5953
|
+
(_a = this.badResponseTime) !== null && _a !== void 0 ? _a : (this.badResponseTime = u.evalOption(up.network.config.badResponseTime, this));
|
5954
|
+
this.addAutoHeaders();
|
5955
|
+
}
|
5940
5956
|
get xhr() {
|
5941
5957
|
var _a;
|
5942
5958
|
return (_a = this._xhr) !== null && _a !== void 0 ? _a : (this._xhr = new XMLHttpRequest());
|
@@ -7816,12 +7832,13 @@ up.fragment = (function () {
|
|
7816
7832
|
verifyDerivedTarget: true,
|
7817
7833
|
navigateOptions: {
|
7818
7834
|
cache: 'auto',
|
7835
|
+
revalidate: 'auto',
|
7819
7836
|
feedback: true,
|
7820
7837
|
fallback: true,
|
7821
7838
|
focus: 'auto',
|
7822
7839
|
scroll: 'auto',
|
7823
7840
|
history: 'auto',
|
7824
|
-
peel: true
|
7841
|
+
peel: true,
|
7825
7842
|
},
|
7826
7843
|
matchAroundOrigin: true,
|
7827
7844
|
runScripts: true,
|
@@ -7889,10 +7906,12 @@ up.fragment = (function () {
|
|
7889
7906
|
const parent = options.parent || document;
|
7890
7907
|
return up.emit(parent, 'up:fragment:destroyed', { fragment, parent, log });
|
7891
7908
|
}
|
7892
|
-
function
|
7893
|
-
return
|
7909
|
+
function isNotDestroying(element) {
|
7910
|
+
return !element.closest('.up-destroying');
|
7911
|
+
}
|
7912
|
+
function isAlive(fragment) {
|
7913
|
+
return fragment.isConnected && isNotDestroying(fragment);
|
7894
7914
|
}
|
7895
|
-
const isNotDestroying = u.negate(isDestroying);
|
7896
7915
|
function getSmart(...args) {
|
7897
7916
|
const options = u.extractOptions(args);
|
7898
7917
|
const selector = args.pop();
|
@@ -8242,8 +8261,10 @@ up.fragment = (function () {
|
|
8242
8261
|
up.emit(element, 'up:fragment:aborted', { log: false });
|
8243
8262
|
}
|
8244
8263
|
}
|
8245
|
-
function onAborted(fragment,
|
8246
|
-
let
|
8264
|
+
function onAborted(fragment, ...args) {
|
8265
|
+
let callback = u.extractCallback(args);
|
8266
|
+
let options = u.extractOptions(args);
|
8267
|
+
let guard = (event) => event.target.contains(fragment) || (options.around && fragment.contains(event.target));
|
8247
8268
|
let unsubscribe = up.on('up:fragment:aborted', { guard }, callback);
|
8248
8269
|
up.destructor(fragment, unsubscribe);
|
8249
8270
|
return unsubscribe;
|
@@ -8291,6 +8312,7 @@ up.fragment = (function () {
|
|
8291
8312
|
onAborted,
|
8292
8313
|
splitTarget,
|
8293
8314
|
parseTargetSteps,
|
8315
|
+
isAlive,
|
8294
8316
|
};
|
8295
8317
|
})();
|
8296
8318
|
up.reload = up.fragment.reload;
|