@aevantec/litevue 0.5.8 → 0.5.10

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 (37) hide show
  1. package/README.md +1 -1
  2. package/dist/litevue-devtools.iife.js +1 -1
  3. package/dist/litevue-devtools.mjs +1 -1
  4. package/dist/litevue-devtools.umd.js +1 -1
  5. package/dist/litevue-plugins.dev.iife.js +10 -5
  6. package/dist/litevue-plugins.dev.mjs +10 -5
  7. package/dist/litevue-plugins.iife.js +1 -1
  8. package/dist/litevue-plugins.mjs +1 -1
  9. package/dist/litevue-plugins.umd.js +1 -1
  10. package/dist/litevue.dev.iife.js +89 -73
  11. package/dist/litevue.dev.mjs +89 -73
  12. package/dist/litevue.iife.js +1 -1
  13. package/dist/litevue.mjs +1 -1
  14. package/dist/litevue.umd.js +1 -1
  15. package/dist/plugins/media.iife.js +1 -1
  16. package/dist/plugins/media.mjs +1 -1
  17. package/dist/plugins/media.umd.js +1 -1
  18. package/dist/plugins/morph.dev.iife.js +10 -5
  19. package/dist/plugins/morph.dev.mjs +10 -5
  20. package/dist/plugins/morph.iife.js +1 -1
  21. package/dist/plugins/morph.mjs +1 -1
  22. package/dist/plugins/morph.umd.js +1 -1
  23. package/dist/types/context.d.mts +0 -1
  24. package/dist/types/context.d.ts +0 -1
  25. package/dist/types/devtools-panel/chrome.d.mts +30 -0
  26. package/dist/types/devtools-panel/chrome.d.ts +30 -0
  27. package/dist/types/devtools-panel/styles.d.mts +17 -0
  28. package/dist/types/devtools-panel/styles.d.ts +17 -0
  29. package/dist/types/devtools-panel/values.d.mts +25 -0
  30. package/dist/types/devtools-panel/values.d.ts +25 -0
  31. package/dist/types/eval.d.mts +3 -0
  32. package/dist/types/eval.d.ts +3 -0
  33. package/dist/types/magics.d.mts +6 -4
  34. package/dist/types/magics.d.ts +6 -4
  35. package/dist/types/plugins/morph/index.d.mts +6 -0
  36. package/dist/types/plugins/morph/index.d.ts +6 -0
  37. package/package.json +2 -2
