@aevantec/litevue 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +73 -0
  3. package/dist/litevue-devtools.iife.js +1 -0
  4. package/dist/litevue-devtools.mjs +841 -0
  5. package/dist/litevue-devtools.umd.js +1 -0
  6. package/dist/litevue-plugins.iife.js +14 -0
  7. package/dist/litevue-plugins.mjs +1282 -0
  8. package/dist/litevue-plugins.umd.js +14 -0
  9. package/dist/litevue.iife.js +12 -0
  10. package/dist/litevue.mjs +1781 -0
  11. package/dist/litevue.umd.js +12 -0
  12. package/dist/types/app.d.mts +21 -0
  13. package/dist/types/app.d.ts +21 -0
  14. package/dist/types/block.d.mts +15 -0
  15. package/dist/types/block.d.ts +15 -0
  16. package/dist/types/context.d.mts +17 -0
  17. package/dist/types/context.d.ts +17 -0
  18. package/dist/types/devtools-panel.d.mts +1 -0
  19. package/dist/types/devtools-panel.d.ts +1 -0
  20. package/dist/types/devtools.d.mts +62 -0
  21. package/dist/types/devtools.d.ts +62 -0
  22. package/dist/types/directives/bind.d.mts +4 -0
  23. package/dist/types/directives/bind.d.ts +4 -0
  24. package/dist/types/directives/effect.d.mts +2 -0
  25. package/dist/types/directives/effect.d.ts +2 -0
  26. package/dist/types/directives/for.d.mts +2 -0
  27. package/dist/types/directives/for.d.ts +2 -0
  28. package/dist/types/directives/html.d.mts +2 -0
  29. package/dist/types/directives/html.d.ts +2 -0
  30. package/dist/types/directives/if.d.mts +2 -0
  31. package/dist/types/directives/if.d.ts +2 -0
  32. package/dist/types/directives/index.d.mts +15 -0
  33. package/dist/types/directives/index.d.ts +15 -0
  34. package/dist/types/directives/model.d.mts +2 -0
  35. package/dist/types/directives/model.d.ts +2 -0
  36. package/dist/types/directives/on.d.mts +2 -0
  37. package/dist/types/directives/on.d.ts +2 -0
  38. package/dist/types/directives/ref.d.mts +2 -0
  39. package/dist/types/directives/ref.d.ts +2 -0
  40. package/dist/types/directives/show.d.mts +2 -0
  41. package/dist/types/directives/show.d.ts +2 -0
  42. package/dist/types/directives/text.d.mts +3 -0
  43. package/dist/types/directives/text.d.ts +3 -0
  44. package/dist/types/effect.d.mts +15 -0
  45. package/dist/types/effect.d.ts +15 -0
  46. package/dist/types/eval.d.mts +2 -0
  47. package/dist/types/eval.d.ts +2 -0
  48. package/dist/types/index.d.mts +8 -0
  49. package/dist/types/index.d.ts +8 -0
  50. package/dist/types/magics.d.mts +13 -0
  51. package/dist/types/magics.d.ts +13 -0
  52. package/dist/types/plugins/collapse.d.mts +10 -0
  53. package/dist/types/plugins/collapse.d.ts +10 -0
  54. package/dist/types/plugins/focus.d.mts +15 -0
  55. package/dist/types/plugins/focus.d.ts +15 -0
  56. package/dist/types/plugins/index.d.mts +7 -0
  57. package/dist/types/plugins/index.d.ts +7 -0
  58. package/dist/types/plugins/intersect.d.mts +11 -0
  59. package/dist/types/plugins/intersect.d.ts +11 -0
  60. package/dist/types/plugins/mask.d.mts +8 -0
  61. package/dist/types/plugins/mask.d.ts +8 -0
  62. package/dist/types/plugins/persist.d.mts +59 -0
  63. package/dist/types/plugins/persist.d.ts +59 -0
  64. package/dist/types/plugins/transition.d.mts +17 -0
  65. package/dist/types/plugins/transition.d.ts +17 -0
  66. package/dist/types/scheduler.d.mts +2 -0
  67. package/dist/types/scheduler.d.ts +2 -0
  68. package/dist/types/store.d.mts +10 -0
  69. package/dist/types/store.d.ts +10 -0
  70. package/dist/types/utils.d.mts +2 -0
  71. package/dist/types/utils.d.ts +2 -0
  72. package/dist/types/walk.d.mts +3 -0
  73. package/dist/types/walk.d.ts +3 -0
  74. package/package.json +124 -0
