@meissa_a/meissa 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +350 -0
- package/dist/apps/app-generator.d.ts +30 -0
- package/dist/apps/index.d.ts +25 -0
- package/dist/apps/postmessage.d.ts +24 -0
- package/dist/apps/template.d.ts +10 -0
- package/dist/apps/types.d.ts +107 -0
- package/dist/apps.cjs +687 -0
- package/dist/apps.js +645 -0
- package/dist/client/component.d.ts +17 -0
- package/dist/client/content.d.ts +12 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/patch.d.ts +6 -0
- package/dist/client/renderer.d.ts +43 -0
- package/dist/client/types.d.ts +52 -0
- package/dist/client.cjs +3558 -0
- package/dist/client.js +3524 -0
- package/dist/renderer/ComponentRenderer.d.ts +11 -0
- package/dist/renderer/MeissaRenderer.d.ts +8 -0
- package/dist/renderer/components/Alert.d.ts +2 -0
- package/dist/renderer/components/Badge.d.ts +2 -0
- package/dist/renderer/components/Btn.d.ts +2 -0
- package/dist/renderer/components/Card.d.ts +2 -0
- package/dist/renderer/components/Chart.d.ts +2 -0
- package/dist/renderer/components/Code.d.ts +2 -0
- package/dist/renderer/components/Col.d.ts +2 -0
- package/dist/renderer/components/Divider.d.ts +2 -0
- package/dist/renderer/components/Form.d.ts +2 -0
- package/dist/renderer/components/Grid.d.ts +2 -0
- package/dist/renderer/components/Heading.d.ts +2 -0
- package/dist/renderer/components/Img.d.ts +2 -0
- package/dist/renderer/components/Input.d.ts +2 -0
- package/dist/renderer/components/List.d.ts +2 -0
- package/dist/renderer/components/Progress.d.ts +2 -0
- package/dist/renderer/components/Row.d.ts +2 -0
- package/dist/renderer/components/Select.d.ts +2 -0
- package/dist/renderer/components/Split.d.ts +2 -0
- package/dist/renderer/components/Stat.d.ts +2 -0
- package/dist/renderer/components/Table.d.ts +2 -0
- package/dist/renderer/components/Tabs.d.ts +2 -0
- package/dist/renderer/components/Text.d.ts +2 -0
- package/dist/renderer/components/index.d.ts +2 -0
- package/dist/renderer/context/ActionContext.d.ts +3 -0
- package/dist/renderer/context/DataContext.d.ts +3 -0
- package/dist/renderer/context/FormContext.d.ts +10 -0
- package/dist/renderer/core/binder.d.ts +17 -0
- package/dist/renderer/core/evaluator.d.ts +13 -0
- package/dist/renderer/core/iterator.d.ts +10 -0
- package/dist/renderer/core/normalizer.d.ts +5 -0
- package/dist/renderer/core/parser.d.ts +8 -0
- package/dist/renderer/core/resolver.d.ts +6 -0
- package/dist/renderer/core/types.d.ts +68 -0
- package/dist/renderer/index.d.ts +7 -0
- package/dist/renderer/utils/cn.d.ts +2 -0
- package/dist/renderer/utils/filters.d.ts +8 -0
- package/dist/renderer/utils/sanitize.d.ts +9 -0
- package/dist/renderer.cjs +3273 -0
- package/dist/renderer.js +3239 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/markdown.d.ts +9 -0
- package/dist/server/server.d.ts +39 -0
- package/dist/server/types.d.ts +56 -0
- package/dist/server/validator.d.ts +5 -0
- package/dist/server.cjs +345 -0
- package/dist/server.js +303 -0
- package/package.json +84 -0
|
@@ -0,0 +1,3273 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
8
|
+
var __toCommonJS = (from) => {
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
10
|
+
if (entry)
|
|
11
|
+
return entry;
|
|
12
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
__moduleCache.set(from, entry);
|
|
22
|
+
return entry;
|
|
23
|
+
};
|
|
24
|
+
var __moduleCache;
|
|
25
|
+
var __returnValue = (v) => v;
|
|
26
|
+
function __exportSetter(name, newValue) {
|
|
27
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
28
|
+
}
|
|
29
|
+
var __export = (target, all) => {
|
|
30
|
+
for (var name in all)
|
|
31
|
+
__defProp(target, name, {
|
|
32
|
+
get: all[name],
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
set: __exportSetter.bind(all, name)
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/renderer/index.ts
|
|
40
|
+
var exports_renderer = {};
|
|
41
|
+
__export(exports_renderer, {
|
|
42
|
+
resolveBindings: () => resolveBindings,
|
|
43
|
+
parse: () => parse,
|
|
44
|
+
normalize: () => normalize,
|
|
45
|
+
MeissaRenderer: () => MeissaRenderer,
|
|
46
|
+
ComponentRenderer: () => ComponentRenderer,
|
|
47
|
+
COMPONENT_REGISTRY: () => COMPONENT_REGISTRY
|
|
48
|
+
});
|
|
49
|
+
module.exports = __toCommonJS(exports_renderer);
|
|
50
|
+
|
|
51
|
+
// src/renderer/MeissaRenderer.tsx
|
|
52
|
+
var import_react13 = require("react");
|
|
53
|
+
|
|
54
|
+
// src/renderer/core/normalizer.ts
|
|
55
|
+
var PRIMARY_PROPS = {
|
|
56
|
+
text: "content",
|
|
57
|
+
heading: "content",
|
|
58
|
+
code: "content",
|
|
59
|
+
btn: "label",
|
|
60
|
+
badge: "content",
|
|
61
|
+
alert: "content",
|
|
62
|
+
img: "src",
|
|
63
|
+
progress: "value",
|
|
64
|
+
list: "items",
|
|
65
|
+
stat: "value",
|
|
66
|
+
input: "name",
|
|
67
|
+
select: "options",
|
|
68
|
+
table: "data",
|
|
69
|
+
chart: "data",
|
|
70
|
+
card: "title",
|
|
71
|
+
tabs: "items",
|
|
72
|
+
form: "submit"
|
|
73
|
+
};
|
|
74
|
+
var DEFAULTS = {
|
|
75
|
+
text: { variant: "default", bold: false, align: "left" },
|
|
76
|
+
heading: { level: 2, align: "left" },
|
|
77
|
+
btn: { variant: "primary", size: "md", disabled: false },
|
|
78
|
+
input: { type: "text", required: false, disabled: false },
|
|
79
|
+
table: { sortable: true },
|
|
80
|
+
chart: { type: "line", legend: true, h: 256 },
|
|
81
|
+
stat: { variant: "default" },
|
|
82
|
+
alert: { variant: "info", dismissible: false },
|
|
83
|
+
badge: { variant: "default" },
|
|
84
|
+
progress: { value: 0, indeterminate: false },
|
|
85
|
+
card: { variant: "default", padding: 4 },
|
|
86
|
+
row: { gap: 4, align: "center", wrap: true },
|
|
87
|
+
col: { gap: 4, align: "stretch" },
|
|
88
|
+
grid: { cols: 2, gap: 4 },
|
|
89
|
+
split: { ratio: "1:1", gap: 4 }
|
|
90
|
+
};
|
|
91
|
+
var CONTAINERS = new Set(["row", "col", "grid", "split", "card", "form", "fragment"]);
|
|
92
|
+
function normalize(input) {
|
|
93
|
+
if (Array.isArray(input)) {
|
|
94
|
+
return normalizeTuple(input);
|
|
95
|
+
}
|
|
96
|
+
if (typeof input === "object" && input !== null) {
|
|
97
|
+
return normalizeObject(input);
|
|
98
|
+
}
|
|
99
|
+
return { type: "text", content: `[Invalid node]` };
|
|
100
|
+
}
|
|
101
|
+
function normalizeTuple(tuple) {
|
|
102
|
+
const type = tuple[0];
|
|
103
|
+
if (!type || typeof type !== "string") {
|
|
104
|
+
return { type: "text", content: "[Invalid: missing type]" };
|
|
105
|
+
}
|
|
106
|
+
if (type === "switch") {
|
|
107
|
+
return normalizeSwitch(tuple);
|
|
108
|
+
}
|
|
109
|
+
if (type === "each") {
|
|
110
|
+
return normalizeEach(tuple);
|
|
111
|
+
}
|
|
112
|
+
if (type === "ref") {
|
|
113
|
+
return { type: "ref", name: tuple[1] };
|
|
114
|
+
}
|
|
115
|
+
const node = { type };
|
|
116
|
+
const second = tuple[1];
|
|
117
|
+
const third = tuple[2];
|
|
118
|
+
if (tuple.length === 1) {} else if (tuple.length === 2) {
|
|
119
|
+
assignSecond(node, type, second);
|
|
120
|
+
} else if (tuple.length >= 3) {
|
|
121
|
+
assignSecond(node, type, second);
|
|
122
|
+
if (Array.isArray(third)) {
|
|
123
|
+
node.children = normalizeChildren(third);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
applyDefaults(node);
|
|
127
|
+
return node;
|
|
128
|
+
}
|
|
129
|
+
function assignSecond(node, type, second) {
|
|
130
|
+
if (second === null || second === undefined) {
|
|
131
|
+
const primaryProp = PRIMARY_PROPS[type];
|
|
132
|
+
if (primaryProp) {
|
|
133
|
+
node[primaryProp] = null;
|
|
134
|
+
}
|
|
135
|
+
} else if (typeof second === "string" || typeof second === "number" || typeof second === "boolean") {
|
|
136
|
+
const primaryProp = PRIMARY_PROPS[type];
|
|
137
|
+
if (primaryProp) {
|
|
138
|
+
node[primaryProp] = second;
|
|
139
|
+
}
|
|
140
|
+
} else if (Array.isArray(second)) {
|
|
141
|
+
if (second.length > 0 && Array.isArray(second[0])) {
|
|
142
|
+
node.children = normalizeChildren(second);
|
|
143
|
+
} else {
|
|
144
|
+
const primaryProp = PRIMARY_PROPS[type];
|
|
145
|
+
if (primaryProp) {
|
|
146
|
+
node[primaryProp] = second;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
} else if (typeof second === "object") {
|
|
150
|
+
const obj = second;
|
|
151
|
+
if ("type" in obj && typeof obj.type === "string") {
|
|
152
|
+
Object.assign(node, obj);
|
|
153
|
+
node.type = type;
|
|
154
|
+
} else {
|
|
155
|
+
if (type === "tabs" && !("items" in obj)) {
|
|
156
|
+
const hasTabContent = Object.values(obj).some((v) => Array.isArray(v));
|
|
157
|
+
if (hasTabContent) {
|
|
158
|
+
node.items = obj;
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
Object.assign(node, obj);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function normalizeSwitch(tuple) {
|
|
167
|
+
const binding = tuple[1];
|
|
168
|
+
const cases = tuple[2];
|
|
169
|
+
const normalizedCases = {};
|
|
170
|
+
if (cases && typeof cases === "object") {
|
|
171
|
+
for (const [key, value] of Object.entries(cases)) {
|
|
172
|
+
normalizedCases[key] = normalize(value);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return { type: "switch", binding, cases: normalizedCases };
|
|
176
|
+
}
|
|
177
|
+
function normalizeEach(tuple) {
|
|
178
|
+
const binding = tuple[1];
|
|
179
|
+
const template = tuple[2];
|
|
180
|
+
return {
|
|
181
|
+
type: "each",
|
|
182
|
+
binding,
|
|
183
|
+
template: normalize(template)
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function normalizeChildren(arr) {
|
|
187
|
+
const result = [];
|
|
188
|
+
for (const item of arr) {
|
|
189
|
+
if (item === null || item === undefined)
|
|
190
|
+
continue;
|
|
191
|
+
result.push(normalize(item));
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
}
|
|
195
|
+
function normalizeObject(obj) {
|
|
196
|
+
const node = { type: obj.type };
|
|
197
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
198
|
+
if (key === "children" && Array.isArray(value)) {
|
|
199
|
+
node.children = normalizeChildren(value);
|
|
200
|
+
} else {
|
|
201
|
+
node[key] = value;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
applyDefaults(node);
|
|
205
|
+
return node;
|
|
206
|
+
}
|
|
207
|
+
function applyDefaults(node) {
|
|
208
|
+
const defaults = DEFAULTS[node.type];
|
|
209
|
+
if (!defaults)
|
|
210
|
+
return;
|
|
211
|
+
for (const [key, value] of Object.entries(defaults)) {
|
|
212
|
+
if (!(key in node)) {
|
|
213
|
+
node[key] = value;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// src/renderer/core/resolver.ts
|
|
219
|
+
function resolveRefs(nodes, defs) {
|
|
220
|
+
if (Object.keys(defs).length === 0)
|
|
221
|
+
return nodes;
|
|
222
|
+
return nodes.map((node) => resolveNode(node, defs));
|
|
223
|
+
}
|
|
224
|
+
function resolveNode(node, defs) {
|
|
225
|
+
if (node.type === "ref") {
|
|
226
|
+
const name = node.name;
|
|
227
|
+
const def = defs[name];
|
|
228
|
+
if (def) {
|
|
229
|
+
return structuredClone(def);
|
|
230
|
+
}
|
|
231
|
+
return { type: "text", content: `[Unknown ref: ${name}]` };
|
|
232
|
+
}
|
|
233
|
+
if (node.children) {
|
|
234
|
+
node.children = node.children.map((child) => resolveNode(child, defs));
|
|
235
|
+
}
|
|
236
|
+
if (node.type === "each" && node.template) {
|
|
237
|
+
node.template = resolveNode(node.template, defs);
|
|
238
|
+
}
|
|
239
|
+
if (node.type === "switch" && node.cases) {
|
|
240
|
+
const cases = node.cases;
|
|
241
|
+
for (const key of Object.keys(cases)) {
|
|
242
|
+
cases[key] = resolveNode(cases[key], defs);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return node;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// src/renderer/core/parser.ts
|
|
249
|
+
function parse(input) {
|
|
250
|
+
if (isDocument(input)) {
|
|
251
|
+
const doc = input;
|
|
252
|
+
const defs = normalizeDefs(doc.defs);
|
|
253
|
+
const nodes = normalizeArray(doc.ui);
|
|
254
|
+
const resolved = resolveRefs(nodes, defs);
|
|
255
|
+
return {
|
|
256
|
+
nodes: resolved,
|
|
257
|
+
defs,
|
|
258
|
+
data: doc.data ?? {},
|
|
259
|
+
theme: doc.theme
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
if (Array.isArray(input) && input.length > 0) {
|
|
263
|
+
if (typeof input[0] === "string" && !Array.isArray(input[1]?.constructor === Array ? input[1] : null)) {
|
|
264
|
+
if (input.length <= 3 && isComponentType(input[0])) {
|
|
265
|
+
const node = normalize(input);
|
|
266
|
+
return { nodes: [node], defs: {}, data: {} };
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
const nodes = normalizeArray(input);
|
|
270
|
+
return { nodes, defs: {}, data: {} };
|
|
271
|
+
}
|
|
272
|
+
if (typeof input === "object" && input !== null && "type" in input) {
|
|
273
|
+
const node = normalize(input);
|
|
274
|
+
return { nodes: [node], defs: {}, data: {} };
|
|
275
|
+
}
|
|
276
|
+
return { nodes: [], defs: {}, data: {} };
|
|
277
|
+
}
|
|
278
|
+
function isDocument(input) {
|
|
279
|
+
return typeof input === "object" && input !== null && !Array.isArray(input) && "ui" in input && Array.isArray(input.ui);
|
|
280
|
+
}
|
|
281
|
+
function isComponentType(value) {
|
|
282
|
+
const types = new Set([
|
|
283
|
+
"text",
|
|
284
|
+
"heading",
|
|
285
|
+
"code",
|
|
286
|
+
"img",
|
|
287
|
+
"btn",
|
|
288
|
+
"input",
|
|
289
|
+
"select",
|
|
290
|
+
"form",
|
|
291
|
+
"table",
|
|
292
|
+
"list",
|
|
293
|
+
"chart",
|
|
294
|
+
"stat",
|
|
295
|
+
"card",
|
|
296
|
+
"tabs",
|
|
297
|
+
"alert",
|
|
298
|
+
"badge",
|
|
299
|
+
"progress",
|
|
300
|
+
"divider",
|
|
301
|
+
"row",
|
|
302
|
+
"col",
|
|
303
|
+
"grid",
|
|
304
|
+
"split",
|
|
305
|
+
"each",
|
|
306
|
+
"switch",
|
|
307
|
+
"ref",
|
|
308
|
+
"fragment"
|
|
309
|
+
]);
|
|
310
|
+
return types.has(value);
|
|
311
|
+
}
|
|
312
|
+
function normalizeArray(arr) {
|
|
313
|
+
const result = [];
|
|
314
|
+
for (const item of arr) {
|
|
315
|
+
if (item === null || item === undefined)
|
|
316
|
+
continue;
|
|
317
|
+
if (Array.isArray(item)) {
|
|
318
|
+
if (typeof item[0] === "string") {
|
|
319
|
+
result.push(normalize(item));
|
|
320
|
+
}
|
|
321
|
+
} else if (typeof item === "object" && "type" in item) {
|
|
322
|
+
result.push(normalize(item));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return result;
|
|
326
|
+
}
|
|
327
|
+
function normalizeDefs(defs) {
|
|
328
|
+
if (!defs)
|
|
329
|
+
return {};
|
|
330
|
+
const result = {};
|
|
331
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
332
|
+
result[name] = normalize(def);
|
|
333
|
+
}
|
|
334
|
+
return result;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// src/renderer/context/DataContext.tsx
|
|
338
|
+
var import_react = require("react");
|
|
339
|
+
var DataContext = import_react.createContext({
|
|
340
|
+
data: {},
|
|
341
|
+
root: {}
|
|
342
|
+
});
|
|
343
|
+
var DataProvider = DataContext.Provider;
|
|
344
|
+
function useData() {
|
|
345
|
+
return import_react.useContext(DataContext);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// src/renderer/context/ActionContext.tsx
|
|
349
|
+
var import_react2 = require("react");
|
|
350
|
+
var noop = () => {};
|
|
351
|
+
var ActionContext = import_react2.createContext({
|
|
352
|
+
onAction: noop,
|
|
353
|
+
onNavigate: noop
|
|
354
|
+
});
|
|
355
|
+
var ActionProvider = ActionContext.Provider;
|
|
356
|
+
function useAction() {
|
|
357
|
+
return import_react2.useContext(ActionContext);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/renderer/ComponentRenderer.tsx
|
|
361
|
+
var import_react12 = require("react");
|
|
362
|
+
|
|
363
|
+
// src/renderer/utils/filters.ts
|
|
364
|
+
var filters = {
|
|
365
|
+
currency(value) {
|
|
366
|
+
const num = Number(value);
|
|
367
|
+
if (isNaN(num))
|
|
368
|
+
return value;
|
|
369
|
+
return new Intl.NumberFormat("en-US", {
|
|
370
|
+
style: "currency",
|
|
371
|
+
currency: "USD"
|
|
372
|
+
}).format(num);
|
|
373
|
+
},
|
|
374
|
+
percent(value) {
|
|
375
|
+
const num = Number(value);
|
|
376
|
+
if (isNaN(num))
|
|
377
|
+
return value;
|
|
378
|
+
const pct = num <= 1 && num >= 0 ? num * 100 : num;
|
|
379
|
+
return `${Math.round(pct)}%`;
|
|
380
|
+
},
|
|
381
|
+
number(value) {
|
|
382
|
+
const num = Number(value);
|
|
383
|
+
if (isNaN(num))
|
|
384
|
+
return value;
|
|
385
|
+
return new Intl.NumberFormat("en-US").format(num);
|
|
386
|
+
},
|
|
387
|
+
relative(value) {
|
|
388
|
+
if (!value)
|
|
389
|
+
return "";
|
|
390
|
+
const date = new Date(value);
|
|
391
|
+
if (isNaN(date.getTime()))
|
|
392
|
+
return String(value);
|
|
393
|
+
const now = Date.now();
|
|
394
|
+
const diff = now - date.getTime();
|
|
395
|
+
const seconds = Math.floor(diff / 1000);
|
|
396
|
+
const minutes = Math.floor(seconds / 60);
|
|
397
|
+
const hours = Math.floor(minutes / 60);
|
|
398
|
+
const days = Math.floor(hours / 24);
|
|
399
|
+
const months = Math.floor(days / 30);
|
|
400
|
+
const years = Math.floor(days / 365);
|
|
401
|
+
if (seconds < 60)
|
|
402
|
+
return "just now";
|
|
403
|
+
if (minutes < 60)
|
|
404
|
+
return `${minutes} minute${minutes > 1 ? "s" : ""} ago`;
|
|
405
|
+
if (hours < 24)
|
|
406
|
+
return `${hours} hour${hours > 1 ? "s" : ""} ago`;
|
|
407
|
+
if (days < 30)
|
|
408
|
+
return `${days} day${days > 1 ? "s" : ""} ago`;
|
|
409
|
+
if (months < 12)
|
|
410
|
+
return `${months} month${months > 1 ? "s" : ""} ago`;
|
|
411
|
+
return `${years} year${years > 1 ? "s" : ""} ago`;
|
|
412
|
+
},
|
|
413
|
+
date(value, format) {
|
|
414
|
+
if (!value)
|
|
415
|
+
return "";
|
|
416
|
+
const date = new Date(value);
|
|
417
|
+
if (isNaN(date.getTime()))
|
|
418
|
+
return String(value);
|
|
419
|
+
switch (format) {
|
|
420
|
+
case "short":
|
|
421
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
422
|
+
case "long":
|
|
423
|
+
return date.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
|
|
424
|
+
case "iso":
|
|
425
|
+
return date.toISOString().split("T")[0];
|
|
426
|
+
case "time":
|
|
427
|
+
return date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
428
|
+
case "datetime":
|
|
429
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" }) + " " + date.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
430
|
+
default:
|
|
431
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
uppercase(value) {
|
|
435
|
+
return typeof value === "string" ? value.toUpperCase() : value;
|
|
436
|
+
},
|
|
437
|
+
lowercase(value) {
|
|
438
|
+
return typeof value === "string" ? value.toLowerCase() : value;
|
|
439
|
+
},
|
|
440
|
+
truncate(value, arg) {
|
|
441
|
+
if (typeof value !== "string")
|
|
442
|
+
return value;
|
|
443
|
+
const max = parseInt(arg || "50", 10);
|
|
444
|
+
if (value.length <= max)
|
|
445
|
+
return value;
|
|
446
|
+
return value.slice(0, max) + "...";
|
|
447
|
+
},
|
|
448
|
+
default(value, arg) {
|
|
449
|
+
if (value === null || value === undefined || value === "") {
|
|
450
|
+
if (arg && arg.startsWith('"') && arg.endsWith('"')) {
|
|
451
|
+
return arg.slice(1, -1);
|
|
452
|
+
}
|
|
453
|
+
if (arg && /^-?\d+(\.\d+)?$/.test(arg)) {
|
|
454
|
+
return Number(arg);
|
|
455
|
+
}
|
|
456
|
+
return arg ?? "";
|
|
457
|
+
}
|
|
458
|
+
return value;
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
function applyFilter(filterExpr, value) {
|
|
462
|
+
const colonIdx = filterExpr.indexOf(":");
|
|
463
|
+
const name = colonIdx >= 0 ? filterExpr.slice(0, colonIdx) : filterExpr;
|
|
464
|
+
const arg = colonIdx >= 0 ? filterExpr.slice(colonIdx + 1) : undefined;
|
|
465
|
+
const fn = filters[name];
|
|
466
|
+
if (!fn)
|
|
467
|
+
return value;
|
|
468
|
+
return fn(value, arg);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// src/renderer/core/binder.ts
|
|
472
|
+
function resolveBindings(template, data) {
|
|
473
|
+
if (typeof template !== "string")
|
|
474
|
+
return template;
|
|
475
|
+
if (!template.includes("{{"))
|
|
476
|
+
return template;
|
|
477
|
+
const exactMatch = template.match(/^\{\{(.+?)\}\}$/);
|
|
478
|
+
if (exactMatch) {
|
|
479
|
+
return resolveExpression(exactMatch[1], data);
|
|
480
|
+
}
|
|
481
|
+
return template.replace(/\{\{(.+?)\}\}/g, (_, expr) => {
|
|
482
|
+
const result = resolveExpression(expr, data);
|
|
483
|
+
return result == null ? "" : String(result);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
function resolveExpression(expr, data) {
|
|
487
|
+
const parts = expr.split("|").map((s) => s.trim());
|
|
488
|
+
const path = parts[0];
|
|
489
|
+
const filters2 = parts.slice(1);
|
|
490
|
+
if (hasComparison(path)) {
|
|
491
|
+
return evaluateComparison(path, data);
|
|
492
|
+
}
|
|
493
|
+
let value = resolvePath(path, data);
|
|
494
|
+
for (const filter of filters2) {
|
|
495
|
+
value = applyFilter(filter, value);
|
|
496
|
+
}
|
|
497
|
+
return value;
|
|
498
|
+
}
|
|
499
|
+
function resolvePath(path, data) {
|
|
500
|
+
if (!path)
|
|
501
|
+
return;
|
|
502
|
+
if (path.startsWith("!")) {
|
|
503
|
+
const value = resolvePath(path.slice(1), data);
|
|
504
|
+
return !isTruthy(value);
|
|
505
|
+
}
|
|
506
|
+
const segments = parsePath(path);
|
|
507
|
+
let current = data;
|
|
508
|
+
for (const segment of segments) {
|
|
509
|
+
if (current === null || current === undefined)
|
|
510
|
+
return;
|
|
511
|
+
if (typeof current === "object") {
|
|
512
|
+
current = current[segment];
|
|
513
|
+
} else {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
return current;
|
|
518
|
+
}
|
|
519
|
+
function parsePath(path) {
|
|
520
|
+
const segments = [];
|
|
521
|
+
let current = "";
|
|
522
|
+
for (let i = 0;i < path.length; i++) {
|
|
523
|
+
const char = path[i];
|
|
524
|
+
if (char === ".") {
|
|
525
|
+
if (current)
|
|
526
|
+
segments.push(current);
|
|
527
|
+
current = "";
|
|
528
|
+
} else if (char === "[") {
|
|
529
|
+
if (current)
|
|
530
|
+
segments.push(current);
|
|
531
|
+
current = "";
|
|
532
|
+
} else if (char === "]") {
|
|
533
|
+
if (current)
|
|
534
|
+
segments.push(current);
|
|
535
|
+
current = "";
|
|
536
|
+
} else {
|
|
537
|
+
current += char;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
if (current)
|
|
541
|
+
segments.push(current);
|
|
542
|
+
return segments;
|
|
543
|
+
}
|
|
544
|
+
function hasComparison(expr) {
|
|
545
|
+
return /\s*(==|!=|<=|>=|<|>)\s*/.test(expr);
|
|
546
|
+
}
|
|
547
|
+
function evaluateComparison(expr, data) {
|
|
548
|
+
const match = expr.match(/^(.+?)\s*(==|!=|<=|>=|<|>)\s*(.+)$/);
|
|
549
|
+
if (!match)
|
|
550
|
+
return false;
|
|
551
|
+
const [, leftExpr, op, rightExpr] = match;
|
|
552
|
+
const left = resolveOperand(leftExpr.trim(), data);
|
|
553
|
+
const right = resolveOperand(rightExpr.trim(), data);
|
|
554
|
+
switch (op) {
|
|
555
|
+
case "==":
|
|
556
|
+
return left == right;
|
|
557
|
+
case "!=":
|
|
558
|
+
return left != right;
|
|
559
|
+
case "<":
|
|
560
|
+
return Number(left) < Number(right);
|
|
561
|
+
case ">":
|
|
562
|
+
return Number(left) > Number(right);
|
|
563
|
+
case "<=":
|
|
564
|
+
return Number(left) <= Number(right);
|
|
565
|
+
case ">=":
|
|
566
|
+
return Number(left) >= Number(right);
|
|
567
|
+
default:
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function resolveOperand(expr, data) {
|
|
572
|
+
if (expr.startsWith("'") && expr.endsWith("'") || expr.startsWith('"') && expr.endsWith('"')) {
|
|
573
|
+
return expr.slice(1, -1);
|
|
574
|
+
}
|
|
575
|
+
if (/^-?\d+(\.\d+)?$/.test(expr)) {
|
|
576
|
+
return Number(expr);
|
|
577
|
+
}
|
|
578
|
+
if (expr === "true")
|
|
579
|
+
return true;
|
|
580
|
+
if (expr === "false")
|
|
581
|
+
return false;
|
|
582
|
+
if (expr === "null")
|
|
583
|
+
return null;
|
|
584
|
+
return resolvePath(expr, data);
|
|
585
|
+
}
|
|
586
|
+
function isTruthy(value) {
|
|
587
|
+
if (value === null || value === undefined)
|
|
588
|
+
return false;
|
|
589
|
+
if (value === false)
|
|
590
|
+
return false;
|
|
591
|
+
if (value === 0)
|
|
592
|
+
return false;
|
|
593
|
+
if (value === "")
|
|
594
|
+
return false;
|
|
595
|
+
if (Array.isArray(value) && value.length === 0)
|
|
596
|
+
return false;
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// src/renderer/core/evaluator.ts
|
|
601
|
+
function evaluate(node, data) {
|
|
602
|
+
if (node.type === "switch") {
|
|
603
|
+
return evaluateSwitch(node, data);
|
|
604
|
+
}
|
|
605
|
+
if (node.if !== undefined) {
|
|
606
|
+
const value = resolveBindings(node.if, data);
|
|
607
|
+
const negated = typeof node.if === "string" && node.if.startsWith("!{{");
|
|
608
|
+
const truthy = negated ? value : isTruthy(value);
|
|
609
|
+
if (!truthy) {
|
|
610
|
+
return { node: null, hidden: false };
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
let hidden = false;
|
|
614
|
+
if (node.show !== undefined) {
|
|
615
|
+
const value = resolveBindings(node.show, data);
|
|
616
|
+
if (!isTruthy(value)) {
|
|
617
|
+
hidden = true;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
return { node, hidden };
|
|
621
|
+
}
|
|
622
|
+
function evaluateSwitch(node, data) {
|
|
623
|
+
const binding = node.binding;
|
|
624
|
+
const cases = node.cases;
|
|
625
|
+
if (!binding || !cases) {
|
|
626
|
+
return { node: null, hidden: false };
|
|
627
|
+
}
|
|
628
|
+
const value = resolveBindings(binding, data);
|
|
629
|
+
const key = String(value);
|
|
630
|
+
if (key in cases) {
|
|
631
|
+
return { node: cases[key], hidden: false };
|
|
632
|
+
}
|
|
633
|
+
if ("_" in cases) {
|
|
634
|
+
return { node: cases["_"], hidden: false };
|
|
635
|
+
}
|
|
636
|
+
return { node: null, hidden: false };
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
// src/renderer/core/iterator.ts
|
|
640
|
+
function expandEach(node, data) {
|
|
641
|
+
const binding = node.binding;
|
|
642
|
+
const template = node.template;
|
|
643
|
+
if (!binding || !template)
|
|
644
|
+
return [];
|
|
645
|
+
const items = resolveBindings(binding, data);
|
|
646
|
+
if (!Array.isArray(items))
|
|
647
|
+
return [];
|
|
648
|
+
return items.map((item, index) => ({
|
|
649
|
+
node: template,
|
|
650
|
+
data: {
|
|
651
|
+
...data,
|
|
652
|
+
$: item,
|
|
653
|
+
$i: index,
|
|
654
|
+
$first: index === 0,
|
|
655
|
+
$last: index === items.length - 1
|
|
656
|
+
}
|
|
657
|
+
}));
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
661
|
+
function r(e) {
|
|
662
|
+
var t, f, n = "";
|
|
663
|
+
if (typeof e == "string" || typeof e == "number")
|
|
664
|
+
n += e;
|
|
665
|
+
else if (typeof e == "object")
|
|
666
|
+
if (Array.isArray(e)) {
|
|
667
|
+
var o = e.length;
|
|
668
|
+
for (t = 0;t < o; t++)
|
|
669
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
670
|
+
} else
|
|
671
|
+
for (f in e)
|
|
672
|
+
e[f] && (n && (n += " "), n += f);
|
|
673
|
+
return n;
|
|
674
|
+
}
|
|
675
|
+
function clsx() {
|
|
676
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
677
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
678
|
+
return n;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// ../../node_modules/.bun/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
|
682
|
+
var CLASS_PART_SEPARATOR = "-";
|
|
683
|
+
var createClassGroupUtils = (config) => {
|
|
684
|
+
const classMap = createClassMap(config);
|
|
685
|
+
const {
|
|
686
|
+
conflictingClassGroups,
|
|
687
|
+
conflictingClassGroupModifiers
|
|
688
|
+
} = config;
|
|
689
|
+
const getClassGroupId = (className) => {
|
|
690
|
+
const classParts = className.split(CLASS_PART_SEPARATOR);
|
|
691
|
+
if (classParts[0] === "" && classParts.length !== 1) {
|
|
692
|
+
classParts.shift();
|
|
693
|
+
}
|
|
694
|
+
return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className);
|
|
695
|
+
};
|
|
696
|
+
const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
|
|
697
|
+
const conflicts = conflictingClassGroups[classGroupId] || [];
|
|
698
|
+
if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) {
|
|
699
|
+
return [...conflicts, ...conflictingClassGroupModifiers[classGroupId]];
|
|
700
|
+
}
|
|
701
|
+
return conflicts;
|
|
702
|
+
};
|
|
703
|
+
return {
|
|
704
|
+
getClassGroupId,
|
|
705
|
+
getConflictingClassGroupIds
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
var getGroupRecursive = (classParts, classPartObject) => {
|
|
709
|
+
if (classParts.length === 0) {
|
|
710
|
+
return classPartObject.classGroupId;
|
|
711
|
+
}
|
|
712
|
+
const currentClassPart = classParts[0];
|
|
713
|
+
const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
|
|
714
|
+
const classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined;
|
|
715
|
+
if (classGroupFromNextClassPart) {
|
|
716
|
+
return classGroupFromNextClassPart;
|
|
717
|
+
}
|
|
718
|
+
if (classPartObject.validators.length === 0) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
722
|
+
return classPartObject.validators.find(({
|
|
723
|
+
validator
|
|
724
|
+
}) => validator(classRest))?.classGroupId;
|
|
725
|
+
};
|
|
726
|
+
var arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
727
|
+
var getGroupIdForArbitraryProperty = (className) => {
|
|
728
|
+
if (arbitraryPropertyRegex.test(className)) {
|
|
729
|
+
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
730
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
731
|
+
if (property) {
|
|
732
|
+
return "arbitrary.." + property;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
var createClassMap = (config) => {
|
|
737
|
+
const {
|
|
738
|
+
theme,
|
|
739
|
+
prefix
|
|
740
|
+
} = config;
|
|
741
|
+
const classMap = {
|
|
742
|
+
nextPart: new Map,
|
|
743
|
+
validators: []
|
|
744
|
+
};
|
|
745
|
+
const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);
|
|
746
|
+
prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {
|
|
747
|
+
processClassesRecursively(classGroup, classMap, classGroupId, theme);
|
|
748
|
+
});
|
|
749
|
+
return classMap;
|
|
750
|
+
};
|
|
751
|
+
var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
|
|
752
|
+
classGroup.forEach((classDefinition) => {
|
|
753
|
+
if (typeof classDefinition === "string") {
|
|
754
|
+
const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
|
|
755
|
+
classPartObjectToEdit.classGroupId = classGroupId;
|
|
756
|
+
return;
|
|
757
|
+
}
|
|
758
|
+
if (typeof classDefinition === "function") {
|
|
759
|
+
if (isThemeGetter(classDefinition)) {
|
|
760
|
+
processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
classPartObject.validators.push({
|
|
764
|
+
validator: classDefinition,
|
|
765
|
+
classGroupId
|
|
766
|
+
});
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
Object.entries(classDefinition).forEach(([key, classGroup2]) => {
|
|
770
|
+
processClassesRecursively(classGroup2, getPart(classPartObject, key), classGroupId, theme);
|
|
771
|
+
});
|
|
772
|
+
});
|
|
773
|
+
};
|
|
774
|
+
var getPart = (classPartObject, path) => {
|
|
775
|
+
let currentClassPartObject = classPartObject;
|
|
776
|
+
path.split(CLASS_PART_SEPARATOR).forEach((pathPart) => {
|
|
777
|
+
if (!currentClassPartObject.nextPart.has(pathPart)) {
|
|
778
|
+
currentClassPartObject.nextPart.set(pathPart, {
|
|
779
|
+
nextPart: new Map,
|
|
780
|
+
validators: []
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);
|
|
784
|
+
});
|
|
785
|
+
return currentClassPartObject;
|
|
786
|
+
};
|
|
787
|
+
var isThemeGetter = (func) => func.isThemeGetter;
|
|
788
|
+
var getPrefixedClassGroupEntries = (classGroupEntries, prefix) => {
|
|
789
|
+
if (!prefix) {
|
|
790
|
+
return classGroupEntries;
|
|
791
|
+
}
|
|
792
|
+
return classGroupEntries.map(([classGroupId, classGroup]) => {
|
|
793
|
+
const prefixedClassGroup = classGroup.map((classDefinition) => {
|
|
794
|
+
if (typeof classDefinition === "string") {
|
|
795
|
+
return prefix + classDefinition;
|
|
796
|
+
}
|
|
797
|
+
if (typeof classDefinition === "object") {
|
|
798
|
+
return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));
|
|
799
|
+
}
|
|
800
|
+
return classDefinition;
|
|
801
|
+
});
|
|
802
|
+
return [classGroupId, prefixedClassGroup];
|
|
803
|
+
});
|
|
804
|
+
};
|
|
805
|
+
var createLruCache = (maxCacheSize) => {
|
|
806
|
+
if (maxCacheSize < 1) {
|
|
807
|
+
return {
|
|
808
|
+
get: () => {
|
|
809
|
+
return;
|
|
810
|
+
},
|
|
811
|
+
set: () => {}
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
let cacheSize = 0;
|
|
815
|
+
let cache = new Map;
|
|
816
|
+
let previousCache = new Map;
|
|
817
|
+
const update = (key, value) => {
|
|
818
|
+
cache.set(key, value);
|
|
819
|
+
cacheSize++;
|
|
820
|
+
if (cacheSize > maxCacheSize) {
|
|
821
|
+
cacheSize = 0;
|
|
822
|
+
previousCache = cache;
|
|
823
|
+
cache = new Map;
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
return {
|
|
827
|
+
get(key) {
|
|
828
|
+
let value = cache.get(key);
|
|
829
|
+
if (value !== undefined) {
|
|
830
|
+
return value;
|
|
831
|
+
}
|
|
832
|
+
if ((value = previousCache.get(key)) !== undefined) {
|
|
833
|
+
update(key, value);
|
|
834
|
+
return value;
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
set(key, value) {
|
|
838
|
+
if (cache.has(key)) {
|
|
839
|
+
cache.set(key, value);
|
|
840
|
+
} else {
|
|
841
|
+
update(key, value);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
};
|
|
846
|
+
var IMPORTANT_MODIFIER = "!";
|
|
847
|
+
var createParseClassName = (config) => {
|
|
848
|
+
const {
|
|
849
|
+
separator,
|
|
850
|
+
experimentalParseClassName
|
|
851
|
+
} = config;
|
|
852
|
+
const isSeparatorSingleCharacter = separator.length === 1;
|
|
853
|
+
const firstSeparatorCharacter = separator[0];
|
|
854
|
+
const separatorLength = separator.length;
|
|
855
|
+
const parseClassName = (className) => {
|
|
856
|
+
const modifiers = [];
|
|
857
|
+
let bracketDepth = 0;
|
|
858
|
+
let modifierStart = 0;
|
|
859
|
+
let postfixModifierPosition;
|
|
860
|
+
for (let index = 0;index < className.length; index++) {
|
|
861
|
+
let currentCharacter = className[index];
|
|
862
|
+
if (bracketDepth === 0) {
|
|
863
|
+
if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {
|
|
864
|
+
modifiers.push(className.slice(modifierStart, index));
|
|
865
|
+
modifierStart = index + separatorLength;
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
if (currentCharacter === "/") {
|
|
869
|
+
postfixModifierPosition = index;
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
if (currentCharacter === "[") {
|
|
874
|
+
bracketDepth++;
|
|
875
|
+
} else if (currentCharacter === "]") {
|
|
876
|
+
bracketDepth--;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);
|
|
880
|
+
const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);
|
|
881
|
+
const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;
|
|
882
|
+
const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;
|
|
883
|
+
return {
|
|
884
|
+
modifiers,
|
|
885
|
+
hasImportantModifier,
|
|
886
|
+
baseClassName,
|
|
887
|
+
maybePostfixModifierPosition
|
|
888
|
+
};
|
|
889
|
+
};
|
|
890
|
+
if (experimentalParseClassName) {
|
|
891
|
+
return (className) => experimentalParseClassName({
|
|
892
|
+
className,
|
|
893
|
+
parseClassName
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
return parseClassName;
|
|
897
|
+
};
|
|
898
|
+
var sortModifiers = (modifiers) => {
|
|
899
|
+
if (modifiers.length <= 1) {
|
|
900
|
+
return modifiers;
|
|
901
|
+
}
|
|
902
|
+
const sortedModifiers = [];
|
|
903
|
+
let unsortedModifiers = [];
|
|
904
|
+
modifiers.forEach((modifier) => {
|
|
905
|
+
const isArbitraryVariant = modifier[0] === "[";
|
|
906
|
+
if (isArbitraryVariant) {
|
|
907
|
+
sortedModifiers.push(...unsortedModifiers.sort(), modifier);
|
|
908
|
+
unsortedModifiers = [];
|
|
909
|
+
} else {
|
|
910
|
+
unsortedModifiers.push(modifier);
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
sortedModifiers.push(...unsortedModifiers.sort());
|
|
914
|
+
return sortedModifiers;
|
|
915
|
+
};
|
|
916
|
+
var createConfigUtils = (config) => ({
|
|
917
|
+
cache: createLruCache(config.cacheSize),
|
|
918
|
+
parseClassName: createParseClassName(config),
|
|
919
|
+
...createClassGroupUtils(config)
|
|
920
|
+
});
|
|
921
|
+
var SPLIT_CLASSES_REGEX = /\s+/;
|
|
922
|
+
var mergeClassList = (classList, configUtils) => {
|
|
923
|
+
const {
|
|
924
|
+
parseClassName,
|
|
925
|
+
getClassGroupId,
|
|
926
|
+
getConflictingClassGroupIds
|
|
927
|
+
} = configUtils;
|
|
928
|
+
const classGroupsInConflict = [];
|
|
929
|
+
const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
|
|
930
|
+
let result = "";
|
|
931
|
+
for (let index = classNames.length - 1;index >= 0; index -= 1) {
|
|
932
|
+
const originalClassName = classNames[index];
|
|
933
|
+
const {
|
|
934
|
+
modifiers,
|
|
935
|
+
hasImportantModifier,
|
|
936
|
+
baseClassName,
|
|
937
|
+
maybePostfixModifierPosition
|
|
938
|
+
} = parseClassName(originalClassName);
|
|
939
|
+
let hasPostfixModifier = Boolean(maybePostfixModifierPosition);
|
|
940
|
+
let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
|
|
941
|
+
if (!classGroupId) {
|
|
942
|
+
if (!hasPostfixModifier) {
|
|
943
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
944
|
+
continue;
|
|
945
|
+
}
|
|
946
|
+
classGroupId = getClassGroupId(baseClassName);
|
|
947
|
+
if (!classGroupId) {
|
|
948
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
949
|
+
continue;
|
|
950
|
+
}
|
|
951
|
+
hasPostfixModifier = false;
|
|
952
|
+
}
|
|
953
|
+
const variantModifier = sortModifiers(modifiers).join(":");
|
|
954
|
+
const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
|
|
955
|
+
const classId = modifierId + classGroupId;
|
|
956
|
+
if (classGroupsInConflict.includes(classId)) {
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
classGroupsInConflict.push(classId);
|
|
960
|
+
const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
|
|
961
|
+
for (let i = 0;i < conflictGroups.length; ++i) {
|
|
962
|
+
const group = conflictGroups[i];
|
|
963
|
+
classGroupsInConflict.push(modifierId + group);
|
|
964
|
+
}
|
|
965
|
+
result = originalClassName + (result.length > 0 ? " " + result : result);
|
|
966
|
+
}
|
|
967
|
+
return result;
|
|
968
|
+
};
|
|
969
|
+
function twJoin() {
|
|
970
|
+
let index = 0;
|
|
971
|
+
let argument;
|
|
972
|
+
let resolvedValue;
|
|
973
|
+
let string = "";
|
|
974
|
+
while (index < arguments.length) {
|
|
975
|
+
if (argument = arguments[index++]) {
|
|
976
|
+
if (resolvedValue = toValue(argument)) {
|
|
977
|
+
string && (string += " ");
|
|
978
|
+
string += resolvedValue;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
return string;
|
|
983
|
+
}
|
|
984
|
+
var toValue = (mix) => {
|
|
985
|
+
if (typeof mix === "string") {
|
|
986
|
+
return mix;
|
|
987
|
+
}
|
|
988
|
+
let resolvedValue;
|
|
989
|
+
let string = "";
|
|
990
|
+
for (let k = 0;k < mix.length; k++) {
|
|
991
|
+
if (mix[k]) {
|
|
992
|
+
if (resolvedValue = toValue(mix[k])) {
|
|
993
|
+
string && (string += " ");
|
|
994
|
+
string += resolvedValue;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
return string;
|
|
999
|
+
};
|
|
1000
|
+
function createTailwindMerge(createConfigFirst, ...createConfigRest) {
|
|
1001
|
+
let configUtils;
|
|
1002
|
+
let cacheGet;
|
|
1003
|
+
let cacheSet;
|
|
1004
|
+
let functionToCall = initTailwindMerge;
|
|
1005
|
+
function initTailwindMerge(classList) {
|
|
1006
|
+
const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
|
|
1007
|
+
configUtils = createConfigUtils(config);
|
|
1008
|
+
cacheGet = configUtils.cache.get;
|
|
1009
|
+
cacheSet = configUtils.cache.set;
|
|
1010
|
+
functionToCall = tailwindMerge;
|
|
1011
|
+
return tailwindMerge(classList);
|
|
1012
|
+
}
|
|
1013
|
+
function tailwindMerge(classList) {
|
|
1014
|
+
const cachedResult = cacheGet(classList);
|
|
1015
|
+
if (cachedResult) {
|
|
1016
|
+
return cachedResult;
|
|
1017
|
+
}
|
|
1018
|
+
const result = mergeClassList(classList, configUtils);
|
|
1019
|
+
cacheSet(classList, result);
|
|
1020
|
+
return result;
|
|
1021
|
+
}
|
|
1022
|
+
return function callTailwindMerge() {
|
|
1023
|
+
return functionToCall(twJoin.apply(null, arguments));
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
var fromTheme = (key) => {
|
|
1027
|
+
const themeGetter = (theme) => theme[key] || [];
|
|
1028
|
+
themeGetter.isThemeGetter = true;
|
|
1029
|
+
return themeGetter;
|
|
1030
|
+
};
|
|
1031
|
+
var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i;
|
|
1032
|
+
var fractionRegex = /^\d+\/\d+$/;
|
|
1033
|
+
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
1034
|
+
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
1035
|
+
var 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$/;
|
|
1036
|
+
var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
|
|
1037
|
+
var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
1038
|
+
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
1039
|
+
var isLength = (value) => isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);
|
|
1040
|
+
var isArbitraryLength = (value) => getIsArbitraryValue(value, "length", isLengthOnly);
|
|
1041
|
+
var isNumber = (value) => Boolean(value) && !Number.isNaN(Number(value));
|
|
1042
|
+
var isArbitraryNumber = (value) => getIsArbitraryValue(value, "number", isNumber);
|
|
1043
|
+
var isInteger = (value) => Boolean(value) && Number.isInteger(Number(value));
|
|
1044
|
+
var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
|
|
1045
|
+
var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
|
|
1046
|
+
var isTshirtSize = (value) => tshirtUnitRegex.test(value);
|
|
1047
|
+
var sizeLabels = /* @__PURE__ */ new Set(["length", "size", "percentage"]);
|
|
1048
|
+
var isArbitrarySize = (value) => getIsArbitraryValue(value, sizeLabels, isNever);
|
|
1049
|
+
var isArbitraryPosition = (value) => getIsArbitraryValue(value, "position", isNever);
|
|
1050
|
+
var imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
|
|
1051
|
+
var isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
|
|
1052
|
+
var isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
|
|
1053
|
+
var isAny = () => true;
|
|
1054
|
+
var getIsArbitraryValue = (value, label, testValue) => {
|
|
1055
|
+
const result = arbitraryValueRegex.exec(value);
|
|
1056
|
+
if (result) {
|
|
1057
|
+
if (result[1]) {
|
|
1058
|
+
return typeof label === "string" ? result[1] === label : label.has(result[1]);
|
|
1059
|
+
}
|
|
1060
|
+
return testValue(result[2]);
|
|
1061
|
+
}
|
|
1062
|
+
return false;
|
|
1063
|
+
};
|
|
1064
|
+
var isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
1065
|
+
var isNever = () => false;
|
|
1066
|
+
var isShadow = (value) => shadowRegex.test(value);
|
|
1067
|
+
var isImage = (value) => imageRegex.test(value);
|
|
1068
|
+
var getDefaultConfig = () => {
|
|
1069
|
+
const colors = fromTheme("colors");
|
|
1070
|
+
const spacing = fromTheme("spacing");
|
|
1071
|
+
const blur = fromTheme("blur");
|
|
1072
|
+
const brightness = fromTheme("brightness");
|
|
1073
|
+
const borderColor = fromTheme("borderColor");
|
|
1074
|
+
const borderRadius = fromTheme("borderRadius");
|
|
1075
|
+
const borderSpacing = fromTheme("borderSpacing");
|
|
1076
|
+
const borderWidth = fromTheme("borderWidth");
|
|
1077
|
+
const contrast = fromTheme("contrast");
|
|
1078
|
+
const grayscale = fromTheme("grayscale");
|
|
1079
|
+
const hueRotate = fromTheme("hueRotate");
|
|
1080
|
+
const invert = fromTheme("invert");
|
|
1081
|
+
const gap = fromTheme("gap");
|
|
1082
|
+
const gradientColorStops = fromTheme("gradientColorStops");
|
|
1083
|
+
const gradientColorStopPositions = fromTheme("gradientColorStopPositions");
|
|
1084
|
+
const inset = fromTheme("inset");
|
|
1085
|
+
const margin = fromTheme("margin");
|
|
1086
|
+
const opacity = fromTheme("opacity");
|
|
1087
|
+
const padding = fromTheme("padding");
|
|
1088
|
+
const saturate = fromTheme("saturate");
|
|
1089
|
+
const scale = fromTheme("scale");
|
|
1090
|
+
const sepia = fromTheme("sepia");
|
|
1091
|
+
const skew = fromTheme("skew");
|
|
1092
|
+
const space = fromTheme("space");
|
|
1093
|
+
const translate = fromTheme("translate");
|
|
1094
|
+
const getOverscroll = () => ["auto", "contain", "none"];
|
|
1095
|
+
const getOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
|
|
1096
|
+
const getSpacingWithAutoAndArbitrary = () => ["auto", isArbitraryValue, spacing];
|
|
1097
|
+
const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];
|
|
1098
|
+
const getLengthWithEmptyAndArbitrary = () => ["", isLength, isArbitraryLength];
|
|
1099
|
+
const getNumberWithAutoAndArbitrary = () => ["auto", isNumber, isArbitraryValue];
|
|
1100
|
+
const getPositions = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"];
|
|
1101
|
+
const getLineStyles = () => ["solid", "dashed", "dotted", "double", "none"];
|
|
1102
|
+
const getBlendModes = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
|
|
1103
|
+
const getAlign = () => ["start", "end", "center", "between", "around", "evenly", "stretch"];
|
|
1104
|
+
const getZeroAndEmpty = () => ["", "0", isArbitraryValue];
|
|
1105
|
+
const getBreaks = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
|
|
1106
|
+
const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];
|
|
1107
|
+
return {
|
|
1108
|
+
cacheSize: 500,
|
|
1109
|
+
separator: ":",
|
|
1110
|
+
theme: {
|
|
1111
|
+
colors: [isAny],
|
|
1112
|
+
spacing: [isLength, isArbitraryLength],
|
|
1113
|
+
blur: ["none", "", isTshirtSize, isArbitraryValue],
|
|
1114
|
+
brightness: getNumberAndArbitrary(),
|
|
1115
|
+
borderColor: [colors],
|
|
1116
|
+
borderRadius: ["none", "", "full", isTshirtSize, isArbitraryValue],
|
|
1117
|
+
borderSpacing: getSpacingWithArbitrary(),
|
|
1118
|
+
borderWidth: getLengthWithEmptyAndArbitrary(),
|
|
1119
|
+
contrast: getNumberAndArbitrary(),
|
|
1120
|
+
grayscale: getZeroAndEmpty(),
|
|
1121
|
+
hueRotate: getNumberAndArbitrary(),
|
|
1122
|
+
invert: getZeroAndEmpty(),
|
|
1123
|
+
gap: getSpacingWithArbitrary(),
|
|
1124
|
+
gradientColorStops: [colors],
|
|
1125
|
+
gradientColorStopPositions: [isPercent, isArbitraryLength],
|
|
1126
|
+
inset: getSpacingWithAutoAndArbitrary(),
|
|
1127
|
+
margin: getSpacingWithAutoAndArbitrary(),
|
|
1128
|
+
opacity: getNumberAndArbitrary(),
|
|
1129
|
+
padding: getSpacingWithArbitrary(),
|
|
1130
|
+
saturate: getNumberAndArbitrary(),
|
|
1131
|
+
scale: getNumberAndArbitrary(),
|
|
1132
|
+
sepia: getZeroAndEmpty(),
|
|
1133
|
+
skew: getNumberAndArbitrary(),
|
|
1134
|
+
space: getSpacingWithArbitrary(),
|
|
1135
|
+
translate: getSpacingWithArbitrary()
|
|
1136
|
+
},
|
|
1137
|
+
classGroups: {
|
|
1138
|
+
aspect: [{
|
|
1139
|
+
aspect: ["auto", "square", "video", isArbitraryValue]
|
|
1140
|
+
}],
|
|
1141
|
+
container: ["container"],
|
|
1142
|
+
columns: [{
|
|
1143
|
+
columns: [isTshirtSize]
|
|
1144
|
+
}],
|
|
1145
|
+
"break-after": [{
|
|
1146
|
+
"break-after": getBreaks()
|
|
1147
|
+
}],
|
|
1148
|
+
"break-before": [{
|
|
1149
|
+
"break-before": getBreaks()
|
|
1150
|
+
}],
|
|
1151
|
+
"break-inside": [{
|
|
1152
|
+
"break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
|
|
1153
|
+
}],
|
|
1154
|
+
"box-decoration": [{
|
|
1155
|
+
"box-decoration": ["slice", "clone"]
|
|
1156
|
+
}],
|
|
1157
|
+
box: [{
|
|
1158
|
+
box: ["border", "content"]
|
|
1159
|
+
}],
|
|
1160
|
+
display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
|
|
1161
|
+
float: [{
|
|
1162
|
+
float: ["right", "left", "none", "start", "end"]
|
|
1163
|
+
}],
|
|
1164
|
+
clear: [{
|
|
1165
|
+
clear: ["left", "right", "both", "none", "start", "end"]
|
|
1166
|
+
}],
|
|
1167
|
+
isolation: ["isolate", "isolation-auto"],
|
|
1168
|
+
"object-fit": [{
|
|
1169
|
+
object: ["contain", "cover", "fill", "none", "scale-down"]
|
|
1170
|
+
}],
|
|
1171
|
+
"object-position": [{
|
|
1172
|
+
object: [...getPositions(), isArbitraryValue]
|
|
1173
|
+
}],
|
|
1174
|
+
overflow: [{
|
|
1175
|
+
overflow: getOverflow()
|
|
1176
|
+
}],
|
|
1177
|
+
"overflow-x": [{
|
|
1178
|
+
"overflow-x": getOverflow()
|
|
1179
|
+
}],
|
|
1180
|
+
"overflow-y": [{
|
|
1181
|
+
"overflow-y": getOverflow()
|
|
1182
|
+
}],
|
|
1183
|
+
overscroll: [{
|
|
1184
|
+
overscroll: getOverscroll()
|
|
1185
|
+
}],
|
|
1186
|
+
"overscroll-x": [{
|
|
1187
|
+
"overscroll-x": getOverscroll()
|
|
1188
|
+
}],
|
|
1189
|
+
"overscroll-y": [{
|
|
1190
|
+
"overscroll-y": getOverscroll()
|
|
1191
|
+
}],
|
|
1192
|
+
position: ["static", "fixed", "absolute", "relative", "sticky"],
|
|
1193
|
+
inset: [{
|
|
1194
|
+
inset: [inset]
|
|
1195
|
+
}],
|
|
1196
|
+
"inset-x": [{
|
|
1197
|
+
"inset-x": [inset]
|
|
1198
|
+
}],
|
|
1199
|
+
"inset-y": [{
|
|
1200
|
+
"inset-y": [inset]
|
|
1201
|
+
}],
|
|
1202
|
+
start: [{
|
|
1203
|
+
start: [inset]
|
|
1204
|
+
}],
|
|
1205
|
+
end: [{
|
|
1206
|
+
end: [inset]
|
|
1207
|
+
}],
|
|
1208
|
+
top: [{
|
|
1209
|
+
top: [inset]
|
|
1210
|
+
}],
|
|
1211
|
+
right: [{
|
|
1212
|
+
right: [inset]
|
|
1213
|
+
}],
|
|
1214
|
+
bottom: [{
|
|
1215
|
+
bottom: [inset]
|
|
1216
|
+
}],
|
|
1217
|
+
left: [{
|
|
1218
|
+
left: [inset]
|
|
1219
|
+
}],
|
|
1220
|
+
visibility: ["visible", "invisible", "collapse"],
|
|
1221
|
+
z: [{
|
|
1222
|
+
z: ["auto", isInteger, isArbitraryValue]
|
|
1223
|
+
}],
|
|
1224
|
+
basis: [{
|
|
1225
|
+
basis: getSpacingWithAutoAndArbitrary()
|
|
1226
|
+
}],
|
|
1227
|
+
"flex-direction": [{
|
|
1228
|
+
flex: ["row", "row-reverse", "col", "col-reverse"]
|
|
1229
|
+
}],
|
|
1230
|
+
"flex-wrap": [{
|
|
1231
|
+
flex: ["wrap", "wrap-reverse", "nowrap"]
|
|
1232
|
+
}],
|
|
1233
|
+
flex: [{
|
|
1234
|
+
flex: ["1", "auto", "initial", "none", isArbitraryValue]
|
|
1235
|
+
}],
|
|
1236
|
+
grow: [{
|
|
1237
|
+
grow: getZeroAndEmpty()
|
|
1238
|
+
}],
|
|
1239
|
+
shrink: [{
|
|
1240
|
+
shrink: getZeroAndEmpty()
|
|
1241
|
+
}],
|
|
1242
|
+
order: [{
|
|
1243
|
+
order: ["first", "last", "none", isInteger, isArbitraryValue]
|
|
1244
|
+
}],
|
|
1245
|
+
"grid-cols": [{
|
|
1246
|
+
"grid-cols": [isAny]
|
|
1247
|
+
}],
|
|
1248
|
+
"col-start-end": [{
|
|
1249
|
+
col: ["auto", {
|
|
1250
|
+
span: ["full", isInteger, isArbitraryValue]
|
|
1251
|
+
}, isArbitraryValue]
|
|
1252
|
+
}],
|
|
1253
|
+
"col-start": [{
|
|
1254
|
+
"col-start": getNumberWithAutoAndArbitrary()
|
|
1255
|
+
}],
|
|
1256
|
+
"col-end": [{
|
|
1257
|
+
"col-end": getNumberWithAutoAndArbitrary()
|
|
1258
|
+
}],
|
|
1259
|
+
"grid-rows": [{
|
|
1260
|
+
"grid-rows": [isAny]
|
|
1261
|
+
}],
|
|
1262
|
+
"row-start-end": [{
|
|
1263
|
+
row: ["auto", {
|
|
1264
|
+
span: [isInteger, isArbitraryValue]
|
|
1265
|
+
}, isArbitraryValue]
|
|
1266
|
+
}],
|
|
1267
|
+
"row-start": [{
|
|
1268
|
+
"row-start": getNumberWithAutoAndArbitrary()
|
|
1269
|
+
}],
|
|
1270
|
+
"row-end": [{
|
|
1271
|
+
"row-end": getNumberWithAutoAndArbitrary()
|
|
1272
|
+
}],
|
|
1273
|
+
"grid-flow": [{
|
|
1274
|
+
"grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
|
|
1275
|
+
}],
|
|
1276
|
+
"auto-cols": [{
|
|
1277
|
+
"auto-cols": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
1278
|
+
}],
|
|
1279
|
+
"auto-rows": [{
|
|
1280
|
+
"auto-rows": ["auto", "min", "max", "fr", isArbitraryValue]
|
|
1281
|
+
}],
|
|
1282
|
+
gap: [{
|
|
1283
|
+
gap: [gap]
|
|
1284
|
+
}],
|
|
1285
|
+
"gap-x": [{
|
|
1286
|
+
"gap-x": [gap]
|
|
1287
|
+
}],
|
|
1288
|
+
"gap-y": [{
|
|
1289
|
+
"gap-y": [gap]
|
|
1290
|
+
}],
|
|
1291
|
+
"justify-content": [{
|
|
1292
|
+
justify: ["normal", ...getAlign()]
|
|
1293
|
+
}],
|
|
1294
|
+
"justify-items": [{
|
|
1295
|
+
"justify-items": ["start", "end", "center", "stretch"]
|
|
1296
|
+
}],
|
|
1297
|
+
"justify-self": [{
|
|
1298
|
+
"justify-self": ["auto", "start", "end", "center", "stretch"]
|
|
1299
|
+
}],
|
|
1300
|
+
"align-content": [{
|
|
1301
|
+
content: ["normal", ...getAlign(), "baseline"]
|
|
1302
|
+
}],
|
|
1303
|
+
"align-items": [{
|
|
1304
|
+
items: ["start", "end", "center", "baseline", "stretch"]
|
|
1305
|
+
}],
|
|
1306
|
+
"align-self": [{
|
|
1307
|
+
self: ["auto", "start", "end", "center", "stretch", "baseline"]
|
|
1308
|
+
}],
|
|
1309
|
+
"place-content": [{
|
|
1310
|
+
"place-content": [...getAlign(), "baseline"]
|
|
1311
|
+
}],
|
|
1312
|
+
"place-items": [{
|
|
1313
|
+
"place-items": ["start", "end", "center", "baseline", "stretch"]
|
|
1314
|
+
}],
|
|
1315
|
+
"place-self": [{
|
|
1316
|
+
"place-self": ["auto", "start", "end", "center", "stretch"]
|
|
1317
|
+
}],
|
|
1318
|
+
p: [{
|
|
1319
|
+
p: [padding]
|
|
1320
|
+
}],
|
|
1321
|
+
px: [{
|
|
1322
|
+
px: [padding]
|
|
1323
|
+
}],
|
|
1324
|
+
py: [{
|
|
1325
|
+
py: [padding]
|
|
1326
|
+
}],
|
|
1327
|
+
ps: [{
|
|
1328
|
+
ps: [padding]
|
|
1329
|
+
}],
|
|
1330
|
+
pe: [{
|
|
1331
|
+
pe: [padding]
|
|
1332
|
+
}],
|
|
1333
|
+
pt: [{
|
|
1334
|
+
pt: [padding]
|
|
1335
|
+
}],
|
|
1336
|
+
pr: [{
|
|
1337
|
+
pr: [padding]
|
|
1338
|
+
}],
|
|
1339
|
+
pb: [{
|
|
1340
|
+
pb: [padding]
|
|
1341
|
+
}],
|
|
1342
|
+
pl: [{
|
|
1343
|
+
pl: [padding]
|
|
1344
|
+
}],
|
|
1345
|
+
m: [{
|
|
1346
|
+
m: [margin]
|
|
1347
|
+
}],
|
|
1348
|
+
mx: [{
|
|
1349
|
+
mx: [margin]
|
|
1350
|
+
}],
|
|
1351
|
+
my: [{
|
|
1352
|
+
my: [margin]
|
|
1353
|
+
}],
|
|
1354
|
+
ms: [{
|
|
1355
|
+
ms: [margin]
|
|
1356
|
+
}],
|
|
1357
|
+
me: [{
|
|
1358
|
+
me: [margin]
|
|
1359
|
+
}],
|
|
1360
|
+
mt: [{
|
|
1361
|
+
mt: [margin]
|
|
1362
|
+
}],
|
|
1363
|
+
mr: [{
|
|
1364
|
+
mr: [margin]
|
|
1365
|
+
}],
|
|
1366
|
+
mb: [{
|
|
1367
|
+
mb: [margin]
|
|
1368
|
+
}],
|
|
1369
|
+
ml: [{
|
|
1370
|
+
ml: [margin]
|
|
1371
|
+
}],
|
|
1372
|
+
"space-x": [{
|
|
1373
|
+
"space-x": [space]
|
|
1374
|
+
}],
|
|
1375
|
+
"space-x-reverse": ["space-x-reverse"],
|
|
1376
|
+
"space-y": [{
|
|
1377
|
+
"space-y": [space]
|
|
1378
|
+
}],
|
|
1379
|
+
"space-y-reverse": ["space-y-reverse"],
|
|
1380
|
+
w: [{
|
|
1381
|
+
w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", isArbitraryValue, spacing]
|
|
1382
|
+
}],
|
|
1383
|
+
"min-w": [{
|
|
1384
|
+
"min-w": [isArbitraryValue, spacing, "min", "max", "fit"]
|
|
1385
|
+
}],
|
|
1386
|
+
"max-w": [{
|
|
1387
|
+
"max-w": [isArbitraryValue, spacing, "none", "full", "min", "max", "fit", "prose", {
|
|
1388
|
+
screen: [isTshirtSize]
|
|
1389
|
+
}, isTshirtSize]
|
|
1390
|
+
}],
|
|
1391
|
+
h: [{
|
|
1392
|
+
h: [isArbitraryValue, spacing, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1393
|
+
}],
|
|
1394
|
+
"min-h": [{
|
|
1395
|
+
"min-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1396
|
+
}],
|
|
1397
|
+
"max-h": [{
|
|
1398
|
+
"max-h": [isArbitraryValue, spacing, "min", "max", "fit", "svh", "lvh", "dvh"]
|
|
1399
|
+
}],
|
|
1400
|
+
size: [{
|
|
1401
|
+
size: [isArbitraryValue, spacing, "auto", "min", "max", "fit"]
|
|
1402
|
+
}],
|
|
1403
|
+
"font-size": [{
|
|
1404
|
+
text: ["base", isTshirtSize, isArbitraryLength]
|
|
1405
|
+
}],
|
|
1406
|
+
"font-smoothing": ["antialiased", "subpixel-antialiased"],
|
|
1407
|
+
"font-style": ["italic", "not-italic"],
|
|
1408
|
+
"font-weight": [{
|
|
1409
|
+
font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", isArbitraryNumber]
|
|
1410
|
+
}],
|
|
1411
|
+
"font-family": [{
|
|
1412
|
+
font: [isAny]
|
|
1413
|
+
}],
|
|
1414
|
+
"fvn-normal": ["normal-nums"],
|
|
1415
|
+
"fvn-ordinal": ["ordinal"],
|
|
1416
|
+
"fvn-slashed-zero": ["slashed-zero"],
|
|
1417
|
+
"fvn-figure": ["lining-nums", "oldstyle-nums"],
|
|
1418
|
+
"fvn-spacing": ["proportional-nums", "tabular-nums"],
|
|
1419
|
+
"fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
|
|
1420
|
+
tracking: [{
|
|
1421
|
+
tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", isArbitraryValue]
|
|
1422
|
+
}],
|
|
1423
|
+
"line-clamp": [{
|
|
1424
|
+
"line-clamp": ["none", isNumber, isArbitraryNumber]
|
|
1425
|
+
}],
|
|
1426
|
+
leading: [{
|
|
1427
|
+
leading: ["none", "tight", "snug", "normal", "relaxed", "loose", isLength, isArbitraryValue]
|
|
1428
|
+
}],
|
|
1429
|
+
"list-image": [{
|
|
1430
|
+
"list-image": ["none", isArbitraryValue]
|
|
1431
|
+
}],
|
|
1432
|
+
"list-style-type": [{
|
|
1433
|
+
list: ["none", "disc", "decimal", isArbitraryValue]
|
|
1434
|
+
}],
|
|
1435
|
+
"list-style-position": [{
|
|
1436
|
+
list: ["inside", "outside"]
|
|
1437
|
+
}],
|
|
1438
|
+
"placeholder-color": [{
|
|
1439
|
+
placeholder: [colors]
|
|
1440
|
+
}],
|
|
1441
|
+
"placeholder-opacity": [{
|
|
1442
|
+
"placeholder-opacity": [opacity]
|
|
1443
|
+
}],
|
|
1444
|
+
"text-alignment": [{
|
|
1445
|
+
text: ["left", "center", "right", "justify", "start", "end"]
|
|
1446
|
+
}],
|
|
1447
|
+
"text-color": [{
|
|
1448
|
+
text: [colors]
|
|
1449
|
+
}],
|
|
1450
|
+
"text-opacity": [{
|
|
1451
|
+
"text-opacity": [opacity]
|
|
1452
|
+
}],
|
|
1453
|
+
"text-decoration": ["underline", "overline", "line-through", "no-underline"],
|
|
1454
|
+
"text-decoration-style": [{
|
|
1455
|
+
decoration: [...getLineStyles(), "wavy"]
|
|
1456
|
+
}],
|
|
1457
|
+
"text-decoration-thickness": [{
|
|
1458
|
+
decoration: ["auto", "from-font", isLength, isArbitraryLength]
|
|
1459
|
+
}],
|
|
1460
|
+
"underline-offset": [{
|
|
1461
|
+
"underline-offset": ["auto", isLength, isArbitraryValue]
|
|
1462
|
+
}],
|
|
1463
|
+
"text-decoration-color": [{
|
|
1464
|
+
decoration: [colors]
|
|
1465
|
+
}],
|
|
1466
|
+
"text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
|
|
1467
|
+
"text-overflow": ["truncate", "text-ellipsis", "text-clip"],
|
|
1468
|
+
"text-wrap": [{
|
|
1469
|
+
text: ["wrap", "nowrap", "balance", "pretty"]
|
|
1470
|
+
}],
|
|
1471
|
+
indent: [{
|
|
1472
|
+
indent: getSpacingWithArbitrary()
|
|
1473
|
+
}],
|
|
1474
|
+
"vertical-align": [{
|
|
1475
|
+
align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryValue]
|
|
1476
|
+
}],
|
|
1477
|
+
whitespace: [{
|
|
1478
|
+
whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
|
|
1479
|
+
}],
|
|
1480
|
+
break: [{
|
|
1481
|
+
break: ["normal", "words", "all", "keep"]
|
|
1482
|
+
}],
|
|
1483
|
+
hyphens: [{
|
|
1484
|
+
hyphens: ["none", "manual", "auto"]
|
|
1485
|
+
}],
|
|
1486
|
+
content: [{
|
|
1487
|
+
content: ["none", isArbitraryValue]
|
|
1488
|
+
}],
|
|
1489
|
+
"bg-attachment": [{
|
|
1490
|
+
bg: ["fixed", "local", "scroll"]
|
|
1491
|
+
}],
|
|
1492
|
+
"bg-clip": [{
|
|
1493
|
+
"bg-clip": ["border", "padding", "content", "text"]
|
|
1494
|
+
}],
|
|
1495
|
+
"bg-opacity": [{
|
|
1496
|
+
"bg-opacity": [opacity]
|
|
1497
|
+
}],
|
|
1498
|
+
"bg-origin": [{
|
|
1499
|
+
"bg-origin": ["border", "padding", "content"]
|
|
1500
|
+
}],
|
|
1501
|
+
"bg-position": [{
|
|
1502
|
+
bg: [...getPositions(), isArbitraryPosition]
|
|
1503
|
+
}],
|
|
1504
|
+
"bg-repeat": [{
|
|
1505
|
+
bg: ["no-repeat", {
|
|
1506
|
+
repeat: ["", "x", "y", "round", "space"]
|
|
1507
|
+
}]
|
|
1508
|
+
}],
|
|
1509
|
+
"bg-size": [{
|
|
1510
|
+
bg: ["auto", "cover", "contain", isArbitrarySize]
|
|
1511
|
+
}],
|
|
1512
|
+
"bg-image": [{
|
|
1513
|
+
bg: ["none", {
|
|
1514
|
+
"gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
|
|
1515
|
+
}, isArbitraryImage]
|
|
1516
|
+
}],
|
|
1517
|
+
"bg-color": [{
|
|
1518
|
+
bg: [colors]
|
|
1519
|
+
}],
|
|
1520
|
+
"gradient-from-pos": [{
|
|
1521
|
+
from: [gradientColorStopPositions]
|
|
1522
|
+
}],
|
|
1523
|
+
"gradient-via-pos": [{
|
|
1524
|
+
via: [gradientColorStopPositions]
|
|
1525
|
+
}],
|
|
1526
|
+
"gradient-to-pos": [{
|
|
1527
|
+
to: [gradientColorStopPositions]
|
|
1528
|
+
}],
|
|
1529
|
+
"gradient-from": [{
|
|
1530
|
+
from: [gradientColorStops]
|
|
1531
|
+
}],
|
|
1532
|
+
"gradient-via": [{
|
|
1533
|
+
via: [gradientColorStops]
|
|
1534
|
+
}],
|
|
1535
|
+
"gradient-to": [{
|
|
1536
|
+
to: [gradientColorStops]
|
|
1537
|
+
}],
|
|
1538
|
+
rounded: [{
|
|
1539
|
+
rounded: [borderRadius]
|
|
1540
|
+
}],
|
|
1541
|
+
"rounded-s": [{
|
|
1542
|
+
"rounded-s": [borderRadius]
|
|
1543
|
+
}],
|
|
1544
|
+
"rounded-e": [{
|
|
1545
|
+
"rounded-e": [borderRadius]
|
|
1546
|
+
}],
|
|
1547
|
+
"rounded-t": [{
|
|
1548
|
+
"rounded-t": [borderRadius]
|
|
1549
|
+
}],
|
|
1550
|
+
"rounded-r": [{
|
|
1551
|
+
"rounded-r": [borderRadius]
|
|
1552
|
+
}],
|
|
1553
|
+
"rounded-b": [{
|
|
1554
|
+
"rounded-b": [borderRadius]
|
|
1555
|
+
}],
|
|
1556
|
+
"rounded-l": [{
|
|
1557
|
+
"rounded-l": [borderRadius]
|
|
1558
|
+
}],
|
|
1559
|
+
"rounded-ss": [{
|
|
1560
|
+
"rounded-ss": [borderRadius]
|
|
1561
|
+
}],
|
|
1562
|
+
"rounded-se": [{
|
|
1563
|
+
"rounded-se": [borderRadius]
|
|
1564
|
+
}],
|
|
1565
|
+
"rounded-ee": [{
|
|
1566
|
+
"rounded-ee": [borderRadius]
|
|
1567
|
+
}],
|
|
1568
|
+
"rounded-es": [{
|
|
1569
|
+
"rounded-es": [borderRadius]
|
|
1570
|
+
}],
|
|
1571
|
+
"rounded-tl": [{
|
|
1572
|
+
"rounded-tl": [borderRadius]
|
|
1573
|
+
}],
|
|
1574
|
+
"rounded-tr": [{
|
|
1575
|
+
"rounded-tr": [borderRadius]
|
|
1576
|
+
}],
|
|
1577
|
+
"rounded-br": [{
|
|
1578
|
+
"rounded-br": [borderRadius]
|
|
1579
|
+
}],
|
|
1580
|
+
"rounded-bl": [{
|
|
1581
|
+
"rounded-bl": [borderRadius]
|
|
1582
|
+
}],
|
|
1583
|
+
"border-w": [{
|
|
1584
|
+
border: [borderWidth]
|
|
1585
|
+
}],
|
|
1586
|
+
"border-w-x": [{
|
|
1587
|
+
"border-x": [borderWidth]
|
|
1588
|
+
}],
|
|
1589
|
+
"border-w-y": [{
|
|
1590
|
+
"border-y": [borderWidth]
|
|
1591
|
+
}],
|
|
1592
|
+
"border-w-s": [{
|
|
1593
|
+
"border-s": [borderWidth]
|
|
1594
|
+
}],
|
|
1595
|
+
"border-w-e": [{
|
|
1596
|
+
"border-e": [borderWidth]
|
|
1597
|
+
}],
|
|
1598
|
+
"border-w-t": [{
|
|
1599
|
+
"border-t": [borderWidth]
|
|
1600
|
+
}],
|
|
1601
|
+
"border-w-r": [{
|
|
1602
|
+
"border-r": [borderWidth]
|
|
1603
|
+
}],
|
|
1604
|
+
"border-w-b": [{
|
|
1605
|
+
"border-b": [borderWidth]
|
|
1606
|
+
}],
|
|
1607
|
+
"border-w-l": [{
|
|
1608
|
+
"border-l": [borderWidth]
|
|
1609
|
+
}],
|
|
1610
|
+
"border-opacity": [{
|
|
1611
|
+
"border-opacity": [opacity]
|
|
1612
|
+
}],
|
|
1613
|
+
"border-style": [{
|
|
1614
|
+
border: [...getLineStyles(), "hidden"]
|
|
1615
|
+
}],
|
|
1616
|
+
"divide-x": [{
|
|
1617
|
+
"divide-x": [borderWidth]
|
|
1618
|
+
}],
|
|
1619
|
+
"divide-x-reverse": ["divide-x-reverse"],
|
|
1620
|
+
"divide-y": [{
|
|
1621
|
+
"divide-y": [borderWidth]
|
|
1622
|
+
}],
|
|
1623
|
+
"divide-y-reverse": ["divide-y-reverse"],
|
|
1624
|
+
"divide-opacity": [{
|
|
1625
|
+
"divide-opacity": [opacity]
|
|
1626
|
+
}],
|
|
1627
|
+
"divide-style": [{
|
|
1628
|
+
divide: getLineStyles()
|
|
1629
|
+
}],
|
|
1630
|
+
"border-color": [{
|
|
1631
|
+
border: [borderColor]
|
|
1632
|
+
}],
|
|
1633
|
+
"border-color-x": [{
|
|
1634
|
+
"border-x": [borderColor]
|
|
1635
|
+
}],
|
|
1636
|
+
"border-color-y": [{
|
|
1637
|
+
"border-y": [borderColor]
|
|
1638
|
+
}],
|
|
1639
|
+
"border-color-s": [{
|
|
1640
|
+
"border-s": [borderColor]
|
|
1641
|
+
}],
|
|
1642
|
+
"border-color-e": [{
|
|
1643
|
+
"border-e": [borderColor]
|
|
1644
|
+
}],
|
|
1645
|
+
"border-color-t": [{
|
|
1646
|
+
"border-t": [borderColor]
|
|
1647
|
+
}],
|
|
1648
|
+
"border-color-r": [{
|
|
1649
|
+
"border-r": [borderColor]
|
|
1650
|
+
}],
|
|
1651
|
+
"border-color-b": [{
|
|
1652
|
+
"border-b": [borderColor]
|
|
1653
|
+
}],
|
|
1654
|
+
"border-color-l": [{
|
|
1655
|
+
"border-l": [borderColor]
|
|
1656
|
+
}],
|
|
1657
|
+
"divide-color": [{
|
|
1658
|
+
divide: [borderColor]
|
|
1659
|
+
}],
|
|
1660
|
+
"outline-style": [{
|
|
1661
|
+
outline: ["", ...getLineStyles()]
|
|
1662
|
+
}],
|
|
1663
|
+
"outline-offset": [{
|
|
1664
|
+
"outline-offset": [isLength, isArbitraryValue]
|
|
1665
|
+
}],
|
|
1666
|
+
"outline-w": [{
|
|
1667
|
+
outline: [isLength, isArbitraryLength]
|
|
1668
|
+
}],
|
|
1669
|
+
"outline-color": [{
|
|
1670
|
+
outline: [colors]
|
|
1671
|
+
}],
|
|
1672
|
+
"ring-w": [{
|
|
1673
|
+
ring: getLengthWithEmptyAndArbitrary()
|
|
1674
|
+
}],
|
|
1675
|
+
"ring-w-inset": ["ring-inset"],
|
|
1676
|
+
"ring-color": [{
|
|
1677
|
+
ring: [colors]
|
|
1678
|
+
}],
|
|
1679
|
+
"ring-opacity": [{
|
|
1680
|
+
"ring-opacity": [opacity]
|
|
1681
|
+
}],
|
|
1682
|
+
"ring-offset-w": [{
|
|
1683
|
+
"ring-offset": [isLength, isArbitraryLength]
|
|
1684
|
+
}],
|
|
1685
|
+
"ring-offset-color": [{
|
|
1686
|
+
"ring-offset": [colors]
|
|
1687
|
+
}],
|
|
1688
|
+
shadow: [{
|
|
1689
|
+
shadow: ["", "inner", "none", isTshirtSize, isArbitraryShadow]
|
|
1690
|
+
}],
|
|
1691
|
+
"shadow-color": [{
|
|
1692
|
+
shadow: [isAny]
|
|
1693
|
+
}],
|
|
1694
|
+
opacity: [{
|
|
1695
|
+
opacity: [opacity]
|
|
1696
|
+
}],
|
|
1697
|
+
"mix-blend": [{
|
|
1698
|
+
"mix-blend": [...getBlendModes(), "plus-lighter", "plus-darker"]
|
|
1699
|
+
}],
|
|
1700
|
+
"bg-blend": [{
|
|
1701
|
+
"bg-blend": getBlendModes()
|
|
1702
|
+
}],
|
|
1703
|
+
filter: [{
|
|
1704
|
+
filter: ["", "none"]
|
|
1705
|
+
}],
|
|
1706
|
+
blur: [{
|
|
1707
|
+
blur: [blur]
|
|
1708
|
+
}],
|
|
1709
|
+
brightness: [{
|
|
1710
|
+
brightness: [brightness]
|
|
1711
|
+
}],
|
|
1712
|
+
contrast: [{
|
|
1713
|
+
contrast: [contrast]
|
|
1714
|
+
}],
|
|
1715
|
+
"drop-shadow": [{
|
|
1716
|
+
"drop-shadow": ["", "none", isTshirtSize, isArbitraryValue]
|
|
1717
|
+
}],
|
|
1718
|
+
grayscale: [{
|
|
1719
|
+
grayscale: [grayscale]
|
|
1720
|
+
}],
|
|
1721
|
+
"hue-rotate": [{
|
|
1722
|
+
"hue-rotate": [hueRotate]
|
|
1723
|
+
}],
|
|
1724
|
+
invert: [{
|
|
1725
|
+
invert: [invert]
|
|
1726
|
+
}],
|
|
1727
|
+
saturate: [{
|
|
1728
|
+
saturate: [saturate]
|
|
1729
|
+
}],
|
|
1730
|
+
sepia: [{
|
|
1731
|
+
sepia: [sepia]
|
|
1732
|
+
}],
|
|
1733
|
+
"backdrop-filter": [{
|
|
1734
|
+
"backdrop-filter": ["", "none"]
|
|
1735
|
+
}],
|
|
1736
|
+
"backdrop-blur": [{
|
|
1737
|
+
"backdrop-blur": [blur]
|
|
1738
|
+
}],
|
|
1739
|
+
"backdrop-brightness": [{
|
|
1740
|
+
"backdrop-brightness": [brightness]
|
|
1741
|
+
}],
|
|
1742
|
+
"backdrop-contrast": [{
|
|
1743
|
+
"backdrop-contrast": [contrast]
|
|
1744
|
+
}],
|
|
1745
|
+
"backdrop-grayscale": [{
|
|
1746
|
+
"backdrop-grayscale": [grayscale]
|
|
1747
|
+
}],
|
|
1748
|
+
"backdrop-hue-rotate": [{
|
|
1749
|
+
"backdrop-hue-rotate": [hueRotate]
|
|
1750
|
+
}],
|
|
1751
|
+
"backdrop-invert": [{
|
|
1752
|
+
"backdrop-invert": [invert]
|
|
1753
|
+
}],
|
|
1754
|
+
"backdrop-opacity": [{
|
|
1755
|
+
"backdrop-opacity": [opacity]
|
|
1756
|
+
}],
|
|
1757
|
+
"backdrop-saturate": [{
|
|
1758
|
+
"backdrop-saturate": [saturate]
|
|
1759
|
+
}],
|
|
1760
|
+
"backdrop-sepia": [{
|
|
1761
|
+
"backdrop-sepia": [sepia]
|
|
1762
|
+
}],
|
|
1763
|
+
"border-collapse": [{
|
|
1764
|
+
border: ["collapse", "separate"]
|
|
1765
|
+
}],
|
|
1766
|
+
"border-spacing": [{
|
|
1767
|
+
"border-spacing": [borderSpacing]
|
|
1768
|
+
}],
|
|
1769
|
+
"border-spacing-x": [{
|
|
1770
|
+
"border-spacing-x": [borderSpacing]
|
|
1771
|
+
}],
|
|
1772
|
+
"border-spacing-y": [{
|
|
1773
|
+
"border-spacing-y": [borderSpacing]
|
|
1774
|
+
}],
|
|
1775
|
+
"table-layout": [{
|
|
1776
|
+
table: ["auto", "fixed"]
|
|
1777
|
+
}],
|
|
1778
|
+
caption: [{
|
|
1779
|
+
caption: ["top", "bottom"]
|
|
1780
|
+
}],
|
|
1781
|
+
transition: [{
|
|
1782
|
+
transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", isArbitraryValue]
|
|
1783
|
+
}],
|
|
1784
|
+
duration: [{
|
|
1785
|
+
duration: getNumberAndArbitrary()
|
|
1786
|
+
}],
|
|
1787
|
+
ease: [{
|
|
1788
|
+
ease: ["linear", "in", "out", "in-out", isArbitraryValue]
|
|
1789
|
+
}],
|
|
1790
|
+
delay: [{
|
|
1791
|
+
delay: getNumberAndArbitrary()
|
|
1792
|
+
}],
|
|
1793
|
+
animate: [{
|
|
1794
|
+
animate: ["none", "spin", "ping", "pulse", "bounce", isArbitraryValue]
|
|
1795
|
+
}],
|
|
1796
|
+
transform: [{
|
|
1797
|
+
transform: ["", "gpu", "none"]
|
|
1798
|
+
}],
|
|
1799
|
+
scale: [{
|
|
1800
|
+
scale: [scale]
|
|
1801
|
+
}],
|
|
1802
|
+
"scale-x": [{
|
|
1803
|
+
"scale-x": [scale]
|
|
1804
|
+
}],
|
|
1805
|
+
"scale-y": [{
|
|
1806
|
+
"scale-y": [scale]
|
|
1807
|
+
}],
|
|
1808
|
+
rotate: [{
|
|
1809
|
+
rotate: [isInteger, isArbitraryValue]
|
|
1810
|
+
}],
|
|
1811
|
+
"translate-x": [{
|
|
1812
|
+
"translate-x": [translate]
|
|
1813
|
+
}],
|
|
1814
|
+
"translate-y": [{
|
|
1815
|
+
"translate-y": [translate]
|
|
1816
|
+
}],
|
|
1817
|
+
"skew-x": [{
|
|
1818
|
+
"skew-x": [skew]
|
|
1819
|
+
}],
|
|
1820
|
+
"skew-y": [{
|
|
1821
|
+
"skew-y": [skew]
|
|
1822
|
+
}],
|
|
1823
|
+
"transform-origin": [{
|
|
1824
|
+
origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", isArbitraryValue]
|
|
1825
|
+
}],
|
|
1826
|
+
accent: [{
|
|
1827
|
+
accent: ["auto", colors]
|
|
1828
|
+
}],
|
|
1829
|
+
appearance: [{
|
|
1830
|
+
appearance: ["none", "auto"]
|
|
1831
|
+
}],
|
|
1832
|
+
cursor: [{
|
|
1833
|
+
cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryValue]
|
|
1834
|
+
}],
|
|
1835
|
+
"caret-color": [{
|
|
1836
|
+
caret: [colors]
|
|
1837
|
+
}],
|
|
1838
|
+
"pointer-events": [{
|
|
1839
|
+
"pointer-events": ["none", "auto"]
|
|
1840
|
+
}],
|
|
1841
|
+
resize: [{
|
|
1842
|
+
resize: ["none", "y", "x", ""]
|
|
1843
|
+
}],
|
|
1844
|
+
"scroll-behavior": [{
|
|
1845
|
+
scroll: ["auto", "smooth"]
|
|
1846
|
+
}],
|
|
1847
|
+
"scroll-m": [{
|
|
1848
|
+
"scroll-m": getSpacingWithArbitrary()
|
|
1849
|
+
}],
|
|
1850
|
+
"scroll-mx": [{
|
|
1851
|
+
"scroll-mx": getSpacingWithArbitrary()
|
|
1852
|
+
}],
|
|
1853
|
+
"scroll-my": [{
|
|
1854
|
+
"scroll-my": getSpacingWithArbitrary()
|
|
1855
|
+
}],
|
|
1856
|
+
"scroll-ms": [{
|
|
1857
|
+
"scroll-ms": getSpacingWithArbitrary()
|
|
1858
|
+
}],
|
|
1859
|
+
"scroll-me": [{
|
|
1860
|
+
"scroll-me": getSpacingWithArbitrary()
|
|
1861
|
+
}],
|
|
1862
|
+
"scroll-mt": [{
|
|
1863
|
+
"scroll-mt": getSpacingWithArbitrary()
|
|
1864
|
+
}],
|
|
1865
|
+
"scroll-mr": [{
|
|
1866
|
+
"scroll-mr": getSpacingWithArbitrary()
|
|
1867
|
+
}],
|
|
1868
|
+
"scroll-mb": [{
|
|
1869
|
+
"scroll-mb": getSpacingWithArbitrary()
|
|
1870
|
+
}],
|
|
1871
|
+
"scroll-ml": [{
|
|
1872
|
+
"scroll-ml": getSpacingWithArbitrary()
|
|
1873
|
+
}],
|
|
1874
|
+
"scroll-p": [{
|
|
1875
|
+
"scroll-p": getSpacingWithArbitrary()
|
|
1876
|
+
}],
|
|
1877
|
+
"scroll-px": [{
|
|
1878
|
+
"scroll-px": getSpacingWithArbitrary()
|
|
1879
|
+
}],
|
|
1880
|
+
"scroll-py": [{
|
|
1881
|
+
"scroll-py": getSpacingWithArbitrary()
|
|
1882
|
+
}],
|
|
1883
|
+
"scroll-ps": [{
|
|
1884
|
+
"scroll-ps": getSpacingWithArbitrary()
|
|
1885
|
+
}],
|
|
1886
|
+
"scroll-pe": [{
|
|
1887
|
+
"scroll-pe": getSpacingWithArbitrary()
|
|
1888
|
+
}],
|
|
1889
|
+
"scroll-pt": [{
|
|
1890
|
+
"scroll-pt": getSpacingWithArbitrary()
|
|
1891
|
+
}],
|
|
1892
|
+
"scroll-pr": [{
|
|
1893
|
+
"scroll-pr": getSpacingWithArbitrary()
|
|
1894
|
+
}],
|
|
1895
|
+
"scroll-pb": [{
|
|
1896
|
+
"scroll-pb": getSpacingWithArbitrary()
|
|
1897
|
+
}],
|
|
1898
|
+
"scroll-pl": [{
|
|
1899
|
+
"scroll-pl": getSpacingWithArbitrary()
|
|
1900
|
+
}],
|
|
1901
|
+
"snap-align": [{
|
|
1902
|
+
snap: ["start", "end", "center", "align-none"]
|
|
1903
|
+
}],
|
|
1904
|
+
"snap-stop": [{
|
|
1905
|
+
snap: ["normal", "always"]
|
|
1906
|
+
}],
|
|
1907
|
+
"snap-type": [{
|
|
1908
|
+
snap: ["none", "x", "y", "both"]
|
|
1909
|
+
}],
|
|
1910
|
+
"snap-strictness": [{
|
|
1911
|
+
snap: ["mandatory", "proximity"]
|
|
1912
|
+
}],
|
|
1913
|
+
touch: [{
|
|
1914
|
+
touch: ["auto", "none", "manipulation"]
|
|
1915
|
+
}],
|
|
1916
|
+
"touch-x": [{
|
|
1917
|
+
"touch-pan": ["x", "left", "right"]
|
|
1918
|
+
}],
|
|
1919
|
+
"touch-y": [{
|
|
1920
|
+
"touch-pan": ["y", "up", "down"]
|
|
1921
|
+
}],
|
|
1922
|
+
"touch-pz": ["touch-pinch-zoom"],
|
|
1923
|
+
select: [{
|
|
1924
|
+
select: ["none", "text", "all", "auto"]
|
|
1925
|
+
}],
|
|
1926
|
+
"will-change": [{
|
|
1927
|
+
"will-change": ["auto", "scroll", "contents", "transform", isArbitraryValue]
|
|
1928
|
+
}],
|
|
1929
|
+
fill: [{
|
|
1930
|
+
fill: [colors, "none"]
|
|
1931
|
+
}],
|
|
1932
|
+
"stroke-w": [{
|
|
1933
|
+
stroke: [isLength, isArbitraryLength, isArbitraryNumber]
|
|
1934
|
+
}],
|
|
1935
|
+
stroke: [{
|
|
1936
|
+
stroke: [colors, "none"]
|
|
1937
|
+
}],
|
|
1938
|
+
sr: ["sr-only", "not-sr-only"],
|
|
1939
|
+
"forced-color-adjust": [{
|
|
1940
|
+
"forced-color-adjust": ["auto", "none"]
|
|
1941
|
+
}]
|
|
1942
|
+
},
|
|
1943
|
+
conflictingClassGroups: {
|
|
1944
|
+
overflow: ["overflow-x", "overflow-y"],
|
|
1945
|
+
overscroll: ["overscroll-x", "overscroll-y"],
|
|
1946
|
+
inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
|
|
1947
|
+
"inset-x": ["right", "left"],
|
|
1948
|
+
"inset-y": ["top", "bottom"],
|
|
1949
|
+
flex: ["basis", "grow", "shrink"],
|
|
1950
|
+
gap: ["gap-x", "gap-y"],
|
|
1951
|
+
p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
|
|
1952
|
+
px: ["pr", "pl"],
|
|
1953
|
+
py: ["pt", "pb"],
|
|
1954
|
+
m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
|
|
1955
|
+
mx: ["mr", "ml"],
|
|
1956
|
+
my: ["mt", "mb"],
|
|
1957
|
+
size: ["w", "h"],
|
|
1958
|
+
"font-size": ["leading"],
|
|
1959
|
+
"fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
|
|
1960
|
+
"fvn-ordinal": ["fvn-normal"],
|
|
1961
|
+
"fvn-slashed-zero": ["fvn-normal"],
|
|
1962
|
+
"fvn-figure": ["fvn-normal"],
|
|
1963
|
+
"fvn-spacing": ["fvn-normal"],
|
|
1964
|
+
"fvn-fraction": ["fvn-normal"],
|
|
1965
|
+
"line-clamp": ["display", "overflow"],
|
|
1966
|
+
rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
|
|
1967
|
+
"rounded-s": ["rounded-ss", "rounded-es"],
|
|
1968
|
+
"rounded-e": ["rounded-se", "rounded-ee"],
|
|
1969
|
+
"rounded-t": ["rounded-tl", "rounded-tr"],
|
|
1970
|
+
"rounded-r": ["rounded-tr", "rounded-br"],
|
|
1971
|
+
"rounded-b": ["rounded-br", "rounded-bl"],
|
|
1972
|
+
"rounded-l": ["rounded-tl", "rounded-bl"],
|
|
1973
|
+
"border-spacing": ["border-spacing-x", "border-spacing-y"],
|
|
1974
|
+
"border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
|
|
1975
|
+
"border-w-x": ["border-w-r", "border-w-l"],
|
|
1976
|
+
"border-w-y": ["border-w-t", "border-w-b"],
|
|
1977
|
+
"border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
|
|
1978
|
+
"border-color-x": ["border-color-r", "border-color-l"],
|
|
1979
|
+
"border-color-y": ["border-color-t", "border-color-b"],
|
|
1980
|
+
"scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
|
|
1981
|
+
"scroll-mx": ["scroll-mr", "scroll-ml"],
|
|
1982
|
+
"scroll-my": ["scroll-mt", "scroll-mb"],
|
|
1983
|
+
"scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
|
|
1984
|
+
"scroll-px": ["scroll-pr", "scroll-pl"],
|
|
1985
|
+
"scroll-py": ["scroll-pt", "scroll-pb"],
|
|
1986
|
+
touch: ["touch-x", "touch-y", "touch-pz"],
|
|
1987
|
+
"touch-x": ["touch"],
|
|
1988
|
+
"touch-y": ["touch"],
|
|
1989
|
+
"touch-pz": ["touch"]
|
|
1990
|
+
},
|
|
1991
|
+
conflictingClassGroupModifiers: {
|
|
1992
|
+
"font-size": ["leading"]
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
};
|
|
1996
|
+
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1997
|
+
|
|
1998
|
+
// src/renderer/utils/cn.ts
|
|
1999
|
+
function cn(...inputs) {
|
|
2000
|
+
return twMerge(clsx(inputs));
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
// src/renderer/components/Text.tsx
|
|
2004
|
+
var jsx_dev_runtime = require("react/jsx-dev-runtime");
|
|
2005
|
+
var variantClasses = {
|
|
2006
|
+
default: "text-meissa-fg",
|
|
2007
|
+
muted: "text-meissa-muted",
|
|
2008
|
+
success: "text-meissa-success",
|
|
2009
|
+
warning: "text-meissa-warning",
|
|
2010
|
+
error: "text-meissa-destructive"
|
|
2011
|
+
};
|
|
2012
|
+
var alignClasses = {
|
|
2013
|
+
left: "text-left",
|
|
2014
|
+
center: "text-center",
|
|
2015
|
+
right: "text-right"
|
|
2016
|
+
};
|
|
2017
|
+
function Text({ node }) {
|
|
2018
|
+
const variant = node.variant || "default";
|
|
2019
|
+
const bold = node.bold;
|
|
2020
|
+
const align = node.align || "left";
|
|
2021
|
+
const content = node.content;
|
|
2022
|
+
return /* @__PURE__ */ jsx_dev_runtime.jsxDEV("p", {
|
|
2023
|
+
className: cn(variantClasses[variant], alignClasses[align], bold && "font-semibold", node.class),
|
|
2024
|
+
children: content
|
|
2025
|
+
}, undefined, false, undefined, this);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
// src/renderer/components/Heading.tsx
|
|
2029
|
+
var jsx_dev_runtime2 = require("react/jsx-dev-runtime");
|
|
2030
|
+
var levelClasses = {
|
|
2031
|
+
1: "text-3xl font-bold",
|
|
2032
|
+
2: "text-2xl font-semibold",
|
|
2033
|
+
3: "text-xl font-semibold",
|
|
2034
|
+
4: "text-lg font-medium",
|
|
2035
|
+
5: "text-base font-medium",
|
|
2036
|
+
6: "text-sm font-medium"
|
|
2037
|
+
};
|
|
2038
|
+
var alignClasses2 = {
|
|
2039
|
+
left: "text-left",
|
|
2040
|
+
center: "text-center",
|
|
2041
|
+
right: "text-right"
|
|
2042
|
+
};
|
|
2043
|
+
function Heading({ node }) {
|
|
2044
|
+
const level = node.level || 2;
|
|
2045
|
+
const align = node.align || "left";
|
|
2046
|
+
const content = node.content;
|
|
2047
|
+
const Tag = `h${level}`;
|
|
2048
|
+
return /* @__PURE__ */ jsx_dev_runtime2.jsxDEV(Tag, {
|
|
2049
|
+
className: cn(levelClasses[level], alignClasses2[align], "text-meissa-fg", node.class),
|
|
2050
|
+
children: content
|
|
2051
|
+
}, undefined, false, undefined, this);
|
|
2052
|
+
}
|
|
2053
|
+
|
|
2054
|
+
// src/renderer/components/Code.tsx
|
|
2055
|
+
var jsx_dev_runtime3 = require("react/jsx-dev-runtime");
|
|
2056
|
+
function Code({ node }) {
|
|
2057
|
+
const content = node.content;
|
|
2058
|
+
const lang = node.lang;
|
|
2059
|
+
const inline = node.inline;
|
|
2060
|
+
if (inline) {
|
|
2061
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("code", {
|
|
2062
|
+
className: cn("bg-meissa-fg/10 rounded px-1.5 py-0.5 text-sm font-mono text-meissa-fg", node.class),
|
|
2063
|
+
children: content
|
|
2064
|
+
}, undefined, false, undefined, this);
|
|
2065
|
+
}
|
|
2066
|
+
return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("pre", {
|
|
2067
|
+
className: cn("bg-meissa-fg/10 rounded-lg p-4 overflow-x-auto", node.class),
|
|
2068
|
+
children: /* @__PURE__ */ jsx_dev_runtime3.jsxDEV("code", {
|
|
2069
|
+
className: "text-sm font-mono text-meissa-fg",
|
|
2070
|
+
"data-lang": lang,
|
|
2071
|
+
children: content
|
|
2072
|
+
}, undefined, false, undefined, this)
|
|
2073
|
+
}, undefined, false, undefined, this);
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
// src/renderer/utils/sanitize.ts
|
|
2077
|
+
function sanitizeUrl(url) {
|
|
2078
|
+
const trimmed = url.trim().toLowerCase();
|
|
2079
|
+
if (trimmed.startsWith("javascript:") || trimmed.startsWith("data:text/html")) {
|
|
2080
|
+
return "about:blank";
|
|
2081
|
+
}
|
|
2082
|
+
return url;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
// src/renderer/components/Img.tsx
|
|
2086
|
+
var jsx_dev_runtime4 = require("react/jsx-dev-runtime");
|
|
2087
|
+
var fitClasses = {
|
|
2088
|
+
cover: "object-cover",
|
|
2089
|
+
contain: "object-contain",
|
|
2090
|
+
fill: "object-fill"
|
|
2091
|
+
};
|
|
2092
|
+
function Img({ node }) {
|
|
2093
|
+
const src = sanitizeUrl(node.src);
|
|
2094
|
+
const alt = node.alt || "";
|
|
2095
|
+
const w = node.w;
|
|
2096
|
+
const h = node.h;
|
|
2097
|
+
const fit = node.fit || "cover";
|
|
2098
|
+
return /* @__PURE__ */ jsx_dev_runtime4.jsxDEV("img", {
|
|
2099
|
+
src,
|
|
2100
|
+
alt,
|
|
2101
|
+
width: w,
|
|
2102
|
+
height: h,
|
|
2103
|
+
className: cn("rounded", fitClasses[fit], node.class)
|
|
2104
|
+
}, undefined, false, undefined, this);
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
// src/renderer/components/Btn.tsx
|
|
2108
|
+
var import_react4 = require("react");
|
|
2109
|
+
|
|
2110
|
+
// src/renderer/context/FormContext.tsx
|
|
2111
|
+
var import_react3 = require("react");
|
|
2112
|
+
var jsx_dev_runtime5 = require("react/jsx-dev-runtime");
|
|
2113
|
+
var FormContext = import_react3.createContext(null);
|
|
2114
|
+
function useForm() {
|
|
2115
|
+
return import_react3.useContext(FormContext);
|
|
2116
|
+
}
|
|
2117
|
+
function FormProvider({ submitAction, onSubmit, children }) {
|
|
2118
|
+
const [values, setValues] = import_react3.useState({});
|
|
2119
|
+
const setValue = import_react3.useCallback((name, value) => {
|
|
2120
|
+
setValues((prev) => ({ ...prev, [name]: value }));
|
|
2121
|
+
}, []);
|
|
2122
|
+
const submit = import_react3.useCallback((action, extraArgs) => {
|
|
2123
|
+
onSubmit(action || submitAction, { ...values, ...extraArgs });
|
|
2124
|
+
}, [submitAction, onSubmit, values]);
|
|
2125
|
+
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(FormContext.Provider, {
|
|
2126
|
+
value: { values, setValue, submit },
|
|
2127
|
+
children
|
|
2128
|
+
}, undefined, false, undefined, this);
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
// src/renderer/components/Btn.tsx
|
|
2132
|
+
var jsx_dev_runtime6 = require("react/jsx-dev-runtime");
|
|
2133
|
+
var variantClasses2 = {
|
|
2134
|
+
primary: "bg-meissa-primary text-white hover:opacity-90",
|
|
2135
|
+
secondary: "bg-meissa-fg/10 text-meissa-fg hover:bg-meissa-fg/15",
|
|
2136
|
+
destructive: "bg-meissa-destructive text-white hover:opacity-90",
|
|
2137
|
+
ghost: "hover:bg-meissa-fg/10 text-meissa-fg",
|
|
2138
|
+
outline: "border border-meissa-border text-meissa-fg hover:bg-meissa-fg/5"
|
|
2139
|
+
};
|
|
2140
|
+
var sizeClasses = {
|
|
2141
|
+
sm: "px-2.5 py-1 text-xs",
|
|
2142
|
+
md: "px-4 py-2 text-sm",
|
|
2143
|
+
lg: "px-6 py-3 text-base"
|
|
2144
|
+
};
|
|
2145
|
+
function Btn({ node }) {
|
|
2146
|
+
const { onAction, onNavigate } = useAction();
|
|
2147
|
+
const form = useForm();
|
|
2148
|
+
const label = node.label;
|
|
2149
|
+
const variant = node.variant || "primary";
|
|
2150
|
+
const size = node.size || "md";
|
|
2151
|
+
const disabled = node.disabled;
|
|
2152
|
+
const action = node.action;
|
|
2153
|
+
const args = node.args;
|
|
2154
|
+
const confirm = node.confirm;
|
|
2155
|
+
const navigate = node.navigate;
|
|
2156
|
+
const handleClick = import_react4.useCallback(() => {
|
|
2157
|
+
if (disabled)
|
|
2158
|
+
return;
|
|
2159
|
+
if (confirm) {
|
|
2160
|
+
if (!window.confirm(confirm))
|
|
2161
|
+
return;
|
|
2162
|
+
}
|
|
2163
|
+
if (navigate) {
|
|
2164
|
+
onNavigate(navigate);
|
|
2165
|
+
} else if (action) {
|
|
2166
|
+
onAction(action, args);
|
|
2167
|
+
} else if (form) {
|
|
2168
|
+
form.submit(undefined, args);
|
|
2169
|
+
}
|
|
2170
|
+
}, [disabled, confirm, navigate, action, args, form, onAction, onNavigate]);
|
|
2171
|
+
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV("button", {
|
|
2172
|
+
type: "button",
|
|
2173
|
+
disabled,
|
|
2174
|
+
onClick: handleClick,
|
|
2175
|
+
className: cn("inline-flex items-center justify-center rounded-md font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-meissa-primary", "disabled:opacity-50 disabled:pointer-events-none", variantClasses2[variant], sizeClasses[size], node.class),
|
|
2176
|
+
children: label
|
|
2177
|
+
}, undefined, false, undefined, this);
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2180
|
+
// src/renderer/components/Input.tsx
|
|
2181
|
+
var import_react5 = require("react");
|
|
2182
|
+
var jsx_dev_runtime7 = require("react/jsx-dev-runtime");
|
|
2183
|
+
function Input({ node }) {
|
|
2184
|
+
const form = useForm();
|
|
2185
|
+
const name = node.name;
|
|
2186
|
+
const type = node.type || "text";
|
|
2187
|
+
const label = node.label;
|
|
2188
|
+
const placeholder = node.placeholder;
|
|
2189
|
+
const required = node.required;
|
|
2190
|
+
const disabled = node.disabled;
|
|
2191
|
+
const value = form?.values[name] ?? node.value ?? "";
|
|
2192
|
+
const handleChange = import_react5.useCallback((e) => {
|
|
2193
|
+
form?.setValue(name, e.target.value);
|
|
2194
|
+
}, [form, name]);
|
|
2195
|
+
const inputClasses = cn("w-full rounded-md border border-meissa-border bg-meissa-bg px-3 py-2 text-sm", "placeholder:text-meissa-muted", "focus:outline-none focus:ring-2 focus:ring-meissa-primary focus:border-transparent", "disabled:opacity-50 disabled:cursor-not-allowed", node.class);
|
|
2196
|
+
return /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("div", {
|
|
2197
|
+
className: "flex flex-col gap-1.5",
|
|
2198
|
+
children: [
|
|
2199
|
+
label && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("label", {
|
|
2200
|
+
className: "text-sm font-medium text-meissa-fg",
|
|
2201
|
+
children: [
|
|
2202
|
+
label,
|
|
2203
|
+
required && /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("span", {
|
|
2204
|
+
className: "text-meissa-destructive ml-1",
|
|
2205
|
+
children: "*"
|
|
2206
|
+
}, undefined, false, undefined, this)
|
|
2207
|
+
]
|
|
2208
|
+
}, undefined, true, undefined, this),
|
|
2209
|
+
type === "textarea" ? /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("textarea", {
|
|
2210
|
+
name,
|
|
2211
|
+
placeholder,
|
|
2212
|
+
required,
|
|
2213
|
+
disabled,
|
|
2214
|
+
value,
|
|
2215
|
+
onChange: handleChange,
|
|
2216
|
+
className: cn(inputClasses, "min-h-[80px] resize-y"),
|
|
2217
|
+
rows: 4
|
|
2218
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime7.jsxDEV("input", {
|
|
2219
|
+
name,
|
|
2220
|
+
type,
|
|
2221
|
+
placeholder,
|
|
2222
|
+
required,
|
|
2223
|
+
disabled,
|
|
2224
|
+
value,
|
|
2225
|
+
onChange: handleChange,
|
|
2226
|
+
className: inputClasses
|
|
2227
|
+
}, undefined, false, undefined, this)
|
|
2228
|
+
]
|
|
2229
|
+
}, undefined, true, undefined, this);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
// src/renderer/components/Select.tsx
|
|
2233
|
+
var import_react6 = require("react");
|
|
2234
|
+
var jsx_dev_runtime8 = require("react/jsx-dev-runtime");
|
|
2235
|
+
function normalizeOptions(raw) {
|
|
2236
|
+
return raw.map((item) => {
|
|
2237
|
+
if (typeof item === "string")
|
|
2238
|
+
return { label: item, value: item };
|
|
2239
|
+
const obj = item;
|
|
2240
|
+
return { label: obj.label || obj.value, value: obj.value || obj.label };
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
function Select({ node }) {
|
|
2244
|
+
const form = useForm();
|
|
2245
|
+
const name = node.name;
|
|
2246
|
+
const label = node.label;
|
|
2247
|
+
const placeholder = node.placeholder || "Select...";
|
|
2248
|
+
const required = node.required;
|
|
2249
|
+
const multiple = node.multiple;
|
|
2250
|
+
const rawOptions = node.options || [];
|
|
2251
|
+
const options = normalizeOptions(rawOptions);
|
|
2252
|
+
const value = form?.values[name] ?? node.value ?? "";
|
|
2253
|
+
const handleChange = import_react6.useCallback((e) => {
|
|
2254
|
+
form?.setValue(name, e.target.value);
|
|
2255
|
+
}, [form, name]);
|
|
2256
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("div", {
|
|
2257
|
+
className: "flex flex-col gap-1.5",
|
|
2258
|
+
children: [
|
|
2259
|
+
label && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("label", {
|
|
2260
|
+
className: "text-sm font-medium text-meissa-fg",
|
|
2261
|
+
children: [
|
|
2262
|
+
label,
|
|
2263
|
+
required && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("span", {
|
|
2264
|
+
className: "text-meissa-destructive ml-1",
|
|
2265
|
+
children: "*"
|
|
2266
|
+
}, undefined, false, undefined, this)
|
|
2267
|
+
]
|
|
2268
|
+
}, undefined, true, undefined, this),
|
|
2269
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV("select", {
|
|
2270
|
+
name,
|
|
2271
|
+
required,
|
|
2272
|
+
multiple,
|
|
2273
|
+
value,
|
|
2274
|
+
onChange: handleChange,
|
|
2275
|
+
className: cn("w-full rounded-md border border-meissa-border bg-meissa-bg px-3 py-2 text-sm", "focus:outline-none focus:ring-2 focus:ring-meissa-primary focus:border-transparent", "disabled:opacity-50 disabled:cursor-not-allowed", node.class),
|
|
2276
|
+
children: [
|
|
2277
|
+
!multiple && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("option", {
|
|
2278
|
+
value: "",
|
|
2279
|
+
children: placeholder
|
|
2280
|
+
}, undefined, false, undefined, this),
|
|
2281
|
+
options.map((opt) => /* @__PURE__ */ jsx_dev_runtime8.jsxDEV("option", {
|
|
2282
|
+
value: opt.value,
|
|
2283
|
+
children: opt.label
|
|
2284
|
+
}, opt.value, false, undefined, this))
|
|
2285
|
+
]
|
|
2286
|
+
}, undefined, true, undefined, this)
|
|
2287
|
+
]
|
|
2288
|
+
}, undefined, true, undefined, this);
|
|
2289
|
+
}
|
|
2290
|
+
|
|
2291
|
+
// src/renderer/components/Form.tsx
|
|
2292
|
+
var import_react7 = require("react");
|
|
2293
|
+
var jsx_dev_runtime9 = require("react/jsx-dev-runtime");
|
|
2294
|
+
function Form({ node, children }) {
|
|
2295
|
+
const { onAction } = useAction();
|
|
2296
|
+
const submit = node.submit;
|
|
2297
|
+
const args = node.args || {};
|
|
2298
|
+
const handleSubmit = import_react7.useCallback((action, formValues) => {
|
|
2299
|
+
onAction(action || submit, { ...args, ...formValues });
|
|
2300
|
+
}, [onAction, submit, args]);
|
|
2301
|
+
const onFormSubmit = import_react7.useCallback((e) => {
|
|
2302
|
+
e.preventDefault();
|
|
2303
|
+
}, []);
|
|
2304
|
+
return /* @__PURE__ */ jsx_dev_runtime9.jsxDEV(FormProvider, {
|
|
2305
|
+
submitAction: submit,
|
|
2306
|
+
onSubmit: handleSubmit,
|
|
2307
|
+
children: /* @__PURE__ */ jsx_dev_runtime9.jsxDEV("form", {
|
|
2308
|
+
onSubmit: onFormSubmit,
|
|
2309
|
+
className: cn("flex flex-col gap-4", node.class),
|
|
2310
|
+
children
|
|
2311
|
+
}, undefined, false, undefined, this)
|
|
2312
|
+
}, undefined, false, undefined, this);
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
// src/renderer/components/Table.tsx
|
|
2316
|
+
var import_react8 = require("react");
|
|
2317
|
+
var jsx_dev_runtime10 = require("react/jsx-dev-runtime");
|
|
2318
|
+
function toTitleCase(key) {
|
|
2319
|
+
return key.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
2320
|
+
}
|
|
2321
|
+
function isNumeric(val) {
|
|
2322
|
+
return typeof val === "number" || typeof val === "string" && !isNaN(Number(val)) && val.trim() !== "";
|
|
2323
|
+
}
|
|
2324
|
+
function Table({ node }) {
|
|
2325
|
+
const { onAction } = useAction();
|
|
2326
|
+
const data = node.data || [];
|
|
2327
|
+
const customColumns = node.columns;
|
|
2328
|
+
const headers = node.headers || {};
|
|
2329
|
+
const sortable = node.sortable !== false;
|
|
2330
|
+
const paginate = node.paginate;
|
|
2331
|
+
const actions = node.actions;
|
|
2332
|
+
const [sortKey, setSortKey] = import_react8.useState(null);
|
|
2333
|
+
const [sortDir, setSortDir] = import_react8.useState("asc");
|
|
2334
|
+
const [page, setPage] = import_react8.useState(0);
|
|
2335
|
+
const columns = import_react8.useMemo(() => {
|
|
2336
|
+
if (customColumns)
|
|
2337
|
+
return customColumns;
|
|
2338
|
+
if (data.length === 0)
|
|
2339
|
+
return [];
|
|
2340
|
+
return Object.keys(data[0]);
|
|
2341
|
+
}, [customColumns, data]);
|
|
2342
|
+
const numericCols = import_react8.useMemo(() => {
|
|
2343
|
+
if (data.length === 0)
|
|
2344
|
+
return new Set;
|
|
2345
|
+
const set = new Set;
|
|
2346
|
+
for (const col of columns) {
|
|
2347
|
+
if (data.every((row) => row[col] == null || isNumeric(row[col]))) {
|
|
2348
|
+
set.add(col);
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
return set;
|
|
2352
|
+
}, [columns, data]);
|
|
2353
|
+
const sortedData = import_react8.useMemo(() => {
|
|
2354
|
+
if (!sortKey)
|
|
2355
|
+
return data;
|
|
2356
|
+
return [...data].sort((a, b) => {
|
|
2357
|
+
const av = a[sortKey];
|
|
2358
|
+
const bv = b[sortKey];
|
|
2359
|
+
if (av == null && bv == null)
|
|
2360
|
+
return 0;
|
|
2361
|
+
if (av == null)
|
|
2362
|
+
return 1;
|
|
2363
|
+
if (bv == null)
|
|
2364
|
+
return -1;
|
|
2365
|
+
const cmp = numericCols.has(sortKey) ? Number(av) - Number(bv) : String(av).localeCompare(String(bv));
|
|
2366
|
+
return sortDir === "asc" ? cmp : -cmp;
|
|
2367
|
+
});
|
|
2368
|
+
}, [data, sortKey, sortDir, numericCols]);
|
|
2369
|
+
const paginatedData = import_react8.useMemo(() => {
|
|
2370
|
+
if (!paginate)
|
|
2371
|
+
return sortedData;
|
|
2372
|
+
const start = page * paginate;
|
|
2373
|
+
return sortedData.slice(start, start + paginate);
|
|
2374
|
+
}, [sortedData, page, paginate]);
|
|
2375
|
+
const totalPages = paginate ? Math.ceil(data.length / paginate) : 1;
|
|
2376
|
+
const handleSort = import_react8.useCallback((col) => {
|
|
2377
|
+
if (!sortable)
|
|
2378
|
+
return;
|
|
2379
|
+
if (sortKey === col) {
|
|
2380
|
+
setSortDir((d) => d === "asc" ? "desc" : "asc");
|
|
2381
|
+
} else {
|
|
2382
|
+
setSortKey(col);
|
|
2383
|
+
setSortDir("asc");
|
|
2384
|
+
}
|
|
2385
|
+
}, [sortable, sortKey]);
|
|
2386
|
+
const handleAction = import_react8.useCallback((action, row) => {
|
|
2387
|
+
const resolvedArgs = {};
|
|
2388
|
+
if (action.args) {
|
|
2389
|
+
for (const [k, v] of Object.entries(action.args)) {
|
|
2390
|
+
if (typeof v === "string" && v.startsWith("{{$.") && v.endsWith("}}")) {
|
|
2391
|
+
const path = v.slice(4, -2);
|
|
2392
|
+
resolvedArgs[k] = row[path];
|
|
2393
|
+
} else {
|
|
2394
|
+
resolvedArgs[k] = v;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
onAction(action.action, resolvedArgs);
|
|
2399
|
+
}, [onAction]);
|
|
2400
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
|
|
2401
|
+
className: cn("w-full overflow-x-auto", node.class),
|
|
2402
|
+
children: [
|
|
2403
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("table", {
|
|
2404
|
+
className: "w-full text-sm",
|
|
2405
|
+
children: [
|
|
2406
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("thead", {
|
|
2407
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("tr", {
|
|
2408
|
+
className: "border-b border-meissa-border",
|
|
2409
|
+
children: [
|
|
2410
|
+
columns.map((col) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("th", {
|
|
2411
|
+
onClick: () => handleSort(col),
|
|
2412
|
+
className: cn("px-3 py-2 font-medium text-meissa-muted", numericCols.has(col) ? "text-right" : "text-left", sortable && "cursor-pointer select-none hover:text-meissa-fg"),
|
|
2413
|
+
children: [
|
|
2414
|
+
headers[col] || toTitleCase(col),
|
|
2415
|
+
sortKey === col && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("span", {
|
|
2416
|
+
className: "ml-1",
|
|
2417
|
+
children: sortDir === "asc" ? "↑" : "↓"
|
|
2418
|
+
}, undefined, false, undefined, this)
|
|
2419
|
+
]
|
|
2420
|
+
}, col, true, undefined, this)),
|
|
2421
|
+
actions && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("th", {
|
|
2422
|
+
className: "px-3 py-2"
|
|
2423
|
+
}, undefined, false, undefined, this)
|
|
2424
|
+
]
|
|
2425
|
+
}, undefined, true, undefined, this)
|
|
2426
|
+
}, undefined, false, undefined, this),
|
|
2427
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("tbody", {
|
|
2428
|
+
children: paginatedData.map((row, i) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("tr", {
|
|
2429
|
+
className: cn("border-b border-meissa-border last:border-0", i % 2 === 1 && "bg-meissa-fg/[0.03]"),
|
|
2430
|
+
children: [
|
|
2431
|
+
columns.map((col) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("td", {
|
|
2432
|
+
className: cn("px-3 py-2 text-meissa-fg", numericCols.has(col) ? "text-right" : "text-left"),
|
|
2433
|
+
children: row[col] != null ? String(row[col]) : ""
|
|
2434
|
+
}, col, false, undefined, this)),
|
|
2435
|
+
actions && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("td", {
|
|
2436
|
+
className: "px-3 py-2 text-right",
|
|
2437
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
|
|
2438
|
+
className: "flex justify-end gap-1",
|
|
2439
|
+
children: actions.map((action, ai) => /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("button", {
|
|
2440
|
+
type: "button",
|
|
2441
|
+
onClick: () => handleAction(action, row),
|
|
2442
|
+
className: cn("px-2 py-1 text-xs rounded font-medium", action.variant === "destructive" ? "text-meissa-destructive hover:bg-meissa-destructive/10" : "text-meissa-primary hover:bg-meissa-primary/10"),
|
|
2443
|
+
children: action.label
|
|
2444
|
+
}, ai, false, undefined, this))
|
|
2445
|
+
}, undefined, false, undefined, this)
|
|
2446
|
+
}, undefined, false, undefined, this)
|
|
2447
|
+
]
|
|
2448
|
+
}, i, true, undefined, this))
|
|
2449
|
+
}, undefined, false, undefined, this)
|
|
2450
|
+
]
|
|
2451
|
+
}, undefined, true, undefined, this),
|
|
2452
|
+
paginate && totalPages > 1 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
|
|
2453
|
+
className: "flex items-center justify-between px-3 py-2 border-t border-meissa-border",
|
|
2454
|
+
children: [
|
|
2455
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("span", {
|
|
2456
|
+
className: "text-xs text-meissa-muted",
|
|
2457
|
+
children: [
|
|
2458
|
+
"Page ",
|
|
2459
|
+
page + 1,
|
|
2460
|
+
" of ",
|
|
2461
|
+
totalPages
|
|
2462
|
+
]
|
|
2463
|
+
}, undefined, true, undefined, this),
|
|
2464
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("div", {
|
|
2465
|
+
className: "flex gap-1",
|
|
2466
|
+
children: [
|
|
2467
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("button", {
|
|
2468
|
+
type: "button",
|
|
2469
|
+
disabled: page === 0,
|
|
2470
|
+
onClick: () => setPage((p) => p - 1),
|
|
2471
|
+
className: "px-2 py-1 text-xs rounded border border-meissa-border disabled:opacity-50",
|
|
2472
|
+
children: "Prev"
|
|
2473
|
+
}, undefined, false, undefined, this),
|
|
2474
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV("button", {
|
|
2475
|
+
type: "button",
|
|
2476
|
+
disabled: page >= totalPages - 1,
|
|
2477
|
+
onClick: () => setPage((p) => p + 1),
|
|
2478
|
+
className: "px-2 py-1 text-xs rounded border border-meissa-border disabled:opacity-50",
|
|
2479
|
+
children: "Next"
|
|
2480
|
+
}, undefined, false, undefined, this)
|
|
2481
|
+
]
|
|
2482
|
+
}, undefined, true, undefined, this)
|
|
2483
|
+
]
|
|
2484
|
+
}, undefined, true, undefined, this)
|
|
2485
|
+
]
|
|
2486
|
+
}, undefined, true, undefined, this);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
// src/renderer/components/List.tsx
|
|
2490
|
+
var jsx_dev_runtime11 = require("react/jsx-dev-runtime");
|
|
2491
|
+
var variantClasses3 = {
|
|
2492
|
+
default: "space-y-1",
|
|
2493
|
+
compact: "space-y-0.5",
|
|
2494
|
+
spaced: "space-y-3"
|
|
2495
|
+
};
|
|
2496
|
+
function List({ node }) {
|
|
2497
|
+
const items = node.items || [];
|
|
2498
|
+
const ordered = node.ordered;
|
|
2499
|
+
const variant = node.variant || "default";
|
|
2500
|
+
const Tag = ordered ? "ol" : "ul";
|
|
2501
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Tag, {
|
|
2502
|
+
className: cn(ordered ? "list-decimal" : "list-disc", "pl-5 text-sm text-meissa-fg", variantClasses3[variant], node.class),
|
|
2503
|
+
children: items.map((item, i) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV("li", {
|
|
2504
|
+
children: String(item)
|
|
2505
|
+
}, i, false, undefined, this))
|
|
2506
|
+
}, undefined, false, undefined, this);
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
// src/renderer/components/Chart.tsx
|
|
2510
|
+
var import_react9 = require("react");
|
|
2511
|
+
var jsx_dev_runtime12 = require("react/jsx-dev-runtime");
|
|
2512
|
+
var rechartsPromise = import("recharts");
|
|
2513
|
+
var COLORS = ["#6366f1", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6", "#06b6d4"];
|
|
2514
|
+
function ChartInner({ node }) {
|
|
2515
|
+
const data = node.data || [];
|
|
2516
|
+
const type = node.type || "line";
|
|
2517
|
+
const x = node.x;
|
|
2518
|
+
const y = node.y;
|
|
2519
|
+
const title = node.title;
|
|
2520
|
+
const legend = node.legend !== false;
|
|
2521
|
+
const h = node.h || 256;
|
|
2522
|
+
const colors = node.colors || COLORS;
|
|
2523
|
+
const { xKey, yKeys } = import_react9.useMemo(() => {
|
|
2524
|
+
if (data.length === 0)
|
|
2525
|
+
return { xKey: "", yKeys: [] };
|
|
2526
|
+
const keys = Object.keys(data[0]);
|
|
2527
|
+
const resolvedX = x || keys[0];
|
|
2528
|
+
const resolvedY = y ? Array.isArray(y) ? y : [y] : keys.filter((k) => k !== resolvedX);
|
|
2529
|
+
return { xKey: resolvedX, yKeys: resolvedY };
|
|
2530
|
+
}, [data, x, y]);
|
|
2531
|
+
if (data.length === 0) {
|
|
2532
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV("div", {
|
|
2533
|
+
className: "text-sm text-meissa-muted italic",
|
|
2534
|
+
children: "No data"
|
|
2535
|
+
}, undefined, false, undefined, this);
|
|
2536
|
+
}
|
|
2537
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV("div", {
|
|
2538
|
+
className: cn("w-full", node.class),
|
|
2539
|
+
style: { height: h },
|
|
2540
|
+
children: [
|
|
2541
|
+
title && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV("p", {
|
|
2542
|
+
className: "text-sm font-medium text-meissa-fg mb-2",
|
|
2543
|
+
children: title
|
|
2544
|
+
}, undefined, false, undefined, this),
|
|
2545
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(import_react9.Suspense, {
|
|
2546
|
+
fallback: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV("div", {
|
|
2547
|
+
className: "animate-pulse bg-meissa-fg/10 rounded w-full h-full"
|
|
2548
|
+
}, undefined, false, undefined, this),
|
|
2549
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(RechartsChart, {
|
|
2550
|
+
data,
|
|
2551
|
+
type,
|
|
2552
|
+
xKey,
|
|
2553
|
+
yKeys,
|
|
2554
|
+
colors,
|
|
2555
|
+
legend,
|
|
2556
|
+
h: h - (title ? 28 : 0)
|
|
2557
|
+
}, undefined, false, undefined, this)
|
|
2558
|
+
}, undefined, false, undefined, this)
|
|
2559
|
+
]
|
|
2560
|
+
}, undefined, true, undefined, this);
|
|
2561
|
+
}
|
|
2562
|
+
function RechartsChart({ data, type, xKey, yKeys, colors, legend, h }) {
|
|
2563
|
+
const recharts = import_react9.use(rechartsPromise);
|
|
2564
|
+
const {
|
|
2565
|
+
ResponsiveContainer,
|
|
2566
|
+
LineChart,
|
|
2567
|
+
Line,
|
|
2568
|
+
BarChart,
|
|
2569
|
+
Bar,
|
|
2570
|
+
AreaChart,
|
|
2571
|
+
Area,
|
|
2572
|
+
PieChart,
|
|
2573
|
+
Pie,
|
|
2574
|
+
Cell,
|
|
2575
|
+
XAxis,
|
|
2576
|
+
YAxis,
|
|
2577
|
+
CartesianGrid,
|
|
2578
|
+
Tooltip,
|
|
2579
|
+
Legend
|
|
2580
|
+
} = recharts;
|
|
2581
|
+
if (type === "sparkline") {
|
|
2582
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ResponsiveContainer, {
|
|
2583
|
+
width: "100%",
|
|
2584
|
+
height: h,
|
|
2585
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(LineChart, {
|
|
2586
|
+
data,
|
|
2587
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Line, {
|
|
2588
|
+
type: "monotone",
|
|
2589
|
+
dataKey: yKeys[0],
|
|
2590
|
+
stroke: colors[0],
|
|
2591
|
+
strokeWidth: 2,
|
|
2592
|
+
dot: false
|
|
2593
|
+
}, undefined, false, undefined, this)
|
|
2594
|
+
}, undefined, false, undefined, this)
|
|
2595
|
+
}, undefined, false, undefined, this);
|
|
2596
|
+
}
|
|
2597
|
+
if (type === "pie" || type === "donut") {
|
|
2598
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ResponsiveContainer, {
|
|
2599
|
+
width: "100%",
|
|
2600
|
+
height: h,
|
|
2601
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(PieChart, {
|
|
2602
|
+
children: [
|
|
2603
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Pie, {
|
|
2604
|
+
data,
|
|
2605
|
+
dataKey: yKeys[0],
|
|
2606
|
+
nameKey: xKey,
|
|
2607
|
+
innerRadius: type === "donut" ? "60%" : 0,
|
|
2608
|
+
outerRadius: "80%",
|
|
2609
|
+
children: data.map((_, i) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Cell, {
|
|
2610
|
+
fill: colors[i % colors.length]
|
|
2611
|
+
}, i, false, undefined, this))
|
|
2612
|
+
}, undefined, false, undefined, this),
|
|
2613
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Tooltip, {}, undefined, false, undefined, this),
|
|
2614
|
+
legend && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Legend, {}, undefined, false, undefined, this)
|
|
2615
|
+
]
|
|
2616
|
+
}, undefined, true, undefined, this)
|
|
2617
|
+
}, undefined, false, undefined, this);
|
|
2618
|
+
}
|
|
2619
|
+
const ChartComponent = type === "bar" ? BarChart : type === "area" ? AreaChart : LineChart;
|
|
2620
|
+
const SeriesComponent = type === "bar" ? Bar : type === "area" ? Area : Line;
|
|
2621
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ResponsiveContainer, {
|
|
2622
|
+
width: "100%",
|
|
2623
|
+
height: h,
|
|
2624
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ChartComponent, {
|
|
2625
|
+
data,
|
|
2626
|
+
children: [
|
|
2627
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(CartesianGrid, {
|
|
2628
|
+
strokeDasharray: "3 3"
|
|
2629
|
+
}, undefined, false, undefined, this),
|
|
2630
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(XAxis, {
|
|
2631
|
+
dataKey: xKey,
|
|
2632
|
+
tick: { fontSize: 12 }
|
|
2633
|
+
}, undefined, false, undefined, this),
|
|
2634
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(YAxis, {
|
|
2635
|
+
tick: { fontSize: 12 }
|
|
2636
|
+
}, undefined, false, undefined, this),
|
|
2637
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Tooltip, {}, undefined, false, undefined, this),
|
|
2638
|
+
legend && yKeys.length > 1 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Legend, {}, undefined, false, undefined, this),
|
|
2639
|
+
yKeys.map((key, i) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(SeriesComponent, {
|
|
2640
|
+
type: "monotone",
|
|
2641
|
+
dataKey: key,
|
|
2642
|
+
stroke: colors[i % colors.length],
|
|
2643
|
+
fill: colors[i % colors.length],
|
|
2644
|
+
...type === "area" ? { fillOpacity: 0.3 } : {}
|
|
2645
|
+
}, key, false, undefined, this))
|
|
2646
|
+
]
|
|
2647
|
+
}, undefined, true, undefined, this)
|
|
2648
|
+
}, undefined, false, undefined, this);
|
|
2649
|
+
}
|
|
2650
|
+
function Chart({ node }) {
|
|
2651
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ChartInner, {
|
|
2652
|
+
node
|
|
2653
|
+
}, undefined, false, undefined, this);
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
// src/renderer/components/Stat.tsx
|
|
2657
|
+
var jsx_dev_runtime13 = require("react/jsx-dev-runtime");
|
|
2658
|
+
var variantClasses4 = {
|
|
2659
|
+
default: "",
|
|
2660
|
+
success: "text-green-600",
|
|
2661
|
+
warning: "text-yellow-600",
|
|
2662
|
+
destructive: "text-red-600"
|
|
2663
|
+
};
|
|
2664
|
+
function Stat({ node }) {
|
|
2665
|
+
const value = node.value;
|
|
2666
|
+
const label = node.label;
|
|
2667
|
+
const trend = node.trend;
|
|
2668
|
+
const variant = node.variant || "default";
|
|
2669
|
+
const trendPositive = trend?.startsWith("+");
|
|
2670
|
+
const trendNegative = trend?.startsWith("-");
|
|
2671
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV("div", {
|
|
2672
|
+
className: cn("flex flex-col gap-1", node.class),
|
|
2673
|
+
children: [
|
|
2674
|
+
label && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV("span", {
|
|
2675
|
+
className: "text-sm text-meissa-muted",
|
|
2676
|
+
children: label
|
|
2677
|
+
}, undefined, false, undefined, this),
|
|
2678
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV("div", {
|
|
2679
|
+
className: "flex items-baseline gap-2",
|
|
2680
|
+
children: [
|
|
2681
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV("span", {
|
|
2682
|
+
className: cn("text-2xl font-semibold", variantClasses4[variant] || "text-meissa-fg"),
|
|
2683
|
+
children: value
|
|
2684
|
+
}, undefined, false, undefined, this),
|
|
2685
|
+
trend && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV("span", {
|
|
2686
|
+
className: cn("text-sm font-medium", trendPositive && "text-green-600", trendNegative && "text-red-600", !trendPositive && !trendNegative && "text-meissa-muted"),
|
|
2687
|
+
children: [
|
|
2688
|
+
trendPositive && "↑",
|
|
2689
|
+
trendNegative && "↓",
|
|
2690
|
+
trend
|
|
2691
|
+
]
|
|
2692
|
+
}, undefined, true, undefined, this)
|
|
2693
|
+
]
|
|
2694
|
+
}, undefined, true, undefined, this)
|
|
2695
|
+
]
|
|
2696
|
+
}, undefined, true, undefined, this);
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/renderer/components/Card.tsx
|
|
2700
|
+
var jsx_dev_runtime14 = require("react/jsx-dev-runtime");
|
|
2701
|
+
var variantClasses5 = {
|
|
2702
|
+
default: "border border-meissa-border bg-meissa-bg",
|
|
2703
|
+
outline: "border-2 border-meissa-border bg-transparent",
|
|
2704
|
+
elevated: "border border-meissa-border bg-meissa-bg shadow-md"
|
|
2705
|
+
};
|
|
2706
|
+
var paddingClasses = {
|
|
2707
|
+
0: "p-0",
|
|
2708
|
+
1: "p-1",
|
|
2709
|
+
2: "p-2",
|
|
2710
|
+
3: "p-3",
|
|
2711
|
+
4: "p-4",
|
|
2712
|
+
6: "p-6",
|
|
2713
|
+
8: "p-8"
|
|
2714
|
+
};
|
|
2715
|
+
function Card({ node, children }) {
|
|
2716
|
+
const title = node.title;
|
|
2717
|
+
const subtitle = node.subtitle;
|
|
2718
|
+
const variant = node.variant || "default";
|
|
2719
|
+
const padding = node.padding ?? 4;
|
|
2720
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV("div", {
|
|
2721
|
+
className: cn("rounded-lg", variantClasses5[variant], node.class),
|
|
2722
|
+
children: [
|
|
2723
|
+
(title || subtitle) && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV("div", {
|
|
2724
|
+
className: cn("border-b border-meissa-border", paddingClasses[padding] || "p-4"),
|
|
2725
|
+
children: [
|
|
2726
|
+
title && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV("h3", {
|
|
2727
|
+
className: "font-semibold text-meissa-fg",
|
|
2728
|
+
children: title
|
|
2729
|
+
}, undefined, false, undefined, this),
|
|
2730
|
+
subtitle && /* @__PURE__ */ jsx_dev_runtime14.jsxDEV("p", {
|
|
2731
|
+
className: "text-sm text-meissa-muted mt-0.5",
|
|
2732
|
+
children: subtitle
|
|
2733
|
+
}, undefined, false, undefined, this)
|
|
2734
|
+
]
|
|
2735
|
+
}, undefined, true, undefined, this),
|
|
2736
|
+
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV("div", {
|
|
2737
|
+
className: cn("flex flex-col gap-4", paddingClasses[padding] || "p-4"),
|
|
2738
|
+
children
|
|
2739
|
+
}, undefined, false, undefined, this)
|
|
2740
|
+
]
|
|
2741
|
+
}, undefined, true, undefined, this);
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
// src/renderer/components/Tabs.tsx
|
|
2745
|
+
var import_react10 = require("react");
|
|
2746
|
+
var jsx_dev_runtime15 = require("react/jsx-dev-runtime");
|
|
2747
|
+
var tabVariantClasses = {
|
|
2748
|
+
default: "border-b-2 border-transparent data-[active=true]:border-meissa-primary data-[active=true]:text-meissa-primary",
|
|
2749
|
+
pills: "rounded-md data-[active=true]:bg-meissa-primary data-[active=true]:text-white",
|
|
2750
|
+
underline: "border-b-2 border-transparent data-[active=true]:border-meissa-fg data-[active=true]:text-meissa-fg"
|
|
2751
|
+
};
|
|
2752
|
+
function Tabs({ node, children }) {
|
|
2753
|
+
const items = node.items || {};
|
|
2754
|
+
const defaultTab = node.default || Object.keys(items)[0];
|
|
2755
|
+
const variant = node.variant || "default";
|
|
2756
|
+
const [activeTab, setActiveTab] = import_react10.useState(defaultTab);
|
|
2757
|
+
const tabKeys = Object.keys(items);
|
|
2758
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV("div", {
|
|
2759
|
+
className: cn("w-full", node.class),
|
|
2760
|
+
children: [
|
|
2761
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV("div", {
|
|
2762
|
+
className: cn("flex", variant === "default" || variant === "underline" ? "border-b border-meissa-border" : "gap-1"),
|
|
2763
|
+
role: "tablist",
|
|
2764
|
+
children: tabKeys.map((key) => /* @__PURE__ */ jsx_dev_runtime15.jsxDEV("button", {
|
|
2765
|
+
type: "button",
|
|
2766
|
+
role: "tab",
|
|
2767
|
+
"aria-selected": activeTab === key,
|
|
2768
|
+
"data-active": activeTab === key,
|
|
2769
|
+
onClick: () => setActiveTab(key),
|
|
2770
|
+
className: cn("px-4 py-2 text-sm font-medium text-meissa-muted transition-colors", "hover:text-meissa-fg", tabVariantClasses[variant]),
|
|
2771
|
+
children: key
|
|
2772
|
+
}, key, false, undefined, this))
|
|
2773
|
+
}, undefined, false, undefined, this),
|
|
2774
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV("div", {
|
|
2775
|
+
className: "pt-4",
|
|
2776
|
+
role: "tabpanel",
|
|
2777
|
+
children
|
|
2778
|
+
}, undefined, false, undefined, this)
|
|
2779
|
+
]
|
|
2780
|
+
}, undefined, true, undefined, this);
|
|
2781
|
+
}
|
|
2782
|
+
|
|
2783
|
+
// src/renderer/components/Alert.tsx
|
|
2784
|
+
var import_react11 = require("react");
|
|
2785
|
+
var jsx_dev_runtime16 = require("react/jsx-dev-runtime");
|
|
2786
|
+
var variantClasses6 = {
|
|
2787
|
+
info: "bg-meissa-primary/10 border-meissa-primary/20 text-meissa-primary",
|
|
2788
|
+
success: "bg-meissa-success/10 border-meissa-success/20 text-meissa-success",
|
|
2789
|
+
warning: "bg-meissa-warning/10 border-meissa-warning/20 text-meissa-warning",
|
|
2790
|
+
error: "bg-meissa-destructive/10 border-meissa-destructive/20 text-meissa-destructive"
|
|
2791
|
+
};
|
|
2792
|
+
function Alert({ node }) {
|
|
2793
|
+
const [dismissed, setDismissed] = import_react11.useState(false);
|
|
2794
|
+
const content = node.content;
|
|
2795
|
+
const variant = node.variant || "info";
|
|
2796
|
+
const title = node.title;
|
|
2797
|
+
const dismissible = node.dismissible;
|
|
2798
|
+
const handleDismiss = import_react11.useCallback(() => setDismissed(true), []);
|
|
2799
|
+
if (dismissed)
|
|
2800
|
+
return null;
|
|
2801
|
+
return /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("div", {
|
|
2802
|
+
role: "alert",
|
|
2803
|
+
className: cn("rounded-md border p-4", variantClasses6[variant], node.class),
|
|
2804
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("div", {
|
|
2805
|
+
className: "flex items-start justify-between",
|
|
2806
|
+
children: [
|
|
2807
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV("div", {
|
|
2808
|
+
className: "flex-1",
|
|
2809
|
+
children: [
|
|
2810
|
+
title && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("p", {
|
|
2811
|
+
className: "font-medium mb-1",
|
|
2812
|
+
children: title
|
|
2813
|
+
}, undefined, false, undefined, this),
|
|
2814
|
+
/* @__PURE__ */ jsx_dev_runtime16.jsxDEV("p", {
|
|
2815
|
+
className: "text-sm",
|
|
2816
|
+
children: content
|
|
2817
|
+
}, undefined, false, undefined, this)
|
|
2818
|
+
]
|
|
2819
|
+
}, undefined, true, undefined, this),
|
|
2820
|
+
dismissible && /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("button", {
|
|
2821
|
+
type: "button",
|
|
2822
|
+
onClick: handleDismiss,
|
|
2823
|
+
className: "ml-3 inline-flex shrink-0 rounded p-1 opacity-70 hover:opacity-100",
|
|
2824
|
+
"aria-label": "Dismiss",
|
|
2825
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("svg", {
|
|
2826
|
+
className: "h-4 w-4",
|
|
2827
|
+
fill: "none",
|
|
2828
|
+
viewBox: "0 0 24 24",
|
|
2829
|
+
stroke: "currentColor",
|
|
2830
|
+
children: /* @__PURE__ */ jsx_dev_runtime16.jsxDEV("path", {
|
|
2831
|
+
strokeLinecap: "round",
|
|
2832
|
+
strokeLinejoin: "round",
|
|
2833
|
+
strokeWidth: 2,
|
|
2834
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2835
|
+
}, undefined, false, undefined, this)
|
|
2836
|
+
}, undefined, false, undefined, this)
|
|
2837
|
+
}, undefined, false, undefined, this)
|
|
2838
|
+
]
|
|
2839
|
+
}, undefined, true, undefined, this)
|
|
2840
|
+
}, undefined, false, undefined, this);
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
// src/renderer/components/Badge.tsx
|
|
2844
|
+
var jsx_dev_runtime17 = require("react/jsx-dev-runtime");
|
|
2845
|
+
var variantClasses7 = {
|
|
2846
|
+
default: "bg-meissa-fg/10 text-meissa-fg",
|
|
2847
|
+
primary: "bg-meissa-primary/10 text-meissa-primary",
|
|
2848
|
+
success: "bg-meissa-success/10 text-meissa-success",
|
|
2849
|
+
warning: "bg-meissa-warning/10 text-meissa-warning",
|
|
2850
|
+
error: "bg-meissa-destructive/10 text-meissa-destructive",
|
|
2851
|
+
outline: "border border-meissa-border text-meissa-fg"
|
|
2852
|
+
};
|
|
2853
|
+
function Badge({ node }) {
|
|
2854
|
+
const content = node.content;
|
|
2855
|
+
const variant = node.variant || "default";
|
|
2856
|
+
return /* @__PURE__ */ jsx_dev_runtime17.jsxDEV("span", {
|
|
2857
|
+
className: cn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium", variantClasses7[variant], node.class),
|
|
2858
|
+
children: content
|
|
2859
|
+
}, undefined, false, undefined, this);
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
// src/renderer/components/Progress.tsx
|
|
2863
|
+
var jsx_dev_runtime18 = require("react/jsx-dev-runtime");
|
|
2864
|
+
var variantClasses8 = {
|
|
2865
|
+
default: "bg-meissa-primary",
|
|
2866
|
+
success: "bg-green-500",
|
|
2867
|
+
warning: "bg-yellow-500",
|
|
2868
|
+
error: "bg-red-500"
|
|
2869
|
+
};
|
|
2870
|
+
function Progress({ node }) {
|
|
2871
|
+
const value = node.value ?? 0;
|
|
2872
|
+
const label = node.label;
|
|
2873
|
+
const showValue = node.showValue;
|
|
2874
|
+
const variant = node.variant || "default";
|
|
2875
|
+
const indeterminate = node.indeterminate;
|
|
2876
|
+
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("div", {
|
|
2877
|
+
className: cn("w-full", node.class),
|
|
2878
|
+
children: [
|
|
2879
|
+
(label || showValue) && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("div", {
|
|
2880
|
+
className: "flex justify-between mb-1",
|
|
2881
|
+
children: [
|
|
2882
|
+
label && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("span", {
|
|
2883
|
+
className: "text-sm text-meissa-fg",
|
|
2884
|
+
children: label
|
|
2885
|
+
}, undefined, false, undefined, this),
|
|
2886
|
+
showValue && !indeterminate && /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("span", {
|
|
2887
|
+
className: "text-sm text-meissa-muted",
|
|
2888
|
+
children: [
|
|
2889
|
+
Math.round(value),
|
|
2890
|
+
"%"
|
|
2891
|
+
]
|
|
2892
|
+
}, undefined, true, undefined, this)
|
|
2893
|
+
]
|
|
2894
|
+
}, undefined, true, undefined, this),
|
|
2895
|
+
/* @__PURE__ */ jsx_dev_runtime18.jsxDEV("div", {
|
|
2896
|
+
className: "w-full h-2 bg-meissa-fg/10 rounded-full overflow-hidden",
|
|
2897
|
+
children: /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("div", {
|
|
2898
|
+
className: cn("h-full rounded-full transition-all duration-300", variantClasses8[variant], indeterminate && "animate-pulse w-full"),
|
|
2899
|
+
style: !indeterminate ? { width: `${Math.min(100, Math.max(0, value))}%` } : undefined,
|
|
2900
|
+
role: "progressbar",
|
|
2901
|
+
"aria-valuenow": indeterminate ? undefined : value,
|
|
2902
|
+
"aria-valuemin": 0,
|
|
2903
|
+
"aria-valuemax": 100
|
|
2904
|
+
}, undefined, false, undefined, this)
|
|
2905
|
+
}, undefined, false, undefined, this)
|
|
2906
|
+
]
|
|
2907
|
+
}, undefined, true, undefined, this);
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
// src/renderer/components/Divider.tsx
|
|
2911
|
+
var jsx_dev_runtime19 = require("react/jsx-dev-runtime");
|
|
2912
|
+
var spacingClasses = {
|
|
2913
|
+
0: "my-0",
|
|
2914
|
+
1: "my-1",
|
|
2915
|
+
2: "my-2",
|
|
2916
|
+
3: "my-3",
|
|
2917
|
+
4: "my-4",
|
|
2918
|
+
6: "my-6",
|
|
2919
|
+
8: "my-8",
|
|
2920
|
+
10: "my-10",
|
|
2921
|
+
12: "my-12",
|
|
2922
|
+
16: "my-16"
|
|
2923
|
+
};
|
|
2924
|
+
function Divider({ node }) {
|
|
2925
|
+
const label = node.label;
|
|
2926
|
+
const spacing = node.spacing ?? 4;
|
|
2927
|
+
if (label) {
|
|
2928
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV("div", {
|
|
2929
|
+
className: cn("flex items-center", spacingClasses[spacing] || "my-4", node.class),
|
|
2930
|
+
children: [
|
|
2931
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV("div", {
|
|
2932
|
+
className: "flex-1 border-t border-meissa-border"
|
|
2933
|
+
}, undefined, false, undefined, this),
|
|
2934
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV("span", {
|
|
2935
|
+
className: "px-3 text-sm text-meissa-muted",
|
|
2936
|
+
children: label
|
|
2937
|
+
}, undefined, false, undefined, this),
|
|
2938
|
+
/* @__PURE__ */ jsx_dev_runtime19.jsxDEV("div", {
|
|
2939
|
+
className: "flex-1 border-t border-meissa-border"
|
|
2940
|
+
}, undefined, false, undefined, this)
|
|
2941
|
+
]
|
|
2942
|
+
}, undefined, true, undefined, this);
|
|
2943
|
+
}
|
|
2944
|
+
return /* @__PURE__ */ jsx_dev_runtime19.jsxDEV("hr", {
|
|
2945
|
+
className: cn("border-t border-meissa-border", spacingClasses[spacing] || "my-4", node.class)
|
|
2946
|
+
}, undefined, false, undefined, this);
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
// src/renderer/components/Row.tsx
|
|
2950
|
+
var jsx_dev_runtime20 = require("react/jsx-dev-runtime");
|
|
2951
|
+
var alignClasses3 = {
|
|
2952
|
+
start: "items-start",
|
|
2953
|
+
center: "items-center",
|
|
2954
|
+
end: "items-end",
|
|
2955
|
+
stretch: "items-stretch"
|
|
2956
|
+
};
|
|
2957
|
+
var justifyClasses = {
|
|
2958
|
+
start: "justify-start",
|
|
2959
|
+
center: "justify-center",
|
|
2960
|
+
end: "justify-end",
|
|
2961
|
+
between: "justify-between",
|
|
2962
|
+
around: "justify-around"
|
|
2963
|
+
};
|
|
2964
|
+
var gapClasses = {
|
|
2965
|
+
0: "gap-0",
|
|
2966
|
+
1: "gap-1",
|
|
2967
|
+
2: "gap-2",
|
|
2968
|
+
3: "gap-3",
|
|
2969
|
+
4: "gap-4",
|
|
2970
|
+
6: "gap-6",
|
|
2971
|
+
8: "gap-8",
|
|
2972
|
+
10: "gap-10",
|
|
2973
|
+
12: "gap-12",
|
|
2974
|
+
16: "gap-16"
|
|
2975
|
+
};
|
|
2976
|
+
function Row({ node, children }) {
|
|
2977
|
+
const gap = node.gap ?? 4;
|
|
2978
|
+
const align = node.align || "center";
|
|
2979
|
+
const justify = node.justify || "start";
|
|
2980
|
+
const wrap = node.wrap;
|
|
2981
|
+
return /* @__PURE__ */ jsx_dev_runtime20.jsxDEV("div", {
|
|
2982
|
+
className: cn("flex flex-row", gapClasses[gap] || "gap-4", alignClasses3[align], justifyClasses[justify], wrap && "flex-wrap", "max-sm:flex-wrap", node.class),
|
|
2983
|
+
children
|
|
2984
|
+
}, undefined, false, undefined, this);
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
// src/renderer/components/Col.tsx
|
|
2988
|
+
var jsx_dev_runtime21 = require("react/jsx-dev-runtime");
|
|
2989
|
+
var alignClasses4 = {
|
|
2990
|
+
start: "items-start",
|
|
2991
|
+
center: "items-center",
|
|
2992
|
+
end: "items-end",
|
|
2993
|
+
stretch: "items-stretch"
|
|
2994
|
+
};
|
|
2995
|
+
var justifyClasses2 = {
|
|
2996
|
+
start: "justify-start",
|
|
2997
|
+
center: "justify-center",
|
|
2998
|
+
end: "justify-end",
|
|
2999
|
+
between: "justify-between",
|
|
3000
|
+
around: "justify-around"
|
|
3001
|
+
};
|
|
3002
|
+
var gapClasses2 = {
|
|
3003
|
+
0: "gap-0",
|
|
3004
|
+
1: "gap-1",
|
|
3005
|
+
2: "gap-2",
|
|
3006
|
+
3: "gap-3",
|
|
3007
|
+
4: "gap-4",
|
|
3008
|
+
6: "gap-6",
|
|
3009
|
+
8: "gap-8",
|
|
3010
|
+
10: "gap-10",
|
|
3011
|
+
12: "gap-12",
|
|
3012
|
+
16: "gap-16"
|
|
3013
|
+
};
|
|
3014
|
+
function Col({ node, children }) {
|
|
3015
|
+
const gap = node.gap ?? 4;
|
|
3016
|
+
const align = node.align || "stretch";
|
|
3017
|
+
const justify = node.justify || "start";
|
|
3018
|
+
return /* @__PURE__ */ jsx_dev_runtime21.jsxDEV("div", {
|
|
3019
|
+
className: cn("flex flex-col", gapClasses2[gap] || "gap-4", alignClasses4[align], justifyClasses2[justify], node.class),
|
|
3020
|
+
children
|
|
3021
|
+
}, undefined, false, undefined, this);
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
// src/renderer/components/Grid.tsx
|
|
3025
|
+
var jsx_dev_runtime22 = require("react/jsx-dev-runtime");
|
|
3026
|
+
var colsClasses = {
|
|
3027
|
+
1: "grid-cols-1",
|
|
3028
|
+
2: "grid-cols-2",
|
|
3029
|
+
3: "grid-cols-3",
|
|
3030
|
+
4: "grid-cols-4",
|
|
3031
|
+
5: "grid-cols-5",
|
|
3032
|
+
6: "grid-cols-6"
|
|
3033
|
+
};
|
|
3034
|
+
var gapClasses3 = {
|
|
3035
|
+
0: "gap-0",
|
|
3036
|
+
1: "gap-1",
|
|
3037
|
+
2: "gap-2",
|
|
3038
|
+
3: "gap-3",
|
|
3039
|
+
4: "gap-4",
|
|
3040
|
+
6: "gap-6",
|
|
3041
|
+
8: "gap-8",
|
|
3042
|
+
10: "gap-10",
|
|
3043
|
+
12: "gap-12",
|
|
3044
|
+
16: "gap-16"
|
|
3045
|
+
};
|
|
3046
|
+
var alignClasses5 = {
|
|
3047
|
+
start: "items-start",
|
|
3048
|
+
center: "items-center",
|
|
3049
|
+
end: "items-end",
|
|
3050
|
+
stretch: "items-stretch"
|
|
3051
|
+
};
|
|
3052
|
+
function Grid({ node, children }) {
|
|
3053
|
+
const cols = node.cols ?? 3;
|
|
3054
|
+
const gap = node.gap ?? 4;
|
|
3055
|
+
const align = node.align || "stretch";
|
|
3056
|
+
return /* @__PURE__ */ jsx_dev_runtime22.jsxDEV("div", {
|
|
3057
|
+
className: cn("grid", colsClasses[cols] || `grid-cols-${cols}`, gapClasses3[gap] || "gap-4", alignClasses5[align], "max-sm:grid-cols-1 max-md:grid-cols-2", node.class),
|
|
3058
|
+
children
|
|
3059
|
+
}, undefined, false, undefined, this);
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
// src/renderer/components/Split.tsx
|
|
3063
|
+
var jsx_dev_runtime23 = require("react/jsx-dev-runtime");
|
|
3064
|
+
var ratioMap = {
|
|
3065
|
+
"1/4": ["w-1/4", "w-3/4"],
|
|
3066
|
+
"1/3": ["w-1/3", "w-2/3"],
|
|
3067
|
+
"1/2": ["w-1/2", "w-1/2"],
|
|
3068
|
+
"2/3": ["w-2/3", "w-1/3"],
|
|
3069
|
+
"3/4": ["w-3/4", "w-1/4"]
|
|
3070
|
+
};
|
|
3071
|
+
var gapClasses4 = {
|
|
3072
|
+
0: "gap-0",
|
|
3073
|
+
1: "gap-1",
|
|
3074
|
+
2: "gap-2",
|
|
3075
|
+
3: "gap-3",
|
|
3076
|
+
4: "gap-4",
|
|
3077
|
+
6: "gap-6",
|
|
3078
|
+
8: "gap-8",
|
|
3079
|
+
10: "gap-10",
|
|
3080
|
+
12: "gap-12",
|
|
3081
|
+
16: "gap-16"
|
|
3082
|
+
};
|
|
3083
|
+
function Split({ node, children }) {
|
|
3084
|
+
const ratio = node.ratio || "1/3";
|
|
3085
|
+
const gap = node.gap ?? 4;
|
|
3086
|
+
const dir = node.dir || "row";
|
|
3087
|
+
const isCol = dir === "col";
|
|
3088
|
+
const [firstSize, secondSize] = ratioMap[ratio] || ["w-1/3", "w-2/3"];
|
|
3089
|
+
const childArray = Array.isArray(children) ? children : [children];
|
|
3090
|
+
return /* @__PURE__ */ jsx_dev_runtime23.jsxDEV("div", {
|
|
3091
|
+
className: cn("flex", isCol ? "flex-col" : "flex-row", gapClasses4[gap] || "gap-4", "max-sm:flex-col", node.class),
|
|
3092
|
+
children: [
|
|
3093
|
+
childArray[0] && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV("div", {
|
|
3094
|
+
className: cn(!isCol && firstSize, "max-sm:w-full"),
|
|
3095
|
+
children: childArray[0]
|
|
3096
|
+
}, undefined, false, undefined, this),
|
|
3097
|
+
childArray[1] && /* @__PURE__ */ jsx_dev_runtime23.jsxDEV("div", {
|
|
3098
|
+
className: cn(!isCol && secondSize, "max-sm:w-full"),
|
|
3099
|
+
children: childArray[1]
|
|
3100
|
+
}, undefined, false, undefined, this)
|
|
3101
|
+
]
|
|
3102
|
+
}, undefined, true, undefined, this);
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
// src/renderer/components/index.ts
|
|
3106
|
+
var COMPONENT_REGISTRY = {
|
|
3107
|
+
text: Text,
|
|
3108
|
+
heading: Heading,
|
|
3109
|
+
code: Code,
|
|
3110
|
+
img: Img,
|
|
3111
|
+
btn: Btn,
|
|
3112
|
+
input: Input,
|
|
3113
|
+
select: Select,
|
|
3114
|
+
form: Form,
|
|
3115
|
+
table: Table,
|
|
3116
|
+
list: List,
|
|
3117
|
+
chart: Chart,
|
|
3118
|
+
stat: Stat,
|
|
3119
|
+
card: Card,
|
|
3120
|
+
tabs: Tabs,
|
|
3121
|
+
alert: Alert,
|
|
3122
|
+
badge: Badge,
|
|
3123
|
+
progress: Progress,
|
|
3124
|
+
divider: Divider,
|
|
3125
|
+
row: Row,
|
|
3126
|
+
col: Col,
|
|
3127
|
+
grid: Grid,
|
|
3128
|
+
split: Split
|
|
3129
|
+
};
|
|
3130
|
+
|
|
3131
|
+
// src/renderer/ComponentRenderer.tsx
|
|
3132
|
+
var jsx_dev_runtime24 = require("react/jsx-dev-runtime");
|
|
3133
|
+
function ComponentRenderer({ node }) {
|
|
3134
|
+
const { data } = useData();
|
|
3135
|
+
const evalResult = import_react12.useMemo(() => evaluate(node, data), [node, data]);
|
|
3136
|
+
if (!evalResult.node)
|
|
3137
|
+
return null;
|
|
3138
|
+
const evaluatedNode = evalResult.node;
|
|
3139
|
+
if (evaluatedNode.type === "each") {
|
|
3140
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(EachRenderer, {
|
|
3141
|
+
node: evaluatedNode
|
|
3142
|
+
}, undefined, false, undefined, this);
|
|
3143
|
+
}
|
|
3144
|
+
if (evaluatedNode.type === "fragment") {
|
|
3145
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(FragmentRenderer, {
|
|
3146
|
+
node: evaluatedNode
|
|
3147
|
+
}, undefined, false, undefined, this);
|
|
3148
|
+
}
|
|
3149
|
+
const boundNode = import_react12.useMemo(() => bindNode(evaluatedNode, data), [evaluatedNode, data]);
|
|
3150
|
+
const Component = COMPONENT_REGISTRY[boundNode.type];
|
|
3151
|
+
if (!Component) {
|
|
3152
|
+
if (typeof globalThis !== "undefined" && globalThis.process?.env?.NODE_ENV !== "production") {
|
|
3153
|
+
console.warn(`[Meissa] Unknown component type: "${boundNode.type}"`);
|
|
3154
|
+
}
|
|
3155
|
+
return null;
|
|
3156
|
+
}
|
|
3157
|
+
const children = boundNode.children?.map((child, i) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ComponentRenderer, {
|
|
3158
|
+
node: child
|
|
3159
|
+
}, child.id || i, false, undefined, this));
|
|
3160
|
+
const element = /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(Component, {
|
|
3161
|
+
node: boundNode,
|
|
3162
|
+
children
|
|
3163
|
+
}, undefined, false, undefined, this);
|
|
3164
|
+
if (evalResult.hidden) {
|
|
3165
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV("div", {
|
|
3166
|
+
style: { display: "none" },
|
|
3167
|
+
children: element
|
|
3168
|
+
}, undefined, false, undefined, this);
|
|
3169
|
+
}
|
|
3170
|
+
return element;
|
|
3171
|
+
}
|
|
3172
|
+
function EachRenderer({ node }) {
|
|
3173
|
+
const { data, root } = useData();
|
|
3174
|
+
const items = import_react12.useMemo(() => expandEach(node, data), [node, data]);
|
|
3175
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
|
3176
|
+
children: items.map((item, i) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(DataProvider, {
|
|
3177
|
+
value: { data: item.data, root },
|
|
3178
|
+
children: /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ComponentRenderer, {
|
|
3179
|
+
node: item.node
|
|
3180
|
+
}, undefined, false, undefined, this)
|
|
3181
|
+
}, i, false, undefined, this))
|
|
3182
|
+
}, undefined, false, undefined, this);
|
|
3183
|
+
}
|
|
3184
|
+
function FragmentRenderer({ node }) {
|
|
3185
|
+
if (!node.children)
|
|
3186
|
+
return null;
|
|
3187
|
+
return /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(jsx_dev_runtime24.Fragment, {
|
|
3188
|
+
children: node.children.map((child, i) => /* @__PURE__ */ jsx_dev_runtime24.jsxDEV(ComponentRenderer, {
|
|
3189
|
+
node: child
|
|
3190
|
+
}, child.id || i, false, undefined, this))
|
|
3191
|
+
}, undefined, false, undefined, this);
|
|
3192
|
+
}
|
|
3193
|
+
function bindNode(node, data) {
|
|
3194
|
+
const bound = { type: node.type };
|
|
3195
|
+
for (const [key, value] of Object.entries(node)) {
|
|
3196
|
+
if (key === "type")
|
|
3197
|
+
continue;
|
|
3198
|
+
if (key === "children") {
|
|
3199
|
+
bound.children = node.children;
|
|
3200
|
+
continue;
|
|
3201
|
+
}
|
|
3202
|
+
bound[key] = bindValue(value, data);
|
|
3203
|
+
}
|
|
3204
|
+
return bound;
|
|
3205
|
+
}
|
|
3206
|
+
function bindValue(value, data) {
|
|
3207
|
+
if (typeof value === "string") {
|
|
3208
|
+
return resolveBindings(value, data);
|
|
3209
|
+
}
|
|
3210
|
+
if (Array.isArray(value)) {
|
|
3211
|
+
return value.map((item) => bindValue(item, data));
|
|
3212
|
+
}
|
|
3213
|
+
if (value !== null && typeof value === "object") {
|
|
3214
|
+
const result = {};
|
|
3215
|
+
for (const [k, v] of Object.entries(value)) {
|
|
3216
|
+
result[k] = bindValue(v, data);
|
|
3217
|
+
}
|
|
3218
|
+
return result;
|
|
3219
|
+
}
|
|
3220
|
+
return value;
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
// src/renderer/MeissaRenderer.tsx
|
|
3224
|
+
var jsx_dev_runtime25 = require("react/jsx-dev-runtime");
|
|
3225
|
+
var noop2 = () => {};
|
|
3226
|
+
function MeissaRenderer({
|
|
3227
|
+
schema,
|
|
3228
|
+
data: externalData,
|
|
3229
|
+
theme,
|
|
3230
|
+
onAction = noop2,
|
|
3231
|
+
onNavigate = noop2,
|
|
3232
|
+
className
|
|
3233
|
+
}) {
|
|
3234
|
+
const parsed = import_react13.useMemo(() => parse(schema), [schema]);
|
|
3235
|
+
const mergedData = import_react13.useMemo(() => ({ ...parsed.data, ...externalData }), [parsed.data, externalData]);
|
|
3236
|
+
const themeStyles = import_react13.useMemo(() => {
|
|
3237
|
+
const mergedTheme = { ...parsed.theme, ...theme };
|
|
3238
|
+
if (!mergedTheme?.colors)
|
|
3239
|
+
return;
|
|
3240
|
+
const vars = {};
|
|
3241
|
+
const { colors } = mergedTheme;
|
|
3242
|
+
if (colors.primary)
|
|
3243
|
+
vars["--meissa-primary"] = colors.primary;
|
|
3244
|
+
if (colors.destructive)
|
|
3245
|
+
vars["--meissa-destructive"] = colors.destructive;
|
|
3246
|
+
if (colors.success)
|
|
3247
|
+
vars["--meissa-success"] = colors.success;
|
|
3248
|
+
if (colors.warning)
|
|
3249
|
+
vars["--meissa-warning"] = colors.warning;
|
|
3250
|
+
if (colors.bg)
|
|
3251
|
+
vars["--meissa-bg"] = colors.bg;
|
|
3252
|
+
if (colors.fg)
|
|
3253
|
+
vars["--meissa-fg"] = colors.fg;
|
|
3254
|
+
if (colors.muted)
|
|
3255
|
+
vars["--meissa-muted"] = colors.muted;
|
|
3256
|
+
if (colors.border)
|
|
3257
|
+
vars["--meissa-border"] = colors.border;
|
|
3258
|
+
return vars;
|
|
3259
|
+
}, [parsed.theme, theme]);
|
|
3260
|
+
return /* @__PURE__ */ jsx_dev_runtime25.jsxDEV("div", {
|
|
3261
|
+
className: cn("flex flex-col gap-4", className),
|
|
3262
|
+
style: themeStyles,
|
|
3263
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ActionProvider, {
|
|
3264
|
+
value: { onAction, onNavigate },
|
|
3265
|
+
children: /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(DataProvider, {
|
|
3266
|
+
value: { data: mergedData, root: mergedData },
|
|
3267
|
+
children: parsed.nodes.map((node, i) => /* @__PURE__ */ jsx_dev_runtime25.jsxDEV(ComponentRenderer, {
|
|
3268
|
+
node
|
|
3269
|
+
}, node.id || i, false, undefined, this))
|
|
3270
|
+
}, undefined, false, undefined, this)
|
|
3271
|
+
}, undefined, false, undefined, this)
|
|
3272
|
+
}, undefined, false, undefined, this);
|
|
3273
|
+
}
|