@vuetify/v0 0.0.2-beta.4 → 0.0.3
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/README.md +251 -0
- package/dist/browser/index.js +3199 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +8 -0
- package/dist/{components-B5iiovK7.mjs → components-DVuB4lnH.js} +16 -217
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +8 -0
- package/dist/composables-yeVk-ULz.js +1270 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants-DiTCgvMU.js +1 -0
- package/dist/factories/index.d.ts +2 -0
- package/dist/factories/index.js +3 -0
- package/dist/{createTrinity-CwGvQ2ng.mjs → factories-BEpawPUw.js} +32 -15
- package/dist/globals-DZvNEOB4.js +12 -0
- package/dist/htmlElements-SjqYu0am.js +78 -0
- package/dist/{index-D4Grk5x1.d.mts → index-BozA2pze.d.ts} +1 -1
- package/dist/index-Ckt12ON6.d.ts +75 -0
- package/dist/index-D0L_ydyW.d.ts +1396 -0
- package/dist/index-DVKeyWc5.d.ts +79 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +11 -0
- package/dist/transformers/index.d.ts +2 -0
- package/dist/transformers/index.js +4 -0
- package/dist/{transformers-BTjuwbOV.mjs → transformers-CWrxLIkw.js} +2 -2
- package/dist/types/{index.d.mts → index.d.ts} +1 -1
- package/dist/types/index.js +1 -0
- package/dist/{useTheme-tY7MoBKr.mjs → useTheme-DCXkw_kv.js} +214 -204
- package/dist/utilities/{index.d.mts → index.d.ts} +2 -2
- package/dist/utilities/{index.mjs → index.js} +1 -1
- package/package.json +20 -35
- package/dist/components/index.d.mts +0 -5
- package/dist/components/index.mjs +0 -7
- package/dist/composables/index.d.mts +0 -5
- package/dist/composables/index.mjs +0 -7
- package/dist/composables-C6dl5kjP.mjs +0 -614
- package/dist/factories/index.d.mts +0 -3
- package/dist/factories/index.mjs +0 -4
- package/dist/factories-DOLmqhVS.mjs +0 -0
- package/dist/index-ChaaTPKp.d.mts +0 -421
- package/dist/index-Cya5Y9pB.d.mts +0 -412
- package/dist/index-DfahEz6s.d.mts +0 -18
- package/dist/index-jG0yrC1F.d.mts +0 -467
- package/dist/index-oCBJwhpG.d.mts +0 -43
- package/dist/index.d.mts +0 -9
- package/dist/index.mjs +0 -9
- package/dist/transformers/index.d.mts +0 -2
- package/dist/transformers/index.mjs +0 -4
- package/dist/types/index.mjs +0 -0
- /package/dist/{index-BA3ZFBnL.d.mts → index-LBy5OPMu.d.ts} +0 -0
- /package/dist/{index-CZRh0I2w.d.mts → index-tUyghL98.d.ts} +0 -0
- /package/dist/{utilities-lZSfrXgw.mjs → utilities-D9rWEgQK.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { COMMON_ELEMENTS, HTMLElementName, IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, SelfClosingElement, __LOGGER_ENABLED__, isSelfClosingTag, version } from "../index-DVKeyWc5.js";
|
|
2
|
+
export { COMMON_ELEMENTS, HTMLElementName, IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, SelfClosingElement, __LOGGER_ENABLED__, isSelfClosingTag, version };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { COMMON_ELEMENTS, SELF_CLOSING_TAGS, isSelfClosingTag } from "../htmlElements-SjqYu0am.js";
|
|
2
|
+
import { IN_BROWSER, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, __LOGGER_ENABLED__, version } from "../globals-DZvNEOB4.js";
|
|
3
|
+
import "../constants-DiTCgvMU.js";
|
|
4
|
+
|
|
5
|
+
export { COMMON_ELEMENTS, IN_BROWSER, SELF_CLOSING_TAGS, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, __LOGGER_ENABLED__, isSelfClosingTag, version };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ContextKey, ContextTrinity, Plugin, PluginOptions, createContext, createPlugin, createTrinity, provideContext, useContext } from "../index-Ckt12ON6.js";
|
|
2
|
+
export { ContextKey, ContextTrinity, Plugin, PluginOptions, createContext, createPlugin, createTrinity, provideContext, useContext };
|
|
@@ -5,21 +5,35 @@ import { inject, provide } from "vue";
|
|
|
5
5
|
* A simple wrapper for tapping into a v0 namespace
|
|
6
6
|
* @param key The provided string or InjectionKey
|
|
7
7
|
* @template Z The type values for the context.
|
|
8
|
-
* @returns
|
|
8
|
+
* @returns The injected context
|
|
9
9
|
* @throws Error if namespace is not found.
|
|
10
10
|
*
|
|
11
11
|
* @see https://vuejs.org/api/composition-api-dependency-injection.html#inject
|
|
12
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
12
13
|
*/
|
|
13
14
|
function useContext(key) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const context = inject(key, void 0);
|
|
16
|
+
if (context === void 0) throw new Error(`Context "${String(key)}" not found. Ensure it's provided by an ancestor.`);
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A simple wrapper for providing Vue context.
|
|
21
|
+
*
|
|
22
|
+
* @param key The provided string or InjectionKey
|
|
23
|
+
* @param context The context value to provide
|
|
24
|
+
* @param app Optional Vue app instance for global provide
|
|
25
|
+
* @returns The provided context
|
|
26
|
+
*
|
|
27
|
+
* @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
|
|
28
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
29
|
+
*/
|
|
30
|
+
function provideContext(key, context, app) {
|
|
31
|
+
app?.provide(key, context) ?? provide(key, context);
|
|
32
|
+
return context;
|
|
19
33
|
}
|
|
20
34
|
/**
|
|
21
35
|
* A simple wrapper for Vues provide & inject systems
|
|
22
|
-
*
|
|
36
|
+
*
|
|
23
37
|
* @param key The provided string or InjectionKey
|
|
24
38
|
* @template Z The type values for the context.
|
|
25
39
|
* @returns A tuple containing provide/inject
|
|
@@ -27,12 +41,14 @@ function useContext(key) {
|
|
|
27
41
|
* @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
|
|
28
42
|
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
29
43
|
*/
|
|
30
|
-
function createContext(
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
function createContext(_key) {
|
|
45
|
+
function _provideContext(context, app) {
|
|
46
|
+
return provideContext(_key, context, app);
|
|
47
|
+
}
|
|
48
|
+
function _useContext(key = _key) {
|
|
49
|
+
return useContext(key);
|
|
34
50
|
}
|
|
35
|
-
return [
|
|
51
|
+
return [_useContext, _provideContext];
|
|
36
52
|
}
|
|
37
53
|
|
|
38
54
|
//#endregion
|
|
@@ -42,6 +58,7 @@ function createContext(key) {
|
|
|
42
58
|
* @param options Configurable object with namespace and provide/setup methods
|
|
43
59
|
* @returns A Vue plugin object with install method that runs app w/ context
|
|
44
60
|
*
|
|
61
|
+
* @see https://vuejs.org/guide/reusability/plugins
|
|
45
62
|
* @see https://vuejs.org/api/application.html#app-runwithcontext
|
|
46
63
|
* @see https://0.vuetifyjs.com/factories/create-plugin
|
|
47
64
|
*/
|
|
@@ -67,13 +84,13 @@ function createPlugin(options) {
|
|
|
67
84
|
*
|
|
68
85
|
* @see https://0.vuetifyjs.com/composables/foundation/create-trinity
|
|
69
86
|
*/
|
|
70
|
-
function createTrinity(createContext$1, provideContext, context) {
|
|
87
|
+
function createTrinity(createContext$1, provideContext$1, context) {
|
|
71
88
|
return [
|
|
72
89
|
createContext$1,
|
|
73
|
-
(_context = context, app) => provideContext(_context, app),
|
|
90
|
+
(_context = context, app) => provideContext$1(_context, app),
|
|
74
91
|
context
|
|
75
92
|
];
|
|
76
93
|
}
|
|
77
94
|
|
|
78
95
|
//#endregion
|
|
79
|
-
export { createContext, createPlugin, createTrinity, useContext };
|
|
96
|
+
export { createContext, createPlugin, createTrinity, provideContext, useContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/constants/globals.ts
|
|
2
|
+
const IN_BROWSER = typeof window !== "undefined";
|
|
3
|
+
const SUPPORTS_TOUCH = IN_BROWSER && ("ontouchstart" in window || window.navigator.maxTouchPoints > 0);
|
|
4
|
+
const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof window.matchMedia === "function";
|
|
5
|
+
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
6
|
+
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
7
|
+
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
8
|
+
const version = "0.0.3";
|
|
9
|
+
const __LOGGER_ENABLED__ = process.env.NODE_ENV !== "production" || process.env.VITE_LOGGER_ENABLED === "true";
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { IN_BROWSER, SUPPORTS_INTERSECTION_OBSERVER, SUPPORTS_MATCH_MEDIA, SUPPORTS_MUTATION_OBSERVER, SUPPORTS_OBSERVER, SUPPORTS_TOUCH, __LOGGER_ENABLED__, version };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//#region src/constants/htmlElements.ts
|
|
2
|
+
const selfClosingTags = [
|
|
3
|
+
"area",
|
|
4
|
+
"base",
|
|
5
|
+
"br",
|
|
6
|
+
"col",
|
|
7
|
+
"embed",
|
|
8
|
+
"hr",
|
|
9
|
+
"img",
|
|
10
|
+
"input",
|
|
11
|
+
"link",
|
|
12
|
+
"meta",
|
|
13
|
+
"source",
|
|
14
|
+
"track",
|
|
15
|
+
"wbr"
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Set of HTML elements that are self-closing (void elements)
|
|
19
|
+
* These elements cannot have children and don't need closing tags
|
|
20
|
+
*/
|
|
21
|
+
const SELF_CLOSING_TAGS = new Set(selfClosingTags);
|
|
22
|
+
/**
|
|
23
|
+
* Common HTML element types for polymorphic components
|
|
24
|
+
*/
|
|
25
|
+
const COMMON_ELEMENTS = {
|
|
26
|
+
DIV: "div",
|
|
27
|
+
SPAN: "span",
|
|
28
|
+
SECTION: "section",
|
|
29
|
+
ARTICLE: "article",
|
|
30
|
+
ASIDE: "aside",
|
|
31
|
+
HEADER: "header",
|
|
32
|
+
FOOTER: "footer",
|
|
33
|
+
MAIN: "main",
|
|
34
|
+
NAV: "nav",
|
|
35
|
+
P: "p",
|
|
36
|
+
H1: "h1",
|
|
37
|
+
H2: "h2",
|
|
38
|
+
H3: "h3",
|
|
39
|
+
H4: "h4",
|
|
40
|
+
H5: "h5",
|
|
41
|
+
H6: "h6",
|
|
42
|
+
BUTTON: "button",
|
|
43
|
+
A: "a",
|
|
44
|
+
INPUT: "input",
|
|
45
|
+
TEXTAREA: "textarea",
|
|
46
|
+
SELECT: "select",
|
|
47
|
+
LABEL: "label",
|
|
48
|
+
UL: "ul",
|
|
49
|
+
OL: "ol",
|
|
50
|
+
LI: "li",
|
|
51
|
+
DL: "dl",
|
|
52
|
+
DT: "dt",
|
|
53
|
+
DD: "dd",
|
|
54
|
+
IMG: "img",
|
|
55
|
+
VIDEO: "video",
|
|
56
|
+
AUDIO: "audio",
|
|
57
|
+
CANVAS: "canvas",
|
|
58
|
+
SVG: "svg",
|
|
59
|
+
TABLE: "table",
|
|
60
|
+
THEAD: "thead",
|
|
61
|
+
TBODY: "tbody",
|
|
62
|
+
TFOOT: "tfoot",
|
|
63
|
+
TR: "tr",
|
|
64
|
+
TH: "th",
|
|
65
|
+
TD: "td",
|
|
66
|
+
FORM: "form",
|
|
67
|
+
FIELDSET: "fieldset",
|
|
68
|
+
LEGEND: "legend"
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Check if an element is self-closing
|
|
72
|
+
*/
|
|
73
|
+
function isSelfClosingTag(tag) {
|
|
74
|
+
return SELF_CLOSING_TAGS.has(tag.toLowerCase());
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { COMMON_ELEMENTS, SELF_CLOSING_TAGS, isSelfClosingTag };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { App, InjectionKey } from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/factories/createContext/index.d.ts
|
|
4
|
+
type ContextKey<Z> = InjectionKey<Z> | string;
|
|
5
|
+
/**
|
|
6
|
+
* A simple wrapper for tapping into a v0 namespace
|
|
7
|
+
* @param key The provided string or InjectionKey
|
|
8
|
+
* @template Z The type values for the context.
|
|
9
|
+
* @returns The injected context
|
|
10
|
+
* @throws Error if namespace is not found.
|
|
11
|
+
*
|
|
12
|
+
* @see https://vuejs.org/api/composition-api-dependency-injection.html#inject
|
|
13
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
14
|
+
*/
|
|
15
|
+
declare function useContext<Z>(key: ContextKey<Z>): Z & ({} | null);
|
|
16
|
+
/**
|
|
17
|
+
* A simple wrapper for providing Vue context.
|
|
18
|
+
*
|
|
19
|
+
* @param key The provided string or InjectionKey
|
|
20
|
+
* @param context The context value to provide
|
|
21
|
+
* @param app Optional Vue app instance for global provide
|
|
22
|
+
* @returns The provided context
|
|
23
|
+
*
|
|
24
|
+
* @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
|
|
25
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
26
|
+
*/
|
|
27
|
+
declare function provideContext<Z>(key: ContextKey<Z>, context: Z, app?: App): Z;
|
|
28
|
+
/**
|
|
29
|
+
* A simple wrapper for Vues provide & inject systems
|
|
30
|
+
*
|
|
31
|
+
* @param key The provided string or InjectionKey
|
|
32
|
+
* @template Z The type values for the context.
|
|
33
|
+
* @returns A tuple containing provide/inject
|
|
34
|
+
*
|
|
35
|
+
* @see https://vuejs.org/api/composition-api-dependency-injection.html#provide
|
|
36
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-context
|
|
37
|
+
*/
|
|
38
|
+
declare function createContext<Z>(_key: ContextKey<Z>): readonly [(key?: ContextKey<Z>) => Z & ({} | null), (context: Z, app?: App) => Z];
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/factories/createPlugin/index.d.ts
|
|
41
|
+
interface PluginOptions {
|
|
42
|
+
namespace: string;
|
|
43
|
+
provide: (app: App) => void;
|
|
44
|
+
setup?: (app: App) => void;
|
|
45
|
+
}
|
|
46
|
+
interface Plugin {
|
|
47
|
+
install: (app: App, ...options: any[]) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* A universal plugin factory to reduce boilerplate code for Vue plugin creation
|
|
51
|
+
* @param options Configurable object with namespace and provide/setup methods
|
|
52
|
+
* @returns A Vue plugin object with install method that runs app w/ context
|
|
53
|
+
*
|
|
54
|
+
* @see https://vuejs.org/guide/reusability/plugins
|
|
55
|
+
* @see https://vuejs.org/api/application.html#app-runwithcontext
|
|
56
|
+
* @see https://0.vuetifyjs.com/factories/create-plugin
|
|
57
|
+
*/
|
|
58
|
+
declare function createPlugin<Z extends Plugin = Plugin>(options: PluginOptions): Z;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/factories/createTrinity/index.d.ts
|
|
61
|
+
type ContextTrinity<Z = unknown> = readonly [() => Z, (context?: Z, app?: App) => Z, Z];
|
|
62
|
+
/**
|
|
63
|
+
* A tuple containing Vue's provide/inject and a context object
|
|
64
|
+
* @param createContext The function that creates the context
|
|
65
|
+
* @param provideContext The function that provides context
|
|
66
|
+
* @param context The underlying context object singleton
|
|
67
|
+
* @template Z The type parameter for the context value
|
|
68
|
+
* @template E The vmodel type for the context state.
|
|
69
|
+
* @returns [createContext, provideContext, context]
|
|
70
|
+
*
|
|
71
|
+
* @see https://0.vuetifyjs.com/composables/foundation/create-trinity
|
|
72
|
+
*/
|
|
73
|
+
declare function createTrinity<Z = unknown>(createContext: () => Z, provideContext: (_context?: Z, app?: App) => Z, context: Z): ContextTrinity<Z>;
|
|
74
|
+
//#endregion
|
|
75
|
+
export { ContextKey, ContextTrinity, Plugin, PluginOptions, createContext, createPlugin, createTrinity, provideContext, useContext };
|