@@ -0,0 +1,8 @@
1
+ import type { Plugin } from '../app.mjs';
2
+ /**
3
+ * v-mask="(999) 999-9999" — formats the input's value as the user types.
4
+ * The attribute value is the literal mask (not evaluated). Tokens:
5
+ * 9 = digit, a = letter, * = alphanumeric; every other character is a
6
+ * literal. Works together with v-model, which receives the masked value.
7
+ */
8
+ export declare const mask: Plugin;
@@ -0,0 +1,8 @@
1
+ import type { Plugin } from '../app';
2
+ /**
3
+ * v-mask="(999) 999-9999" — formats the input's value as the user types.
4
+ * The attribute value is the literal mask (not evaluated). Tokens:
5
+ * 9 = digit, a = letter, * = alphanumeric; every other character is a
6
+ * literal. Works together with v-model, which receives the masked value.
7
+ */
8
+ export declare const mask: Plugin;
@@ -0,0 +1,59 @@
1
+ import type { Plugin } from '../app.mjs';
2
+ /** The slice of the Web Storage API persistence needs. */
3
+ export interface PersistStorage {
4
+ getItem(key: string): string | null;
5
+ setItem(key: string, value: string): void;
6
+ }
7
+ /**
8
+ * Register a custom storage under a name, so it can be selected by name from
9
+ * anywhere — including as a directive modifier:
10
+ *
11
+ * registerStorage('memory', myMemoryStorage);
12
+ * persistStore('scratch', { storage: 'memory' });
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
+ */
18
+ export declare const registerStorage: (name: string, storage: PersistStorage) => void;
19
+ /**
20
+ * Switch the storage used when none is specified. Accepts a registered name
21
+ * ('local', 'session', or your own) or a storage object.
22
+ *
23
+ * setDefaultStorage('session'); // everything defaults to sessionStorage
24
+ */
25
+ export declare const setDefaultStorage: (storage: PersistStorage | string) => void;
26
+ /**
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.
30
+ *
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.
33
+ *
34
+ * An argument narrows what is stored to specific properties:
35
+ * v-persist:draft="composer" — only `draft`
36
+ * 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"
42
+ */
43
+ export declare const persist: Plugin;
44
+ /**
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.
48
+ *
49
+ * persistStore('cart') // the whole store
50
+ * persistStore('cart', { keys: ['items'] }) // only these properties
51
+ * persistStore('cart', { key: 'v2:cart' }) // custom storage key
52
+ * persistStore('draft', { storage: 'session' }) // a different storage
53
+ * persistStore('scratch', { storage: myStorage }) // any getItem/setItem
54
+ */
55
+ export declare const persistStore: (name: string, options?: {
56
+ key?: string;
57
+ keys?: string[];
58
+ storage?: PersistStorage | string;
59
+ }) => () => void;
@@ -0,0 +1,59 @@
1
+ import type { Plugin } from '../app';
2
+ /** The slice of the Web Storage API persistence needs. */
3
+ export interface PersistStorage {
4
+ getItem(key: string): string | null;
5
+ setItem(key: string, value: string): void;
6
+ }
7
+ /**
8
+ * Register a custom storage under a name, so it can be selected by name from
9
+ * anywhere — including as a directive modifier:
10
+ *
11
+ * registerStorage('memory', myMemoryStorage);
12
+ * persistStore('scratch', { storage: 'memory' });
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
+ */
18
+ export declare const registerStorage: (name: string, storage: PersistStorage) => void;
19
+ /**
20
+ * Switch the storage used when none is specified. Accepts a registered name
21
+ * ('local', 'session', or your own) or a storage object.
22
+ *
23
+ * setDefaultStorage('session'); // everything defaults to sessionStorage
24
+ */
25
+ export declare const setDefaultStorage: (storage: PersistStorage | string) => void;
26
+ /**
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.
30
+ *
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.
33
+ *
34
+ * An argument narrows what is stored to specific properties:
35
+ * v-persist:draft="composer" — only `draft`
36
+ * 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"
42
+ */
43
+ export declare const persist: Plugin;
44
+ /**
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.
48
+ *
49
+ * persistStore('cart') // the whole store
50
+ * persistStore('cart', { keys: ['items'] }) // only these properties
51
+ * persistStore('cart', { key: 'v2:cart' }) // custom storage key
52
+ * persistStore('draft', { storage: 'session' }) // a different storage
53
+ * persistStore('scratch', { storage: myStorage }) // any getItem/setItem
54
+ */
55
+ export declare const persistStore: (name: string, options?: {
56
+ key?: string;
57
+ keys?: string[];
58
+ storage?: PersistStorage | string;
59
+ }) => () => void;
@@ -0,0 +1,17 @@
1
+ import type { Plugin } from '../app.mjs';
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).
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.
16
+ */
17
+ export declare const transition: Plugin;
@@ -0,0 +1,17 @@
1
+ import type { Plugin } from '../app';
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).
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.
16
+ */
17
+ export declare const transition: Plugin;
@@ -0,0 +1,2 @@
1
+ export declare const nextTick: (fn: () => void) => Promise<void>;
2
+ export declare const queueJob: (job: Function) => void;
@@ -0,0 +1,2 @@
1
+ export declare const nextTick: (fn: () => void) => Promise<void>;
2
+ export declare const queueJob: (job: Function) => void;
@@ -0,0 +1,10 @@
1
+ export declare const stores: Record<string, any>;
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.
9
+ */
10
+ export declare const store: <T extends Record<string, any>>(name: string, value?: T) => T;
@@ -0,0 +1,10 @@
1
+ export declare const stores: Record<string, any>;
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.
9
+ */
10
+ export declare const store: <T extends Record<string, any>>(name: string, value?: T) => T;
@@ -0,0 +1,2 @@
1
+ export declare const checkAttr: (el: Element, name: string) => string | null;
2
+ export declare const listen: (el: Element, event: string, handler: any, options?: any) => void;
@@ -0,0 +1,2 @@
1
+ export declare const checkAttr: (el: Element, name: string) => string | null;
2
+ export declare const listen: (el: Element, event: string, handler: any, options?: any) => void;
@@ -0,0 +1,3 @@
1
+ import { Context } from './context.mjs';
2
+ export declare let inOnce: boolean;
3
+ export declare const walk: (node: Node, ctx: Context) => ChildNode | null | void;
@@ -0,0 +1,3 @@
1
+ import { Context } from './context';
2
+ export declare let inOnce: boolean;
3
+ export declare const walk: (node: Node, ctx: Context) => ChildNode | null | void;
package/package.json ADDED
@@ -0,0 +1,124 @@
1
+ {
2
+ "name": "@aevantec/litevue",
3
+ "version": "0.5.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "Lightweight subset of Vue optimized for progressive enhancement. A fork of petite-vue with devtools.",
8
+ "type": "commonjs",
9
+ "//sideEffects": "The core auto-mounts when its script tag has `init`, and the devtools panel self-initializes on import \u2014 both are real import side effects and must not be tree-shaken. The plugins bundle is pure, so bundlers may drop unused plugins.",
10
+ "sideEffects": [
11
+ "./dist/litevue.*",
12
+ "./dist/litevue-devtools.*"
13
+ ],
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "main": "dist/litevue.umd.js",
18
+ "unpkg": "dist/litevue.iife.js",
19
+ "jsdelivr": "dist/litevue.iife.js",
20
+ "module": "./dist/litevue.mjs",
21
+ "exports": {
22
+ ".": {
23
+ "import": {
24
+ "types": "./dist/types/index.d.mts",
25
+ "default": "./dist/litevue.mjs"
26
+ },
27
+ "require": {
28
+ "types": "./dist/types/index.d.ts",
29
+ "default": "./dist/litevue.umd.js"
30
+ }
31
+ },
32
+ "./plugins": {
33
+ "import": {
34
+ "types": "./dist/types/plugins/index.d.mts",
35
+ "default": "./dist/litevue-plugins.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./dist/types/plugins/index.d.ts",
39
+ "default": "./dist/litevue-plugins.umd.js"
40
+ }
41
+ },
42
+ "./devtools": {
43
+ "import": {
44
+ "types": "./dist/types/devtools-panel.d.mts",
45
+ "default": "./dist/litevue-devtools.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./dist/types/devtools-panel.d.ts",
49
+ "default": "./dist/litevue-devtools.umd.js"
50
+ }
51
+ },
52
+ "./package.json": "./package.json"
53
+ },
54
+ "types": "./dist/types/index.d.ts",
55
+ "typesVersions": {
56
+ "*": {
57
+ "plugins": [
58
+ "./dist/types/plugins/index.d.ts"
59
+ ],
60
+ "devtools": [
61
+ "./dist/types/devtools-panel.d.ts"
62
+ ]
63
+ }
64
+ },
65
+ "scripts": {
66
+ "dev": "vite",
67
+ "build": "vite build && vite build --config vite.devtools.config.mts && vite build --config vite.plugins.config.mts && pnpm build:types",
68
+ "build:types": "tsc --emitDeclarationOnly && mv dist/src dist/types && node scripts/build-types.mjs",
69
+ "lint:package": "publint --strict && attw --pack .",
70
+ "prepublishOnly": "pnpm build && publint --strict",
71
+ "docs:dev": "vitepress dev docs",
72
+ "docs:build": "vitepress build docs",
73
+ "docs:preview": "vitepress preview docs",
74
+ "format": "prettier --write \"**/*.{ts,mts,js,html,json}\"",
75
+ "test": "vitest run",
76
+ "test:watch": "vitest"
77
+ },
78
+ "repository": {
79
+ "type": "git",
80
+ "url": "git+https://github.com/aevantec/litevue.git"
81
+ },
82
+ "keywords": [
83
+ "vue",
84
+ "petite-vue",
85
+ "litevue",
86
+ "alpine",
87
+ "alpinejs",
88
+ "progressive-enhancement",
89
+ "reactivity",
90
+ "directives",
91
+ "no-build",
92
+ "devtools",
93
+ "lightweight",
94
+ "frontend"
95
+ ],
96
+ "author": "abiacarl <abiacarl@gmail.com>",
97
+ "license": "MIT",
98
+ "bugs": {
99
+ "url": "https://github.com/aevantec/litevue/issues"
100
+ },
101
+ "homepage": "https://github.com/aevantec/litevue#readme",
102
+ "engines": {
103
+ "node": ">=18"
104
+ },
105
+ "packageManager": "pnpm@10.30.3",
106
+ "dependencies": {
107
+ "@vue/reactivity": "~3.4.0"
108
+ },
109
+ "devDependencies": {
110
+ "@arethetypeswrong/cli": "^0.18.5",
111
+ "@vue/shared": "~3.4.0",
112
+ "jsdom": "^25.0.1",
113
+ "prettier": "^3.4.0",
114
+ "publint": "^0.3.22",
115
+ "terser": "^5.36.0",
116
+ "typescript": "^5.6.0",
117
+ "vite": "^5.4.0",
118
+ "vitepress": "^1.6.4",
119
+ "vitest": "^2.1.9"
120
+ },
121
+ "contributors": [
122
+ "Evan You (petite-vue, which this is forked from)"
123
+ ]
124
+ }