@aevantec/litevue 0.5.5 → 0.5.7

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 (65) hide show
  1. package/README.md +10 -7
  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 +898 -0
  6. package/dist/litevue-plugins.dev.mjs +880 -0
  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 +2103 -0
  11. package/dist/litevue.dev.mjs +2092 -0
  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/collapse.iife.js +1 -1
  16. package/dist/plugins/collapse.mjs +1 -1
  17. package/dist/plugins/collapse.umd.js +1 -1
  18. package/dist/plugins/media.dev.iife.js +249 -0
  19. package/dist/plugins/media.dev.mjs +243 -0
  20. package/dist/plugins/morph.dev.iife.js +217 -0
  21. package/dist/plugins/morph.dev.mjs +212 -0
  22. package/dist/plugins/morph.iife.js +1 -1
  23. package/dist/plugins/morph.mjs +1 -1
  24. package/dist/plugins/morph.umd.js +1 -1
  25. package/dist/plugins/persist.dev.iife.js +126 -0
  26. package/dist/plugins/persist.dev.mjs +120 -0
  27. package/dist/types/app.d.mts +15 -18
  28. package/dist/types/app.d.ts +15 -18
  29. package/dist/types/block.d.mts +1 -2
  30. package/dist/types/block.d.ts +1 -2
  31. package/dist/types/context.d.mts +5 -8
  32. package/dist/types/context.d.ts +5 -8
  33. package/dist/types/devtools.d.mts +7 -0
  34. package/dist/types/devtools.d.ts +7 -0
  35. package/dist/types/effect.d.mts +6 -10
  36. package/dist/types/effect.d.ts +6 -10
  37. package/dist/types/errors.d.mts +36 -0
  38. package/dist/types/errors.d.ts +36 -0
  39. package/dist/types/eval.d.mts +8 -2
  40. package/dist/types/eval.d.ts +8 -2
  41. package/dist/types/index.d.mts +1 -0
  42. package/dist/types/index.d.ts +1 -0
  43. package/dist/types/magics.d.mts +5 -6
  44. package/dist/types/magics.d.ts +5 -6
  45. package/dist/types/ownership.d.mts +9 -16
  46. package/dist/types/ownership.d.ts +9 -16
  47. package/dist/types/plugins/focus/index.d.mts +6 -8
  48. package/dist/types/plugins/focus/index.d.ts +6 -8
  49. package/dist/types/plugins/media/index.d.mts +6 -7
  50. package/dist/types/plugins/media/index.d.ts +6 -7
  51. package/dist/types/plugins/morph/index.d.mts +23 -11
  52. package/dist/types/plugins/morph/index.d.ts +23 -11
  53. package/dist/types/plugins/persist/index.d.mts +12 -19
  54. package/dist/types/plugins/persist/index.d.ts +12 -19
  55. package/dist/types/plugins/resize/index.d.mts +5 -7
  56. package/dist/types/plugins/resize/index.d.ts +5 -7
  57. package/dist/types/plugins/transition/index.d.mts +7 -12
  58. package/dist/types/plugins/transition/index.d.ts +7 -12
  59. package/dist/types/store.d.mts +3 -6
  60. package/dist/types/store.d.ts +3 -6
  61. package/dist/types/utils.d.mts +3 -3
  62. package/dist/types/utils.d.ts +3 -3
  63. package/dist/types/warn.d.mts +6 -8
  64. package/dist/types/warn.d.ts +6 -8
  65. package/package.json +11 -2
@@ -5,15 +5,12 @@ export interface PersistStorage {
5
5
  setItem(key: string, value: string): void;
6
6
  }
7
7
  /**
8
- * Register a custom storage under a name, so it can be selected by name from
9
- * anywhere — including as a directive modifier:
8
+ * Register a custom storage under a name, selectable anywhere — including as a
9
+ * directive modifier. Any object with getItem/setItem works.
10
10
  *
11
11
  * registerStorage('memory', myMemoryStorage);
12
12
  * persistStore('scratch', { storage: 'memory' });
13
13
  * <div v-persist.memory="scratch">…</div>
14
- *
15
- * Any object with getItem/setItem works — sessionStorage, an IndexedDB
16
- * shim, an in-memory map, a server-backed store.
17
14
  */
18
15
  export declare const registerStorage: (name: string, storage: PersistStorage) => void;
19
16
  /**
@@ -24,27 +21,23 @@ export declare const registerStorage: (name: string, storage: PersistStorage) =>
24
21
  */
25
22
  export declare const setDefaultStorage: (storage: PersistStorage | string) => void;