@@ -1 +1 @@
1
- var e=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),t=/^(?:v-|:|@)/,n=/^(?::|v-bind:)/,r=["id","data-key","data-id"],o=e=>{for(const t of r){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},i=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},s=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),l=(e,r)=>{const o=(e=>{const t=/* @__PURE__ */new Set;for(const{name:r}of e.attributes)n.test(r)?t.add(r.replace(n,"").split(".")[0]):"v-model"===r&&(t.add("value"),t.add("checked"));return t})(r);for(const{name:n,value:i}of[...r.attributes])t.test(n)||o.has(n)||e.getAttribute(n)!==i&&e.setAttribute(n,i);for(const{name:t}of[...e.attributes])o.has(t)||r.hasAttribute(t)||e.removeAttribute(t)},d=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return a(e,t,n,r);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return a(e,t,n,r);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(l(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||s(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(s(t))return!0;return!1})(i)||u(o,i,o.__ctx||n,r))},a=(t,n,r,o)=>{if(e(t,o))return;const i=n.cloneNode(!0);!1!==o.beforeNodeAdded?.(i)&&(r?.dispose?.(t),t.parentNode.replaceChild(i,t),o.afterNodeRemoved?.(t),c(i,r))},c=(e,t)=>{const n=t||i(e.parentNode);n?.walk?.(e,n)},u=(t,n,r,i)=>{const s=i.key||o,l=/* @__PURE__ */new Map;for(let e=t.firstChild;e;e=e.nextSibling)if(1===e.nodeType){const t=s(e);if(null==t)continue;l.set(t,e)}const a=e=>e&&1===e.nodeType?s(e):null;let u=t.firstChild,f=n.firstChild;const p=e=>{const n=e.cloneNode(!0);!1!==i.beforeNodeAdded?.(n)&&(t.insertBefore(n,u),c(n,r))};for(;f;){const e=f.nextSibling,n=a(f);if(null!=n){const e=l.get(n);e?(e===u?u=u.nextSibling:t.insertBefore(e,u),l.delete(n),d(e,f,r,i)):p(f)}else if(u&&null==a(u)){const e=u.nextSibling;d(u,f,r,i),u=e}else p(f);f=e}for(;u;){const n=u.nextSibling;e(u,i)||(r?.dispose?.(u),t.removeChild(u),i.afterNodeRemoved?.(u)),u=n}},f=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=p();d(e,r,i(e),n),t()}return e},p=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},h=e=>{e.scope.$morph=f};export{f as morph,h as morphPlugin};
1
+ var e=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),t=/^(?:v-|:|@)/,n=/^(?::|v-bind:)/,r=/^v-(?!scope|on:)/,o=["id","data-key","data-id"],i=e=>{for(const t of o){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},s=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},d=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),l=(e,o)=>{const i=(e=>{const t=/* @__PURE__ */new Set;for(const{name:o}of e.attributes)n.test(o)?t.add(o.replace(n,"").split(".")[0]):"v-model"===o?(t.add("value"),t.add("checked")):"v-bind"===o?t.add("*"):r.test(o)&&t.add("style");return t})(o);for(const{name:n,value:r}of[...o.attributes])t.test(n)||i.has(n)||e.getAttribute(n)!==r&&e.setAttribute(n,r);for(const{name:t}of[...e.attributes])i.has("*")||i.has(t)||o.hasAttribute(t)||e.removeAttribute(t)},a=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return c(e,t,n,r);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return c(e,t,n,r);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(l(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||d(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(d(t))return!0;return!1})(i)||f(o,i,o.__ctx||n,r))},c=(t,n,r,o)=>{if(e(t,o))return;const i=n.cloneNode(!0);!1!==o.beforeNodeAdded?.(i)&&(r?.dispose?.(t),t.parentNode.replaceChild(i,t),o.afterNodeRemoved?.(t),u(i,r))},u=(e,t)=>{const n=t||s(e.parentNode);n?.walk?.(e,n)},f=(t,n,r,o)=>{const s=o.key||i,d=/* @__PURE__ */new Map;for(let e=t.firstChild;e;e=e.nextSibling)if(1===e.nodeType){const t=s(e);if(null==t)continue;d.set(t,e)}const l=e=>e&&1===e.nodeType?s(e):null;let c=t.firstChild,f=n.firstChild;const p=e=>{const n=e.cloneNode(!0);!1!==o.beforeNodeAdded?.(n)&&(t.insertBefore(n,c),u(n,r))};for(;f;){const e=f.nextSibling,n=l(f);if(null!=n){const e=d.get(n);e?(e===c?c=c.nextSibling:t.insertBefore(e,c),d.delete(n),a(e,f,r,o)):p(f)}else if(c&&null==l(c)){const e=c.nextSibling;a(c,f,r,o),c=e}else p(f);f=e}for(;c;){const n=c.nextSibling;e(c,o)||(r?.dispose?.(c),t.removeChild(c),o.afterNodeRemoved?.(c)),c=n}},p=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=()=>{const t=m();a(e,r,s(e),n),t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},m=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}},h=e=>{e.scope.$morph=p};export{p as morph,h as morphPlugin};
@@ -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).LiteVueMorph={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),n=/^(?:v-|:|@)/,o=/^(?::|v-bind:)/,r=["id","data-key","data-id"],i=e=>{for(const t of r){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},s=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},l=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),d=(e,t)=>{const r=(e=>{const t=new Set;for(const{name:n}of e.attributes)o.test(n)?t.add(n.replace(o,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:o,value:i}of[...t.attributes])n.test(o)||r.has(o)||e.getAttribute(o)!==i&&e.setAttribute(o,i);for(const{name:n}of[...e.attributes])r.has(n)||t.hasAttribute(n)||e.removeAttribute(n)},a=(e,t,n,o)=>{if(e.nodeType!==t.nodeType)return u(e,t,n,o);if(3===e.nodeType||8===e.nodeType){const o=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(o,n))return;return void(e.data!==o&&(e.data=o))}if(1!==e.nodeType)return;const r=e,i=t;if(r.tagName!==i.tagName)return u(e,t,n,o);o.skip?.(r,i)||r.hasAttribute("data-morph-skip")||(d(r,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||l(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(l(t))return!0;return!1})(i)||f(r,i,r.__ctx||n,o))},u=(e,n,o,r)=>{if(t(e,r))return;const i=n.cloneNode(!0);!1!==r.beforeNodeAdded?.(i)&&(o?.dispose?.(e),e.parentNode.replaceChild(i,e),r.afterNodeRemoved?.(e),c(i,o))},c=(e,t)=>{const n=t||s(e.parentNode);n?.walk?.(e,n)},f=(e,n,o,r)=>{const s=r.key||i,l=new Map;for(let t=e.firstChild;t;t=t.nextSibling)if(1===t.nodeType){const e=s(t);if(null==e)continue;l.set(e,t)}const d=e=>e&&1===e.nodeType?s(e):null;let u=e.firstChild,f=n.firstChild;const p=t=>{const n=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(n)&&(e.insertBefore(n,u),c(n,o))};for(;f;){const t=f.nextSibling,n=d(f);if(null!=n){const t=l.get(n);t?(t===u?u=u.nextSibling:e.insertBefore(t,u),l.delete(n),a(t,f,o,r)):p(f)}else if(u&&null==d(u)){const e=u.nextSibling;a(u,f,o,r),u=e}else p(f);f=t}for(;u;){const n=u.nextSibling;t(u,r)||(o?.dispose?.(u),e.removeChild(u),r.afterNodeRemoved?.(u)),u=n}},p=(e,t,n={})=>{let o;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const r=n.content;o=1===r.childElementCount?r.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(r),t})()}else o=t;if(o){const t=h();a(e,o,s(e),n),t()}return e},h=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,o=null;try{n=t.selectionStart,o=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,o)}catch{}}};e.morph=p,e.morphPlugin=e=>{e.scope.$morph=p}});
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).LiteVueMorph={})}(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});var t=(e,t)=>1===e.nodeType&&(e.hasAttribute("data-morph-preserve")||!!t.preserve?.(e)),n=/^(?:v-|:|@)/,o=/^(?::|v-bind:)/,r=/^v-(?!scope|on:)/,i=["id","data-key","data-id"],s=e=>{for(const t of i){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},d=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},l=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),a=(e,t)=>{const i=(e=>{const t=new Set;for(const{name:n}of e.attributes)o.test(n)?t.add(n.replace(o,"").split(".")[0]):"v-model"===n?(t.add("value"),t.add("checked")):"v-bind"===n?t.add("*"):r.test(n)&&t.add("style");return t})(t);for(const{name:o,value:r}of[...t.attributes])n.test(o)||i.has(o)||e.getAttribute(o)!==r&&e.setAttribute(o,r);for(const{name:n}of[...e.attributes])i.has("*")||i.has(n)||t.hasAttribute(n)||e.removeAttribute(n)},c=(e,t,n,o)=>{if(e.nodeType!==t.nodeType)return u(e,t,n,o);if(3===e.nodeType||8===e.nodeType){const o=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(o,n))return;return void(e.data!==o&&(e.data=o))}if(1!==e.nodeType)return;const r=e,i=t;if(r.tagName!==i.tagName)return u(e,t,n,o);o.skip?.(r,i)||r.hasAttribute("data-morph-skip")||(a(r,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||l(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(l(t))return!0;return!1})(i)||p(r,i,r.__ctx||n,o))},u=(e,n,o,r)=>{if(t(e,r))return;const i=n.cloneNode(!0);!1!==r.beforeNodeAdded?.(i)&&(o?.dispose?.(e),e.parentNode.replaceChild(i,e),r.afterNodeRemoved?.(e),f(i,o))},f=(e,t)=>{const n=t||d(e.parentNode);n?.walk?.(e,n)},p=(e,n,o,r)=>{const i=r.key||s,d=new Map;for(let t=e.firstChild;t;t=t.nextSibling)if(1===t.nodeType){const e=i(t);if(null==e)continue;d.set(e,t)}const l=e=>e&&1===e.nodeType?i(e):null;let a=e.firstChild,u=n.firstChild;const p=t=>{const n=t.cloneNode(!0);!1!==r.beforeNodeAdded?.(n)&&(e.insertBefore(n,a),f(n,o))};for(;u;){const t=u.nextSibling,n=l(u);if(null!=n){const t=d.get(n);t?(t===a?a=a.nextSibling:e.insertBefore(t,a),d.delete(n),c(t,u,o,r)):p(u)}else if(a&&null==l(a)){const e=a.nextSibling;c(a,u,o,r),a=e}else p(u);u=t}for(;a;){const n=a.nextSibling;t(a,r)||(o?.dispose?.(a),e.removeChild(a),r.afterNodeRemoved?.(a)),a=n}},h=(e,t,n={})=>{let o;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const r=n.content;o=1===r.childElementCount?r.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(r),t})()}else o=t;if(o){const t=()=>{const t=m();c(e,o,d(e),n),t()};n.transition&&document.startViewTransition?document.startViewTransition(t):t()}return e},m=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,o=null;try{n=t.selectionStart,o=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,o)}catch{}}};e.morph=h,e.morphPlugin=e=>{e.scope.$morph=h}});
@@ -2,7 +2,6 @@ import { effect as rawEffect, ReactiveEffectRunner } from '@vue/reactivity';
2
2
  import { Block } from './block.mjs';
