@uipath/apollo-wind 2.63.0 → 2.65.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.
Files changed (71) hide show
  1. package/dist/components/forms/aria-ids.cjs +38 -0
  2. package/dist/components/forms/aria-ids.d.ts +2 -0
  3. package/dist/components/forms/aria-ids.js +4 -0
  4. package/dist/components/forms/demo-mocks.cjs +0 -448
  5. package/dist/components/forms/demo-mocks.js +0 -448
  6. package/dist/components/forms/field-control.cjs +21 -17
  7. package/dist/components/forms/field-control.d.ts +3 -1
  8. package/dist/components/forms/field-control.js +21 -17
  9. package/dist/components/forms/field-renderer.cjs +65 -37
  10. package/dist/components/forms/field-renderer.js +66 -38
  11. package/dist/components/forms/form-designer.cjs +204 -3
  12. package/dist/components/forms/form-designer.js +204 -3
  13. package/dist/components/forms/form-examples.cjs +3 -190
  14. package/dist/components/forms/form-examples.d.ts +0 -10
  15. package/dist/components/forms/form-examples.js +3 -184
  16. package/dist/components/forms/form-schema.d.ts +6 -0
  17. package/dist/components/forms/metadata-form.cjs +9 -1
  18. package/dist/components/forms/metadata-form.d.ts +8 -1
  19. package/dist/components/forms/metadata-form.js +9 -1
  20. package/dist/components/forms/mode-aware-field.cjs +11 -6
  21. package/dist/components/forms/mode-aware-field.d.ts +2 -0
  22. package/dist/components/forms/mode-aware-field.js +11 -6
  23. package/dist/components/forms/string-list-field.cjs +5 -4
  24. package/dist/components/forms/string-list-field.d.ts +4 -2
  25. package/dist/components/forms/string-list-field.js +5 -4
  26. package/dist/components/ui/index.cjs +77 -66
  27. package/dist/components/ui/index.d.ts +1 -0
  28. package/dist/components/ui/index.js +1 -0
  29. package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +13 -0
  30. package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +2 -1
  31. package/dist/components/ui/json-tree-view/JsonTreeRow.js +2 -1
  32. package/dist/components/ui/json-tree-view/JsonTypeBadge.cjs +43 -6
  33. package/dist/components/ui/json-tree-view/JsonTypeBadge.d.ts +6 -3
  34. package/dist/components/ui/json-tree-view/JsonTypeBadge.js +44 -7
  35. package/dist/components/ui/json-tree-view/index.d.ts +1 -1
  36. package/dist/components/ui/json-tree-view/strings.cjs +1 -0
  37. package/dist/components/ui/json-tree-view/strings.d.ts +10 -2
  38. package/dist/components/ui/json-tree-view/strings.js +1 -0
  39. package/dist/components/ui/prompt-value-control.cjs +3 -1
  40. package/dist/components/ui/prompt-value-control.d.ts +5 -0
  41. package/dist/components/ui/prompt-value-control.js +3 -1
  42. package/dist/components/ui/sidebar/index.cjs +113 -0
  43. package/dist/components/ui/sidebar/index.d.ts +10 -0
  44. package/dist/components/ui/sidebar/index.js +7 -0
  45. package/dist/components/ui/sidebar/sidebar-context.cjs +151 -0
  46. package/dist/components/ui/sidebar/sidebar-context.d.ts +39 -0
  47. package/dist/components/ui/sidebar/sidebar-context.js +108 -0
  48. package/dist/components/ui/sidebar/sidebar-group.cjs +87 -0
  49. package/dist/components/ui/sidebar/sidebar-group.d.ts +10 -0
  50. package/dist/components/ui/sidebar/sidebar-group.js +44 -0
  51. package/dist/components/ui/sidebar/sidebar-layout.cjs +92 -0
  52. package/dist/components/ui/sidebar/sidebar-layout.d.ts +7 -0
  53. package/dist/components/ui/sidebar/sidebar-layout.js +46 -0
  54. package/dist/components/ui/sidebar/sidebar-menu-sub.cjs +79 -0
  55. package/dist/components/ui/sidebar/sidebar-menu-sub.d.ts +11 -0
  56. package/dist/components/ui/sidebar/sidebar-menu-sub.js +39 -0
  57. package/dist/components/ui/sidebar/sidebar-menu.cjs +185 -0
  58. package/dist/components/ui/sidebar/sidebar-menu.d.ts +26 -0
  59. package/dist/components/ui/sidebar/sidebar-menu.js +133 -0
  60. package/dist/components/ui/sidebar/sidebar.cjs +220 -0
  61. package/dist/components/ui/sidebar/sidebar.d.ts +22 -0
  62. package/dist/components/ui/sidebar/sidebar.js +177 -0
  63. package/dist/components/ui/variable-value-control.cjs +3 -1
  64. package/dist/components/ui/variable-value-control.d.ts +5 -0
  65. package/dist/components/ui/variable-value-control.js +3 -1
  66. package/dist/index.cjs +94 -18
  67. package/dist/index.d.ts +3 -1
  68. package/dist/index.js +2 -1
  69. package/dist/styles.css +647 -0
  70. package/package.json +1 -1
  71. package/dist/templates/Forms/form-builder-example.d.ts +0 -1
