@vuetify/v0 1.0.0-alpha.1 → 1.0.0-alpha.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.
- package/dist/{adapter-T7AedXkz.d.mts → adapter-58IvIfAZ.d.mts} +1 -1
- package/dist/{adapter-DtgIrQsG.mjs → adapter-Be9zUc-n.mjs} +1 -1
- package/dist/{adapter-DoziXEzS.d.mts → adapter-BvWEd9w-.d.mts} +2 -2
- package/dist/{adapter-J7ude3gO.d.mts → adapter-DlX3FA3A.d.mts} +1 -1
- package/dist/{adapter-CDpOQ8sn.mjs → adapter-gQ2SNKZq.mjs} +3 -3
- package/dist/{adapters-Da2twiUn.mjs → adapters-BJ5n7rgh.mjs} +1 -1
- package/dist/adapters-BnKW0BF_.mjs +2 -0
- package/dist/adapters-CBrvizWb.mjs +4 -0
- package/dist/adapters-CMJGA1k7.mjs +2 -0
- package/dist/adapters-Dse4bPxk.mjs +5 -0
- package/dist/browser/index.js +166 -159
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/{components-CaPQCjo5.mjs → components-CqDewYTU.mjs} +63 -37
- package/dist/composables/index.d.mts +18 -18
- package/dist/composables/index.mjs +26 -24
- package/dist/{consola-Byg0ybzh.d.mts → consola-BdgyPEfx.d.mts} +1 -1
- package/dist/constants/index.d.mts +2 -2
- package/dist/constants/index.mjs +3 -3
- package/dist/{createDataTable-B4UflKnT.mjs → createDataTable-rXBqGglI.mjs} +15 -12
- package/dist/{createGroup-BC2nfttd.mjs → createGroup-BU4olYtB.mjs} +7 -7
- package/dist/{createTokens-oJAeh262.mjs → createRegistry-Dl-bSSTr.mjs} +6 -299
- package/dist/{createSelection-BA9guLah.mjs → createSelection-Csaa-C8p.mjs} +1 -1
- package/dist/{createSingle-BHxHLZeg.mjs → createSingle-8xbHAIpY.mjs} +1 -1
- package/dist/createTokens-lNg2M_P_.mjs +302 -0
- package/dist/data-table/adapters/client/index.d.mts +1 -1
- package/dist/data-table/adapters/client/index.mjs +1 -1
- package/dist/data-table/adapters/index.d.mts +4 -4
- package/dist/data-table/adapters/index.mjs +5 -5
- package/dist/data-table/adapters/server/index.d.mts +1 -1
- package/dist/data-table/adapters/server/index.mjs +1 -1
- package/dist/data-table/adapters/virtual/index.d.mts +1 -1
- package/dist/data-table/adapters/virtual/index.mjs +1 -1
- package/dist/data-table/index.d.mts +5 -5
- package/dist/data-table/index.mjs +5 -5
- package/dist/date/index.d.mts +2 -2
- package/dist/date/index.mjs +4 -4
- package/dist/features/adapters/flagsmith/index.d.mts +1 -1
- package/dist/features/adapters/flagsmith/index.mjs +1 -1
- package/dist/features/adapters/launchdarkly/index.d.mts +1 -1
- package/dist/features/adapters/launchdarkly/index.mjs +1 -1
- package/dist/features/adapters/posthog/index.d.mts +1 -1
- package/dist/features/adapters/posthog/index.mjs +1 -1
- package/dist/features/index.d.mts +2 -2
- package/dist/features/index.mjs +1 -1
- package/dist/{globals-Berkg6mP.mjs → globals-CKdzjeLe.mjs} +1 -1
- package/dist/htmlElements-D4oMQZPJ.mjs +28 -0
- package/dist/{index-M8EpGjjA.d.mts → index-1XdASTjp.d.mts} +1 -1
- package/dist/{index-Gk3x_7zD.d.mts → index-B7cqgTBL.d.mts} +115 -117
- package/dist/{index-DVPq3_Fz.d.mts → index-BJGcVy7e.d.mts} +4 -4
- package/dist/index-BgCkepP_.d.mts +31 -0
- package/dist/{index-DFvLSoto.d.mts → index-BxKMMWnQ.d.mts} +9 -9
- package/dist/{index-tyzwWFHS.d.mts → index-BzFHTW59.d.mts} +1 -1
- package/dist/{index-CDcl4wPo.d.mts → index-CT5SCLzW.d.mts} +1 -1
- package/dist/{index-TtSSvHY6.d.mts → index-DE3bWw11.d.mts} +2 -2
- package/dist/{index-F2Fmxnzi.d.mts → index-Dp1HjBxJ.d.mts} +1 -1
- package/dist/{index-B_AlCD7t.d.mts → index-DuddF-NR.d.mts} +2 -9
- package/dist/{index-Dxx0eMLi.d.mts → index-GOpjKzaJ.d.mts} +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.mjs +30 -28
- package/dist/json/attributes.json +4 -4
- package/dist/json/web-types.json +5 -5
- package/dist/locale/adapters/index.d.mts +2 -2
- package/dist/locale/adapters/index.mjs +2 -2
- package/dist/locale/adapters/v0/index.d.mts +1 -1
- package/dist/locale/adapters/v0/index.mjs +1 -1
- package/dist/locale/adapters/vue-i18n/index.d.mts +1 -1
- package/dist/locale/index.d.mts +3 -3
- package/dist/locale/index.mjs +2 -2
- package/dist/logger/adapters/consola/index.d.mts +1 -1
- package/dist/logger/adapters/index.d.mts +4 -4
- package/dist/logger/adapters/index.mjs +2 -2
- package/dist/logger/adapters/pino/index.d.mts +1 -1
- package/dist/logger/adapters/v0/index.d.mts +1 -1
- package/dist/logger/adapters/v0/index.mjs +1 -1
- package/dist/logger/index.d.mts +5 -5
- package/dist/logger/index.mjs +2 -2
- package/dist/notifications/index.d.mts +2 -2
- package/dist/notifications/index.mjs +3 -54
- package/dist/palettes/ant/generate/index.mjs +1 -0
- package/dist/palettes/ant/index.d.mts +1 -1
- package/dist/palettes/index.d.mts +3 -3
- package/dist/palettes/leonardo/generate/index.mjs +1 -0
- package/dist/palettes/material/generate/index.mjs +1 -0
- package/dist/palettes/material/index.d.mts +1 -1
- package/dist/palettes/md1/index.d.mts +1 -1
- package/dist/palettes/md2/index.d.mts +1 -1
- package/dist/palettes/radix/index.d.mts +1 -1
- package/dist/palettes/tailwind/index.d.mts +1 -1
- package/dist/permissions/adapters/index.d.mts +1 -1
- package/dist/permissions/adapters/index.mjs +2 -2
- package/dist/permissions/adapters/v0/index.d.mts +1 -1
- package/dist/permissions/adapters/v0/index.mjs +1 -1
- package/dist/permissions/index.d.mts +1 -1
- package/dist/permissions/index.mjs +2 -2
- package/dist/{pino-BxddSW2l.d.mts → pino-DNfCEb0p.d.mts} +1 -1
- package/dist/{posthog-CPvNHMUb.mjs → posthog-DZNnPXxS.mjs} +1 -1
- package/dist/rules/index.d.mts +1 -1
- package/dist/rules/index.mjs +1 -1
- package/dist/{server-ZiHJ4tfq.d.mts → server-3ilWFwqe.d.mts} +1 -1
- package/dist/{server-B6OtHgBT.mjs → server-y7zLSCSx.mjs} +1 -1
- package/dist/storage/adapters/index.d.mts +2 -2
- package/dist/storage/adapters/index.mjs +1 -1
- package/dist/storage/adapters/memory/index.d.mts +1 -1
- package/dist/storage/adapters/memory/index.mjs +1 -1
- package/dist/storage/index.d.mts +3 -3
- package/dist/storage/index.mjs +2 -2
- package/dist/theme/adapters/index.d.mts +1 -1
- package/dist/theme/adapters/index.mjs +4 -4
- package/dist/theme/adapters/unhead/index.d.mts +1 -1
- package/dist/theme/adapters/unhead/index.mjs +1 -1
- package/dist/theme/adapters/v0/index.d.mts +1 -1
- package/dist/theme/adapters/v0/index.mjs +1 -1
- package/dist/theme/index.d.mts +1 -1
- package/dist/theme/index.mjs +3 -3
- package/dist/{toArray-BA_JxFPv.mjs → toArray-as9BWxBK.mjs} +1 -0
- package/dist/types/index.d.mts +2 -2
- package/dist/{unhead-D2YqAcmF.mjs → unhead-DZiD-4Tx.mjs} +2 -2
- package/dist/{useClickOutside-B9a6Jext.mjs → useClickOutside-CmCUD_Pf.mjs} +46 -905
- package/dist/{useFeatures-wgMwaQ5W.mjs → useFeatures-ZIvzzuEV.mjs} +8 -7
- package/dist/{useLocale-qMmVnAwS.mjs → useLocale-DTJx3aKR.mjs} +10 -7
- package/dist/{useLogger-DFIRqm-N.mjs → useLogger-BBTcMN61.mjs} +3 -3
- package/dist/useNotifications-H4knpvNw.mjs +869 -0
- package/dist/{usePermissions-tZhkBJmq.mjs → usePermissions-B_G12Dwd.mjs} +6 -6
- package/dist/{useRules-D3UXEtu7.mjs → useRules--7Qoo60I.mjs} +7 -5
- package/dist/{useTheme-BeD__R8t.mjs → useTheme-Co05TEeD.mjs} +11 -8
- package/dist/utilities/index.d.mts +1 -1
- package/dist/utilities/index.mjs +10 -5
- package/dist/{v0-6XptGYVx.mjs → v0-BrTEO5sv.mjs} +2 -2
- package/dist/{v0-Dzw5OwNo.d.mts → v0-CdusXjY_.d.mts} +1 -1
- package/dist/{v0-I2mHxD9T.mjs → v0-D0Mh3EVG.mjs} +1 -1
- package/dist/{v0-CWXUkMY0.d.mts → v0-D7Fm2C3Y.d.mts} +1 -1
- package/dist/{v0-CNitYI9N.mjs → v0-DeiZuexg.mjs} +1 -1
- package/dist/{v0-BG7RhKBv.mjs → v0-Dq3zhexO.mjs} +2 -2
- package/dist/{v0-C2UMaHUa.d.mts → v0-DrOub-e1.d.mts} +1 -1
- package/dist/{virtual-To-dSw2_.mjs → virtual-C0yHf1DC.mjs} +2 -2
- package/dist/{virtual-BCOfxnRS.d.mts → virtual-D4fckewC.d.mts} +1 -1
- package/package.json +1 -1
- package/dist/adapters-BhNTUuxE.mjs +0 -2
- package/dist/adapters-CFjrKxA2.mjs +0 -5
- package/dist/adapters-CiCexgsk.mjs +0 -4
- package/dist/adapters-DegUcfkd.mjs +0 -2
- package/dist/htmlElements-CIePKaTX.mjs +0 -75
- package/dist/index-D6mQAEs2.d.mts +0 -79
- /package/dist/{adapter-DNKjooxI.d.mts → adapter-Dhq68tz0.d.mts} +0 -0
- /package/dist/{createPagination-qvJkcTUY.mjs → createPagination-CHF7SmmK.mjs} +0 -0
- /package/dist/{flagsmith-DQnnahG5.mjs → flagsmith-Dbh1h8WF.mjs} +0 -0
- /package/dist/{index-DxruGeVY.d.mts → index-C6rdXZ7j.d.mts} +0 -0
- /package/dist/{index-DvuJXuAN.d.mts → index-CFhUdAHM.d.mts} +0 -0
- /package/dist/{index-PWQavSPf.d.mts → index-CROz1VSV.d.mts} +0 -0
- /package/dist/{index-D4odwkZg.d.mts → index-DTvqw22G.d.mts} +0 -0
- /package/dist/{launchdarkly-2_48EJ1_.mjs → launchdarkly-BKtW-idu.mjs} +0 -0
- /package/dist/{memory-DUyWthic.d.mts → memory-CeSQE-QV.d.mts} +0 -0
- /package/dist/{memory-XCMtkld1.mjs → memory-oYBvtkgx.mjs} +0 -0
- /package/dist/{v0-4OQBCeda.mjs → v0-Bmow1q_x.mjs} +0 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { isObject, isString, isUndefined } from "./utilities/index.mjs";
|
|
2
|
+
import { i as useContext, t as createTrinity } from "./createTrinity-BTCs1pYx.mjs";
|
|
3
|
+
import { i as useLogger } from "./useLogger-BBTcMN61.mjs";
|
|
4
|
+
import { t as createRegistry } from "./createRegistry-Dl-bSSTr.mjs";
|
|
5
|
+
//#region src/composables/createTokens/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* @module createTokens
|
|
8
|
+
*
|
|
9
|
+
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Design token registry with alias resolution and W3C Design Tokens format support.
|
|
13
|
+
*
|
|
14
|
+
* Key features:
|
|
15
|
+
* - Alias resolution with circular reference detection
|
|
16
|
+
* - Nested token flattening with dot notation
|
|
17
|
+
* - W3C Design Tokens format ($value, $type, $description, $extensions)
|
|
18
|
+
* - Path-based resolution (e.g., {colors}.blue.500)
|
|
19
|
+
* - Resolution caching for performance (~28,590 ops/sec)
|
|
20
|
+
*
|
|
21
|
+
* Used by useTheme, useLocale, and useFeatures for token-based configuration.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { createTokens } from '@vuetify/v0'
|
|
26
|
+
*
|
|
27
|
+
* const tokens = createTokens({
|
|
28
|
+
* colors: { primary: '#1976d2' },
|
|
29
|
+
* })
|
|
30
|
+
* console.log(tokens.resolve('{colors.primary}'))
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new token instance.
|
|
35
|
+
*
|
|
36
|
+
* @param tokens The tokens to use.
|
|
37
|
+
* @param options The options for the token instance.
|
|
38
|
+
* @template Z The type of the token ticket.
|
|
39
|
+
* @template E The type of the token context.
|
|
40
|
+
* @returns A new token instance.
|
|
41
|
+
*
|
|
42
|
+
* @see https://www.designtokens.org/tr/drafts/format/
|
|
43
|
+
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { createTokens } from '@vuetify/v0'
|
|
48
|
+
*
|
|
49
|
+
* const tokens = createTokens({
|
|
50
|
+
* colors: {
|
|
51
|
+
* primary: '#3b82f6',
|
|
52
|
+
* secondary: '{colors.primary}', // Alias reference
|
|
53
|
+
* },
|
|
54
|
+
* })
|
|
55
|
+
*
|
|
56
|
+
* console.log(tokens.resolve('{colors.primary}')) // '#3b82f6'
|
|
57
|
+
* console.log(tokens.resolve('{colors.secondary}')) // '#3b82f6'
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
function createTokens(tokens = {}, options = {}) {
|
|
61
|
+
const logger = useLogger();
|
|
62
|
+
const registry = createRegistry(options);
|
|
63
|
+
const cache = /* @__PURE__ */ new Map();
|
|
64
|
+
registry.onboard(/* @__PURE__ */ flatten(tokens, options.prefix, !!options.flat));
|
|
65
|
+
function isAlias(token) {
|
|
66
|
+
return /* @__PURE__ */ isString(token) && token.length > 2 && token[0] === "{" && token.at(-1) === "}";
|
|
67
|
+
}
|
|
68
|
+
function isTokenAlias(value) {
|
|
69
|
+
return /* @__PURE__ */ isObject(value) && "$value" in value;
|
|
70
|
+
}
|
|
71
|
+
function resolve(token, visited = /* @__PURE__ */ new Set()) {
|
|
72
|
+
const cacheKey = /* @__PURE__ */ isString(token) ? token : JSON.stringify(token);
|
|
73
|
+
if (cache.has(cacheKey)) return cache.get(cacheKey);
|
|
74
|
+
const reference = isTokenAlias(token) ? token.$value : token;
|
|
75
|
+
const isAliasReference = /* @__PURE__ */ isString(reference) && isAlias(reference);
|
|
76
|
+
const clean = isAliasReference ? reference.slice(1, -1) : String(reference);
|
|
77
|
+
if (visited.has(clean)) {
|
|
78
|
+
logger.warn(`Circular alias detected for "${clean}"`);
|
|
79
|
+
cache.set(cacheKey, void 0);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
visited.add(clean);
|
|
83
|
+
let found = registry.get(clean);
|
|
84
|
+
let segments = [];
|
|
85
|
+
if (!found && clean.includes(".")) {
|
|
86
|
+
const parts = clean.split(".");
|
|
87
|
+
for (let i = parts.length - 1; i > 0; i--) {
|
|
88
|
+
const prefix = parts.slice(0, i).join(".");
|
|
89
|
+
const suffix = parts.slice(i);
|
|
90
|
+
const candidate = registry.get(prefix);
|
|
91
|
+
if (!/* @__PURE__ */ isUndefined(candidate?.value)) {
|
|
92
|
+
found = candidate;
|
|
93
|
+
segments = suffix;
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (/* @__PURE__ */ isUndefined(found?.value)) {
|
|
99
|
+
if (isAliasReference) logger.warn(`Alias not found for "${String(reference)}"`);
|
|
100
|
+
cache.set(cacheKey, void 0);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
let result;
|
|
104
|
+
let current = found.value;
|
|
105
|
+
if (segments.length > 0) {
|
|
106
|
+
if (isTokenAlias(current)) current = current.$value;
|
|
107
|
+
for (const segment of segments) {
|
|
108
|
+
if (!/* @__PURE__ */ isObject(current) || !(segment in current)) {
|
|
109
|
+
current = void 0;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
current = current[segment];
|
|
113
|
+
if (isTokenAlias(current)) current = current.$value;
|
|
114
|
+
}
|
|
115
|
+
if (/* @__PURE__ */ isUndefined(current)) {
|
|
116
|
+
logger.warn(`Path not found inside "${clean}": ${segments.join(".")}`);
|
|
117
|
+
cache.set(cacheKey, void 0);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
result = current;
|
|
121
|
+
} else if (isTokenAlias(current)) {
|
|
122
|
+
const inner = current.$value;
|
|
123
|
+
if (/* @__PURE__ */ isString(inner) && isAlias(inner)) return resolve(inner, visited);
|
|
124
|
+
result = inner;
|
|
125
|
+
} else if (/* @__PURE__ */ isString(current) && isAlias(current)) return resolve(current, visited);
|
|
126
|
+
else result = current;
|
|
127
|
+
cache.set(cacheKey, result);
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
const { register: _register, upsert: _upsert, unregister: _unregister, onboard: _onboard, offboard: _offboard, move: _move, clear: _clear } = registry;
|
|
131
|
+
function register(registration) {
|
|
132
|
+
cache.clear();
|
|
133
|
+
return _register(registration);
|
|
134
|
+
}
|
|
135
|
+
function upsert(id, registration) {
|
|
136
|
+
cache.clear();
|
|
137
|
+
return _upsert(id, registration);
|
|
138
|
+
}
|
|
139
|
+
function unregister(id) {
|
|
140
|
+
cache.clear();
|
|
141
|
+
return _unregister(id);
|
|
142
|
+
}
|
|
143
|
+
function onboard(registrations) {
|
|
144
|
+
cache.clear();
|
|
145
|
+
return _onboard(registrations);
|
|
146
|
+
}
|
|
147
|
+
function offboard(ids) {
|
|
148
|
+
cache.clear();
|
|
149
|
+
return _offboard(ids);
|
|
150
|
+
}
|
|
151
|
+
function move(id, index) {
|
|
152
|
+
cache.clear();
|
|
153
|
+
return _move(id, index);
|
|
154
|
+
}
|
|
155
|
+
function clear() {
|
|
156
|
+
cache.clear();
|
|
157
|
+
return _clear();
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
...registry,
|
|
161
|
+
register,
|
|
162
|
+
upsert,
|
|
163
|
+
unregister,
|
|
164
|
+
onboard,
|
|
165
|
+
offboard,
|
|
166
|
+
move,
|
|
167
|
+
clear,
|
|
168
|
+
resolve,
|
|
169
|
+
isAlias,
|
|
170
|
+
get size() {
|
|
171
|
+
return registry.size;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Creates a new token context.
|
|
177
|
+
*
|
|
178
|
+
* @param namespace The namespace for the token context.
|
|
179
|
+
* @param tokens The tokens to use.
|
|
180
|
+
* @template Z The type of the token ticket.
|
|
181
|
+
* @template E The type of the token context.
|
|
182
|
+
* @returns A new token context.
|
|
183
|
+
*
|
|
184
|
+
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```ts
|
|
188
|
+
* import { createTokensContext } from '@vuetify/v0'
|
|
189
|
+
*
|
|
190
|
+
* export const [useTokens, provideTokens, context] = createTokensContext({
|
|
191
|
+
* namespace: 'v0:tokens',
|
|
192
|
+
* tokens: {
|
|
193
|
+
* colors: {
|
|
194
|
+
* primary: '#3b82f6',
|
|
195
|
+
* secondary: '{colors.primary}', // Alias reference
|
|
196
|
+
* },
|
|
197
|
+
* },
|
|
198
|
+
* })
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
function createTokensContext(_options) {
|
|
202
|
+
const { namespace = "v0:tokens", tokens = {}, ...options } = _options;
|
|
203
|
+
return createTrinity(namespace, createTokens(tokens, options));
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Returns the current tokens instance.
|
|
207
|
+
*
|
|
208
|
+
* @param namespace The namespace for the tokens context. Defaults to `'v0:tokens'`.
|
|
209
|
+
* @returns The current tokens instance.
|
|
210
|
+
*
|
|
211
|
+
* @see https://0.vuetifyjs.com/composables/registration/create-tokens
|
|
212
|
+
*
|
|
213
|
+
* @example
|
|
214
|
+
* ```vue
|
|
215
|
+
* <script setup lang="ts">
|
|
216
|
+
* import { useTokens } from '@vuetify/v0'
|
|
217
|
+
*
|
|
218
|
+
* const tokens = useTokens()
|
|
219
|
+
* <\/script>
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
function useTokens(namespace = "v0:tokens") {
|
|
223
|
+
return useContext(namespace);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Flattens a nested collection of tokens into a flat array of tokens.
|
|
227
|
+
* Each token is represented by an object containing its ID & value.
|
|
228
|
+
* @param tokens The collection of tokens to flatten.
|
|
229
|
+
* @param prefix An optional prefix to prepend to each token ID.
|
|
230
|
+
* @returns An array of flattened tokens, each with an ID and value.
|
|
231
|
+
*/
|
|
232
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
233
|
+
function flatten(tokens, prefix = "", flat = false) {
|
|
234
|
+
const flattened = [];
|
|
235
|
+
const stack = [{
|
|
236
|
+
tokens,
|
|
237
|
+
prefix,
|
|
238
|
+
flat
|
|
239
|
+
}];
|
|
240
|
+
while (stack.length > 0) {
|
|
241
|
+
const { tokens: currentTokens, prefix: currentPrefix, flat } = stack.pop();
|
|
242
|
+
const meta = {};
|
|
243
|
+
for (const k in currentTokens) if (k.startsWith("$")) meta[k] = currentTokens[k];
|
|
244
|
+
if (Object.keys(meta).length > 0 && currentPrefix) flattened.push({
|
|
245
|
+
id: currentPrefix,
|
|
246
|
+
value: meta
|
|
247
|
+
});
|
|
248
|
+
for (const key in currentTokens) {
|
|
249
|
+
if (key.startsWith("$")) continue;
|
|
250
|
+
const value = currentTokens[key];
|
|
251
|
+
const id = currentPrefix ? `${currentPrefix}.${key}` : key;
|
|
252
|
+
if (!/* @__PURE__ */ isObject(value)) {
|
|
253
|
+
flattened.push({
|
|
254
|
+
id,
|
|
255
|
+
value
|
|
256
|
+
});
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
if ("$value" in value) {
|
|
260
|
+
flattened.push({
|
|
261
|
+
id,
|
|
262
|
+
value
|
|
263
|
+
});
|
|
264
|
+
const inner = value.$value;
|
|
265
|
+
if (/* @__PURE__ */ isObject(inner) && !flat) for (const innerKey in inner) {
|
|
266
|
+
if (innerKey.startsWith("$")) continue;
|
|
267
|
+
const child = inner[innerKey];
|
|
268
|
+
const childId = `${id}.${innerKey}`;
|
|
269
|
+
if (!/* @__PURE__ */ isObject(child)) flattened.push({
|
|
270
|
+
id: childId,
|
|
271
|
+
value: child
|
|
272
|
+
});
|
|
273
|
+
else if ("$value" in child) flattened.push({
|
|
274
|
+
id: childId,
|
|
275
|
+
value: child
|
|
276
|
+
});
|
|
277
|
+
else stack.push({
|
|
278
|
+
tokens: child,
|
|
279
|
+
prefix: childId,
|
|
280
|
+
flat
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (flat) {
|
|
286
|
+
flattened.push({
|
|
287
|
+
id,
|
|
288
|
+
value
|
|
289
|
+
});
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
stack.push({
|
|
293
|
+
tokens: value,
|
|
294
|
+
prefix: id,
|
|
295
|
+
flat
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return flattened;
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
302
|
+
export { useTokens as i, createTokensContext as n, flatten as r, createTokens as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ClientAdapter } from "../../../v0-
|
|
1
|
+
import { t as ClientAdapter } from "../../../v0-CdusXjY_.mjs";
|
|
2
2
|
export { ClientAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ClientAdapter } from "../../../v0-
|
|
1
|
+
import { t as ClientAdapter } from "../../../v0-Dq3zhexO.mjs";
|
|
2
2
|
export { ClientAdapter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-
|
|
2
|
-
import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-
|
|
3
|
-
import { t as ClientAdapter } from "../../v0-
|
|
4
|
-
import { t as VirtualAdapter } from "../../virtual-
|
|
1
|
+
import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../../adapter-DlX3FA3A.mjs";
|
|
2
|
+
import { n as ServerAdapterOptions, t as ServerAdapter } from "../../server-3ilWFwqe.mjs";
|
|
3
|
+
import { t as ClientAdapter } from "../../v0-CdusXjY_.mjs";
|
|
4
|
+
import { t as VirtualAdapter } from "../../virtual-D4fckewC.mjs";
|
|
5
5
|
export { ClientAdapter, DataTableAdapter, DataTableAdapterContext, DataTableAdapterInterface, DataTableAdapterResult, ServerAdapter, ServerAdapterOptions, SortDirection, SortEntry, VirtualAdapter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as DataTableAdapter } from "../../adapter-
|
|
2
|
-
import { t as ClientAdapter } from "../../v0-
|
|
3
|
-
import { t as ServerAdapter } from "../../server-
|
|
4
|
-
import { t as VirtualAdapter } from "../../virtual-
|
|
5
|
-
import "../../adapters-
|
|
1
|
+
import { t as DataTableAdapter } from "../../adapter-gQ2SNKZq.mjs";
|
|
2
|
+
import { t as ClientAdapter } from "../../v0-Dq3zhexO.mjs";
|
|
3
|
+
import { t as ServerAdapter } from "../../server-y7zLSCSx.mjs";
|
|
4
|
+
import { t as VirtualAdapter } from "../../virtual-C0yHf1DC.mjs";
|
|
5
|
+
import "../../adapters-Dse4bPxk.mjs";
|
|
6
6
|
export { ClientAdapter, DataTableAdapter, ServerAdapter, VirtualAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-
|
|
1
|
+
import { n as ServerAdapterOptions, t as ServerAdapter } from "../../../server-3ilWFwqe.mjs";
|
|
2
2
|
export { ServerAdapter, ServerAdapterOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as ServerAdapter } from "../../../server-
|
|
1
|
+
import { t as ServerAdapter } from "../../../server-y7zLSCSx.mjs";
|
|
2
2
|
export { ServerAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VirtualAdapter } from "../../../virtual-
|
|
1
|
+
import { t as VirtualAdapter } from "../../../virtual-D4fckewC.mjs";
|
|
2
2
|
export { VirtualAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as VirtualAdapter } from "../../../virtual-
|
|
1
|
+
import { t as VirtualAdapter } from "../../../virtual-C0yHf1DC.mjs";
|
|
2
2
|
export { VirtualAdapter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../adapter-
|
|
2
|
-
import { _ as computeDepth, a as DataTableGroup, c as DataTableSelection, d as SelectStrategy, f as createDataTable, g as InternalHeader, h as ColumnNode, i as DataTableExpansion, l as DataTableSort, m as useDataTable, n as DataTableContext, o as DataTableGrouping, p as createDataTableContext, r as DataTableContextOptions, s as DataTableOptions, t as DataTableColumn, u as KeysOfType, v as extractLeaves, y as resolveHeaders } from "../index-
|
|
3
|
-
import { n as ServerAdapterOptions, t as ServerAdapter } from "../server-
|
|
4
|
-
import { t as ClientAdapter } from "../v0-
|
|
5
|
-
import { t as VirtualAdapter } from "../virtual-
|
|
1
|
+
import { a as SortDirection, i as DataTableAdapterResult, n as DataTableAdapterContext, o as SortEntry, r as DataTableAdapterInterface, t as DataTableAdapter } from "../adapter-DlX3FA3A.mjs";
|
|
2
|
+
import { _ as computeDepth, a as DataTableGroup, c as DataTableSelection, d as SelectStrategy, f as createDataTable, g as InternalHeader, h as ColumnNode, i as DataTableExpansion, l as DataTableSort, m as useDataTable, n as DataTableContext, o as DataTableGrouping, p as createDataTableContext, r as DataTableContextOptions, s as DataTableOptions, t as DataTableColumn, u as KeysOfType, v as extractLeaves, y as resolveHeaders } from "../index-BJGcVy7e.mjs";
|
|
3
|
+
import { n as ServerAdapterOptions, t as ServerAdapter } from "../server-3ilWFwqe.mjs";
|
|
4
|
+
import { t as ClientAdapter } from "../v0-CdusXjY_.mjs";
|
|
5
|
+
import { t as VirtualAdapter } from "../virtual-D4fckewC.mjs";
|
|
6
6
|
export { ClientAdapter, ColumnNode, DataTableAdapter, DataTableAdapterContext, DataTableAdapterInterface, DataTableAdapterResult, DataTableColumn, DataTableContext, DataTableContextOptions, DataTableExpansion, DataTableGroup, DataTableGrouping, DataTableOptions, DataTableSelection, DataTableSort, InternalHeader, KeysOfType, SelectStrategy, ServerAdapter, ServerAdapterOptions, SortDirection, SortEntry, VirtualAdapter, computeDepth, createDataTable, createDataTableContext, extractLeaves, resolveHeaders, useDataTable };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as DataTableAdapter } from "../adapter-
|
|
2
|
-
import { t as ClientAdapter } from "../v0-
|
|
3
|
-
import { a as extractLeaves, i as computeDepth, n as createDataTableContext, o as resolveHeaders, r as useDataTable, t as createDataTable } from "../createDataTable-
|
|
4
|
-
import { t as ServerAdapter } from "../server-
|
|
5
|
-
import { t as VirtualAdapter } from "../virtual-
|
|
1
|
+
import { t as DataTableAdapter } from "../adapter-gQ2SNKZq.mjs";
|
|
2
|
+
import { t as ClientAdapter } from "../v0-Dq3zhexO.mjs";
|
|
3
|
+
import { a as extractLeaves, i as computeDepth, n as createDataTableContext, o as resolveHeaders, r as useDataTable, t as createDataTable } from "../createDataTable-rXBqGglI.mjs";
|
|
4
|
+
import { t as ServerAdapter } from "../server-y7zLSCSx.mjs";
|
|
5
|
+
import { t as VirtualAdapter } from "../virtual-C0yHf1DC.mjs";
|
|
6
6
|
export { ClientAdapter, DataTableAdapter, ServerAdapter, VirtualAdapter, computeDepth, createDataTable, createDataTableContext, extractLeaves, resolveHeaders, useDataTable };
|
package/dist/date/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as DateAdapter } from "../adapter-
|
|
1
|
+
import { t as DateAdapter } from "../adapter-58IvIfAZ.mjs";
|
|
2
2
|
import { Temporal } from "@js-temporal/polyfill";
|
|
3
3
|
|
|
4
4
|
//#region src/composables/useDate/adapters/v0.d.ts
|
|
@@ -53,7 +53,7 @@ declare class Vuetify0DateAdapter implements DateAdapter<PlainDateTime> {
|
|
|
53
53
|
*/
|
|
54
54
|
parse(value: string, _format: string): PlainDateTime | null;
|
|
55
55
|
isValid(date: unknown): date is PlainDateTime;
|
|
56
|
-
|
|
56
|
+
isNullish(value: PlainDateTime | null): value is null;
|
|
57
57
|
getCurrentLocaleCode(): string;
|
|
58
58
|
is12HourCycleInCurrentLocale(): boolean;
|
|
59
59
|
format(date: PlainDateTime, formatString: string): string;
|
package/dist/date/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as IN_BROWSER } from "../globals-
|
|
2
|
-
import { isNull, isNullOrUndefined, isNumber, isString } from "../utilities/index.mjs";
|
|
1
|
+
import { t as IN_BROWSER } from "../globals-CKdzjeLe.mjs";
|
|
2
|
+
import { isFunction, isNull, isNullOrUndefined, isNumber, isString } from "../utilities/index.mjs";
|
|
3
3
|
import { Temporal } from "@js-temporal/polyfill";
|
|
4
4
|
//#region src/composables/useDate/adapters/v0.ts
|
|
5
5
|
/**
|
|
@@ -30,7 +30,7 @@ const MAX_CACHE_SIZE = 50;
|
|
|
30
30
|
function deriveWeekInfo(locale) {
|
|
31
31
|
try {
|
|
32
32
|
const loc = new Intl.Locale(locale);
|
|
33
|
-
const info =
|
|
33
|
+
const info = /* @__PURE__ */ isFunction(loc.getWeekInfo) ? loc.getWeekInfo() : loc.weekInfo;
|
|
34
34
|
return {
|
|
35
35
|
firstDay: info?.firstDay === 7 ? 0 : info?.firstDay ?? 0,
|
|
36
36
|
minimalDays: info?.minimalDays ?? deriveMinimalDays(locale)
|
|
@@ -193,7 +193,7 @@ var Vuetify0DateAdapter = class {
|
|
|
193
193
|
}
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
isNullish(value) {
|
|
197
197
|
return /* @__PURE__ */ isNullOrUndefined(value);
|
|
198
198
|
}
|
|
199
199
|
getCurrentLocaleCode() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FlagsmithFeatureAdapter } from "../../../index-
|
|
1
|
+
import { t as FlagsmithFeatureAdapter } from "../../../index-BzFHTW59.mjs";
|
|
2
2
|
export { FlagsmithFeatureAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as FlagsmithFeatureAdapter } from "../../../flagsmith-
|
|
1
|
+
import { t as FlagsmithFeatureAdapter } from "../../../flagsmith-Dbh1h8WF.mjs";
|
|
2
2
|
export { FlagsmithFeatureAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LaunchDarklyFeatureAdapter } from "../../../index-
|
|
1
|
+
import { t as LaunchDarklyFeatureAdapter } from "../../../index-1XdASTjp.mjs";
|
|
2
2
|
export { LaunchDarklyFeatureAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as LaunchDarklyFeatureAdapter } from "../../../launchdarkly-
|
|
1
|
+
import { t as LaunchDarklyFeatureAdapter } from "../../../launchdarkly-BKtW-idu.mjs";
|
|
2
2
|
export { LaunchDarklyFeatureAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PostHogFeatureAdapter } from "../../../index-
|
|
1
|
+
import { t as PostHogFeatureAdapter } from "../../../index-Dp1HjBxJ.mjs";
|
|
2
2
|
export { PostHogFeatureAdapter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as PostHogFeatureAdapter } from "../../../posthog-
|
|
1
|
+
import { t as PostHogFeatureAdapter } from "../../../posthog-DZNnPXxS.mjs";
|
|
2
2
|
export { PostHogFeatureAdapter };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as createFeaturesContext, Jn as FeatureOptions, Kn as FeatureContext, Qn as createFeatures, Xn as FeatureTicket, Yn as FeaturePluginOptions, Zn as FeatureTicketInput, er as createFeaturesPlugin, qn as FeatureContextOptions, tr as useFeatures } from "../index-
|
|
2
|
-
import { i as FeaturesAdapterValue, n as FeaturesAdapterFlags, r as FeaturesAdapterInterface, t as FeaturesAdapter } from "../index-
|
|
1
|
+
import { $n as createFeaturesContext, Jn as FeatureOptions, Kn as FeatureContext, Qn as createFeatures, Xn as FeatureTicket, Yn as FeaturePluginOptions, Zn as FeatureTicketInput, er as createFeaturesPlugin, qn as FeatureContextOptions, tr as useFeatures } from "../index-BxKMMWnQ.mjs";
|
|
2
|
+
import { i as FeaturesAdapterValue, n as FeaturesAdapterFlags, r as FeaturesAdapterInterface, t as FeaturesAdapter } from "../index-CT5SCLzW.mjs";
|
|
3
3
|
export { FeatureContext, FeatureContextOptions, FeatureOptions, FeaturePluginOptions, FeatureTicket, FeatureTicketInput, FeaturesAdapter, FeaturesAdapterFlags, FeaturesAdapterInterface, FeaturesAdapterValue, createFeatures, createFeaturesContext, createFeaturesPlugin, useFeatures };
|
package/dist/features/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FeaturesAdapter, i as useFeatures, n as createFeaturesContext, r as createFeaturesPlugin, t as createFeatures } from "../useFeatures-
|
|
1
|
+
import { a as FeaturesAdapter, i as useFeatures, n as createFeaturesContext, r as createFeaturesPlugin, t as createFeatures } from "../useFeatures-ZIvzzuEV.mjs";
|
|
2
2
|
export { FeaturesAdapter, createFeatures, createFeaturesContext, createFeaturesPlugin, useFeatures };
|
|
@@ -5,7 +5,7 @@ const SUPPORTS_MATCH_MEDIA = IN_BROWSER && "matchMedia" in window && typeof wind
|
|
|
5
5
|
const SUPPORTS_OBSERVER = IN_BROWSER && "ResizeObserver" in window;
|
|
6
6
|
const SUPPORTS_INTERSECTION_OBSERVER = IN_BROWSER && "IntersectionObserver" in window;
|
|
7
7
|
const SUPPORTS_MUTATION_OBSERVER = IN_BROWSER && "MutationObserver" in window;
|
|
8
|
-
const version = "1.0.0-alpha.
|
|
8
|
+
const version = "1.0.0-alpha.2";
|
|
9
9
|
/* v8 ignore next -- build-time constant, __DEV__ short-circuits in tests */
|
|
10
10
|
const __LOGGER_ENABLED__ = typeof (process.env.NODE_ENV !== "production") !== "undefined" && process.env.NODE_ENV !== "production" || typeof process.env.VITE_LOGGER_ENABLED !== "undefined" && process.env.VITE_LOGGER_ENABLED === "true";
|
|
11
11
|
//#endregion
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Set of HTML elements that are self-closing (void elements)
|
|
3
|
+
* These elements cannot have children and don't need closing tags
|
|
4
|
+
*/
|
|
5
|
+
const SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([
|
|
6
|
+
"area",
|
|
7
|
+
"base",
|
|
8
|
+
"br",
|
|
9
|
+
"col",
|
|
10
|
+
"embed",
|
|
11
|
+
"hr",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"link",
|
|
15
|
+
"meta",
|
|
16
|
+
"source",
|
|
17
|
+
"track",
|
|
18
|
+
"wbr"
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Check if an element is self-closing
|
|
22
|
+
*/
|
|
23
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
24
|
+
function isSelfClosingTag(tag) {
|
|
25
|
+
return SELF_CLOSING_TAGS.has(tag.toLowerCase());
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { isSelfClosingTag as n, SELF_CLOSING_TAGS as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as FeaturesAdapterFlags, r as FeaturesAdapterInterface } from "./index-
|
|
1
|
+
import { n as FeaturesAdapterFlags, r as FeaturesAdapterInterface } from "./index-CT5SCLzW.mjs";
|
|
2
2
|
import { LDClient } from "launchdarkly-js-client-sdk";
|
|
3
3
|
|
|
4
4
|
//#region src/composables/useFeatures/adapters/launchdarkly/index.d.ts
|