@aevantec/litevue 0.5.3 → 0.5.4
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.
- package/dist/litevue-plugins.iife.js +1 -1
- package/dist/litevue-plugins.mjs +232 -8
- package/dist/litevue-plugins.umd.js +1 -1
- package/dist/litevue.iife.js +2 -2
- package/dist/litevue.mjs +46 -17
- package/dist/litevue.umd.js +2 -2
- package/dist/plugins/collapse.iife.js +1 -0
- package/dist/plugins/collapse.mjs +46 -0
- package/dist/plugins/collapse.umd.js +1 -0
- package/dist/plugins/focus.iife.js +1 -0
- package/dist/plugins/focus.mjs +69 -0
- package/dist/plugins/focus.umd.js +1 -0
- package/dist/plugins/intersect.iife.js +1 -0
- package/dist/plugins/intersect.mjs +20 -0
- package/dist/plugins/intersect.umd.js +1 -0
- package/dist/plugins/mask.iife.js +1 -0
- package/dist/plugins/mask.mjs +37 -0
- package/dist/plugins/mask.umd.js +1 -0
- package/dist/plugins/media.iife.js +1 -0
- package/dist/plugins/media.mjs +204 -0
- package/dist/plugins/media.umd.js +1 -0
- package/dist/plugins/morph.iife.js +1 -0
- package/dist/plugins/morph.mjs +174 -0
- package/dist/plugins/morph.umd.js +1 -0
- package/dist/plugins/persist.iife.js +1 -0
- package/dist/plugins/persist.mjs +86 -0
- package/dist/plugins/persist.umd.js +1 -0
- package/dist/plugins/resize.iife.js +1 -0
- package/dist/plugins/resize.mjs +15 -0
- package/dist/plugins/resize.umd.js +1 -0
- package/dist/plugins/transition.iife.js +1 -0
- package/dist/plugins/transition.mjs +76 -0
- package/dist/plugins/transition.umd.js +1 -0
- package/dist/types/app.d.mts +5 -1
- package/dist/types/app.d.ts +5 -1
- package/dist/types/plugins/{collapse.d.mts → collapse/index.d.mts} +1 -1
- package/dist/types/plugins/{collapse.d.ts → collapse/index.d.ts} +1 -1
- package/dist/types/plugins/{focus.d.mts → focus/index.d.mts} +1 -1
- package/dist/types/plugins/{focus.d.ts → focus/index.d.ts} +1 -1
- package/dist/types/plugins/index.d.mts +12 -9
- package/dist/types/plugins/index.d.ts +3 -0
- package/dist/types/plugins/{intersect.d.mts → intersect/index.d.mts} +1 -1
- package/dist/types/plugins/{intersect.d.ts → intersect/index.d.ts} +1 -1
- package/dist/types/plugins/{mask.d.mts → mask/index.d.mts} +1 -1
- package/dist/types/plugins/{mask.d.ts → mask/index.d.ts} +1 -1
- package/dist/types/plugins/media/index.d.mts +46 -0
- package/dist/types/plugins/media/index.d.ts +46 -0
- package/dist/types/plugins/{morph.d.mts → morph/index.d.mts} +1 -1
- package/dist/types/plugins/{morph.d.ts → morph/index.d.ts} +1 -1
- package/dist/types/plugins/{persist.d.mts → persist/index.d.mts} +1 -1
- package/dist/types/plugins/{persist.d.ts → persist/index.d.ts} +1 -1
- package/dist/types/plugins/resize/index.d.mts +12 -0
- package/dist/types/plugins/resize/index.d.ts +12 -0
- package/dist/types/plugins/{transition.d.mts → transition/index.d.mts} +1 -1
- package/dist/types/plugins/{transition.d.ts → transition/index.d.ts} +1 -1
- package/dist/types/utils.d.mts +6 -1
- package/dist/types/utils.d.ts +6 -1
- package/package.json +120 -4
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
export { intersect } from './intersect.mjs';
|
|
2
|
-
export { mask } from './mask.mjs';
|
|
3
|
-
export { transition } from './transition.mjs';
|
|
4
|
-
export { persist, persistStore, registerStorage, setDefaultStorage, } from './persist.mjs';
|
|
5
|
-
export type { PersistStorage } from './persist.mjs';
|
|
6
|
-
export { focus } from './focus.mjs';
|
|
7
|
-
export { collapse } from './collapse.mjs';
|
|
8
|
-
export { morph, morphPlugin } from './morph.mjs';
|
|
9
|
-
export type { MorphOptions } from './morph.mjs';
|
|
1
|
+
export { intersect } from './intersect/index.mjs';
|
|
2
|
+
export { mask } from './mask/index.mjs';
|
|
3
|
+
export { transition } from './transition/index.mjs';
|
|
4
|
+
export { persist, persistStore, registerStorage, setDefaultStorage, } from './persist/index.mjs';
|
|
5
|
+
export type { PersistStorage } from './persist/index.mjs';
|
|
6
|
+
export { focus } from './focus/index.mjs';
|
|
7
|
+
export { collapse } from './collapse/index.mjs';
|
|
8
|
+
export { morph, morphPlugin } from './morph/index.mjs';
|
|
9
|
+
export type { MorphOptions } from './morph/index.mjs';
|
|
10
|
+
export { media, mq, resetMedia, defaultBreakpoints } from './media/index.mjs';
|
|
11
|
+
export { resize } from './resize/index.mjs';
|
|
12
|
+
export type { MediaOptions, Breakpoints, ResponsiveMap, Device, Mq, } from './media/index.mjs';
|
|
@@ -7,3 +7,6 @@ export { focus } from './focus';
|
|
|
7
7
|
export { collapse } from './collapse';
|
|
8
8
|
export { morph, morphPlugin } from './morph';
|
|
9
9
|
export type { MorphOptions } from './morph';
|
|
10
|
+
export { media, mq, resetMedia, defaultBreakpoints } from './media';
|
|
11
|
+
export { resize } from './resize';
|
|
12
|
+
export type { MediaOptions, Breakpoints, ResponsiveMap, Device, Mq, } from './media';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Plugin } from '../../app.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Viewport-driven behaviour — the cases CSS genuinely cannot serve: values
|
|
4
|
+
* handed to JavaScript, structural branches, skipping expensive init on small
|
|
5
|
+
* screens. Appearance still belongs in a stylesheet, which applies before
|
|
6
|
+
* first paint; this runs after it.
|
|
7
|
+
*/
|
|
8
|
+
export type Breakpoints = Record<string, number>;
|
|
9
|
+
export interface MediaOptions {
|
|
10
|
+
/** Replaces the default scale wholesale rather than merging into it. */
|
|
11
|
+
breakpoints?: Breakpoints;
|
|
12
|
+
}
|
|
13
|
+
/** A responsive map: breakpoint key to value, mobile-first. */
|
|
14
|
+
export type ResponsiveMap<T = any> = Record<string | number, T>;
|
|
15
|
+
export type Device = 'mobile' | 'tablet' | 'desktop';
|
|
16
|
+
/**
|
|
17
|
+
* The scale in use until something calls `configure()`. Exported because
|
|
18
|
+
* `configure()` replaces rather than merges: adjusting one breakpoint, or
|
|
19
|
+
* adding one, means spreading this rather than retyping all five.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultBreakpoints: Readonly<Breakpoints>;
|
|
22
|
+
export interface Mq {
|
|
23
|
+
/** Resolve one responsive map to the value for the current viewport. */
|
|
24
|
+
<T>(map: ResponsiveMap<T>, fallback?: T): T | undefined;
|
|
25
|
+
/** Resolve several maps in one call. */
|
|
26
|
+
props<T extends Record<string, ResponsiveMap>>(maps: T): {
|
|
27
|
+
[K in keyof T]: any;
|
|
28
|
+
};
|
|
29
|
+
/** The current breakpoint: base, or a key from the scale. */
|
|
30
|
+
readonly breakpoint: string;
|
|
31
|
+
/** Exclusive bucket, unlike the inclusive `atLeast`. */
|
|
32
|
+
readonly device: Device;
|
|
33
|
+
/** Inclusive, the equivalent of Tailwind's `md:`. */
|
|
34
|
+
atLeast(key: string | number): boolean;
|
|
35
|
+
/** Any media query, e.g. `(prefers-reduced-motion: reduce)`. */
|
|
36
|
+
match(query: string): boolean;
|
|
37
|
+
/** Replace the breakpoint scale. Safe to call after reads have begun. */
|
|
38
|
+
configure(options: MediaOptions): void;
|
|
39
|
+
}
|
|
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
|
+
export declare const resetMedia: () => void;
|
|
46
|
+
export declare const media: Plugin<MediaOptions>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Plugin } from '../../app';
|
|
2
|
+
/**
|
|
3
|
+
* Viewport-driven behaviour — the cases CSS genuinely cannot serve: values
|
|
4
|
+
* handed to JavaScript, structural branches, skipping expensive init on small
|
|
5
|
+
* screens. Appearance still belongs in a stylesheet, which applies before
|
|
6
|
+
* first paint; this runs after it.
|
|
7
|
+
*/
|
|
8
|
+
export type Breakpoints = Record<string, number>;
|
|
9
|
+
export interface MediaOptions {
|
|
10
|
+
/** Replaces the default scale wholesale rather than merging into it. */
|
|
11
|
+
breakpoints?: Breakpoints;
|
|
12
|
+
}
|
|
13
|
+
/** A responsive map: breakpoint key to value, mobile-first. */
|
|
14
|
+
export type ResponsiveMap<T = any> = Record<string | number, T>;
|
|
15
|
+
export type Device = 'mobile' | 'tablet' | 'desktop';
|
|
16
|
+
/**
|
|
17
|
+
* The scale in use until something calls `configure()`. Exported because
|
|
18
|
+
* `configure()` replaces rather than merges: adjusting one breakpoint, or
|
|
19
|
+
* adding one, means spreading this rather than retyping all five.
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultBreakpoints: Readonly<Breakpoints>;
|
|
22
|
+
export interface Mq {
|
|
23
|
+
/** Resolve one responsive map to the value for the current viewport. */
|
|
24
|
+
<T>(map: ResponsiveMap<T>, fallback?: T): T | undefined;
|
|
25
|
+
/** Resolve several maps in one call. */
|
|
26
|
+
props<T extends Record<string, ResponsiveMap>>(maps: T): {
|
|
27
|
+
[K in keyof T]: any;
|
|
28
|
+
};
|
|
29
|
+
/** The current breakpoint: base, or a key from the scale. */
|
|
30
|
+
readonly breakpoint: string;
|
|
31
|
+
/** Exclusive bucket, unlike the inclusive `atLeast`. */
|
|
32
|
+
readonly device: Device;
|
|
33
|
+
/** Inclusive, the equivalent of Tailwind's `md:`. */
|
|
34
|
+
atLeast(key: string | number): boolean;
|
|
35
|
+
/** Any media query, e.g. `(prefers-reduced-motion: reduce)`. */
|
|
36
|
+
match(query: string): boolean;
|
|
37
|
+
/** Replace the breakpoint scale. Safe to call after reads have begun. */
|
|
38
|
+
configure(options: MediaOptions): void;
|
|
39
|
+
}
|
|
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
|
+
export declare const resetMedia: () => void;
|
|
46
|
+
export declare const media: Plugin<MediaOptions>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin } from '../../app.mjs';
|
|
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.
|
|
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`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const resize: Plugin;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin } from '../../app';
|
|
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.
|
|
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`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const resize: Plugin;
|
package/dist/types/utils.d.mts
CHANGED
|
@@ -1,2 +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.
|
|
6
|
+
*/
|
|
7
|
+
export declare const listen: (el: Element, event: string, handler: any, options?: any) => () => void;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,2 +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.
|
|
6
|
+
*/
|
|
7
|
+
export declare const listen: (el: Element, event: string, handler: any, options?: any) => () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aevantec/litevue",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -49,6 +49,96 @@
|
|
|
49
49
|
"default": "./dist/litevue-devtools.umd.js"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
+
"./plugins/collapse": {
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/types/plugins/collapse/index.d.mts",
|
|
55
|
+
"default": "./dist/plugins/collapse.mjs"
|
|
56
|
+
},
|
|
57
|
+
"require": {
|
|
58
|
+
"types": "./dist/types/plugins/collapse/index.d.ts",
|
|
59
|
+
"default": "./dist/plugins/collapse.umd.js"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"./plugins/focus": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./dist/types/plugins/focus/index.d.mts",
|
|
65
|
+
"default": "./dist/plugins/focus.mjs"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./dist/types/plugins/focus/index.d.ts",
|
|
69
|
+
"default": "./dist/plugins/focus.umd.js"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./plugins/intersect": {
|
|
73
|
+
"import": {
|
|
74
|
+
"types": "./dist/types/plugins/intersect/index.d.mts",
|
|
75
|
+
"default": "./dist/plugins/intersect.mjs"
|
|
76
|
+
},
|
|
77
|
+
"require": {
|
|
78
|
+
"types": "./dist/types/plugins/intersect/index.d.ts",
|
|
79
|
+
"default": "./dist/plugins/intersect.umd.js"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"./plugins/mask": {
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./dist/types/plugins/mask/index.d.mts",
|
|
85
|
+
"default": "./dist/plugins/mask.mjs"
|
|
86
|
+
},
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./dist/types/plugins/mask/index.d.ts",
|
|
89
|
+
"default": "./dist/plugins/mask.umd.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./plugins/media": {
|
|
93
|
+
"import": {
|
|
94
|
+
"types": "./dist/types/plugins/media/index.d.mts",
|
|
95
|
+
"default": "./dist/plugins/media.mjs"
|
|
96
|
+
},
|
|
97
|
+
"require": {
|
|
98
|
+
"types": "./dist/types/plugins/media/index.d.ts",
|
|
99
|
+
"default": "./dist/plugins/media.umd.js"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"./plugins/morph": {
|
|
103
|
+
"import": {
|
|
104
|
+
"types": "./dist/types/plugins/morph/index.d.mts",
|
|
105
|
+
"default": "./dist/plugins/morph.mjs"
|
|
106
|
+
},
|
|
107
|
+
"require": {
|
|
108
|
+
"types": "./dist/types/plugins/morph/index.d.ts",
|
|
109
|
+
"default": "./dist/plugins/morph.umd.js"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"./plugins/persist": {
|
|
113
|
+
"import": {
|
|
114
|
+
"types": "./dist/types/plugins/persist/index.d.mts",
|
|
115
|
+
"default": "./dist/plugins/persist.mjs"
|
|
116
|
+
},
|
|
117
|
+
"require": {
|
|
118
|
+
"types": "./dist/types/plugins/persist/index.d.ts",
|
|
119
|
+
"default": "./dist/plugins/persist.umd.js"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"./plugins/resize": {
|
|
123
|
+
"import": {
|
|
124
|
+
"types": "./dist/types/plugins/resize/index.d.mts",
|
|
125
|
+
"default": "./dist/plugins/resize.mjs"
|
|
126
|
+
},
|
|
127
|
+
"require": {
|
|
128
|
+
"types": "./dist/types/plugins/resize/index.d.ts",
|
|
129
|
+
"default": "./dist/plugins/resize.umd.js"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"./plugins/transition": {
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/types/plugins/transition/index.d.mts",
|
|
135
|
+
"default": "./dist/plugins/transition.mjs"
|
|
136
|
+
},
|
|
137
|
+
"require": {
|
|
138
|
+
"types": "./dist/types/plugins/transition/index.d.ts",
|
|
139
|
+
"default": "./dist/plugins/transition.umd.js"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
52
142
|
"./package.json": "./package.json"
|
|
53
143
|
},
|
|
54
144
|
"types": "./dist/types/index.d.ts",
|
|
@@ -59,15 +149,43 @@
|
|
|
59
149
|
],
|
|
60
150
|
"devtools": [
|
|
61
151
|
"./dist/types/devtools-panel.d.ts"
|
|
152
|
+
],
|
|
153
|
+
"plugins/collapse": [
|
|
154
|
+
"./dist/types/plugins/collapse/index.d.ts"
|
|
155
|
+
],
|
|
156
|
+
"plugins/focus": [
|
|
157
|
+
"./dist/types/plugins/focus/index.d.ts"
|
|
158
|
+
],
|
|
159
|
+
"plugins/intersect": [
|
|
160
|
+
"./dist/types/plugins/intersect/index.d.ts"
|
|
161
|
+
],
|
|
162
|
+
"plugins/mask": [
|
|
163
|
+
"./dist/types/plugins/mask/index.d.ts"
|
|
164
|
+
],
|
|
165
|
+
"plugins/media": [
|
|
166
|
+
"./dist/types/plugins/media/index.d.ts"
|
|
167
|
+
],
|
|
168
|
+
"plugins/morph": [
|
|
169
|
+
"./dist/types/plugins/morph/index.d.ts"
|
|
170
|
+
],
|
|
171
|
+
"plugins/persist": [
|
|
172
|
+
"./dist/types/plugins/persist/index.d.ts"
|
|
173
|
+
],
|
|
174
|
+
"plugins/resize": [
|
|
175
|
+
"./dist/types/plugins/resize/index.d.ts"
|
|
176
|
+
],
|
|
177
|
+
"plugins/transition": [
|
|
178
|
+
"./dist/types/plugins/transition/index.d.ts"
|
|
62
179
|
]
|
|
63
180
|
}
|
|
64
181
|
},
|
|
65
182
|
"scripts": {
|
|
66
183
|
"dev": "vite",
|
|
67
|
-
"build": "vite build && vite build --config vite.devtools.config.mts && vite build --config vite.plugins.config.mts && pnpm build:types",
|
|
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",
|
|
68
185
|
"build:types": "tsc --emitDeclarationOnly && mv dist/src dist/types && node scripts/build-types.mjs",
|
|
69
186
|
"lint:package": "publint --strict && attw --pack .",
|
|
70
187
|
"check:bundles": "node scripts/check-bundles.mjs",
|
|
188
|
+
"check:docs-versions": "node scripts/check-docs-versions.mjs",
|
|
71
189
|
"prepublishOnly": "pnpm build && publint --strict",
|
|
72
190
|
"docs:dev": "vitepress dev docs",
|
|
73
191
|
"docs:build": "vitepress build docs",
|
|
@@ -84,8 +202,6 @@
|
|
|
84
202
|
"vue",
|
|
85
203
|
"petite-vue",
|
|
86
204
|
"litevue",
|
|
87
|
-
"alpine",
|
|
88
|
-
"alpinejs",
|
|
89
205
|
"progressive-enhancement",
|
|
90
206
|
"reactivity",
|
|
91
207
|
"directives",
|