@@ -41,6 +41,7 @@ const separator_cjs_namespaceObject = require("../ui/separator.cjs");
41
41
  const switch_cjs_namespaceObject = require("../ui/switch.cjs");
42
42
  const tabs_cjs_namespaceObject = require("../ui/tabs.cjs");
43
43
  const textarea_cjs_namespaceObject = require("../ui/textarea.cjs");
44
+ const external_field_actions_cjs_namespaceObject = require("./field-actions.cjs");
44
45
  const external_metadata_form_cjs_namespaceObject = require("./metadata-form.cjs");
45
46
  const external_schema_serializer_cjs_namespaceObject = require("./schema-serializer.cjs");
46
47
  const FIELD_TYPE_METADATA = [
@@ -135,6 +136,93 @@ const FIELD_TYPE_METADATA = [
135
136
  description: 'Custom field component'
136
137
  }
137
138
  ];
139
+ const ANATOMY_FIELD_TYPES = [
140
+ 'text',
141
+ 'email',
142
+ 'textarea',
143
+ 'number',
144
+ 'select',
145
+ 'multiselect',
146
+ 'switch',
147
+ 'checkbox',
148
+ 'boolean'
149
+ ];
150
+ const VALUE_MODE_OPTIONS = [
151
+ {
152
+ label: 'Fixed value',
153
+ value: 'literal'
154
+ },
155
+ {
156
+ label: 'Expression',
157
+ value: 'expression'
158
+ },
159
+ {
160
+ label: 'Variable',
161
+ value: 'variable'
162
+ },
163
+ {
164
+ label: 'Prompt',
165
+ value: 'prompt'
166
+ }
167
+ ];
168
+ const PREVIEW_PLUGINS = [
169
+ {
170
+ name: 'designer-preview',
171
+ variables: [
172
+ {
173
+ id: 'vars',
174
+ label: '$vars',
175
+ children: [
176
+ {
177
+ id: 'customerName',
178
+ label: 'customerName',
179
+ value: '$vars.customerName',
180
+ type: 'string'
181
+ },
182
+ {
183
+ id: 'orderId',
184
+ label: 'orderId',
185
+ value: '$vars.orderId',
186
+ type: 'string'
187
+ },
188
+ {
189
+ id: 'total',
190
+ label: 'total',
191
+ value: '$vars.total',
192
+ type: 'number'
193
+ }
194
+ ]
195
+ }
196
+ ],
197
+ fieldActions: {
198
+ header: {
199
+ 'insert-variable': (0, external_field_actions_cjs_namespaceObject.createInsertVariableAction)({}),
200
+ 'ai-assist': (0, external_field_actions_cjs_namespaceObject.createAiAssistAction)({
201
+ generate: ({ prompt })=>new Promise((resolve)=>setTimeout(()=>resolve({
202
+ value: `Generated from "${prompt}"`
203
+ }), 600))
204
+ })
205
+ }
206
+ }
207
+ }
208
+ ];
209
+ function toValueModes(values) {
210
+ const modes = values?.modes ?? [];
211
+ if (0 === modes.length) return;
212
+ const defaultMode = values?.defaultMode;
213
+ return {
214
+ modes,
215
+ ...defaultMode && modes.includes(defaultMode) && {
216
+ defaultMode
217
+ },
218
+ ...values?.switchable === false && {
219
+ switchable: false
220
+ }
221
+ };
222
+ }
223
+ function nonEmpty(list) {
224
+ return Array.isArray(list) && list.length > 0 ? list : void 0;
225
+ }
138
226
  function buildValidationConfig(field) {
139
227
  const { type, validation, rules } = field;
140
228
  const config = {};
@@ -481,6 +569,102 @@ const createFieldConfigSchema = (field)=>({
481
569
  is: 'file'
482
570
  }
483
571
  ]
572
+ },
573
+ {
574
+ id: 'value-modes',
575
+ title: 'Value modes and actions',
576
+ description: 'A field with modes takes its value as a fixed value, an expression, a variable or a prompt. Any of these settings renders the field anatomy.',
577
+ fields: [
578
+ {
579
+ name: 'valueModes.modes',
580
+ type: 'multiselect',
581
+ label: 'Modes',
582
+ placeholder: 'No modes',
583
+ options: VALUE_MODE_OPTIONS
584
+ },
585
+ {
586
+ name: 'valueModes.defaultMode',
587
+ type: 'select',
588
+ label: 'Default mode',
589
+ placeholder: 'The first mode',
590
+ options: VALUE_MODE_OPTIONS,
591
+ rules: [
592
+ {
593
+ id: 'show-with-modes',
594
+ conditions: [
595
+ {
596
+ when: 'valueModes.modes',
597
+ custom: 'valueModes.modes.length > 0'
598
+ }
599
+ ],
600
+ effects: {
601
+ visible: true
602
+ }
603
+ }
604
+ ]
605
+ },
606
+ {
607
+ name: 'valueModes.switchable',
608
+ type: 'switch',
609
+ label: 'Users can switch modes',
610
+ rules: [
611
+ {
612
+ id: 'show-with-modes',
613
+ conditions: [
614
+ {
615
+ when: 'valueModes.modes',
616
+ custom: 'valueModes.modes.length > 0'
617
+ }
618
+ ],
619
+ effects: {
620
+ visible: true
621
+ }
622
+ }
623
+ ]
624
+ },
625
+ {
626
+ name: 'headerActions',
627
+ type: 'multiselect',
628
+ label: 'Header actions',
629
+ placeholder: 'None',
630
+ options: [
631
+ {
632
+ label: 'Insert variable',
633
+ value: 'insert-variable'
634
+ },
635
+ {
636
+ label: 'AI assist',
637
+ value: 'ai-assist'
638
+ }
639
+ ]
640
+ },
641
+ {
642
+ name: 'menuActions',
643
+ type: 'multiselect',
644
+ label: 'Menu actions',
645
+ placeholder: 'None',
646
+ options: [
647
+ {
648
+ label: 'Clear value',
649
+ value: 'clear'
650
+ }
651
+ ]
652
+ },
653
+ {
654
+ name: 'badge',
655
+ type: 'text',
656
+ label: 'Badge',
657
+ placeholder: 'e.g. Beta'
658
+ }
659
+ ],
660
+ conditions: [
661
+ {
662
+ when: 'type',
663
+ in: [
664
+ ...ANATOMY_FIELD_TYPES
665
+ ]
666
+ }
667
+ ]
484
668
  }
