@ethereal-nexus/core 1.7.2 → 1.9.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 (129) hide show
  1. package/dist/decorators/index.d.mts +1 -1
  2. package/dist/decorators/index.d.ts +1 -1
  3. package/dist/decorators/webcomponent/index.d.mts +1 -1
  4. package/dist/decorators/webcomponent/index.d.ts +1 -1
  5. package/dist/decorators/webcomponent/webcomponent.d.mts +1 -1
  6. package/dist/decorators/webcomponent/webcomponent.d.ts +1 -1
  7. package/dist/functions/component/component.d.mts +1 -1
  8. package/dist/functions/component/component.d.ts +1 -1
  9. package/dist/functions/component/index.d.mts +1 -1
  10. package/dist/functions/component/index.d.ts +1 -1
  11. package/dist/functions/index.d.mts +1 -1
  12. package/dist/functions/index.d.ts +1 -1
  13. package/dist/functions/parse/index.d.mts +1 -1
  14. package/dist/functions/parse/index.d.ts +1 -1
  15. package/dist/functions/parse/parse.d.mts +1 -1
  16. package/dist/functions/parse/parse.d.ts +1 -1
  17. package/dist/functions/parse/parsePrimitives.d.mts +1 -1
  18. package/dist/functions/parse/parsePrimitives.d.ts +1 -1
  19. package/dist/index.d.mts +2 -1
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.js +28 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +24 -0
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/schema/calendar/calendar.d.mts +1 -1
  26. package/dist/schema/calendar/calendar.d.ts +1 -1
  27. package/dist/schema/calendar/index.d.mts +1 -1
  28. package/dist/schema/calendar/index.d.ts +1 -1
  29. package/dist/schema/checkbox/checkbox.d.mts +3 -3
  30. package/dist/schema/checkbox/checkbox.d.ts +3 -3
  31. package/dist/schema/checkbox/checkbox.js.map +1 -1
  32. package/dist/schema/checkbox/checkbox.mjs.map +1 -1
  33. package/dist/schema/checkbox/index.d.mts +1 -1
  34. package/dist/schema/checkbox/index.d.ts +1 -1
  35. package/dist/schema/checkbox/index.js.map +1 -1
  36. package/dist/schema/checkbox/index.mjs.map +1 -1
  37. package/dist/schema/datamodel/datamodel.d.mts +1 -1
  38. package/dist/schema/datamodel/datamodel.d.ts +1 -1
  39. package/dist/schema/datamodel/index.d.mts +1 -1
  40. package/dist/schema/datamodel/index.d.ts +1 -1
  41. package/dist/schema/datasource/datasource.d.mts +1 -1
  42. package/dist/schema/datasource/datasource.d.ts +1 -1
  43. package/dist/schema/datasource/index.d.mts +1 -1
  44. package/dist/schema/datasource/index.d.ts +1 -1
  45. package/dist/schema/dialog/condition.d.mts +1 -1
  46. package/dist/schema/dialog/condition.d.ts +1 -1
  47. package/dist/schema/dialog/dialog.d.mts +1 -1
  48. package/dist/schema/dialog/dialog.d.ts +1 -1
  49. package/dist/schema/dialog/index.d.mts +1 -1
  50. package/dist/schema/dialog/index.d.ts +1 -1
  51. package/dist/schema/dialog/tabs.d.mts +1 -1
  52. package/dist/schema/dialog/tabs.d.ts +1 -1
  53. package/dist/schema/dialog/types.d.mts +1 -1
  54. package/dist/schema/dialog/types.d.ts +1 -1
  55. package/dist/schema/dynamic/dynamic.d.mts +1 -1
  56. package/dist/schema/dynamic/dynamic.d.ts +1 -1
  57. package/dist/schema/dynamic/index.d.mts +1 -1
  58. package/dist/schema/dynamic/index.d.ts +1 -1
  59. package/dist/schema/group/group.d.mts +1 -1
  60. package/dist/schema/group/group.d.ts +1 -1
  61. package/dist/schema/group/index.d.mts +1 -1
  62. package/dist/schema/group/index.d.ts +1 -1
  63. package/dist/schema/hidden/hidden.d.mts +1 -1
  64. package/dist/schema/hidden/hidden.d.ts +1 -1
  65. package/dist/schema/hidden/index.d.mts +1 -1
  66. package/dist/schema/hidden/index.d.ts +1 -1
  67. package/dist/schema/media/index.d.mts +1 -1
  68. package/dist/schema/media/index.d.ts +1 -1
  69. package/dist/schema/media/index.js.map +1 -1
  70. package/dist/schema/media/index.mjs.map +1 -1
  71. package/dist/schema/media/media.d.mts +3 -2
  72. package/dist/schema/media/media.d.ts +3 -2
  73. package/dist/schema/media/media.js.map +1 -1
  74. package/dist/schema/media/media.mjs.map +1 -1
  75. package/dist/schema/multifield/index.d.mts +1 -1
  76. package/dist/schema/multifield/index.d.ts +1 -1
  77. package/dist/schema/multifield/multifield.d.mts +1 -1
  78. package/dist/schema/multifield/multifield.d.ts +1 -1
  79. package/dist/schema/navigation/index.d.mts +1 -1
  80. package/dist/schema/navigation/index.d.ts +1 -1
  81. package/dist/schema/navigation/navigation.d.mts +1 -1
  82. package/dist/schema/navigation/navigation.d.ts +1 -1
  83. package/dist/schema/object/index.d.mts +1 -1
  84. package/dist/schema/object/index.d.ts +1 -1
  85. package/dist/schema/object/object.d.mts +1 -1
  86. package/dist/schema/object/object.d.ts +1 -1
  87. package/dist/schema/optional/index.d.mts +1 -1
  88. package/dist/schema/optional/index.d.ts +1 -1
  89. package/dist/schema/optional/optional.d.mts +1 -1
  90. package/dist/schema/optional/optional.d.ts +1 -1
  91. package/dist/schema/pathbrowser/index.d.mts +1 -1
  92. package/dist/schema/pathbrowser/index.d.ts +1 -1
  93. package/dist/schema/pathbrowser/pathbrowser.d.mts +1 -1
  94. package/dist/schema/pathbrowser/pathbrowser.d.ts +1 -1
  95. package/dist/schema/rte/index.d.mts +1 -1
  96. package/dist/schema/rte/index.d.ts +1 -1
  97. package/dist/schema/rte/rte.d.mts +1 -1
  98. package/dist/schema/rte/rte.d.ts +1 -1
  99. package/dist/schema/select/index.d.mts +1 -1
  100. package/dist/schema/select/index.d.ts +1 -1
  101. package/dist/schema/select/select.d.mts +1 -1
  102. package/dist/schema/select/select.d.ts +1 -1
  103. package/dist/schema/tags/index.d.mts +4 -0
  104. package/dist/schema/tags/index.d.ts +4 -0
  105. package/dist/schema/tags/index.js +53 -0
  106. package/dist/schema/tags/index.js.map +1 -0
  107. package/dist/schema/tags/index.mjs +26 -0
  108. package/dist/schema/tags/index.mjs.map +1 -0
  109. package/dist/schema/tags/tags.d.mts +26 -0
  110. package/dist/schema/tags/tags.d.ts +26 -0
  111. package/dist/schema/tags/tags.js +51 -0
  112. package/dist/schema/tags/tags.js.map +1 -0
  113. package/dist/schema/tags/tags.mjs +26 -0
  114. package/dist/schema/tags/tags.mjs.map +1 -0
  115. package/dist/schema/text/index.d.mts +1 -1
  116. package/dist/schema/text/index.d.ts +1 -1
  117. package/dist/schema/text/text.d.mts +1 -1
  118. package/dist/schema/text/text.d.ts +1 -1
  119. package/dist/types/index.d.mts +1 -1
  120. package/dist/types/index.d.ts +1 -1
  121. package/dist/types/infer.d.mts +1 -1
  122. package/dist/types/infer.d.ts +1 -1
  123. package/dist/types/object.d.mts +1 -1
  124. package/dist/types/object.d.ts +1 -1
  125. package/dist/types/schema.d.mts +1 -1
  126. package/dist/types/schema.d.ts +1 -1
  127. package/dist/{types-Bezok3ga.d.ts → types-B_w1dteH.d.ts} +1 -1
  128. package/dist/{types-3ETl5yY_.d.mts → types-Y1F-dOLI.d.mts} +1 -1
  129. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  export { webcomponent } from './webcomponent/webcomponent.mjs';
