@mrts/soltw 0.3.21 → 0.3.23
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/index.d.ts +125 -10
- package/dist/index.js +3730 -10
- package/dist/index.jsx +3648 -10
- package/package.json +2 -2
- package/dist/Block.d.ts +0 -13
- package/dist/Block.js +0 -33
- package/dist/Block.jsx +0 -24
- package/dist/items/IdLabel.d.ts +0 -15
- package/dist/items/IdLabel.js +0 -19
- package/dist/items/IdLabel.jsx +0 -19
- package/dist/items/Item.d.ts +0 -25
- package/dist/items/Item.js +0 -79
- package/dist/items/Item.jsx +0 -64
- package/dist/items/ItemGroup.d.ts +0 -24
- package/dist/items/ItemGroup.js +0 -87
- package/dist/items/ItemGroup.jsx +0 -64
- package/dist/node_modules/solid-js/dist/solid.js +0 -677
- package/dist/node_modules/solid-js/dist/solid.jsx +0 -654
- package/dist/node_modules/solid-js/web/dist/web.js +0 -694
- package/dist/node_modules/solid-js/web/dist/web.jsx +0 -678
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -1893
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.jsx +0 -1893
- package/dist/packages/common/dist/index.js +0 -4
- package/dist/packages/common/dist/index.jsx +0 -4
- package/dist/packages/common/dist/messages/index.js +0 -1
- package/dist/packages/common/dist/messages/index.jsx +0 -1
- package/dist/packages/common/dist/messages/logMessages.js +0 -14
- package/dist/packages/common/dist/messages/logMessages.jsx +0 -14
- package/dist/packages/common/dist/strings/index.js +0 -1
- package/dist/packages/common/dist/strings/index.jsx +0 -1
- package/dist/packages/common/dist/strings/tokenize.js +0 -47
- package/dist/packages/common/dist/strings/tokenize.jsx +0 -47
- package/dist/soltw.d.ts +0 -7
- package/dist/soltw.js +0 -10
- package/dist/soltw.jsx +0 -7
- package/dist/stylers/SVTStyler.d.ts +0 -32
- package/dist/stylers/SVTStyler.js +0 -65
- package/dist/stylers/SVTStyler.jsx +0 -65
- package/dist/stylers/Stylers.d.ts +0 -12
- package/dist/stylers/Stylers.js +0 -23
- package/dist/stylers/Stylers.jsx +0 -23
- package/dist/stylers/base.styler.d.ts +0 -6
- package/dist/stylers/base.styler.js +0 -71
- package/dist/stylers/base.styler.jsx +0 -71
- package/dist/stylers/index.js +0 -4
- package/dist/stylers/index.jsx +0 -4
- package/dist/stylers/normalizers.d.ts +0 -6
- package/dist/stylers/normalizers.js +0 -32
- package/dist/stylers/normalizers.jsx +0 -32
- package/dist/stylers/types.d.ts +0 -14
package/dist/index.js
CHANGED
|
@@ -1,12 +1,3732 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//#region src/items/IdLabel.ts
|
|
2
|
+
function buildIdLabel(arg) {
|
|
3
|
+
if (typeof arg == "string") return {
|
|
4
|
+
id: arg,
|
|
5
|
+
label: arg
|
|
6
|
+
};
|
|
7
|
+
else if (Array.isArray(arg)) return {
|
|
8
|
+
id: arg[0],
|
|
9
|
+
label: arg[1]
|
|
10
|
+
};
|
|
11
|
+
else {
|
|
12
|
+
const r = Object.assign({}, arg);
|
|
13
|
+
if (r.label == void 0) r["label"] = r.id;
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
11
17
|
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ../../node_modules/solid-js/dist/solid.js
|
|
20
|
+
const sharedConfig = {
|
|
21
|
+
context: void 0,
|
|
22
|
+
registry: void 0,
|
|
23
|
+
effects: void 0,
|
|
24
|
+
done: false,
|
|
25
|
+
getContextId() {
|
|
26
|
+
return getContextId(this.context.count);
|
|
27
|
+
},
|
|
28
|
+
getNextContextId() {
|
|
29
|
+
return getContextId(this.context.count++);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
function getContextId(count) {
|
|
33
|
+
const num = String(count), len = num.length - 1;
|
|
34
|
+
return sharedConfig.context.id + (len ? String.fromCharCode(96 + len) : "") + num;
|
|
35
|
+
}
|
|
36
|
+
function setHydrateContext(context) {
|
|
37
|
+
sharedConfig.context = context;
|
|
38
|
+
}
|
|
39
|
+
function nextHydrateContext() {
|
|
40
|
+
return {
|
|
41
|
+
...sharedConfig.context,
|
|
42
|
+
id: sharedConfig.getNextContextId(),
|
|
43
|
+
count: 0
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const equalFn = (a, b) => a === b;
|
|
47
|
+
const $PROXY = Symbol("solid-proxy");
|
|
48
|
+
const SUPPORTS_PROXY = typeof Proxy === "function";
|
|
49
|
+
const $TRACK = Symbol("solid-track");
|
|
50
|
+
const signalOptions = { equals: equalFn };
|
|
51
|
+
let ERROR = null;
|
|
52
|
+
let runEffects = runQueue;
|
|
53
|
+
const STALE = 1;
|
|
54
|
+
const PENDING = 2;
|
|
55
|
+
const UNOWNED = {
|
|
56
|
+
owned: null,
|
|
57
|
+
cleanups: null,
|
|
58
|
+
context: null,
|
|
59
|
+
owner: null
|
|
60
|
+
};
|
|
61
|
+
var Owner = null;
|
|
62
|
+
let Transition = null;
|
|
63
|
+
let Scheduler = null;
|
|
64
|
+
let ExternalSourceConfig = null;
|
|
65
|
+
let Listener = null;
|
|
66
|
+
let Updates = null;
|
|
67
|
+
let Effects = null;
|
|
68
|
+
let ExecCount = 0;
|
|
69
|
+
function createRoot(fn, detachedOwner) {
|
|
70
|
+
const listener = Listener, owner = Owner, unowned = fn.length === 0, current = detachedOwner === void 0 ? owner : detachedOwner, root = unowned ? UNOWNED : {
|
|
71
|
+
owned: null,
|
|
72
|
+
cleanups: null,
|
|
73
|
+
context: current ? current.context : null,
|
|
74
|
+
owner: current
|
|
75
|
+
}, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
76
|
+
Owner = root;
|
|
77
|
+
Listener = null;
|
|
78
|
+
try {
|
|
79
|
+
return runUpdates(updateFn, true);
|
|
80
|
+
} finally {
|
|
81
|
+
Listener = listener;
|
|
82
|
+
Owner = owner;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function createSignal(value, options) {
|
|
86
|
+
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
87
|
+
const s = {
|
|
88
|
+
value,
|
|
89
|
+
observers: null,
|
|
90
|
+
observerSlots: null,
|
|
91
|
+
comparator: options.equals || void 0
|
|
92
|
+
};
|
|
93
|
+
const setter = (value$1) => {
|
|
94
|
+
if (typeof value$1 === "function") if (Transition && Transition.running && Transition.sources.has(s)) value$1 = value$1(s.tValue);
|
|
95
|
+
else value$1 = value$1(s.value);
|
|
96
|
+
return writeSignal(s, value$1);
|
|
97
|
+
};
|
|
98
|
+
return [readSignal.bind(s), setter];
|
|
99
|
+
}
|
|
100
|
+
function createRenderEffect(fn, value, options) {
|
|
101
|
+
const c = createComputation(fn, value, false, STALE);
|
|
102
|
+
if (Scheduler && Transition && Transition.running) Updates.push(c);
|
|
103
|
+
else updateComputation(c);
|
|
104
|
+
}
|
|
105
|
+
function createEffect(fn, value, options) {
|
|
106
|
+
runEffects = runUserEffects;
|
|
107
|
+
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && useContext(SuspenseContext);
|
|
108
|
+
if (s) c.suspense = s;
|
|
109
|
+
if (!options || !options.render) c.user = true;
|
|
110
|
+
Effects ? Effects.push(c) : updateComputation(c);
|
|
111
|
+
}
|
|
112
|
+
function createMemo(fn, value, options) {
|
|
113
|
+
options = options ? Object.assign({}, signalOptions, options) : signalOptions;
|
|
114
|
+
const c = createComputation(fn, value, true, 0);
|
|
115
|
+
c.observers = null;
|
|
116
|
+
c.observerSlots = null;
|
|
117
|
+
c.comparator = options.equals || void 0;
|
|
118
|
+
if (Scheduler && Transition && Transition.running) {
|
|
119
|
+
c.tState = STALE;
|
|
120
|
+
Updates.push(c);
|
|
121
|
+
} else updateComputation(c);
|
|
122
|
+
return readSignal.bind(c);
|
|
123
|
+
}
|
|
124
|
+
function untrack(fn) {
|
|
125
|
+
if (!ExternalSourceConfig && Listener === null) return fn();
|
|
126
|
+
const listener = Listener;
|
|
127
|
+
Listener = null;
|
|
128
|
+
try {
|
|
129
|
+
if (ExternalSourceConfig) return ExternalSourceConfig.untrack(fn);
|
|
130
|
+
return fn();
|
|
131
|
+
} finally {
|
|
132
|
+
Listener = listener;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function onCleanup(fn) {
|
|
136
|
+
if (Owner === null);
|
|
137
|
+
else if (Owner.cleanups === null) Owner.cleanups = [fn];
|
|
138
|
+
else Owner.cleanups.push(fn);
|
|
139
|
+
return fn;
|
|
140
|
+
}
|
|
141
|
+
function startTransition(fn) {
|
|
142
|
+
if (Transition && Transition.running) {
|
|
143
|
+
fn();
|
|
144
|
+
return Transition.done;
|
|
145
|
+
}
|
|
146
|
+
const l = Listener;
|
|
147
|
+
const o = Owner;
|
|
148
|
+
return Promise.resolve().then(() => {
|
|
149
|
+
Listener = l;
|
|
150
|
+
Owner = o;
|
|
151
|
+
let t;
|
|
152
|
+
if (Scheduler || SuspenseContext) {
|
|
153
|
+
t = Transition || (Transition = {
|
|
154
|
+
sources: /* @__PURE__ */ new Set(),
|
|
155
|
+
effects: [],
|
|
156
|
+
promises: /* @__PURE__ */ new Set(),
|
|
157
|
+
disposed: /* @__PURE__ */ new Set(),
|
|
158
|
+
queue: /* @__PURE__ */ new Set(),
|
|
159
|
+
running: true
|
|
160
|
+
});
|
|
161
|
+
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
162
|
+
t.running = true;
|
|
163
|
+
}
|
|
164
|
+
runUpdates(fn, false);
|
|
165
|
+
Listener = Owner = null;
|
|
166
|
+
return t ? t.done : void 0;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
170
|
+
function useContext(context) {
|
|
171
|
+
let value;
|
|
172
|
+
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
173
|
+
}
|
|
174
|
+
let SuspenseContext;
|
|
175
|
+
function readSignal() {
|
|
176
|
+
const runningTransition = Transition && Transition.running;
|
|
177
|
+
if (this.sources && (runningTransition ? this.tState : this.state)) if ((runningTransition ? this.tState : this.state) === STALE) updateComputation(this);
|
|
178
|
+
else {
|
|
179
|
+
const updates = Updates;
|
|
180
|
+
Updates = null;
|
|
181
|
+
runUpdates(() => lookUpstream(this), false);
|
|
182
|
+
Updates = updates;
|
|
183
|
+
}
|
|
184
|
+
if (Listener) {
|
|
185
|
+
const sSlot = this.observers ? this.observers.length : 0;
|
|
186
|
+
if (!Listener.sources) {
|
|
187
|
+
Listener.sources = [this];
|
|
188
|
+
Listener.sourceSlots = [sSlot];
|
|
189
|
+
} else {
|
|
190
|
+
Listener.sources.push(this);
|
|
191
|
+
Listener.sourceSlots.push(sSlot);
|
|
192
|
+
}
|
|
193
|
+
if (!this.observers) {
|
|
194
|
+
this.observers = [Listener];
|
|
195
|
+
this.observerSlots = [Listener.sources.length - 1];
|
|
196
|
+
} else {
|
|
197
|
+
this.observers.push(Listener);
|
|
198
|
+
this.observerSlots.push(Listener.sources.length - 1);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (runningTransition && Transition.sources.has(this)) return this.tValue;
|
|
202
|
+
return this.value;
|
|
203
|
+
}
|
|
204
|
+
function writeSignal(node, value, isComp) {
|
|
205
|
+
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
206
|
+
if (!node.comparator || !node.comparator(current, value)) {
|
|
207
|
+
if (Transition) {
|
|
208
|
+
const TransitionRunning = Transition.running;
|
|
209
|
+
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
210
|
+
Transition.sources.add(node);
|
|
211
|
+
node.tValue = value;
|
|
212
|
+
}
|
|
213
|
+
if (!TransitionRunning) node.value = value;
|
|
214
|
+
} else node.value = value;
|
|
215
|
+
if (node.observers && node.observers.length) runUpdates(() => {
|
|
216
|
+
for (let i = 0; i < node.observers.length; i += 1) {
|
|
217
|
+
const o = node.observers[i];
|
|
218
|
+
const TransitionRunning = Transition && Transition.running;
|
|
219
|
+
if (TransitionRunning && Transition.disposed.has(o)) continue;
|
|
220
|
+
if (TransitionRunning ? !o.tState : !o.state) {
|
|
221
|
+
if (o.pure) Updates.push(o);
|
|
222
|
+
else Effects.push(o);
|
|
223
|
+
if (o.observers) markDownstream(o);
|
|
224
|
+
}
|
|
225
|
+
if (!TransitionRunning) o.state = STALE;
|
|
226
|
+
else o.tState = STALE;
|
|
227
|
+
}
|
|
228
|
+
if (Updates.length > 1e6) {
|
|
229
|
+
Updates = [];
|
|
230
|
+
throw new Error();
|
|
231
|
+
}
|
|
232
|
+
}, false);
|
|
233
|
+
}
|
|
234
|
+
return value;
|
|
235
|
+
}
|
|
236
|
+
function updateComputation(node) {
|
|
237
|
+
if (!node.fn) return;
|
|
238
|
+
cleanNode(node);
|
|
239
|
+
const time = ExecCount;
|
|
240
|
+
runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
|
|
241
|
+
if (Transition && !Transition.running && Transition.sources.has(node)) queueMicrotask(() => {
|
|
242
|
+
runUpdates(() => {
|
|
243
|
+
Transition && (Transition.running = true);
|
|
244
|
+
Listener = Owner = node;
|
|
245
|
+
runComputation(node, node.tValue, time);
|
|
246
|
+
Listener = Owner = null;
|
|
247
|
+
}, false);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
function runComputation(node, value, time) {
|
|
251
|
+
let nextValue;
|
|
252
|
+
const owner = Owner, listener = Listener;
|
|
253
|
+
Listener = Owner = node;
|
|
254
|
+
try {
|
|
255
|
+
nextValue = node.fn(value);
|
|
256
|
+
} catch (err) {
|
|
257
|
+
if (node.pure) if (Transition && Transition.running) {
|
|
258
|
+
node.tState = STALE;
|
|
259
|
+
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
260
|
+
node.tOwned = void 0;
|
|
261
|
+
} else {
|
|
262
|
+
node.state = STALE;
|
|
263
|
+
node.owned && node.owned.forEach(cleanNode);
|
|
264
|
+
node.owned = null;
|
|
265
|
+
}
|
|
266
|
+
node.updatedAt = time + 1;
|
|
267
|
+
return handleError(err);
|
|
268
|
+
} finally {
|
|
269
|
+
Listener = listener;
|
|
270
|
+
Owner = owner;
|
|
271
|
+
}
|
|
272
|
+
if (!node.updatedAt || node.updatedAt <= time) {
|
|
273
|
+
if (node.updatedAt != null && "observers" in node) writeSignal(node, nextValue, true);
|
|
274
|
+
else if (Transition && Transition.running && node.pure) {
|
|
275
|
+
Transition.sources.add(node);
|
|
276
|
+
node.tValue = nextValue;
|
|
277
|
+
} else node.value = nextValue;
|
|
278
|
+
node.updatedAt = time;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function createComputation(fn, init, pure, state = STALE, options) {
|
|
282
|
+
const c = {
|
|
283
|
+
fn,
|
|
284
|
+
state,
|
|
285
|
+
updatedAt: null,
|
|
286
|
+
owned: null,
|
|
287
|
+
sources: null,
|
|
288
|
+
sourceSlots: null,
|
|
289
|
+
cleanups: null,
|
|
290
|
+
value: init,
|
|
291
|
+
owner: Owner,
|
|
292
|
+
context: Owner ? Owner.context : null,
|
|
293
|
+
pure
|
|
294
|
+
};
|
|
295
|
+
if (Transition && Transition.running) {
|
|
296
|
+
c.state = 0;
|
|
297
|
+
c.tState = state;
|
|
298
|
+
}
|
|
299
|
+
if (Owner === null);
|
|
300
|
+
else if (Owner !== UNOWNED) if (Transition && Transition.running && Owner.pure) if (!Owner.tOwned) Owner.tOwned = [c];
|
|
301
|
+
else Owner.tOwned.push(c);
|
|
302
|
+
else if (!Owner.owned) Owner.owned = [c];
|
|
303
|
+
else Owner.owned.push(c);
|
|
304
|
+
if (ExternalSourceConfig && c.fn) {
|
|
305
|
+
const [track, trigger] = createSignal(void 0, { equals: false });
|
|
306
|
+
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
307
|
+
onCleanup(() => ordinary.dispose());
|
|
308
|
+
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
309
|
+
const inTransition = ExternalSourceConfig.factory(c.fn, triggerInTransition);
|
|
310
|
+
c.fn = (x) => {
|
|
311
|
+
track();
|
|
312
|
+
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
return c;
|
|
316
|
+
}
|
|
317
|
+
function runTop(node) {
|
|
318
|
+
const runningTransition = Transition && Transition.running;
|
|
319
|
+
if ((runningTransition ? node.tState : node.state) === 0) return;
|
|
320
|
+
if ((runningTransition ? node.tState : node.state) === PENDING) return lookUpstream(node);
|
|
321
|
+
if (node.suspense && untrack(node.suspense.inFallback)) return node.suspense.effects.push(node);
|
|
322
|
+
const ancestors = [node];
|
|
323
|
+
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
324
|
+
if (runningTransition && Transition.disposed.has(node)) return;
|
|
325
|
+
if (runningTransition ? node.tState : node.state) ancestors.push(node);
|
|
326
|
+
}
|
|
327
|
+
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
328
|
+
node = ancestors[i];
|
|
329
|
+
if (runningTransition) {
|
|
330
|
+
let top = node, prev = ancestors[i + 1];
|
|
331
|
+
while ((top = top.owner) && top !== prev) if (Transition.disposed.has(top)) return;
|
|
332
|
+
}
|
|
333
|
+
if ((runningTransition ? node.tState : node.state) === STALE) updateComputation(node);
|
|
334
|
+
else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
335
|
+
const updates = Updates;
|
|
336
|
+
Updates = null;
|
|
337
|
+
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
338
|
+
Updates = updates;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function runUpdates(fn, init) {
|
|
343
|
+
if (Updates) return fn();
|
|
344
|
+
let wait = false;
|
|
345
|
+
if (!init) Updates = [];
|
|
346
|
+
if (Effects) wait = true;
|
|
347
|
+
else Effects = [];
|
|
348
|
+
ExecCount++;
|
|
349
|
+
try {
|
|
350
|
+
const res = fn();
|
|
351
|
+
completeUpdates(wait);
|
|
352
|
+
return res;
|
|
353
|
+
} catch (err) {
|
|
354
|
+
if (!wait) Effects = null;
|
|
355
|
+
Updates = null;
|
|
356
|
+
handleError(err);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
function completeUpdates(wait) {
|
|
360
|
+
if (Updates) {
|
|
361
|
+
if (Scheduler && Transition && Transition.running) scheduleQueue(Updates);
|
|
362
|
+
else runQueue(Updates);
|
|
363
|
+
Updates = null;
|
|
364
|
+
}
|
|
365
|
+
if (wait) return;
|
|
366
|
+
let res;
|
|
367
|
+
if (Transition) {
|
|
368
|
+
if (!Transition.promises.size && !Transition.queue.size) {
|
|
369
|
+
const sources = Transition.sources;
|
|
370
|
+
const disposed = Transition.disposed;
|
|
371
|
+
Effects.push.apply(Effects, Transition.effects);
|
|
372
|
+
res = Transition.resolve;
|
|
373
|
+
for (const e$1 of Effects) {
|
|
374
|
+
"tState" in e$1 && (e$1.state = e$1.tState);
|
|
375
|
+
delete e$1.tState;
|
|
376
|
+
}
|
|
377
|
+
Transition = null;
|
|
378
|
+
runUpdates(() => {
|
|
379
|
+
for (const d of disposed) cleanNode(d);
|
|
380
|
+
for (const v of sources) {
|
|
381
|
+
v.value = v.tValue;
|
|
382
|
+
if (v.owned) for (let i = 0, len = v.owned.length; i < len; i++) cleanNode(v.owned[i]);
|
|
383
|
+
if (v.tOwned) v.owned = v.tOwned;
|
|
384
|
+
delete v.tValue;
|
|
385
|
+
delete v.tOwned;
|
|
386
|
+
v.tState = 0;
|
|
387
|
+
}
|
|
388
|
+
setTransPending(false);
|
|
389
|
+
}, false);
|
|
390
|
+
} else if (Transition.running) {
|
|
391
|
+
Transition.running = false;
|
|
392
|
+
Transition.effects.push.apply(Transition.effects, Effects);
|
|
393
|
+
Effects = null;
|
|
394
|
+
setTransPending(true);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const e = Effects;
|
|
399
|
+
Effects = null;
|
|
400
|
+
if (e.length) runUpdates(() => runEffects(e), false);
|
|
401
|
+
if (res) res();
|
|
402
|
+
}
|
|
403
|
+
function runQueue(queue) {
|
|
404
|
+
for (let i = 0; i < queue.length; i++) runTop(queue[i]);
|
|
405
|
+
}
|
|
406
|
+
function scheduleQueue(queue) {
|
|
407
|
+
for (let i = 0; i < queue.length; i++) {
|
|
408
|
+
const item = queue[i];
|
|
409
|
+
const tasks = Transition.queue;
|
|
410
|
+
if (!tasks.has(item)) {
|
|
411
|
+
tasks.add(item);
|
|
412
|
+
Scheduler(() => {
|
|
413
|
+
tasks.delete(item);
|
|
414
|
+
runUpdates(() => {
|
|
415
|
+
Transition.running = true;
|
|
416
|
+
runTop(item);
|
|
417
|
+
}, false);
|
|
418
|
+
Transition && (Transition.running = false);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function runUserEffects(queue) {
|
|
424
|
+
let i, userLength = 0;
|
|
425
|
+
for (i = 0; i < queue.length; i++) {
|
|
426
|
+
const e = queue[i];
|
|
427
|
+
if (!e.user) runTop(e);
|
|
428
|
+
else queue[userLength++] = e;
|
|
429
|
+
}
|
|
430
|
+
if (sharedConfig.context) {
|
|
431
|
+
if (sharedConfig.count) {
|
|
432
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
433
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
setHydrateContext();
|
|
437
|
+
}
|
|
438
|
+
if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
|
|
439
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
440
|
+
userLength += sharedConfig.effects.length;
|
|
441
|
+
delete sharedConfig.effects;
|
|
442
|
+
}
|
|
443
|
+
for (i = 0; i < userLength; i++) runTop(queue[i]);
|
|
444
|
+
}
|
|
445
|
+
function lookUpstream(node, ignore) {
|
|
446
|
+
const runningTransition = Transition && Transition.running;
|
|
447
|
+
if (runningTransition) node.tState = 0;
|
|
448
|
+
else node.state = 0;
|
|
449
|
+
for (let i = 0; i < node.sources.length; i += 1) {
|
|
450
|
+
const source = node.sources[i];
|
|
451
|
+
if (source.sources) {
|
|
452
|
+
const state = runningTransition ? source.tState : source.state;
|
|
453
|
+
if (state === STALE) {
|
|
454
|
+
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount)) runTop(source);
|
|
455
|
+
} else if (state === PENDING) lookUpstream(source, ignore);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function markDownstream(node) {
|
|
460
|
+
const runningTransition = Transition && Transition.running;
|
|
461
|
+
for (let i = 0; i < node.observers.length; i += 1) {
|
|
462
|
+
const o = node.observers[i];
|
|
463
|
+
if (runningTransition ? !o.tState : !o.state) {
|
|
464
|
+
if (runningTransition) o.tState = PENDING;
|
|
465
|
+
else o.state = PENDING;
|
|
466
|
+
if (o.pure) Updates.push(o);
|
|
467
|
+
else Effects.push(o);
|
|
468
|
+
o.observers && markDownstream(o);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
function cleanNode(node) {
|
|
473
|
+
let i;
|
|
474
|
+
if (node.sources) while (node.sources.length) {
|
|
475
|
+
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
476
|
+
if (obs && obs.length) {
|
|
477
|
+
const n = obs.pop(), s = source.observerSlots.pop();
|
|
478
|
+
if (index < obs.length) {
|
|
479
|
+
n.sourceSlots[s] = index;
|
|
480
|
+
obs[index] = n;
|
|
481
|
+
source.observerSlots[index] = s;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (node.tOwned) {
|
|
486
|
+
for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
|
|
487
|
+
delete node.tOwned;
|
|
488
|
+
}
|
|
489
|
+
if (Transition && Transition.running && node.pure) reset(node, true);
|
|
490
|
+
else if (node.owned) {
|
|
491
|
+
for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
|
|
492
|
+
node.owned = null;
|
|
493
|
+
}
|
|
494
|
+
if (node.cleanups) {
|
|
495
|
+
for (i = node.cleanups.length - 1; i >= 0; i--) node.cleanups[i]();
|
|
496
|
+
node.cleanups = null;
|
|
497
|
+
}
|
|
498
|
+
if (Transition && Transition.running) node.tState = 0;
|
|
499
|
+
else node.state = 0;
|
|
500
|
+
}
|
|
501
|
+
function reset(node, top) {
|
|
502
|
+
if (!top) {
|
|
503
|
+
node.tState = 0;
|
|
504
|
+
Transition.disposed.add(node);
|
|
505
|
+
}
|
|
506
|
+
if (node.owned) for (let i = 0; i < node.owned.length; i++) reset(node.owned[i]);
|
|
507
|
+
}
|
|
508
|
+
function castError(err) {
|
|
509
|
+
if (err instanceof Error) return err;
|
|
510
|
+
return new Error(typeof err === "string" ? err : "Unknown error", { cause: err });
|
|
511
|
+
}
|
|
512
|
+
function runErrors(err, fns, owner) {
|
|
513
|
+
try {
|
|
514
|
+
for (const f of fns) f(err);
|
|
515
|
+
} catch (e) {
|
|
516
|
+
handleError(e, owner && owner.owner || null);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function handleError(err, owner = Owner) {
|
|
520
|
+
const fns = ERROR && owner && owner.context && owner.context[ERROR];
|
|
521
|
+
const error = castError(err);
|
|
522
|
+
if (!fns) throw error;
|
|
523
|
+
if (Effects) Effects.push({
|
|
524
|
+
fn() {
|
|
525
|
+
runErrors(error, fns, owner);
|
|
526
|
+
},
|
|
527
|
+
state: STALE
|
|
528
|
+
});
|
|
529
|
+
else runErrors(error, fns, owner);
|
|
530
|
+
}
|
|
531
|
+
const FALLBACK = Symbol("fallback");
|
|
532
|
+
function dispose(d) {
|
|
533
|
+
for (let i = 0; i < d.length; i++) d[i]();
|
|
534
|
+
}
|
|
535
|
+
function mapArray(list, mapFn, options = {}) {
|
|
536
|
+
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
537
|
+
onCleanup(() => dispose(disposers));
|
|
538
|
+
return () => {
|
|
539
|
+
let newItems = list() || [], newLen = newItems.length, i, j;
|
|
540
|
+
newItems[$TRACK];
|
|
541
|
+
return untrack(() => {
|
|
542
|
+
let newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
|
|
543
|
+
if (newLen === 0) {
|
|
544
|
+
if (len !== 0) {
|
|
545
|
+
dispose(disposers);
|
|
546
|
+
disposers = [];
|
|
547
|
+
items = [];
|
|
548
|
+
mapped = [];
|
|
549
|
+
len = 0;
|
|
550
|
+
indexes && (indexes = []);
|
|
551
|
+
}
|
|
552
|
+
if (options.fallback) {
|
|
553
|
+
items = [FALLBACK];
|
|
554
|
+
mapped[0] = createRoot((disposer) => {
|
|
555
|
+
disposers[0] = disposer;
|
|
556
|
+
return options.fallback();
|
|
557
|
+
});
|
|
558
|
+
len = 1;
|
|
559
|
+
}
|
|
560
|
+
} else if (len === 0) {
|
|
561
|
+
mapped = new Array(newLen);
|
|
562
|
+
for (j = 0; j < newLen; j++) {
|
|
563
|
+
items[j] = newItems[j];
|
|
564
|
+
mapped[j] = createRoot(mapper);
|
|
565
|
+
}
|
|
566
|
+
len = newLen;
|
|
567
|
+
} else {
|
|
568
|
+
temp = new Array(newLen);
|
|
569
|
+
tempdisposers = new Array(newLen);
|
|
570
|
+
indexes && (tempIndexes = new Array(newLen));
|
|
571
|
+
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++);
|
|
572
|
+
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
573
|
+
temp[newEnd] = mapped[end];
|
|
574
|
+
tempdisposers[newEnd] = disposers[end];
|
|
575
|
+
indexes && (tempIndexes[newEnd] = indexes[end]);
|
|
576
|
+
}
|
|
577
|
+
newIndices = /* @__PURE__ */ new Map();
|
|
578
|
+
newIndicesNext = new Array(newEnd + 1);
|
|
579
|
+
for (j = newEnd; j >= start; j--) {
|
|
580
|
+
item = newItems[j];
|
|
581
|
+
i = newIndices.get(item);
|
|
582
|
+
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
583
|
+
newIndices.set(item, j);
|
|
584
|
+
}
|
|
585
|
+
for (i = start; i <= end; i++) {
|
|
586
|
+
item = items[i];
|
|
587
|
+
j = newIndices.get(item);
|
|
588
|
+
if (j !== void 0 && j !== -1) {
|
|
589
|
+
temp[j] = mapped[i];
|
|
590
|
+
tempdisposers[j] = disposers[i];
|
|
591
|
+
indexes && (tempIndexes[j] = indexes[i]);
|
|
592
|
+
j = newIndicesNext[j];
|
|
593
|
+
newIndices.set(item, j);
|
|
594
|
+
} else disposers[i]();
|
|
595
|
+
}
|
|
596
|
+
for (j = start; j < newLen; j++) if (j in temp) {
|
|
597
|
+
mapped[j] = temp[j];
|
|
598
|
+
disposers[j] = tempdisposers[j];
|
|
599
|
+
if (indexes) {
|
|
600
|
+
indexes[j] = tempIndexes[j];
|
|
601
|
+
indexes[j](j);
|
|
602
|
+
}
|
|
603
|
+
} else mapped[j] = createRoot(mapper);
|
|
604
|
+
mapped = mapped.slice(0, len = newLen);
|
|
605
|
+
items = newItems.slice(0);
|
|
606
|
+
}
|
|
607
|
+
return mapped;
|
|
608
|
+
});
|
|
609
|
+
function mapper(disposer) {
|
|
610
|
+
disposers[j] = disposer;
|
|
611
|
+
if (indexes) {
|
|
612
|
+
const [s, set] = createSignal(j);
|
|
613
|
+
indexes[j] = set;
|
|
614
|
+
return mapFn(newItems[j], s);
|
|
615
|
+
}
|
|
616
|
+
return mapFn(newItems[j]);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
let hydrationEnabled = false;
|
|
621
|
+
function createComponent(Comp, props) {
|
|
622
|
+
if (hydrationEnabled) {
|
|
623
|
+
if (sharedConfig.context) {
|
|
624
|
+
const c = sharedConfig.context;
|
|
625
|
+
setHydrateContext(nextHydrateContext());
|
|
626
|
+
const r = untrack(() => Comp(props || {}));
|
|
627
|
+
setHydrateContext(c);
|
|
628
|
+
return r;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return untrack(() => Comp(props || {}));
|
|
632
|
+
}
|
|
633
|
+
function trueFn() {
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
const propTraps = {
|
|
637
|
+
get(_, property, receiver) {
|
|
638
|
+
if (property === $PROXY) return receiver;
|
|
639
|
+
return _.get(property);
|
|
640
|
+
},
|
|
641
|
+
has(_, property) {
|
|
642
|
+
if (property === $PROXY) return true;
|
|
643
|
+
return _.has(property);
|
|
644
|
+
},
|
|
645
|
+
set: trueFn,
|
|
646
|
+
deleteProperty: trueFn,
|
|
647
|
+
getOwnPropertyDescriptor(_, property) {
|
|
648
|
+
return {
|
|
649
|
+
configurable: true,
|
|
650
|
+
enumerable: true,
|
|
651
|
+
get() {
|
|
652
|
+
return _.get(property);
|
|
653
|
+
},
|
|
654
|
+
set: trueFn,
|
|
655
|
+
deleteProperty: trueFn
|
|
656
|
+
};
|
|
657
|
+
},
|
|
658
|
+
ownKeys(_) {
|
|
659
|
+
return _.keys();
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
function splitProps(props, ...keys) {
|
|
663
|
+
const len = keys.length;
|
|
664
|
+
if (SUPPORTS_PROXY && $PROXY in props) {
|
|
665
|
+
const blocked = len > 1 ? keys.flat() : keys[0];
|
|
666
|
+
const res = keys.map((k) => {
|
|
667
|
+
return new Proxy({
|
|
668
|
+
get(property) {
|
|
669
|
+
return k.includes(property) ? props[property] : void 0;
|
|
670
|
+
},
|
|
671
|
+
has(property) {
|
|
672
|
+
return k.includes(property) && property in props;
|
|
673
|
+
},
|
|
674
|
+
keys() {
|
|
675
|
+
return k.filter((property) => property in props);
|
|
676
|
+
}
|
|
677
|
+
}, propTraps);
|
|
678
|
+
});
|
|
679
|
+
res.push(new Proxy({
|
|
680
|
+
get(property) {
|
|
681
|
+
return blocked.includes(property) ? void 0 : props[property];
|
|
682
|
+
},
|
|
683
|
+
has(property) {
|
|
684
|
+
return blocked.includes(property) ? false : property in props;
|
|
685
|
+
},
|
|
686
|
+
keys() {
|
|
687
|
+
return Object.keys(props).filter((k) => !blocked.includes(k));
|
|
688
|
+
}
|
|
689
|
+
}, propTraps));
|
|
690
|
+
return res;
|
|
691
|
+
}
|
|
692
|
+
const objects = [];
|
|
693
|
+
for (let i = 0; i <= len; i++) objects[i] = {};
|
|
694
|
+
for (const propName of Object.getOwnPropertyNames(props)) {
|
|
695
|
+
let keyIndex = len;
|
|
696
|
+
for (let i = 0; i < keys.length; i++) if (keys[i].includes(propName)) {
|
|
697
|
+
keyIndex = i;
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
const desc = Object.getOwnPropertyDescriptor(props, propName);
|
|
701
|
+
!desc.get && !desc.set && desc.enumerable && desc.writable && desc.configurable ? objects[keyIndex][propName] = desc.value : Object.defineProperty(objects[keyIndex], propName, desc);
|
|
702
|
+
}
|
|
703
|
+
return objects;
|
|
704
|
+
}
|
|
705
|
+
const narrowedError = (name) => `Stale read from <${name}>.`;
|
|
706
|
+
function For(props) {
|
|
707
|
+
const fallback = "fallback" in props && { fallback: () => props.fallback };
|
|
708
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
709
|
+
}
|
|
710
|
+
function Show(props) {
|
|
711
|
+
const keyed = props.keyed;
|
|
712
|
+
const conditionValue = createMemo(() => props.when, void 0, void 0);
|
|
713
|
+
const condition = keyed ? conditionValue : createMemo(conditionValue, void 0, { equals: (a, b) => !a === !b });
|
|
714
|
+
return createMemo(() => {
|
|
715
|
+
const c = condition();
|
|
716
|
+
if (c) {
|
|
717
|
+
const child = props.children;
|
|
718
|
+
return typeof child === "function" && child.length > 0 ? untrack(() => child(keyed ? c : () => {
|
|
719
|
+
if (!untrack(condition)) throw narrowedError("Show");
|
|
720
|
+
return conditionValue();
|
|
721
|
+
})) : child;
|
|
722
|
+
}
|
|
723
|
+
return props.fallback;
|
|
724
|
+
}, void 0, void 0);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region ../../node_modules/solid-js/web/dist/web.js
|
|
729
|
+
const Properties = /* @__PURE__ */ new Set([
|
|
730
|
+
"className",
|
|
731
|
+
"value",
|
|
732
|
+
"readOnly",
|
|
733
|
+
"noValidate",
|
|
734
|
+
"formNoValidate",
|
|
735
|
+
"isMap",
|
|
736
|
+
"noModule",
|
|
737
|
+
"playsInline",
|
|
738
|
+
"adAuctionHeaders",
|
|
739
|
+
"allowFullscreen",
|
|
740
|
+
"browsingTopics",
|
|
741
|
+
"defaultChecked",
|
|
742
|
+
"defaultMuted",
|
|
743
|
+
"defaultSelected",
|
|
744
|
+
"disablePictureInPicture",
|
|
745
|
+
"disableRemotePlayback",
|
|
746
|
+
"preservesPitch",
|
|
747
|
+
"shadowRootClonable",
|
|
748
|
+
"shadowRootCustomElementRegistry",
|
|
749
|
+
"shadowRootDelegatesFocus",
|
|
750
|
+
"shadowRootSerializable",
|
|
751
|
+
"sharedStorageWritable",
|
|
752
|
+
...[
|
|
753
|
+
"allowfullscreen",
|
|
754
|
+
"async",
|
|
755
|
+
"alpha",
|
|
756
|
+
"autofocus",
|
|
757
|
+
"autoplay",
|
|
758
|
+
"checked",
|
|
759
|
+
"controls",
|
|
760
|
+
"default",
|
|
761
|
+
"disabled",
|
|
762
|
+
"formnovalidate",
|
|
763
|
+
"hidden",
|
|
764
|
+
"indeterminate",
|
|
765
|
+
"inert",
|
|
766
|
+
"ismap",
|
|
767
|
+
"loop",
|
|
768
|
+
"multiple",
|
|
769
|
+
"muted",
|
|
770
|
+
"nomodule",
|
|
771
|
+
"novalidate",
|
|
772
|
+
"open",
|
|
773
|
+
"playsinline",
|
|
774
|
+
"readonly",
|
|
775
|
+
"required",
|
|
776
|
+
"reversed",
|
|
777
|
+
"seamless",
|
|
778
|
+
"selected",
|
|
779
|
+
"adauctionheaders",
|
|
780
|
+
"browsingtopics",
|
|
781
|
+
"credentialless",
|
|
782
|
+
"defaultchecked",
|
|
783
|
+
"defaultmuted",
|
|
784
|
+
"defaultselected",
|
|
785
|
+
"defer",
|
|
786
|
+
"disablepictureinpicture",
|
|
787
|
+
"disableremoteplayback",
|
|
788
|
+
"preservespitch",
|
|
789
|
+
"shadowrootclonable",
|
|
790
|
+
"shadowrootcustomelementregistry",
|
|
791
|
+
"shadowrootdelegatesfocus",
|
|
792
|
+
"shadowrootserializable",
|
|
793
|
+
"sharedstoragewritable"
|
|
794
|
+
]
|
|
795
|
+
]);
|
|
796
|
+
const ChildProperties = /* @__PURE__ */ new Set([
|
|
797
|
+
"innerHTML",
|
|
798
|
+
"textContent",
|
|
799
|
+
"innerText",
|
|
800
|
+
"children"
|
|
801
|
+
]);
|
|
802
|
+
const Aliases = /* @__PURE__ */ Object.assign(Object.create(null), {
|
|
803
|
+
className: "class",
|
|
804
|
+
htmlFor: "for"
|
|
805
|
+
});
|
|
806
|
+
const PropAliases = /* @__PURE__ */ Object.assign(Object.create(null), {
|
|
807
|
+
class: "className",
|
|
808
|
+
novalidate: {
|
|
809
|
+
$: "noValidate",
|
|
810
|
+
FORM: 1
|
|
811
|
+
},
|
|
812
|
+
formnovalidate: {
|
|
813
|
+
$: "formNoValidate",
|
|
814
|
+
BUTTON: 1,
|
|
815
|
+
INPUT: 1
|
|
816
|
+
},
|
|
817
|
+
ismap: {
|
|
818
|
+
$: "isMap",
|
|
819
|
+
IMG: 1
|
|
820
|
+
},
|
|
821
|
+
nomodule: {
|
|
822
|
+
$: "noModule",
|
|
823
|
+
SCRIPT: 1
|
|
824
|
+
},
|
|
825
|
+
playsinline: {
|
|
826
|
+
$: "playsInline",
|
|
827
|
+
VIDEO: 1
|
|
828
|
+
},
|
|
829
|
+
readonly: {
|
|
830
|
+
$: "readOnly",
|
|
831
|
+
INPUT: 1,
|
|
832
|
+
TEXTAREA: 1
|
|
833
|
+
},
|
|
834
|
+
adauctionheaders: {
|
|
835
|
+
$: "adAuctionHeaders",
|
|
836
|
+
IFRAME: 1
|
|
837
|
+
},
|
|
838
|
+
allowfullscreen: {
|
|
839
|
+
$: "allowFullscreen",
|
|
840
|
+
IFRAME: 1
|
|
841
|
+
},
|
|
842
|
+
browsingtopics: {
|
|
843
|
+
$: "browsingTopics",
|
|
844
|
+
IMG: 1
|
|
845
|
+
},
|
|
846
|
+
defaultchecked: {
|
|
847
|
+
$: "defaultChecked",
|
|
848
|
+
INPUT: 1
|
|
849
|
+
},
|
|
850
|
+
defaultmuted: {
|
|
851
|
+
$: "defaultMuted",
|
|
852
|
+
AUDIO: 1,
|
|
853
|
+
VIDEO: 1
|
|
854
|
+
},
|
|
855
|
+
defaultselected: {
|
|
856
|
+
$: "defaultSelected",
|
|
857
|
+
OPTION: 1
|
|
858
|
+
},
|
|
859
|
+
disablepictureinpicture: {
|
|
860
|
+
$: "disablePictureInPicture",
|
|
861
|
+
VIDEO: 1
|
|
862
|
+
},
|
|
863
|
+
disableremoteplayback: {
|
|
864
|
+
$: "disableRemotePlayback",
|
|
865
|
+
AUDIO: 1,
|
|
866
|
+
VIDEO: 1
|
|
867
|
+
},
|
|
868
|
+
preservespitch: {
|
|
869
|
+
$: "preservesPitch",
|
|
870
|
+
AUDIO: 1,
|
|
871
|
+
VIDEO: 1
|
|
872
|
+
},
|
|
873
|
+
shadowrootclonable: {
|
|
874
|
+
$: "shadowRootClonable",
|
|
875
|
+
TEMPLATE: 1
|
|
876
|
+
},
|
|
877
|
+
shadowrootdelegatesfocus: {
|
|
878
|
+
$: "shadowRootDelegatesFocus",
|
|
879
|
+
TEMPLATE: 1
|
|
880
|
+
},
|
|
881
|
+
shadowrootserializable: {
|
|
882
|
+
$: "shadowRootSerializable",
|
|
883
|
+
TEMPLATE: 1
|
|
884
|
+
},
|
|
885
|
+
sharedstoragewritable: {
|
|
886
|
+
$: "sharedStorageWritable",
|
|
887
|
+
IFRAME: 1,
|
|
888
|
+
IMG: 1
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
function getPropAlias(prop, tagName) {
|
|
892
|
+
const a = PropAliases[prop];
|
|
893
|
+
return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
|
|
894
|
+
}
|
|
895
|
+
const DelegatedEvents = /* @__PURE__ */ new Set([
|
|
896
|
+
"beforeinput",
|
|
897
|
+
"click",
|
|
898
|
+
"dblclick",
|
|
899
|
+
"contextmenu",
|
|
900
|
+
"focusin",
|
|
901
|
+
"focusout",
|
|
902
|
+
"input",
|
|
903
|
+
"keydown",
|
|
904
|
+
"keyup",
|
|
905
|
+
"mousedown",
|
|
906
|
+
"mousemove",
|
|
907
|
+
"mouseout",
|
|
908
|
+
"mouseover",
|
|
909
|
+
"mouseup",
|
|
910
|
+
"pointerdown",
|
|
911
|
+
"pointermove",
|
|
912
|
+
"pointerout",
|
|
913
|
+
"pointerover",
|
|
914
|
+
"pointerup",
|
|
915
|
+
"touchend",
|
|
916
|
+
"touchmove",
|
|
917
|
+
"touchstart"
|
|
918
|
+
]);
|
|
919
|
+
const SVGElements = /* @__PURE__ */ new Set([
|
|
920
|
+
"altGlyph",
|
|
921
|
+
"altGlyphDef",
|
|
922
|
+
"altGlyphItem",
|
|
923
|
+
"animate",
|
|
924
|
+
"animateColor",
|
|
925
|
+
"animateMotion",
|
|
926
|
+
"animateTransform",
|
|
927
|
+
"circle",
|
|
928
|
+
"clipPath",
|
|
929
|
+
"color-profile",
|
|
930
|
+
"cursor",
|
|
931
|
+
"defs",
|
|
932
|
+
"desc",
|
|
933
|
+
"ellipse",
|
|
934
|
+
"feBlend",
|
|
935
|
+
"feColorMatrix",
|
|
936
|
+
"feComponentTransfer",
|
|
937
|
+
"feComposite",
|
|
938
|
+
"feConvolveMatrix",
|
|
939
|
+
"feDiffuseLighting",
|
|
940
|
+
"feDisplacementMap",
|
|
941
|
+
"feDistantLight",
|
|
942
|
+
"feDropShadow",
|
|
943
|
+
"feFlood",
|
|
944
|
+
"feFuncA",
|
|
945
|
+
"feFuncB",
|
|
946
|
+
"feFuncG",
|
|
947
|
+
"feFuncR",
|
|
948
|
+
"feGaussianBlur",
|
|
949
|
+
"feImage",
|
|
950
|
+
"feMerge",
|
|
951
|
+
"feMergeNode",
|
|
952
|
+
"feMorphology",
|
|
953
|
+
"feOffset",
|
|
954
|
+
"fePointLight",
|
|
955
|
+
"feSpecularLighting",
|
|
956
|
+
"feSpotLight",
|
|
957
|
+
"feTile",
|
|
958
|
+
"feTurbulence",
|
|
959
|
+
"filter",
|
|
960
|
+
"font",
|
|
961
|
+
"font-face",
|
|
962
|
+
"font-face-format",
|
|
963
|
+
"font-face-name",
|
|
964
|
+
"font-face-src",
|
|
965
|
+
"font-face-uri",
|
|
966
|
+
"foreignObject",
|
|
967
|
+
"g",
|
|
968
|
+
"glyph",
|
|
969
|
+
"glyphRef",
|
|
970
|
+
"hkern",
|
|
971
|
+
"image",
|
|
972
|
+
"line",
|
|
973
|
+
"linearGradient",
|
|
974
|
+
"marker",
|
|
975
|
+
"mask",
|
|
976
|
+
"metadata",
|
|
977
|
+
"missing-glyph",
|
|
978
|
+
"mpath",
|
|
979
|
+
"path",
|
|
980
|
+
"pattern",
|
|
981
|
+
"polygon",
|
|
982
|
+
"polyline",
|
|
983
|
+
"radialGradient",
|
|
984
|
+
"rect",
|
|
985
|
+
"set",
|
|
986
|
+
"stop",
|
|
987
|
+
"svg",
|
|
988
|
+
"switch",
|
|
989
|
+
"symbol",
|
|
990
|
+
"text",
|
|
991
|
+
"textPath",
|
|
992
|
+
"tref",
|
|
993
|
+
"tspan",
|
|
994
|
+
"use",
|
|
995
|
+
"view",
|
|
996
|
+
"vkern"
|
|
997
|
+
]);
|
|
998
|
+
const SVGNamespace = {
|
|
999
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
1000
|
+
xml: "http://www.w3.org/XML/1998/namespace"
|
|
1001
|
+
};
|
|
1002
|
+
function reconcileArrays(parentNode, a, b) {
|
|
1003
|
+
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
1004
|
+
while (aStart < aEnd || bStart < bEnd) {
|
|
1005
|
+
if (a[aStart] === b[bStart]) {
|
|
1006
|
+
aStart++;
|
|
1007
|
+
bStart++;
|
|
1008
|
+
continue;
|
|
1009
|
+
}
|
|
1010
|
+
while (a[aEnd - 1] === b[bEnd - 1]) {
|
|
1011
|
+
aEnd--;
|
|
1012
|
+
bEnd--;
|
|
1013
|
+
}
|
|
1014
|
+
if (aEnd === aStart) {
|
|
1015
|
+
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
1016
|
+
while (bStart < bEnd) parentNode.insertBefore(b[bStart++], node);
|
|
1017
|
+
} else if (bEnd === bStart) while (aStart < aEnd) {
|
|
1018
|
+
if (!map || !map.has(a[aStart])) a[aStart].remove();
|
|
1019
|
+
aStart++;
|
|
1020
|
+
}
|
|
1021
|
+
else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
1022
|
+
const node = a[--aEnd].nextSibling;
|
|
1023
|
+
parentNode.insertBefore(b[bStart++], a[aStart++].nextSibling);
|
|
1024
|
+
parentNode.insertBefore(b[--bEnd], node);
|
|
1025
|
+
a[aEnd] = b[bEnd];
|
|
1026
|
+
} else {
|
|
1027
|
+
if (!map) {
|
|
1028
|
+
map = /* @__PURE__ */ new Map();
|
|
1029
|
+
let i = bStart;
|
|
1030
|
+
while (i < bEnd) map.set(b[i], i++);
|
|
1031
|
+
}
|
|
1032
|
+
const index = map.get(a[aStart]);
|
|
1033
|
+
if (index != null) if (bStart < index && index < bEnd) {
|
|
1034
|
+
let i = aStart, sequence = 1, t;
|
|
1035
|
+
while (++i < aEnd && i < bEnd) {
|
|
1036
|
+
if ((t = map.get(a[i])) == null || t !== index + sequence) break;
|
|
1037
|
+
sequence++;
|
|
1038
|
+
}
|
|
1039
|
+
if (sequence > index - bStart) {
|
|
1040
|
+
const node = a[aStart];
|
|
1041
|
+
while (bStart < index) parentNode.insertBefore(b[bStart++], node);
|
|
1042
|
+
} else parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1043
|
+
} else aStart++;
|
|
1044
|
+
else a[aStart++].remove();
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
const $$EVENTS = "_$DX_DELEGATE";
|
|
1049
|
+
function template(html, isImportNode, isSVG, isMathML) {
|
|
1050
|
+
let node;
|
|
1051
|
+
const create = () => {
|
|
1052
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
1053
|
+
t.innerHTML = html;
|
|
1054
|
+
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
1055
|
+
};
|
|
1056
|
+
const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
1057
|
+
fn.cloneNode = fn;
|
|
1058
|
+
return fn;
|
|
1059
|
+
}
|
|
1060
|
+
function delegateEvents(eventNames, document$1 = window.document) {
|
|
1061
|
+
const e = document$1[$$EVENTS] || (document$1[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
1062
|
+
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
1063
|
+
const name = eventNames[i];
|
|
1064
|
+
if (!e.has(name)) {
|
|
1065
|
+
e.add(name);
|
|
1066
|
+
document$1.addEventListener(name, eventHandler);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
function setAttribute(node, name, value) {
|
|
1071
|
+
if (isHydrating(node)) return;
|
|
1072
|
+
if (value == null) node.removeAttribute(name);
|
|
1073
|
+
else node.setAttribute(name, value);
|
|
1074
|
+
}
|
|
1075
|
+
function setAttributeNS(node, namespace, name, value) {
|
|
1076
|
+
if (isHydrating(node)) return;
|
|
1077
|
+
if (value == null) node.removeAttributeNS(namespace, name);
|
|
1078
|
+
else node.setAttributeNS(namespace, name, value);
|
|
1079
|
+
}
|
|
1080
|
+
function setBoolAttribute(node, name, value) {
|
|
1081
|
+
if (isHydrating(node)) return;
|
|
1082
|
+
value ? node.setAttribute(name, "") : node.removeAttribute(name);
|
|
1083
|
+
}
|
|
1084
|
+
function className(node, value) {
|
|
1085
|
+
if (isHydrating(node)) return;
|
|
1086
|
+
if (value == null) node.removeAttribute("class");
|
|
1087
|
+
else node.className = value;
|
|
1088
|
+
}
|
|
1089
|
+
function addEventListener(node, name, handler, delegate) {
|
|
1090
|
+
if (delegate) if (Array.isArray(handler)) {
|
|
1091
|
+
node[`$$${name}`] = handler[0];
|
|
1092
|
+
node[`$$${name}Data`] = handler[1];
|
|
1093
|
+
} else node[`$$${name}`] = handler;
|
|
1094
|
+
else if (Array.isArray(handler)) {
|
|
1095
|
+
const handlerFn = handler[0];
|
|
1096
|
+
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
1097
|
+
} else node.addEventListener(name, handler, typeof handler !== "function" && handler);
|
|
1098
|
+
}
|
|
1099
|
+
function classList(node, value, prev = {}) {
|
|
1100
|
+
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
1101
|
+
let i, len;
|
|
1102
|
+
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
1103
|
+
const key = prevKeys[i];
|
|
1104
|
+
if (!key || key === "undefined" || value[key]) continue;
|
|
1105
|
+
toggleClassKey(node, key, false);
|
|
1106
|
+
delete prev[key];
|
|
1107
|
+
}
|
|
1108
|
+
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
1109
|
+
const key = classKeys[i], classValue = !!value[key];
|
|
1110
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue) continue;
|
|
1111
|
+
toggleClassKey(node, key, true);
|
|
1112
|
+
prev[key] = classValue;
|
|
1113
|
+
}
|
|
1114
|
+
return prev;
|
|
1115
|
+
}
|
|
1116
|
+
function style(node, value, prev) {
|
|
1117
|
+
if (!value) return prev ? setAttribute(node, "style") : value;
|
|
1118
|
+
const nodeStyle = node.style;
|
|
1119
|
+
if (typeof value === "string") return nodeStyle.cssText = value;
|
|
1120
|
+
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
1121
|
+
prev || (prev = {});
|
|
1122
|
+
value || (value = {});
|
|
1123
|
+
let v, s;
|
|
1124
|
+
for (s in prev) {
|
|
1125
|
+
value[s] ?? nodeStyle.removeProperty(s);
|
|
1126
|
+
delete prev[s];
|
|
1127
|
+
}
|
|
1128
|
+
for (s in value) {
|
|
1129
|
+
v = value[s];
|
|
1130
|
+
if (v !== prev[s]) {
|
|
1131
|
+
nodeStyle.setProperty(s, v);
|
|
1132
|
+
prev[s] = v;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
return prev;
|
|
1136
|
+
}
|
|
1137
|
+
function spread(node, props = {}, isSVG, skipChildren) {
|
|
1138
|
+
const prevProps = {};
|
|
1139
|
+
if (!skipChildren) createRenderEffect(() => prevProps.children = insertExpression(node, props.children, prevProps.children));
|
|
1140
|
+
createRenderEffect(() => typeof props.ref === "function" && use(props.ref, node));
|
|
1141
|
+
createRenderEffect(() => assign(node, props, isSVG, true, prevProps, true));
|
|
1142
|
+
return prevProps;
|
|
1143
|
+
}
|
|
1144
|
+
function use(fn, element, arg) {
|
|
1145
|
+
return untrack(() => fn(element, arg));
|
|
1146
|
+
}
|
|
1147
|
+
function insert(parent, accessor, marker, initial) {
|
|
1148
|
+
if (marker !== void 0 && !initial) initial = [];
|
|
1149
|
+
if (typeof accessor !== "function") return insertExpression(parent, accessor, initial, marker);
|
|
1150
|
+
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
1151
|
+
}
|
|
1152
|
+
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
1153
|
+
props || (props = {});
|
|
1154
|
+
for (const prop in prevProps) if (!(prop in props)) {
|
|
1155
|
+
if (prop === "children") continue;
|
|
1156
|
+
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
|
|
1157
|
+
}
|
|
1158
|
+
for (const prop in props) {
|
|
1159
|
+
if (prop === "children") {
|
|
1160
|
+
if (!skipChildren) insertExpression(node, props.children);
|
|
1161
|
+
continue;
|
|
1162
|
+
}
|
|
1163
|
+
const value = props[prop];
|
|
1164
|
+
prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
function getNextElement(template$1) {
|
|
1168
|
+
let node, key;
|
|
1169
|
+
if (!isHydrating() || !(node = sharedConfig.registry.get(key = getHydrationKey()))) return template$1();
|
|
1170
|
+
if (sharedConfig.completed) sharedConfig.completed.add(node);
|
|
1171
|
+
sharedConfig.registry.delete(key);
|
|
1172
|
+
return node;
|
|
1173
|
+
}
|
|
1174
|
+
function isHydrating(node) {
|
|
1175
|
+
return !!sharedConfig.context && !sharedConfig.done && (!node || node.isConnected);
|
|
1176
|
+
}
|
|
1177
|
+
function toPropertyName(name) {
|
|
1178
|
+
return name.toLowerCase().replace(/-([a-z])/g, (_, w) => w.toUpperCase());
|
|
1179
|
+
}
|
|
1180
|
+
function toggleClassKey(node, key, value) {
|
|
1181
|
+
const classNames = key.trim().split(/\s+/);
|
|
1182
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++) node.classList.toggle(classNames[i], value);
|
|
1183
|
+
}
|
|
1184
|
+
function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
|
|
1185
|
+
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
1186
|
+
if (prop === "style") return style(node, value, prev);
|
|
1187
|
+
if (prop === "classList") return classList(node, value, prev);
|
|
1188
|
+
if (value === prev) return prev;
|
|
1189
|
+
if (prop === "ref") {
|
|
1190
|
+
if (!skipRef) value(node);
|
|
1191
|
+
} else if (prop.slice(0, 3) === "on:") {
|
|
1192
|
+
const e = prop.slice(3);
|
|
1193
|
+
prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
|
|
1194
|
+
value && node.addEventListener(e, value, typeof value !== "function" && value);
|
|
1195
|
+
} else if (prop.slice(0, 10) === "oncapture:") {
|
|
1196
|
+
const e = prop.slice(10);
|
|
1197
|
+
prev && node.removeEventListener(e, prev, true);
|
|
1198
|
+
value && node.addEventListener(e, value, true);
|
|
1199
|
+
} else if (prop.slice(0, 2) === "on") {
|
|
1200
|
+
const name = prop.slice(2).toLowerCase();
|
|
1201
|
+
const delegate = DelegatedEvents.has(name);
|
|
1202
|
+
if (!delegate && prev) {
|
|
1203
|
+
const h = Array.isArray(prev) ? prev[0] : prev;
|
|
1204
|
+
node.removeEventListener(name, h);
|
|
1205
|
+
}
|
|
1206
|
+
if (delegate || value) {
|
|
1207
|
+
addEventListener(node, name, value, delegate);
|
|
1208
|
+
delegate && delegateEvents([name]);
|
|
1209
|
+
}
|
|
1210
|
+
} else if (prop.slice(0, 5) === "attr:") setAttribute(node, prop.slice(5), value);
|
|
1211
|
+
else if (prop.slice(0, 5) === "bool:") setBoolAttribute(node, prop.slice(5), value);
|
|
1212
|
+
else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
|
|
1213
|
+
if (forceProp) {
|
|
1214
|
+
prop = prop.slice(5);
|
|
1215
|
+
isProp = true;
|
|
1216
|
+
} else if (isHydrating(node)) return value;
|
|
1217
|
+
if (prop === "class" || prop === "className") className(node, value);
|
|
1218
|
+
else if (isCE && !isProp && !isChildProp) node[toPropertyName(prop)] = value;
|
|
1219
|
+
else node[propAlias || prop] = value;
|
|
1220
|
+
} else {
|
|
1221
|
+
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1222
|
+
if (ns) setAttributeNS(node, ns, prop, value);
|
|
1223
|
+
else setAttribute(node, Aliases[prop] || prop, value);
|
|
1224
|
+
}
|
|
1225
|
+
return value;
|
|
1226
|
+
}
|
|
1227
|
+
function eventHandler(e) {
|
|
1228
|
+
if (sharedConfig.registry && sharedConfig.events) {
|
|
1229
|
+
if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
|
|
1230
|
+
}
|
|
1231
|
+
let node = e.target;
|
|
1232
|
+
const key = `$$${e.type}`;
|
|
1233
|
+
const oriTarget = e.target;
|
|
1234
|
+
const oriCurrentTarget = e.currentTarget;
|
|
1235
|
+
const retarget = (value) => Object.defineProperty(e, "target", {
|
|
1236
|
+
configurable: true,
|
|
1237
|
+
value
|
|
1238
|
+
});
|
|
1239
|
+
const handleNode = () => {
|
|
1240
|
+
const handler = node[key];
|
|
1241
|
+
if (handler && !node.disabled) {
|
|
1242
|
+
const data = node[`${key}Data`];
|
|
1243
|
+
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
1244
|
+
if (e.cancelBubble) return;
|
|
1245
|
+
}
|
|
1246
|
+
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
|
|
1247
|
+
return true;
|
|
1248
|
+
};
|
|
1249
|
+
const walkUpTree = () => {
|
|
1250
|
+
while (handleNode() && (node = node._$host || node.parentNode || node.host));
|
|
1251
|
+
};
|
|
1252
|
+
Object.defineProperty(e, "currentTarget", {
|
|
1253
|
+
configurable: true,
|
|
1254
|
+
get() {
|
|
1255
|
+
return node || document;
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
|
|
1259
|
+
if (e.composedPath) {
|
|
1260
|
+
const path = e.composedPath();
|
|
1261
|
+
retarget(path[0]);
|
|
1262
|
+
for (let i = 0; i < path.length - 2; i++) {
|
|
1263
|
+
node = path[i];
|
|
1264
|
+
if (!handleNode()) break;
|
|
1265
|
+
if (node._$host) {
|
|
1266
|
+
node = node._$host;
|
|
1267
|
+
walkUpTree();
|
|
1268
|
+
break;
|
|
1269
|
+
}
|
|
1270
|
+
if (node.parentNode === oriCurrentTarget) break;
|
|
1271
|
+
}
|
|
1272
|
+
} else walkUpTree();
|
|
1273
|
+
retarget(oriTarget);
|
|
1274
|
+
}
|
|
1275
|
+
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
1276
|
+
const hydrating = isHydrating(parent);
|
|
1277
|
+
if (hydrating) {
|
|
1278
|
+
!current && (current = [...parent.childNodes]);
|
|
1279
|
+
let cleaned = [];
|
|
1280
|
+
for (let i = 0; i < current.length; i++) {
|
|
1281
|
+
const node = current[i];
|
|
1282
|
+
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$") node.remove();
|
|
1283
|
+
else cleaned.push(node);
|
|
1284
|
+
}
|
|
1285
|
+
current = cleaned;
|
|
1286
|
+
}
|
|
1287
|
+
while (typeof current === "function") current = current();
|
|
1288
|
+
if (value === current) return current;
|
|
1289
|
+
const t = typeof value, multi = marker !== void 0;
|
|
1290
|
+
parent = multi && current[0] && current[0].parentNode || parent;
|
|
1291
|
+
if (t === "string" || t === "number") {
|
|
1292
|
+
if (hydrating) return current;
|
|
1293
|
+
if (t === "number") {
|
|
1294
|
+
value = value.toString();
|
|
1295
|
+
if (value === current) return current;
|
|
1296
|
+
}
|
|
1297
|
+
if (multi) {
|
|
1298
|
+
let node = current[0];
|
|
1299
|
+
if (node && node.nodeType === 3) node.data !== value && (node.data = value);
|
|
1300
|
+
else node = document.createTextNode(value);
|
|
1301
|
+
current = cleanChildren(parent, current, marker, node);
|
|
1302
|
+
} else if (current !== "" && typeof current === "string") current = parent.firstChild.data = value;
|
|
1303
|
+
else current = parent.textContent = value;
|
|
1304
|
+
} else if (value == null || t === "boolean") {
|
|
1305
|
+
if (hydrating) return current;
|
|
1306
|
+
current = cleanChildren(parent, current, marker);
|
|
1307
|
+
} else if (t === "function") {
|
|
1308
|
+
createRenderEffect(() => {
|
|
1309
|
+
let v = value();
|
|
1310
|
+
while (typeof v === "function") v = v();
|
|
1311
|
+
current = insertExpression(parent, v, current, marker);
|
|
1312
|
+
});
|
|
1313
|
+
return () => current;
|
|
1314
|
+
} else if (Array.isArray(value)) {
|
|
1315
|
+
const array = [];
|
|
1316
|
+
const currentArray = current && Array.isArray(current);
|
|
1317
|
+
if (normalizeIncomingArray(array, value, current, unwrapArray)) {
|
|
1318
|
+
createRenderEffect(() => current = insertExpression(parent, array, current, marker, true));
|
|
1319
|
+
return () => current;
|
|
1320
|
+
}
|
|
1321
|
+
if (hydrating) {
|
|
1322
|
+
if (!array.length) return current;
|
|
1323
|
+
if (marker === void 0) return current = [...parent.childNodes];
|
|
1324
|
+
let node = array[0];
|
|
1325
|
+
if (node.parentNode !== parent) return current;
|
|
1326
|
+
const nodes = [node];
|
|
1327
|
+
while ((node = node.nextSibling) !== marker) nodes.push(node);
|
|
1328
|
+
return current = nodes;
|
|
1329
|
+
}
|
|
1330
|
+
if (array.length === 0) {
|
|
1331
|
+
current = cleanChildren(parent, current, marker);
|
|
1332
|
+
if (multi) return current;
|
|
1333
|
+
} else if (currentArray) if (current.length === 0) appendNodes(parent, array, marker);
|
|
1334
|
+
else reconcileArrays(parent, current, array);
|
|
1335
|
+
else {
|
|
1336
|
+
current && cleanChildren(parent);
|
|
1337
|
+
appendNodes(parent, array);
|
|
1338
|
+
}
|
|
1339
|
+
current = array;
|
|
1340
|
+
} else if (value.nodeType) {
|
|
1341
|
+
if (hydrating && value.parentNode) return current = multi ? [value] : value;
|
|
1342
|
+
if (Array.isArray(current)) {
|
|
1343
|
+
if (multi) return current = cleanChildren(parent, current, marker, value);
|
|
1344
|
+
cleanChildren(parent, current, null, value);
|
|
1345
|
+
} else if (current == null || current === "" || !parent.firstChild) parent.appendChild(value);
|
|
1346
|
+
else parent.replaceChild(value, parent.firstChild);
|
|
1347
|
+
current = value;
|
|
1348
|
+
}
|
|
1349
|
+
return current;
|
|
1350
|
+
}
|
|
1351
|
+
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
1352
|
+
let dynamic = false;
|
|
1353
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
1354
|
+
let item = array[i], prev = current && current[normalized.length], t;
|
|
1355
|
+
if (item == null || item === true || item === false);
|
|
1356
|
+
else if ((t = typeof item) === "object" && item.nodeType) normalized.push(item);
|
|
1357
|
+
else if (Array.isArray(item)) dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1358
|
+
else if (t === "function") if (unwrap) {
|
|
1359
|
+
while (typeof item === "function") item = item();
|
|
1360
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
1361
|
+
} else {
|
|
1362
|
+
normalized.push(item);
|
|
1363
|
+
dynamic = true;
|
|
1364
|
+
}
|
|
1365
|
+
else {
|
|
1366
|
+
const value = String(item);
|
|
1367
|
+
if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
|
|
1368
|
+
else normalized.push(document.createTextNode(value));
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
return dynamic;
|
|
1372
|
+
}
|
|
1373
|
+
function appendNodes(parent, array, marker = null) {
|
|
1374
|
+
for (let i = 0, len = array.length; i < len; i++) parent.insertBefore(array[i], marker);
|
|
1375
|
+
}
|
|
1376
|
+
function cleanChildren(parent, current, marker, replacement) {
|
|
1377
|
+
if (marker === void 0) return parent.textContent = "";
|
|
1378
|
+
const node = replacement || document.createTextNode("");
|
|
1379
|
+
if (current.length) {
|
|
1380
|
+
let inserted = false;
|
|
1381
|
+
for (let i = current.length - 1; i >= 0; i--) {
|
|
1382
|
+
const el = current[i];
|
|
1383
|
+
if (node !== el) {
|
|
1384
|
+
const isParent = el.parentNode === parent;
|
|
1385
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1386
|
+
else isParent && el.remove();
|
|
1387
|
+
} else inserted = true;
|
|
1388
|
+
}
|
|
1389
|
+
} else parent.insertBefore(node, marker);
|
|
1390
|
+
return [node];
|
|
1391
|
+
}
|
|
1392
|
+
function getHydrationKey() {
|
|
1393
|
+
return sharedConfig.getNextContextId();
|
|
1394
|
+
}
|
|
1395
|
+
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
1396
|
+
function createElement(tagName, isSVG = false, is = void 0) {
|
|
1397
|
+
return isSVG ? document.createElementNS(SVG_NAMESPACE, tagName) : document.createElement(tagName, { is });
|
|
1398
|
+
}
|
|
1399
|
+
function createDynamic(component, props) {
|
|
1400
|
+
const cached = createMemo(component);
|
|
1401
|
+
return createMemo(() => {
|
|
1402
|
+
const component$1 = cached();
|
|
1403
|
+
switch (typeof component$1) {
|
|
1404
|
+
case "function": return untrack(() => component$1(props));
|
|
1405
|
+
case "string":
|
|
1406
|
+
const isSvg = SVGElements.has(component$1);
|
|
1407
|
+
const el = sharedConfig.context ? getNextElement() : createElement(component$1, isSvg, untrack(() => props.is));
|
|
1408
|
+
spread(el, props, isSvg);
|
|
1409
|
+
return el;
|
|
1410
|
+
}
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
function Dynamic(props) {
|
|
1414
|
+
const [, others] = splitProps(props, ["component"]);
|
|
1415
|
+
return createDynamic(() => props.component, others);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
//#endregion
|
|
1419
|
+
//#region ../../node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
1420
|
+
/**
|
|
1421
|
+
* Concatenates two arrays faster than the array spread operator.
|
|
1422
|
+
*/
|
|
1423
|
+
const concatArrays = (array1, array2) => {
|
|
1424
|
+
const combinedArray = new Array(array1.length + array2.length);
|
|
1425
|
+
for (let i = 0; i < array1.length; i++) combinedArray[i] = array1[i];
|
|
1426
|
+
for (let i = 0; i < array2.length; i++) combinedArray[array1.length + i] = array2[i];
|
|
1427
|
+
return combinedArray;
|
|
1428
|
+
};
|
|
1429
|
+
const createClassValidatorObject = (classGroupId, validator) => ({
|
|
1430
|
+
classGroupId,
|
|
1431
|
+
validator
|
|
1432
|
+
});
|
|
1433
|
+
const createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
|
|
1434
|
+
nextPart,
|
|
1435
|
+
validators,
|
|
1436
|
+
classGroupId
|
|
1437
|
+
});
|
|
1438
|
+
const CLASS_PART_SEPARATOR = "-";
|
|
1439
|
+
const EMPTY_CONFLICTS = [];
|
|
1440
|
+
const ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
|
|
1441
|
+
const createClassGroupUtils = (config) => {
|
|
1442
|
+
const classMap = createClassMap(config);
|
|
1443
|
+
const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
|
|
1444
|
+
const getClassGroupId = (className$1) => {
|
|
1445
|
+
if (className$1.startsWith("[") && className$1.endsWith("]")) return getGroupIdForArbitraryProperty(className$1);
|
|
1446
|
+
const classParts = className$1.split(CLASS_PART_SEPARATOR);
|
|
1447
|
+
return getGroupRecursive(classParts, classParts[0] === "" && classParts.length > 1 ? 1 : 0, classMap);
|
|
1448
|
+
};
|
|
1449
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
1450
|
+
if (hasPostfixModifier) {
|
|
1451
|
+
const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
|
|
1452
|
+
const baseConflicts = conflictingClassGroups[classGroupId];
|
|
1453
|
+
if (modifierConflicts) {
|
|
1454
|
+
if (baseConflicts) return concatArrays(baseConflicts, modifierConflicts);
|
|
1455
|
+
return modifierConflicts;
|
|
1456
|
+
}
|
|
1457
|
+
return baseConflicts || EMPTY_CONFLICTS;
|
|
1458
|
+
}
|
|
1459
|
+
return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
|
|
1460
|
+
};
|
|
1461
|
+
return {
|
|
1462
|
+
getClassGroupId,
|
|
1463
|
+
getConflictingClassGroupIds
|
|
1464
|
+
};
|
|
1465
|
+
};
|
|
1466
|
+
const getGroupRecursive = (classParts, startIndex, classPartObject) => {
|
|
1467
|
+
if (classParts.length - startIndex === 0) return classPartObject.classGroupId;
|
|
1468
|
+
const currentClassPart = classParts[startIndex];
|
|
1469
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
1470
|
+
if (nextClassPartObject) {
|
|
1471
|
+
const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
|
|
1472
|
+
if (result) return result;
|
|
1473
|
+
}
|
|
1474
|
+
const validators = classPartObject.validators;
|
|
1475
|
+
if (validators === null) return;
|
|
1476
|
+
const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
|
|
1477
|
+
const validatorsLength = validators.length;
|
|
1478
|
+
for (let i = 0; i < validatorsLength; i++) {
|
|
1479
|
+
const validatorObj = validators[i];
|
|
1480
|
+
if (validatorObj.validator(classRest)) return validatorObj.classGroupId;
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
/**
|
|
1484
|
+
* Get the class group ID for an arbitrary property.
|
|
1485
|
+
*
|
|
1486
|
+
* @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
|
|
1487
|
+
*/
|
|
1488
|
+
const getGroupIdForArbitraryProperty = (className$1) => className$1.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
|
|
1489
|
+
const content = className$1.slice(1, -1);
|
|
1490
|
+
const colonIndex = content.indexOf(":");
|
|
1491
|
+
const property = content.slice(0, colonIndex);
|
|
1492
|
+
return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
|
|
1493
|
+
})();
|
|
1494
|
+
/**
|
|
1495
|
+
* Exported for testing only
|
|
1496
|
+
*/
|
|
1497
|
+
const createClassMap = (config) => {
|
|
1498
|
+
const { theme, classGroups } = config;
|
|
1499
|
+
return processClassGroups(classGroups, theme);
|
|
1500
|
+
};
|
|
1501
|
+
const processClassGroups = (classGroups, theme) => {
|
|
1502
|
+
const classMap = createClassPartObject();
|
|
1503
|
+
for (const classGroupId in classGroups) {
|
|
1504
|
+
const group = classGroups[classGroupId];
|
|
1505
|
+
processClassesRecursively(group, classMap, classGroupId, theme);
|
|
1506
|
+
}
|
|
1507
|
+
return classMap;
|
|
1508
|
+
};
|
|
1509
|
+
const processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
1510
|
+
const len = classGroup.length;
|
|
1511
|
+
for (let i = 0; i < len; i++) {
|
|
1512
|
+
const classDefinition = classGroup[i];
|
|
1513
|
+
processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
const processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
1517
|
+
if (typeof classDefinition === "string") {
|
|
1518
|
+
processStringDefinition(classDefinition, classPartObject, classGroupId);
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
if (typeof classDefinition === "function") {
|
|
1522
|
+
processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
1523
|
+
return;
|
|
1524
|
+
}
|
|
1525
|
+
processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
|
|
1526
|
+
};
|
|
1527
|
+
const processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
|
|
1528
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
1529
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
1530
|
+
};
|
|
1531
|
+
const processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
1532
|
+
if (isThemeGetter(classDefinition)) {
|
|
1533
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
if (classPartObject.validators === null) classPartObject.validators = [];
|
|
1537
|
+
classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
|
|
1538
|
+
};
|
|
1539
|
+
const processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
|
|
1540
|
+
const entries = Object.entries(classDefinition);
|
|
1541
|
+
const len = entries.length;
|
|
1542
|
+
for (let i = 0; i < len; i++) {
|
|
1543
|
+
const [key, value] = entries[i];
|
|
1544
|
+
processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
const getPart = (classPartObject, path) => {
|
|
1548
|
+
let current = classPartObject;
|
|
1549
|
+
const parts = path.split(CLASS_PART_SEPARATOR);
|
|
1550
|
+
const len = parts.length;
|
|
1551
|
+
for (let i = 0; i < len; i++) {
|
|
1552
|
+
const part = parts[i];
|
|
1553
|
+
let next = current.nextPart.get(part);
|
|
1554
|
+
if (!next) {
|
|
1555
|
+
next = createClassPartObject();
|
|
1556
|
+
current.nextPart.set(part, next);
|
|
1557
|
+
}
|
|
1558
|
+
current = next;
|
|
1559
|
+
}
|
|
1560
|
+
return current;
|
|
1561
|
+
};
|
|
1562
|
+
const isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
|
|
1563
|
+
const createLruCache = (maxCacheSize) => {
|
|
1564
|
+
if (maxCacheSize < 1) return {
|
|
1565
|
+
get: () => void 0,
|
|
1566
|
+
set: () => {}
|
|
1567
|
+
};
|
|
1568
|
+
let cacheSize = 0;
|
|
1569
|
+
let cache = Object.create(null);
|
|
1570
|
+
let previousCache = Object.create(null);
|
|
1571
|
+
const update = (key, value) => {
|
|
1572
|
+
cache[key] = value;
|
|
1573
|
+
cacheSize++;
|
|
1574
|
+
if (cacheSize > maxCacheSize) {
|
|
1575
|
+
cacheSize = 0;
|
|
1576
|
+
previousCache = cache;
|
|
1577
|
+
cache = Object.create(null);
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
return {
|
|
1581
|
+
get(key) {
|
|
1582
|
+
let value = cache[key];
|
|
1583
|
+
if (value !== void 0) return value;
|
|
1584
|
+
if ((value = previousCache[key]) !== void 0) {
|
|
1585
|
+
update(key, value);
|
|
1586
|
+
return value;
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
set(key, value) {
|
|
1590
|
+
if (key in cache) cache[key] = value;
|
|
1591
|
+
else update(key, value);
|
|
1592
|
+
}
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
const IMPORTANT_MODIFIER = "!";
|
|
1596
|
+
const MODIFIER_SEPARATOR = ":";
|
|
1597
|
+
const EMPTY_MODIFIERS = [];
|
|
1598
|
+
const createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
|
|
1599
|
+
modifiers,
|
|
1600
|
+
hasImportantModifier,
|
|
1601
|
+
baseClassName,
|
|
1602
|
+
maybePostfixModifierPosition,
|
|
1603
|
+
isExternal
|
|
1604
|
+
});
|
|
1605
|
+
const createParseClassName = (config) => {
|
|
1606
|
+
const { prefix, experimentalParseClassName } = config;
|
|
1607
|
+
/**
|
|
1608
|
+
* Parse class name into parts.
|
|
1609
|
+
*
|
|
1610
|
+
* Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
|
|
1611
|
+
* @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
|
|
1612
|
+
*/
|
|
1613
|
+
let parseClassName = (className$1) => {
|
|
1614
|
+
const modifiers = [];
|
|
1615
|
+
let bracketDepth = 0;
|
|
1616
|
+
let parenDepth = 0;
|
|
1617
|
+
let modifierStart = 0;
|
|
1618
|
+
let postfixModifierPosition;
|
|
1619
|
+
const len = className$1.length;
|
|
1620
|
+
for (let index = 0; index < len; index++) {
|
|
1621
|
+
const currentCharacter = className$1[index];
|
|
1622
|
+
if (bracketDepth === 0 && parenDepth === 0) {
|
|
1623
|
+
if (currentCharacter === MODIFIER_SEPARATOR) {
|
|
1624
|
+
modifiers.push(className$1.slice(modifierStart, index));
|
|
1625
|
+
modifierStart = index + 1;
|
|
1626
|
+
continue;
|
|
1627
|
+
}
|
|
1628
|
+
if (currentCharacter === "/") {
|
|
1629
|
+
postfixModifierPosition = index;
|
|
1630
|
+
continue;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
if (currentCharacter === "[") bracketDepth++;
|
|
1634
|
+
else if (currentCharacter === "]") bracketDepth--;
|
|
1635
|
+
else if (currentCharacter === "(") parenDepth++;
|
|
1636
|
+
else if (currentCharacter === ")") parenDepth--;
|
|
1637
|
+
}
|
|
1638
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className$1 : className$1.slice(modifierStart);
|
|
1639
|
+
let baseClassName = baseClassNameWithImportantModifier;
|
|
1640
|
+
let hasImportantModifier = false;
|
|
1641
|
+
if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
|
|
1642
|
+
baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
|
|
1643
|
+
hasImportantModifier = true;
|
|
1644
|
+
} else if (baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
|
|
1645
|
+
baseClassName = baseClassNameWithImportantModifier.slice(1);
|
|
1646
|
+
hasImportantModifier = true;
|
|
1647
|
+
}
|
|
1648
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
|
|
1649
|
+
return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
|
|
1650
|
+
};
|
|
1651
|
+
if (prefix) {
|
|
1652
|
+
const fullPrefix = prefix + MODIFIER_SEPARATOR;
|
|
1653
|
+
const parseClassNameOriginal = parseClassName;
|
|
1654
|
+
parseClassName = (className$1) => className$1.startsWith(fullPrefix) ? parseClassNameOriginal(className$1.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className$1, void 0, true);
|
|
1655
|
+
}
|
|
1656
|
+
if (experimentalParseClassName) {
|
|
1657
|
+
const parseClassNameOriginal = parseClassName;
|
|
1658
|
+
parseClassName = (className$1) => experimentalParseClassName({
|
|
1659
|
+
className: className$1,
|
|
1660
|
+
parseClassName: parseClassNameOriginal
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
return parseClassName;
|
|
1664
|
+
};
|
|
1665
|
+
/**
|
|
1666
|
+
* Sorts modifiers according to following schema:
|
|
1667
|
+
* - Predefined modifiers are sorted alphabetically
|
|
1668
|
+
* - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
|
|
1669
|
+
*/
|
|
1670
|
+
const createSortModifiers = (config) => {
|
|
1671
|
+
const modifierWeights = /* @__PURE__ */ new Map();
|
|
1672
|
+
config.orderSensitiveModifiers.forEach((mod, index) => {
|
|
1673
|
+
modifierWeights.set(mod, 1e6 + index);
|
|
1674
|
+
});
|
|
1675
|
+
return (modifiers) => {
|
|
1676
|
+
const result = [];
|
|
1677
|
+
let currentSegment = [];
|
|
1678
|
+
for (let i = 0; i < modifiers.length; i++) {
|
|
1679
|
+
const modifier = modifiers[i];
|
|
1680
|
+
const isArbitrary = modifier[0] === "[";
|
|
1681
|
+
const isOrderSensitive = modifierWeights.has(modifier);
|
|
1682
|
+
if (isArbitrary || isOrderSensitive) {
|
|
1683
|
+
if (currentSegment.length > 0) {
|
|
1684
|
+
currentSegment.sort();
|
|
1685
|
+
result.push(...currentSegment);
|
|
1686
|
+
currentSegment = [];
|
|
1687
|
+
}
|
|
1688
|
+
result.push(modifier);
|
|
1689
|
+
} else currentSegment.push(modifier);
|
|
1690
|
+
}
|
|
1691
|
+
if (currentSegment.length > 0) {
|
|
1692
|
+
currentSegment.sort();
|
|
1693
|
+
result.push(...currentSegment);
|
|
1694
|
+
}
|
|
1695
|
+
return result;
|
|
1696
|
+
};
|
|
1697
|
+
};
|
|
1698
|
+
const createConfigUtils = (config) => ({
|
|
1699
|
+
cache: createLruCache(config.cacheSize),
|
|
1700
|
+
parseClassName: createParseClassName(config),
|
|
1701
|
+
sortModifiers: createSortModifiers(config),
|
|
1702
|
+
...createClassGroupUtils(config)
|
|
1703
|
+
});
|
|
1704
|
+
const SPLIT_CLASSES_REGEX = /\s+/;
|
|
1705
|
+
const mergeClassList = (classList$1, configUtils) => {
|
|
1706
|
+
const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
|
|
1707
|
+
/**
|
|
1708
|
+
* Set of classGroupIds in following format:
|
|
1709
|
+
* `{importantModifier}{variantModifiers}{classGroupId}`
|
|
1710
|
+
* @example 'float'
|
|
1711
|
+
* @example 'hover:focus:bg-color'
|
|
1712
|
+
* @example 'md:!pr'
|
|
1713
|
+
*/
|
|
1714
|
+
const classGroupsInConflict = [];
|
|
1715
|
+
const classNames = classList$1.trim().split(SPLIT_CLASSES_REGEX);
|
|
1716
|
+
let result = "";
|
|
1717
|
+
for (let index = classNames.length - 1; index >= 0; index -= 1) {
|
|
1718
|
+
const originalClassName = classNames[index];
|
|
1719
|
+
const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
|
|
1720
|
+
if (isExternal) {
|
|
1721
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1722
|
+
continue;
|
|
1723
|
+
}
|
|
1724
|
+
let hasPostfixModifier = !!maybePostfixModifierPosition;
|
|
1725
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
1726
|
+
if (!classGroupId) {
|
|
1727
|
+
if (!hasPostfixModifier) {
|
|
1728
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1729
|
+
continue;
|
|
1730
|
+
}
|
|
1731
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
1732
|
+
if (!classGroupId) {
|
|
1733
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1734
|
+
continue;
|
|
1735
|
+
}
|
|
1736
|
+
hasPostfixModifier = false;
|
|
1737
|
+
}
|
|
1738
|
+
const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
|
|
1739
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
1740
|
+
const classId = modifierId + classGroupId;
|
|
1741
|
+
if (classGroupsInConflict.indexOf(classId) > -1) continue;
|
|
1742
|
+
classGroupsInConflict.push(classId);
|
|
1743
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
1744
|
+
for (let i = 0; i < conflictGroups.length; ++i) {
|
|
1745
|
+
const group = conflictGroups[i];
|
|
1746
|
+
classGroupsInConflict.push(modifierId + group);
|
|
1747
|
+
}
|
|
1748
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
1749
|
+
}
|
|
1750
|
+
return result;
|
|
1751
|
+
};
|
|
1752
|
+
/**
|
|
1753
|
+
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
|
|
1754
|
+
*
|
|
1755
|
+
* Specifically:
|
|
1756
|
+
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
|
|
1757
|
+
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
|
|
1758
|
+
*
|
|
1759
|
+
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
|
|
1760
|
+
*/
|
|
1761
|
+
const twJoin = (...classLists) => {
|
|
1762
|
+
let index = 0;
|
|
1763
|
+
let argument;
|
|
1764
|
+
let resolvedValue;
|
|
1765
|
+
let string = "";
|
|
1766
|
+
while (index < classLists.length) if (argument = classLists[index++]) {
|
|
1767
|
+
if (resolvedValue = toValue(argument)) {
|
|
1768
|
+
string && (string += " ");
|
|
1769
|
+
string += resolvedValue;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
return string;
|
|
1773
|
+
};
|
|
1774
|
+
const toValue = (mix) => {
|
|
1775
|
+
if (typeof mix === "string") return mix;
|
|
1776
|
+
let resolvedValue;
|
|
1777
|
+
let string = "";
|
|
1778
|
+
for (let k = 0; k < mix.length; k++) if (mix[k]) {
|
|
1779
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
1780
|
+
string && (string += " ");
|
|
1781
|
+
string += resolvedValue;
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1784
|
+
return string;
|
|
1785
|
+
};
|
|
1786
|
+
const createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
|
|
1787
|
+
let configUtils;
|
|
1788
|
+
let cacheGet;
|
|
1789
|
+
let cacheSet;
|
|
1790
|
+
let functionToCall;
|
|
1791
|
+
const initTailwindMerge = (classList$1) => {
|
|
1792
|
+
configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
|
|
1793
|
+
cacheGet = configUtils.cache.get;
|
|
1794
|
+
cacheSet = configUtils.cache.set;
|
|
1795
|
+
functionToCall = tailwindMerge;
|
|
1796
|
+
return tailwindMerge(classList$1);
|
|
1797
|
+
};
|
|
1798
|
+
const tailwindMerge = (classList$1) => {
|
|
1799
|
+
const cachedResult = cacheGet(classList$1);
|
|
1800
|
+
if (cachedResult) return cachedResult;
|
|
1801
|
+
const result = mergeClassList(classList$1, configUtils);
|
|
1802
|
+
cacheSet(classList$1, result);
|
|
1803
|
+
return result;
|
|
1804
|
+
};
|
|
1805
|
+
functionToCall = initTailwindMerge;
|
|
1806
|
+
return (...args) => functionToCall(twJoin(...args));
|
|
1807
|
+
};
|
|
1808
|
+
const fallbackThemeArr = [];
|
|
1809
|
+
const fromTheme = (key) => {
|
|
1810
|
+
const themeGetter = (theme) => theme[key] || fallbackThemeArr;
|
|
1811
|
+
themeGetter.isThemeGetter = true;
|
|
1812
|
+
return themeGetter;
|
|
1813
|
+
};
|
|
1814
|
+
const arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
|
|
1815
|
+
const arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
|
|
1816
|
+
const fractionRegex = /^\d+\/\d+$/;
|
|
1817
|
+
const tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
1818
|
+
const lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
|
|
1819
|
+
const colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
1820
|
+
const shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
1821
|
+
const imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
1822
|
+
const isFraction = (value) => fractionRegex.test(value);
|
|
1823
|
+
const isNumber = (value) => !!value && !Number.isNaN(Number(value));
|
|
1824
|
+
const isInteger = (value) => !!value && Number.isInteger(Number(value));
|
|
1825
|
+
const isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
1826
|
+
const isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
1827
|
+
const isAny = () => true;
|
|
1828
|
+
const isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
1829
|
+
const isNever = () => false;
|
|
1830
|
+
const isShadow = (value) => shadowRegex.test(value);
|
|
1831
|
+
const isImage = (value) => imageRegex.test(value);
|
|
1832
|
+
const isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
|
|
1833
|
+
const isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
|
|
1834
|
+
const isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
1835
|
+
const isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
|
|
1836
|
+
const isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
|
|
1837
|
+
const isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
|
|
1838
|
+
const isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
|
|
1839
|
+
const isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
|
|
1840
|
+
const isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
|
|
1841
|
+
const isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
|
|
1842
|
+
const isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
|
|
1843
|
+
const isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
|
|
1844
|
+
const isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
|
|
1845
|
+
const isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
|
|
1846
|
+
const isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
|
|
1847
|
+
const getIsArbitraryValue = (value, testLabel, testValue) => {
|
|
1848
|
+
const result = arbitraryValueRegex.exec(value);
|
|
1849
|
+
if (result) {
|
|
1850
|
+
if (result[1]) return testLabel(result[1]);
|
|
1851
|
+
return testValue(result[2]);
|
|
1852
|
+
}
|
|
1853
|
+
return false;
|
|
1854
|
+
};
|
|
1855
|
+
const getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
|
|
1856
|
+
const result = arbitraryVariableRegex.exec(value);
|
|
1857
|
+
if (result) {
|
|
1858
|
+
if (result[1]) return testLabel(result[1]);
|
|
1859
|
+
return shouldMatchNoLabel;
|
|
1860
|
+
}
|
|
1861
|
+
return false;
|
|
1862
|
+
};
|
|
1863
|
+
const isLabelPosition = (label) => label === "position" || label === "percentage";
|
|
1864
|
+
const isLabelImage = (label) => label === "image" || label === "url";
|
|
1865
|
+
const isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
|
|
1866
|
+
const isLabelLength = (label) => label === "length";
|
|
1867
|
+
const isLabelNumber = (label) => label === "number";
|
|
1868
|
+
const isLabelFamilyName = (label) => label === "family-name";
|
|
1869
|
+
const isLabelShadow = (label) => label === "shadow";
|
|
1870
|
+
const getDefaultConfig = () => {
|
|
1871
|
+
/**
|
|
1872
|
+
* Theme getters for theme variable namespaces
|
|
1873
|
+
* @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
|
|
1874
|
+
*/
|
|
1875
|
+
const themeColor = fromTheme("color");
|
|
1876
|
+
const themeFont = fromTheme("font");
|
|
1877
|
+
const themeText = fromTheme("text");
|
|
1878
|
+
const themeFontWeight = fromTheme("font-weight");
|
|
1879
|
+
const themeTracking = fromTheme("tracking");
|
|
1880
|
+
const themeLeading = fromTheme("leading");
|
|
1881
|
+
const themeBreakpoint = fromTheme("breakpoint");
|
|
1882
|
+
const themeContainer = fromTheme("container");
|
|
1883
|
+
const themeSpacing = fromTheme("spacing");
|
|
1884
|
+
const themeRadius = fromTheme("radius");
|
|
1885
|
+
const themeShadow = fromTheme("shadow");
|
|
1886
|
+
const themeInsetShadow = fromTheme("inset-shadow");
|
|
1887
|
+
const themeTextShadow = fromTheme("text-shadow");
|
|
1888
|
+
const themeDropShadow = fromTheme("drop-shadow");
|
|
1889
|
+
const themeBlur = fromTheme("blur");
|
|
1890
|
+
const themePerspective = fromTheme("perspective");
|
|
1891
|
+
const themeAspect = fromTheme("aspect");
|
|
1892
|
+
const themeEase = fromTheme("ease");
|
|
1893
|
+
const themeAnimate = fromTheme("animate");
|
|
1894
|
+
/**
|
|
1895
|
+
* Helpers to avoid repeating the same scales
|
|
1896
|
+
*
|
|
1897
|
+
* We use functions that create a new array every time they're called instead of static arrays.
|
|
1898
|
+
* This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.
|
|
1899
|
+
*/
|
|
1900
|
+
const scaleBreak = () => [
|
|
1901
|
+
"auto",
|
|
1902
|
+
"avoid",
|
|
1903
|
+
"all",
|
|
1904
|
+
"avoid-page",
|
|
1905
|
+
"page",
|
|
1906
|
+
"left",
|
|
1907
|
+
"right",
|
|
1908
|
+
"column"
|
|
1909
|
+
];
|
|
1910
|
+
const scalePosition = () => [
|
|
1911
|
+
"center",
|
|
1912
|
+
"top",
|
|
1913
|
+
"bottom",
|
|
1914
|
+
"left",
|
|
1915
|
+
"right",
|
|
1916
|
+
"top-left",
|
|
1917
|
+
"left-top",
|
|
1918
|
+
"top-right",
|
|
1919
|
+
"right-top",
|
|
1920
|
+
"bottom-right",
|
|
1921
|
+
"right-bottom",
|
|
1922
|
+
"bottom-left",
|
|
1923
|
+
"left-bottom"
|
|
1924
|
+
];
|
|
1925
|
+
const scalePositionWithArbitrary = () => [
|
|
1926
|
+
...scalePosition(),
|
|
1927
|
+
isArbitraryVariable,
|
|
1928
|
+
isArbitraryValue
|
|
1929
|
+
];
|
|
1930
|
+
const scaleOverflow = () => [
|
|
1931
|
+
"auto",
|
|
1932
|
+
"hidden",
|
|
1933
|
+
"clip",
|
|
1934
|
+
"visible",
|
|
1935
|
+
"scroll"
|
|
1936
|
+
];
|
|
1937
|
+
const scaleOverscroll = () => [
|
|
1938
|
+
"auto",
|
|
1939
|
+
"contain",
|
|
1940
|
+
"none"
|
|
1941
|
+
];
|
|
1942
|
+
const scaleUnambiguousSpacing = () => [
|
|
1943
|
+
isArbitraryVariable,
|
|
1944
|
+
isArbitraryValue,
|
|
1945
|
+
themeSpacing
|
|
1946
|
+
];
|
|
1947
|
+
const scaleInset = () => [
|
|
1948
|
+
isFraction,
|
|
1949
|
+
"full",
|
|
1950
|
+
"auto",
|
|
1951
|
+
...scaleUnambiguousSpacing()
|
|
1952
|
+
];
|
|
1953
|
+
const scaleGridTemplateColsRows = () => [
|
|
1954
|
+
isInteger,
|
|
1955
|
+
"none",
|
|
1956
|
+
"subgrid",
|
|
1957
|
+
isArbitraryVariable,
|
|
1958
|
+
isArbitraryValue
|
|
1959
|
+
];
|
|
1960
|
+
const scaleGridColRowStartAndEnd = () => [
|
|
1961
|
+
"auto",
|
|
1962
|
+
{ span: [
|
|
1963
|
+
"full",
|
|
1964
|
+
isInteger,
|
|
1965
|
+
isArbitraryVariable,
|
|
1966
|
+
isArbitraryValue
|
|
1967
|
+
] },
|
|
1968
|
+
isInteger,
|
|
1969
|
+
isArbitraryVariable,
|
|
1970
|
+
isArbitraryValue
|
|
1971
|
+
];
|
|
1972
|
+
const scaleGridColRowStartOrEnd = () => [
|
|
1973
|
+
isInteger,
|
|
1974
|
+
"auto",
|
|
1975
|
+
isArbitraryVariable,
|
|
1976
|
+
isArbitraryValue
|
|
1977
|
+
];
|
|
1978
|
+
const scaleGridAutoColsRows = () => [
|
|
1979
|
+
"auto",
|
|
1980
|
+
"min",
|
|
1981
|
+
"max",
|
|
1982
|
+
"fr",
|
|
1983
|
+
isArbitraryVariable,
|
|
1984
|
+
isArbitraryValue
|
|
1985
|
+
];
|
|
1986
|
+
const scaleAlignPrimaryAxis = () => [
|
|
1987
|
+
"start",
|
|
1988
|
+
"end",
|
|
1989
|
+
"center",
|
|
1990
|
+
"between",
|
|
1991
|
+
"around",
|
|
1992
|
+
"evenly",
|
|
1993
|
+
"stretch",
|
|
1994
|
+
"baseline",
|
|
1995
|
+
"center-safe",
|
|
1996
|
+
"end-safe"
|
|
1997
|
+
];
|
|
1998
|
+
const scaleAlignSecondaryAxis = () => [
|
|
1999
|
+
"start",
|
|
2000
|
+
"end",
|
|
2001
|
+
"center",
|
|
2002
|
+
"stretch",
|
|
2003
|
+
"center-safe",
|
|
2004
|
+
"end-safe"
|
|
2005
|
+
];
|
|
2006
|
+
const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
|
|
2007
|
+
const scaleSizing = () => [
|
|
2008
|
+
isFraction,
|
|
2009
|
+
"auto",
|
|
2010
|
+
"full",
|
|
2011
|
+
"dvw",
|
|
2012
|
+
"dvh",
|
|
2013
|
+
"lvw",
|
|
2014
|
+
"lvh",
|
|
2015
|
+
"svw",
|
|
2016
|
+
"svh",
|
|
2017
|
+
"min",
|
|
2018
|
+
"max",
|
|
2019
|
+
"fit",
|
|
2020
|
+
...scaleUnambiguousSpacing()
|
|
2021
|
+
];
|
|
2022
|
+
const scaleColor = () => [
|
|
2023
|
+
themeColor,
|
|
2024
|
+
isArbitraryVariable,
|
|
2025
|
+
isArbitraryValue
|
|
2026
|
+
];
|
|
2027
|
+
const scaleBgPosition = () => [
|
|
2028
|
+
...scalePosition(),
|
|
2029
|
+
isArbitraryVariablePosition,
|
|
2030
|
+
isArbitraryPosition,
|
|
2031
|
+
{ position: [isArbitraryVariable, isArbitraryValue] }
|
|
2032
|
+
];
|
|
2033
|
+
const scaleBgRepeat = () => ["no-repeat", { repeat: [
|
|
2034
|
+
"",
|
|
2035
|
+
"x",
|
|
2036
|
+
"y",
|
|
2037
|
+
"space",
|
|
2038
|
+
"round"
|
|
2039
|
+
] }];
|
|
2040
|
+
const scaleBgSize = () => [
|
|
2041
|
+
"auto",
|
|
2042
|
+
"cover",
|
|
2043
|
+
"contain",
|
|
2044
|
+
isArbitraryVariableSize,
|
|
2045
|
+
isArbitrarySize,
|
|
2046
|
+
{ size: [isArbitraryVariable, isArbitraryValue] }
|
|
2047
|
+
];
|
|
2048
|
+
const scaleGradientStopPosition = () => [
|
|
2049
|
+
isPercent,
|
|
2050
|
+
isArbitraryVariableLength,
|
|
2051
|
+
isArbitraryLength
|
|
2052
|
+
];
|
|
2053
|
+
const scaleRadius = () => [
|
|
2054
|
+
"",
|
|
2055
|
+
"none",
|
|
2056
|
+
"full",
|
|
2057
|
+
themeRadius,
|
|
2058
|
+
isArbitraryVariable,
|
|
2059
|
+
isArbitraryValue
|
|
2060
|
+
];
|
|
2061
|
+
const scaleBorderWidth = () => [
|
|
2062
|
+
"",
|
|
2063
|
+
isNumber,
|
|
2064
|
+
isArbitraryVariableLength,
|
|
2065
|
+
isArbitraryLength
|
|
2066
|
+
];
|
|
2067
|
+
const scaleLineStyle = () => [
|
|
2068
|
+
"solid",
|
|
2069
|
+
"dashed",
|
|
2070
|
+
"dotted",
|
|
2071
|
+
"double"
|
|
2072
|
+
];
|
|
2073
|
+
const scaleBlendMode = () => [
|
|
2074
|
+
"normal",
|
|
2075
|
+
"multiply",
|
|
2076
|
+
"screen",
|
|
2077
|
+
"overlay",
|
|
2078
|
+
"darken",
|
|
2079
|
+
"lighten",
|
|
2080
|
+
"color-dodge",
|
|
2081
|
+
"color-burn",
|
|
2082
|
+
"hard-light",
|
|
2083
|
+
"soft-light",
|
|
2084
|
+
"difference",
|
|
2085
|
+
"exclusion",
|
|
2086
|
+
"hue",
|
|
2087
|
+
"saturation",
|
|
2088
|
+
"color",
|
|
2089
|
+
"luminosity"
|
|
2090
|
+
];
|
|
2091
|
+
const scaleMaskImagePosition = () => [
|
|
2092
|
+
isNumber,
|
|
2093
|
+
isPercent,
|
|
2094
|
+
isArbitraryVariablePosition,
|
|
2095
|
+
isArbitraryPosition
|
|
2096
|
+
];
|
|
2097
|
+
const scaleBlur = () => [
|
|
2098
|
+
"",
|
|
2099
|
+
"none",
|
|
2100
|
+
themeBlur,
|
|
2101
|
+
isArbitraryVariable,
|
|
2102
|
+
isArbitraryValue
|
|
2103
|
+
];
|
|
2104
|
+
const scaleRotate = () => [
|
|
2105
|
+
"none",
|
|
2106
|
+
isNumber,
|
|
2107
|
+
isArbitraryVariable,
|
|
2108
|
+
isArbitraryValue
|
|
2109
|
+
];
|
|
2110
|
+
const scaleScale = () => [
|
|
2111
|
+
"none",
|
|
2112
|
+
isNumber,
|
|
2113
|
+
isArbitraryVariable,
|
|
2114
|
+
isArbitraryValue
|
|
2115
|
+
];
|
|
2116
|
+
const scaleSkew = () => [
|
|
2117
|
+
isNumber,
|
|
2118
|
+
isArbitraryVariable,
|
|
2119
|
+
isArbitraryValue
|
|
2120
|
+
];
|
|
2121
|
+
const scaleTranslate = () => [
|
|
2122
|
+
isFraction,
|
|
2123
|
+
"full",
|
|
2124
|
+
...scaleUnambiguousSpacing()
|
|
2125
|
+
];
|
|
2126
|
+
return {
|
|
2127
|
+
cacheSize: 500,
|
|
2128
|
+
theme: {
|
|
2129
|
+
animate: [
|
|
2130
|
+
"spin",
|
|
2131
|
+
"ping",
|
|
2132
|
+
"pulse",
|
|
2133
|
+
"bounce"
|
|
2134
|
+
],
|
|
2135
|
+
aspect: ["video"],
|
|
2136
|
+
blur: [isTshirtSize],
|
|
2137
|
+
breakpoint: [isTshirtSize],
|
|
2138
|
+
color: [isAny],
|
|
2139
|
+
container: [isTshirtSize],
|
|
2140
|
+
"drop-shadow": [isTshirtSize],
|
|
2141
|
+
ease: [
|
|
2142
|
+
"in",
|
|
2143
|
+
"out",
|
|
2144
|
+
"in-out"
|
|
2145
|
+
],
|
|
2146
|
+
font: [isAnyNonArbitrary],
|
|
2147
|
+
"font-weight": [
|
|
2148
|
+
"thin",
|
|
2149
|
+
"extralight",
|
|
2150
|
+
"light",
|
|
2151
|
+
"normal",
|
|
2152
|
+
"medium",
|
|
2153
|
+
"semibold",
|
|
2154
|
+
"bold",
|
|
2155
|
+
"extrabold",
|
|
2156
|
+
"black"
|
|
2157
|
+
],
|
|
2158
|
+
"inset-shadow": [isTshirtSize],
|
|
2159
|
+
leading: [
|
|
2160
|
+
"none",
|
|
2161
|
+
"tight",
|
|
2162
|
+
"snug",
|
|
2163
|
+
"normal",
|
|
2164
|
+
"relaxed",
|
|
2165
|
+
"loose"
|
|
2166
|
+
],
|
|
2167
|
+
perspective: [
|
|
2168
|
+
"dramatic",
|
|
2169
|
+
"near",
|
|
2170
|
+
"normal",
|
|
2171
|
+
"midrange",
|
|
2172
|
+
"distant",
|
|
2173
|
+
"none"
|
|
2174
|
+
],
|
|
2175
|
+
radius: [isTshirtSize],
|
|
2176
|
+
shadow: [isTshirtSize],
|
|
2177
|
+
spacing: ["px", isNumber],
|
|
2178
|
+
text: [isTshirtSize],
|
|
2179
|
+
"text-shadow": [isTshirtSize],
|
|
2180
|
+
tracking: [
|
|
2181
|
+
"tighter",
|
|
2182
|
+
"tight",
|
|
2183
|
+
"normal",
|
|
2184
|
+
"wide",
|
|
2185
|
+
"wider",
|
|
2186
|
+
"widest"
|
|
2187
|
+
]
|
|
2188
|
+
},
|
|
2189
|
+
classGroups: {
|
|
2190
|
+
aspect: [{ aspect: [
|
|
2191
|
+
"auto",
|
|
2192
|
+
"square",
|
|
2193
|
+
isFraction,
|
|
2194
|
+
isArbitraryValue,
|
|
2195
|
+
isArbitraryVariable,
|
|
2196
|
+
themeAspect
|
|
2197
|
+
] }],
|
|
2198
|
+
container: ["container"],
|
|
2199
|
+
columns: [{ columns: [
|
|
2200
|
+
isNumber,
|
|
2201
|
+
isArbitraryValue,
|
|
2202
|
+
isArbitraryVariable,
|
|
2203
|
+
themeContainer
|
|
2204
|
+
] }],
|
|
2205
|
+
"break-after": [{ "break-after": scaleBreak() }],
|
|
2206
|
+
"break-before": [{ "break-before": scaleBreak() }],
|
|
2207
|
+
"break-inside": [{ "break-inside": [
|
|
2208
|
+
"auto",
|
|
2209
|
+
"avoid",
|
|
2210
|
+
"avoid-page",
|
|
2211
|
+
"avoid-column"
|
|
2212
|
+
] }],
|
|
2213
|
+
"box-decoration": [{ "box-decoration": ["slice", "clone"] }],
|
|
2214
|
+
box: [{ box: ["border", "content"] }],
|
|
2215
|
+
display: [
|
|
2216
|
+
"block",
|
|
2217
|
+
"inline-block",
|
|
2218
|
+
"inline",
|
|
2219
|
+
"flex",
|
|
2220
|
+
"inline-flex",
|
|
2221
|
+
"table",
|
|
2222
|
+
"inline-table",
|
|
2223
|
+
"table-caption",
|
|
2224
|
+
"table-cell",
|
|
2225
|
+
"table-column",
|
|
2226
|
+
"table-column-group",
|
|
2227
|
+
"table-footer-group",
|
|
2228
|
+
"table-header-group",
|
|
2229
|
+
"table-row-group",
|
|
2230
|
+
"table-row",
|
|
2231
|
+
"flow-root",
|
|
2232
|
+
"grid",
|
|
2233
|
+
"inline-grid",
|
|
2234
|
+
"contents",
|
|
2235
|
+
"list-item",
|
|
2236
|
+
"hidden"
|
|
2237
|
+
],
|
|
2238
|
+
sr: ["sr-only", "not-sr-only"],
|
|
2239
|
+
float: [{ float: [
|
|
2240
|
+
"right",
|
|
2241
|
+
"left",
|
|
2242
|
+
"none",
|
|
2243
|
+
"start",
|
|
2244
|
+
"end"
|
|
2245
|
+
] }],
|
|
2246
|
+
clear: [{ clear: [
|
|
2247
|
+
"left",
|
|
2248
|
+
"right",
|
|
2249
|
+
"both",
|
|
2250
|
+
"none",
|
|
2251
|
+
"start",
|
|
2252
|
+
"end"
|
|
2253
|
+
] }],
|
|
2254
|
+
isolation: ["isolate", "isolation-auto"],
|
|
2255
|
+
"object-fit": [{ object: [
|
|
2256
|
+
"contain",
|
|
2257
|
+
"cover",
|
|
2258
|
+
"fill",
|
|
2259
|
+
"none",
|
|
2260
|
+
"scale-down"
|
|
2261
|
+
] }],
|
|
2262
|
+
"object-position": [{ object: scalePositionWithArbitrary() }],
|
|
2263
|
+
overflow: [{ overflow: scaleOverflow() }],
|
|
2264
|
+
"overflow-x": [{ "overflow-x": scaleOverflow() }],
|
|
2265
|
+
"overflow-y": [{ "overflow-y": scaleOverflow() }],
|
|
2266
|
+
overscroll: [{ overscroll: scaleOverscroll() }],
|
|
2267
|
+
"overscroll-x": [{ "overscroll-x": scaleOverscroll() }],
|
|
2268
|
+
"overscroll-y": [{ "overscroll-y": scaleOverscroll() }],
|
|
2269
|
+
position: [
|
|
2270
|
+
"static",
|
|
2271
|
+
"fixed",
|
|
2272
|
+
"absolute",
|
|
2273
|
+
"relative",
|
|
2274
|
+
"sticky"
|
|
2275
|
+
],
|
|
2276
|
+
inset: [{ inset: scaleInset() }],
|
|
2277
|
+
"inset-x": [{ "inset-x": scaleInset() }],
|
|
2278
|
+
"inset-y": [{ "inset-y": scaleInset() }],
|
|
2279
|
+
start: [{ start: scaleInset() }],
|
|
2280
|
+
end: [{ end: scaleInset() }],
|
|
2281
|
+
top: [{ top: scaleInset() }],
|
|
2282
|
+
right: [{ right: scaleInset() }],
|
|
2283
|
+
bottom: [{ bottom: scaleInset() }],
|
|
2284
|
+
left: [{ left: scaleInset() }],
|
|
2285
|
+
visibility: [
|
|
2286
|
+
"visible",
|
|
2287
|
+
"invisible",
|
|
2288
|
+
"collapse"
|
|
2289
|
+
],
|
|
2290
|
+
z: [{ z: [
|
|
2291
|
+
isInteger,
|
|
2292
|
+
"auto",
|
|
2293
|
+
isArbitraryVariable,
|
|
2294
|
+
isArbitraryValue
|
|
2295
|
+
] }],
|
|
2296
|
+
basis: [{ basis: [
|
|
2297
|
+
isFraction,
|
|
2298
|
+
"full",
|
|
2299
|
+
"auto",
|
|
2300
|
+
themeContainer,
|
|
2301
|
+
...scaleUnambiguousSpacing()
|
|
2302
|
+
] }],
|
|
2303
|
+
"flex-direction": [{ flex: [
|
|
2304
|
+
"row",
|
|
2305
|
+
"row-reverse",
|
|
2306
|
+
"col",
|
|
2307
|
+
"col-reverse"
|
|
2308
|
+
] }],
|
|
2309
|
+
"flex-wrap": [{ flex: [
|
|
2310
|
+
"nowrap",
|
|
2311
|
+
"wrap",
|
|
2312
|
+
"wrap-reverse"
|
|
2313
|
+
] }],
|
|
2314
|
+
flex: [{ flex: [
|
|
2315
|
+
isNumber,
|
|
2316
|
+
isFraction,
|
|
2317
|
+
"auto",
|
|
2318
|
+
"initial",
|
|
2319
|
+
"none",
|
|
2320
|
+
isArbitraryValue
|
|
2321
|
+
] }],
|
|
2322
|
+
grow: [{ grow: [
|
|
2323
|
+
"",
|
|
2324
|
+
isNumber,
|
|
2325
|
+
isArbitraryVariable,
|
|
2326
|
+
isArbitraryValue
|
|
2327
|
+
] }],
|
|
2328
|
+
shrink: [{ shrink: [
|
|
2329
|
+
"",
|
|
2330
|
+
isNumber,
|
|
2331
|
+
isArbitraryVariable,
|
|
2332
|
+
isArbitraryValue
|
|
2333
|
+
] }],
|
|
2334
|
+
order: [{ order: [
|
|
2335
|
+
isInteger,
|
|
2336
|
+
"first",
|
|
2337
|
+
"last",
|
|
2338
|
+
"none",
|
|
2339
|
+
isArbitraryVariable,
|
|
2340
|
+
isArbitraryValue
|
|
2341
|
+
] }],
|
|
2342
|
+
"grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
|
|
2343
|
+
"col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
|
|
2344
|
+
"col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
|
|
2345
|
+
"col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
|
|
2346
|
+
"grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
|
|
2347
|
+
"row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
|
|
2348
|
+
"row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
|
|
2349
|
+
"row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
|
|
2350
|
+
"grid-flow": [{ "grid-flow": [
|
|
2351
|
+
"row",
|
|
2352
|
+
"col",
|
|
2353
|
+
"dense",
|
|
2354
|
+
"row-dense",
|
|
2355
|
+
"col-dense"
|
|
2356
|
+
] }],
|
|
2357
|
+
"auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
|
|
2358
|
+
"auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
|
|
2359
|
+
gap: [{ gap: scaleUnambiguousSpacing() }],
|
|
2360
|
+
"gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
|
|
2361
|
+
"gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
|
|
2362
|
+
"justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
|
|
2363
|
+
"justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
|
|
2364
|
+
"justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
2365
|
+
"align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
|
|
2366
|
+
"align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
|
|
2367
|
+
"align-self": [{ self: [
|
|
2368
|
+
"auto",
|
|
2369
|
+
...scaleAlignSecondaryAxis(),
|
|
2370
|
+
{ baseline: ["", "last"] }
|
|
2371
|
+
] }],
|
|
2372
|
+
"place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
|
|
2373
|
+
"place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
|
|
2374
|
+
"place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
|
|
2375
|
+
p: [{ p: scaleUnambiguousSpacing() }],
|
|
2376
|
+
px: [{ px: scaleUnambiguousSpacing() }],
|
|
2377
|
+
py: [{ py: scaleUnambiguousSpacing() }],
|
|
2378
|
+
ps: [{ ps: scaleUnambiguousSpacing() }],
|
|
2379
|
+
pe: [{ pe: scaleUnambiguousSpacing() }],
|
|
2380
|
+
pt: [{ pt: scaleUnambiguousSpacing() }],
|
|
2381
|
+
pr: [{ pr: scaleUnambiguousSpacing() }],
|
|
2382
|
+
pb: [{ pb: scaleUnambiguousSpacing() }],
|
|
2383
|
+
pl: [{ pl: scaleUnambiguousSpacing() }],
|
|
2384
|
+
m: [{ m: scaleMargin() }],
|
|
2385
|
+
mx: [{ mx: scaleMargin() }],
|
|
2386
|
+
my: [{ my: scaleMargin() }],
|
|
2387
|
+
ms: [{ ms: scaleMargin() }],
|
|
2388
|
+
me: [{ me: scaleMargin() }],
|
|
2389
|
+
mt: [{ mt: scaleMargin() }],
|
|
2390
|
+
mr: [{ mr: scaleMargin() }],
|
|
2391
|
+
mb: [{ mb: scaleMargin() }],
|
|
2392
|
+
ml: [{ ml: scaleMargin() }],
|
|
2393
|
+
"space-x": [{ "space-x": scaleUnambiguousSpacing() }],
|
|
2394
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
2395
|
+
"space-y": [{ "space-y": scaleUnambiguousSpacing() }],
|
|
2396
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
2397
|
+
size: [{ size: scaleSizing() }],
|
|
2398
|
+
w: [{ w: [
|
|
2399
|
+
themeContainer,
|
|
2400
|
+
"screen",
|
|
2401
|
+
...scaleSizing()
|
|
2402
|
+
] }],
|
|
2403
|
+
"min-w": [{ "min-w": [
|
|
2404
|
+
themeContainer,
|
|
2405
|
+
"screen",
|
|
2406
|
+
"none",
|
|
2407
|
+
...scaleSizing()
|
|
2408
|
+
] }],
|
|
2409
|
+
"max-w": [{ "max-w": [
|
|
2410
|
+
themeContainer,
|
|
2411
|
+
"screen",
|
|
2412
|
+
"none",
|
|
2413
|
+
"prose",
|
|
2414
|
+
{ screen: [themeBreakpoint] },
|
|
2415
|
+
...scaleSizing()
|
|
2416
|
+
] }],
|
|
2417
|
+
h: [{ h: [
|
|
2418
|
+
"screen",
|
|
2419
|
+
"lh",
|
|
2420
|
+
...scaleSizing()
|
|
2421
|
+
] }],
|
|
2422
|
+
"min-h": [{ "min-h": [
|
|
2423
|
+
"screen",
|
|
2424
|
+
"lh",
|
|
2425
|
+
"none",
|
|
2426
|
+
...scaleSizing()
|
|
2427
|
+
] }],
|
|
2428
|
+
"max-h": [{ "max-h": [
|
|
2429
|
+
"screen",
|
|
2430
|
+
"lh",
|
|
2431
|
+
...scaleSizing()
|
|
2432
|
+
] }],
|
|
2433
|
+
"font-size": [{ text: [
|
|
2434
|
+
"base",
|
|
2435
|
+
themeText,
|
|
2436
|
+
isArbitraryVariableLength,
|
|
2437
|
+
isArbitraryLength
|
|
2438
|
+
] }],
|
|
2439
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
2440
|
+
"font-style": ["italic", "not-italic"],
|
|
2441
|
+
"font-weight": [{ font: [
|
|
2442
|
+
themeFontWeight,
|
|
2443
|
+
isArbitraryVariable,
|
|
2444
|
+
isArbitraryNumber
|
|
2445
|
+
] }],
|
|
2446
|
+
"font-stretch": [{ "font-stretch": [
|
|
2447
|
+
"ultra-condensed",
|
|
2448
|
+
"extra-condensed",
|
|
2449
|
+
"condensed",
|
|
2450
|
+
"semi-condensed",
|
|
2451
|
+
"normal",
|
|
2452
|
+
"semi-expanded",
|
|
2453
|
+
"expanded",
|
|
2454
|
+
"extra-expanded",
|
|
2455
|
+
"ultra-expanded",
|
|
2456
|
+
isPercent,
|
|
2457
|
+
isArbitraryValue
|
|
2458
|
+
] }],
|
|
2459
|
+
"font-family": [{ font: [
|
|
2460
|
+
isArbitraryVariableFamilyName,
|
|
2461
|
+
isArbitraryValue,
|
|
2462
|
+
themeFont
|
|
2463
|
+
] }],
|
|
2464
|
+
"fvn-normal": ["normal-nums"],
|
|
2465
|
+
"fvn-ordinal": ["ordinal"],
|
|
2466
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
2467
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
2468
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
2469
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
2470
|
+
tracking: [{ tracking: [
|
|
2471
|
+
themeTracking,
|
|
2472
|
+
isArbitraryVariable,
|
|
2473
|
+
isArbitraryValue
|
|
2474
|
+
] }],
|
|
2475
|
+
"line-clamp": [{ "line-clamp": [
|
|
2476
|
+
isNumber,
|
|
2477
|
+
"none",
|
|
2478
|
+
isArbitraryVariable,
|
|
2479
|
+
isArbitraryNumber
|
|
2480
|
+
] }],
|
|
2481
|
+
leading: [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
|
|
2482
|
+
"list-image": [{ "list-image": [
|
|
2483
|
+
"none",
|
|
2484
|
+
isArbitraryVariable,
|
|
2485
|
+
isArbitraryValue
|
|
2486
|
+
] }],
|
|
2487
|
+
"list-style-position": [{ list: ["inside", "outside"] }],
|
|
2488
|
+
"list-style-type": [{ list: [
|
|
2489
|
+
"disc",
|
|
2490
|
+
"decimal",
|
|
2491
|
+
"none",
|
|
2492
|
+
isArbitraryVariable,
|
|
2493
|
+
isArbitraryValue
|
|
2494
|
+
] }],
|
|
2495
|
+
"text-alignment": [{ text: [
|
|
2496
|
+
"left",
|
|
2497
|
+
"center",
|
|
2498
|
+
"right",
|
|
2499
|
+
"justify",
|
|
2500
|
+
"start",
|
|
2501
|
+
"end"
|
|
2502
|
+
] }],
|
|
2503
|
+
"placeholder-color": [{ placeholder: scaleColor() }],
|
|
2504
|
+
"text-color": [{ text: scaleColor() }],
|
|
2505
|
+
"text-decoration": [
|
|
2506
|
+
"underline",
|
|
2507
|
+
"overline",
|
|
2508
|
+
"line-through",
|
|
2509
|
+
"no-underline"
|
|
2510
|
+
],
|
|
2511
|
+
"text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
|
|
2512
|
+
"text-decoration-thickness": [{ decoration: [
|
|
2513
|
+
isNumber,
|
|
2514
|
+
"from-font",
|
|
2515
|
+
"auto",
|
|
2516
|
+
isArbitraryVariable,
|
|
2517
|
+
isArbitraryLength
|
|
2518
|
+
] }],
|
|
2519
|
+
"text-decoration-color": [{ decoration: scaleColor() }],
|
|
2520
|
+
"underline-offset": [{ "underline-offset": [
|
|
2521
|
+
isNumber,
|
|
2522
|
+
"auto",
|
|
2523
|
+
isArbitraryVariable,
|
|
2524
|
+
isArbitraryValue
|
|
2525
|
+
] }],
|
|
2526
|
+
"text-transform": [
|
|
2527
|
+
"uppercase",
|
|
2528
|
+
"lowercase",
|
|
2529
|
+
"capitalize",
|
|
2530
|
+
"normal-case"
|
|
2531
|
+
],
|
|
2532
|
+
"text-overflow": [
|
|
2533
|
+
"truncate",
|
|
2534
|
+
"text-ellipsis",
|
|
2535
|
+
"text-clip"
|
|
2536
|
+
],
|
|
2537
|
+
"text-wrap": [{ text: [
|
|
2538
|
+
"wrap",
|
|
2539
|
+
"nowrap",
|
|
2540
|
+
"balance",
|
|
2541
|
+
"pretty"
|
|
2542
|
+
] }],
|
|
2543
|
+
indent: [{ indent: scaleUnambiguousSpacing() }],
|
|
2544
|
+
"vertical-align": [{ align: [
|
|
2545
|
+
"baseline",
|
|
2546
|
+
"top",
|
|
2547
|
+
"middle",
|
|
2548
|
+
"bottom",
|
|
2549
|
+
"text-top",
|
|
2550
|
+
"text-bottom",
|
|
2551
|
+
"sub",
|
|
2552
|
+
"super",
|
|
2553
|
+
isArbitraryVariable,
|
|
2554
|
+
isArbitraryValue
|
|
2555
|
+
] }],
|
|
2556
|
+
whitespace: [{ whitespace: [
|
|
2557
|
+
"normal",
|
|
2558
|
+
"nowrap",
|
|
2559
|
+
"pre",
|
|
2560
|
+
"pre-line",
|
|
2561
|
+
"pre-wrap",
|
|
2562
|
+
"break-spaces"
|
|
2563
|
+
] }],
|
|
2564
|
+
break: [{ break: [
|
|
2565
|
+
"normal",
|
|
2566
|
+
"words",
|
|
2567
|
+
"all",
|
|
2568
|
+
"keep"
|
|
2569
|
+
] }],
|
|
2570
|
+
wrap: [{ wrap: [
|
|
2571
|
+
"break-word",
|
|
2572
|
+
"anywhere",
|
|
2573
|
+
"normal"
|
|
2574
|
+
] }],
|
|
2575
|
+
hyphens: [{ hyphens: [
|
|
2576
|
+
"none",
|
|
2577
|
+
"manual",
|
|
2578
|
+
"auto"
|
|
2579
|
+
] }],
|
|
2580
|
+
content: [{ content: [
|
|
2581
|
+
"none",
|
|
2582
|
+
isArbitraryVariable,
|
|
2583
|
+
isArbitraryValue
|
|
2584
|
+
] }],
|
|
2585
|
+
"bg-attachment": [{ bg: [
|
|
2586
|
+
"fixed",
|
|
2587
|
+
"local",
|
|
2588
|
+
"scroll"
|
|
2589
|
+
] }],
|
|
2590
|
+
"bg-clip": [{ "bg-clip": [
|
|
2591
|
+
"border",
|
|
2592
|
+
"padding",
|
|
2593
|
+
"content",
|
|
2594
|
+
"text"
|
|
2595
|
+
] }],
|
|
2596
|
+
"bg-origin": [{ "bg-origin": [
|
|
2597
|
+
"border",
|
|
2598
|
+
"padding",
|
|
2599
|
+
"content"
|
|
2600
|
+
] }],
|
|
2601
|
+
"bg-position": [{ bg: scaleBgPosition() }],
|
|
2602
|
+
"bg-repeat": [{ bg: scaleBgRepeat() }],
|
|
2603
|
+
"bg-size": [{ bg: scaleBgSize() }],
|
|
2604
|
+
"bg-image": [{ bg: [
|
|
2605
|
+
"none",
|
|
2606
|
+
{
|
|
2607
|
+
linear: [
|
|
2608
|
+
{ to: [
|
|
2609
|
+
"t",
|
|
2610
|
+
"tr",
|
|
2611
|
+
"r",
|
|
2612
|
+
"br",
|
|
2613
|
+
"b",
|
|
2614
|
+
"bl",
|
|
2615
|
+
"l",
|
|
2616
|
+
"tl"
|
|
2617
|
+
] },
|
|
2618
|
+
isInteger,
|
|
2619
|
+
isArbitraryVariable,
|
|
2620
|
+
isArbitraryValue
|
|
2621
|
+
],
|
|
2622
|
+
radial: [
|
|
2623
|
+
"",
|
|
2624
|
+
isArbitraryVariable,
|
|
2625
|
+
isArbitraryValue
|
|
2626
|
+
],
|
|
2627
|
+
conic: [
|
|
2628
|
+
isInteger,
|
|
2629
|
+
isArbitraryVariable,
|
|
2630
|
+
isArbitraryValue
|
|
2631
|
+
]
|
|
2632
|
+
},
|
|
2633
|
+
isArbitraryVariableImage,
|
|
2634
|
+
isArbitraryImage
|
|
2635
|
+
] }],
|
|
2636
|
+
"bg-color": [{ bg: scaleColor() }],
|
|
2637
|
+
"gradient-from-pos": [{ from: scaleGradientStopPosition() }],
|
|
2638
|
+
"gradient-via-pos": [{ via: scaleGradientStopPosition() }],
|
|
2639
|
+
"gradient-to-pos": [{ to: scaleGradientStopPosition() }],
|
|
2640
|
+
"gradient-from": [{ from: scaleColor() }],
|
|
2641
|
+
"gradient-via": [{ via: scaleColor() }],
|
|
2642
|
+
"gradient-to": [{ to: scaleColor() }],
|
|
2643
|
+
rounded: [{ rounded: scaleRadius() }],
|
|
2644
|
+
"rounded-s": [{ "rounded-s": scaleRadius() }],
|
|
2645
|
+
"rounded-e": [{ "rounded-e": scaleRadius() }],
|
|
2646
|
+
"rounded-t": [{ "rounded-t": scaleRadius() }],
|
|
2647
|
+
"rounded-r": [{ "rounded-r": scaleRadius() }],
|
|
2648
|
+
"rounded-b": [{ "rounded-b": scaleRadius() }],
|
|
2649
|
+
"rounded-l": [{ "rounded-l": scaleRadius() }],
|
|
2650
|
+
"rounded-ss": [{ "rounded-ss": scaleRadius() }],
|
|
2651
|
+
"rounded-se": [{ "rounded-se": scaleRadius() }],
|
|
2652
|
+
"rounded-ee": [{ "rounded-ee": scaleRadius() }],
|
|
2653
|
+
"rounded-es": [{ "rounded-es": scaleRadius() }],
|
|
2654
|
+
"rounded-tl": [{ "rounded-tl": scaleRadius() }],
|
|
2655
|
+
"rounded-tr": [{ "rounded-tr": scaleRadius() }],
|
|
2656
|
+
"rounded-br": [{ "rounded-br": scaleRadius() }],
|
|
2657
|
+
"rounded-bl": [{ "rounded-bl": scaleRadius() }],
|
|
2658
|
+
"border-w": [{ border: scaleBorderWidth() }],
|
|
2659
|
+
"border-w-x": [{ "border-x": scaleBorderWidth() }],
|
|
2660
|
+
"border-w-y": [{ "border-y": scaleBorderWidth() }],
|
|
2661
|
+
"border-w-s": [{ "border-s": scaleBorderWidth() }],
|
|
2662
|
+
"border-w-e": [{ "border-e": scaleBorderWidth() }],
|
|
2663
|
+
"border-w-t": [{ "border-t": scaleBorderWidth() }],
|
|
2664
|
+
"border-w-r": [{ "border-r": scaleBorderWidth() }],
|
|
2665
|
+
"border-w-b": [{ "border-b": scaleBorderWidth() }],
|
|
2666
|
+
"border-w-l": [{ "border-l": scaleBorderWidth() }],
|
|
2667
|
+
"divide-x": [{ "divide-x": scaleBorderWidth() }],
|
|
2668
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
2669
|
+
"divide-y": [{ "divide-y": scaleBorderWidth() }],
|
|
2670
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
2671
|
+
"border-style": [{ border: [
|
|
2672
|
+
...scaleLineStyle(),
|
|
2673
|
+
"hidden",
|
|
2674
|
+
"none"
|
|
2675
|
+
] }],
|
|
2676
|
+
"divide-style": [{ divide: [
|
|
2677
|
+
...scaleLineStyle(),
|
|
2678
|
+
"hidden",
|
|
2679
|
+
"none"
|
|
2680
|
+
] }],
|
|
2681
|
+
"border-color": [{ border: scaleColor() }],
|
|
2682
|
+
"border-color-x": [{ "border-x": scaleColor() }],
|
|
2683
|
+
"border-color-y": [{ "border-y": scaleColor() }],
|
|
2684
|
+
"border-color-s": [{ "border-s": scaleColor() }],
|
|
2685
|
+
"border-color-e": [{ "border-e": scaleColor() }],
|
|
2686
|
+
"border-color-t": [{ "border-t": scaleColor() }],
|
|
2687
|
+
"border-color-r": [{ "border-r": scaleColor() }],
|
|
2688
|
+
"border-color-b": [{ "border-b": scaleColor() }],
|
|
2689
|
+
"border-color-l": [{ "border-l": scaleColor() }],
|
|
2690
|
+
"divide-color": [{ divide: scaleColor() }],
|
|
2691
|
+
"outline-style": [{ outline: [
|
|
2692
|
+
...scaleLineStyle(),
|
|
2693
|
+
"none",
|
|
2694
|
+
"hidden"
|
|
2695
|
+
] }],
|
|
2696
|
+
"outline-offset": [{ "outline-offset": [
|
|
2697
|
+
isNumber,
|
|
2698
|
+
isArbitraryVariable,
|
|
2699
|
+
isArbitraryValue
|
|
2700
|
+
] }],
|
|
2701
|
+
"outline-w": [{ outline: [
|
|
2702
|
+
"",
|
|
2703
|
+
isNumber,
|
|
2704
|
+
isArbitraryVariableLength,
|
|
2705
|
+
isArbitraryLength
|
|
2706
|
+
] }],
|
|
2707
|
+
"outline-color": [{ outline: scaleColor() }],
|
|
2708
|
+
shadow: [{ shadow: [
|
|
2709
|
+
"",
|
|
2710
|
+
"none",
|
|
2711
|
+
themeShadow,
|
|
2712
|
+
isArbitraryVariableShadow,
|
|
2713
|
+
isArbitraryShadow
|
|
2714
|
+
] }],
|
|
2715
|
+
"shadow-color": [{ shadow: scaleColor() }],
|
|
2716
|
+
"inset-shadow": [{ "inset-shadow": [
|
|
2717
|
+
"none",
|
|
2718
|
+
themeInsetShadow,
|
|
2719
|
+
isArbitraryVariableShadow,
|
|
2720
|
+
isArbitraryShadow
|
|
2721
|
+
] }],
|
|
2722
|
+
"inset-shadow-color": [{ "inset-shadow": scaleColor() }],
|
|
2723
|
+
"ring-w": [{ ring: scaleBorderWidth() }],
|
|
2724
|
+
"ring-w-inset": ["ring-inset"],
|
|
2725
|
+
"ring-color": [{ ring: scaleColor() }],
|
|
2726
|
+
"ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
|
|
2727
|
+
"ring-offset-color": [{ "ring-offset": scaleColor() }],
|
|
2728
|
+
"inset-ring-w": [{ "inset-ring": scaleBorderWidth() }],
|
|
2729
|
+
"inset-ring-color": [{ "inset-ring": scaleColor() }],
|
|
2730
|
+
"text-shadow": [{ "text-shadow": [
|
|
2731
|
+
"none",
|
|
2732
|
+
themeTextShadow,
|
|
2733
|
+
isArbitraryVariableShadow,
|
|
2734
|
+
isArbitraryShadow
|
|
2735
|
+
] }],
|
|
2736
|
+
"text-shadow-color": [{ "text-shadow": scaleColor() }],
|
|
2737
|
+
opacity: [{ opacity: [
|
|
2738
|
+
isNumber,
|
|
2739
|
+
isArbitraryVariable,
|
|
2740
|
+
isArbitraryValue
|
|
2741
|
+
] }],
|
|
2742
|
+
"mix-blend": [{ "mix-blend": [
|
|
2743
|
+
...scaleBlendMode(),
|
|
2744
|
+
"plus-darker",
|
|
2745
|
+
"plus-lighter"
|
|
2746
|
+
] }],
|
|
2747
|
+
"bg-blend": [{ "bg-blend": scaleBlendMode() }],
|
|
2748
|
+
"mask-clip": [{ "mask-clip": [
|
|
2749
|
+
"border",
|
|
2750
|
+
"padding",
|
|
2751
|
+
"content",
|
|
2752
|
+
"fill",
|
|
2753
|
+
"stroke",
|
|
2754
|
+
"view"
|
|
2755
|
+
] }, "mask-no-clip"],
|
|
2756
|
+
"mask-composite": [{ mask: [
|
|
2757
|
+
"add",
|
|
2758
|
+
"subtract",
|
|
2759
|
+
"intersect",
|
|
2760
|
+
"exclude"
|
|
2761
|
+
] }],
|
|
2762
|
+
"mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
|
|
2763
|
+
"mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }],
|
|
2764
|
+
"mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }],
|
|
2765
|
+
"mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }],
|
|
2766
|
+
"mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }],
|
|
2767
|
+
"mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }],
|
|
2768
|
+
"mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }],
|
|
2769
|
+
"mask-image-t-from-color": [{ "mask-t-from": scaleColor() }],
|
|
2770
|
+
"mask-image-t-to-color": [{ "mask-t-to": scaleColor() }],
|
|
2771
|
+
"mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }],
|
|
2772
|
+
"mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }],
|
|
2773
|
+
"mask-image-r-from-color": [{ "mask-r-from": scaleColor() }],
|
|
2774
|
+
"mask-image-r-to-color": [{ "mask-r-to": scaleColor() }],
|
|
2775
|
+
"mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }],
|
|
2776
|
+
"mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }],
|
|
2777
|
+
"mask-image-b-from-color": [{ "mask-b-from": scaleColor() }],
|
|
2778
|
+
"mask-image-b-to-color": [{ "mask-b-to": scaleColor() }],
|
|
2779
|
+
"mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }],
|
|
2780
|
+
"mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }],
|
|
2781
|
+
"mask-image-l-from-color": [{ "mask-l-from": scaleColor() }],
|
|
2782
|
+
"mask-image-l-to-color": [{ "mask-l-to": scaleColor() }],
|
|
2783
|
+
"mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }],
|
|
2784
|
+
"mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }],
|
|
2785
|
+
"mask-image-x-from-color": [{ "mask-x-from": scaleColor() }],
|
|
2786
|
+
"mask-image-x-to-color": [{ "mask-x-to": scaleColor() }],
|
|
2787
|
+
"mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }],
|
|
2788
|
+
"mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }],
|
|
2789
|
+
"mask-image-y-from-color": [{ "mask-y-from": scaleColor() }],
|
|
2790
|
+
"mask-image-y-to-color": [{ "mask-y-to": scaleColor() }],
|
|
2791
|
+
"mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
|
|
2792
|
+
"mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }],
|
|
2793
|
+
"mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }],
|
|
2794
|
+
"mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }],
|
|
2795
|
+
"mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }],
|
|
2796
|
+
"mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
|
|
2797
|
+
"mask-image-radial-size": [{ "mask-radial": [{
|
|
2798
|
+
closest: ["side", "corner"],
|
|
2799
|
+
farthest: ["side", "corner"]
|
|
2800
|
+
}] }],
|
|
2801
|
+
"mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }],
|
|
2802
|
+
"mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
|
|
2803
|
+
"mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }],
|
|
2804
|
+
"mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }],
|
|
2805
|
+
"mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }],
|
|
2806
|
+
"mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }],
|
|
2807
|
+
"mask-mode": [{ mask: [
|
|
2808
|
+
"alpha",
|
|
2809
|
+
"luminance",
|
|
2810
|
+
"match"
|
|
2811
|
+
] }],
|
|
2812
|
+
"mask-origin": [{ "mask-origin": [
|
|
2813
|
+
"border",
|
|
2814
|
+
"padding",
|
|
2815
|
+
"content",
|
|
2816
|
+
"fill",
|
|
2817
|
+
"stroke",
|
|
2818
|
+
"view"
|
|
2819
|
+
] }],
|
|
2820
|
+
"mask-position": [{ mask: scaleBgPosition() }],
|
|
2821
|
+
"mask-repeat": [{ mask: scaleBgRepeat() }],
|
|
2822
|
+
"mask-size": [{ mask: scaleBgSize() }],
|
|
2823
|
+
"mask-type": [{ "mask-type": ["alpha", "luminance"] }],
|
|
2824
|
+
"mask-image": [{ mask: [
|
|
2825
|
+
"none",
|
|
2826
|
+
isArbitraryVariable,
|
|
2827
|
+
isArbitraryValue
|
|
2828
|
+
] }],
|
|
2829
|
+
filter: [{ filter: [
|
|
2830
|
+
"",
|
|
2831
|
+
"none",
|
|
2832
|
+
isArbitraryVariable,
|
|
2833
|
+
isArbitraryValue
|
|
2834
|
+
] }],
|
|
2835
|
+
blur: [{ blur: scaleBlur() }],
|
|
2836
|
+
brightness: [{ brightness: [
|
|
2837
|
+
isNumber,
|
|
2838
|
+
isArbitraryVariable,
|
|
2839
|
+
isArbitraryValue
|
|
2840
|
+
] }],
|
|
2841
|
+
contrast: [{ contrast: [
|
|
2842
|
+
isNumber,
|
|
2843
|
+
isArbitraryVariable,
|
|
2844
|
+
isArbitraryValue
|
|
2845
|
+
] }],
|
|
2846
|
+
"drop-shadow": [{ "drop-shadow": [
|
|
2847
|
+
"",
|
|
2848
|
+
"none",
|
|
2849
|
+
themeDropShadow,
|
|
2850
|
+
isArbitraryVariableShadow,
|
|
2851
|
+
isArbitraryShadow
|
|
2852
|
+
] }],
|
|
2853
|
+
"drop-shadow-color": [{ "drop-shadow": scaleColor() }],
|
|
2854
|
+
grayscale: [{ grayscale: [
|
|
2855
|
+
"",
|
|
2856
|
+
isNumber,
|
|
2857
|
+
isArbitraryVariable,
|
|
2858
|
+
isArbitraryValue
|
|
2859
|
+
] }],
|
|
2860
|
+
"hue-rotate": [{ "hue-rotate": [
|
|
2861
|
+
isNumber,
|
|
2862
|
+
isArbitraryVariable,
|
|
2863
|
+
isArbitraryValue
|
|
2864
|
+
] }],
|
|
2865
|
+
invert: [{ invert: [
|
|
2866
|
+
"",
|
|
2867
|
+
isNumber,
|
|
2868
|
+
isArbitraryVariable,
|
|
2869
|
+
isArbitraryValue
|
|
2870
|
+
] }],
|
|
2871
|
+
saturate: [{ saturate: [
|
|
2872
|
+
isNumber,
|
|
2873
|
+
isArbitraryVariable,
|
|
2874
|
+
isArbitraryValue
|
|
2875
|
+
] }],
|
|
2876
|
+
sepia: [{ sepia: [
|
|
2877
|
+
"",
|
|
2878
|
+
isNumber,
|
|
2879
|
+
isArbitraryVariable,
|
|
2880
|
+
isArbitraryValue
|
|
2881
|
+
] }],
|
|
2882
|
+
"backdrop-filter": [{ "backdrop-filter": [
|
|
2883
|
+
"",
|
|
2884
|
+
"none",
|
|
2885
|
+
isArbitraryVariable,
|
|
2886
|
+
isArbitraryValue
|
|
2887
|
+
] }],
|
|
2888
|
+
"backdrop-blur": [{ "backdrop-blur": scaleBlur() }],
|
|
2889
|
+
"backdrop-brightness": [{ "backdrop-brightness": [
|
|
2890
|
+
isNumber,
|
|
2891
|
+
isArbitraryVariable,
|
|
2892
|
+
isArbitraryValue
|
|
2893
|
+
] }],
|
|
2894
|
+
"backdrop-contrast": [{ "backdrop-contrast": [
|
|
2895
|
+
isNumber,
|
|
2896
|
+
isArbitraryVariable,
|
|
2897
|
+
isArbitraryValue
|
|
2898
|
+
] }],
|
|
2899
|
+
"backdrop-grayscale": [{ "backdrop-grayscale": [
|
|
2900
|
+
"",
|
|
2901
|
+
isNumber,
|
|
2902
|
+
isArbitraryVariable,
|
|
2903
|
+
isArbitraryValue
|
|
2904
|
+
] }],
|
|
2905
|
+
"backdrop-hue-rotate": [{ "backdrop-hue-rotate": [
|
|
2906
|
+
isNumber,
|
|
2907
|
+
isArbitraryVariable,
|
|
2908
|
+
isArbitraryValue
|
|
2909
|
+
] }],
|
|
2910
|
+
"backdrop-invert": [{ "backdrop-invert": [
|
|
2911
|
+
"",
|
|
2912
|
+
isNumber,
|
|
2913
|
+
isArbitraryVariable,
|
|
2914
|
+
isArbitraryValue
|
|
2915
|
+
] }],
|
|
2916
|
+
"backdrop-opacity": [{ "backdrop-opacity": [
|
|
2917
|
+
isNumber,
|
|
2918
|
+
isArbitraryVariable,
|
|
2919
|
+
isArbitraryValue
|
|
2920
|
+
] }],
|
|
2921
|
+
"backdrop-saturate": [{ "backdrop-saturate": [
|
|
2922
|
+
isNumber,
|
|
2923
|
+
isArbitraryVariable,
|
|
2924
|
+
isArbitraryValue
|
|
2925
|
+
] }],
|
|
2926
|
+
"backdrop-sepia": [{ "backdrop-sepia": [
|
|
2927
|
+
"",
|
|
2928
|
+
isNumber,
|
|
2929
|
+
isArbitraryVariable,
|
|
2930
|
+
isArbitraryValue
|
|
2931
|
+
] }],
|
|
2932
|
+
"border-collapse": [{ border: ["collapse", "separate"] }],
|
|
2933
|
+
"border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }],
|
|
2934
|
+
"border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }],
|
|
2935
|
+
"border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }],
|
|
2936
|
+
"table-layout": [{ table: ["auto", "fixed"] }],
|
|
2937
|
+
caption: [{ caption: ["top", "bottom"] }],
|
|
2938
|
+
transition: [{ transition: [
|
|
2939
|
+
"",
|
|
2940
|
+
"all",
|
|
2941
|
+
"colors",
|
|
2942
|
+
"opacity",
|
|
2943
|
+
"shadow",
|
|
2944
|
+
"transform",
|
|
2945
|
+
"none",
|
|
2946
|
+
isArbitraryVariable,
|
|
2947
|
+
isArbitraryValue
|
|
2948
|
+
] }],
|
|
2949
|
+
"transition-behavior": [{ transition: ["normal", "discrete"] }],
|
|
2950
|
+
duration: [{ duration: [
|
|
2951
|
+
isNumber,
|
|
2952
|
+
"initial",
|
|
2953
|
+
isArbitraryVariable,
|
|
2954
|
+
isArbitraryValue
|
|
2955
|
+
] }],
|
|
2956
|
+
ease: [{ ease: [
|
|
2957
|
+
"linear",
|
|
2958
|
+
"initial",
|
|
2959
|
+
themeEase,
|
|
2960
|
+
isArbitraryVariable,
|
|
2961
|
+
isArbitraryValue
|
|
2962
|
+
] }],
|
|
2963
|
+
delay: [{ delay: [
|
|
2964
|
+
isNumber,
|
|
2965
|
+
isArbitraryVariable,
|
|
2966
|
+
isArbitraryValue
|
|
2967
|
+
] }],
|
|
2968
|
+
animate: [{ animate: [
|
|
2969
|
+
"none",
|
|
2970
|
+
themeAnimate,
|
|
2971
|
+
isArbitraryVariable,
|
|
2972
|
+
isArbitraryValue
|
|
2973
|
+
] }],
|
|
2974
|
+
backface: [{ backface: ["hidden", "visible"] }],
|
|
2975
|
+
perspective: [{ perspective: [
|
|
2976
|
+
themePerspective,
|
|
2977
|
+
isArbitraryVariable,
|
|
2978
|
+
isArbitraryValue
|
|
2979
|
+
] }],
|
|
2980
|
+
"perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }],
|
|
2981
|
+
rotate: [{ rotate: scaleRotate() }],
|
|
2982
|
+
"rotate-x": [{ "rotate-x": scaleRotate() }],
|
|
2983
|
+
"rotate-y": [{ "rotate-y": scaleRotate() }],
|
|
2984
|
+
"rotate-z": [{ "rotate-z": scaleRotate() }],
|
|
2985
|
+
scale: [{ scale: scaleScale() }],
|
|
2986
|
+
"scale-x": [{ "scale-x": scaleScale() }],
|
|
2987
|
+
"scale-y": [{ "scale-y": scaleScale() }],
|
|
2988
|
+
"scale-z": [{ "scale-z": scaleScale() }],
|
|
2989
|
+
"scale-3d": ["scale-3d"],
|
|
2990
|
+
skew: [{ skew: scaleSkew() }],
|
|
2991
|
+
"skew-x": [{ "skew-x": scaleSkew() }],
|
|
2992
|
+
"skew-y": [{ "skew-y": scaleSkew() }],
|
|
2993
|
+
transform: [{ transform: [
|
|
2994
|
+
isArbitraryVariable,
|
|
2995
|
+
isArbitraryValue,
|
|
2996
|
+
"",
|
|
2997
|
+
"none",
|
|
2998
|
+
"gpu",
|
|
2999
|
+
"cpu"
|
|
3000
|
+
] }],
|
|
3001
|
+
"transform-origin": [{ origin: scalePositionWithArbitrary() }],
|
|
3002
|
+
"transform-style": [{ transform: ["3d", "flat"] }],
|
|
3003
|
+
translate: [{ translate: scaleTranslate() }],
|
|
3004
|
+
"translate-x": [{ "translate-x": scaleTranslate() }],
|
|
3005
|
+
"translate-y": [{ "translate-y": scaleTranslate() }],
|
|
3006
|
+
"translate-z": [{ "translate-z": scaleTranslate() }],
|
|
3007
|
+
"translate-none": ["translate-none"],
|
|
3008
|
+
accent: [{ accent: scaleColor() }],
|
|
3009
|
+
appearance: [{ appearance: ["none", "auto"] }],
|
|
3010
|
+
"caret-color": [{ caret: scaleColor() }],
|
|
3011
|
+
"color-scheme": [{ scheme: [
|
|
3012
|
+
"normal",
|
|
3013
|
+
"dark",
|
|
3014
|
+
"light",
|
|
3015
|
+
"light-dark",
|
|
3016
|
+
"only-dark",
|
|
3017
|
+
"only-light"
|
|
3018
|
+
] }],
|
|
3019
|
+
cursor: [{ cursor: [
|
|
3020
|
+
"auto",
|
|
3021
|
+
"default",
|
|
3022
|
+
"pointer",
|
|
3023
|
+
"wait",
|
|
3024
|
+
"text",
|
|
3025
|
+
"move",
|
|
3026
|
+
"help",
|
|
3027
|
+
"not-allowed",
|
|
3028
|
+
"none",
|
|
3029
|
+
"context-menu",
|
|
3030
|
+
"progress",
|
|
3031
|
+
"cell",
|
|
3032
|
+
"crosshair",
|
|
3033
|
+
"vertical-text",
|
|
3034
|
+
"alias",
|
|
3035
|
+
"copy",
|
|
3036
|
+
"no-drop",
|
|
3037
|
+
"grab",
|
|
3038
|
+
"grabbing",
|
|
3039
|
+
"all-scroll",
|
|
3040
|
+
"col-resize",
|
|
3041
|
+
"row-resize",
|
|
3042
|
+
"n-resize",
|
|
3043
|
+
"e-resize",
|
|
3044
|
+
"s-resize",
|
|
3045
|
+
"w-resize",
|
|
3046
|
+
"ne-resize",
|
|
3047
|
+
"nw-resize",
|
|
3048
|
+
"se-resize",
|
|
3049
|
+
"sw-resize",
|
|
3050
|
+
"ew-resize",
|
|
3051
|
+
"ns-resize",
|
|
3052
|
+
"nesw-resize",
|
|
3053
|
+
"nwse-resize",
|
|
3054
|
+
"zoom-in",
|
|
3055
|
+
"zoom-out",
|
|
3056
|
+
isArbitraryVariable,
|
|
3057
|
+
isArbitraryValue
|
|
3058
|
+
] }],
|
|
3059
|
+
"field-sizing": [{ "field-sizing": ["fixed", "content"] }],
|
|
3060
|
+
"pointer-events": [{ "pointer-events": ["auto", "none"] }],
|
|
3061
|
+
resize: [{ resize: [
|
|
3062
|
+
"none",
|
|
3063
|
+
"",
|
|
3064
|
+
"y",
|
|
3065
|
+
"x"
|
|
3066
|
+
] }],
|
|
3067
|
+
"scroll-behavior": [{ scroll: ["auto", "smooth"] }],
|
|
3068
|
+
"scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }],
|
|
3069
|
+
"scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }],
|
|
3070
|
+
"scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }],
|
|
3071
|
+
"scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }],
|
|
3072
|
+
"scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }],
|
|
3073
|
+
"scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }],
|
|
3074
|
+
"scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }],
|
|
3075
|
+
"scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }],
|
|
3076
|
+
"scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }],
|
|
3077
|
+
"scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }],
|
|
3078
|
+
"scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }],
|
|
3079
|
+
"scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }],
|
|
3080
|
+
"scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }],
|
|
3081
|
+
"scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }],
|
|
3082
|
+
"scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }],
|
|
3083
|
+
"scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }],
|
|
3084
|
+
"scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }],
|
|
3085
|
+
"scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }],
|
|
3086
|
+
"snap-align": [{ snap: [
|
|
3087
|
+
"start",
|
|
3088
|
+
"end",
|
|
3089
|
+
"center",
|
|
3090
|
+
"align-none"
|
|
3091
|
+
] }],
|
|
3092
|
+
"snap-stop": [{ snap: ["normal", "always"] }],
|
|
3093
|
+
"snap-type": [{ snap: [
|
|
3094
|
+
"none",
|
|
3095
|
+
"x",
|
|
3096
|
+
"y",
|
|
3097
|
+
"both"
|
|
3098
|
+
] }],
|
|
3099
|
+
"snap-strictness": [{ snap: ["mandatory", "proximity"] }],
|
|
3100
|
+
touch: [{ touch: [
|
|
3101
|
+
"auto",
|
|
3102
|
+
"none",
|
|
3103
|
+
"manipulation"
|
|
3104
|
+
] }],
|
|
3105
|
+
"touch-x": [{ "touch-pan": [
|
|
3106
|
+
"x",
|
|
3107
|
+
"left",
|
|
3108
|
+
"right"
|
|
3109
|
+
] }],
|
|
3110
|
+
"touch-y": [{ "touch-pan": [
|
|
3111
|
+
"y",
|
|
3112
|
+
"up",
|
|
3113
|
+
"down"
|
|
3114
|
+
] }],
|
|
3115
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
3116
|
+
select: [{ select: [
|
|
3117
|
+
"none",
|
|
3118
|
+
"text",
|
|
3119
|
+
"all",
|
|
3120
|
+
"auto"
|
|
3121
|
+
] }],
|
|
3122
|
+
"will-change": [{ "will-change": [
|
|
3123
|
+
"auto",
|
|
3124
|
+
"scroll",
|
|
3125
|
+
"contents",
|
|
3126
|
+
"transform",
|
|
3127
|
+
isArbitraryVariable,
|
|
3128
|
+
isArbitraryValue
|
|
3129
|
+
] }],
|
|
3130
|
+
fill: [{ fill: ["none", ...scaleColor()] }],
|
|
3131
|
+
"stroke-w": [{ stroke: [
|
|
3132
|
+
isNumber,
|
|
3133
|
+
isArbitraryVariableLength,
|
|
3134
|
+
isArbitraryLength,
|
|
3135
|
+
isArbitraryNumber
|
|
3136
|
+
] }],
|
|
3137
|
+
stroke: [{ stroke: ["none", ...scaleColor()] }],
|
|
3138
|
+
"forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
|
|
3139
|
+
},
|
|
3140
|
+
conflictingClassGroups: {
|
|
3141
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
3142
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
3143
|
+
inset: [
|
|
3144
|
+
"inset-x",
|
|
3145
|
+
"inset-y",
|
|
3146
|
+
"start",
|
|
3147
|
+
"end",
|
|
3148
|
+
"top",
|
|
3149
|
+
"right",
|
|
3150
|
+
"bottom",
|
|
3151
|
+
"left"
|
|
3152
|
+
],
|
|
3153
|
+
"inset-x": ["right", "left"],
|
|
3154
|
+
"inset-y": ["top", "bottom"],
|
|
3155
|
+
flex: [
|
|
3156
|
+
"basis",
|
|
3157
|
+
"grow",
|
|
3158
|
+
"shrink"
|
|
3159
|
+
],
|
|
3160
|
+
gap: ["gap-x", "gap-y"],
|
|
3161
|
+
p: [
|
|
3162
|
+
"px",
|
|
3163
|
+
"py",
|
|
3164
|
+
"ps",
|
|
3165
|
+
"pe",
|
|
3166
|
+
"pt",
|
|
3167
|
+
"pr",
|
|
3168
|
+
"pb",
|
|
3169
|
+
"pl"
|
|
3170
|
+
],
|
|
3171
|
+
px: ["pr", "pl"],
|
|
3172
|
+
py: ["pt", "pb"],
|
|
3173
|
+
m: [
|
|
3174
|
+
"mx",
|
|
3175
|
+
"my",
|
|
3176
|
+
"ms",
|
|
3177
|
+
"me",
|
|
3178
|
+
"mt",
|
|
3179
|
+
"mr",
|
|
3180
|
+
"mb",
|
|
3181
|
+
"ml"
|
|
3182
|
+
],
|
|
3183
|
+
mx: ["mr", "ml"],
|
|
3184
|
+
my: ["mt", "mb"],
|
|
3185
|
+
size: ["w", "h"],
|
|
3186
|
+
"font-size": ["leading"],
|
|
3187
|
+
"fvn-normal": [
|
|
3188
|
+
"fvn-ordinal",
|
|
3189
|
+
"fvn-slashed-zero",
|
|
3190
|
+
"fvn-figure",
|
|
3191
|
+
"fvn-spacing",
|
|
3192
|
+
"fvn-fraction"
|
|
3193
|
+
],
|
|
3194
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
3195
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
3196
|
+
"fvn-figure": ["fvn-normal"],
|
|
3197
|
+
"fvn-spacing": ["fvn-normal"],
|
|
3198
|
+
"fvn-fraction": ["fvn-normal"],
|
|
3199
|
+
"line-clamp": ["display", "overflow"],
|
|
3200
|
+
rounded: [
|
|
3201
|
+
"rounded-s",
|
|
3202
|
+
"rounded-e",
|
|
3203
|
+
"rounded-t",
|
|
3204
|
+
"rounded-r",
|
|
3205
|
+
"rounded-b",
|
|
3206
|
+
"rounded-l",
|
|
3207
|
+
"rounded-ss",
|
|
3208
|
+
"rounded-se",
|
|
3209
|
+
"rounded-ee",
|
|
3210
|
+
"rounded-es",
|
|
3211
|
+
"rounded-tl",
|
|
3212
|
+
"rounded-tr",
|
|
3213
|
+
"rounded-br",
|
|
3214
|
+
"rounded-bl"
|
|
3215
|
+
],
|
|
3216
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
3217
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
3218
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
3219
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
3220
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
3221
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
3222
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
3223
|
+
"border-w": [
|
|
3224
|
+
"border-w-x",
|
|
3225
|
+
"border-w-y",
|
|
3226
|
+
"border-w-s",
|
|
3227
|
+
"border-w-e",
|
|
3228
|
+
"border-w-t",
|
|
3229
|
+
"border-w-r",
|
|
3230
|
+
"border-w-b",
|
|
3231
|
+
"border-w-l"
|
|
3232
|
+
],
|
|
3233
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
3234
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
3235
|
+
"border-color": [
|
|
3236
|
+
"border-color-x",
|
|
3237
|
+
"border-color-y",
|
|
3238
|
+
"border-color-s",
|
|
3239
|
+
"border-color-e",
|
|
3240
|
+
"border-color-t",
|
|
3241
|
+
"border-color-r",
|
|
3242
|
+
"border-color-b",
|
|
3243
|
+
"border-color-l"
|
|
3244
|
+
],
|
|
3245
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
3246
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
3247
|
+
translate: [
|
|
3248
|
+
"translate-x",
|
|
3249
|
+
"translate-y",
|
|
3250
|
+
"translate-none"
|
|
3251
|
+
],
|
|
3252
|
+
"translate-none": [
|
|
3253
|
+
"translate",
|
|
3254
|
+
"translate-x",
|
|
3255
|
+
"translate-y",
|
|
3256
|
+
"translate-z"
|
|
3257
|
+
],
|
|
3258
|
+
"scroll-m": [
|
|
3259
|
+
"scroll-mx",
|
|
3260
|
+
"scroll-my",
|
|
3261
|
+
"scroll-ms",
|
|
3262
|
+
"scroll-me",
|
|
3263
|
+
"scroll-mt",
|
|
3264
|
+
"scroll-mr",
|
|
3265
|
+
"scroll-mb",
|
|
3266
|
+
"scroll-ml"
|
|
3267
|
+
],
|
|
3268
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
3269
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
3270
|
+
"scroll-p": [
|
|
3271
|
+
"scroll-px",
|
|
3272
|
+
"scroll-py",
|
|
3273
|
+
"scroll-ps",
|
|
3274
|
+
"scroll-pe",
|
|
3275
|
+
"scroll-pt",
|
|
3276
|
+
"scroll-pr",
|
|
3277
|
+
"scroll-pb",
|
|
3278
|
+
"scroll-pl"
|
|
3279
|
+
],
|
|
3280
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
3281
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
3282
|
+
touch: [
|
|
3283
|
+
"touch-x",
|
|
3284
|
+
"touch-y",
|
|
3285
|
+
"touch-pz"
|
|
3286
|
+
],
|
|
3287
|
+
"touch-x": ["touch"],
|
|
3288
|
+
"touch-y": ["touch"],
|
|
3289
|
+
"touch-pz": ["touch"]
|
|
3290
|
+
},
|
|
3291
|
+
conflictingClassGroupModifiers: { "font-size": ["leading"] },
|
|
3292
|
+
orderSensitiveModifiers: [
|
|
3293
|
+
"*",
|
|
3294
|
+
"**",
|
|
3295
|
+
"after",
|
|
3296
|
+
"backdrop",
|
|
3297
|
+
"before",
|
|
3298
|
+
"details-content",
|
|
3299
|
+
"file",
|
|
3300
|
+
"first-letter",
|
|
3301
|
+
"first-line",
|
|
3302
|
+
"marker",
|
|
3303
|
+
"placeholder",
|
|
3304
|
+
"selection"
|
|
3305
|
+
]
|
|
3306
|
+
};
|
|
3307
|
+
};
|
|
3308
|
+
const twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
3309
|
+
|
|
3310
|
+
//#endregion
|
|
3311
|
+
//#region ../common/dist/strings/tokenize.js
|
|
3312
|
+
function buildTokenizeFuncUsingSplitters(splitters) {
|
|
3313
|
+
splitters = Array.isArray(splitters) ? splitters : [splitters];
|
|
3314
|
+
const tokenize = (s) => {
|
|
3315
|
+
let r = s.split(splitters[0]).filter((t) => t != "" && t != void 0);
|
|
3316
|
+
for (const splitter of splitters.slice(1)) {
|
|
3317
|
+
const r0 = [...r];
|
|
3318
|
+
r = [];
|
|
3319
|
+
for (const s$1 of r0) r.push(...tokenizeFilterString(s$1, {
|
|
3320
|
+
splitter,
|
|
3321
|
+
filter: (t) => t != "" && t != void 0
|
|
3322
|
+
}));
|
|
3323
|
+
}
|
|
3324
|
+
return r;
|
|
3325
|
+
};
|
|
3326
|
+
return tokenize;
|
|
3327
|
+
}
|
|
3328
|
+
function buildArgTokenizeFunc(tokenize) {
|
|
3329
|
+
const argTokenize = (arg) => {
|
|
3330
|
+
if (arg == void 0) return [];
|
|
3331
|
+
else if (Array.isArray(arg)) {
|
|
3332
|
+
const r = [];
|
|
3333
|
+
for (const a of arg) r.push(...argTokenize(a));
|
|
3334
|
+
return r;
|
|
3335
|
+
} else return tokenize(arg);
|
|
3336
|
+
};
|
|
3337
|
+
return argTokenize;
|
|
3338
|
+
}
|
|
3339
|
+
const tokenizeBySpaces = buildTokenizeFuncUsingSplitters(/\s+/);
|
|
3340
|
+
const argTokenizeBySpaces = buildArgTokenizeFunc(tokenizeBySpaces);
|
|
3341
|
+
function tokenizeFilterString(s, options = {}) {
|
|
3342
|
+
const separator = options.splitter ?? /\s+/;
|
|
3343
|
+
const filter = options.filter ?? ((s$1) => s$1.length > 0);
|
|
3344
|
+
return s.split(separator).filter(filter);
|
|
3345
|
+
}
|
|
3346
|
+
function deduplicate(items) {
|
|
3347
|
+
const r = [];
|
|
3348
|
+
const itemSet = /* @__PURE__ */ new Set();
|
|
3349
|
+
for (const item of items) if (!itemSet.has(item)) {
|
|
3350
|
+
r.push(item);
|
|
3351
|
+
itemSet.add(item);
|
|
3352
|
+
}
|
|
3353
|
+
return r;
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
//#endregion
|
|
3357
|
+
//#region ../common/dist/messages/logMessages.js
|
|
3358
|
+
const LogLevels = [
|
|
3359
|
+
"ERROR",
|
|
3360
|
+
"WARNING",
|
|
3361
|
+
"INFO",
|
|
3362
|
+
"DEBUG"
|
|
3363
|
+
];
|
|
3364
|
+
const LogLevelsMap = /* @__PURE__ */ new Map();
|
|
3365
|
+
LogLevels.forEach((level, i) => {
|
|
3366
|
+
LogLevelsMap.set(level, LogLevels.length - i);
|
|
3367
|
+
});
|
|
3368
|
+
|
|
3369
|
+
//#endregion
|
|
3370
|
+
//#region src/stylers/normalizers.ts
|
|
3371
|
+
function twMergeNormalize(raw) {
|
|
3372
|
+
return tokenizeFilterString(twMerge(...raw));
|
|
3373
|
+
}
|
|
3374
|
+
function mainTagNormalize(rawTags, defaultTag) {
|
|
3375
|
+
return exclusiveTagsNormalize(rawTags, (tag) => tag.length == 1 && tag.toUpperCase() == tag, defaultTag);
|
|
3376
|
+
}
|
|
3377
|
+
function exclusiveTagsNormalize(rawTags, tagSet, defaultTag) {
|
|
3378
|
+
const rhead = [];
|
|
3379
|
+
const rtail = [];
|
|
3380
|
+
let rtag = void 0;
|
|
3381
|
+
const tagSetFunc = typeof tagSet == "function" ? tagSet : (tag) => tagSet.has(tag);
|
|
3382
|
+
for (const tag of rawTags) if (tagSetFunc(tag)) {
|
|
3383
|
+
rtag = tag;
|
|
3384
|
+
rhead.push(...rtail);
|
|
3385
|
+
rtail.length = 0;
|
|
3386
|
+
} else if (rtag == void 0) rhead.push(tag);
|
|
3387
|
+
else rtail.push(tag);
|
|
3388
|
+
rtag = rtag ?? defaultTag;
|
|
3389
|
+
return rtag == void 0 ? [...rhead, ...rtail] : [
|
|
3390
|
+
...rhead,
|
|
3391
|
+
rtag,
|
|
3392
|
+
...rtail
|
|
3393
|
+
];
|
|
3394
|
+
}
|
|
3395
|
+
|
|
3396
|
+
//#endregion
|
|
3397
|
+
//#region src/stylers/SVTStyler.ts
|
|
3398
|
+
var SVTStyler = class SVTStyler {
|
|
3399
|
+
_rules = [];
|
|
3400
|
+
options;
|
|
3401
|
+
constructor(rules, options = {}) {
|
|
3402
|
+
for (const r of rules) this._rules.push(SVTStyler.normalizeRule(r));
|
|
3403
|
+
this.options = { ...options };
|
|
3404
|
+
}
|
|
3405
|
+
with(rules, options = {}) {
|
|
3406
|
+
const addedRules = [];
|
|
3407
|
+
for (const r of rules) addedRules.push(SVTStyler.normalizeRule(r));
|
|
3408
|
+
const styler = new SVTStyler([], { ...this.options });
|
|
3409
|
+
styler._rules.push(...this._rules, ...addedRules);
|
|
3410
|
+
return styler;
|
|
3411
|
+
}
|
|
3412
|
+
classes(stags, vtags) {
|
|
3413
|
+
const r = [];
|
|
3414
|
+
let stagsNormalized = argTokenizeBySpaces(stags);
|
|
3415
|
+
let vtagsNormalized = argTokenizeBySpaces(vtags);
|
|
3416
|
+
if (this.options.stagsNormaliser) stagsNormalized = this.options.stagsNormaliser(stagsNormalized);
|
|
3417
|
+
if (this.options.vtagsNormaliser) vtagsNormalized = this.options.vtagsNormaliser(vtagsNormalized);
|
|
3418
|
+
for (const rule of this._rules) if (this.ruleMatches(rule, stagsNormalized, vtagsNormalized)) r.push(...rule.classes);
|
|
3419
|
+
return this.options.normalizer ? this.options.normalizer(r) : r;
|
|
3420
|
+
}
|
|
3421
|
+
static normalizeRule(rule) {
|
|
3422
|
+
let stagMode = rule.stagMode ?? "or";
|
|
3423
|
+
let vtagMode = rule.vtagMode ?? "or";
|
|
3424
|
+
let stags = deduplicate(argTokenizeBySpaces(rule.stags));
|
|
3425
|
+
let vtags = deduplicate(argTokenizeBySpaces(rule.vtags));
|
|
3426
|
+
let classes = deduplicate(argTokenizeBySpaces(rule.classes));
|
|
3427
|
+
if (rule.stags == void 0 && rule.stagMode == void 0) stagMode = "any";
|
|
3428
|
+
if (rule.vtags == void 0 && rule.vtagMode == void 0) vtagMode = "any";
|
|
3429
|
+
return {
|
|
3430
|
+
stagRule: {
|
|
3431
|
+
mode: stagMode,
|
|
3432
|
+
tags: stags
|
|
3433
|
+
},
|
|
3434
|
+
vtagRule: {
|
|
3435
|
+
mode: vtagMode,
|
|
3436
|
+
tags: vtags
|
|
3437
|
+
},
|
|
3438
|
+
classes
|
|
3439
|
+
};
|
|
3440
|
+
}
|
|
3441
|
+
ruleMatches(rule, stags, vtags) {
|
|
3442
|
+
return tagRuleMatches(rule.stagRule, stags) && tagRuleMatches(rule.vtagRule, vtags);
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
function tagRuleMatches(rule, candidateTags) {
|
|
3446
|
+
if (rule.mode == "any") return true;
|
|
3447
|
+
else if (rule.mode == "or") {
|
|
3448
|
+
for (const ctag of candidateTags) if (rule.tags.indexOf(ctag) >= 0) return true;
|
|
3449
|
+
return false;
|
|
3450
|
+
} else if (rule.mode == "and") {
|
|
3451
|
+
for (const rtag of rule.tags) if (candidateTags.indexOf(rtag) < 0) return false;
|
|
3452
|
+
return true;
|
|
3453
|
+
}
|
|
3454
|
+
return false;
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
//#endregion
|
|
3458
|
+
//#region src/stylers/base.styler.ts
|
|
3459
|
+
const baseStyler = new SVTStyler([
|
|
3460
|
+
{
|
|
3461
|
+
vtags: "A",
|
|
3462
|
+
classes: "bg-slate-100 text-slate-800"
|
|
3463
|
+
},
|
|
3464
|
+
{
|
|
3465
|
+
vtags: "B",
|
|
3466
|
+
classes: "bg-slate-800 text-slate-100"
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
vtags: "C",
|
|
3470
|
+
classes: "bg-stone-300 text-orange-950"
|
|
3471
|
+
},
|
|
3472
|
+
{
|
|
3473
|
+
vtags: "D",
|
|
3474
|
+
classes: "bg-orange-900 text-stone-100"
|
|
3475
|
+
},
|
|
3476
|
+
{
|
|
3477
|
+
vtags: "LG",
|
|
3478
|
+
classes: "text-xl p-2"
|
|
3479
|
+
},
|
|
3480
|
+
{
|
|
3481
|
+
vtags: "BASE",
|
|
3482
|
+
classes: "text-base p-1"
|
|
3483
|
+
},
|
|
3484
|
+
{
|
|
3485
|
+
vtags: "SM",
|
|
3486
|
+
classes: "text-sm p-0.5"
|
|
3487
|
+
},
|
|
3488
|
+
{
|
|
3489
|
+
vtags: "LG",
|
|
3490
|
+
stags: "item",
|
|
3491
|
+
classes: "text-xl px-2 py-1"
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
vtags: "BASE",
|
|
3495
|
+
stags: "item",
|
|
3496
|
+
classes: "text-base px-1 py-0.5"
|
|
3497
|
+
},
|
|
3498
|
+
{
|
|
3499
|
+
vtags: "SM",
|
|
3500
|
+
stags: "item",
|
|
3501
|
+
classes: "text-sm p-0.5"
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
stags: "item:selected",
|
|
3505
|
+
classes: "underline font-bold"
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
stags: "item:disabled",
|
|
3509
|
+
classes: "blur-[1px]"
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
stags: "item/disabler",
|
|
3513
|
+
classes: "bg-slate-300/85 cursor-not-allowed"
|
|
3514
|
+
}
|
|
3515
|
+
], {
|
|
3516
|
+
normalizer: twMergeNormalize,
|
|
3517
|
+
vtagsNormaliser: (tags) => exclusiveTagsNormalize(mainTagNormalize(tags, "A"), new Set([
|
|
3518
|
+
"SM",
|
|
3519
|
+
"BASE",
|
|
3520
|
+
"LG"
|
|
3521
|
+
]), "BASE")
|
|
3522
|
+
});
|
|
3523
|
+
|
|
3524
|
+
//#endregion
|
|
3525
|
+
//#region src/stylers/Stylers.ts
|
|
3526
|
+
var Stylers = class {
|
|
3527
|
+
static _base;
|
|
3528
|
+
static _stylersMap = /* @__PURE__ */ new Map();
|
|
3529
|
+
static get base() {
|
|
3530
|
+
return this._base;
|
|
3531
|
+
}
|
|
3532
|
+
static setBase(base) {
|
|
3533
|
+
return this._base = base;
|
|
3534
|
+
}
|
|
3535
|
+
static {
|
|
3536
|
+
this._stylersMap.set("default", baseStyler);
|
|
3537
|
+
this.setBase(baseStyler);
|
|
3538
|
+
}
|
|
3539
|
+
static get(name) {
|
|
3540
|
+
return this._stylersMap.get(name);
|
|
3541
|
+
}
|
|
3542
|
+
};
|
|
3543
|
+
|
|
3544
|
+
//#endregion
|
|
3545
|
+
//#region src/items/Item.tsx
|
|
3546
|
+
var _tmpl$$1 = /* @__PURE__ */ template(`<div>`);
|
|
3547
|
+
const Item = (props) => {
|
|
3548
|
+
const itemData = () => {
|
|
3549
|
+
const r = buildIdLabel(props.idLabel);
|
|
3550
|
+
if (props.selected) r.label = `[${r.label}]`;
|
|
3551
|
+
return r;
|
|
3552
|
+
};
|
|
3553
|
+
const currentSTags = () => {
|
|
3554
|
+
const r = [];
|
|
3555
|
+
r.push("item");
|
|
3556
|
+
if (props.selected) r.push("item:selected");
|
|
3557
|
+
if (props.disabled) r.push("item:disabled");
|
|
3558
|
+
return r;
|
|
3559
|
+
};
|
|
3560
|
+
const currentStyler = () => {
|
|
3561
|
+
if (props.styler) return props.styler;
|
|
3562
|
+
else return Stylers.base;
|
|
3563
|
+
};
|
|
3564
|
+
const classProp = createMemo(() => {
|
|
3565
|
+
if (props.class == void 0) return {};
|
|
3566
|
+
else if (typeof props.class == "string") return { item: props.class };
|
|
3567
|
+
else return props.class;
|
|
3568
|
+
});
|
|
3569
|
+
const itemClasses = () => {
|
|
3570
|
+
const stags = currentSTags();
|
|
3571
|
+
const styler = currentStyler();
|
|
3572
|
+
const rawClasses = [];
|
|
3573
|
+
const stylerClasses = styler ? styler.classes(stags, props.vtags) : void 0;
|
|
3574
|
+
rawClasses.push(...stylerClasses ?? []);
|
|
3575
|
+
if (props.callback) rawClasses.push("select-none cursor-pointer");
|
|
3576
|
+
const customClasses = classProp();
|
|
3577
|
+
if (customClasses.item) rawClasses.push(customClasses.item);
|
|
3578
|
+
if (props.selected && customClasses.selected) rawClasses.push(customClasses.selected);
|
|
3579
|
+
if (props.disabled && customClasses.disabled) rawClasses.push(customClasses.disabled);
|
|
3580
|
+
rawClasses.push("relative");
|
|
3581
|
+
return twMerge(rawClasses);
|
|
3582
|
+
};
|
|
3583
|
+
const disablerClasses = createMemo(() => {
|
|
3584
|
+
const rawClasses = [];
|
|
3585
|
+
if (currentStyler()) rawClasses.push(...currentStyler().classes("item/disabler", props.vtags));
|
|
3586
|
+
if (classProp().disabler) rawClasses.push(classProp().disabler);
|
|
3587
|
+
rawClasses.push("absolute inset-0");
|
|
3588
|
+
return twMerge(rawClasses);
|
|
3589
|
+
});
|
|
3590
|
+
function handleClick() {
|
|
3591
|
+
if (props.callback != void 0) props.callback(itemData());
|
|
3592
|
+
}
|
|
3593
|
+
return (() => {
|
|
3594
|
+
var _el$ = _tmpl$$1();
|
|
3595
|
+
_el$.$$click = handleClick;
|
|
3596
|
+
insert(_el$, () => itemData().label, null);
|
|
3597
|
+
insert(_el$, createComponent(Show, {
|
|
3598
|
+
get when() {
|
|
3599
|
+
return props.disabled;
|
|
3600
|
+
},
|
|
3601
|
+
get children() {
|
|
3602
|
+
var _el$2 = _tmpl$$1();
|
|
3603
|
+
_el$2.$$click = (e) => {
|
|
3604
|
+
if (!props.clickableWhendisabled) e.stopPropagation();
|
|
3605
|
+
};
|
|
3606
|
+
createRenderEffect(() => className(_el$2, disablerClasses()));
|
|
3607
|
+
return _el$2;
|
|
3608
|
+
}
|
|
3609
|
+
}), null);
|
|
3610
|
+
createRenderEffect(() => className(_el$, itemClasses()));
|
|
3611
|
+
return _el$;
|
|
3612
|
+
})();
|
|
3613
|
+
};
|
|
3614
|
+
delegateEvents(["click"]);
|
|
3615
|
+
|
|
3616
|
+
//#endregion
|
|
3617
|
+
//#region src/Block.tsx
|
|
3618
|
+
const Block = (props) => {
|
|
3619
|
+
const elementTag = () => props.element ?? "div";
|
|
3620
|
+
const currentStyler = () => {
|
|
3621
|
+
if (props.styler) return props.styler;
|
|
3622
|
+
else return Stylers.base;
|
|
3623
|
+
};
|
|
3624
|
+
function blockClasses() {
|
|
3625
|
+
const classes = currentStyler().classes("block", props.vtags) ?? [];
|
|
3626
|
+
if (props.class) classes.push(props.class);
|
|
3627
|
+
return twMerge(classes);
|
|
3628
|
+
}
|
|
3629
|
+
return createComponent(Dynamic, {
|
|
3630
|
+
get component() {
|
|
3631
|
+
return elementTag();
|
|
3632
|
+
},
|
|
3633
|
+
get ["class"]() {
|
|
3634
|
+
return blockClasses();
|
|
3635
|
+
},
|
|
3636
|
+
get children() {
|
|
3637
|
+
return props.children;
|
|
3638
|
+
}
|
|
3639
|
+
});
|
|
3640
|
+
};
|
|
3641
|
+
|
|
3642
|
+
//#endregion
|
|
3643
|
+
//#region src/items/ItemGroup.tsx
|
|
3644
|
+
const ItemGroup = (props) => {
|
|
3645
|
+
const items = () => props.items.map(buildIdLabel);
|
|
3646
|
+
createEffect(() => {
|
|
3647
|
+
console.log("GROUP ITEMS", items());
|
|
3648
|
+
});
|
|
3649
|
+
const currentVTags = createMemo(() => {
|
|
3650
|
+
const item = [];
|
|
3651
|
+
const group = [];
|
|
3652
|
+
const _vtags = props.vtags;
|
|
3653
|
+
if (Array.isArray(_vtags) || typeof _vtags == "string") group.push(...argTokenizeBySpaces(_vtags));
|
|
3654
|
+
else if (typeof _vtags == "object" && _vtags != null) {
|
|
3655
|
+
group.push(...argTokenizeBySpaces(_vtags.group));
|
|
3656
|
+
item.push(...argTokenizeBySpaces(_vtags.item));
|
|
3657
|
+
}
|
|
3658
|
+
return {
|
|
3659
|
+
group,
|
|
3660
|
+
item
|
|
3661
|
+
};
|
|
3662
|
+
});
|
|
3663
|
+
const classes = createMemo(() => {
|
|
3664
|
+
let group = "";
|
|
3665
|
+
let item = "";
|
|
3666
|
+
if (typeof props.class == "string") group = props.class;
|
|
3667
|
+
else if (props.class != void 0) {
|
|
3668
|
+
props.class;
|
|
3669
|
+
group = props.class.group ?? "";
|
|
3670
|
+
item = props.class.item ?? "";
|
|
3671
|
+
}
|
|
3672
|
+
return {
|
|
3673
|
+
group,
|
|
3674
|
+
item
|
|
3675
|
+
};
|
|
3676
|
+
});
|
|
3677
|
+
const blockClasses = () => {
|
|
3678
|
+
return twMerge("flex flex-row gap-1", classes().group);
|
|
3679
|
+
};
|
|
3680
|
+
const itemClasses = () => {
|
|
3681
|
+
return classes().item;
|
|
3682
|
+
};
|
|
3683
|
+
const callCallback = (item) => {
|
|
3684
|
+
if (props.callback) props.callback(item);
|
|
3685
|
+
};
|
|
3686
|
+
const itemSelected = (id) => {
|
|
3687
|
+
if (typeof props.selection == "string") return id == props.selection;
|
|
3688
|
+
else if (typeof props.selection == "object") return !!props.selection[id];
|
|
3689
|
+
return false;
|
|
3690
|
+
};
|
|
3691
|
+
return createComponent(Block, {
|
|
3692
|
+
get ["class"]() {
|
|
3693
|
+
return blockClasses();
|
|
3694
|
+
},
|
|
3695
|
+
get vtags() {
|
|
3696
|
+
return currentVTags().group;
|
|
3697
|
+
},
|
|
3698
|
+
get children() {
|
|
3699
|
+
return createComponent(For, {
|
|
3700
|
+
get each() {
|
|
3701
|
+
return items();
|
|
3702
|
+
},
|
|
3703
|
+
children: (item) => {
|
|
3704
|
+
const selected = () => itemSelected(item.id);
|
|
3705
|
+
return createComponent(Item, {
|
|
3706
|
+
idLabel: item,
|
|
3707
|
+
get selected() {
|
|
3708
|
+
return selected();
|
|
3709
|
+
},
|
|
3710
|
+
callback: () => callCallback(item),
|
|
3711
|
+
get ["class"]() {
|
|
3712
|
+
return itemClasses();
|
|
3713
|
+
},
|
|
3714
|
+
get vtags() {
|
|
3715
|
+
return currentVTags().item;
|
|
3716
|
+
}
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
});
|
|
3720
|
+
}
|
|
3721
|
+
});
|
|
3722
|
+
};
|
|
3723
|
+
|
|
3724
|
+
//#endregion
|
|
3725
|
+
//#region src/soltw.tsx
|
|
3726
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div class=bg-red-600>- - S O L T W - -`);
|
|
3727
|
+
const SolTw = (props) => {
|
|
3728
|
+
return _tmpl$();
|
|
3729
|
+
};
|
|
3730
|
+
|
|
3731
|
+
//#endregion
|
|
12
3732
|
export { Block, Item, ItemGroup, SVTStyler, SolTw, Stylers, baseStyler, buildIdLabel, exclusiveTagsNormalize, mainTagNormalize, tagRuleMatches, twMergeNormalize };
|