485
669
  ],
486
670
  initialData: {
@@ -494,6 +678,14 @@ const createFieldConfigSchema = (field)=>({
494
678
  step: field.step,
495
679
  accept: field.accept || '',
496
680
  multiple: field.multiple || false,
681
+ valueModes: {
682
+ modes: field.valueModes?.modes ?? [],
683
+ defaultMode: field.valueModes?.defaultMode ?? '',
684
+ switchable: field.valueModes?.switchable ?? true
685
+ },
686
+ headerActions: field.headerActions ?? [],
687
+ menuActions: field.menuActions ?? [],
688
+ badge: field.badge ?? '',
497
689
  validation: {
498
690
  minLength: field.validation?.minLength,
499
691
  maxLength: field.validation?.maxLength,
@@ -611,6 +803,11 @@ function FieldConfigForm({ field, onUpdate, allFields, existingFieldNames }) {
611
803
  placeholder: values.placeholder || void 0,
612
804
  description: values.description || void 0
613
805
  };
806
+ const anatomy = ANATOMY_FIELD_TYPES.includes(newType);
807
+ updates.valueModes = anatomy ? toValueModes(values.valueModes) : void 0;
808
+ updates.headerActions = anatomy ? nonEmpty(values.headerActions) : void 0;
809
+ updates.menuActions = anatomy ? nonEmpty(values.menuActions) : void 0;
810
+ updates.badge = anatomy && values.badge || void 0;
614
811
  const requiredMessage = validationValues?.requiredMessage || void 0;
615
812
  if ('number' === newType || 'slider' === newType) {
616
813
  updates.min = values.min;
@@ -1183,9 +1380,12 @@ function FormDesigner() {
1183
1380
  })
1184
1381
  ]
1185
1382
  }),
1186
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
1383
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
1187
1384
  className: "text-[9px] text-muted-foreground",
1188
- children: field.type
1385
+ children: [
1386
+ field.type,
1387
+ field.valueModes && ` · ${field.valueModes.modes.length} modes`
1388
+ ]
1189
1389
  })