2
2
  import 'react';
3
3
  import '../schema/dialog/dialog.mjs';
4
- import '../types-3ETl5yY_.mjs';
4
+ import '../types-Y1F-dOLI.mjs';
5
5
  import '../types/webcomponent.mjs';
6
6
  import '../types/utils.mjs';
@@ -1,6 +1,6 @@
1
1
  export { webcomponent } from './webcomponent/webcomponent.js';
2
2
  import 'react';
3
3
  import '../schema/dialog/dialog.js';
4
- import '../types-Bezok3ga.js';
4
+ import '../types-B_w1dteH.js';
5
5
  import '../types/webcomponent.js';
6
6
  import '../types/utils.js';
@@ -1,6 +1,6 @@
1
1
  export { webcomponent } from './webcomponent.mjs';
2
2
  import 'react';
3
3
  import '../../schema/dialog/dialog.mjs';
4
- import '../../types-3ETl5yY_.mjs';
4
+ import '../../types-Y1F-dOLI.mjs';
5
5
  import '../../types/webcomponent.mjs';
6
6
  import '../../types/utils.mjs';
@@ -1,6 +1,6 @@
1
1
  export { webcomponent } from './webcomponent.js';
2
2
  import 'react';
3
3
  import '../../schema/dialog/dialog.js';
