aptechka 0.5.44 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Animation-6Na1MCtM.cjs +1 -0
- package/lib/Animation-CELiTw3n.js +132 -0
- package/lib/Composed-DmLYTh1b.js +35 -0
- package/lib/Composed-Dx2hs-va.cjs +1 -0
- package/lib/{Damped-P4MkCGoY.js → Damped-Mx_FNNVz.js} +2 -5
- package/lib/Damped-loFiBsBy.cjs +1 -0
- package/lib/{Derived-kPJs5JC5.js → Derived-DlCvc0xQ.js} +1 -1
- package/lib/{Derived-B-g8dYgh.cjs → Derived-a6MDQEPY.cjs} +1 -1
- package/lib/ElementConstructor-CAZ2ra8m.cjs +1 -0
- package/lib/ElementConstructor-OYlPJf2L.js +366 -0
- package/lib/Resource-D3TQormz.cjs +1 -0
- package/lib/Resource-DIcoALGo.js +64 -0
- package/lib/{SourceManager-Q-PB-Rkh.js → SourceManager-Bz329f90.js} +1 -1
- package/lib/{SourceManager-vSlsMKUE.cjs → SourceManager-kxr5eUyL.cjs} +1 -1
- package/lib/Store-6s0YXK4o.cjs +1 -0
- package/lib/{Store-BQXXikps.js → Store-BI2xxXOA.js} +42 -42
- package/lib/Tweened-B_mclQ61.cjs +1 -0
- package/lib/Tweened-NE8M9onF.js +48 -0
- package/lib/{Viewport-DMB0dO-s.cjs → Viewport-CJeKnL5V.cjs} +1 -1
- package/lib/{Viewport-CFFhFKqX.js → Viewport-D9IL7kUQ.js} +1 -1
- package/lib/_createStore-Cf1MyeHa.cjs +1 -0
- package/lib/_createStore-Ck9bHolX.js +12 -0
- package/lib/accordion/AccordionElement.d.ts +3 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +140 -104
- package/lib/animation/Animation.d.ts +10 -18
- package/lib/animation/Damped.d.ts +3 -5
- package/lib/animation/Tweened.d.ts +0 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +31 -31
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +3 -3
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.js +3 -3
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +3 -3
- package/lib/counter/index.d.ts +8 -0
- package/lib/{createStylesheet-DBCEbDjI.js → createStylesheet-CR_yi5tp.js} +1 -1
- package/lib/{createStylesheet-CqHU9_qv.cjs → createStylesheet-p23sZ7Ey.cjs} +1 -1
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -0
- package/lib/css-property/index.js +36 -32
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +114 -113
- package/lib/en3/core/En3Raycaster.d.ts +20 -0
- package/lib/en3/core/En3View.d.ts +1 -1
- package/lib/en3/core/en3.d.ts +5 -1
- package/lib/en3/helpers/En3Controls.d.ts +5 -0
- package/lib/en3/helpers/En3GridHelper.d.ts +8 -0
- package/lib/en3/helpers/En3Object3dManager.d.ts +12 -0
- package/lib/en3/helpers/En3OrbitControls.d.ts +8 -0
- package/lib/en3/helpers/En3TransformControls.d.ts +8 -0
- package/lib/en3/helpers/index.cjs +1 -0
- package/lib/en3/helpers/index.d.ts +2 -0
- package/lib/en3/helpers/index.js +1165 -0
- package/lib/en3/index.cjs +1 -213
- package/lib/en3/index.d.ts +1 -19
- package/lib/en3/index.js +4 -3305
- package/lib/en3/libs/index.d.ts +1 -0
- package/lib/en3/loaders/{en3GLTFLoader.d.ts → _En3GLTFLoader.d.ts} +2 -4
- package/lib/en3/loaders/_En3TextureLoader.d.ts +8 -0
- package/lib/en3/loaders/index.cjs +1 -0
- package/lib/en3/loaders/index.d.ts +3 -0
- package/lib/en3/loaders/index.js +1757 -0
- package/lib/en3/loaders/loaders.d.ts +13 -0
- package/lib/en3/misc/index.cjs +10 -0
- package/lib/en3/misc/index.d.ts +2 -0
- package/lib/en3/misc/index.js +115 -0
- package/lib/en3/objects/En3Clip.d.ts +1 -1
- package/lib/en3/objects/En3GLTF.d.ts +2 -1
- package/lib/en3/objects/En3ImageLike.d.ts +2 -1
- package/lib/en3/objects/En3SourceConsumer.d.ts +1 -1
- package/lib/en3/objects/fluid/index.d.ts +0 -3
- package/lib/en3/objects/index.d.ts +7 -0
- package/lib/en3/utils/index.cjs +1 -0
- package/lib/en3/utils/index.d.ts +5 -0
- package/lib/en3/utils/index.js +43 -0
- package/lib/en3-C4mzaF6q.cjs +8 -0
- package/lib/en3-hbkN1OPu.js +343 -0
- package/lib/globals-DMjysUXI.js +8 -0
- package/lib/globals-bYKki-b9.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{index-BN9X-l9M.js → index-BAH_fO2N.js} +3 -3
- package/lib/{index-BbgmbQ-5.cjs → index-D1LQUR-R.cjs} +1 -1
- package/lib/instantiate-D19Uvc31.js +125 -0
- package/lib/instantiate-Db5gGSYG.cjs +1 -0
- package/lib/jsx/ComponentElement.d.ts +18 -0
- package/lib/jsx/globals.d.ts +13 -0
- package/lib/jsx/h.d.ts +7 -0
- package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
- package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
- package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
- package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
- package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
- package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
- package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
- package/lib/jsx/hooks/onAnimationFrame.js +22 -0
- package/lib/jsx/hooks/onElementResize.cjs +1 -0
- package/lib/jsx/hooks/onElementResize.d.ts +5 -0
- package/lib/jsx/hooks/onElementResize.js +11 -0
- package/lib/jsx/hooks/onIntersection.cjs +1 -0
- package/lib/jsx/hooks/onIntersection.d.ts +5 -0
- package/lib/jsx/hooks/onIntersection.js +11 -0
- package/lib/jsx/hooks/onWindowResize.cjs +1 -0
- package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
- package/lib/jsx/hooks/onWindowResize.js +8 -0
- package/lib/jsx/hooks/store/createArrayStore.d.ts +3 -0
- package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedComponent.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedComponents.d.ts +3 -0
- package/lib/jsx/hooks/store/createResource.d.ts +3 -0
- package/lib/jsx/hooks/store/createStore.d.ts +3 -0
- package/lib/jsx/hooks/store/index.cjs +1 -0
- package/lib/jsx/hooks/store/index.d.ts +7 -0
- package/lib/jsx/hooks/store/index.js +49 -0
- package/lib/jsx/hooks/watchAttribute.cjs +1 -0
- package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
- package/lib/jsx/hooks/watchAttribute.js +17 -0
- package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
- package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
- package/lib/jsx/hooks/watchCSSProperty.js +17 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +13 -0
- package/lib/jsx/index.js +91 -0
- package/lib/jsx/instantiate.d.ts +5 -0
- package/lib/jsx/register.d.ts +1 -0
- package/lib/jsx/render.d.ts +6 -0
- package/lib/jsx/type.d.ts +188 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.d.ts +2 -0
- package/lib/ladder/index.js +84 -66
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +9 -0
- package/lib/layout-box/index.js +190 -164
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +7 -7
- package/lib/morph/Morph.d.ts +2 -2
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.d.ts +1 -1
- package/lib/morph/index.js +135 -143
- package/lib/notifier/index.d.ts +2 -2
- package/lib/notifier/index.js +3 -1
- package/lib/onConnect-DGP866cj.cjs +1 -0
- package/lib/onConnect-y5DrxJ9P.js +7 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +2 -2
- package/lib/polyfills-CM4SCDTt.cjs +1 -0
- package/lib/polyfills-X6KXuHg-.js +33 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +2 -2
- package/lib/router/Router.d.ts +11 -3
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +1 -1
- package/lib/router/index.js +185 -165
- package/lib/scroll/ScrollElement.d.ts +2 -19
- package/lib/scroll/ScrollSection.d.ts +23 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +81 -77
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/ArrayStore.d.ts +21 -0
- package/lib/store/Store.d.ts +1 -7
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +65 -139
- package/lib/tags-BqJKcIve.js +485 -0
- package/lib/tags-ld5jemJw.cjs +1 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +2 -2
- package/lib/tweaker/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerColorManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerFolderElement.d.ts +2 -0
- package/lib/tweaker/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerNumberManagerElement.d.ts +4 -8
- package/lib/tweaker/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerStoreManagerElement.d.ts +7 -7
- package/lib/tweaker/TweakerStringManagerElement.d.ts +3 -5
- package/lib/tweaker/index.cjs +3 -3
- package/lib/tweaker/index.js +535 -412
- package/lib/tweaker/tweakerManagerConstructors.d.ts +2 -2
- package/lib/tweaker/tweakerStorage.d.ts +8 -1
- package/lib/url-C3dWnJQg.cjs +1 -0
- package/lib/url-DMNfW7uN.js +22 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +39 -34
- package/lib/utils/number.d.ts +1 -0
- package/lib/utils/url.d.ts +9 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +107 -3
- package/lib/Animation-DDHjrbtL.cjs +0 -1
- package/lib/Animation-Dq_05jlR.js +0 -217
- package/lib/DRACOLoader-C2CFpMGS.cjs +0 -2
- package/lib/DRACOLoader-D2KY2dku.js +0 -241
- package/lib/Damped-l0mnlhar.cjs +0 -1
- package/lib/KTX2Loader-DdUl1XiY.cjs +0 -2
- package/lib/KTX2Loader-DqpAffDj.js +0 -536
- package/lib/Store-C-1ruEIm.cjs +0 -1
- package/lib/Tweened-CwDC2zl8.js +0 -51
- package/lib/Tweened-DIt9j9B-.cjs +0 -1
- package/lib/animation/AnimationLink.d.ts +0 -13
- package/lib/en3/loaders/en3TextureLoader.d.ts +0 -3
- package/lib/en3/test/En3HTML.d.ts +0 -10
- package/lib/polyfills-BA-CL_HF.js +0 -27
- package/lib/polyfills-DHs2SNbz.cjs +0 -1
- package/lib/store/CumulativeResource.d.ts +0 -13
- package/lib/tags-CMPg9ETZ.js +0 -848
- package/lib/tags-Djb6mb1o.cjs +0 -1
- package/lib/tweaker/TweakerRangeManagerElement.d.ts +0 -11
- /package/lib/en3/{loaders → core}/en3Cache.d.ts +0 -0
- /package/lib/{MeshoptDecoder-CMeN3oU0.cjs → en3/libs/index.cjs} +0 -0
- /package/lib/{MeshoptDecoder-6XfTpOG2.js → en3/libs/index.js} +0 -0
- /package/lib/en3/{test → misc}/En3ModifiedMaterial.d.ts +0 -0
- /package/lib/en3/{attachments → misc}/En3SourceManager.d.ts +0 -0
package/lib/router/Router.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { splitPath, ChangeHistoryAction } from '../utils';
|
|
1
2
|
import { Route, RouteModule } from './Route';
|
|
3
|
+
import { Link } from './Link';
|
|
2
4
|
|
|
3
5
|
export interface RouterPreprocessorEntry {
|
|
4
|
-
|
|
6
|
+
path: ReturnType<typeof splitPath>;
|
|
5
7
|
resolve: () => void;
|
|
6
8
|
reject: () => void;
|
|
7
9
|
}
|
|
@@ -14,7 +16,6 @@ export interface RouterAfterNavigationEntry {
|
|
|
14
16
|
pathname: string;
|
|
15
17
|
}
|
|
16
18
|
export type RouterAfterNavigationCallback = (entry: RouterAfterNavigationEntry) => void;
|
|
17
|
-
export type RouterHistoryAction = 'push' | 'replace' | 'none';
|
|
18
19
|
export interface RouterParameters {
|
|
19
20
|
rootElement?: HTMLElement;
|
|
20
21
|
base?: string;
|
|
@@ -28,7 +29,14 @@ export declare class Router {
|
|
|
28
29
|
get currentPathname(): string;
|
|
29
30
|
get candidatePathname(): string | undefined;
|
|
30
31
|
get routes(): Route[];
|
|
32
|
+
get links(): Link[];
|
|
31
33
|
navigationEvent(callback: RouterAfterNavigationCallback): () => void;
|
|
32
34
|
defineRoute(pattern: string, module: RouteModule): void;
|
|
33
|
-
navigate(
|
|
35
|
+
navigate(path: string, action?: ChangeHistoryAction): Promise<void>;
|
|
36
|
+
normalizePath(path: string): {
|
|
37
|
+
leaf: string;
|
|
38
|
+
pathname: string;
|
|
39
|
+
parameters: string;
|
|
40
|
+
hash: string;
|
|
41
|
+
};
|
|
34
42
|
}
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var tt=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var Y=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(Y(a,e,"read from private field"),s?s.call(a):e.get(a)),h=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(Y(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var F=(a,e,s)=>(Y(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,r)=>{var o=u=>{try{f(s.next(u))}catch(v){r(v)}},c=u=>{try{f(s.throw(u))}catch(v){r(v)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var G=(a,e,s)=>(e=a[tt("asyncIterator")])?e.call(a):(a=a[tt("iterator")](),e={},s=(i,r)=>(r=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=r.call(a,o),u=o.done,Promise.resolve(o.value).then(v=>c({value:v,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const rt=require("urlpattern-polyfill"),ot=require("../notifier/index.cjs"),st=require("../browser-CpzFX2xg.cjs"),ct=require("../function-MthRj-GJ.cjs"),J=require("../url-C3dWnJQg.cjs"),lt=require("../instantiate-Db5gGSYG.cjs"),et=require("../object-CCiXnER2.cjs");var R,O,A,p,d,w,S,L,b,E,x,it;class ut{constructor(e,s){h(this,x);h(this,R,void 0);h(this,O,void 0);h(this,A,void 0);h(this,p,void 0);h(this,d,void 0);h(this,w,void 0);h(this,S,void 0);h(this,L,null);h(this,b,[]);h(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,w,!1),n(this,S,null),st.isBrowser&&n(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,w)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,r;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),et.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield F(this,x,it).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:c,searchParams:f};et.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,lt.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,t(this,d).querySelector("[data-nest]")||((r=t(this,d).shadowRoot)==null?void 0:r.querySelector("[data-nest]"))||t(this,d).shadowRoot||t(this,d)),n(this,w,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,w,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,w=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,it=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=G(e),i,r,o;i=!(r=yield s.next()).done;i=!1){const c=r.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(r){o=[r]}finally{try{i&&(r=s.return)&&(yield r.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class dt{constructor(e,s){h(this,k,void 0);h(this,m,void 0);h(this,P,void 0);h(this,U,void 0);h(this,q,void 0);h(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),r=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?r.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===r.pathname||(c=t(this,q))!=null&&c.includes(r.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=rt.URLPattern;var C,N,g,z,T,y,H,B,I,D,nt,K;const W=class W{constructor(e){h(this,D);h(this,C,null);h(this,N,null);h(this,g,[]);h(this,z,null);h(this,T,[]);h(this,y,void 0);h(this,H,null);h(this,B,new ot.Notifier);h(this,I,ct.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));h(this,K,e=>{e.state&&this.navigate(e.state,"none")});st.isBrowser&&(e!=null&&e.base?n(this,N,J.normalizeBase(e.base)):n(this,N,"/"),W.active=this,n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,K)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ut(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Z,_;const i=this.normalizePath(e);let{pathname:r,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===r||t(this,H)===r)return;W.active=this,n(this,y,r);const u=t(this,g).filter(l=>l.isActive),v=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),at=u.filter(l=>!l.testPathname(f)),V=u.filter(l=>l.testPathname(f));let X=!0;if(this.preprocessor)try{yield new Promise((l,ht)=>{var $;($=this.preprocessor)==null||$.call(this,{path:i,resolve:l,reject:ht})})}catch(l){l?console.error(l):console.log("Route change canceled"),X=!1}if(X&&t(this,y)===r){n(this,z,V[V.length-1]),at.forEach(l=>{l.close()}),n(this,H,r);try{for(var pt=G(v),gt,Pt,vt;gt=!(Pt=yield pt.next()).done;gt=!1){const l=Pt.value;yield l.render(((Z=t(this,z))==null?void 0:Z.nest)||t(this,C),r),n(this,z,l)}}catch(Pt){vt=[Pt]}finally{try{gt&&(Pt=pt.return)&&(yield Pt.call(pt))}finally{if(vt)throw vt[0]}}J.changeHistory(s,r,c,o),F(this,D,nt).call(this),(_=this.postprocessor)==null||_.call(this,{pathname:r}),t(this,B).notify({pathname:r})}})}normalizePath(e){return J.splitPath(e,t(this,N))}};C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,D=new WeakSet,nt=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var r;return(r=i.getAttribute("href"))==null?void 0:r.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new dt(this,i)))},K=new WeakMap;let Q=W;exports.Router=Q;
|
package/lib/router/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Router, type RouterPreprocessorEntry, type RouterPreprocessor, type RouterPostprocessor, type RouterAfterNavigationCallback, type
|
|
1
|
+
export { Router, type RouterPreprocessorEntry, type RouterPreprocessor, type RouterPostprocessor, type RouterAfterNavigationCallback, type RouterParameters, } from './Router';
|
|
2
2
|
export { type RouteModule, type RouteParameters, type RouteURLParams, } from './Route';
|
package/lib/router/index.js
CHANGED
|
@@ -1,256 +1,276 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
if (!
|
|
1
|
+
var Z = (n, e) => (e = Symbol[n]) ? e : Symbol.for("Symbol." + n);
|
|
2
|
+
var Y = (n, e, s) => {
|
|
3
|
+
if (!e.has(n))
|
|
4
4
|
throw TypeError("Cannot " + s);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
if (
|
|
6
|
+
var t = (n, e, s) => (Y(n, e, "read from private field"), s ? s.call(n) : e.get(n)), h = (n, e, s) => {
|
|
7
|
+
if (e.has(n))
|
|
8
8
|
throw TypeError("Cannot add the same private member more than once");
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
9
|
+
e instanceof WeakSet ? e.add(n) : e.set(n, s);
|
|
10
|
+
}, a = (n, e, s, i) => (Y(n, e, "write to private field"), i ? i.call(n, s) : e.set(n, s), s);
|
|
11
|
+
var $ = (n, e, s) => (Y(n, e, "access private method"), s);
|
|
12
|
+
var I = (n, e, s) => new Promise((i, r) => {
|
|
13
|
+
var o = (u) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
f(s.next(u));
|
|
16
|
+
} catch (v) {
|
|
17
|
+
r(v);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, c = (u) => {
|
|
20
20
|
try {
|
|
21
|
-
|
|
22
|
-
} catch (
|
|
23
|
-
|
|
21
|
+
f(s.throw(u));
|
|
22
|
+
} catch (v) {
|
|
23
|
+
r(v);
|
|
24
24
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
25
|
+
}, f = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(o, c);
|
|
26
|
+
f((s = s.apply(n, e)).next());
|
|
27
27
|
});
|
|
28
|
-
var F = (n,
|
|
29
|
-
import { URLPattern as
|
|
30
|
-
import { Notifier as
|
|
31
|
-
import { i as
|
|
32
|
-
import { d as
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
28
|
+
var F = (n, e, s) => (e = n[Z("asyncIterator")]) ? e.call(n) : (n = n[Z("iterator")](), e = {}, s = (i, r) => (r = n[i]) && (e[i] = (o) => new Promise((c, f, u) => (o = r.call(n, o), u = o.done, Promise.resolve(o.value).then((v) => c({ value: v, done: u }), f)))), s("next"), s("return"), e);
|
|
29
|
+
import { URLPattern as ht } from "urlpattern-polyfill";
|
|
30
|
+
import { Notifier as rt } from "../notifier/index.js";
|
|
31
|
+
import { i as et } from "../browser-0zX67oeU.js";
|
|
32
|
+
import { d as ot } from "../function-C10DGppn.js";
|
|
33
|
+
import { n as ct, c as lt, s as ut } from "../url-DMNfW7uN.js";
|
|
34
|
+
import { i as mt } from "../instantiate-D19Uvc31.js";
|
|
35
|
+
import { i as _ } from "../object-D6MVWB4l.js";
|
|
36
|
+
var R, U, A, p, m, w, k, L, E, b, M, st;
|
|
37
|
+
class dt {
|
|
38
|
+
constructor(e, s) {
|
|
39
|
+
h(this, M);
|
|
40
|
+
h(this, R, void 0);
|
|
41
|
+
h(this, U, void 0);
|
|
42
|
+
h(this, A, void 0);
|
|
43
|
+
h(this, p, void 0);
|
|
44
|
+
h(this, m, void 0);
|
|
45
|
+
h(this, w, void 0);
|
|
46
|
+
h(this, k, void 0);
|
|
47
|
+
h(this, L, null);
|
|
48
|
+
h(this, E, []);
|
|
49
|
+
h(this, b, []);
|
|
50
|
+
a(this, R, e), a(this, U, s), a(this, A, new URLPattern({ pathname: t(this, R) })), a(this, p, null), a(this, m, null), a(this, w, !1), a(this, k, null), et && a(this, L, new MutationObserver((i) => {
|
|
51
|
+
i[0].addedNodes.forEach((o) => {
|
|
52
|
+
t(this, p) ? t(this, b).push(o) : t(this, E).push(o);
|
|
51
53
|
});
|
|
52
54
|
}));
|
|
53
55
|
}
|
|
54
56
|
get pattern() {
|
|
55
|
-
return
|
|
57
|
+
return t(this, R);
|
|
56
58
|
}
|
|
57
59
|
get urlPattern() {
|
|
58
|
-
return
|
|
60
|
+
return t(this, A);
|
|
59
61
|
}
|
|
60
62
|
get isActive() {
|
|
61
|
-
return
|
|
63
|
+
return t(this, w);
|
|
62
64
|
}
|
|
63
65
|
get element() {
|
|
64
|
-
return
|
|
66
|
+
return t(this, m);
|
|
65
67
|
}
|
|
66
68
|
get nest() {
|
|
67
|
-
return
|
|
69
|
+
return t(this, k);
|
|
68
70
|
}
|
|
69
|
-
testPathname(
|
|
70
|
-
return this.urlPattern.test({ pathname:
|
|
71
|
+
testPathname(e) {
|
|
72
|
+
return this.urlPattern.test({ pathname: e });
|
|
71
73
|
}
|
|
72
|
-
render(
|
|
73
|
-
return
|
|
74
|
-
var i,
|
|
75
|
-
if (
|
|
74
|
+
render(e, s) {
|
|
75
|
+
return I(this, null, function* () {
|
|
76
|
+
var i, r;
|
|
77
|
+
if (t(this, L).observe(document.head, {
|
|
76
78
|
childList: !0,
|
|
77
79
|
subtree: !0
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
document.head.appendChild(
|
|
80
|
+
}), t(this, p))
|
|
81
|
+
t(this, E).forEach((o) => {
|
|
82
|
+
document.head.appendChild(o);
|
|
81
83
|
});
|
|
82
84
|
else {
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
const
|
|
86
|
-
customElements.get(
|
|
85
|
+
const o = yield t(this, U).call(this);
|
|
86
|
+
if (a(this, b, [...t(this, E)]), typeof o.default == "function" && (a(this, p, o.default), _(o.default))) {
|
|
87
|
+
const c = "e-" + ((i = t(this, p)) == null ? void 0 : i.name.toLowerCase());
|
|
88
|
+
customElements.get(c) || customElements.define(c, o.default);
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
|
-
if (yield
|
|
90
|
-
const
|
|
91
|
+
if (yield $(this, M, st).call(this), t(this, p)) {
|
|
92
|
+
const o = t(this, A).exec({ pathname: s }), c = (o == null ? void 0 : o.pathname.groups) || {}, f = Object.fromEntries(
|
|
91
93
|
new URLSearchParams(location.search)
|
|
92
|
-
),
|
|
93
|
-
pathnameParams:
|
|
94
|
-
searchParams:
|
|
94
|
+
), u = {
|
|
95
|
+
pathnameParams: c,
|
|
96
|
+
searchParams: f
|
|
95
97
|
};
|
|
96
|
-
|
|
98
|
+
_(t(this, p)) ? a(this, m, new (t(this, p))(u)) : a(this, m, mt(t(this, p), {
|
|
99
|
+
attributes: u
|
|
100
|
+
})), e.appendChild(t(this, m)), a(this, k, t(this, m).querySelector("[data-nest]") || ((r = t(this, m).shadowRoot) == null ? void 0 : r.querySelector("[data-nest]")) || t(this, m).shadowRoot || t(this, m)), a(this, w, !0);
|
|
97
101
|
}
|
|
98
|
-
|
|
102
|
+
t(this, L).disconnect();
|
|
99
103
|
});
|
|
100
104
|
}
|
|
101
105
|
close() {
|
|
102
|
-
var
|
|
103
|
-
|
|
106
|
+
var e;
|
|
107
|
+
t(this, L).disconnect(), (e = t(this, m)) == null || e.remove(), a(this, w, !1), t(this, b).forEach((s) => document.head.removeChild(s)), a(this, b, []);
|
|
104
108
|
}
|
|
105
109
|
getAnchorElements() {
|
|
106
110
|
var s;
|
|
107
|
-
let
|
|
108
|
-
return
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
]),
|
|
111
|
+
let e = [];
|
|
112
|
+
return t(this, m) && (e = [...t(this, m).querySelectorAll("a")]), (s = t(this, m)) != null && s.shadowRoot && (e = [
|
|
113
|
+
...e,
|
|
114
|
+
...t(this, m).shadowRoot.querySelectorAll("a")
|
|
115
|
+
]), e;
|
|
112
116
|
}
|
|
113
117
|
}
|
|
114
|
-
R = new WeakMap(), U = new WeakMap(),
|
|
115
|
-
return
|
|
116
|
-
const
|
|
118
|
+
R = new WeakMap(), U = new WeakMap(), A = new WeakMap(), p = new WeakMap(), m = new WeakMap(), w = new WeakMap(), k = new WeakMap(), L = new WeakMap(), E = new WeakMap(), b = new WeakMap(), M = new WeakSet(), st = function() {
|
|
119
|
+
return I(this, null, function* () {
|
|
120
|
+
const e = t(this, E).filter((c) => c instanceof HTMLElement ? c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK" : !1);
|
|
117
121
|
try {
|
|
118
|
-
for (var s = F(
|
|
119
|
-
const
|
|
120
|
-
yield new Promise((
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
for (var s = F(e), i, r, o; i = !(r = yield s.next()).done; i = !1) {
|
|
123
|
+
const c = r.value;
|
|
124
|
+
yield new Promise((f) => {
|
|
125
|
+
c.onload = () => {
|
|
126
|
+
f();
|
|
123
127
|
};
|
|
124
128
|
});
|
|
125
129
|
}
|
|
126
|
-
} catch (
|
|
127
|
-
|
|
130
|
+
} catch (r) {
|
|
131
|
+
o = [r];
|
|
128
132
|
} finally {
|
|
129
133
|
try {
|
|
130
|
-
i && (
|
|
134
|
+
i && (r = s.return) && (yield r.call(s));
|
|
131
135
|
} finally {
|
|
132
|
-
if (
|
|
133
|
-
throw
|
|
136
|
+
if (o)
|
|
137
|
+
throw o[0];
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
140
|
});
|
|
137
141
|
};
|
|
138
|
-
var
|
|
139
|
-
class
|
|
140
|
-
constructor(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
var S, d, P, O, N, x;
|
|
143
|
+
class ft {
|
|
144
|
+
constructor(e, s) {
|
|
145
|
+
h(this, S, void 0);
|
|
146
|
+
h(this, d, void 0);
|
|
147
|
+
h(this, P, void 0);
|
|
148
|
+
h(this, O, void 0);
|
|
149
|
+
h(this, N, void 0);
|
|
150
|
+
h(this, x, (e) => {
|
|
151
|
+
e.preventDefault(), t(this, S).links.forEach((s) => {
|
|
152
|
+
var i;
|
|
153
|
+
t(this, P) === t(s, P) || (i = t(s, N)) != null && i.includes(t(this, P)) ? t(s, d).classList.add("clicked") : t(s, d).classList.remove("clicked");
|
|
154
|
+
}), t(this, S).navigate(t(this, P), t(this, O));
|
|
147
155
|
});
|
|
148
|
-
|
|
156
|
+
var o, c;
|
|
157
|
+
a(this, S, e), a(this, d, s), a(this, P, t(this, d).getAttribute("href") || "/"), a(this, O, t(this, d).getAttribute(
|
|
158
|
+
"data-history-action"
|
|
159
|
+
) || "push"), t(this, d).addEventListener("click", t(this, x));
|
|
160
|
+
const i = e.normalizePath(t(this, P)), r = e.normalizePath(location.pathname);
|
|
161
|
+
a(this, N, (o = t(this, d).getAttribute("data-match-paths")) == null ? void 0 : o.split(",").map((f) => e.normalizePath(f.trim()).pathname)), t(this, d).hasAttribute("data-include") ? r.pathname.includes(i.pathname) && t(this, d).classList.add("current") : i.pathname === r.pathname || (c = t(this, N)) != null && c.includes(r.pathname) ? (t(this, d).classList.add("current"), t(this, d).classList.add("clicked")) : t(this, d).classList.remove("clicked");
|
|
149
162
|
}
|
|
150
163
|
destroy() {
|
|
151
|
-
|
|
164
|
+
t(this, d).removeEventListener("click", t(this, x)), t(this, d).classList.remove("current");
|
|
152
165
|
}
|
|
153
166
|
}
|
|
154
|
-
|
|
155
|
-
globalThis.URLPattern =
|
|
156
|
-
var
|
|
157
|
-
const
|
|
158
|
-
constructor(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
167
|
+
S = new WeakMap(), d = new WeakMap(), P = new WeakMap(), O = new WeakMap(), N = new WeakMap(), x = new WeakMap();
|
|
168
|
+
globalThis.URLPattern = ht;
|
|
169
|
+
var C, z, g, q, H, y, T, B, j, D, it, K;
|
|
170
|
+
const W = class W {
|
|
171
|
+
constructor(e) {
|
|
172
|
+
h(this, D);
|
|
173
|
+
h(this, C, null);
|
|
174
|
+
h(this, z, null);
|
|
175
|
+
h(this, g, []);
|
|
176
|
+
h(this, q, null);
|
|
177
|
+
h(this, H, []);
|
|
178
|
+
h(this, y, void 0);
|
|
179
|
+
h(this, T, null);
|
|
180
|
+
h(this, B, new rt());
|
|
181
|
+
h(this, j, ot(() => {
|
|
182
|
+
const e = (s) => s.split("/").length;
|
|
183
|
+
a(this, g, t(this, g).sort((s, i) => e(s.pattern) - e(i.pattern))), this.navigate(location.pathname);
|
|
171
184
|
}, 0));
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
h(this, K, (e) => {
|
|
186
|
+
e.state && this.navigate(e.state, "none");
|
|
174
187
|
});
|
|
175
|
-
|
|
188
|
+
et && (e != null && e.base ? a(this, z, ct(e.base)) : a(this, z, "/"), W.active = this, a(this, C, (e == null ? void 0 : e.rootElement) || document.body), addEventListener("popstate", t(this, K)));
|
|
176
189
|
}
|
|
177
190
|
get currentPathname() {
|
|
178
|
-
return
|
|
191
|
+
return t(this, T);
|
|
179
192
|
}
|
|
180
193
|
get candidatePathname() {
|
|
181
|
-
return
|
|
194
|
+
return t(this, y);
|
|
182
195
|
}
|
|
183
196
|
get routes() {
|
|
184
|
-
return
|
|
197
|
+
return t(this, g);
|
|
185
198
|
}
|
|
186
|
-
|
|
187
|
-
return
|
|
199
|
+
get links() {
|
|
200
|
+
return t(this, H);
|
|
188
201
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
e(this, p).push(i), e(this, D).call(this);
|
|
202
|
+
navigationEvent(e) {
|
|
203
|
+
return t(this, B).subscribe(e);
|
|
192
204
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
defineRoute(e, s) {
|
|
206
|
+
const i = new dt(e, s);
|
|
207
|
+
t(this, g).push(i), t(this, j).call(this);
|
|
208
|
+
}
|
|
209
|
+
navigate(e, s = "push") {
|
|
210
|
+
return I(this, null, function* () {
|
|
211
|
+
var Q, V;
|
|
212
|
+
const i = this.normalizePath(e);
|
|
213
|
+
let { pathname: r, hash: o, parameters: c, leaf: f } = i;
|
|
214
|
+
if (t(this, y) === r || t(this, T) === r)
|
|
197
215
|
return;
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
(
|
|
201
|
-
),
|
|
202
|
-
let
|
|
216
|
+
W.active = this, a(this, y, r);
|
|
217
|
+
const u = t(this, g).filter((l) => l.isActive), v = t(this, g).filter(
|
|
218
|
+
(l) => !u.includes(l) && l.testPathname(f)
|
|
219
|
+
), at = u.filter((l) => !l.testPathname(f)), G = u.filter((l) => l.testPathname(f));
|
|
220
|
+
let J = !0;
|
|
203
221
|
if (this.preprocessor)
|
|
204
222
|
try {
|
|
205
|
-
yield new Promise((
|
|
206
|
-
var
|
|
207
|
-
(
|
|
223
|
+
yield new Promise((l, nt) => {
|
|
224
|
+
var X;
|
|
225
|
+
(X = this.preprocessor) == null || X.call(this, { path: i, resolve: l, reject: nt });
|
|
208
226
|
});
|
|
209
|
-
} catch (
|
|
210
|
-
|
|
227
|
+
} catch (l) {
|
|
228
|
+
l ? console.error(l) : console.log("Route change canceled"), J = !1;
|
|
211
229
|
}
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}),
|
|
230
|
+
if (J && t(this, y) === r) {
|
|
231
|
+
a(this, q, G[G.length - 1]), at.forEach((l) => {
|
|
232
|
+
l.close();
|
|
233
|
+
}), a(this, T, r);
|
|
216
234
|
try {
|
|
217
|
-
for (var
|
|
218
|
-
const
|
|
219
|
-
yield
|
|
235
|
+
for (var At = F(v), kt, St, Nt; kt = !(St = yield At.next()).done; kt = !1) {
|
|
236
|
+
const l = St.value;
|
|
237
|
+
yield l.render(((Q = t(this, q)) == null ? void 0 : Q.nest) || t(this, C), r), a(this, q, l);
|
|
220
238
|
}
|
|
221
|
-
} catch (
|
|
222
|
-
|
|
239
|
+
} catch (St) {
|
|
240
|
+
Nt = [St];
|
|
223
241
|
} finally {
|
|
224
242
|
try {
|
|
225
|
-
|
|
243
|
+
kt && (St = At.return) && (yield St.call(At));
|
|
226
244
|
} finally {
|
|
227
|
-
if (
|
|
228
|
-
throw
|
|
245
|
+
if (Nt)
|
|
246
|
+
throw Nt[0];
|
|
229
247
|
}
|
|
230
248
|
}
|
|
231
|
-
|
|
232
|
-
s === "push" ? history.pushState(c, "", c) : s === "replace" && history.replaceState(c, "", c), z(this, K, _).call(this), (G = this.postprocessor) == null || G.call(this, { pathname: t }), e(this, M).notify({ pathname: t });
|
|
249
|
+
lt(s, r, c, o), $(this, D, it).call(this), (V = this.postprocessor) == null || V.call(this, { pathname: r }), t(this, B).notify({ pathname: r });
|
|
233
250
|
}
|
|
234
251
|
});
|
|
235
252
|
}
|
|
253
|
+
normalizePath(e) {
|
|
254
|
+
return ut(e, t(this, z));
|
|
255
|
+
}
|
|
236
256
|
};
|
|
237
|
-
|
|
238
|
-
const
|
|
257
|
+
C = new WeakMap(), z = new WeakMap(), g = new WeakMap(), q = new WeakMap(), H = new WeakMap(), y = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), D = new WeakSet(), it = function() {
|
|
258
|
+
const e = t(this, g).filter((i) => i.isActive), s = Array.from(
|
|
239
259
|
new Set(
|
|
240
260
|
[
|
|
241
|
-
...
|
|
242
|
-
...
|
|
261
|
+
...t(this, C).querySelectorAll("a"),
|
|
262
|
+
...e.map((i) => i.getAnchorElements()).flat()
|
|
243
263
|
].filter((i) => {
|
|
244
|
-
var
|
|
245
|
-
return (
|
|
264
|
+
var r;
|
|
265
|
+
return (r = i.getAttribute("href")) == null ? void 0 : r.startsWith("/");
|
|
246
266
|
})
|
|
247
267
|
)
|
|
248
268
|
);
|
|
249
|
-
|
|
269
|
+
t(this, H).forEach((i) => {
|
|
250
270
|
i.destroy();
|
|
251
|
-
}),
|
|
252
|
-
},
|
|
253
|
-
let
|
|
271
|
+
}), a(this, H, s.map((i) => new ft(this, i)));
|
|
272
|
+
}, K = new WeakMap();
|
|
273
|
+
let tt = W;
|
|
254
274
|
export {
|
|
255
|
-
|
|
275
|
+
tt as Router
|
|
256
276
|
};
|
|
@@ -3,6 +3,7 @@ import { CustomElement } from '../custom-element';
|
|
|
3
3
|
import { Store } from '../store';
|
|
4
4
|
import { Axes2D, EasingFunction } from '../utils';
|
|
5
5
|
import { CSSProperty } from '../css-property';
|
|
6
|
+
import { ScrollSection } from './ScrollSection';
|
|
6
7
|
|
|
7
8
|
export type ScrollBehaviour = 'smooth' | 'instant';
|
|
8
9
|
export interface ScrollSetOptions {
|
|
@@ -12,22 +13,6 @@ export interface ScrollSetOptions {
|
|
|
12
13
|
duration: number;
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
export type SectionMark = 'current' | 'previous' | 'next' | null;
|
|
16
|
-
export type SectionmarkChangeEvent = CustomEvent<{
|
|
17
|
-
mark: SectionMark;
|
|
18
|
-
}>;
|
|
19
|
-
declare class Section {
|
|
20
|
-
#private;
|
|
21
|
-
constructor(element: HTMLElement, index: number, scrollElement: ScrollElement);
|
|
22
|
-
get index(): number;
|
|
23
|
-
get size(): number;
|
|
24
|
-
get position(): number;
|
|
25
|
-
destroy(): void;
|
|
26
|
-
setSize(value?: number): void;
|
|
27
|
-
resize(): void;
|
|
28
|
-
transform(): void;
|
|
29
|
-
mark(mark: SectionMark): void;
|
|
30
|
-
}
|
|
31
16
|
export declare class ScrollElement extends CustomElement {
|
|
32
17
|
#private;
|
|
33
18
|
constructor();
|
|
@@ -60,7 +45,7 @@ export declare class ScrollElement extends CustomElement {
|
|
|
60
45
|
get currentScrollValue(): number;
|
|
61
46
|
get targetScrollValue(): number;
|
|
62
47
|
get contentElement(): HTMLElement;
|
|
63
|
-
get sections():
|
|
48
|
+
get sections(): ScrollSection[];
|
|
64
49
|
get position(): number;
|
|
65
50
|
get contentPosition(): number;
|
|
66
51
|
get viewportSize(): number;
|
|
@@ -94,7 +79,5 @@ declare global {
|
|
|
94
79
|
}
|
|
95
80
|
interface HTMLElementEventMap {
|
|
96
81
|
sectionsChange: CustomEvent;
|
|
97
|
-
sectionMarkChange: SectionmarkChangeEvent;
|
|
98
82
|
}
|
|
99
83
|
}
|
|
100
|
-
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ScrollElement } from './ScrollElement';
|
|
2
|
+
|
|
3
|
+
export type ScrollSectionMark = 'current' | 'previous' | 'next' | null;
|
|
4
|
+
export type ScrollSectionMarkChangeEvent = CustomEvent<{
|
|
5
|
+
mark: ScrollSectionMark;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class ScrollSection {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(element: HTMLElement, index: number, scrollElement: ScrollElement);
|
|
10
|
+
get index(): number;
|
|
11
|
+
get size(): number;
|
|
12
|
+
get position(): number;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
setSize(value?: number): void;
|
|
15
|
+
resize(): void;
|
|
16
|
+
transform(): void;
|
|
17
|
+
mark(mark: ScrollSectionMark): void;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementEventMap {
|
|
21
|
+
sectionMarkChange: ScrollSectionMarkChangeEvent;
|
|
22
|
+
}
|
|
23
|
+
}
|