@aevantec/litevue 0.5.4 → 0.5.5

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/dist/litevue-devtools.iife.js +1 -1
  2. package/dist/litevue-devtools.mjs +1 -853
  3. package/dist/litevue-devtools.umd.js +1 -1
  4. package/dist/litevue-plugins.iife.js +1 -1
  5. package/dist/litevue-plugins.mjs +1 -717
  6. package/dist/litevue-plugins.umd.js +1 -1
  7. package/dist/litevue.iife.js +1 -12
  8. package/dist/litevue.mjs +1 -1890
  9. package/dist/litevue.umd.js +1 -12
  10. package/dist/plugins/collapse.iife.js +1 -1
  11. package/dist/plugins/collapse.mjs +1 -46
  12. package/dist/plugins/collapse.umd.js +1 -1
  13. package/dist/plugins/focus.iife.js +1 -1
  14. package/dist/plugins/focus.mjs +1 -69
  15. package/dist/plugins/focus.umd.js +1 -1
  16. package/dist/plugins/intersect.iife.js +1 -1
  17. package/dist/plugins/intersect.mjs +1 -20
  18. package/dist/plugins/intersect.umd.js +1 -1
  19. package/dist/plugins/mask.iife.js +1 -1
  20. package/dist/plugins/mask.mjs +1 -37
  21. package/dist/plugins/mask.umd.js +1 -1
  22. package/dist/plugins/media.iife.js +1 -1
  23. package/dist/plugins/media.mjs +1 -204
  24. package/dist/plugins/media.umd.js +1 -1
  25. package/dist/plugins/morph.iife.js +1 -1
  26. package/dist/plugins/morph.mjs +1 -174
  27. package/dist/plugins/morph.umd.js +1 -1
  28. package/dist/plugins/persist.iife.js +1 -1
  29. package/dist/plugins/persist.mjs +1 -86
  30. package/dist/plugins/persist.umd.js +1 -1
  31. package/dist/plugins/resize.iife.js +1 -1
  32. package/dist/plugins/resize.mjs +1 -15
  33. package/dist/plugins/resize.umd.js +1 -1
  34. package/dist/plugins/transition.iife.js +1 -1
  35. package/dist/plugins/transition.mjs +1 -76
  36. package/dist/plugins/transition.umd.js +1 -1
  37. package/dist/types/app.d.mts +30 -2
  38. package/dist/types/app.d.ts +30 -2
  39. package/dist/types/block.d.mts +7 -0
  40. package/dist/types/block.d.ts +7 -0
  41. package/dist/types/context.d.mts +7 -0
  42. package/dist/types/context.d.ts +7 -0
  43. package/dist/types/index.d.mts +1 -1
  44. package/dist/types/index.d.ts +1 -1
  45. package/dist/types/ownership.d.mts +30 -0
  46. package/dist/types/ownership.d.ts +30 -0
  47. package/dist/types/plugins/media/index.d.mts +0 -4
  48. package/dist/types/plugins/media/index.d.ts +0 -4
  49. package/dist/types/scheduler.d.mts +3 -0
  50. package/dist/types/scheduler.d.ts +3 -0
  51. package/dist/types/warn.d.mts +16 -0
  52. package/dist/types/warn.d.ts +16 -0
  53. package/package.json +15 -8
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Per-node disposal.
3
+ *
4
+ * Effects and cleanups are owned by a Context, and a Context spans everything
5
+ * between one `v-scope` and the next. That is the right boundary for
6
+ * `app.unmount(el)`, which tears down whole regions, but it is the wrong one
7
+ * for a node removed on its own: morph detaches nodes directly, so a node
8
+ * leaves the DOM while its effects stay in an array that is still alive and
9
+ * still reacting.
10
+ *
11
+ * This records what each node acquired while it was walked, so a removed
12
+ * subtree can be disposed precisely without giving every node a Context.
13
+ */
14
+ type Disposer = () => void;
15
+ export declare const setOwner: (node: Node | undefined) => Node | undefined;
16
+ /**
17
+ * Registers a disposer against `node`, defaulting to the node being walked.
18
+ *
19
+ * The explicit form exists because a directive may outlive the element it was
20
+ * written on: `v-if` and `v-for` both detach that element and render from an
21
+ * anchor, so their own effects have to be owned by a node that stays in the
22
+ * tree, not by the template they removed.
23
+ */
24
+ export declare const own: (dispose: Disposer, node?: Node | undefined) => void;
25
+ /**
26
+ * Disposes `node` and everything under it. Safe to call on a node that never
27
+ * acquired anything, and safe to call twice — the record is dropped as it runs.
28
+ */
29
+ export declare const disposeSubtree: (node: Node) => void;
30
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Per-node disposal.
3
+ *
4
+ * Effects and cleanups are owned by a Context, and a Context spans everything
5
+ * between one `v-scope` and the next. That is the right boundary for
6
+ * `app.unmount(el)`, which tears down whole regions, but it is the wrong one
7
+ * for a node removed on its own: morph detaches nodes directly, so a node
8
+ * leaves the DOM while its effects stay in an array that is still alive and
9
+ * still reacting.
10
+ *
11
+ * This records what each node acquired while it was walked, so a removed
12
+ * subtree can be disposed precisely without giving every node a Context.
13
+ */
14
+ type Disposer = () => void;
15
+ export declare const setOwner: (node: Node | undefined) => Node | undefined;
16
+ /**
17
+ * Registers a disposer against `node`, defaulting to the node being walked.
18
+ *
19
+ * The explicit form exists because a directive may outlive the element it was
20
+ * written on: `v-if` and `v-for` both detach that element and render from an
21
+ * anchor, so their own effects have to be owned by a node that stays in the
22
+ * tree, not by the template they removed.
23
+ */
24
+ export declare const own: (dispose: Disposer, node?: Node | undefined) => void;
25
+ /**
26
+ * Disposes `node` and everything under it. Safe to call on a node that never
27
+ * acquired anything, and safe to call twice — the record is dropped as it runs.
28
+ */
29
+ export declare const disposeSubtree: (node: Node) => void;
30
+ export {};
@@ -38,9 +38,5 @@ export interface Mq {
38
38
  configure(options: MediaOptions): void;
39
39
  }