26
23
  /**
27
- * v-persist="storage-key" — syncs the element's scope to storage. Saved
28
- * values are restored on mount, and every change (including nested objects
29
- * and arrays) is written back automatically.
24
+ * v-persist="storage-key" — syncs the element's scope to storage: restored on
25
+ * mount, written back on every change, nested values included.
30
26
  *
31
- * The attribute value is used verbatim as the storage key (it is not
32
- * evaluated as an expression); it falls back to the element id.
27
+ * The attribute value is the storage key verbatim, not an expression, and
28
+ * falls back to the element id. An argument narrows which properties are
29
+ * stored; a modifier picks the storage (`local` default, `session`, or any
30
+ * name given to registerStorage()).
33
31
  *
34
- * An argument narrows what is stored to specific properties:
35
32
  * v-persist:draft="composer" — only `draft`
36
33
  * v-persist:draft,recipient="composer" — only those two
37
- *
38
- * A modifier picks the storage — `local` (default), `session`, or any name
39
- * passed to registerStorage():
40
- * v-persist.session="wizard"
41
- * v-persist:draft.session="composer"
34
+ * v-persist:draft.session="composer" — and into sessionStorage
42
35
  */
43
36
  export declare const persist: Plugin;
44
37
  /**
45
- * persistStore('cart') — the JS-side counterpart for global stores, which
46
- * have no element to hang a directive on. Restores immediately and saves on
47
- * every change; returns a function that stops persisting.
38
+ * persistStore('cart') — the JS-side counterpart for global stores, which have
39
+ * no element to hang a directive on. Restores immediately, saves on change,
40
+ * and returns a stop function.
48
41
  *
49
42
  * persistStore('cart') // the whole store
50
43
  * persistStore('cart', { keys: ['items'] }) // only these properties
@@ -5,15 +5,12 @@ export interface PersistStorage {
5
5
  setItem(key: string, value: string): void;
6
6
  }
7
7
  /**
8
- * Register a custom storage under a name, so it can be selected by name from
9
- * anywhere — including as a directive modifier:
8
+ * Register a custom storage under a name, selectable anywhere — including as a
9
+ * directive modifier. Any object with getItem/setItem works.
10
10
  *
11
11
  * registerStorage('memory', myMemoryStorage);
12
12
  * persistStore('scratch', { storage: 'memory' });
13
13
  * <div v-persist.memory="scratch">…</div>
14
- *
15
- * Any object with getItem/setItem works — sessionStorage, an IndexedDB
16
- * shim, an in-memory map, a server-backed store.
17
14
  */
18
15
  export declare const registerStorage: (name: string, storage: PersistStorage) => void;
19
16
  /**
@@ -24,27 +21,23 @@ export declare const registerStorage: (name: string, storage: PersistStorage) =>
24
21
  */
25
22
  export declare const setDefaultStorage: (storage: PersistStorage | string) => void;
26
23
  /**
27
- * v-persist="storage-key" — syncs the element's scope to storage. Saved
28
- * values are restored on mount, and every change (including nested objects
29
- * and arrays) is written back automatically.
24
+ * v-persist="storage-key" — syncs the element's scope to storage: restored on
25
+ * mount, written back on every change, nested values included.
30
26
  *
31
- * The attribute value is used verbatim as the storage key (it is not
32
- * evaluated as an expression); it falls back to the element id.
27
+ * The attribute value is the storage key verbatim, not an expression, and
28
+ * falls back to the element id. An argument narrows which properties are
29
+ * stored; a modifier picks the storage (`local` default, `session`, or any
30
+ * name given to registerStorage()).
33
31
  *
34
- * An argument narrows what is stored to specific properties:
35
32
  * v-persist:draft="composer" — only `draft`
36
33
  * v-persist:draft,recipient="composer" — only those two
37
- *
38
- * A modifier picks the storage — `local` (default), `session`, or any name
39
- * passed to registerStorage():
40
- * v-persist.session="wizard"
41
- * v-persist:draft.session="composer"
34
+ * v-persist:draft.session="composer" — and into sessionStorage
42
35
  */
43
36
  export declare const persist: Plugin;
