@vuetify/v0 0.0.2-beta.3 → 0.0.2

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.
@@ -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-z_zwVNP8.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--2b7sF4-.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, useContext } from "../index-BqrLvboW.js";
2
+ export { ContextKey, ContextTrinity, Plugin, PluginOptions, createContext, createPlugin, createTrinity, useContext };
@@ -0,0 +1,3 @@
1
+ import { createContext, createPlugin, createTrinity, useContext } from "../factories-CPq2yMlr.js";
2
+
3
+ export { createContext, createPlugin, createTrinity, useContext };
@@ -0,0 +1,79 @@
1
+ import { inject, provide } from "vue";
2
+
3
+ //#region src/factories/createContext/index.ts
4
+ /**
5
+ * A simple wrapper for tapping into a v0 namespace
6
+ * @param key The provided string or InjectionKey
7
+ * @template Z The type values for the context.
8
+ * @returns A function that retrieves context
9
+ * @throws Error if namespace is not found.
10
+ *
11
+ * @see https://vuejs.org/api/composition-api-dependency-injection.html#inject
12
+ */
13
+ function useContext(key) {
14
+ return function(namespace) {
15
+ const context = inject(namespace || 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
+ /**
21
+ * A simple wrapper for Vues provide & inject systems
22
+ * to create context for managing application state
23
+ * @param key The provided string or InjectionKey
24
+ * @template Z The type values for the context.
25
+ * @returns A tuple containing provide/inject
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 createContext(key) {
31
+ function provideContext(context, app) {
32
+ app?.provide(key, context) ?? provide(key, context);
33
+ return context;
34
+ }
35
+ return [useContext(key), provideContext];
36
+ }
37
+
38
+ //#endregion
39
+ //#region src/factories/createPlugin/index.ts
40
+ /**
41
+ * A universal plugin factory to reduce boilerplate code for Vue plugin creation
42
+ * @param options Configurable object with namespace and provide/setup methods
43
+ * @returns A Vue plugin object with install method that runs app w/ context
44
+ *
45
+ * @see https://vuejs.org/api/application.html#app-runwithcontext
46
+ * @see https://0.vuetifyjs.com/factories/create-plugin
47
+ */
48
+ function createPlugin(options) {
49
+ return { install(app) {
50
+ app.runWithContext(() => {
51
+ options.provide(app);
52
+ options.setup?.(app);
53
+ });
54
+ } };
55
+ }
56
+
57
+ //#endregion
58
+ //#region src/factories/createTrinity/index.ts
59
+ /**
60
+ * A tuple containing Vue's provide/inject and a context object
61
+ * @param createContext The function that creates the context
62
+ * @param provideContext The function that provides context
63
+ * @param context The underlying context object singleton
64
+ * @template Z The type parameter for the context value
65
+ * @template E The vmodel type for the context state.
66
+ * @returns [createContext, provideContext, context]
67
+ *
68
+ * @see https://0.vuetifyjs.com/composables/foundation/create-trinity
69
+ */
70
+ function createTrinity(createContext$1, provideContext, context) {
71
+ return [
72
+ createContext$1,
73
+ (_context = context, app) => provideContext(_context, app),
74
+ context
75
+ ];
76
+ }
77
+
78
+ //#endregion
79
+ export { createContext, createPlugin, createTrinity, 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.2";
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 };