4
- import '../../types-Bezok3ga.js';
4
+ import '../../types-B_w1dteH.js';
5
5
  import '../../types/webcomponent.js';
6
6
  import '../../types/utils.js';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DialogSchema } from '../../schema/dialog/dialog.mjs';
3
- import { f as ObjectEntries } from '../../types-3ETl5yY_.mjs';
3
+ import { f as ObjectEntries } from '../../types-Y1F-dOLI.mjs';
4
4
  import '../../types/webcomponent.mjs';
5
5
  import '../../types/utils.mjs';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { DialogSchema } from '../../schema/dialog/dialog.js';
3
- import { f as ObjectEntries } from '../../types-Bezok3ga.js';
3
+ import { f as ObjectEntries } from '../../types-B_w1dteH.js';
4
4
  import '../../types/webcomponent.js';
5
5
  import '../../types/utils.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput } from '../../types-3ETl5yY_.mjs';
1
+ import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput } from '../../types-Y1F-dOLI.mjs';
2
2
  import { ComponentModel } from '../../types/component.mjs';
3
3
  import { DialogSchema } from '../../schema/dialog/dialog.mjs';
4
4
  import '../../types/webcomponent.mjs';
@@ -1,4 +1,4 @@
1
- import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput } from '../../types-Bezok3ga.js';
1
+ import { f as ObjectEntries, B as BaseSchema, g as ObjectOutput } from '../../types-B_w1dteH.js';
2
2
  import { ComponentModel } from '../../types/component.js';
3
3
  import { DialogSchema } from '../../schema/dialog/dialog.js';
4
4
  import '../../types/webcomponent.js';
@@ -1,5 +1,5 @@
1
1
  export { ComponentSchema, component } from './component.mjs';
2
- import '../../types-3ETl5yY_.mjs';
2
+ import '../../types-Y1F-dOLI.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
5
5
  import '../../types/component.mjs';
@@ -1,5 +1,5 @@
1
1
  export { ComponentSchema, component } from './component.js';
2
- import '../../types-Bezok3ga.js';
2
+ import '../../types-B_w1dteH.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
5
5
  import '../../types/component.js';
@@ -2,7 +2,7 @@ export { parse } from './parse/parse.mjs';
2
2
  export { parsePrimitives } from './parse/parsePrimitives.mjs';
3
3
  export { ComponentSchema, component } from './component/component.mjs';
4
4
  import '../schema/dialog/dialog.mjs';
5
- import '../types-3ETl5yY_.mjs';
5
+ import '../types-Y1F-dOLI.mjs';
6
6
  import '../types/webcomponent.mjs';
7
7
  import '../types/utils.mjs';
8
8
  import '../types/component.mjs';
@@ -2,7 +2,7 @@ export { parse } from './parse/parse.js';
2
2
  export { parsePrimitives } from './parse/parsePrimitives.js';
3
3
  export { ComponentSchema, component } from './component/component.js';