44
37
  /**
45
- * persistStore('cart') — the JS-side counterpart for global stores, which
46
- * have no element to hang a directive on. Restores immediately and saves on
47
- * every change; returns a function that stops persisting.
38
+ * persistStore('cart') — the JS-side counterpart for global stores, which have
39
+ * no element to hang a directive on. Restores immediately, saves on change,
40
+ * and returns a stop function.
48
41
  *
49
42
  * persistStore('cart') // the whole store
50
43
  * persistStore('cart', { keys: ['items'] }) // only these properties
@@ -1,12 +1,10 @@
1
1
  import type { Plugin } from '../../app.mjs';
2
2
  /**
3
- * `v-resize="expr"` — element size, which no media query can report and which
4
- * CSS container queries cannot hand to JavaScript. The expression runs with
5
- * `$width` and `$height` in scope.
3
+ * `v-resize="expr"` — element size, which no media query reports and container
4
+ * queries cannot hand to JavaScript. The expression runs with `$width` and
5
+ * `$height` in scope.
6
6
  *
7
- * Separate from the media plugin on purpose: that one is viewport state,
8
- * readable from a script with no element involved, while this is bound to the
9
- * element it sits on. They share no code, and the shape here — one directive
10
- * wrapping one observer — is the same as `intersect`.
7
+ * Separate from the media plugin: that is viewport state, readable with no
8
+ * element involved, while this is bound to the element it sits on.
11
9
  */
12
10
  export declare const resize: Plugin;
@@ -1,12 +1,10 @@
1
1
  import type { Plugin } from '../../app';
2
2
  /**
3
- * `v-resize="expr"` — element size, which no media query can report and which
4
- * CSS container queries cannot hand to JavaScript. The expression runs with
5
- * `$width` and `$height` in scope.
3
+ * `v-resize="expr"` — element size, which no media query reports and container
4
+ * queries cannot hand to JavaScript. The expression runs with `$width` and
5
+ * `$height` in scope.
6
6
  *
7
- * Separate from the media plugin on purpose: that one is viewport state,
8
- * readable from a script with no element involved, while this is bound to the
9
- * element it sits on. They share no code, and the shape here — one directive
10
- * wrapping one observer — is the same as `intersect`.
7
+ * Separate from the media plugin: that is viewport state, readable with no
8
+ * element involved, while this is bound to the element it sits on.
11
9
  */
12
10
  export declare const resize: Plugin;
@@ -1,17 +1,12 @@
1
1
  import type { Plugin } from '../../app.mjs';
2
2
  /**
3
- * v-transition:name="expression" — an animated v-show. Toggles the element
4
- * with Vue-style transition classes: name-enter-from / name-enter-active /
5
- * name-enter-to on show, and name-leave-from / name-leave-active /
6
- * name-leave-to before hiding. The element is only hidden after the leave
7
- * transition finishes (duration is read from computed styles).
3
+ * v-transition:name="expression" — an animated v-show, using Vue-style
4
+ * classes: name-enter-from/-active/-to on show, name-leave-* before hiding.
5
+ * The element hides only once the leave transition finishes, its duration read
6
+ * from computed styles. The name defaults to "v", and the initial state does
7
+ * not animate unless `.appear` is present.
8
8
  *
9
- * The name defaults to "v". The initial state applies without animating
10
- * unless the .appear modifier is present. Use it instead of v-show.
11
- *
12
- * With no expression (`v-transition:fade` on a v-if/v-for element) it
13
- * switches to unmount mode: the enter transition runs when the element is
14
- * inserted, and a leave hook is registered so the core delays removal until
15
- * the leave transition finishes.
9
+ * With no expression, on a v-if/v-for element, it switches to unmount mode:
10
+ * enter runs on insertion, and a leave hook makes the core delay removal.
16
11
  */
17
12
  export declare const transition: Plugin;
@@ -1,17 +1,12 @@
1
1
  import type { Plugin } from '../../app';
2
2
  /**
3
- * v-transition:name="expression" — an animated v-show. Toggles the element
4
- * with Vue-style transition classes: name-enter-from / name-enter-active /
5
- * name-enter-to on show, and name-leave-from / name-leave-active /
6
- * name-leave-to before hiding. The element is only hidden after the leave
7
- * transition finishes (duration is read from computed styles).
3
+ * v-transition:name="expression" — an animated v-show, using Vue-style
4
+ * classes: name-enter-from/-active/-to on show, name-leave-* before hiding.
5
+ * The element hides only once the leave transition finishes, its duration read
6
+ * from computed styles. The name defaults to "v", and the initial state does
7
+ * not animate unless `.appear` is present.
8
8
  *
9
- * The name defaults to "v". The initial state applies without animating
10
- * unless the .appear modifier is present. Use it instead of v-show.
11
- *
12
- * With no expression (`v-transition:fade` on a v-if/v-for element) it
13
- * switches to unmount mode: the enter transition runs when the element is
14
- * inserted, and a leave hook is registered so the core delays removal until
15
- * the leave transition finishes.
9
+ * With no expression, on a v-if/v-for element, it switches to unmount mode:
10
+ * enter runs on insertion, and a leave hook makes the core delay removal.
16
11
  */
