@vuer-ai/vuer-uikit 0.0.92 → 0.0.94
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/cli/dial-cli.js +124 -25
- package/dist/{chunk-OCSIGVPE.mjs → chunk-AIINOWEH.mjs} +31 -11
- package/dist/chunk-KVJ4Q3EZ.mjs +39 -0
- package/dist/{chunk-D3N6DX5T.cjs → chunk-LONOMMFA.cjs} +31 -11
- package/dist/{chunk-GQYRGBQY.cjs → chunk-ORCJ4XB7.cjs} +1 -1
- package/dist/chunk-RVBZZHB5.mjs +94 -0
- package/dist/chunk-WLIMI4FZ.cjs +99 -0
- package/dist/{chunk-Q7WXG6GA.mjs → chunk-XAY3KYPJ.mjs} +1 -1
- package/dist/chunk-XSKUAK23.cjs +42 -0
- package/dist/dial/DialPanel.cjs +4 -4
- package/dist/dial/DialPanel.d.cts +6 -0
- package/dist/dial/DialPanel.d.ts +6 -0
- package/dist/dial/DialPanel.mjs +3 -3
- package/dist/dial/DialProvider.d.cts +1 -0
- package/dist/dial/DialProvider.d.ts +1 -0
- package/dist/dial/index.cjs +20 -20
- package/dist/dial/index.mjs +3 -3
- package/dist/dial/wrapped-inputs/ControlledInputs.cjs +7 -7
- package/dist/dial/wrapped-inputs/ControlledInputs.mjs +3 -3
- package/dist/dial/wrapped-inputs/DialInputs.cjs +14 -14
- package/dist/dial/wrapped-inputs/DialInputs.mjs +3 -3
- package/dist/dial/wrapped-inputs/DialVectorInput.cjs +4 -4
- package/dist/dial/wrapped-inputs/DialVectorInput.mjs +3 -3
- package/dist/dial/wrapped-inputs/index.cjs +19 -19
- package/dist/dial/wrapped-inputs/index.mjs +3 -3
- package/dist/index.cjs +26 -26
- package/dist/index.mjs +3 -3
- package/dist/ui/UIKitBadge.cjs +5 -5
- package/dist/ui/UIKitBadge.mjs +1 -1
- package/dist/ui/icons/MouseCursorIcons.cjs +3 -3
- package/dist/ui/icons/MouseCursorIcons.mjs +1 -1
- package/dist/ui/icons/index.cjs +3 -3
- package/dist/ui/icons/index.mjs +1 -1
- package/dist/ui/index.cjs +8 -8
- package/dist/ui/index.mjs +2 -2
- package/package.json +1 -1
package/cli/dial-cli.js
CHANGED
|
@@ -80,25 +80,59 @@ function parseTypeAlias(sourceFile, typeName) {
|
|
|
80
80
|
}
|
|
81
81
|
function parseInterfaceProperties(sourceFile, interfaceName) {
|
|
82
82
|
const properties = [];
|
|
83
|
+
let interfaceDialTags = {};
|
|
84
|
+
const groupConfigs = {};
|
|
83
85
|
function visit(node) {
|
|
84
86
|
if (ts.isInterfaceDeclaration(node) && node.name.text === interfaceName) {
|
|
87
|
+
const interfaceJsDocNodes = ts.getJSDocCommentsAndTags(node);
|
|
88
|
+
if (interfaceJsDocNodes && interfaceJsDocNodes.length > 0) {
|
|
89
|
+
const interfaceFullText = interfaceJsDocNodes[0].getFullText();
|
|
90
|
+
interfaceDialTags = parseDialTags(interfaceFullText);
|
|
91
|
+
const lines = interfaceFullText.split("\n");
|
|
92
|
+
lines.forEach((line) => {
|
|
93
|
+
const groupMatch = line.match(/@dial\s+(\w+)(.*)/);
|
|
94
|
+
if (groupMatch) {
|
|
95
|
+
const groupName = groupMatch[1];
|
|
96
|
+
const configStr = groupMatch[2];
|
|
97
|
+
if (configStr.includes("@dial-no-wrap")) {
|
|
98
|
+
groupConfigs[groupName] = { noWrap: true };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
85
103
|
node.members.forEach((member) => {
|
|
86
104
|
if (ts.isPropertySignature(member) && member.name && ts.isIdentifier(member.name)) {
|
|
87
105
|
const propName = member.name.text;
|
|
88
106
|
const jsDocNodes = ts.getJSDocCommentsAndTags(member);
|
|
107
|
+
let propertyDialTags = {};
|
|
89
108
|
if (jsDocNodes && jsDocNodes.length > 0) {
|
|
90
109
|
const fullText = jsDocNodes[0].getFullText();
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
110
|
+
propertyDialTags = parseDialTags(fullText);
|
|
111
|
+
}
|
|
112
|
+
const mergedDialTags = { ...interfaceDialTags, ...propertyDialTags };
|
|
113
|
+
const prop = {
|
|
114
|
+
name: propName,
|
|
115
|
+
dtype: mergedDialTags.dtype || "number"
|
|
116
|
+
};
|
|
117
|
+
if (mergedDialTags.min !== void 0) prop.min = mergedDialTags.min;
|
|
118
|
+
if (mergedDialTags.max !== void 0) prop.max = mergedDialTags.max;
|
|
119
|
+
if (mergedDialTags.step !== void 0) prop.step = mergedDialTags.step;
|
|
120
|
+
if (mergedDialTags.icon) prop.icon = mergedDialTags.icon;
|
|
121
|
+
if (mergedDialTags.grouping || mergedDialTags.column || mergedDialTags.rowCount || mergedDialTags.colCount || mergedDialTags.labelPosition || mergedDialTags.noWrap) {
|
|
122
|
+
prop.tags = {};
|
|
123
|
+
if (mergedDialTags.grouping) {
|
|
124
|
+
prop.tags.grouping = mergedDialTags.grouping;
|
|
125
|
+
if (groupConfigs[mergedDialTags.grouping]?.noWrap) {
|
|
126
|
+
prop.tags.noWrap = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (mergedDialTags.column) prop.tags.layout = "column";
|
|
130
|
+
if (mergedDialTags.rowCount) prop.tags.row = mergedDialTags.rowCount;
|
|
131
|
+
if (mergedDialTags.colCount) prop.tags.col = mergedDialTags.colCount;
|
|
132
|
+
if (mergedDialTags.labelPosition) prop.tags.labelPosition = mergedDialTags.labelPosition;
|
|
133
|
+
if (mergedDialTags.noWrap) prop.tags.noWrap = true;
|
|
101
134
|
}
|
|
135
|
+
properties.push(prop);
|
|
102
136
|
}
|
|
103
137
|
});
|
|
104
138
|
}
|
|
@@ -109,7 +143,6 @@ function parseInterfaceProperties(sourceFile, interfaceName) {
|
|
|
109
143
|
}
|
|
110
144
|
function parseDialTags(description) {
|
|
111
145
|
const dialTags = {};
|
|
112
|
-
console.log("description====>", description);
|
|
113
146
|
if (!description) return dialTags;
|
|
114
147
|
if (/@dial-ignore\b/i.test(description)) {
|
|
115
148
|
dialTags.ignore = true;
|
|
@@ -187,6 +220,15 @@ function parseDialTags(description) {
|
|
|
187
220
|
dialTags.icon = value.trim();
|
|
188
221
|
}
|
|
189
222
|
break;
|
|
223
|
+
case "default":
|
|
224
|
+
if (value) {
|
|
225
|
+
try {
|
|
226
|
+
dialTags.default = JSON.parse(value);
|
|
227
|
+
} catch {
|
|
228
|
+
dialTags.default = value.trim();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
190
232
|
case "placeholders":
|
|
191
233
|
if (value) {
|
|
192
234
|
dialTags.placeholders = value.split(",").map((s) => s.trim());
|
|
@@ -238,13 +280,16 @@ function parseDialTags(description) {
|
|
|
238
280
|
case "inline":
|
|
239
281
|
dialTags.labelPosition = "inline";
|
|
240
282
|
break;
|
|
283
|
+
case "no-wrap":
|
|
284
|
+
dialTags.noWrap = true;
|
|
285
|
+
break;
|
|
241
286
|
default:
|
|
242
287
|
break;
|
|
243
288
|
}
|
|
244
289
|
}
|
|
245
290
|
return dialTags;
|
|
246
291
|
}
|
|
247
|
-
function propToDialSchema(propName, propData) {
|
|
292
|
+
function propToDialSchema(propName, propData, groupConfigs) {
|
|
248
293
|
const description = propData.description || "";
|
|
249
294
|
const dialTags = parseDialTags(description);
|
|
250
295
|
if (dialTags.ignore) {
|
|
@@ -268,12 +313,16 @@ function propToDialSchema(propName, propData) {
|
|
|
268
313
|
name: propName,
|
|
269
314
|
dtype
|
|
270
315
|
};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
316
|
+
if (dialTags.default !== void 0) {
|
|
317
|
+
schema.value = dialTags.default;
|
|
318
|
+
} else {
|
|
319
|
+
const defaultValue = propData.defaultValue;
|
|
320
|
+
if (defaultValue?.value) {
|
|
321
|
+
try {
|
|
322
|
+
schema.value = JSON.parse(defaultValue.value);
|
|
323
|
+
} catch {
|
|
324
|
+
schema.value = defaultValue.value;
|
|
325
|
+
}
|
|
277
326
|
}
|
|
278
327
|
}
|
|
279
328
|
if (dialTags.min !== void 0) schema.min = dialTags.min;
|
|
@@ -290,6 +339,9 @@ function propToDialSchema(propName, propData) {
|
|
|
290
339
|
const tags = {};
|
|
291
340
|
if (dialTags.grouping) {
|
|
292
341
|
tags.grouping = dialTags.grouping;
|
|
342
|
+
if (groupConfigs && groupConfigs[dialTags.grouping]?.noWrap) {
|
|
343
|
+
tags.noWrap = true;
|
|
344
|
+
}
|
|
293
345
|
}
|
|
294
346
|
if (dialTags.column) {
|
|
295
347
|
tags.col = true;
|
|
@@ -320,6 +372,43 @@ async function processFile(filePath, outputDir, options, flags = {}) {
|
|
|
320
372
|
const sourceFile = ts.createSourceFile(filePath, sourceCode, ts.ScriptTarget.Latest, true);
|
|
321
373
|
const enhancedMetadata = docs.map((doc) => {
|
|
322
374
|
const dialSchema = [];
|
|
375
|
+
const groupConfigs = {};
|
|
376
|
+
if (doc.description) {
|
|
377
|
+
const componentTags = parseDialTags(doc.description);
|
|
378
|
+
const descLines = doc.description.split("\n");
|
|
379
|
+
descLines.forEach((line) => {
|
|
380
|
+
const groupMatch = line.match(/@dial\s+(\w+)(.*)/);
|
|
381
|
+
if (groupMatch) {
|
|
382
|
+
const groupName = groupMatch[1];
|
|
383
|
+
const configStr = groupMatch[2];
|
|
384
|
+
if (configStr.includes("@dial-no-wrap")) {
|
|
385
|
+
groupConfigs[groupName] = { noWrap: true };
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
const propsInterfaceName = doc.displayName + "Props";
|
|
391
|
+
function findInterfaceJSDoc(node) {
|
|
392
|
+
if (ts.isInterfaceDeclaration(node) && node.name.text === propsInterfaceName) {
|
|
393
|
+
const interfaceJsDocNodes = ts.getJSDocCommentsAndTags(node);
|
|
394
|
+
if (interfaceJsDocNodes && interfaceJsDocNodes.length > 0) {
|
|
395
|
+
const interfaceFullText = interfaceJsDocNodes[0].getFullText();
|
|
396
|
+
const lines = interfaceFullText.split("\n");
|
|
397
|
+
lines.forEach((line) => {
|
|
398
|
+
const groupMatch = line.match(/@dial\s+(\w+)(.*)/);
|
|
399
|
+
if (groupMatch) {
|
|
400
|
+
const groupName = groupMatch[1];
|
|
401
|
+
const configStr = groupMatch[2];
|
|
402
|
+
if (configStr.includes("@dial-no-wrap")) {
|
|
403
|
+
groupConfigs[groupName] = { noWrap: true };
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
ts.forEachChild(node, findInterfaceJSDoc);
|
|
410
|
+
}
|
|
411
|
+
findInterfaceJSDoc(sourceFile);
|
|
323
412
|
for (const [propName, propData] of Object.entries(doc.props || {})) {
|
|
324
413
|
const propDescription = propData.description || "";
|
|
325
414
|
const propDialTags = parseDialTags(propDescription);
|
|
@@ -331,7 +420,7 @@ async function processFile(filePath, outputDir, options, flags = {}) {
|
|
|
331
420
|
if (referencedType) {
|
|
332
421
|
const typeDefinition = parseTypeAlias(sourceFile, referencedType);
|
|
333
422
|
if (typeDefinition) {
|
|
334
|
-
const schema = propToDialSchema(propName, propData);
|
|
423
|
+
const schema = propToDialSchema(propName, propData, groupConfigs);
|
|
335
424
|
if (!schema) {
|
|
336
425
|
continue;
|
|
337
426
|
}
|
|
@@ -377,13 +466,13 @@ async function processFile(filePath, outputDir, options, flags = {}) {
|
|
|
377
466
|
});
|
|
378
467
|
});
|
|
379
468
|
} else {
|
|
380
|
-
const schema = propToDialSchema(propName, propData);
|
|
469
|
+
const schema = propToDialSchema(propName, propData, groupConfigs);
|
|
381
470
|
if (schema) {
|
|
382
471
|
dialSchema.push(schema);
|
|
383
472
|
}
|
|
384
473
|
}
|
|
385
474
|
} else {
|
|
386
|
-
const schema = propToDialSchema(propName, propData);
|
|
475
|
+
const schema = propToDialSchema(propName, propData, groupConfigs);
|
|
387
476
|
if (schema) {
|
|
388
477
|
dialSchema.push(schema);
|
|
389
478
|
}
|
|
@@ -393,6 +482,7 @@ async function processFile(filePath, outputDir, options, flags = {}) {
|
|
|
393
482
|
displayName: doc.displayName,
|
|
394
483
|
description: doc.description,
|
|
395
484
|
dialSchema,
|
|
485
|
+
groupConfigs,
|
|
396
486
|
props: doc.props
|
|
397
487
|
};
|
|
398
488
|
});
|
|
@@ -411,10 +501,18 @@ async function processFile(filePath, outputDir, options, flags = {}) {
|
|
|
411
501
|
if (!flags.quiet) {
|
|
412
502
|
console.log(`\u{1F4DD} Wrote enhanced metadata to ${baseName}-combined.json`);
|
|
413
503
|
}
|
|
414
|
-
const schemas = enhancedMetadata.map((c) =>
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
504
|
+
const schemas = enhancedMetadata.map((c) => {
|
|
505
|
+
const groups = Object.entries(c.groupConfigs || {}).map(([name, config]) => ({
|
|
506
|
+
name,
|
|
507
|
+
...config
|
|
508
|
+
}));
|
|
509
|
+
return {
|
|
510
|
+
component: c.displayName,
|
|
511
|
+
schema: c.dialSchema,
|
|
512
|
+
groups: groups.length > 0 ? groups : void 0,
|
|
513
|
+
config: c.dialConfig
|
|
514
|
+
};
|
|
515
|
+
});
|
|
418
516
|
writeFileSync(join(outputDir, `${baseName}-schemas.json`), JSON.stringify(schemas, null, 2));
|
|
419
517
|
if (!flags.quiet) {
|
|
420
518
|
console.log(`\u{1F4DD} Wrote dial schemas to ${baseName}-schemas.json`);
|
|
@@ -481,6 +579,7 @@ DIAL ANNOTATIONS
|
|
|
481
579
|
@dial-min <number> Minimum value for numeric inputs
|
|
482
580
|
@dial-max <number> Maximum value for numeric inputs
|
|
483
581
|
@dial-step <number> Step increment for numeric inputs
|
|
582
|
+
@dial-default <value> Default value (overrides component default)
|
|
484
583
|
@dial-options [...] Array of preset values
|
|
485
584
|
@dial-icon <name> Lucide icon name for the control
|
|
486
585
|
@dial-ignore Exclude this property from dial schema generation
|
|
@@ -364,6 +364,7 @@ var DialVectorInput2 = ({
|
|
|
364
364
|
gridColumns = void 0;
|
|
365
365
|
gridRows = void 0;
|
|
366
366
|
}
|
|
367
|
+
console.log("the grid-flow is", gridAutoFlow, gridColumns, gridRows);
|
|
367
368
|
const vectorValue = Array.isArray(value) ? value.concat(Array(Math.max(0, dimensions - value.length)).fill(0)) : Array(dimensions).fill(0);
|
|
368
369
|
const inputSteps = Array.from({ length: dimensions }, (_, i) => {
|
|
369
370
|
if (steps[i] !== void 0) {
|
|
@@ -407,23 +408,37 @@ var DialVectorInput2 = ({
|
|
|
407
408
|
] })
|
|
408
409
|
] });
|
|
409
410
|
};
|
|
410
|
-
var DialPanel = ({ schemas }) => {
|
|
411
|
-
const
|
|
411
|
+
var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
412
|
+
const groupConfigMap = {};
|
|
413
|
+
if (groupConfigs) {
|
|
414
|
+
groupConfigs.forEach((config) => {
|
|
415
|
+
groupConfigMap[config.name] = config;
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
schemas.forEach((schema) => {
|
|
419
|
+
const grouping = schema.tags?.grouping;
|
|
420
|
+
if (grouping && !groupConfigMap[grouping]) {
|
|
421
|
+
groupConfigMap[grouping] = { name: grouping };
|
|
422
|
+
}
|
|
423
|
+
if (grouping && schema.tags?.noWrap && groupConfigMap[grouping]) {
|
|
424
|
+
groupConfigMap[grouping].noWrap = true;
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
const groupedSchemas = {};
|
|
412
428
|
const ungrouped = [];
|
|
413
429
|
schemas.forEach((schema) => {
|
|
414
430
|
const grouping = schema.tags?.grouping;
|
|
415
431
|
if (grouping) {
|
|
416
|
-
if (!
|
|
417
|
-
|
|
432
|
+
if (!groupedSchemas[grouping]) {
|
|
433
|
+
groupedSchemas[grouping] = [];
|
|
418
434
|
}
|
|
419
|
-
|
|
435
|
+
groupedSchemas[grouping].push(schema);
|
|
420
436
|
} else {
|
|
421
437
|
ungrouped.push(schema);
|
|
422
438
|
}
|
|
423
439
|
});
|
|
424
440
|
const renderSchemaInput = (schema) => {
|
|
425
441
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
426
|
-
tags?.col === true;
|
|
427
442
|
const labelPosition = tags?.labelPosition;
|
|
428
443
|
const label = name.charAt(0).toUpperCase() + name.slice(1);
|
|
429
444
|
switch (dtype) {
|
|
@@ -524,11 +539,16 @@ var DialPanel = ({ schemas }) => {
|
|
|
524
539
|
}
|
|
525
540
|
};
|
|
526
541
|
return /* @__PURE__ */ jsxs("div", { className: "dial-schema-renderer space-y-4", children: [
|
|
527
|
-
Object.entries(
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
542
|
+
Object.entries(groupedSchemas).map(([name, schemaList]) => {
|
|
543
|
+
const groupConfig = groupConfigMap[name];
|
|
544
|
+
const hasNoWrap = groupConfig?.noWrap;
|
|
545
|
+
const wrapClass = hasNoWrap ? "" : "flex-wrap";
|
|
546
|
+
return /* @__PURE__ */ jsxs("div", { className: "dial-group", children: [
|
|
547
|
+
/* @__PURE__ */ jsx("div", { className: "text-text-primary mb-2 font-medium", children: name }),
|
|
548
|
+
/* @__PURE__ */ jsx("div", { className: `dial-row flex flex-row ${wrapClass} gap-4`, children: schemaList.map(renderSchemaInput) })
|
|
549
|
+
] }, name);
|
|
550
|
+
}),
|
|
551
|
+
ungrouped.length > 0 && /* @__PURE__ */ jsx("div", { className: "dial-group", children: /* @__PURE__ */ jsx("div", { className: "dial-row flex flex-row flex-wrap gap-4", children: ungrouped.map(renderSchemaInput) }) })
|
|
532
552
|
] });
|
|
533
553
|
};
|
|
534
554
|
var DialInputWrapper2 = ({ label, children }) => {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
// src/ui/icons/MouseCursorIcons.tsx
|
|
4
|
+
var MouseCursorIcon = ({ strokeWidth = 2.25 }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
width: "16",
|
|
10
|
+
height: "16",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
strokeWidth,
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
className: "lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2",
|
|
18
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z" })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
var MouseCursorAltIcon = ({ strokeWidth = 2.25 }) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
|
+
"svg",
|
|
25
|
+
{
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
width: "16",
|
|
28
|
+
height: "16",
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
stroke: "currentColor",
|
|
32
|
+
strokeWidth: strokeWidth / 2,
|
|
33
|
+
className: "lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2",
|
|
34
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z" })
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { MouseCursorAltIcon, MouseCursorIcon };
|
|
@@ -366,6 +366,7 @@ var DialVectorInput2 = ({
|
|
|
366
366
|
gridColumns = void 0;
|
|
367
367
|
gridRows = void 0;
|
|
368
368
|
}
|
|
369
|
+
console.log("the grid-flow is", gridAutoFlow, gridColumns, gridRows);
|
|
369
370
|
const vectorValue = Array.isArray(value) ? value.concat(Array(Math.max(0, dimensions - value.length)).fill(0)) : Array(dimensions).fill(0);
|
|
370
371
|
const inputSteps = Array.from({ length: dimensions }, (_, i) => {
|
|
371
372
|
if (steps[i] !== void 0) {
|
|
@@ -409,23 +410,37 @@ var DialVectorInput2 = ({
|
|
|
409
410
|
] })
|
|
410
411
|
] });
|
|
411
412
|
};
|
|
412
|
-
var DialPanel = ({ schemas }) => {
|
|
413
|
-
const
|
|
413
|
+
var DialPanel = ({ schemas, groups: groupConfigs }) => {
|
|
414
|
+
const groupConfigMap = {};
|
|
415
|
+
if (groupConfigs) {
|
|
416
|
+
groupConfigs.forEach((config) => {
|
|
417
|
+
groupConfigMap[config.name] = config;
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
schemas.forEach((schema) => {
|
|
421
|
+
const grouping = schema.tags?.grouping;
|
|
422
|
+
if (grouping && !groupConfigMap[grouping]) {
|
|
423
|
+
groupConfigMap[grouping] = { name: grouping };
|
|
424
|
+
}
|
|
425
|
+
if (grouping && schema.tags?.noWrap && groupConfigMap[grouping]) {
|
|
426
|
+
groupConfigMap[grouping].noWrap = true;
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
const groupedSchemas = {};
|
|
414
430
|
const ungrouped = [];
|
|
415
431
|
schemas.forEach((schema) => {
|
|
416
432
|
const grouping = schema.tags?.grouping;
|
|
417
433
|
if (grouping) {
|
|
418
|
-
if (!
|
|
419
|
-
|
|
434
|
+
if (!groupedSchemas[grouping]) {
|
|
435
|
+
groupedSchemas[grouping] = [];
|
|
420
436
|
}
|
|
421
|
-
|
|
437
|
+
groupedSchemas[grouping].push(schema);
|
|
422
438
|
} else {
|
|
423
439
|
ungrouped.push(schema);
|
|
424
440
|
}
|
|
425
441
|
});
|
|
426
442
|
const renderSchemaInput = (schema) => {
|
|
427
443
|
const { name, dtype, min, max, step, options, tags } = schema;
|
|
428
|
-
tags?.col === true;
|
|
429
444
|
const labelPosition = tags?.labelPosition;
|
|
430
445
|
const label = name.charAt(0).toUpperCase() + name.slice(1);
|
|
431
446
|
switch (dtype) {
|
|
@@ -526,11 +541,16 @@ var DialPanel = ({ schemas }) => {
|
|
|
526
541
|
}
|
|
527
542
|
};
|
|
528
543
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dial-schema-renderer space-y-4", children: [
|
|
529
|
-
Object.entries(
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
544
|
+
Object.entries(groupedSchemas).map(([name, schemaList]) => {
|
|
545
|
+
const groupConfig = groupConfigMap[name];
|
|
546
|
+
const hasNoWrap = groupConfig?.noWrap;
|
|
547
|
+
const wrapClass = hasNoWrap ? "" : "flex-wrap";
|
|
548
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "dial-group", children: [
|
|
549
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-text-primary mb-2 font-medium", children: name }),
|
|
550
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `dial-row flex flex-row ${wrapClass} gap-4`, children: schemaList.map(renderSchemaInput) })
|
|
551
|
+
] }, name);
|
|
552
|
+
}),
|
|
553
|
+
ungrouped.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dial-group", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "dial-row flex flex-row flex-wrap gap-4", children: ungrouped.map(renderSchemaInput) }) })
|
|
534
554
|
] });
|
|
535
555
|
};
|
|
536
556
|
var DialInputWrapper2 = ({ label, children }) => {
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { cn } from './chunk-HMN4IKTG.mjs';
|
|
2
|
+
import { GitBranch } from 'lucide-react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var PACKAGE_VERSION = "0.0.93" ;
|
|
6
|
+
var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
|
|
7
|
+
var GIT_HASH = "46e2850" ;
|
|
8
|
+
function PackageBadge({
|
|
9
|
+
className,
|
|
10
|
+
packageName,
|
|
11
|
+
packageFullName,
|
|
12
|
+
versionText,
|
|
13
|
+
linkable = true,
|
|
14
|
+
gitHash
|
|
15
|
+
}) {
|
|
16
|
+
const npmUrl = packageFullName && versionText ? `https://www.npmjs.com/package/${packageFullName}/v/${versionText.replace("v", "")}` : void 0;
|
|
17
|
+
return /* @__PURE__ */ jsxs(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: `rounded-uk-xs rounded-r-uk-xs text-uk-sm bg-icon-withbg inline-flex items-center ${className || ""}`,
|
|
21
|
+
style: linkable ? { cursor: "pointer" } : void 0,
|
|
22
|
+
children: [
|
|
23
|
+
(packageName || versionText) && /* @__PURE__ */ jsxs("div", { className: "rounded-uk-xs inline-flex items-center overflow-hidden", children: [
|
|
24
|
+
packageName && /* @__PURE__ */ jsx(
|
|
25
|
+
"span",
|
|
26
|
+
{
|
|
27
|
+
className: "pl-sm pr-xs py-xxxs bg-brand-primary text-text-withbg text-uk-xs",
|
|
28
|
+
style: {
|
|
29
|
+
backgroundColor: "var(--color-brand-primary, var(--brand-primary))",
|
|
30
|
+
color: "white",
|
|
31
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.1)"
|
|
32
|
+
},
|
|
33
|
+
children: packageName
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
versionText && /* @__PURE__ */ jsx(
|
|
37
|
+
"a",
|
|
38
|
+
{
|
|
39
|
+
href: linkable && npmUrl ? npmUrl : void 0,
|
|
40
|
+
className: cn(
|
|
41
|
+
"pl-xs pr-sm py-xxxs rounded-r-uk-xs",
|
|
42
|
+
"bg-alt-primary",
|
|
43
|
+
"text-text-secondary",
|
|
44
|
+
"text-text-primary text-uk-xs",
|
|
45
|
+
linkable && "hover:text-brand-primary"
|
|
46
|
+
),
|
|
47
|
+
style: {
|
|
48
|
+
textShadow: "0 1px 1px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.05)"
|
|
49
|
+
},
|
|
50
|
+
onClick: !linkable ? (e) => e.preventDefault() : void 0,
|
|
51
|
+
children: versionText
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] }),
|
|
55
|
+
gitHash && gitHash !== "unknown" && /* @__PURE__ */ jsxs(
|
|
56
|
+
"a",
|
|
57
|
+
{
|
|
58
|
+
href: linkable ? `https://github.com/vuer-ai/vuer-uikit/commit/${gitHash}` : void 0,
|
|
59
|
+
className: "px-md rounded-uk-ssx font-number-input text-text-tertiary text-uk-xs ml-[0px] bg-transparent py-[0px]",
|
|
60
|
+
onClick: !linkable ? (e) => e.preventDefault() : void 0,
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(GitBranch, { className: "mr-[2px] inline-block size-2" }),
|
|
63
|
+
gitHash
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function UIKitBadge({
|
|
72
|
+
className,
|
|
73
|
+
package: showPackage = false,
|
|
74
|
+
prefix = false,
|
|
75
|
+
linkable = false,
|
|
76
|
+
version = false,
|
|
77
|
+
hash = false
|
|
78
|
+
}) {
|
|
79
|
+
const packageShortName = PACKAGE_NAME.split("/").pop() || PACKAGE_NAME;
|
|
80
|
+
const versionText = version ? prefix ? `v${PACKAGE_VERSION}` : PACKAGE_VERSION : void 0;
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
PackageBadge,
|
|
83
|
+
{
|
|
84
|
+
className,
|
|
85
|
+
packageName: showPackage ? packageShortName : void 0,
|
|
86
|
+
packageFullName: PACKAGE_NAME,
|
|
87
|
+
versionText,
|
|
88
|
+
linkable,
|
|
89
|
+
gitHash: hash ? GIT_HASH : void 0
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { GIT_HASH, PACKAGE_VERSION, PackageBadge, UIKitBadge };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
var PACKAGE_VERSION = "0.0.93" ;
|
|
8
|
+
var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
|
|
9
|
+
var GIT_HASH = "46e2850" ;
|
|
10
|
+
function PackageBadge({
|
|
11
|
+
className,
|
|
12
|
+
packageName,
|
|
13
|
+
packageFullName,
|
|
14
|
+
versionText,
|
|
15
|
+
linkable = true,
|
|
16
|
+
gitHash
|
|
17
|
+
}) {
|
|
18
|
+
const npmUrl = packageFullName && versionText ? `https://www.npmjs.com/package/${packageFullName}/v/${versionText.replace("v", "")}` : void 0;
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
className: `rounded-uk-xs rounded-r-uk-xs text-uk-sm bg-icon-withbg inline-flex items-center ${className || ""}`,
|
|
23
|
+
style: linkable ? { cursor: "pointer" } : void 0,
|
|
24
|
+
children: [
|
|
25
|
+
(packageName || versionText) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-uk-xs inline-flex items-center overflow-hidden", children: [
|
|
26
|
+
packageName && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
className: "pl-sm pr-xs py-xxxs bg-brand-primary text-text-withbg text-uk-xs",
|
|
30
|
+
style: {
|
|
31
|
+
backgroundColor: "var(--color-brand-primary, var(--brand-primary))",
|
|
32
|
+
color: "white",
|
|
33
|
+
textShadow: "0 1px 2px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.1)"
|
|
34
|
+
},
|
|
35
|
+
children: packageName
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
versionText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
"a",
|
|
40
|
+
{
|
|
41
|
+
href: linkable && npmUrl ? npmUrl : void 0,
|
|
42
|
+
className: chunkOHIB3TEN_cjs.cn(
|
|
43
|
+
"pl-xs pr-sm py-xxxs rounded-r-uk-xs",
|
|
44
|
+
"bg-alt-primary",
|
|
45
|
+
"text-text-secondary",
|
|
46
|
+
"text-text-primary text-uk-xs",
|
|
47
|
+
linkable && "hover:text-brand-primary"
|
|
48
|
+
),
|
|
49
|
+
style: {
|
|
50
|
+
textShadow: "0 1px 1px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.05)"
|
|
51
|
+
},
|
|
52
|
+
onClick: !linkable ? (e) => e.preventDefault() : void 0,
|
|
53
|
+
children: versionText
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }),
|
|
57
|
+
gitHash && gitHash !== "unknown" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
58
|
+
"a",
|
|
59
|
+
{
|
|
60
|
+
href: linkable ? `https://github.com/vuer-ai/vuer-uikit/commit/${gitHash}` : void 0,
|
|
61
|
+
className: "px-md rounded-uk-ssx font-number-input text-text-tertiary text-uk-xs ml-[0px] bg-transparent py-[0px]",
|
|
62
|
+
onClick: !linkable ? (e) => e.preventDefault() : void 0,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { className: "mr-[2px] inline-block size-2" }),
|
|
65
|
+
gitHash
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
function UIKitBadge({
|
|
74
|
+
className,
|
|
75
|
+
package: showPackage = false,
|
|
76
|
+
prefix = false,
|
|
77
|
+
linkable = false,
|
|
78
|
+
version = false,
|
|
79
|
+
hash = false
|
|
80
|
+
}) {
|
|
81
|
+
const packageShortName = PACKAGE_NAME.split("/").pop() || PACKAGE_NAME;
|
|
82
|
+
const versionText = version ? prefix ? `v${PACKAGE_VERSION}` : PACKAGE_VERSION : void 0;
|
|
83
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
84
|
+
PackageBadge,
|
|
85
|
+
{
|
|
86
|
+
className,
|
|
87
|
+
packageName: showPackage ? packageShortName : void 0,
|
|
88
|
+
packageFullName: PACKAGE_NAME,
|
|
89
|
+
versionText,
|
|
90
|
+
linkable,
|
|
91
|
+
gitHash: hash ? GIT_HASH : void 0
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
exports.GIT_HASH = GIT_HASH;
|
|
97
|
+
exports.PACKAGE_VERSION = PACKAGE_VERSION;
|
|
98
|
+
exports.PackageBadge = PackageBadge;
|
|
99
|
+
exports.UIKitBadge = UIKitBadge;
|