1190
1390
  ]
1191
1391
  }),
@@ -1400,13 +1600,14 @@ function FormDesigner() {
1400
1600
  }),
1401
1601
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_metadata_form_cjs_namespaceObject.MetadataForm, {
1402
1602
  schema: generatedSchema,
1603
+ plugins: PREVIEW_PLUGINS,
1403
1604
  onSubmit: (data)=>{
1404
1605
  console.log('Form submitted:', data);
1405
1606
  alert('Form submitted! Check console for data.');
1406
1607
  },
1407
1608
  disabled: previewDisabled,
1408
1609
  autoComplete: "off"
1409
- }, sections.map((s)=>`${s.id}:${s.collapsible}:${s.defaultExpanded}:${s.fields.map((f)=>`${f.id}:${f.type}:${f.name}:${JSON.stringify(f.rules || [])}:${JSON.stringify(f.validation || {})}`).join('-')}`).join(','))
1610
+ }, sections.map((s)=>`${s.id}:${s.collapsible}:${s.defaultExpanded}:${s.fields.map((f)=>`${f.id}:${f.type}:${f.name}:${JSON.stringify(f.rules || [])}:${JSON.stringify(f.validation || {})}:${JSON.stringify(f.valueModes || {})}`).join('-')}`).join(','))
1410
1611
  ]
1411
1612
  }),
