@ethereal-nexus/core 1.0.1 → 1.2.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 (142) hide show
  1. package/dist/decorators/index.d.mts +1 -1
  2. package/dist/decorators/index.d.ts +1 -1
  3. package/dist/decorators/index.js +25 -3
  4. package/dist/decorators/index.js.map +1 -1
  5. package/dist/decorators/index.mjs +25 -3
  6. package/dist/decorators/index.mjs.map +1 -1
  7. package/dist/decorators/webcomponent/index.d.mts +1 -1
  8. package/dist/decorators/webcomponent/index.d.ts +1 -1
  9. package/dist/decorators/webcomponent/index.js +25 -3
  10. package/dist/decorators/webcomponent/index.js.map +1 -1
  11. package/dist/decorators/webcomponent/index.mjs +25 -3
  12. package/dist/decorators/webcomponent/index.mjs.map +1 -1
  13. package/dist/decorators/webcomponent/webcomponent.d.mts +1 -1
  14. package/dist/decorators/webcomponent/webcomponent.d.ts +1 -1
  15. package/dist/decorators/webcomponent/webcomponent.js +25 -3
  16. package/dist/decorators/webcomponent/webcomponent.js.map +1 -1
  17. package/dist/decorators/webcomponent/webcomponent.mjs +25 -3
  18. package/dist/decorators/webcomponent/webcomponent.mjs.map +1 -1
  19. package/dist/functions/component/component.d.mts +3 -4
  20. package/dist/functions/component/component.d.ts +3 -4
  21. package/dist/functions/component/component.js +3 -16
  22. package/dist/functions/component/component.js.map +1 -1
  23. package/dist/functions/component/component.mjs +3 -16
  24. package/dist/functions/component/component.mjs.map +1 -1
  25. package/dist/functions/component/index.d.mts +1 -1
  26. package/dist/functions/component/index.d.ts +1 -1
  27. package/dist/functions/component/index.js +3 -16
  28. package/dist/functions/component/index.js.map +1 -1
  29. package/dist/functions/component/index.mjs +3 -16
  30. package/dist/functions/component/index.mjs.map +1 -1
  31. package/dist/functions/index.d.mts +1 -1
  32. package/dist/functions/index.d.ts +1 -1
  33. package/dist/functions/index.js +3 -16
  34. package/dist/functions/index.js.map +1 -1
  35. package/dist/functions/index.mjs +3 -16
  36. package/dist/functions/index.mjs.map +1 -1
  37. package/dist/functions/parse/index.d.mts +1 -1
  38. package/dist/functions/parse/index.d.ts +1 -1
  39. package/dist/functions/parse/parse.d.mts +1 -1
  40. package/dist/functions/parse/parse.d.ts +1 -1
  41. package/dist/functions/parse/parsePrimitives.d.mts +1 -1
  42. package/dist/functions/parse/parsePrimitives.d.ts +1 -1
  43. package/dist/index.d.mts +2 -1
  44. package/dist/index.d.ts +2 -1
  45. package/dist/index.js +53 -19
  46. package/dist/index.js.map +1 -1
  47. package/dist/index.mjs +52 -19
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/schema/calendar/calendar.d.mts +1 -1
  50. package/dist/schema/calendar/calendar.d.ts +1 -1
  51. package/dist/schema/calendar/index.d.mts +1 -1
  52. package/dist/schema/calendar/index.d.ts +1 -1
  53. package/dist/schema/checkbox/checkbox.d.mts +1 -1
  54. package/dist/schema/checkbox/checkbox.d.ts +1 -1
  55. package/dist/schema/checkbox/index.d.mts +1 -1
  56. package/dist/schema/checkbox/index.d.ts +1 -1
  57. package/dist/schema/datamodel/datamodel.d.mts +1 -1
  58. package/dist/schema/datamodel/datamodel.d.ts +1 -1
  59. package/dist/schema/datamodel/index.d.mts +1 -1
  60. package/dist/schema/datamodel/index.d.ts +1 -1
  61. package/dist/schema/datasource/datasource.d.mts +1 -1
  62. package/dist/schema/datasource/datasource.d.ts +1 -1
  63. package/dist/schema/datasource/index.d.mts +1 -1
  64. package/dist/schema/datasource/index.d.ts +1 -1
  65. package/dist/schema/dialog/condition.d.mts +1 -1
  66. package/dist/schema/dialog/condition.d.ts +1 -1
  67. package/dist/schema/dialog/dialog.d.mts +1 -1
  68. package/dist/schema/dialog/dialog.d.ts +1 -1
  69. package/dist/schema/dialog/index.d.mts +1 -1
  70. package/dist/schema/dialog/index.d.ts +1 -1
  71. package/dist/schema/dialog/tabs.d.mts +1 -1
  72. package/dist/schema/dialog/tabs.d.ts +1 -1
  73. package/dist/schema/dialog/types.d.mts +1 -1
  74. package/dist/schema/dialog/types.d.ts +1 -1
  75. package/dist/schema/dynamic/dynamic.d.mts +1 -1
  76. package/dist/schema/dynamic/dynamic.d.ts +1 -1
  77. package/dist/schema/dynamic/index.d.mts +1 -1
  78. package/dist/schema/dynamic/index.d.ts +1 -1
  79. package/dist/schema/group/group.d.mts +1 -1
  80. package/dist/schema/group/group.d.ts +1 -1
  81. package/dist/schema/group/index.d.mts +1 -1
  82. package/dist/schema/group/index.d.ts +1 -1
  83. package/dist/schema/hidden/hidden.d.mts +1 -1
  84. package/dist/schema/hidden/hidden.d.ts +1 -1
  85. package/dist/schema/hidden/index.d.mts +1 -1
  86. package/dist/schema/hidden/index.d.ts +1 -1
  87. package/dist/schema/image/image.d.mts +1 -1
  88. package/dist/schema/image/image.d.ts +1 -1
  89. package/dist/schema/image/index.d.mts +1 -1
  90. package/dist/schema/image/index.d.ts +1 -1
  91. package/dist/schema/multifield/index.d.mts +1 -1
  92. package/dist/schema/multifield/index.d.ts +1 -1
  93. package/dist/schema/multifield/multifield.d.mts +1 -1
  94. package/dist/schema/multifield/multifield.d.ts +1 -1
  95. package/dist/schema/navigation/index.d.mts +4 -0
  96. package/dist/schema/navigation/index.d.ts +4 -0
  97. package/dist/schema/navigation/index.js +53 -0
  98. package/dist/schema/navigation/index.js.map +1 -0
  99. package/dist/schema/navigation/index.mjs +26 -0
  100. package/dist/schema/navigation/index.mjs.map +1 -0
  101. package/dist/schema/navigation/navigation.d.mts +22 -0
  102. package/dist/schema/navigation/navigation.d.ts +22 -0
  103. package/dist/schema/navigation/navigation.js +51 -0
  104. package/dist/schema/navigation/navigation.js.map +1 -0
  105. package/dist/schema/navigation/navigation.mjs +26 -0
  106. package/dist/schema/navigation/navigation.mjs.map +1 -0
  107. package/dist/schema/object/index.d.mts +1 -1
  108. package/dist/schema/object/index.d.ts +1 -1
  109. package/dist/schema/object/object.d.mts +1 -1
  110. package/dist/schema/object/object.d.ts +1 -1
  111. package/dist/schema/optional/index.d.mts +1 -1
  112. package/dist/schema/optional/index.d.ts +1 -1
  113. package/dist/schema/optional/optional.d.mts +1 -1
  114. package/dist/schema/optional/optional.d.ts +1 -1
  115. package/dist/schema/pathbrowser/index.d.mts +1 -1
  116. package/dist/schema/pathbrowser/index.d.ts +1 -1
  117. package/dist/schema/pathbrowser/pathbrowser.d.mts +1 -1
  118. package/dist/schema/pathbrowser/pathbrowser.d.ts +1 -1
  119. package/dist/schema/rte/index.d.mts +1 -1
  120. package/dist/schema/rte/index.d.ts +1 -1
  121. package/dist/schema/rte/rte.d.mts +1 -1
  122. package/dist/schema/rte/rte.d.ts +1 -1
  123. package/dist/schema/select/index.d.mts +1 -1
  124. package/dist/schema/select/index.d.ts +1 -1
  125. package/dist/schema/select/select.d.mts +1 -1
  126. package/dist/schema/select/select.d.ts +1 -1
  127. package/dist/schema/text/index.d.mts +1 -1
  128. package/dist/schema/text/index.d.ts +1 -1
  129. package/dist/schema/text/text.d.mts +1 -1
  130. package/dist/schema/text/text.d.ts +1 -1
  131. package/dist/types/index.d.mts +1 -1
  132. package/dist/types/index.d.ts +1 -1
  133. package/dist/types/infer.d.mts +1 -1
  134. package/dist/types/infer.d.ts +1 -1
  135. package/dist/types/object.d.mts +1 -1
  136. package/dist/types/object.d.ts +1 -1
  137. package/dist/types/object.js.map +1 -1
  138. package/dist/types/schema.d.mts +1 -1
  139. package/dist/types/schema.d.ts +1 -1
  140. package/dist/{types-Cvbi87LT.d.ts → types-5qjjdXLi.d.ts} +1 -7
  141. package/dist/{types-DUGwdG43.d.mts → types-CUiyZnDu.d.mts} +1 -7
  142. package/package.json +3 -2