3
3
  import { Directive } from './directives/index.mjs';
4
4
  export interface Context {
5
- key?: any;
6
5
  scope: Record<string, any>;
7
6
  dirs: Record<string, Directive>;
8
7
  blocks: Block[];
@@ -2,7 +2,6 @@ import { effect as rawEffect, ReactiveEffectRunner } from '@vue/reactivity';
2
2
  import { Block } from './block';
3
3
  import { Directive } from './directives';
4
4
  export interface Context {
5
- key?: any;
6
5
  scope: Record<string, any>;
7
6
  dirs: Record<string, Directive>;
8
7
  blocks: Block[];
@@ -0,0 +1,30 @@
1
+ export declare const icon: (paths: string) => string;
2
+ export type ThemeMode = 'dark' | 'light' | 'system';
3
+ export type Dock = 'float' | 'bottom' | 'right';
4
+ export interface UiState {
5
+ open?: boolean;
6
+ right?: number;
7
+ bottom?: number;
8
+ w?: number;
9
+ h?: number;
10
+ /** dock-bottom height and dock-right width, remembered separately */
11
+ bh?: number;
12
+ rw?: number;
13
+ dock?: Dock;
14
+ }
15
+ export declare const loadUi: () => UiState;
16
+ export declare const loadTheme: () => ThemeMode;
17
+ export declare const saveTheme: (theme: ThemeMode) => void;
18
+ export declare const saveUi: (patch: UiState) => void;
19
+ export declare const themeIcons: Record<ThemeMode, string>;
20
+ /** Dock icons: an outlined viewport with the docked region filled, per browser
21
+ * devtools convention. Floating shows a detached window. */
22
+ export declare const dockIcons: Record<Dock, string>;
23
+ export declare const nextDock: Record<Dock, Dock>;
24
+ export declare const dockTitles: Record<Dock, string>;
25
+ export declare const nextTheme: Record<ThemeMode, ThemeMode>;
26
+ export declare const MIN_W = 320;
27
+ export declare const MIN_H = 320;
28
+ export declare const maxW: () => number;
29
+ export declare const maxH: () => number;
30
+ export declare const clamp: (v: number, lo: number, hi: number) => number;
@@ -0,0 +1,30 @@
1
+ export declare const icon: (paths: string) => string;
2
+ export type ThemeMode = 'dark' | 'light' | 'system';
3
+ export type Dock = 'float' | 'bottom' | 'right';
4
+ export interface UiState {
5
+ open?: boolean;
6
+ right?: number;
7
+ bottom?: number;
8
+ w?: number;
9
+ h?: number;
10
+ /** dock-bottom height and dock-right width, remembered separately */
11
+ bh?: number;
12
+ rw?: number;
13
+ dock?: Dock;
14
+ }
15
+ export declare const loadUi: () => UiState;
16
+ export declare const loadTheme: () => ThemeMode;
17
+ export declare const saveTheme: (theme: ThemeMode) => void;
18
+ export declare const saveUi: (patch: UiState) => void;
19
+ export declare const themeIcons: Record<ThemeMode, string>;
20
+ /** Dock icons: an outlined viewport with the docked region filled, per browser
21
+ * devtools convention. Floating shows a detached window. */
22
+ export declare const dockIcons: Record<Dock, string>;
23
+ export declare const nextDock: Record<Dock, Dock>;
24
+ export declare const dockTitles: Record<Dock, string>;
25
+ export declare const nextTheme: Record<ThemeMode, ThemeMode>;
26
+ export declare const MIN_W = 320;
27
+ export declare const MIN_H = 320;
28
+ export declare const maxW: () => number;
29
+ export declare const maxH: () => number;
30
+ export declare const clamp: (v: number, lo: number, hi: number) => number;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Panel stylesheet. Note the template below is a *string* — comments inside it
3
+ * ship verbatim, so explanations belong out here where terser strips them.
4
+ *
5
+ * Docked layouts (`.dock-bottom` / `.dock-right`) give the tree a full viewport
6
+ * edge, as browser devtools do; only the cross-axis stays resizable, since the
7
+ * other would fight the dock.
8
+ *
9
+ * `min-height` is 320px, not 200: against the fixed chrome (34px header, 28px
10
+ * tabs, 23px filter) 200 left about five rows of tree, too few to read. 320
11
+ * keeps roughly eleven.
12
+ *
13
+ * Sizing uses an explicit `.grip` rather than CSS `resize`, whose handle is
14
+ * always bottom-right — the wrong corner once docked, where dragging down would
15
+ * grow the panel upward. Each mode gets a handle on the edge that moves.
16
+ */
17
+ export declare const css = "\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Panel stylesheet. Note the template below is a *string* — comments inside it
3
+ * ship verbatim, so explanations belong out here where terser strips them.
4
+ *
5
+ * Docked layouts (`.dock-bottom` / `.dock-right`) give the tree a full viewport
6
+ * edge, as browser devtools do; only the cross-axis stays resizable, since the
7
+ * other would fight the dock.
8
+ *
9
+ * `min-height` is 320px, not 200: against the fixed chrome (34px header, 28px
10
+ * tabs, 23px filter) 200 left about five rows of tree, too few to read. 320
11
+ * keeps roughly eleven.
12
+ *
13
+ * Sizing uses an explicit `.grip` rather than CSS `resize`, whose handle is
14
+ * always bottom-right — the wrong corner once docked, where dragging down would
15
+ * grow the panel upward. Each mode gets a handle on the edge that moves.
16
+ */
17
+ export declare const css = "\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 760px;\n max-width: calc(100vw - 24px);\n height: 450px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 320px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.panel.dock-bottom {\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n max-width: none;\n border-radius: 0;\n border-left: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-right {\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n max-height: none;\n border-radius: 0;\n border-top: 0;\n border-right: 0;\n border-bottom: 0;\n}\n.panel.dock-bottom .header,\n.panel.dock-right .header {\n cursor: default;\n}\n.grip {\n position: absolute;\n z-index: 1;\n touch-action: none;\n right: 0;\n bottom: 0;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n background: linear-gradient(135deg, transparent 50%, var(--border) 50%);\n}\n.panel.dock-bottom .grip {\n top: 0;\n left: 0;\n width: auto;\n height: 5px;\n cursor: ns-resize;\n background: none;\n}\n.panel.dock-right .grip {\n top: 0;\n left: 0;\n width: 5px;\n height: auto;\n cursor: ew-resize;\n background: none;\n}\n.panel.dock-bottom .grip:hover,\n.panel.dock-bottom .grip.active,\n.panel.dock-right .grip:hover,\n.panel.dock-right .grip.active {\n background: var(--accent);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n cursor: pointer;\n}\n.row .label {\n flex-shrink: 0;\n}\n.row .arrow {\n cursor: pointer;\n padding: 3px 4px;\n margin: -3px -4px;\n box-sizing: content-box;\n}\n.row .arrow:hover {\n color: var(--key);\n}\n.row .hit {\n color: var(--exp);\n opacity: 0.75;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n";
@@ -0,0 +1,25 @@
1
+ export declare const h: (tag: string, className: string, text?: string) => HTMLElement;
2
+ /**
3
+ * Finds `term` among a scope's property names and values, returning the first
4
+ * hit's path so the tree can show why a scope matched.
5
+ *
6
+ * Bounded on purpose: it runs on every keystroke over every mounted scope and
7
+ * state is arbitrary. Depth is capped, functions and `$` magics are skipped,
8
+ * and visited objects are remembered so cycles terminate.
9
+ */
10
+ export declare const findInState: (scope: any, term: string) => string | undefined;
11
+ export declare const fmt: (v: unknown) => string;
12
+ export declare const coerce: (raw: string, old: unknown) => string | number;
13
+ export declare const descriptorOf: (o: any, key: string) => PropertyDescriptor | undefined;
14
+ /**
15
+ * True for values with no editor: setter-less accessors and getter-only
16
+ * `computed()` refs. A computed is only recognizable from the raw descriptor,
17
+ * since reading through the proxy has already unwrapped it. The reactivity
18
+ * flags are read directly to keep @vue/reactivity out of this bundle.
19
+ */
20
+ export declare const isReadOnly: (desc?: PropertyDescriptor) => boolean;
21
+ export declare const collectProps: (scope: Record<string, any>) => {
22
+ own: string[];
23
+ inherited: string[];
24
+ };
25
+ export declare const previewOf: (v: any) => string;
@@ -0,0 +1,25 @@
1
+ export declare const h: (tag: string, className: string, text?: string) => HTMLElement;
2
+ /**
3
+ * Finds `term` among a scope's property names and values, returning the first
4
+ * hit's path so the tree can show why a scope matched.
5
+ *
6
+ * Bounded on purpose: it runs on every keystroke over every mounted scope and
7
+ * state is arbitrary. Depth is capped, functions and `$` magics are skipped,
8
+ * and visited objects are remembered so cycles terminate.
9
+ */
10
+ export declare const findInState: (scope: any, term: string) => string | undefined;
11
+ export declare const fmt: (v: unknown) => string;
12
+ export declare const coerce: (raw: string, old: unknown) => string | number;
13
+ export declare const descriptorOf: (o: any, key: string) => PropertyDescriptor | undefined;
14
+ /**
15
+ * True for values with no editor: setter-less accessors and getter-only
16
+ * `computed()` refs. A computed is only recognizable from the raw descriptor,
17
+ * since reading through the proxy has already unwrapped it. The reactivity
18
+ * flags are read directly to keep @vue/reactivity out of this bundle.
19
+ */
20
+ export declare const isReadOnly: (desc?: PropertyDescriptor) => boolean;
21
+ export declare const collectProps: (scope: Record<string, any>) => {
22
+ own: string[];
23
+ inherited: string[];
24
+ };
25
+ export declare const previewOf: (v: any) => string;
@@ -1,4 +1,7 @@
1
1
  import { type ErrorInfo } from './errors.mjs';
2
+ export declare const EVAL_CACHE_LIMIT = 1000;
3
+ /** For tests: how many compiled expressions are held. */
4
+ export declare const evalCacheSize: () => number;
2
5
  /** Where the expression came from, so a failure can name its directive and element. */
3
6
  export type EvalMeta = Pick<ErrorInfo, 'source' | 'el'> & {
4
7
  /** Shown instead of the compiled text: `{{ total }}`, not `$s( total )`. */
@@ -1,4 +1,7 @@
1
1
  import { type ErrorInfo } from './errors';
2
+ export declare const EVAL_CACHE_LIMIT = 1000;
3
+ /** For tests: how many compiled expressions are held. */
4
+ export declare const evalCacheSize: () => number;
2
5
  /** Where the expression came from, so a failure can name its directive and element. */
3
6
  export type EvalMeta = Pick<ErrorInfo, 'source' | 'el'> & {
4
7
  /** Shown instead of the compiled text: `{{ total }}`, not `$s( total )`. */
@@ -5,8 +5,10 @@ import type { Context } from './context.mjs';
5
5
  */
6
6
  export declare const createId: () => (name?: string) => string;
7
7
  /**
8
- * $watch(source, callback) — watches a dot-path string or getter and calls
9
- * back with (value, oldValue). Tied to the owning scope's effects, so it stops
10
- * when the scope unmounts.
8
+ * $watch(source, callback, { immediate }) — watches a dot-path string or getter
9
+ * and calls back with (value, oldValue). Returns a stop function; it also stops
10
+ * when the owning scope unmounts.
11
11
  */
12
- export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void) => void;
12
+ export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void, options?: {
13
+ immediate?: boolean;
14
+ }) => () => void;
@@ -5,8 +5,10 @@ import type { Context } from './context';
5
5
  */
6
6
  export declare const createId: () => (name?: string) => string;
7
7
  /**
8
- * $watch(source, callback) — watches a dot-path string or getter and calls
9
- * back with (value, oldValue). Tied to the owning scope's effects, so it stops
10
- * when the scope unmounts.
8
+ * $watch(source, callback, { immediate }) — watches a dot-path string or getter
9
+ * and calls back with (value, oldValue). Returns a stop function; it also stops
10
+ * when the owning scope unmounts.
11
11
  */
12
- export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void) => void;
12
+ export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void, options?: {
13
+ immediate?: boolean;
14
+ }) => () => void;
@@ -33,6 +33,12 @@ export interface MorphOptions {
33
33
  * released — so what arrives here is inert, not a live subtree.
34
34
  */
35
35
  afterNodeRemoved?: (node: Node) => void;
36
+ /**
37
+ * Patch inside `document.startViewTransition()` where supported. The patch
38
+ * then runs once the browser has captured the old view, not before `morph`
39
+ * returns. Without the API it patches immediately, as if the option were off.
40
+ */
41
+ transition?: boolean;
36
42
  }
37
43
  /**
38
44
  * morph(from, to) — patch `from` in place so it matches `to`, which may be an
@@ -33,6 +33,12 @@ export interface MorphOptions {
33
33
  * released — so what arrives here is inert, not a live subtree.
34
34
  */
35
35
  afterNodeRemoved?: (node: Node) => void;
36
+ /**
37
+ * Patch inside `document.startViewTransition()` where supported. The patch
38
+ * then runs once the browser has captured the old view, not before `morph`
39
+ * returns. Without the API it patches immediately, as if the option were off.
40
+ */
41
+ transition?: boolean;
36
42
  }
37
43
  /**
38
44
  * morph(from, to) — patch `from` in place so it matches `to`, which may be an
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aevantec/litevue",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "description": "Lightweight subset of Vue optimized for progressive enhancement. A fork of petite-vue with devtools.",
7
+ "description": "A maintained petite-vue fork: Vue's template syntax and reactivity in ~10kb, 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": [