1412
1613
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(tabs_cjs_namespaceObject.TabsContent, {
@@ -13,6 +13,7 @@ import { Separator } from "../ui/separator.js";
13
13
  import { Switch } from "../ui/switch.js";
14
14
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "../ui/tabs.js";
15
15
  import { Textarea } from "../ui/textarea.js";
16
+ import { createAiAssistAction, createInsertVariableAction } from "./field-actions.js";
16
17
  import { MetadataForm } from "./metadata-form.js";
17
18
  import { schemaToJson } from "./schema-serializer.js";
18
19
  const FIELD_TYPE_METADATA = [
@@ -107,6 +108,93 @@ const FIELD_TYPE_METADATA = [
107
108
  description: 'Custom field component'
108
109
  }
109
110
  ];
111
+ const ANATOMY_FIELD_TYPES = [
112
+ 'text',
113
+ 'email',
114
+ 'textarea',
115
+ 'number',
116
+ 'select',
117
+ 'multiselect',
118
+ 'switch',
119
+ 'checkbox',
120
+ 'boolean'
121
+ ];
122
+ const VALUE_MODE_OPTIONS = [
123
+ {
124
+ label: 'Fixed value',
125
+ value: 'literal'
126
+ },
127
+ {
128
+ label: 'Expression',
129
+ value: 'expression'
130
+ },
131
+ {
132
+ label: 'Variable',
133
+ value: 'variable'
134
+ },
135
+ {
136
+ label: 'Prompt',
137
+ value: 'prompt'
138
+ }
139
+ ];
140
+ const PREVIEW_PLUGINS = [
141
+ {
142
+ name: 'designer-preview',
143
+ variables: [
144
+ {
145
+ id: 'vars',
146
+ label: '$vars',
147
+ children: [
148
+ {
149
+ id: 'customerName',
150
+ label: 'customerName',
151
+ value: '$vars.customerName',
152
+ type: 'string'
153
+ },
154
+ {
155
+ id: 'orderId',
156
+ label: 'orderId',
157
+ value: '$vars.orderId',
158
+ type: 'string'
159
+ },
160
+ {
161
+ id: 'total',
162
+ label: 'total',
163
+ value: '$vars.total',
164
+ type: 'number'
165
+ }
166
+ ]
167
+ }
168
+ ],
169
+ fieldActions: {
170
+ header: {
171
+ 'insert-variable': createInsertVariableAction({}),
172
+ 'ai-assist': createAiAssistAction({
173
+ generate: ({ prompt })=>new Promise((resolve)=>setTimeout(()=>resolve({
174
+ value: `Generated from "${prompt}"`
175
+ }), 600))
176
+ })
177
+ }
178
+ }
179
+ }
180
+ ];
181
+ function toValueModes(values) {
182
+ const modes = values?.modes ?? [];
183
+ if (0 === modes.length) return;
184
+ const defaultMode = values?.defaultMode;
185
+ return {
186
+ modes,
187
+ ...defaultMode && modes.includes(defaultMode) && {
188
+ defaultMode
189
+ },
190
+ ...values?.switchable === false && {
191
+ switchable: false
192
+ }
193
+ };
194
+ }
195
+ function nonEmpty(list) {
196
+ return Array.isArray(list) && list.length > 0 ? list : void 0;
197
+ }
110
198
  function buildValidationConfig(field) {
111
199
  const { type, validation, rules } = field;
112
200
  const config = {};
@@ -453,6 +541,102 @@ const createFieldConfigSchema = (field)=>({
453
541
  is: 'file'
454
542
  }
455
543
  ]
544
+ },
545
+ {
546
+ id: 'value-modes',
547
+ title: 'Value modes and actions',
548
+ description: 'A field with modes takes its value as a fixed value, an expression, a variable or a prompt. Any of these settings renders the field anatomy.',
549
+ fields: [
550
+ {
551
+ name: 'valueModes.modes',
552
+ type: 'multiselect',
553
+ label: 'Modes',
554
+ placeholder: 'No modes',
555
+ options: VALUE_MODE_OPTIONS
556
+ },
557
+ {
558
+ name: 'valueModes.defaultMode',
559
+ type: 'select',
560
+ label: 'Default mode',
561
+ placeholder: 'The first mode',
562
+ options: VALUE_MODE_OPTIONS,
563
+ rules: [
564
+ {
565
+ id: 'show-with-modes',
566
+ conditions: [
567
+ {
568
+ when: 'valueModes.modes',
569
+ custom: 'valueModes.modes.length > 0'
570
+ }
571
+ ],
572
+ effects: {
573
+ visible: true
574
+ }
575
+ }
576
+ ]
577
+ },
578
+ {
579
+ name: 'valueModes.switchable',
580
+ type: 'switch',
581
+ label: 'Users can switch modes',
582
+ rules: [
583
+ {
584
+ id: 'show-with-modes',
585
+ conditions: [
586
+ {
587
+ when: 'valueModes.modes',
588
+ custom: 'valueModes.modes.length > 0'
589
+ }
590
+ ],
591
+ effects: {
592
+ visible: true
593
+ }
594
+ }
595
+ ]
596
+ },
597
+ {
598
+ name: 'headerActions',
599
+ type: 'multiselect',
600
+ label: 'Header actions',
601
+ placeholder: 'None',
602
+ options: [
603
+ {
604
+ label: 'Insert variable',
605
+ value: 'insert-variable'
606
+ },
607
+ {
608
+ label: 'AI assist',
609
+ value: 'ai-assist'
610
+ }
611
+ ]
612
+ },
613
+ {
614
+ name: 'menuActions',
615
+ type: 'multiselect',
616
+ label: 'Menu actions',
617
+ placeholder: 'None',
618
+ options: [
619
+ {
620
+ label: 'Clear value',
621
+ value: 'clear'
622
+ }
623
+ ]
624
+ },
625
+ {
626
+ name: 'badge',
627
+ type: 'text',
628
+ label: 'Badge',
629
+ placeholder: 'e.g. Beta'
630
+ }
631
+ ],
632
+ conditions: [
633
+ {
634
+ when: 'type',
635
+ in: [
636
+ ...ANATOMY_FIELD_TYPES
637
+ ]
638
+ }
639
+ ]
456
640
  }
457
641
  ],
458
642
  initialData: {
@@ -466,6 +650,14 @@ const createFieldConfigSchema = (field)=>({
466
650
  step: field.step,
467
651
  accept: field.accept || '',
468
652
  multiple: field.multiple || false,
653
+ valueModes: {
654
+ modes: field.valueModes?.modes ?? [],
655
+ defaultMode: field.valueModes?.defaultMode ?? '',
656
+ switchable: field.valueModes?.switchable ?? true
657
+ },
658
+ headerActions: field.headerActions ?? [],
659
+ menuActions: field.menuActions ?? [],
660
+ badge: field.badge ?? '',
469
661
  validation: {
470
662
  minLength: field.validation?.minLength,
471
663
  maxLength: field.validation?.maxLength,
@@ -583,6 +775,11 @@ function FieldConfigForm({ field, onUpdate, allFields, existingFieldNames }) {
583
775
  placeholder: values.placeholder || void 0,
584
776
  description: values.description || void 0
585
777
  };
778
+ const anatomy = ANATOMY_FIELD_TYPES.includes(newType);
779
+ updates.valueModes = anatomy ? toValueModes(values.valueModes) : void 0;
780
+ updates.headerActions = anatomy ? nonEmpty(values.headerActions) : void 0;
781
+ updates.menuActions = anatomy ? nonEmpty(values.menuActions) : void 0;
782
+ updates.badge = anatomy && values.badge || void 0;
586
783
  const requiredMessage = validationValues?.requiredMessage || void 0;
587
784
  if ('number' === newType || 'slider' === newType) {
588
785
  updates.min = values.min;
@@ -1155,9 +1352,12 @@ function FormDesigner() {
1155
1352
  })
1156
1353
  ]
1157
1354
  }),
1158
- /*#__PURE__*/ jsx("div", {
1355
+ /*#__PURE__*/ jsxs("div", {
1159
1356
  className: "text-[9px] text-muted-foreground",
1160
- children: field.type
1357
+ children: [
1358
+ field.type,
1359
+ field.valueModes && ` · ${field.valueModes.modes.length} modes`
1360
+ ]
1161
1361
  })
1162
1362
  ]
1163
1363
  }),
@@ -1372,13 +1572,14 @@ function FormDesigner() {
1372
1572
  }),
1373
1573
  /*#__PURE__*/ jsx(MetadataForm, {
1374
1574
  schema: generatedSchema,
1575
+ plugins: PREVIEW_PLUGINS,
1375
1576
  onSubmit: (data)=>{
1376
1577
  console.log('Form submitted:', data);
1377
1578
  alert('Form submitted! Check console for data.');
1378
1579
  },
1379
1580
  disabled: previewDisabled,
1380
1581
  autoComplete: "off"
1381
- }, sections.map((s)=>`${s.id}:${s.collapsible}:${s.defaultExpanded}:${s.fields.map((f)=>`${f.id}:${f.type}:${f.name}:${JSON.stringify(f.rules || [])}:${JSON.stringify(f.validation || {})}`).join('-')}`).join(','))
1582
+ }, sections.map((s)=>`${s.id}:${s.collapsible}:${s.defaultExpanded}:${s.fields.map((f)=>`${f.id}:${f.type}:${f.name}:${JSON.stringify(f.rules || [])}:${JSON.stringify(f.validation || {})}:${JSON.stringify(f.valueModes || {})}`).join('-')}`).join(','))
1382
1583
  ]
1383
1584
  }),
1384
1585
  /*#__PURE__*/ jsx(TabsContent, {