@aevantec/litevue 0.5.15 → 0.5.17

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.
Files changed (53) hide show
  1. package/README.md +2 -2
  2. package/dist/litevue-plugins.dev.iife.js +34 -30
  3. package/dist/litevue-plugins.dev.mjs +34 -30
  4. package/dist/litevue-plugins.iife.js +1 -1
  5. package/dist/litevue-plugins.mjs +1 -1
  6. package/dist/litevue-plugins.umd.js +1 -1
  7. package/dist/litevue.dev.iife.js +266 -241
  8. package/dist/litevue.dev.mjs +266 -241
  9. package/dist/litevue.iife.js +1 -1
  10. package/dist/litevue.mjs +1 -1
  11. package/dist/litevue.umd.js +1 -1
  12. package/dist/plugins/focus.iife.js +1 -1
  13. package/dist/plugins/focus.mjs +1 -1
  14. package/dist/plugins/focus.umd.js +1 -1
  15. package/dist/plugins/mask.iife.js +1 -1
  16. package/dist/plugins/mask.mjs +1 -1
  17. package/dist/plugins/mask.umd.js +1 -1
  18. package/dist/plugins/media.dev.iife.js +9 -7
  19. package/dist/plugins/media.dev.mjs +9 -7
  20. package/dist/plugins/media.iife.js +1 -1
  21. package/dist/plugins/media.mjs +1 -1
  22. package/dist/plugins/media.umd.js +1 -1
  23. package/dist/plugins/morph.dev.iife.js +9 -5
  24. package/dist/plugins/morph.dev.mjs +9 -5
  25. package/dist/plugins/morph.iife.js +1 -1
  26. package/dist/plugins/morph.mjs +1 -1
  27. package/dist/plugins/morph.umd.js +1 -1
  28. package/dist/plugins/navigate.dev.iife.js +36 -16
  29. package/dist/plugins/navigate.dev.mjs +36 -16
  30. package/dist/plugins/navigate.iife.js +1 -1
  31. package/dist/plugins/navigate.mjs +1 -1
  32. package/dist/plugins/navigate.umd.js +1 -1
  33. package/dist/plugins/persist.dev.iife.js +1 -2
  34. package/dist/plugins/persist.dev.mjs +1 -2
  35. package/dist/types/block.d.mts +2 -2
  36. package/dist/types/block.d.ts +2 -2
  37. package/dist/types/context.d.mts +7 -1
  38. package/dist/types/context.d.ts +7 -1
  39. package/dist/types/directives/bind.d.mts +1 -0
  40. package/dist/types/directives/bind.d.ts +1 -0
  41. package/dist/types/directives/on.d.mts +2 -0
  42. package/dist/types/directives/on.d.ts +2 -0
  43. package/dist/types/directives/show.d.mts +4 -1
  44. package/dist/types/directives/show.d.ts +4 -1
  45. package/dist/types/errors.d.mts +1 -1
  46. package/dist/types/errors.d.ts +1 -1
  47. package/dist/types/ownership.d.mts +2 -0
  48. package/dist/types/ownership.d.ts +2 -0
  49. package/dist/types/scheduler.d.mts +9 -1
  50. package/dist/types/scheduler.d.ts +9 -1
  51. package/dist/types/walk.d.mts +1 -0
  52. package/dist/types/walk.d.ts +1 -0
  53. package/package.json +2 -2
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueNavigate={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=["[v-scope]",...["visible","idle","interaction"].map(e=>`[v-scope\\.${e}]`)].join(","),r=e=>e.origin===location.origin,o=e=>e.pathname+e.search,n=e=>!!e.closest('[data-navigate="false"]'),a=e=>new URLSearchParams([...e].map(([e,t])=>[e,t.name??t])),i=(e,t,r=!1)=>document.dispatchEvent(new CustomEvent("navigate:"+e,{detail:t,cancelable:r})),s=e=>[...e.head.querySelectorAll("[data-navigate-track]")].map(e=>e.getAttribute("src")||e.getAttribute("href")).sort().join(),c=e=>{for(;e;e=e.parentElement)if(e.__ctx)return!0;return!1};e.navigate=(e,l={})=>{const u=l.target||"body";let d,h=o(location);const f=new WeakSet;let m,p,v=[];const y=e=>m?.href===e&&Date.now()-m.at<1e4,b=e=>{v.forEach(e=>e.removeAttribute("aria-busy")),(v=e).forEach(e=>e.setAttribute("aria-busy","true"))},g=history.scrollRestoration;history.scrollRestoration="manual";const w=document.createElement("div");w.id="litevue-navigate-status",w.setAttribute("aria-live","polite"),w.setAttribute("data-morph-preserve",""),w.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)",document.body.append(w);const E=(r,n,a,s,d,f)=>{if(s&&history[a.href===location.href?"replaceState":"pushState"]({},"",a.href),h=o(location),document.title=n.title,((e,r,o,n)=>{const a=[o,...o.querySelectorAll("*")].filter(e=>e.__ctx&&!c(e.parentElement)),i=[];r(o,n,{beforeNodeAdded:e=>{1===e.nodeType&&i.push(e)}}),a.forEach(t=>t.isConnected||e.unmount(t)),i.forEach(r=>r.isConnected&&!c(r)&&(r.matches(t)||r.querySelector(t))&&e.mount(r))})(e,e.scope.$morph,r,n.querySelector(u)),d(),!1!==l.scroll){const e=null==f&&a.hash&&document.getElementById(a.hash.slice(1));e?e.scrollIntoView():scrollTo(0,f||0)}const m=r.querySelector("[autofocus]");m?m.focus():r===document.body?document.activeElement?.blur?.():(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),w.textContent=document.title||document.querySelector("h1")?.textContent?.trim()||location.pathname,i("after",{url:a.href})},S=async(t,o={},n,a)=>{if(!i("before",{url:t},null==a))return;d?.abort();const c=d=new AbortController;b([document.documentElement,n].filter(Boolean));const h="POST"===o.method;null==a&&history.replaceState({...history.state,y:scrollY},"");try{if(!e.scope.$morph)throw new Error("navigate needs the morph plugin");const n=await(!o.method&&y(t)?m.res:fetch(t,{...o,signal:c.signal,headers:{"X-Requested-With":"litevue"}}));m=void 0;const i=new URL(n.url||t);if(i.hash||=new URL(t).hash,!n.headers.get("content-type")?.includes("text/html")||!r(i)||!n.ok&&!h)throw n.body?.cancel(),new Error(`cannot render ${n.status} from ${i.href}`);const f=await n.text();if(c!==d)return;const p=(new DOMParser).parseFromString(f,"text/html"),v=document.querySelector(u);if(!v||!p.querySelector(u))throw new Error(`no ${u} in ${i.href}`);if(s(p)!==s(document))throw new Error(`${i.href} loads different scripts or styles`);p.querySelectorAll("script").forEach(e=>e.remove());const b=await(async e=>{const t="link,style,meta",r=[...document.head.querySelectorAll(t)],o=[];for(const n of e.head.querySelectorAll(t)){const e=r.findIndex(e=>e.isEqualNode(n));if(e>-1){r.splice(e,1);continue}const t=document.importNode(n,!0);t.matches("link[rel=stylesheet]")&&o.push(new Promise(e=>{t.addEventListener("load",e),t.addEventListener("error",e)})),document.head.append(t)}return await Promise.all(o),()=>r.forEach(e=>e.matches("[data-navigate-preserve]")||e.remove())})(p),g=()=>c===d&&E(v,p,i,n.ok&&null==a,b,a);l.transition&&document.startViewTransition?document.startViewTransition(g):g()}catch(f){if(c.signal.aborted)return;i("error",{url:t,error:f}),h||location.assign(t)}finally{c===d&&b([])}},A=e=>{const t=e.target.closest?.("a[href]");if(!(t instanceof HTMLAnchorElement))return;if(n(t)||t.hasAttribute("download"))return;if(t.target&&"_self"!==t.target)return;const a=new URL(t.href,location.href);return!r(a)||a.hash&&o(a)===o(location)?void 0:a},L=e=>{if(e.defaultPrevented||e.button||e.metaKey||e.ctrlKey)return;if(e.shiftKey||e.altKey)return;const t=A(e);t&&(e.preventDefault(),S(t.href))},x=e=>{const t=A(e);t&&o(t)!==h&&!y(t.href)&&(m={href:t.href,at:Date.now(),res:fetch(t.href,{headers:{"X-Requested-With":"litevue","X-Sec-Purpose":"prefetch"}})},m.res.catch(()=>{}))},T=e=>{clearTimeout(p),p=setTimeout(x,100,e)},q=()=>clearTimeout(p),P=l.prefetch?[["pointerover",T],["focusin",T],["pointerout",q],["focusout",q],["pointerdown",x]]:[],R=e=>{const t=e.target,o=e.submitter,i=e=>o?.getAttribute("form"+e)||t.getAttribute(e),s=(i("method")||"get").toLowerCase(),c=i("target"),l=i("enctype");if(e.defaultPrevented||"dialog"===s||n(t))return;if("text/plain"===l)return;if(c&&"_self"!==c)return;const u=new URL(i("action")||location.href,location.href);if(!r(u))return;const d=new FormData(t);if(o?.name&&d.append(o.name,o.value),e.preventDefault(),"post"===s){if(f.has(t))return;return f.add(t),S(u.href,{method:"POST",body:"multipart/form-data"===l?d:a(d)},t).finally(()=>f.delete(t))}u.search=a(d).toString(),S(u.href,{},t)},k=e=>{o(location)!==h&&S(location.href,{},void 0,e.state?.y||0)};return document.addEventListener("click",L),document.addEventListener("submit",R),P.forEach(([e,t])=>document.addEventListener(e,t)),addEventListener("popstate",k),()=>{d?.abort(),clearTimeout(p),document.removeEventListener("click",L),document.removeEventListener("submit",R),P.forEach(([e,t])=>document.removeEventListener(e,t)),removeEventListener("popstate",k),history.scrollRestoration=g,b([]),w.remove()}}});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueNavigate={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=["[v-scope]",...["visible","idle","interaction"].map(e=>`[v-scope\\.${e}]`)].join(","),r=e=>e.origin===location.origin,o=e=>e.pathname+e.search,n=e=>!!e.closest('[data-navigate="false"]'),a=e=>new URLSearchParams([...e].map(([e,t])=>[e,t.name??t])),i=()=>history.replaceState({...history.state,y:scrollY},""),s=(e,t,r=!1)=>document.dispatchEvent(new CustomEvent("navigate:"+e,{detail:t,cancelable:r})),c=e=>[...e.head.querySelectorAll("[data-navigate-track]")].map(e=>e.getAttribute("src")||e.getAttribute("href")).sort().join(),l=e=>{for(;e;e=e.parentElement)if(e.__ctx)return!0;return!1};e.navigate=(e,u={})=>{const d=u.target||"body";let f,h=o(location);const m=new WeakSet;let p,v,y,b=[];const g=e=>p?.href===e&&Date.now()-p.at<1e4,w=e=>{b.forEach(e=>e.removeAttribute("aria-busy")),(b=e).forEach(e=>e.setAttribute("aria-busy","true"))},E=history.scrollRestoration;history.scrollRestoration="manual";const S=document.createElement("div");S.id="litevue-navigate-status",S.setAttribute("aria-live","polite"),S.setAttribute("data-morph-preserve",""),S.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)",document.body.append(S);const A=(r,n,a,i,c,f)=>{if(i&&history[a.href===location.href?"replaceState":"pushState"]({},"",a.href),h=o(location),document.title=n.title,((e,r,o,n)=>{const a=[o,...o.querySelectorAll("*")].filter(e=>e.__ctx&&!l(e.parentElement)),i=[];r(o,n,{beforeNodeAdded:e=>{1===e.nodeType&&i.push(e)}}),a.forEach(t=>t.isConnected||e.unmount(t)),i.forEach(r=>r.isConnected&&!l(r)&&(r.matches(t)||r.querySelector(t))&&e.mount(r))})(e,e.scope.$morph,r,n.querySelector(d)),c(),!1!==u.scroll){const e=null==f&&a.hash&&document.getElementById(a.hash.slice(1));e?e.scrollIntoView():scrollTo(0,f||0)}const m=r.querySelector("[autofocus]");m?m.focus():r===document.body?document.activeElement?.blur?.():(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0})),S.textContent=document.title||document.querySelector("h1")?.textContent?.trim()||location.pathname,s("after",{url:a.href})},L=async(t,o={},n,a)=>{if(!s("before",{url:t},null==a))return;const l=!o.method&&g(t)?p:p?.c.abort();p=void 0,f?.abort();const h=f=l?l.c:new AbortController;w([document.documentElement,n].filter(Boolean));const m="POST"===o.method;let v;null==a&&i();try{if(!e.scope.$morph)throw new Error("navigate needs the morph plugin");v=await(l?l.res:fetch(t,{...o,signal:h.signal,headers:{"X-Requested-With":"litevue"}}));const n=new URL(v.url||t);if(n.hash||=new URL(t).hash,!v.headers.get("content-type")?.includes("text/html")||!r(n)||!v.ok&&!m)throw v.body?.cancel(),new Error(`cannot render ${v.status} from ${n.href}`);const i=await v.text();if(h!==f)return;const s=(new DOMParser).parseFromString(i,"text/html"),p=document.querySelector(d);if(!p||!s.querySelector(d))throw new Error(`no ${d} in ${n.href}`);if(c(s)!==c(document))throw new Error(`${n.href} loads different scripts or styles`);s.querySelectorAll("script").forEach(e=>e.remove());const y=await(async e=>{const t="link,style,meta",r=[...document.head.querySelectorAll(t)],o=[];for(const n of e.head.querySelectorAll(t)){const e=r.findIndex(e=>e.isEqualNode(n));if(e>-1){r.splice(e,1);continue}const t=document.importNode(n,!0);t.matches("link[rel=stylesheet]")&&o.push(new Promise(e=>{t.addEventListener("load",e),t.addEventListener("error",e)})),document.head.append(t)}return await Promise.all(o),()=>r.forEach(e=>e.matches("[data-navigate-preserve]")||e.remove())})(s),b=v.ok&&null==a,g=()=>h===f&&A(p,s,n,b,y,a);u.transition&&document.startViewTransition?document.startViewTransition(g):g()}catch(y){if(h.signal.aborted)return;s("error",{url:t,error:y}),m?v?.redirected&&location.assign(v.url):location.assign(t)}finally{h===f&&w([])}},T=e=>{const t=e.target.closest?.("a[href]");if(!(t instanceof HTMLAnchorElement))return;if(n(t)||t.hasAttribute("download"))return;if(t.target&&"_self"!==t.target)return;const a=new URL(t.href,location.href);return!r(a)||a.href.includes("#")&&o(a)===o(location)?void 0:a},x=e=>{if(e.defaultPrevented||e.button||e.metaKey||e.ctrlKey)return;if(e.shiftKey||e.altKey)return;const t=T(e);t&&(e.preventDefault(),L(t.href))},q=e=>{const t=T(e);if(!t||o(t)===h||g(t.href))return;p?.c.abort();const r=new AbortController;p={href:t.href,at:Date.now(),c:r,res:fetch(t.href,{signal:r.signal,headers:{"X-Requested-With":"litevue","X-Sec-Purpose":"prefetch"}})},p.res.catch(()=>{})},P=e=>{clearTimeout(v),v=setTimeout(q,100,e)},R=()=>clearTimeout(v),k=u.prefetch?[["pointerover",P],["focusin",P],["pointerout",R],["focusout",R],["pointerdown",q]]:[],C=e=>{const t=e.target,o=e.submitter,i=e=>o?.getAttribute("form"+e)||t.getAttribute(e),s=(i("method")||"get").toLowerCase(),c=i("target"),l=i("enctype");if(e.defaultPrevented||"dialog"===s||n(t))return;if("text/plain"===l)return;if(c&&"_self"!==c)return;const u=new URL(i("action")||location.href,location.href);if(!r(u))return;const d=new FormData(t);if(o?.name&&d.append(o.name,o.value),e.preventDefault(),"post"===s){if(m.has(t))return;return m.add(t),L(u.href,{method:"POST",body:"multipart/form-data"===l?d:a(d)},t).finally(()=>m.delete(t))}u.search=a(d).toString(),L(u.href,{},t)},$=()=>{clearTimeout(y),y=setTimeout(i,150)},D=e=>{clearTimeout(y),o(location)!==h&&L(location.href,{},void 0,e.state?.y||0)};return document.addEventListener("click",x),document.addEventListener("submit",C),k.forEach(([e,t])=>document.addEventListener(e,t)),addEventListener("popstate",D),addEventListener("scroll",$),()=>{clearTimeout(y),removeEventListener("scroll",$),f?.abort(),p?.c.abort(),clearTimeout(v),document.removeEventListener("click",x),document.removeEventListener("submit",C),k.forEach(([e,t])=>document.removeEventListener(e,t)),removeEventListener("popstate",D),history.scrollRestoration=E,w([]),S.remove()}}});
@@ -1,6 +1,6 @@
1
1
  var LiteVuePersist = (function(exports, _aevantec_litevue) {
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- //#region src/plugins/persist/index.ts
3
+ // src/plugins/persist/index.ts
4
4
  var PREFIX = "litevue:";
5
5
  /** Custom storages registered by name, usable as a directive modifier. */
6
6
  var registry = Object.create(null);
@@ -117,7 +117,6 @@ var LiteVuePersist = (function(exports, _aevantec_litevue) {
117
117
  if (!storage) console.error(`persistStore("${name}") — storage "${String(options.storage)}" is not available.`);
118
118
  return sync(target, PREFIX + (options.key ?? name), options.keys, storage, _aevantec_litevue.watchEffect);
119
119
  };
120
- //#endregion
121
120
  exports.persist = persist;
122
121
  exports.persistStore = persistStore;
123
122
  exports.registerStorage = registerStorage;
@@ -1,5 +1,5 @@
1
1
  import { store, watchEffect } from "@aevantec/litevue";
2
- //#region src/plugins/persist/index.ts
2
+ // src/plugins/persist/index.ts
3
3
  var PREFIX = "litevue:";
4
4
  /** Custom storages registered by name, usable as a directive modifier. */
5
5
  var registry = Object.create(null);
@@ -116,5 +116,4 @@ var persistStore = (name, options = {}) => {
116
116
  if (!storage) console.error(`persistStore("${name}") — storage "${String(options.storage)}" is not available.`);
117
117
  return sync(target, PREFIX + (options.key ?? name), options.keys, storage, watchEffect);
118
118
  };
119
- //#endregion
120
119
  export { persist, persistStore, registerStorage, setDefaultStorage };
@@ -7,8 +7,8 @@ export declare class Block {
7
7
  isFragment: boolean;
8
8
  start?: Text;
9
9
  end?: Text;
10
- owned: boolean;
11
- get el(): Element | Text;
10
+ owned?: boolean;
11
+ get el(): any;
12
12
  constructor(template: Element, parentCtx: Context, isRoot?: boolean);
13
13
  insert(parent: Element, anchor?: Node | null): void;
14
14
  remove(): void;
@@ -7,8 +7,8 @@ export declare class Block {
7
7
  isFragment: boolean;
8
8
  start?: Text;
9
9
  end?: Text;
10
- owned: boolean;
11
- get el(): Element | Text;
10
+ owned?: boolean;
11
+ get el(): any;
12
12
  constructor(template: Element, parentCtx: Context, isRoot?: boolean);
13
13
  insert(parent: Element, anchor?: Node | null): void;
14
14
  remove(): void;
@@ -23,5 +23,11 @@ export interface Context {
23
23
  dispose?: (node: Node) => void;
24
24
  }
25
25
  export declare const createContext: (parent?: Context) => Context;
26
+ /**
27
+ * Framework-provided, so non-enumerable: `Object.assign`-ing one scope onto
28
+ * another must copy the user's data and leave these alone. v-for does exactly
29
+ * that on every update, which reset each row's $id and wiped its $refs.
30
+ */
31
+ export declare const hide: (scope: any, key: string, value: any) => any;
26
32
  export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
27
- export declare const bindContextMethods: (scope: Record<string, any>) => void;
33
+ export declare const bindContextMethods: (scope: Record<string, any>, raw?: Record<string, any>) => void;
@@ -23,5 +23,11 @@ export interface Context {
23
23
  dispose?: (node: Node) => void;
24
24
  }
25
25
  export declare const createContext: (parent?: Context) => Context;
26
+ /**
27
+ * Framework-provided, so non-enumerable: `Object.assign`-ing one scope onto
28
+ * another must copy the user's data and leave these alone. v-for does exactly
29
+ * that on every update, which reset each row's $id and wiped its $refs.
30
+ */
31
+ export declare const hide: (scope: any, key: string, value: any) => any;
26
32
  export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
27
- export declare const bindContextMethods: (scope: Record<string, any>) => void;
33
+ export declare const bindContextMethods: (scope: Record<string, any>, raw?: Record<string, any>) => void;
@@ -1,4 +1,5 @@
1
1
  import { Directive } from './index.mjs';
2
2
  export declare const bind: Directive<Element & {
3
3
  _class?: string | null;
4
+ __bound?: any;
4
5
  }>;
@@ -1,4 +1,5 @@
1
1
  import { Directive } from '.';
2
2
  export declare const bind: Directive<Element & {
3
3
  _class?: string | null;
4
+ __bound?: any;
4
5
  }>;
@@ -1,2 +1,4 @@
1
1
  import { Directive } from './index.mjs';
2
+ /** For tests: how many handler expressions are memoised. */
3
+ export declare const expressionCacheSize: () => number;
2
4
  export declare const on: Directive;
@@ -1,2 +1,4 @@
1
1
  import { Directive } from '.';
2
+ /** For tests: how many handler expressions are memoised. */
3
+ export declare const expressionCacheSize: () => number;
2
4
  export declare const on: Directive;
@@ -1,2 +1,5 @@
1
1
  import { Directive } from './index.mjs';
2
- export declare const show: Directive<HTMLElement>;
2
+ export declare const show: Directive<HTMLElement & {
3
+ _vod?: string;
4
+ _vsh?: boolean;
5
+ }>;
@@ -1,2 +1,5 @@
1
1
  import { Directive } from '.';
2
- export declare const show: Directive<HTMLElement>;
2
+ export declare const show: Directive<HTMLElement & {
3
+ _vod?: string;
4
+ _vsh?: boolean;
5
+ }>;
@@ -7,7 +7,7 @@ export type ErrorPhase =
7
7
  'expression'
8
8
  /** inside a v-on handler, after the event fired */
9
9
  | 'handler'
10
- /** a directive's own setup threw */
10
+ /** a directive's own setup threw, or a `v-teleport` or `$template` selector does not parse */
11
11
  | 'directive'
12
12
  /** the expression could not be compiled into a function at all */
13
13
  | 'compile'
@@ -7,7 +7,7 @@ export type ErrorPhase =
7
7
  'expression'
8
8
  /** inside a v-on handler, after the event fired */
9
9
  | 'handler'
10
- /** a directive's own setup threw */
10
+ /** a directive's own setup threw, or a `v-teleport` or `$template` selector does not parse */
11
11
  | 'directive'
12
12
  /** the expression could not be compiled into a function at all */
13
13
  | 'compile'
@@ -15,6 +15,8 @@ export declare const setOwner: (node: Node | undefined) => Node | undefined;
15
15
  * the anchor.
16
16
  */
17
17
  export declare const own: (dispose: Disposer, node?: Node | undefined) => void;
18
+ /** Withdraws a disposer from `node`, for an owner that removes it itself. */
19
+ export declare const disown: (dispose: Disposer, node: Node) => void;
18
20
  /**
19
21
  * Disposes `node` and its subtree. Safe on an unowned node, and idempotent —
20
22
  * the record is dropped as it runs.
@@ -15,6 +15,8 @@ export declare const setOwner: (node: Node | undefined) => Node | undefined;
15
15
  * the anchor.
16
16
  */
17
17
  export declare const own: (dispose: Disposer, node?: Node | undefined) => void;
18
+ /** Withdraws a disposer from `node`, for an owner that removes it itself. */
19
+ export declare const disown: (dispose: Disposer, node: Node) => void;
18
20
  /**
19
21
  * Disposes `node` and its subtree. Safe on an unowned node, and idempotent —
20
22
  * the record is dropped as it runs.
@@ -1,5 +1,13 @@
1
1
  import { type ReactiveEffectRunner } from '@vue/reactivity';
2
2
  /** Stops an effect and remembers that it is stopped. Use instead of `stop`. */
3
3
  export declare const stopEffect: (runner: ReactiveEffectRunner) => void;
4
+ export type Job = Function & {
5
+ i?: number;
6
+ };
4
7
  export declare const nextTick: (fn: () => void) => Promise<void>;
5
- export declare const queueJob: (job: Function) => void;
8
+ /**
9
+ * Stamps a job with its creation order, which the flush runs in. An effect
10
+ * stamped as it is created sorts before the children its first run creates.
11
+ */
12
+ export declare const stampJob: <T extends Job>(job: T) => T;
13
+ export declare const queueJob: (job: Job) => void;
@@ -1,5 +1,13 @@
1
1
  import { type ReactiveEffectRunner } from '@vue/reactivity';
2
2
  /** Stops an effect and remembers that it is stopped. Use instead of `stop`. */
3
3
  export declare const stopEffect: (runner: ReactiveEffectRunner) => void;
4
+ export type Job = Function & {
5
+ i?: number;
6
+ };
4
7
  export declare const nextTick: (fn: () => void) => Promise<void>;
5
- export declare const queueJob: (job: Function) => void;
8
+ /**
9
+ * Stamps a job with its creation order, which the flush runs in. An effect
10
+ * stamped as it is created sorts before the children its first run creates.
11
+ */
12
+ export declare const stampJob: <T extends Job>(job: T) => T;
13
+ export declare const queueJob: (job: Job) => void;
@@ -1,3 +1,4 @@
1
1
  import { Context } from './context.mjs';
2
2
  export declare let inOnce: boolean;
3
+ export declare const withOnce: (once: boolean, fn: () => unknown) => void;
3
4
  export declare const walk: (node: Node, ctx: Context) => ChildNode | null | void;
@@ -1,3 +1,4 @@
1
1
  import { Context } from './context';
2
2
  export declare let inOnce: boolean;
3
+ export declare const withOnce: (once: boolean, fn: () => unknown) => void;
3
4
  export declare const walk: (node: Node, ctx: Context) => ChildNode | null | void;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aevantec/litevue",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "description": "A maintained petite-vue fork: Vue's template syntax and reactivity in ~10kb, with built-in devtools. No build step.",
7
+ "description": "A maintained petite-vue fork: Vue's template syntax and reactivity in ~11kb, with built-in devtools. No build step.",
8
8
  "type": "commonjs",
9
9
  "//sideEffects": "The core auto-mounts when its script tag has `init`, and the devtools panel self-initializes on import — both are real import side effects and must not be tree-shaken. The plugins bundle is pure, so bundlers may drop unused plugins.",
10
10
  "sideEffects": [