17
12
  export declare const transition: Plugin;
@@ -1,10 +1,7 @@
1
1
  export declare const stores: Record<string, any>;
2
2
  /**
3
- * Register or retrieve a global store, shared across all apps and available
4
- * to every expression as $store.<name>.
5
- *
6
- * store('cart', { items: [], add(i) { this.items.push(i) } }) registers a
7
- * reactive store (an init() method, if present, runs once on registration);
8
- * store('cart') retrieves it.
3
+ * Register or retrieve a global store, shared across apps and exposed to every
4
+ * expression as `$store.<name>`. Passing a value registers it and runs its
5
+ * `init()` once, if present; omitting one retrieves.
9
6
  */
10
7
  export declare const store: <T extends Record<string, any>>(name: string, value?: T) => T;
@@ -1,10 +1,7 @@
1
1
  export declare const stores: Record<string, any>;
2
2
  /**
3
- * Register or retrieve a global store, shared across all apps and available
4
- * to every expression as $store.<name>.
5
- *
6
- * store('cart', { items: [], add(i) { this.items.push(i) } }) registers a
7
- * reactive store (an init() method, if present, runs once on registration);
8
- * store('cart') retrieves it.
3
+ * Register or retrieve a global store, shared across apps and exposed to every
4
+ * expression as `$store.<name>`. Passing a value registers it and runs its
5
+ * `init()` once, if present; omitting one retrieves.
9
6
  */
10
7
  export declare const store: <T extends Record<string, any>>(name: string, value?: T) => T;
@@ -1,7 +1,7 @@
1
1
  export declare const checkAttr: (el: Element, name: string) => string | null;
2
2
  /**
3
- * Adds a listener and hands back a remover. Callers are expected to use it:
4
- * `app.unmount(el)` tears down a region whose elements stay in the document, so
5
- * a listener left behind would keep driving markup that is meant to be inert.
3
+ * Adds a listener and returns a remover. Callers are expected to use it:
4
+ * `app.unmount(el)` leaves elements in the document, so a listener left behind
5
+ * would keep driving markup meant to be inert.
6
6
  */
7
7
  export declare const listen: (el: Element, event: string, handler: any, options?: any) => () => void;
@@ -1,7 +1,7 @@
1
1
  export declare const checkAttr: (el: Element, name: string) => string | null;
2
2
  /**
3
- * Adds a listener and hands back a remover. Callers are expected to use it:
4
- * `app.unmount(el)` tears down a region whose elements stay in the document, so
5
- * a listener left behind would keep driving markup that is meant to be inert.
3
+ * Adds a listener and returns a remover. Callers are expected to use it:
4
+ * `app.unmount(el)` leaves elements in the document, so a listener left behind
5
+ * would keep driving markup meant to be inert.
6
6
  */
7
7
  export declare const listen: (el: Element, event: string, handler: any, options?: any) => () => void;
@@ -1,16 +1,14 @@
1
1
  /**
2
2
  * Development warnings.
3
3
  *
4
- * Every call site is guarded by `import.meta.env.DEV`, and the guard is what
5
- * removes them: the production build replaces that constant and terser drops
6
- * the branch, so neither these functions nor their message strings reach a
7
- * shipped bundle. Warnings are therefore free to be wordy — a warning that
8
- * does not say what to do instead is barely worth the bytes it does not cost.
4
+ * Every call site is guarded by `import.meta.env.DEV`; the production build
5
+ * replaces that constant and terser drops the branch, so neither these
6
+ * functions nor their strings ship. Messages are therefore free to be wordy —
7
+ * say what to do instead.
9
8
  */
10
9
  export declare const warn: (msg: string) => void;
11
10
  /**
12
- * Warns once per `key`. Most of these fire from effects, which re-run on every
13
- * relevant state change — without this a single mistake would print on every
14
- * keystroke and train the reader to ignore the console.
11
+ * Warns once per `key`. Most callers are effects, which re-run on every
12
+ * relevant change — one mistake would otherwise print on every keystroke.
15
13
  */
16
14
  export declare const warnOnce: (key: string, msg: string) => void;