4
4
  import '../schema/dialog/dialog.js';
5
- import '../types-Bezok3ga.js';
5
+ import '../types-B_w1dteH.js';
6
6
  import '../types/webcomponent.js';
7
7
  import '../types/utils.js';
8
8
  import '../types/component.js';
@@ -1,6 +1,6 @@
1
1
  export { parse } from './parse.mjs';
2
2
  export { parsePrimitives } from './parsePrimitives.mjs';
3
3
  import '../../schema/dialog/dialog.mjs';
4
- import '../../types-3ETl5yY_.mjs';
4
+ import '../../types-Y1F-dOLI.mjs';
5
5
  import '../../types/webcomponent.mjs';
6
6
  import '../../types/utils.mjs';
@@ -1,6 +1,6 @@
1
1
  export { parse } from './parse.js';
2
2
  export { parsePrimitives } from './parsePrimitives.js';
3
3
  import '../../schema/dialog/dialog.js';
4
- import '../../types-Bezok3ga.js';
4
+ import '../../types-B_w1dteH.js';
5
5
  import '../../types/webcomponent.js';
6
6
  import '../../types/utils.js';
@@ -1,5 +1,5 @@
1
1
  import { DialogSchema } from '../../schema/dialog/dialog.mjs';
2
- import { f as ObjectEntries } from '../../types-3ETl5yY_.mjs';
2
+ import { f as ObjectEntries } from '../../types-Y1F-dOLI.mjs';
3
3
  import '../../types/webcomponent.mjs';
4
4
  import '../../types/utils.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { DialogSchema } from '../../schema/dialog/dialog.js';
2
- import { f as ObjectEntries } from '../../types-Bezok3ga.js';
2
+ import { f as ObjectEntries } from '../../types-B_w1dteH.js';
3
3
  import '../../types/webcomponent.js';
4
4
  import '../../types/utils.js';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { DialogSchema } from '../../schema/dialog/dialog.mjs';
2
2
  import { WebcomponentPropTypes } from '../../types/webcomponent.mjs';
3
- import { f as ObjectEntries } from '../../types-3ETl5yY_.mjs';
3
+ import { f as ObjectEntries } from '../../types-Y1F-dOLI.mjs';
4
4
  import '../../types/utils.mjs';
5
5
 
6
6
  declare function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>): Record<string, WebcomponentPropTypes>;
@@ -1,6 +1,6 @@
1
1
  import { DialogSchema } from '../../schema/dialog/dialog.js';
2
2
  import { WebcomponentPropTypes } from '../../types/webcomponent.js';
3
- import { f as ObjectEntries } from '../../types-Bezok3ga.js';
3
+ import { f as ObjectEntries } from '../../types-B_w1dteH.js';
4
4
  import '../../types/utils.js';
5
5
 
6
6
  declare function parsePrimitives<T extends ObjectEntries>(schema: DialogSchema<T>): Record<string, WebcomponentPropTypes>;
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DialogSchema, dialog } from './schema/dialog/dialog.mjs';
2
2
  export { Condition } from './schema/dialog/condition.mjs';
3
- export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, T as TabsArgument, o as optional } from './types-3ETl5yY_.mjs';
3
+ export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, T as TabsArgument, o as optional } from './types-Y1F-dOLI.mjs';
4
4
  export { Tabs } from './schema/dialog/tabs.mjs';
5
5
  export { MultifieldSchema, multifield } from './schema/multifield/multifield.mjs';
6
6
  export { TextSchema, text } from './schema/text/text.mjs';
@@ -15,6 +15,7 @@ export { DataSourceSchema, datasource } from './schema/datasource/datasource.mjs
15
15
  export { GroupSchema, group } from './schema/group/group.mjs';
16
16
  export { DataModelSchema, datamodel } from './schema/datamodel/datamodel.mjs';
17
17
  export { NavigationItemSchema, NavigationSchema, navigation } from './schema/navigation/navigation.mjs';
18
+ export { TagsSchema, tags } from './schema/tags/tags.mjs';
18
19
  export { HiddenSchema, hidden } from './schema/hidden/hidden.mjs';
19
20
  export { ObjectSchema, object } from './schema/object/object.mjs';
20
21
  export { GetServerSideProps } from './types/props.mjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DialogSchema, dialog } from './schema/dialog/dialog.js';