40
40
  export declare const mq: Mq;
41
- /**
42
- * Test seam. Drops every subscription and returns to the default scale, so a
43
- * suite can swap its matchMedia stub between cases.
44
- */
45
41
  export declare const resetMedia: () => void;
46
42
  export declare const media: Plugin<MediaOptions>;
@@ -38,9 +38,5 @@ export interface Mq {
38
38
  configure(options: MediaOptions): void;
39
39
  }
40
40
  export declare const mq: Mq;
41
- /**
42
- * Test seam. Drops every subscription and returns to the default scale, so a
43
- * suite can swap its matchMedia stub between cases.
44
- */
45
41
  export declare const resetMedia: () => void;
46
42
  export declare const media: Plugin<MediaOptions>;
@@ -1,2 +1,5 @@
1
+ import { type ReactiveEffectRunner } from '@vue/reactivity';
2
+ /** Stops an effect and remembers that it is stopped. Use instead of `stop`. */
3
+ export declare const stopEffect: (runner: ReactiveEffectRunner) => void;
1
4
  export declare const nextTick: (fn: () => void) => Promise<void>;
2
5
  export declare const queueJob: (job: Function) => void;
@@ -1,2 +1,5 @@
1
+ import { type ReactiveEffectRunner } from '@vue/reactivity';
2
+ /** Stops an effect and remembers that it is stopped. Use instead of `stop`. */
3
+ export declare const stopEffect: (runner: ReactiveEffectRunner) => void;
1
4
  export declare const nextTick: (fn: () => void) => Promise<void>;
2
5
  export declare const queueJob: (job: Function) => void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Development warnings.
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.
9
+ */
10
+ export declare const warn: (msg: string) => void;
11
+ /**
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.
15
+ */
16
+ export declare const warnOnce: (key: string, msg: string) => void;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Development warnings.
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.
9
+ */
10
+ export declare const warn: (msg: string) => void;
11
+ /**
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.
15
+ */
16
+ 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.4",
3
+ "version": "0.5.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -192,7 +192,10 @@
192
192
  "docs:preview": "vitepress preview docs",
193
193
  "format": "prettier --write \"**/*.{ts,mts,js,html,json}\"",
194
194
  "test": "vitest run",
195
- "test:watch": "vitest"
195
+ "test:browser": "vitest run --config vitest.browser.config.mts",
196
+ "coverage": "vitest run --coverage",
197
+ "test:watch": "vitest",
198
+ "check:size": "node scripts/check-size.mjs"
196
199
  },
197
200
  "repository": {
198
201
  "type": "git",
@@ -225,15 +228,19 @@
225
228
  },
226
229
  "devDependencies": {
227
230
  "@arethetypeswrong/cli": "^0.18.5",
231
+ "@vitest/browser": "^4.1.11",
232
+ "@vitest/browser-playwright": "^4.1.11",
233
+ "@vitest/coverage-v8": "^4.1.11",
228
234
  "@vue/shared": "~3.4.0",
229
- "jsdom": "^25.0.1",
235
+ "jsdom": "^30.0.1",
236
+ "playwright": "^1.62.1",
230
237
  "prettier": "^3.4.0",
231
- "publint": "^0.3.22",
232
- "terser": "^5.36.0",
233
- "typescript": "^5.6.0",
234
- "vite": "^5.4.0",
238
+ "publint": "^0.3.24",
239
+ "terser": "^5.50.0",
240
+ "typescript": "^7.0.2",
241
+ "vite": "^8.2.2",
235
242
  "vitepress": "^1.6.4",
236
- "vitest": "^2.1.9"
243
+ "vitest": "^4.1.11"
237
244
  },
238
245
  "contributors": [
239
246
  "Evan You (petite-vue, which this is forked from)"