@@ -1,16 +1,14 @@
1
1
  /**
2
2
  * Development warnings.
3
3
  *
4
- * Every call site is guarded by `import.meta.env.DEV`, and the guard is what
5
- * removes them: the production build replaces that constant and terser drops
6
- * the branch, so neither these functions nor their message strings reach a
7
- * shipped bundle. Warnings are therefore free to be wordy — a warning that
8
- * does not say what to do instead is barely worth the bytes it does not cost.
4
+ * Every call site is guarded by `import.meta.env.DEV`; the production build
5
+ * replaces that constant and terser drops the branch, so neither these
6
+ * functions nor their strings ship. Messages are therefore free to be wordy —
7
+ * say what to do instead.
9
8
  */
10
9
  export declare const warn: (msg: string) => void;
11
10
  /**
12
- * Warns once per `key`. Most of these fire from effects, which re-run on every
13
- * relevant state change — without this a single mistake would print on every
14
- * keystroke and train the reader to ignore the console.
11
+ * Warns once per `key`. Most callers are effects, which re-run on every
12
+ * relevant change — one mistake would otherwise print on every keystroke.
15
13
  */
16
14
  export declare const warnOnce: (key: string, msg: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aevantec/litevue",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,6 +22,7 @@
22
22
  ".": {
23
23
  "import": {
24
24
  "types": "./dist/types/index.d.mts",
25
+ "development": "./dist/litevue.dev.mjs",
25
26
  "default": "./dist/litevue.mjs"
26
27
  },
27
28
  "require": {
@@ -32,6 +33,7 @@
32
33
  "./plugins": {
33
34
  "import": {
34
35
  "types": "./dist/types/plugins/index.d.mts",
36
+ "development": "./dist/litevue-plugins.dev.mjs",
35
37
  "default": "./dist/litevue-plugins.mjs"
36
38
  },
37
39
  "require": {
@@ -92,6 +94,7 @@
92
94
  "./plugins/media": {
93
95
  "import": {
94
96
  "types": "./dist/types/plugins/media/index.d.mts",
97
+ "development": "./dist/plugins/media.dev.mjs",
95
98
  "default": "./dist/plugins/media.mjs"
96
99
  },
97
100
  "require": {
@@ -102,6 +105,7 @@
102
105
  "./plugins/morph": {
103
106
  "import": {
104
107
  "types": "./dist/types/plugins/morph/index.d.mts",
108
+ "development": "./dist/plugins/morph.dev.mjs",
105
109
  "default": "./dist/plugins/morph.mjs"
106
110
  },
107
111
  "require": {
@@ -112,6 +116,7 @@
112
116
  "./plugins/persist": {
113
117
  "import": {
114
118
  "types": "./dist/types/plugins/persist/index.d.mts",
119
+ "development": "./dist/plugins/persist.dev.mjs",
115
120
  "default": "./dist/plugins/persist.mjs"
116
121
  },
117
122
  "require": {
@@ -181,11 +186,14 @@
181
186
  },
182
187
  "scripts": {
183
188
  "dev": "vite",
184
- "build": "vite build && vite build --config vite.devtools.config.mts && vite build --config vite.plugins.config.mts && node scripts/build-plugins.mjs && pnpm build:types",
189
+ "build": "vite build && vite build --mode dev-bundle && vite build --config vite.devtools.config.mts && vite build --config vite.plugins.config.mts && vite build --config vite.plugins.config.mts --mode dev-bundle && node scripts/build-plugins.mjs && pnpm build:types",
185
190
  "build:types": "tsc --emitDeclarationOnly && mv dist/src dist/types && node scripts/build-types.mjs",
191
+ "lint": "oxlint --deny-warnings src test scripts",
186
192
  "lint:package": "publint --strict && attw --pack .",
187
193
  "check:bundles": "node scripts/check-bundles.mjs",
194
+ "check:dist-runtime": "node scripts/check-dist-runtime.mjs",
188
195
  "check:docs-versions": "node scripts/check-docs-versions.mjs",
196
+ "check:docs-sizes": "node scripts/check-docs-sizes.mjs",
189
197
  "prepublishOnly": "pnpm build && publint --strict",
190
198
  "docs:dev": "vitepress dev docs",
191
199
  "docs:build": "vitepress build docs",
@@ -233,6 +241,7 @@
233
241
  "@vitest/coverage-v8": "^4.1.11",
234
242
  "@vue/shared": "~3.4.0",
235
243
  "jsdom": "^30.0.1",
244
+ "oxlint": "^1.80.0",
236
245
  "playwright": "^1.62.1",
237
246
  "prettier": "^3.4.0",
238
247
  "publint": "^0.3.24",