2
2
  export { Condition } from './schema/dialog/condition.js';
3
- export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, T as TabsArgument, o as optional } from './types-Bezok3ga.js';
3
+ export { d as BaseFieldInput, B as BaseSchema, b as ConditionFn, a as ConditionOperators, C as Conditions, c as ConditionsArgument, F as Field, O as OptionalSchema, e as Output, T as TabsArgument, o as optional } from './types-B_w1dteH.js';
4
4
  export { Tabs } from './schema/dialog/tabs.js';
5
5
  export { MultifieldSchema, multifield } from './schema/multifield/multifield.js';
6
6
  export { TextSchema, text } from './schema/text/text.js';
@@ -15,6 +15,7 @@ export { DataSourceSchema, datasource } from './schema/datasource/datasource.js'
15
15
  export { GroupSchema, group } from './schema/group/group.js';
16
16
  export { DataModelSchema, datamodel } from './schema/datamodel/datamodel.js';
17
17
  export { NavigationItemSchema, NavigationSchema, navigation } from './schema/navigation/navigation.js';
18
+ export { TagsSchema, tags } from './schema/tags/tags.js';
18
19
  export { HiddenSchema, hidden } from './schema/hidden/hidden.js';
19
20
  export { ObjectSchema, object } from './schema/object/object.js';
20
21
  export { GetServerSideProps } from './types/props.js';
package/dist/index.js CHANGED
@@ -30,8 +30,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
31
31
 
32
32
  // src/index.ts