package/dist/index.mjs CHANGED
@@ -418,6 +418,29 @@ function datamodel(input) {
418
418
  };
419
419
  }
420
420
 
421
+ // src/schema/navigation/navigation.ts
422
+ function navigation(input) {
423
+ const { placeholder, label, tooltip, required, showChildrenCheckbox, showRootLevel } = input;
424
+ return {
425
+ type: "navigation",
426
+ _parse() {
427
+ return {
428
+ type: "navigation",
429
+ label,
430
+ placeholder,
431
+ tooltip,
432
+ required,
433
+ showChildrenCheckbox,
434
+ showRootLevel
435
+ };
436
+ },
437
+ _primitive() {
438
+ return "json";
439
+ },
440
+ ...input
441
+ };
442
+ }
443
+
421
444
  // src/schema/hidden/hidden.ts
422
445
  function hidden(input) {
423
446
  const { type } = input;
@@ -486,32 +509,19 @@ function parsePrimitives(schema) {
486
509
  }
487
510
 
488
511
  // src/functions/component/component.ts
489
- function component(config, dialog2, slots) {
490
- const slotsParse = slots ? Object.entries(slots).map(
491
- ([key, slot]) => ({
492
- id: key,
493
- name: key,
494
- ...slot._parse()
495
- })
496
- ) : [];
497
- const slotsPrimitives = slots ? Object.entries(slots).reduce((acc, [key, slot]) => {
498
- acc[key] = slot._primitive();
499
- return acc;
500
- }, {}) : [];
512
+ function component(config, dialog2) {
501
513
  return {
502
514
  type: "component",
503
515
  dialog: dialog2,
504
516
  _parse() {
505
517
  return {
506
518
  ...config,
507
- ...dialog2._parse(),
508
- dynamiczones: slotsParse
519
+ ...dialog2._parse()
509
520
  };
510
521
  },
511
522
  _primitive() {
512
523
  return {
513
- ...dialog2._primitive(),
514
- ...slotsPrimitives
524
+ ...dialog2._primitive()
515
525
  };
516
526
  },
517
527
  ...config
@@ -525,12 +535,34 @@ function webcomponent(schema, options) {
525
535
  } : void 0;
526
536
  return (component2) => {
527
537
  const name = pascalToKebab(component2.displayName);
538
+ class StyledWebComponent extends r2wc(component2, {
539
+ shadow: "open",
540
+ props
541
+ }) {
542
+ connectedCallback() {
543
+ super.connectedCallback();
544
+ queueMicrotask(() => {
545
+ const cssUrlsAttr = this.getAttribute("data-css-urls");
546
+ if (cssUrlsAttr) {
547
+ const cssUrlsArray = JSON.parse(cssUrlsAttr.replace(/'/g, '"'));
548
+ const slotTemplate = document.createElement("template");
549
+ const getImportsFromUrlsArray = (urls) => urls.map((url) => `<link rel="preload" as="style" onload="this.rel='stylesheet'" type="text/css" href="${url}">`).join("\n");
550
+ slotTemplate.innerHTML = `<style>
551
+ ::slotted(*) {
552
+ display: block !important;
553
+ }
554
+ </style>
555
+ ${getImportsFromUrlsArray(cssUrlsArray)}
556
+ `;
557
+ this.shadowRoot?.appendChild(slotTemplate.content.cloneNode(true));
558
+ }
559
+ });
560
+ }
561
+ }
528
562
  if (!window.customElements.get(name)) {
529
563
  customElements.define(
530
564
  name,
531
- r2wc(component2, {
532
- props
533
- })
565
+ StyledWebComponent
534
566
  );
535
567
  }
536
568
  };
@@ -549,6 +581,7 @@ export {
549
581
  hidden,
550
582
  image,
551
583
  multifield,
584
+ navigation,
552
585
  object,
553
586
  optional,
554
587
  parse,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schema/dialog/tabs.ts","../src/schema/dialog/condition.ts","../src/utils/pathToArray.ts","../src/schema/dialog/dialog.ts","../src/schema/multifield/multifield.ts","../src/schema/text/text.ts","../src/schema/checkbox/checkbox.ts","../src/schema/pathbrowser/pathbrowser.ts","../src/schema/image/image.ts","../src/schema/select/select.ts","../src/schema/rte/rte.ts","../src/schema/dynamic/dynamic.ts","../src/schema/calendar/calendar.ts","../src/schema/datasource/datasource.ts","../src/schema/group/group.ts","../src/schema/datamodel/datamodel.ts","../src/schema/hidden/hidden.ts","../src/schema/optional/optional.ts","../src/schema/object/object.ts","../src/decorators/webcomponent/webcomponent.ts","../src/utils/pascalToKebab.ts","../src/functions/parse/parse.ts","../src/functions/parse/parsePrimitives.ts","../src/functions/component/component.ts"],"sourcesContent":["import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n\n const nextKey = keys[i + 1];\n if(nextKey === '$this') {\n field.condition = condition;\n break;\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse(),\n }))\n .filter((entry: object) => {\n if ('type' in entry) {\n return entry.type !== 'hidden';\n }\n });\n\n const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput\n} from '../../types';\n\nexport interface MultifieldSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<InferOutput<TChildren>[]> {\n readonly type: 'multifield';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse]\n }\n },\n _primitive() {\n return 'json'\n },\n ...input\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface TextSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'textfield';\n}\n\ninterface TextInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {\n showastoggle?: boolean\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface PathBrowserSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'pathbrowser';\n}\n\ninterface PathBrowserInput extends BaseFieldInput {\n placeholder: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface ImageSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'image';\n}\n\ninterface ImageInput extends BaseFieldInput {\n}\n\nexport function image(input: ImageInput): ImageSchema {\n const {label, tooltip, required} = input;\n\n return {\n type: 'image',\n _parse() {\n return {\n type: 'image',\n label,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, BaseSchema } from '../../types';\n\ntype ReadonlyObject<T> = {\n readonly [K in keyof T]: T[K];\n};\n\nexport interface SelectSchema<T, TMultiple extends boolean = false> extends BaseSchema<TMultiple extends true ? T[] : T> {\n /**\n * The schema type.\n */\n type: 'select';\n multiple: TMultiple\n}\n\ninterface SelectInput extends BaseFieldInput {\n placeholder?: string;\n multiple?: boolean;\n values: {\n value: string;\n label: string;\n }[];\n}\n\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput, TMultiple extends boolean= T['multiple'] extends true ? true : false>(input: T): SelectSchema<ValuesType<ReadonlyObject<T>>, TMultiple>{\n const { label, values, tooltip, placeholder, multiple = false, required } = input;\n\n return {\n type: 'select',\n _parse() {\n return {\n type: 'select',\n label,\n multiple,\n values,\n tooltip,\n placeholder,\n required\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\n };\n}\n","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface RichTextEditorSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'richtexteditor';\n}\n\ninterface RichTextEditorInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import {\n BaseSchema,\n} from '../../types';\n\nexport interface DynamicZoneSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'dynamic';\n}\n\ninterface DynamicInput {\n}\n\nexport function dynamic(input: DynamicInput): DynamicZoneSchema {\n return {\n type: 'dynamic',\n _parse() {\n return {\n type: 'dynamic',\n };\n },\n _primitive() {\n return 'string';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CalendarSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'calendar';\n}\n\ninterface CalendarInput extends BaseFieldInput {\n placeholder?: string;\n valueformat: string;\n displayformat: string;\n headerformat: string;\n startday?: string;\n min?: string;\n max?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required} = input;\n\n return {\n type: 'calendar',\n _parse() {\n return {\n type: 'calendar',\n label,\n valueformat,\n placeholder,\n startday,\n tooltip,\n min,\n max,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\nimport { SelectSchema } from '../select';\ntype DataSourceOutputType<Multiple extends boolean> = Multiple extends true ? string[] : string;\n\nexport interface DataSourceSchema<Multiple extends boolean = false> extends BaseSchema<DataSourceOutputType<Multiple>> {\n /**\n * The schema type.\n */\n type: 'datasource';\n}\n\ninterface DataSourceBody {\n [key: string]: any;\n}\ninterface DataSourceInput extends BaseFieldInput {\n placeholder?: string;\n url: string;\n multiple?: boolean;\n body: DataSourceBody;\n}\n\nexport function datasource<Multiple extends boolean = false>(input: DataSourceInput & { multiple?: Multiple }): DataSourceSchema<Multiple> {\n const {label, body, url, tooltip,placeholder, multiple = false as Multiple, required } = input;\n\n return {\n type: 'datasource',\n _parse() {\n return {\n type: 'datasource',\n label,\n url,\n multiple,\n body,\n tooltip,\n placeholder,\n required,\n }\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n }\n}\n","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput,\n} from '../../types';\n\nexport interface GroupSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<{\n active: boolean;\n} & InferOutput<TChildren>> {\n readonly type: 'group';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren;\n toggle?: boolean;\n}\n\nexport function group<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): GroupSchema<TChildren> {\n const { label, children, tooltip, toggle } = input;\n const childrenParse = children._parse();\n\n return {\n type: 'group',\n _parse() {\n return {\n type: 'group',\n label,\n tooltip,\n toggle,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse],\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface DataModelSchema<TOutput extends Record<string, any> = Record<string, any>> extends BaseSchema<TOutput> { /**\n * The schema type.\n */\n type: 'datamodel';\n}\n\ninterface DataModelInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { type BaseSchema } from '../../types';\nimport { type WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface HiddenSchema extends BaseSchema<string> {\n /**\n * The schema type.\n */\n type: 'hidden';\n}\n\ninterface HiddenInput {\n type: WebcomponentPropTypes\n}\n\n/**\n * Creates a hidden schema.\n *\n * @param input The type of input for the webcomponent binding.\n *\n * @returns A hidden schema.\n */\nexport function hidden(input: HiddenInput): HiddenSchema {\n const {type} = input;\n\n return {\n type: 'hidden',\n _parse() {\n //Explicitly hidding this input from the parse final result.\n return this;\n },\n _primitive() {\n return type\n },\n }\n}","import { BaseSchema, Output } from '../../types';\n\n/**\n * Optional schema type.\n */\nexport interface OptionalSchema<\n TWrapped extends BaseSchema,\n TOutput = Output<TWrapped> | undefined\n> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'optional';\n /**\n * The wrapped schema.\n */\n wrapped: TWrapped;\n}\n\n\n/**\n * Creates an optional schema.\n *\n * @param wrapped The wrapped schema.\n *\n * @returns A optional schema.\n */\nexport function optional<TWrapped extends BaseSchema>(\n wrapped: TWrapped\n): OptionalSchema<TWrapped> {\n return {\n type: 'optional',\n wrapped,\n _primitive() {\n return this.wrapped._primitive();\n },\n _parse() {\n return this.wrapped._parse();\n },\n };\n}","import type { BaseSchema } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface ObjectSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'object';\n}\n\nexport function object<TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries> {\n return {\n type: 'object',\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return 'json'\n }\n };\n}","import type React from 'react';\nimport r2wc from '@r2wc/react-to-web-component';\nimport { DialogSchema } from '../../schema/dialog';\nimport { pascalToKebab } from '../../utils/pascalToKebab';\nimport { parsePrimitives } from '../../functions';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\ntype BaseOptions = {}\n\nexport function webcomponent<T extends ObjectEntries>(schema?: DialogSchema<T>, options?: BaseOptions) {\n const props: Record<string, WebcomponentPropTypes> | undefined = schema ? {\n ...parsePrimitives(schema),\n } : undefined;\n\n return <P extends {} = {}>(component: React.ComponentType<P>) => {\n const name = pascalToKebab(component.displayName!)\n\n if (!window.customElements.get(name)) {\n customElements.define(\n name,\n r2wc(component, {\n props,\n }),\n );\n }\n }\n}","export function pascalToKebab(pascalCaseString: string) {\n return pascalCaseString\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}","import { DialogSchema } from '../../schema/dialog';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parse<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._parse()\n}","import { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._primitive() as Record<string, WebcomponentPropTypes>\n}","import { BaseSchema, ComponentModel } from '../../types';\nimport { ObjectEntries, ObjectOutput, SlotEntries } from '../../types/object';\nimport { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface ComponentSchema<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined> extends BaseSchema<ObjectOutput<TEntries & TSlots>>, Partial<ComponentModel> {\n type: 'component';\n dialog: DialogSchema<TEntries>;\n slots?: TSlots,\n}\n\nexport function component<TEntries extends ObjectEntries, TSlots extends SlotEntries | undefined>(\n config: Partial<ComponentModel>,\n dialog: DialogSchema<TEntries>,\n slots?: TSlots,\n): ComponentSchema<TEntries, TSlots> {\n\n const slotsParse = slots ? Object.entries(slots).map(([key, slot]) => (\n {\n id: key,\n name: key,\n ...slot._parse(),\n }),\n ) : [];\n const slotsPrimitives = slots ? Object.entries(slots).reduce((acc, [key, slot]) => {\n acc[key] = slot._primitive();\n return acc\n }, {} as Record<string, WebcomponentPropTypes | Record<string, WebcomponentPropTypes>>) : [];\n\n return {\n type: 'component',\n dialog,\n _parse() {\n return {\n ...config,\n ...dialog._parse(),\n dynamiczones: slotsParse,\n };\n },\n _primitive() {\n return {\n ...dialog._primitive() as object,\n ...slotsPrimitives as object,\n };\n },\n ...config,\n };\n}"],"mappings":";;;;;AAGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IAAiC;AAAA;AAAA,EAEpD,OAAO,MAAc,SAA8B;AACjD,SAAK,KAAK,IAAI,MAAM,OAAO;AAAA,EAC7B;AAAA,EAEA,MAAM,SAAkB;AACtB,UAAM,SAAS,CAAC;AAChB,UAAM,cAAc,oBAAI,IAAI;AAE5B,QAAG,KAAK,KAAK,SAAS,GAAG;AACvB,aAAO;AAAA,IACT;AAEA,eAAU,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM;AACnC,YAAM,WAAW,CAAC;AAElB,UAAG,CAAC,MAAM;AACR,cAAM,IAAI,MAAM,UAAU,OAAO,IAAI,CAAC,mDAAmD;AAAA,MAC3F;AAEA,iBAAU,CAAC,GAAI,KAAK,OAAO,QAAQ,IAAI,GAAG;AACxC,cAAM,QAAQ,QAAQ,KAAK,OAAK,EAAE,OAAO,GAAG;AAE5C,YAAI,YAAY,IAAI,GAAG,GAAG;AACxB,gBAAM,IAAI,MAAM,UAAU,OAAO,IAAI,CAAC,IAAI,OAAO,GAAG,CAAC,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E3F,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAAA;AAAA,IACA,SAAS;AACP,aAAO;AAAA,QACL,GAAG;AAAA,QACH,GAAGA,QAAO,OAAO;AAAA,QACjB,cAAc;AAAA,MAChB;AAAA,IACF;AAAA,IACA,aAAa;AACX,aAAO;AAAA,QACL,GAAGA,QAAO,WAAW;AAAA,QACrB,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,GAAG;AAAA,EACL;AACF;;;AJrCO,SAAS,aAAsC,QAA0B,SAAuB;AACrG,QAAM,QAA2D,SAAS;AAAA,IACxE,GAAG,gBAAgB,MAAM;AAAA,EAC3B,IAAI;AAEJ,SAAO,CAAoBC,eAAsC;AAC/D,UAAM,OAAO,cAAcA,WAAU,WAAY;AAEjD,QAAI,CAAC,OAAO,eAAe,IAAI,IAAI,GAAG;AACpC,qBAAe;AAAA,QACb;AAAA,QACA,KAAKA,YAAW;AAAA,UACd;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AACF;","names":["field","dialog","dialog","component"]}
1
+ {"version":3,"sources":["../src/schema/dialog/tabs.ts","../src/schema/dialog/condition.ts","../src/utils/pathToArray.ts","../src/schema/dialog/dialog.ts","../src/schema/multifield/multifield.ts","../src/schema/text/text.ts","../src/schema/checkbox/checkbox.ts","../src/schema/pathbrowser/pathbrowser.ts","../src/schema/image/image.ts","../src/schema/select/select.ts","../src/schema/rte/rte.ts","../src/schema/dynamic/dynamic.ts","../src/schema/calendar/calendar.ts","../src/schema/datasource/datasource.ts","../src/schema/group/group.ts","../src/schema/datamodel/datamodel.ts","../src/schema/navigation/navigation.ts","../src/schema/hidden/hidden.ts","../src/schema/optional/optional.ts","../src/schema/object/object.ts","../src/decorators/webcomponent/webcomponent.ts","../src/utils/pascalToKebab.ts","../src/functions/parse/parse.ts","../src/functions/parse/parsePrimitives.ts","../src/functions/component/component.ts"],"sourcesContent":["import { EntryMask } from '../../types';\nimport { Field } from './types';\n\nexport class Tabs<TEntries> {\n private tabs = new Map<string, EntryMask<TEntries>>();\n\n addTab(name: string, entries: EntryMask<TEntries>) {\n this.tabs.set(name, entries);\n }\n\n parse(entries: Field[]) {\n const result = []\n const usedEntries = new Set();\n\n if(this.tabs.size === 0) {\n return entries\n }\n\n for(const [name, mask] of this.tabs) {\n const children = []\n\n if(!mask) {\n throw new Error(`Entry \"${String(name)}\" does not have an appropriate tab configuration.`);\n }\n\n for(const [key,] of Object.entries(mask)) {\n const field = entries.find(f => f.id === key)\n\n if (usedEntries.has(key)) {\n throw new Error(`Entry \"${String(name)}.${String(key)}\" is already used in another tab.`);\n }\n\n if(!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n children.push(entries.find(f => f.id === key))\n }\n\n result.push({\n type: 'tab',\n label: name,\n id: `tab_${name.toLowerCase().replaceAll(' ', '')}`,\n children\n })\n }\n\n return [{\n type: 'tabs',\n id: 'tabs',\n children: result\n }]\n }\n}","import { NestedPaths } from '../../types';\nimport { ConditionFn, ConditionOperators, Conditions, Field } from './types';\nimport { ObjectEntries } from '../../types/object';\n\nfunction addConditionToField(fields: Field[], path: string, condition: Conditions): void {\n const keys = path.split('.');\n let currentFields = fields;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const field = currentFields.find(f => f.id === key);\n\n if (!field) {\n throw new Error(`Field with id \"${key}\" not found`);\n }\n\n if (i === keys.length - 1) {\n field.condition = condition;\n } else {\n if (!field.children) {\n throw new Error(`Field with id \"${key}\" has no children`);\n }\n\n const nextKey = keys[i + 1];\n if(nextKey === '$this') {\n field.condition = condition;\n break;\n }\n currentFields = field.children;\n }\n }\n}\n\nexport class Condition<TEntries extends ObjectEntries> {\n private conditions = new Map<string, Conditions>();\n\n addCondition(field: NestedPaths<TEntries>, condition: ConditionFn<TEntries>) {\n const operators: ConditionOperators<TEntries> = {\n eq: (field, value) => ({ operator: 'eq', field, value }),\n neq: (field, value) => ({ operator: 'neq', field, value }),\n exists: (field) => ({ operator: 'exists', field }),\n and: (...operations) => ({ operator: 'and', value: operations }),\n or: (...operations) => ({ operator: 'or', value: operations })\n };\n\n this.conditions.set(field, condition(operators));\n }\n\n parse(entries: Field[]) {\n for (let [key, value] of this.conditions) {\n addConditionToField(entries, key, value)\n }\n\n return entries;\n }\n}\n","interface PathValue {\n path: string[];\n value: any;\n}\n\nexport function pathToArray(obj: Record<string, any>, parentPath: string[] = []): PathValue[] {\n const result: PathValue[] = [];\n\n for (const [key, value] of Object.entries(obj)) {\n const currentPath = [...parentPath, key];\n\n if (typeof value === 'object' && !value.hasOwnProperty('operator') && !Array.isArray(value)) {\n // If the value is an object, recurse into it\n result.push(...pathToArray(value, currentPath));\n } else {\n // If the value is not an object, store the path and value\n result.push({ path: currentPath, value });\n }\n }\n\n return result;\n}","import { BaseSchema, EntryMask, NestedPaths } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { Tabs } from './tabs';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { Condition } from './condition';\nimport { pathToArray } from '../../utils/pathToArray';\nimport { ConditionsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: Record<string, EntryMask<TEntries>>) => DialogSchema<TEntries>;\n conditions: (conditions: ConditionsArgument<TEntries>) => DialogSchema<TEntries>;\n}\n\nclass DialogBuilder<TEntries extends ObjectEntries> implements DialogSchema<TEntries> {\n private conditionsModule: Condition<TEntries>;\n private tabsModule: Tabs<TEntries>;\n private readonly entries: TEntries;\n readonly type = 'dialog';\n\n constructor(entries: TEntries) {\n this.entries = entries;\n this.conditionsModule = new Condition<TEntries>();\n this.tabsModule = new Tabs<TEntries>();\n }\n\n conditions(conditions: ConditionsArgument<TEntries>) {\n const conditionsArray = pathToArray(conditions)\n for (const condition of conditionsArray) {\n this.conditionsModule.addCondition(condition.path.join('.') as NestedPaths<TEntries>, condition.value);\n }\n return this;\n }\n\n tabs(tabs: Record<string, EntryMask<TEntries>>) {\n for (const [key, tab] of Object.entries(tabs)) {\n this.tabsModule.addTab(key as any, tab!);\n }\n return this;\n }\n\n _parse() {\n const dialog = Object.entries(this.entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse(),\n }))\n .filter((entry: object) => {\n if ('type' in entry) {\n return entry.type !== 'hidden';\n }\n });\n\n const dialogWithConditions = this.conditionsModule.parse(dialog);\n const dialogWithTabs = this.tabsModule.parse(dialogWithConditions);\n return {\n dialog: dialogWithTabs\n };\n }\n\n _primitive() {\n const result: Record<string, WebcomponentPropTypes> = {};\n\n for (const [key, entry] of Object.entries(this.entries)) {\n const type = entry._primitive();\n if (typeof type === 'string') {\n result[key] = type;\n }\n }\n\n return result;\n }\n}\n\nexport function dialog<TEntries extends ObjectEntries>(entries: TEntries) {\n return new DialogBuilder(entries)\n}","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput\n} from '../../types';\n\nexport interface MultifieldSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<InferOutput<TChildren>[]> {\n readonly type: 'multifield';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse]\n }\n },\n _primitive() {\n return 'json'\n },\n ...input\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface TextSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'textfield';\n}\n\ninterface TextInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends boolean = boolean> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {\n showastoggle?: boolean\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface PathBrowserSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'pathbrowser';\n}\n\ninterface PathBrowserInput extends BaseFieldInput {\n placeholder: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface ImageSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'image';\n}\n\ninterface ImageInput extends BaseFieldInput {\n}\n\nexport function image(input: ImageInput): ImageSchema {\n const {label, tooltip, required} = input;\n\n return {\n type: 'image',\n _parse() {\n return {\n type: 'image',\n label,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, BaseSchema } from '../../types';\n\ntype ReadonlyObject<T> = {\n readonly [K in keyof T]: T[K];\n};\n\nexport interface SelectSchema<T, TMultiple extends boolean = false> extends BaseSchema<TMultiple extends true ? T[] : T> {\n /**\n * The schema type.\n */\n type: 'select';\n multiple: TMultiple\n}\n\ninterface SelectInput extends BaseFieldInput {\n placeholder?: string;\n multiple?: boolean;\n values: {\n value: string;\n label: string;\n }[];\n}\n\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput, TMultiple extends boolean= T['multiple'] extends true ? true : false>(input: T): SelectSchema<ValuesType<ReadonlyObject<T>>, TMultiple>{\n const { label, values, tooltip, placeholder, multiple = false, required } = input;\n\n return {\n type: 'select',\n _parse() {\n return {\n type: 'select',\n label,\n multiple,\n values,\n tooltip,\n placeholder,\n required\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\n };\n}\n","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface RichTextEditorSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'richtexteditor';\n}\n\ninterface RichTextEditorInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import {\n BaseSchema,\n} from '../../types';\n\nexport interface DynamicZoneSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'dynamic';\n}\n\ninterface DynamicInput {\n}\n\nexport function dynamic(input: DynamicInput): DynamicZoneSchema {\n return {\n type: 'dynamic',\n _parse() {\n return {\n type: 'dynamic',\n };\n },\n _primitive() {\n return 'string';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CalendarSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'calendar';\n}\n\ninterface CalendarInput extends BaseFieldInput {\n placeholder?: string;\n valueformat: string;\n displayformat: string;\n headerformat: string;\n startday?: string;\n min?: string;\n max?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required} = input;\n\n return {\n type: 'calendar',\n _parse() {\n return {\n type: 'calendar',\n label,\n valueformat,\n placeholder,\n startday,\n tooltip,\n min,\n max,\n required\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\nimport { SelectSchema } from '../select';\ntype DataSourceOutputType<Multiple extends boolean> = Multiple extends true ? string[] : string;\n\nexport interface DataSourceSchema<Multiple extends boolean = false> extends BaseSchema<DataSourceOutputType<Multiple>> {\n /**\n * The schema type.\n */\n type: 'datasource';\n}\n\ninterface DataSourceBody {\n [key: string]: any;\n}\ninterface DataSourceInput extends BaseFieldInput {\n placeholder?: string;\n url: string;\n multiple?: boolean;\n body: DataSourceBody;\n}\n\nexport function datasource<Multiple extends boolean = false>(input: DataSourceInput & { multiple?: Multiple }): DataSourceSchema<Multiple> {\n const {label, body, url, tooltip,placeholder, multiple = false as Multiple, required } = input;\n\n return {\n type: 'datasource',\n _parse() {\n return {\n type: 'datasource',\n label,\n url,\n multiple,\n body,\n tooltip,\n placeholder,\n required,\n }\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n }\n}\n","import {\n BaseFieldInput,\n BaseSchema,\n InferOutput,\n} from '../../types';\n\nexport interface GroupSchema<\n TChildren extends BaseSchema<unknown>,\n> extends BaseSchema<{\n active: boolean;\n} & InferOutput<TChildren>> {\n readonly type: 'group';\n /**\n * The children item schema.\n */\n readonly children: TChildren;\n}\n\ninterface MultifieldInput<TChildren extends BaseSchema<unknown>> extends BaseFieldInput {\n children: TChildren;\n toggle?: boolean;\n}\n\nexport function group<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): GroupSchema<TChildren> {\n const { label, children, tooltip, toggle } = input;\n const childrenParse = children._parse();\n\n return {\n type: 'group',\n _parse() {\n return {\n type: 'group',\n label,\n tooltip,\n toggle,\n children: Array.isArray(childrenParse) ? childrenParse : [childrenParse],\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface DataModelSchema<TOutput extends Record<string, any> = Record<string, any>> extends BaseSchema<TOutput> { /**\n * The schema type.\n */\n type: 'datamodel';\n}\n\ninterface DataModelInput extends BaseFieldInput {\n placeholder?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface NavigationSchema extends BaseSchema<NavigationItemSchema[]> { /**\n * The schema type.\n */\n type: 'navigation';\n}\n\nexport interface NavigationItemSchema {\n id: string;\n children: NavigationItemSchema[];\n active: boolean;\n url: string;\n title: string;\n}\n\n\ninterface DataModelInput extends BaseFieldInput {\n placeholder?: string;\n showChildrenCheckbox?: boolean;\n showRootLevel?: boolean;\n}\n\nexport function navigation(input: DataModelInput): NavigationSchema {\n const {placeholder, label,tooltip, required, showChildrenCheckbox, showRootLevel} = input;\n\n return {\n type: 'navigation',\n _parse() {\n return {\n type: 'navigation',\n label,\n placeholder,\n tooltip,\n required,\n showChildrenCheckbox,\n showRootLevel,\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { type BaseSchema } from '../../types';\nimport { type WebcomponentPropTypes } from '../../types/webcomponent';\n\nexport interface HiddenSchema extends BaseSchema<string> {\n /**\n * The schema type.\n */\n type: 'hidden';\n}\n\ninterface HiddenInput {\n type: WebcomponentPropTypes\n}\n\n/**\n * Creates a hidden schema.\n *\n * @param input The type of input for the webcomponent binding.\n *\n * @returns A hidden schema.\n */\nexport function hidden(input: HiddenInput): HiddenSchema {\n const {type} = input;\n\n return {\n type: 'hidden',\n _parse() {\n //Explicitly hidding this input from the parse final result.\n return this;\n },\n _primitive() {\n return type\n },\n }\n}","import { BaseSchema, Output } from '../../types';\n\n/**\n * Optional schema type.\n */\nexport interface OptionalSchema<\n TWrapped extends BaseSchema,\n TOutput = Output<TWrapped> | undefined\n> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'optional';\n /**\n * The wrapped schema.\n */\n wrapped: TWrapped;\n}\n\n\n/**\n * Creates an optional schema.\n *\n * @param wrapped The wrapped schema.\n *\n * @returns A optional schema.\n */\nexport function optional<TWrapped extends BaseSchema>(\n wrapped: TWrapped\n): OptionalSchema<TWrapped> {\n return {\n type: 'optional',\n wrapped,\n _primitive() {\n return this.wrapped._primitive();\n },\n _parse() {\n return this.wrapped._parse();\n },\n };\n}","import type { BaseSchema } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\n\nexport interface ObjectSchema<TEntries extends ObjectEntries, TOutput = ObjectOutput<TEntries>> extends BaseSchema<TOutput> {\n type: 'object';\n}\n\nexport function object<TEntries extends ObjectEntries>(entries: TEntries): ObjectSchema<TEntries> {\n return {\n type: 'object',\n _parse() {\n return Object.entries(entries)\n .map(([key, entry]) => ({\n id: key,\n name: key,\n ...entry._parse()\n }))\n .filter((entry: object) => {\n if('type' in entry){\n return entry.type !== 'hidden'\n }\n })\n },\n _primitive() {\n return 'json'\n }\n };\n}","import type React from 'react';\nimport r2wc from '@r2wc/react-to-web-component';\nimport { DialogSchema } from '../../schema/dialog';\nimport { pascalToKebab } from '../../utils/pascalToKebab';\nimport { parsePrimitives } from '../../functions';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\ntype BaseOptions = {}\n\nexport function webcomponent<T extends ObjectEntries>(schema?: DialogSchema<T>, options?: BaseOptions) {\n const props: Record<string, WebcomponentPropTypes> | undefined = schema ? {\n ...parsePrimitives(schema),\n } : undefined;\n\n return <P extends {} = {}>(component: React.ComponentType<P>) => {\n const name = pascalToKebab(component.displayName!);\n\n class StyledWebComponent extends r2wc(component, {\n shadow: 'open',\n props,\n }) {\n connectedCallback() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n super.connectedCallback();\n queueMicrotask(() => {\n\n const cssUrlsAttr = this.getAttribute('data-css-urls');\n if (cssUrlsAttr) {\n const cssUrlsArray: string[] = JSON.parse(cssUrlsAttr.replace(/'/g, '\"'));\n const slotTemplate = document.createElement('template');\n const getImportsFromUrlsArray = (urls: string[]) => urls.map((url) => `<link rel=\"preload\" as=\"style\" onload=\"this.rel='stylesheet'\" type=\"text/css\" href=\"${url}\">`).join('\\n');\n slotTemplate.innerHTML = `<style>\n ::slotted(*) {\n display: block !important;\n }\n </style>\n ${getImportsFromUrlsArray(cssUrlsArray)}\n`;\n this.shadowRoot?.appendChild(slotTemplate.content.cloneNode(true));\n }\n });\n }\n }\n\n\n if (!window.customElements.get(name)) {\n customElements.define(\n name, StyledWebComponent,\n );\n }\n };\n}","export function pascalToKebab(pascalCaseString: string) {\n return pascalCaseString\n .replace(/([a-z])([A-Z])/g, '$1-$2')\n .toLowerCase();\n}","import { DialogSchema } from '../../schema/dialog';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parse<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._parse()\n}","import { DialogSchema } from '../../schema/dialog';\nimport { WebcomponentPropTypes } from '../../types/webcomponent';\nimport { ObjectEntries } from '../../types/object';\n\nexport function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>) {\n return schema._primitive() as Record<string, WebcomponentPropTypes>\n}","import { BaseSchema, ComponentModel } from '../../types';\nimport { ObjectEntries, ObjectOutput } from '../../types/object';\nimport { DialogSchema } from '../../schema/dialog';\n\nexport interface ComponentSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>>, Partial<ComponentModel> {\n type: 'component';\n dialog: DialogSchema<TEntries>;\n}\n\nexport function component<TEntries extends ObjectEntries>(\n config: Partial<ComponentModel>,\n dialog: DialogSchema<TEntries>,\n): ComponentSchema<TEntries> {\n\n return {\n type: 'component',\n dialog,\n _parse() {\n return {\n ...config,\n ...dialog._parse(),\n };\n },\n _primitive() {\n return {\n ...dialog._primitive() as object,\n };\n },\n ...config,\n };\n}"],"mappings":";;;;;AAGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IAAiC;AAAA;AAAA,EAEpD,OAAO,MAAc,SAA8B;AACjD,SAAK,KAAK,IAAI,MAAM,OAAO;AAAA,EAC7B;AAAA,EAEA,MAAM,SAAkB;AACtB,UAAM,SAAS,CAAC;AAChB,UAAM,cAAc,oBAAI,IAAI;AAE5B,QAAG,KAAK,KAAK,SAAS,GAAG;AACvB,aAAO;AAAA,IACT;AAEA,eAAU,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM;AACnC,YAAM,WAAW,CAAC;AAElB,UAAG,CAAC,MAAM;AACR,cAAM,IAAI,MAAM,UAAU,OAAO,IAAI,CAAC,mDAAmD;AAAA,MAC3F;AAEA,iBAAU,CAAC,GAAI,KAAK,OAAO,QAAQ,IAAI,GAAG;AACxC,cAAM,QAAQ,QAAQ,KAAK,OAAK,EAAE,OAAO,GAAG;AAE5C,YAAI,YAAY,IAAI,GAAG,GAAG;AACxB,gBAAM,IAAI,MAAM,UAAU,OAAO,IAAI,CAAC,IAAI,OAAO,GAAG,CAAC,mCAAmC;AAAA,QAC1F;AAEA,YAAG,CAAC,OAAO;AACT,gBAAM,IAAI,MAAM,kBAAkB,GAAG,aAAa;AAAA,QACpD;AAEA,iBAAS,KAAK,QAAQ,KAAK,OAAK,EAAE,OAAO,GAAG,CAAC;AAAA,MAC/C;AAEA,aAAO,KAAK;AAAA,QACV,MAAM;AAAA,QACN,OAAO;AAAA,QACP,IAAI,OAAO,KAAK,YAAY,EAAE,WAAW,KAAK,EAAE,CAAC;A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A,EAC3B,IAAI;AAEJ,SAAO,CAAoBC,eAAsC;AAC/D,UAAM,OAAO,cAAcA,WAAU,WAAY;AAAA,IAEjD,MAAM,2BAA2B,KAAKA,YAAW;AAAA,MAC/C,QAAQ;AAAA,MACR;AAAA,IACF,CAAC,EAAE;AAAA,MACD,oBAAoB;AAGlB,cAAM,kBAAkB;AACxB,uBAAe,MAAM;AAEnB,gBAAM,cAAc,KAAK,aAAa,eAAe;AACrD,cAAI,aAAa;AACf,kBAAM,eAAyB,KAAK,MAAM,YAAY,QAAQ,MAAM,GAAG,CAAC;AACxE,kBAAM,eAAe,SAAS,cAAc,UAAU;AACtD,kBAAM,0BAA0B,CAAC,SAAmB,KAAK,IAAI,CAAC,QAAQ,uFAAuF,GAAG,IAAI,EAAE,KAAK,IAAI;AAC/K,yBAAa,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKnB,wBAAwB,YAAY,CAAC;AAAA;AAE3C,iBAAK,YAAY,YAAY,aAAa,QAAQ,UAAU,IAAI,CAAC;AAAA,UACnE;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAGA,QAAI,CAAC,OAAO,eAAe,IAAI,IAAI,GAAG;AACpC,qBAAe;AAAA,QACb;AAAA,QAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["field","dialog","dialog","component"]}
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { CalendarSchema, calendar } from './calendar.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { CalendarSchema, calendar } from './calendar.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { CheckBoxSchema, checkbox } from './checkbox.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { CheckBoxSchema, checkbox } from './checkbox.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { DataModelSchema, datamodel } from './datamodel.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { DataModelSchema, datamodel } from './datamodel.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { DataSourceSchema, datasource } from './datasource.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { DataSourceSchema, datasource } from './datasource.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,5 +1,5 @@
1
1
  import { NestedPaths } from '../../types/utils.mjs';
2
- import { f as ObjectEntries, b as ConditionFn, F as Field } from '../../types-DUGwdG43.mjs';
2
+ import { f as ObjectEntries, b as ConditionFn, F as Field } from '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
 
5
5
  declare class Condition<TEntries extends ObjectEntries> {
@@ -1,5 +1,5 @@
1
1
  import { NestedPaths } from '../../types/utils.js';
2
- import { f as ObjectEntries, b as ConditionFn, F as Field } from '../../types-Cvbi87LT.js';
2
+ import { f as ObjectEntries, b as ConditionFn, F as Field } from '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
 
5
5
  declare class Condition<TEntries extends ObjectEntries> {
@@ -1,4 +1,4 @@
1
- import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput, c as ConditionsArgument, F as Field } from '../../types-DUGwdG43.mjs';
1
+ import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput, c as ConditionsArgument, F as Field } from '../../types-CUiyZnDu.mjs';
2
2
  import { EntryMask } from '../../types/utils.mjs';
3
3
  import { WebcomponentPropTypes } from '../../types/webcomponent.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput, c as ConditionsArgument, F as Field } from '../../types-Cvbi87LT.js';
1
+ import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput, c as ConditionsArgument, F as Field } from '../../types-5qjjdXLi.js';
2
2
  import { EntryMask } from '../../types/utils.js';
3
3
  import { WebcomponentPropTypes } from '../../types/webcomponent.js';
4
4
 
@@ -1,6 +1,6 @@
1
1
  export { DialogSchema, dialog } from './dialog.mjs';
2
2
  export { Condition } from './condition.mjs';
3
- export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-DUGwdG43.mjs';
3
+ export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-CUiyZnDu.mjs';
4
4
  export { Tabs } from './tabs.mjs';
5
5
  import '../../types/utils.mjs';
6
6
  import '../../types/webcomponent.mjs';
@@ -1,6 +1,6 @@
1
1
  export { DialogSchema, dialog } from './dialog.js';
2
2
  export { Condition } from './condition.js';
3
- export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-Cvbi87LT.js';
3
+ export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-5qjjdXLi.js';
4
4
  export { Tabs } from './tabs.js';
5
5
  import '../../types/utils.js';
6
6
  import '../../types/webcomponent.js';
@@ -1,5 +1,5 @@
1
1
  import { EntryMask } from '../../types/utils.mjs';
2
- import { F as Field } from '../../types-DUGwdG43.mjs';
2
+ import { F as Field } from '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
 
5
5
  declare class Tabs<TEntries> {
@@ -1,5 +1,5 @@
1
1
  import { EntryMask } from '../../types/utils.js';
2
- import { F as Field } from '../../types-Cvbi87LT.js';
2
+ import { F as Field } from '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
 
5
5
  declare class Tabs<TEntries> {
@@ -1,3 +1,3 @@
1
- export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-DUGwdG43.mjs';
1
+ export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/utils.mjs';
3
3
  import '../../types/webcomponent.mjs';
@@ -1,3 +1,3 @@
1
- export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-Cvbi87LT.js';
1
+ export { b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/utils.js';
3
3
  import '../../types/webcomponent.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { DynamicZoneSchema, dynamic } from './dynamic.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { DynamicZoneSchema, dynamic } from './dynamic.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import { InferOutput } from '../../types/infer.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import { InferOutput } from '../../types/infer.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,5 +1,5 @@
1
1
  export { GroupSchema, group } from './group.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
5
5
  import '../../types/infer.mjs';
@@ -1,5 +1,5 @@
1
1
  export { GroupSchema, group } from './group.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
5
5
  import '../../types/infer.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema } from '../../types-CUiyZnDu.mjs';
2
2
  import { WebcomponentPropTypes } from '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema } from '../../types-5qjjdXLi.js';
2
2
  import { WebcomponentPropTypes } from '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { HiddenSchema, hidden } from './hidden.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { HiddenSchema, hidden } from './hidden.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-DUGwdG43.mjs';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-CUiyZnDu.mjs';
2
2
  import '../../types/webcomponent.mjs';
3
3
  import '../../types/utils.mjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { B as BaseSchema, d as BaseFieldInput } from '../../types-Cvbi87LT.js';
1
+ import { B as BaseSchema, d as BaseFieldInput } from '../../types-5qjjdXLi.js';
2
2
  import '../../types/webcomponent.js';
3
3
  import '../../types/utils.js';
4
4
 
@@ -1,4 +1,4 @@
1
1
  export { ImageSchema, image } from './image.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
@@ -1,4 +1,4 @@
1
1
  export { ImageSchema, image } from './image.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
@@ -1,5 +1,5 @@
1
1
  export { MultifieldSchema, multifield } from './multifield.mjs';
2
- import '../../types-DUGwdG43.mjs';
2
+ import '../../types-CUiyZnDu.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
5
5
  import '../../types/infer.mjs';
@@ -1,5 +1,5 @@
1
1
  export { MultifieldSchema, multifield } from './multifield.js';
2
- import '../../types-Cvbi87LT.js';
2
+ import '../../types-5qjjdXLi.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
5
5
  import '../../types/infer.js';