33
- var src_exports = {};
34
- __export(src_exports, {
33
+ var index_exports = {};
34
+ __export(index_exports, {
35
35
  Condition: () => Condition,
36
36
  Tabs: () => Tabs,
37
37
  calendar: () => calendar,
@@ -54,10 +54,11 @@ __export(src_exports, {
54
54
  pathbrowser: () => pathbrowser,
55
55
  rte: () => rte,
56
56
  select: () => select,
57
+ tags: () => tags,
57
58
  text: () => text,
58
59
  webcomponent: () => webcomponent
59
60
  });
60
- module.exports = __toCommonJS(src_exports);
61
+ module.exports = __toCommonJS(index_exports);
61
62
 
62
63
  // src/schema/dialog/tabs.ts
63
64
  var Tabs = class {
@@ -521,6 +522,29 @@ function navigation(input) {
521
522
  };
522
523
  }
523
524
 
525
+ // src/schema/tags/tags.ts
526
+ function tags(input) {
527
+ const { placeholder, label, required, defaultValue, multiple, namespaces } = input;
528
+ return {
529
+ type: "tags",
530
+ _parse() {
531
+ return {
532
+ type: "tags",
533
+ label,
534
+ placeholder,
535
+ required,
536
+ defaultValue,
537
+ multiple,
538
+ namespaces
539
+ };
540
+ },
541
+ _primitive() {
542
+ return multiple ? "json" : "string";
543
+ },
544
+ ...input
545
+ };
546
+ }
547
+
524
548
  // src/schema/hidden/hidden.ts
525
549
  function hidden(input) {
526
550
  const { type } = input;
@@ -671,6 +695,7 @@ function webcomponent(schema, options) {
671
695
  pathbrowser,
672
696
  rte,
673
697
  select,
698
+ tags,
674
699
  text,
675
700
  webcomponent
676
701
  });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../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/media/media.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":["export * from \"./schema/dialog\";\n\nexport * from \"./schema/multifield\";\nexport * from \"./schema/text\";\nexport * from \"./schema/checkbox\";\nexport * from \"./schema/pathbrowser\";\nexport * from \"./schema/media\";\nexport * from \"./schema/select\";\nexport * from \"./schema/rte\";\nexport * from \"./schema/dynamic\";\nexport * from \"./schema/calendar\";\nexport * from \"./schema/datasource\";\nexport * from \"./schema/group\";\nexport * from \"./schema/datamodel\";\nexport * from \"./schema/navigation\";\n\nexport * from \"./schema/hidden\";\nexport * from \"./schema/optional\";\nexport * from \"./schema/object\";\n\nexport * from \"./types\";\n\nexport * from \"./decorators\"\nexport * from \"./functions\"\n","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, 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, TabsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: TabsArgument<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: TabsArgument<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, Output\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 itemLabelKey?: keyof Output<TChildren>\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required, itemLabelKey} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n itemLabelKey,\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 defaultValue?: string;\n validationRegex?: string;\n validationErrorMessage?: string;\n\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required, defaultValue, validationRegex, validationErrorMessage} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue,\n validationRegex,\n validationErrorMessage\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\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 defaultValue?: boolean;\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false, defaultValue} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle,\n defaultValue\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 defaultValue?: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required, defaultValue} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\ntype MediaOutputType = {\n alt: string;\n url: string;\n renditions: string[];\n};\n\nexport interface MediaSchema<TOutput extends string = string> extends BaseSchema<MediaOutputType> {\n /**\n * The schema type.\n */\n type: 'media';\n}\n\ntype ImageTypes = 'image/gif' | 'image/jpeg' | 'image/png' | 'image/tiff' | 'image/svg+xml';\ntype VideoTypes = 'video/mp4' | 'video/webm' | 'video/ogg';\ntype PDFTypes = 'application/pdf';\ntype ZipTypes = 'application/zip' | 'application/x-zip-compressed' | 'application/x-zip' | 'application/x-compressed' | 'multipart/x-zip';\n\n\ninterface MediaInput extends BaseFieldInput {\n defaultValue?: string;\n allowedMimeTypes?: ( PDFTypes | ZipTypes | ImageTypes | VideoTypes )[];\n}\n\nexport function media(input: MediaInput): MediaSchema {\n const { label, tooltip, required, defaultValue, allowedMimeTypes } = input;\n\n return {\n type: 'media',\n _parse() {\n return {\n type: 'media',\n label,\n tooltip,\n required,\n defaultValue,\n allowedMimeTypes\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}\n\n/**\n * @deprecated Use `media` instead.\n */\nexport const image = (input: MediaInput = {\n label: 'image',\n allowedMimeTypes: ['image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'image/svg+xml'],\n}) => media(input);\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<TMultiple extends boolean = false> extends BaseFieldInput {\n placeholder?: string;\n multiple?: TMultiple;\n values: {\n value: string;\n label: string;\n }[];\n defaultValue?: TMultiple extends true ? string[] : string;\n}\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput<TMultiple>, 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, defaultValue } = input;\n\n if (!multiple && Array.isArray(defaultValue)) {\n throw new Error('defaultValue should be a string when multiple is false');\n }\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 defaultValue\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\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 defaultValue?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required, defaultValue} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\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 defaultValue?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required, defaultValue} = 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 defaultValue\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 defaultValue?: string;\n method?: 'GET' | 'POST';\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, defaultValue, method = 'POST' } = 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 defaultValue,\n method\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 defaultValue?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required, defaultValue} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\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 defaultValue?: string;\n pageProperties?:{\n value: string;\n label: string;\n }[]\n}\n\nexport function navigation(input: DataModelInput): NavigationSchema {\n const {placeholder, label,tooltip, required, showChildrenCheckbox, showRootLevel, defaultValue, pageProperties} = 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 defaultValue,\n pageProperties,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,OAAN,MAAqB;AAAA,EAArB;AACL,wBAAQ,QAAO,oBAAI,IA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AA,QACL,GAAGA,QAAO,WAAW;AAAA,MACvB;AAAA,IACF;AAAA,IACA,GAAG;AAAA,EACL;AACF;;;AJpBO,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;AAAA,IAEjD,MAAM,+BAA2B,8BAAAC,SAAKD,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","r2wc"]}
1
+ {"version":3,"sources":["../src/index.ts","../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/media/media.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/tags/tags.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":["export * from \"./schema/dialog\";\n\nexport * from \"./schema/multifield\";\nexport * from \"./schema/text\";\nexport * from \"./schema/checkbox\";\nexport * from \"./schema/pathbrowser\";\nexport * from \"./schema/media\";\nexport * from \"./schema/select\";\nexport * from \"./schema/rte\";\nexport * from \"./schema/dynamic\";\nexport * from \"./schema/calendar\";\nexport * from \"./schema/datasource\";\nexport * from \"./schema/group\";\nexport * from \"./schema/datamodel\";\nexport * from \"./schema/navigation\";\nexport * from \"./schema/tags\";\n\nexport * from \"./schema/hidden\";\nexport * from \"./schema/optional\";\nexport * from \"./schema/object\";\n\nexport * from \"./types\";\n\nexport * from \"./decorators\"\nexport * from \"./functions\"\n","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, 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, TabsArgument } from './types';\n\nexport interface DialogSchema<TEntries extends ObjectEntries> extends BaseSchema<ObjectOutput<TEntries>> {\n type: 'dialog';\n tabs: (tabs: TabsArgument<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: TabsArgument<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, Output\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 itemLabelKey?: keyof Output<TChildren>\n}\n\nexport function multifield<const TChildren extends BaseSchema<unknown>>(input: MultifieldInput<TChildren>): MultifieldSchema<TChildren> {\n const {label, children, required, itemLabelKey} = input;\n const childrenParse = children._parse();\n\n return {\n type: 'multifield',\n _parse() {\n return {\n type: 'multifield',\n label,\n required,\n itemLabelKey,\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 defaultValue?: string;\n validationRegex?: string;\n validationErrorMessage?: string;\n\n}\n\nexport function text(input: TextInput): TextSchema {\n const {placeholder, label,tooltip, required, defaultValue, validationRegex, validationErrorMessage} = input;\n\n return {\n type: 'textfield',\n _parse() {\n return {\n type: 'textfield',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue,\n validationRegex,\n validationErrorMessage\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}\n","import { BaseFieldInput, type BaseSchema } from '../../types';\n\nexport interface CheckBoxSchema<TOutput extends string = string> extends BaseSchema<TOutput> {\n /**\n * The schema type.\n */\n type: 'checkbox';\n}\n\ninterface CheckBoxInput extends BaseFieldInput {\n showastoggle?: boolean\n defaultValue?: boolean | string;\n}\n\nexport function checkbox(input: CheckBoxInput): CheckBoxSchema {\n const {label, tooltip, showastoggle = false, defaultValue} = input;\n\n return {\n type: 'checkbox',\n _parse() {\n return {\n type: 'checkbox',\n label,\n tooltip,\n showastoggle,\n defaultValue\n }\n },\n _primitive() {\n return 'boolean'\n },\n ...input,\n }\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 defaultValue?: string;\n}\n\nexport function pathbrowser(input: PathBrowserInput): PathBrowserSchema {\n const {placeholder, label, tooltip, required, defaultValue} = input;\n\n return {\n type: 'pathbrowser',\n _parse() {\n return {\n type: 'pathbrowser',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\n }\n },\n _primitive() {\n return 'string'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\ntype MediaOutputType = {\n alt: string;\n url: string;\n renditions: string[];\n};\n\nexport interface MediaSchema<TOutput extends string = string> extends BaseSchema<MediaOutputType> {\n /**\n * The schema type.\n */\n type: 'media';\n}\n\ntype ImageTypes = 'image/gif' | 'image/jpeg' | 'image/png' | 'image/tiff' | 'image/svg+xml';\ntype VideoTypes = 'video/mp4' | 'video/webm' | 'video/ogg';\ntype PDFTypes = 'application/pdf';\ntype ZipTypes = 'application/zip' | 'application/x-zip-compressed' | 'application/x-zip' | 'application/x-compressed' | 'multipart/x-zip';\ntype CSVType = 'text/csv';\n\n\ninterface MediaInput extends BaseFieldInput {\n defaultValue?: string;\n allowedMimeTypes?: ( PDFTypes | ZipTypes | ImageTypes | VideoTypes | CSVType)[];\n}\n\nexport function media(input: MediaInput): MediaSchema {\n const { label, tooltip, required, defaultValue, allowedMimeTypes } = input;\n\n return {\n type: 'media',\n _parse() {\n return {\n type: 'media',\n label,\n tooltip,\n required,\n defaultValue,\n allowedMimeTypes\n };\n },\n _primitive() {\n return 'json';\n },\n ...input,\n };\n}\n\n/**\n * @deprecated Use `media` instead.\n */\nexport const image = (input: MediaInput = {\n label: 'image',\n allowedMimeTypes: ['image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'image/svg+xml'],\n}) => media(input);\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<TMultiple extends boolean = false> extends BaseFieldInput {\n placeholder?: string;\n multiple?: TMultiple;\n values: {\n value: string;\n label: string;\n }[];\n defaultValue?: TMultiple extends true ? string[] : string;\n}\n\ntype ValuesType<T extends { values: readonly { value: string }[] }> = T['values'][number]['value'];\n\nexport function select<const T extends SelectInput<TMultiple>, 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, defaultValue } = input;\n\n if (!multiple && Array.isArray(defaultValue)) {\n throw new Error('defaultValue should be a string when multiple is false');\n }\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 defaultValue\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n multiple: multiple as TMultiple,\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 defaultValue?: string;\n}\n\nexport function rte(input: RichTextEditorInput): RichTextEditorSchema {\n const {placeholder, label, tooltip, required, defaultValue} = input;\n\n return {\n type: 'richtexteditor',\n _parse() {\n return {\n type: 'richtexteditor',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\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 defaultValue?: string;\n}\n\nexport function calendar(input: CalendarInput): CalendarSchema {\n const {valueformat,startday=0,min,max, placeholder, label,tooltip,required, defaultValue} = 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 defaultValue\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 defaultValue?: string;\n method?: 'GET' | 'POST';\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, defaultValue, method = 'POST' } = 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 defaultValue,\n method\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 defaultValue?: string;\n}\n\nexport function datamodel(input: DataModelInput): DataModelSchema {\n const {placeholder, label,tooltip, required, defaultValue} = input;\n\n return {\n type: 'datamodel',\n _parse() {\n return {\n type: 'datamodel',\n label,\n placeholder,\n tooltip,\n required,\n defaultValue\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 defaultValue?: string;\n pageProperties?:{\n value: string;\n label: string;\n }[]\n}\n\nexport function navigation(input: DataModelInput): NavigationSchema {\n const {placeholder, label,tooltip, required, showChildrenCheckbox, showRootLevel, defaultValue, pageProperties} = 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 defaultValue,\n pageProperties,\n }\n },\n _primitive() {\n return 'json'\n },\n ...input,\n }\n}","import { BaseFieldInput, type BaseSchema } from '../../types';\n\ntype TagOutputType = {\n name: string;\n namespace: string;\n};\n\n\ntype TagsOutputType<Multiple extends boolean> = Multiple extends true ? TagOutputType[] : TagOutputType;\n\nexport interface TagsSchema<Multiple extends boolean = false> extends BaseSchema<TagsOutputType<Multiple>> {\n /**\n * The schema type.\n */\n type: 'tags';\n}\n\ninterface TagsInput extends BaseFieldInput {\n placeholder?: string;\n defaultValue?: string;\n multiple?: boolean;\n namespaces?: string[];\n}\n\nexport function tags<Multiple extends boolean = false>(input: TagsInput & {\n multiple?: Multiple\n}): TagsSchema<Multiple> {\n const { placeholder, label, required, defaultValue, multiple, namespaces } = input;\n\n return {\n type: 'tags',\n _parse() {\n return {\n type: 'tags',\n label,\n placeholder,\n required,\n defaultValue,\n multiple,\n namespaces,\n };\n },\n _primitive() {\n return multiple ? 'json' : 'string';\n },\n ...input,\n };\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,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,IA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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","r2wc"]}
package/dist/index.mjs CHANGED
@@ -464,6 +464,29 @@ function navigation(input) {
464
464
  };
465
465
  }
466
466
 
467
+ // src/schema/tags/tags.ts
468
+ function tags(input) {
469
+ const { placeholder, label, required, defaultValue, multiple, namespaces } = input;
470
+ return {
471
+ type: "tags",
472
+ _parse() {
473
+ return {
474
+ type: "tags",
475
+ label,
476
+ placeholder,
477
+ required,
478
+ defaultValue,
479
+ multiple,
480
+ namespaces
481
+ };
482
+ },
483
+ _primitive() {
484
+ return multiple ? "json" : "string";
485
+ },
486
+ ...input
487
+ };
488
+ }
489
+
467
490
  // src/schema/hidden/hidden.ts
468
491
  function hidden(input) {
469
492
  const { type } = input;
@@ -613,6 +636,7 @@ export {
613
636
  pathbrowser,
614
637
  rte,
615
638
  select,
639
+ tags,
616
640
  text,
617
641
  webcomponent
618
642
  };