@servicetitan/dte-unlayer 0.158.0 → 0.159.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 (147) hide show
  1. package/dist/api-core.js +22 -29
  2. package/dist/api-core.js.map +1 -1
  3. package/dist/api-custom-tools.js +23 -29
  4. package/dist/api-custom-tools.js.map +1 -1
  5. package/dist/business-calendar/BusinessCalendarDrawer.d.ts +19 -0
  6. package/dist/business-calendar/BusinessCalendarDrawer.d.ts.map +1 -0
  7. package/dist/business-calendar/BusinessCalendarDrawer.js +41 -0
  8. package/dist/business-calendar/BusinessCalendarDrawer.js.map +1 -0
  9. package/dist/business-calendar/business-calendar-requests.d.ts +25 -0
  10. package/dist/business-calendar/business-calendar-requests.d.ts.map +1 -0
  11. package/dist/business-calendar/business-calendar-requests.js +46 -0
  12. package/dist/business-calendar/business-calendar-requests.js.map +1 -0
  13. package/dist/business-calendar/business-calendar-state.d.ts +22 -0
  14. package/dist/business-calendar/business-calendar-state.d.ts.map +1 -0
  15. package/dist/business-calendar/business-calendar-state.js +74 -0
  16. package/dist/business-calendar/business-calendar-state.js.map +1 -0
  17. package/dist/business-calendar/useBusinessCalendarRequests.d.ts +15 -0
  18. package/dist/business-calendar/useBusinessCalendarRequests.d.ts.map +1 -0
  19. package/dist/business-calendar/useBusinessCalendarRequests.js +30 -0
  20. package/dist/business-calendar/useBusinessCalendarRequests.js.map +1 -0
  21. package/dist/display-conditions/ConditionGroup.js +15 -89
  22. package/dist/display-conditions/ConditionGroup.js.map +1 -1
  23. package/dist/display-conditions/ConditionGroupsSection.js +2 -70
  24. package/dist/display-conditions/ConditionGroupsSection.js.map +1 -1
  25. package/dist/display-conditions/ConditionRow.js +63 -205
  26. package/dist/display-conditions/ConditionRow.js.map +1 -1
  27. package/dist/display-conditions/DisplayConditionModal.js +40 -190
  28. package/dist/display-conditions/DisplayConditionModal.js.map +1 -1
  29. package/dist/display-conditions/LookupValueControl.js +42 -105
  30. package/dist/display-conditions/LookupValueControl.js.map +1 -1
  31. package/dist/display-conditions/SeparatorWithChip.js +1 -10
  32. package/dist/display-conditions/SeparatorWithChip.js.map +1 -1
  33. package/dist/display-conditions/constants.js +15 -20
  34. package/dist/display-conditions/constants.js.map +1 -1
  35. package/dist/display-conditions/displayConditionController.js +5 -8
  36. package/dist/display-conditions/displayConditionController.js.map +1 -1
  37. package/dist/display-conditions/lookupOptionsController.js +16 -16
  38. package/dist/display-conditions/lookupOptionsController.js.map +1 -1
  39. package/dist/display-conditions/nunjucks.js +98 -116
  40. package/dist/display-conditions/nunjucks.js.map +1 -1
  41. package/dist/display-conditions/schemaDataPoints.js +13 -11
  42. package/dist/display-conditions/schemaDataPoints.js.map +1 -1
  43. package/dist/display-conditions/types.js +23 -67
  44. package/dist/display-conditions/types.js.map +1 -1
  45. package/dist/display-conditions/useConditionForms.js +38 -56
  46. package/dist/display-conditions/useConditionForms.js.map +1 -1
  47. package/dist/display-conditions/useLookupOptions.js +24 -44
  48. package/dist/display-conditions/useLookupOptions.js.map +1 -1
  49. package/dist/e-sign-offset/ESignDateSignedOffsetModal.js +37 -150
  50. package/dist/e-sign-offset/ESignDateSignedOffsetModal.js.map +1 -1
  51. package/dist/e-sign-offset/ESignOffsetRuleRow.js +12 -73
  52. package/dist/e-sign-offset/ESignOffsetRuleRow.js.map +1 -1
  53. package/dist/e-sign-offset/eSignOffsetController.js +5 -8
  54. package/dist/e-sign-offset/eSignOffsetController.js.map +1 -1
  55. package/dist/editor-core-source.d.ts +2 -2
  56. package/dist/editor-core-source.d.ts.map +1 -1
  57. package/dist/editor-core-source.js +3 -3
  58. package/dist/editor-core-source.js.map +1 -1
  59. package/dist/editor-core.js +2 -2
  60. package/dist/editor-core.js.map +1 -1
  61. package/dist/editor.d.ts.map +1 -1
  62. package/dist/editor.js +56 -118
  63. package/dist/editor.js.map +1 -1
  64. package/dist/image-upload-error.js +3 -3
  65. package/dist/image-upload-error.js.map +1 -1
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +0 -1
  69. package/dist/index.js.map +1 -1
  70. package/dist/loadScript.js +7 -8
  71. package/dist/loadScript.js.map +1 -1
  72. package/dist/log.js +2 -3
  73. package/dist/log.js.map +1 -1
  74. package/dist/merge-tags.js +18 -17
  75. package/dist/merge-tags.js.map +1 -1
  76. package/dist/shared/configs.js +1 -2
  77. package/dist/shared/configs.js.map +1 -1
  78. package/dist/shared/const.d.ts +70 -0
  79. package/dist/shared/const.d.ts.map +1 -1
  80. package/dist/shared/const.js +13 -4
  81. package/dist/shared/const.js.map +1 -1
  82. package/dist/shared/date-calc.js +47 -38
  83. package/dist/shared/date-calc.js.map +1 -1
  84. package/dist/shared/e-sign-offset.js +46 -63
  85. package/dist/shared/e-sign-offset.js.map +1 -1
  86. package/dist/shared/edit-icon.js +0 -1
  87. package/dist/shared/edit-icon.js.map +1 -1
  88. package/dist/shared/fonts.js +16 -17
  89. package/dist/shared/fonts.js.map +1 -1
  90. package/dist/shared/forms.js +16 -38
  91. package/dist/shared/forms.js.map +1 -1
  92. package/dist/shared/instance-id.js +6 -9
  93. package/dist/shared/instance-id.js.map +1 -1
  94. package/dist/shared/nunjucks-helpers.js +2 -5
  95. package/dist/shared/nunjucks-helpers.js.map +1 -1
  96. package/dist/shared/schema.js +52 -96
  97. package/dist/shared/schema.js.map +1 -1
  98. package/dist/shared/tools.js +6 -13
  99. package/dist/shared/tools.js.map +1 -1
  100. package/dist/store.d.ts +15 -1
  101. package/dist/store.d.ts.map +1 -1
  102. package/dist/store.js +851 -548
  103. package/dist/store.js.map +1 -1
  104. package/dist/tools.js +133 -143
  105. package/dist/tools.js.map +1 -1
  106. package/dist/unlayer-interface.d.ts +15 -4
  107. package/dist/unlayer-interface.d.ts.map +1 -1
  108. package/dist/unlayer-interface.js +1 -2
  109. package/dist/unlayer-interface.js.map +1 -1
  110. package/dist/unlayer.js +86 -113
  111. package/dist/unlayer.js.map +1 -1
  112. package/dist/vendor/dte-shared/business-calendar-validation.utils.d.ts +25 -0
  113. package/dist/vendor/dte-shared/business-calendar-validation.utils.js +80 -0
  114. package/dist/vendor/dte-shared/components/business-calendar-section.d.ts +15 -0
  115. package/dist/vendor/dte-shared/components/business-calendar-section.js +14 -0
  116. package/dist/vendor/dte-shared/components/schedule-drawer.d.ts +18 -0
  117. package/dist/vendor/dte-shared/components/schedule-drawer.js +119 -0
  118. package/dist/vendor/dte-shared/components/schedule-picker.d.ts +8 -0
  119. package/dist/vendor/dte-shared/components/schedule-picker.js +88 -0
  120. package/dist/vendor/dte-shared/constants.d.ts +31 -0
  121. package/dist/vendor/dte-shared/constants.js +34 -0
  122. package/dist/vendor/dte-shared/field-schedule-editor-context.d.ts +31 -0
  123. package/dist/vendor/dte-shared/field-schedule-editor-context.js +110 -0
  124. package/dist/vendor/dte-shared/index.d.ts +8 -0
  125. package/dist/vendor/dte-shared/index.js +7 -0
  126. package/dist/vendor/dte-shared/schedule-bindings.utils.d.ts +22 -0
  127. package/dist/vendor/dte-shared/schedule-bindings.utils.js +31 -0
  128. package/dist/vendor/dte-shared/styles/schedule.css +19 -0
  129. package/dist/vendor/dte-shared/types.d.ts +129 -0
  130. package/dist/vendor/dte-shared/types.js +1 -0
  131. package/package.json +7 -1
  132. package/src/__tests__/business-calendar-drawer.test.tsx +183 -0
  133. package/src/__tests__/business-calendar-requests.test.ts +166 -0
  134. package/src/__tests__/business-calendar-state.test.tsx +142 -0
  135. package/src/__tests__/store.business-calendar.test.ts +185 -0
  136. package/src/__tests__/unlayer.e-sign-types.test.ts +30 -0
  137. package/src/business-calendar/BusinessCalendarDrawer.tsx +76 -0
  138. package/src/business-calendar/business-calendar-requests.ts +80 -0
  139. package/src/business-calendar/business-calendar-state.ts +113 -0
  140. package/src/business-calendar/useBusinessCalendarRequests.ts +49 -0
  141. package/src/editor-core-source.ts +2 -2
  142. package/src/editor.tsx +15 -0
  143. package/src/index.ts +10 -0
  144. package/src/shared/const.ts +59 -0
  145. package/src/store.ts +67 -5
  146. package/src/unlayer-interface.tsx +15 -4
  147. package/src/unlayer.tsx +5 -5
@@ -1,79 +1,78 @@
1
1
  export const unlayerSupportedFonts = [
2
2
  {
3
3
  label: 'Liberation Sans',
4
- value: 'arial,helvetica,sans-serif'
4
+ value: 'arial,helvetica,sans-serif',
5
5
  },
6
6
  {
7
7
  label: 'Lobster Two',
8
8
  value: "'Lobster Two',cursive",
9
- url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700'
9
+ url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700',
10
10
  },
11
11
  {
12
12
  label: 'Playfair Display',
13
13
  value: "'Playfair Display',serif",
14
- url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700'
14
+ url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700',
15
15
  },
16
16
  {
17
17
  label: 'Rubik',
18
18
  value: "'Rubik',sans-serif",
19
- url: 'https://fonts.googleapis.com/css?family=Rubik:400,700'
19
+ url: 'https://fonts.googleapis.com/css?family=Rubik:400,700',
20
20
  },
21
21
  {
22
22
  label: 'Source Sans Pro',
23
23
  value: "'Source Sans Pro',sans-serif",
24
- url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'
24
+ url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700',
25
25
  },
26
26
  {
27
27
  label: 'Open Sans',
28
28
  value: "'Open Sans',sans-serif",
29
- url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700'
29
+ url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700',
30
30
  },
31
31
  {
32
32
  label: 'Crimson Text',
33
33
  value: "'Crimson Text',serif",
34
- url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700'
34
+ url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700',
35
35
  },
36
36
  {
37
37
  label: 'Montserrat',
38
38
  value: "'Montserrat',sans-serif",
39
- url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700'
39
+ url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700',
40
40
  },
41
41
  {
42
42
  label: 'Old Standard TT',
43
43
  value: "'Old Standard TT',serif",
44
- url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700'
44
+ url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700',
45
45
  },
46
46
  {
47
47
  label: 'Lato',
48
48
  value: "'Lato',sans-serif",
49
- url: 'https://fonts.googleapis.com/css?family=Lato:400,700'
49
+ url: 'https://fonts.googleapis.com/css?family=Lato:400,700',
50
50
  },
51
51
  {
52
52
  label: 'Raleway',
53
53
  value: "'Raleway',sans-serif",
54
- url: 'https://fonts.googleapis.com/css?family=Raleway:400,700'
54
+ url: 'https://fonts.googleapis.com/css?family=Raleway:400,700',
55
55
  },
56
56
  {
57
57
  label: 'Cabin',
58
58
  value: "'Cabin',sans-serif",
59
- url: 'https://fonts.googleapis.com/css?family=Cabin:400,700'
59
+ url: 'https://fonts.googleapis.com/css?family=Cabin:400,700',
60
60
  },
61
61
  {
62
62
  label: 'Pacifico',
63
63
  value: "'Pacifico',cursive",
64
- url: 'https://fonts.googleapis.com/css?family=Pacifico'
64
+ url: 'https://fonts.googleapis.com/css?family=Pacifico',
65
65
  },
66
66
  // custom DTE fonts
67
67
  {
68
68
  label: 'Sofia Pro',
69
69
  value: 'Sofia Pro',
70
- url: 'https://fonts.googleapis.com/css2?family=Sofia+Sans:ital,wght@0,1..1000;1,1..1000&display=swap'
70
+ url: 'https://fonts.googleapis.com/css2?family=Sofia+Sans:ital,wght@0,1..1000;1,1..1000&display=swap',
71
71
  },
72
72
  {
73
73
  label: 'Nunito',
74
74
  value: 'Nunito',
75
- url: 'https://fonts.googleapis.com/css?family=Nunito'
76
- }
75
+ url: 'https://fonts.googleapis.com/css?family=Nunito',
76
+ },
77
77
  ];
78
-
79
78
  //# sourceMappingURL=fonts.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/fonts.ts"],"sourcesContent":["export const unlayerSupportedFonts = [\n {\n label: 'Liberation Sans',\n value: 'arial,helvetica,sans-serif',\n },\n {\n label: 'Lobster Two',\n value: \"'Lobster Two',cursive\",\n url: 'https://fonts.googleapis.com/css?family=Lobster+Two:400,700',\n },\n {\n label: 'Playfair Display',\n value: \"'Playfair Display',serif\",\n url: 'https://fonts.googleapis.com/css?family=Playfair+Display:400,700',\n },\n {\n label: 'Rubik',\n value: \"'Rubik',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Rubik:400,700',\n },\n {\n label: 'Source Sans Pro',\n value: \"'Source Sans Pro',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700',\n },\n {\n label: 'Open Sans',\n value: \"'Open Sans',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Open+Sans:400,700',\n },\n {\n label: 'Crimson Text',\n value: \"'Crimson Text',serif\",\n url: 'https://fonts.googleapis.com/css?family=Crimson+Text:400,700',\n },\n {\n label: 'Montserrat',\n value: \"'Montserrat',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Montserrat:400,700',\n },\n {\n label: 'Old Standard TT',\n value: \"'Old Standard TT',serif\",\n url: 'https://fonts.googleapis.com/css?family=Old+Standard+TT:400,700',\n },\n {\n label: 'Lato',\n value: \"'Lato',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Lato:400,700',\n },\n {\n label: 'Raleway',\n value: \"'Raleway',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Raleway:400,700',\n },\n {\n label: 'Cabin',\n value: \"'Cabin',sans-serif\",\n url: 'https://fonts.googleapis.com/css?family=Cabin:400,700',\n },\n {\n label: 'Pacifico',\n value: \"'Pacifico',cursive\",\n url: 'https://fonts.googleapis.com/css?family=Pacifico',\n },\n // custom DTE fonts\n {\n label: 'Sofia Pro',\n value: 'Sofia Pro',\n url: 'https://fonts.googleapis.com/css2?family=Sofia+Sans:ital,wght@0,1..1000;1,1..1000&display=swap',\n },\n {\n label: 'Nunito',\n value: 'Nunito',\n url: 'https://fonts.googleapis.com/css?family=Nunito',\n },\n];\n"],"names":["unlayerSupportedFonts","label","value","url"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB;IACjC;QACIC,OAAO;QACPC,OAAO;IACX;IACA;QACID,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA,mBAAmB;IACnB;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;IACA;QACIF,OAAO;QACPC,OAAO;QACPC,KAAK;IACT;CACH,CAAC"}
1
+ {"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/shared/fonts.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACjC;QACI,KAAK,EAAE,iBAAiB;QACxB,KAAK,EAAE,4BAA4B;KACtC;IACD;QACI,KAAK,EAAE,aAAa;QACpB,KAAK,EAAE,uBAAuB;QAC9B,GAAG,EAAE,6DAA6D;KACrE;IACD;QACI,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE,0BAA0B;QACjC,GAAG,EAAE,kEAAkE;KAC1E;IACD;QACI,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,oBAAoB;QAC3B,GAAG,EAAE,uDAAuD;KAC/D;IACD;QACI,KAAK,EAAE,iBAAiB;QACxB,KAAK,EAAE,8BAA8B;QACrC,GAAG,EAAE,iEAAiE;KACzE;IACD;QACI,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,wBAAwB;QAC/B,GAAG,EAAE,2DAA2D;KACnE;IACD;QACI,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,sBAAsB;QAC7B,GAAG,EAAE,8DAA8D;KACtE;IACD;QACI,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,yBAAyB;QAChC,GAAG,EAAE,4DAA4D;KACpE;IACD;QACI,KAAK,EAAE,iBAAiB;QACxB,KAAK,EAAE,yBAAyB;QAChC,GAAG,EAAE,iEAAiE;KACzE;IACD;QACI,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,mBAAmB;QAC1B,GAAG,EAAE,sDAAsD;KAC9D;IACD;QACI,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,sBAAsB;QAC7B,GAAG,EAAE,yDAAyD;KACjE;IACD;QACI,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,oBAAoB;QAC3B,GAAG,EAAE,uDAAuD;KAC/D;IACD;QACI,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,oBAAoB;QAC3B,GAAG,EAAE,kDAAkD;KAC1D;IACD,mBAAmB;IACnB;QACI,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,WAAW;QAClB,GAAG,EAAE,gGAAgG;KACxG;IACD;QACI,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,gDAAgD;KACxD;CACJ,CAAC"}
@@ -1,58 +1,37 @@
1
- export var FormItemType = /*#__PURE__*/ function(FormItemType) {
2
- FormItemType["Text"] = "Text";
3
- FormItemType["Number"] = "Number";
4
- FormItemType["Picture"] = "Picture";
5
- FormItemType["Checkboxes"] = "Checkboxes";
6
- FormItemType["RadioButtons"] = "RadioButtons";
7
- FormItemType["Date"] = "Date";
8
- FormItemType["Signature"] = "Signature";
9
- FormItemType["Dropdown"] = "Dropdown";
10
- FormItemType["Stoplight"] = "Stoplight";
11
- FormItemType["SmartField"] = "SmartField";
12
- return FormItemType;
13
- }({});
14
1
  const FORM_FIELD_KEY_RE = /^__submission_fields\.(\d+)\.([A-Za-z0-9]+)$/;
15
2
  const FORM_FIELD_RUNTIME_PATH_RE = /^__submission_fields\["(\d+)"\]\["([A-Za-z0-9]+)"\]$/;
16
3
  const LEGACY_FORM_KEY_RE = /^form_(\d+)_([A-Za-z0-9]+)$/;
17
4
  const LEGACY_FORM_KEY_PREFIX_RE = /^__form_(\d+)_([a-f0-9]+)$/;
18
- export const buildFormFieldKey = (formId, fieldId)=>`__submission_fields.${formId}.${fieldId.replaceAll('-', '')}`;
19
- export const parseFormFieldKey = (key)=>{
20
- var _FORM_FIELD_KEY_RE_exec;
21
- const match = (_FORM_FIELD_KEY_RE_exec = FORM_FIELD_KEY_RE.exec(key)) !== null && _FORM_FIELD_KEY_RE_exec !== void 0 ? _FORM_FIELD_KEY_RE_exec : FORM_FIELD_RUNTIME_PATH_RE.exec(key);
5
+ export const buildFormFieldKey = (formId, fieldId) => `__submission_fields.${formId}.${fieldId.replaceAll('-', '')}`;
6
+ export const parseFormFieldKey = (key) => {
7
+ var _a;
8
+ const match = (_a = FORM_FIELD_KEY_RE.exec(key)) !== null && _a !== void 0 ? _a : FORM_FIELD_RUNTIME_PATH_RE.exec(key);
22
9
  if (match) {
23
- return {
24
- formId: Number(match[1]),
25
- fieldId: match[2]
26
- };
10
+ return { formId: Number(match[1]), fieldId: match[2] };
27
11
  }
28
12
  // Backward compatibility for already saved values.
29
13
  const oldMatch = LEGACY_FORM_KEY_RE.exec(key);
30
14
  if (oldMatch) {
31
- return {
32
- formId: Number(oldMatch[1]),
33
- fieldId: oldMatch[2]
34
- };
15
+ return { formId: Number(oldMatch[1]), fieldId: oldMatch[2] };
35
16
  }
36
17
  const legacyMatch = LEGACY_FORM_KEY_PREFIX_RE.exec(key);
37
18
  if (legacyMatch) {
38
- return {
39
- formId: Number(legacyMatch[1]),
40
- fieldId: legacyMatch[2]
41
- };
19
+ return { formId: Number(legacyMatch[1]), fieldId: legacyMatch[2] };
42
20
  }
43
21
  return null;
44
22
  };
45
- export const isFormFieldKey = (key)=>parseFormFieldKey(key) !== null;
23
+ export const isFormFieldKey = (key) => parseFormFieldKey(key) !== null;
46
24
  /**
47
25
  * Submission keys may start with numeric properties, so dot notation is unsafe.
48
- */ export const toNunjucksFieldReference = (fieldKey)=>{
26
+ */
27
+ export const toNunjucksFieldReference = (fieldKey) => {
49
28
  const parsed = parseFormFieldKey(fieldKey);
50
29
  if (!parsed) {
51
30
  return fieldKey;
52
31
  }
53
32
  return `__submission_fields["${parsed.formId}"]["${parsed.fieldId}"]`;
54
33
  };
55
- export const getCalculatedFieldTypeFromFormItemType = (itemType)=>{
34
+ export const getCalculatedFieldTypeFromFormItemType = (itemType) => {
56
35
  if (itemType === 'Number') {
57
36
  return 'number';
58
37
  }
@@ -61,7 +40,7 @@ export const getCalculatedFieldTypeFromFormItemType = (itemType)=>{
61
40
  }
62
41
  return null;
63
42
  };
64
- export const getConditionalFieldTypeFromFormItemType = (itemType)=>{
43
+ export const getConditionalFieldTypeFromFormItemType = (itemType) => {
65
44
  if (!itemType) {
66
45
  return null;
67
46
  }
@@ -75,19 +54,18 @@ export const getConditionalFieldTypeFromFormItemType = (itemType)=>{
75
54
  };
76
55
  const DEFAULT_FORM_NUMBER_SAMPLE = 44;
77
56
  const DEFAULT_FORM_DATE_SAMPLE = '2026-01-15';
78
- export const getFormFieldSampleValue = (field, index = 0)=>{
57
+ export const getFormFieldSampleValue = (field, index = 0) => {
79
58
  if (typeof field.sampleData === 'number' || typeof field.sampleData === 'string') {
80
59
  return field.sampleData;
81
60
  }
82
- if (field.itemType === "Number") {
61
+ if (field.itemType === "Number" /* FormItemType.Number */) {
83
62
  return DEFAULT_FORM_NUMBER_SAMPLE + index;
84
63
  }
85
- if (field.itemType === "Date") {
64
+ if (field.itemType === "Date" /* FormItemType.Date */) {
86
65
  const [year, month, day] = DEFAULT_FORM_DATE_SAMPLE.split('-');
87
- const dayNumber = Number(day) + index % 10;
66
+ const dayNumber = Number(day) + (index % 10);
88
67
  return `${year}-${month}-${String(dayNumber).padStart(2, '0')}`;
89
68
  }
90
69
  return field.header ? `${field.header} value` : 'sample';
91
70
  };
92
-
93
71
  //# sourceMappingURL=forms.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/forms.ts"],"sourcesContent":["export interface FormInfo {\n id: number;\n name: string;\n}\n\nexport interface FormFieldInfo {\n id: string;\n header: string;\n itemType: string;\n sampleData?: unknown;\n}\n\nexport const enum FormItemType {\n Text = 'Text',\n Number = 'Number',\n Picture = 'Picture',\n Checkboxes = 'Checkboxes',\n RadioButtons = 'RadioButtons',\n Date = 'Date',\n Signature = 'Signature',\n Dropdown = 'Dropdown',\n Stoplight = 'Stoplight',\n SmartField = 'SmartField',\n}\n\nexport type FormCalculatedFieldType = 'number' | 'date';\nexport type FormConditionalFieldType = 'number' | 'string';\n\nconst FORM_FIELD_KEY_RE = /^__submission_fields\\.(\\d+)\\.([A-Za-z0-9]+)$/;\nconst FORM_FIELD_RUNTIME_PATH_RE = /^__submission_fields\\[\"(\\d+)\"\\]\\[\"([A-Za-z0-9]+)\"\\]$/;\nconst LEGACY_FORM_KEY_RE = /^form_(\\d+)_([A-Za-z0-9]+)$/;\nconst LEGACY_FORM_KEY_PREFIX_RE = /^__form_(\\d+)_([a-f0-9]+)$/;\n\nexport const buildFormFieldKey = (formId: number, fieldId: string): string =>\n `__submission_fields.${formId}.${fieldId.replaceAll('-', '')}`;\n\nexport const parseFormFieldKey = (key: string): { formId: number; fieldId: string } | null => {\n const match = FORM_FIELD_KEY_RE.exec(key) ?? FORM_FIELD_RUNTIME_PATH_RE.exec(key);\n if (match) {\n return { formId: Number(match[1]), fieldId: match[2] };\n }\n\n // Backward compatibility for already saved values.\n const oldMatch = LEGACY_FORM_KEY_RE.exec(key);\n if (oldMatch) {\n return { formId: Number(oldMatch[1]), fieldId: oldMatch[2] };\n }\n\n const legacyMatch = LEGACY_FORM_KEY_PREFIX_RE.exec(key);\n if (legacyMatch) {\n return { formId: Number(legacyMatch[1]), fieldId: legacyMatch[2] };\n }\n\n return null;\n};\n\nexport const isFormFieldKey = (key: string): boolean => parseFormFieldKey(key) !== null;\n\n/**\n * Submission keys may start with numeric properties, so dot notation is unsafe.\n */\nexport const toNunjucksFieldReference = (fieldKey: string): string => {\n const parsed = parseFormFieldKey(fieldKey);\n if (!parsed) {\n return fieldKey;\n }\n\n return `__submission_fields[\"${parsed.formId}\"][\"${parsed.fieldId}\"]`;\n};\n\nexport const getCalculatedFieldTypeFromFormItemType = (\n itemType: string,\n): FormCalculatedFieldType | null => {\n if (itemType === 'Number') {\n return 'number';\n }\n if (itemType === 'Date') {\n return 'date';\n }\n return null;\n};\n\nexport const getConditionalFieldTypeFromFormItemType = (\n itemType: string,\n): FormConditionalFieldType | null => {\n if (!itemType) {\n return null;\n }\n if (itemType === 'Number') {\n return 'number';\n }\n if (itemType === 'Picture' || itemType === 'Signature') {\n return null;\n }\n return 'string';\n};\n\nconst DEFAULT_FORM_NUMBER_SAMPLE = 44;\nconst DEFAULT_FORM_DATE_SAMPLE = '2026-01-15';\n\nexport const getFormFieldSampleValue = (\n field: Pick<FormFieldInfo, 'itemType' | 'sampleData'> & { header?: string },\n index = 0,\n): number | string => {\n if (typeof field.sampleData === 'number' || typeof field.sampleData === 'string') {\n return field.sampleData;\n }\n\n if (field.itemType === FormItemType.Number) {\n return DEFAULT_FORM_NUMBER_SAMPLE + index;\n }\n\n if (field.itemType === FormItemType.Date) {\n const [year, month, day] = DEFAULT_FORM_DATE_SAMPLE.split('-');\n const dayNumber = Number(day) + (index % 10);\n return `${year}-${month}-${String(dayNumber).padStart(2, '0')}`;\n }\n\n return field.header ? `${field.header} value` : 'sample';\n};\n"],"names":["FormItemType","FORM_FIELD_KEY_RE","FORM_FIELD_RUNTIME_PATH_RE","LEGACY_FORM_KEY_RE","LEGACY_FORM_KEY_PREFIX_RE","buildFormFieldKey","formId","fieldId","replaceAll","parseFormFieldKey","key","match","exec","Number","oldMatch","legacyMatch","isFormFieldKey","toNunjucksFieldReference","fieldKey","parsed","getCalculatedFieldTypeFromFormItemType","itemType","getConditionalFieldTypeFromFormItemType","DEFAULT_FORM_NUMBER_SAMPLE","DEFAULT_FORM_DATE_SAMPLE","getFormFieldSampleValue","field","index","sampleData","year","month","day","split","dayNumber","String","padStart","header"],"mappings":"AAYA,OAAO,IAAA,AAAWA,sCAAAA;;;;;;;;;;;WAAAA;MAWjB;AAKD,MAAMC,oBAAoB;AAC1B,MAAMC,6BAA6B;AACnC,MAAMC,qBAAqB;AAC3B,MAAMC,4BAA4B;AAElC,OAAO,MAAMC,oBAAoB,CAACC,QAAgBC,UAC9C,CAAC,oBAAoB,EAAED,OAAO,CAAC,EAAEC,QAAQC,UAAU,CAAC,KAAK,KAAK,CAAC;AAEnE,OAAO,MAAMC,oBAAoB,CAACC;QAChBT;IAAd,MAAMU,SAAQV,0BAAAA,kBAAkBW,IAAI,CAACF,kBAAvBT,qCAAAA,0BAA+BC,2BAA2BU,IAAI,CAACF;IAC7E,IAAIC,OAAO;QACP,OAAO;YAAEL,QAAQO,OAAOF,KAAK,CAAC,EAAE;YAAGJ,SAASI,KAAK,CAAC,EAAE;QAAC;IACzD;IAEA,mDAAmD;IACnD,MAAMG,WAAWX,mBAAmBS,IAAI,CAACF;IACzC,IAAII,UAAU;QACV,OAAO;YAAER,QAAQO,OAAOC,QAAQ,CAAC,EAAE;YAAGP,SAASO,QAAQ,CAAC,EAAE;QAAC;IAC/D;IAEA,MAAMC,cAAcX,0BAA0BQ,IAAI,CAACF;IACnD,IAAIK,aAAa;QACb,OAAO;YAAET,QAAQO,OAAOE,WAAW,CAAC,EAAE;YAAGR,SAASQ,WAAW,CAAC,EAAE;QAAC;IACrE;IAEA,OAAO;AACX,EAAE;AA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AG,CAAC,EACM,EAAE;IACjB,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC/E,OAAO,KAAK,CAAC,UAAU,CAAC;IAC5B,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,uCAAwB,EAAE,CAAC;QACzC,OAAO,0BAA0B,GAAG,KAAK,CAAC;IAC9C,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,mCAAsB,EAAE,CAAC;QACvC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/D,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;QAC7C,OAAO,GAAG,IAAI,IAAI,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC7D,CAAC,CAAC"}
@@ -6,23 +6,20 @@ import { E_SIGN_TOOL_SLUG } from './const';
6
6
  *
7
7
  * `calculated_field` and `e-sign` use it as the field key DTE binds a business-day schedule
8
8
  * to, so a copy starts unbound.
9
- */ export const INSTANCE_ID_TOOL_SLUGS = [
10
- 'embedded-image',
11
- 'calculated_field',
12
- E_SIGN_TOOL_SLUG
13
- ];
9
+ */
10
+ export const INSTANCE_ID_TOOL_SLUGS = ['embedded-image', 'calculated_field', E_SIGN_TOOL_SLUG];
14
11
  /**
15
12
  * Generates an RFC 4122 v4 GUID (`3fa85f64-5717-4562-b3fc-2c963f66afa6`) with the
16
13
  * platform `crypto.randomUUID()`. It is only exposed in secure contexts (https /
17
14
  * localhost); when missing the error is logged and no id is produced.
18
- */ export const generateInstanceId = ()=>{
19
- var _globalThis_crypto;
20
- if (typeof ((_globalThis_crypto = globalThis.crypto) === null || _globalThis_crypto === void 0 ? void 0 : _globalThis_crypto.randomUUID) !== 'function') {
15
+ */
16
+ export const generateInstanceId = () => {
17
+ var _a;
18
+ if (typeof ((_a = globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) !== 'function') {
21
19
  // eslint-disable-next-line no-console
22
20
  console.error('crypto.randomUUID is not available (insecure context?), cannot generate an instance id');
23
21
  return undefined;
24
22
  }
25
23
  return globalThis.crypto.randomUUID();
26
24
  };
27
-
28
25
  //# sourceMappingURL=instance-id.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/instance-id.ts"],"sourcesContent":["import { E_SIGN_TOOL_SLUG } from './const';\n\n/**\n * Custom tools whose `values.id` is a per-instance GUID that must stay unique\n * within a design. When such a tool is duplicated (content or row duplicate),\n * Unlayer copies the values as-is, so the host regenerates the id of the copy.\n *\n * `calculated_field` and `e-sign` use it as the field key DTE binds a business-day schedule\n * to, so a copy starts unbound.\n */\nexport const INSTANCE_ID_TOOL_SLUGS = ['embedded-image', 'calculated_field', E_SIGN_TOOL_SLUG];\n\n/**\n * Generates an RFC 4122 v4 GUID (`3fa85f64-5717-4562-b3fc-2c963f66afa6`) with the\n * platform `crypto.randomUUID()`. It is only exposed in secure contexts (https /\n * localhost); when missing the error is logged and no id is produced.\n */\nexport const generateInstanceId = (): string | undefined => {\n if (typeof globalThis.crypto?.randomUUID !== 'function') {\n // eslint-disable-next-line no-console\n console.error(\n 'crypto.randomUUID is not available (insecure context?), cannot generate an instance id',\n );\n return undefined;\n }\n\n return globalThis.crypto.randomUUID();\n};\n"],"names":["E_SIGN_TOOL_SLUG","INSTANCE_ID_TOOL_SLUGS","generateInstanceId","globalThis","crypto","randomUUID","console","error","undefined"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,UAAU;AAE3C;;;;;;;CAOC,GACD,OAAO,MAAMC,yBAAyB;IAAC;IAAkB;IAAoBD;CAAiB,CAAC;AAE/F;;;;CAIC,GACD,OAAO,MAAME,qBAAqB;QACnBC;IAAX,IAAI,SAAOA,qBAAAA,WAAWC,MAAM,cAAjBD,yCAAAA,mBAAmBE,UAAU,MAAK,YAAY;QACrD,sCAAsC;QACtCC,QAAQC,KAAK,CACT;QAEJ,OAAOC;IACX;IAEA,OAAOL,WAAWC,MAAM,CAACC,UAAU;AACvC,EAAE"}
1
+ {"version":3,"file":"instance-id.js","sourceRoot":"","sources":["../../src/shared/instance-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;AAE/F;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAuB,EAAE;;IACvD,IAAI,OAAO,CAAA,MAAA,UAAU,CAAC,MAAM,0CAAE,UAAU,CAAA,KAAK,UAAU,EAAE,CAAC;QACtD,sCAAsC;QACtC,OAAO,CAAC,KAAK,CACT,wFAAwF,CAC3F,CAAC;QACF,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AAC1C,CAAC,CAAC"}
@@ -4,16 +4,13 @@ export function emptyArrayIfNull(obj, key) {
4
4
  }
5
5
  let arrayOfObj = obj;
6
6
  if (!Array.isArray(obj)) {
7
- arrayOfObj = [
8
- obj
9
- ];
7
+ arrayOfObj = [obj];
10
8
  }
11
- arrayOfObj.forEach((el)=>{
9
+ arrayOfObj.forEach((el) => {
12
10
  if (typeof el[key] === 'undefined' || el[key] === null) {
13
11
  el[key] = [];
14
12
  }
15
13
  });
16
14
  return obj;
17
15
  }
18
-
19
16
  //# sourceMappingURL=nunjucks-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/nunjucks-helpers.ts"],"sourcesContent":["export function emptyArrayIfNull(obj: any, key: string) {\n if (!obj) {\n return obj;\n }\n\n let arrayOfObj = obj;\n if (!Array.isArray(obj)) {\n arrayOfObj = [obj];\n }\n\n arrayOfObj.forEach((el: { [x: string]: any[] }) => {\n if (typeof el[key] === 'undefined' || el[key] === null) {\n el[key] = [];\n }\n });\n\n return obj;\n}\n"],"names":["emptyArrayIfNull","obj","key","arrayOfObj","Array","isArray","forEach","el"],"mappings":"AAAA,OAAO,SAASA,iBAAiBC,GAAQ,EAAEC,GAAW;IAClD,IAAI,CAACD,KAAK;QACN,OAAOA;IACX;IAEA,IAAIE,aAAaF;IACjB,IAAI,CAACG,MAAMC,OAAO,CAACJ,MAAM;QACrBE,aAAa;YAACF;SAAI;IACtB;IAEAE,WAAWG,OAAO,CAAC,CAACC;QAChB,IAAI,OAAOA,EAAE,CAACL,IAAI,KAAK,eAAeK,EAAE,CAACL,IAAI,KAAK,MAAM;YACpDK,EAAE,CAACL,IAAI,GAAG,EAAE;QAChB;IACJ;IAEA,OAAOD;AACX"}
1
+ {"version":3,"file":"nunjucks-helpers.js","sourceRoot":"","sources":["../../src/shared/nunjucks-helpers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,GAAQ,EAAE,GAAW;IAClD,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,GAAG,CAAC;IACf,CAAC;IAED,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,UAAU,CAAC,OAAO,CAAC,CAAC,EAA0B,EAAE,EAAE;QAC9C,IAAI,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,WAAW,IAAI,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;YACrD,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;QACjB,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -1,28 +1,17 @@
1
- export const schemaNodeAvailableTypes = [
2
- 'object',
3
- 'array',
4
- 'string',
5
- 'number',
6
- 'date'
7
- ];
8
- export const schemaNodeStringSubTypes = [
9
- 'string',
10
- 'text',
11
- 'html',
12
- 'image'
13
- ];
14
- export const schemaIsAvailableType = (type)=>schemaNodeAvailableTypes.includes(type);
1
+ export const schemaNodeAvailableTypes = ['object', 'array', 'string', 'number', 'date'];
2
+ export const schemaNodeStringSubTypes = ['string', 'text', 'html', 'image'];
3
+ export const schemaIsAvailableType = (type) => schemaNodeAvailableTypes.includes(type);
15
4
  export const schemaArrayRootKey = '[]';
16
- export const schemaIsObject = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'object';
17
- export const schemaIsArrayOfObjects = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'array' && (node === null || node === void 0 ? void 0 : node.items.type) === 'object';
18
- export const schemaIsArray = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'array';
19
- export const schemaIsString = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string';
20
- export const schemaIsNumber = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'number';
21
- export const schemaIsDate = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'date';
22
- export const schemaIsStringHtml = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'html';
23
- export const schemaIsStringImage = (node)=>(node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'image';
24
- export const schemaFindNode = (schema, key)=>{
25
- const nodeFinder = (node, keys)=>{
5
+ export const schemaIsObject = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'object';
6
+ export const schemaIsArrayOfObjects = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'array' && (node === null || node === void 0 ? void 0 : node.items.type) === 'object';
7
+ export const schemaIsArray = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'array';
8
+ export const schemaIsString = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'string';
9
+ export const schemaIsNumber = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'number';
10
+ export const schemaIsDate = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'date';
11
+ export const schemaIsStringHtml = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'html';
12
+ export const schemaIsStringImage = (node) => (node === null || node === void 0 ? void 0 : node.type) === 'string' && (node === null || node === void 0 ? void 0 : node.subType) === 'image';
13
+ export const schemaFindNode = (schema, key) => {
14
+ const nodeFinder = (node, keys) => {
26
15
  if (!node) {
27
16
  return undefined;
28
17
  }
@@ -46,115 +35,82 @@ export const schemaFindNode = (schema, key)=>{
46
35
  };
47
36
  return nodeFinder(schema, key.split('.'));
48
37
  };
49
- export const schemaFindParentNode = (schema, key)=>{
38
+ export const schemaFindParentNode = (schema, key) => {
50
39
  const keys = key.split('.');
51
40
  keys.pop();
52
- return keys.length ? schemaFindNode(schema, keys.join('.')) : schemaIsObject(schema) && schema.properties[key] ? schema : undefined;
41
+ return keys.length
42
+ ? schemaFindNode(schema, keys.join('.'))
43
+ : schemaIsObject(schema) && schema.properties[key]
44
+ ? schema
45
+ : undefined;
53
46
  };
54
- export const schemaGetFieldKey = (fullKey)=>{
55
- var _fullKey_split_pop;
56
- return (_fullKey_split_pop = fullKey.split('.').pop()) !== null && _fullKey_split_pop !== void 0 ? _fullKey_split_pop : '';
57
- };
58
- export const schemaBuildNode = (type, arrayItemType)=>{
47
+ export const schemaGetFieldKey = (fullKey) => { var _a; return (_a = fullKey.split('.').pop()) !== null && _a !== void 0 ? _a : ''; };
48
+ export const schemaBuildNode = (type, arrayItemType) => {
59
49
  if (type === 'object') {
60
- return {
61
- type: 'object',
62
- properties: {},
63
- options: {}
64
- };
50
+ return { type: 'object', properties: {}, options: {} };
65
51
  }
66
52
  if (type === 'array') {
67
- return {
68
- type: 'array',
69
- items: schemaBuildNode(arrayItemType !== null && arrayItemType !== void 0 ? arrayItemType : 'object'),
70
- options: {}
71
- };
53
+ return { type: 'array', items: schemaBuildNode(arrayItemType !== null && arrayItemType !== void 0 ? arrayItemType : 'object'), options: {} };
72
54
  }
73
- return {
74
- type,
75
- options: {}
76
- };
55
+ return { type, options: {} };
77
56
  };
78
- export const schemaBuildMap = (schema)=>{
57
+ export const schemaBuildMap = (schema) => {
79
58
  const fieldsMap = {};
80
59
  const dummyData = {};
81
- const processNode = (node, nodeKey, parentNodes, isArrayed, dummyDataNode)=>{
82
- var _node_title;
83
- const nodeLabel = (_node_title = node.title) !== null && _node_title !== void 0 ? _node_title : nodeKey;
60
+ const processNode = (node, nodeKey, parentNodes, isArrayed, dummyDataNode) => {
61
+ var _a, _b, _c, _d, _e, _f, _g, _h;
62
+ const nodeLabel = (_a = node.title) !== null && _a !== void 0 ? _a : nodeKey;
84
63
  const isArrayRoot = nodeKey === schemaArrayRootKey;
85
64
  if (nodeKey) {
86
- var _node_title1;
87
- const fullKey = [
88
- ...parentNodes.map((n)=>n.key),
89
- nodeKey
90
- ].join('.');
91
- const fullTitle = [
92
- ...parentNodes.map((n)=>n.title),
93
- nodeLabel
94
- ].join(' - ');
65
+ const fullKey = [...parentNodes.map(n => n.key), nodeKey].join('.');
66
+ const fullTitle = [...parentNodes.map(n => n.title), nodeLabel].join(' - ');
95
67
  fieldsMap[fullKey] = {
96
68
  fieldKey: nodeKey,
97
69
  fullKey,
98
70
  fullTitle,
99
- title: ((_node_title1 = node.title) !== null && _node_title1 !== void 0 ? _node_title1 : isArrayed) ? nodeLabel : fullTitle,
71
+ title: ((_b = node.title) !== null && _b !== void 0 ? _b : isArrayed) ? nodeLabel : fullTitle,
100
72
  node,
101
73
  isArrayed,
102
- isValue: !schemaIsObject(node) && !schemaIsArray(node)
74
+ isValue: !schemaIsObject(node) && !schemaIsArray(node),
103
75
  };
104
76
  }
105
77
  if (schemaIsObject(node)) {
106
- var _node_properties;
107
- const properties = (_node_properties = node.properties) !== null && _node_properties !== void 0 ? _node_properties : {};
78
+ const properties = (_c = node.properties) !== null && _c !== void 0 ? _c : {};
108
79
  const keys = Object.keys(properties !== null && properties !== void 0 ? properties : {}).sort();
109
80
  let dummyDataObject = {};
110
81
  if (isArrayRoot) {
111
- var _dummyDataNode_push;
112
- (_dummyDataNode_push = dummyDataNode.push) === null || _dummyDataNode_push === void 0 ? void 0 : _dummyDataNode_push.call(dummyDataNode, dummyDataObject);
113
- } else if (nodeKey) {
82
+ (_d = dummyDataNode.push) === null || _d === void 0 ? void 0 : _d.call(dummyDataNode, dummyDataObject);
83
+ }
84
+ else if (nodeKey) {
114
85
  dummyDataNode[nodeKey] = dummyDataObject;
115
- } else {
86
+ }
87
+ else {
116
88
  dummyDataObject = dummyDataNode;
117
89
  }
118
- for (const key of keys){
119
- processNode(properties[key], key, nodeKey ? [
120
- ...parentNodes,
121
- {
122
- key: nodeKey,
123
- title: nodeLabel
124
- }
125
- ] : [], isArrayed, dummyDataObject);
90
+ for (const key of keys) {
91
+ processNode(properties[key], key, nodeKey ? [...parentNodes, { key: nodeKey, title: nodeLabel }] : [], isArrayed, dummyDataObject);
126
92
  }
127
- } else if (schemaIsArray(node)) {
128
- var _node_items;
129
- const items = (_node_items = node.items) !== null && _node_items !== void 0 ? _node_items : {};
93
+ }
94
+ else if (schemaIsArray(node)) {
95
+ const items = (_e = node.items) !== null && _e !== void 0 ? _e : {};
130
96
  dummyDataNode[nodeKey] = [];
131
- processNode(items, schemaArrayRootKey, nodeKey ? [
132
- ...parentNodes,
133
- {
134
- key: nodeKey,
135
- title: nodeLabel
136
- }
137
- ] : [], true, dummyDataNode[nodeKey]);
138
- } else if (nodeKey) {
139
- var _node_options, _node_options1;
140
- const sampleData = node === null || node === void 0 ? void 0 : (_node_options = node.options) === null || _node_options === void 0 ? void 0 : _node_options.sampleData;
141
- const placeholder = node === null || node === void 0 ? void 0 : (_node_options1 = node.options) === null || _node_options1 === void 0 ? void 0 : _node_options1.placeholder;
97
+ processNode(items, schemaArrayRootKey, nodeKey ? [...parentNodes, { key: nodeKey, title: nodeLabel }] : [], true, dummyDataNode[nodeKey]);
98
+ }
99
+ else if (nodeKey) {
100
+ const sampleData = (_f = node === null || node === void 0 ? void 0 : node.options) === null || _f === void 0 ? void 0 : _f.sampleData;
101
+ const placeholder = (_g = node === null || node === void 0 ? void 0 : node.options) === null || _g === void 0 ? void 0 : _g.placeholder;
142
102
  const value = sampleData !== undefined ? sampleData : placeholder;
143
103
  if (value !== undefined) {
144
104
  if (isArrayRoot) {
145
- var _dummyDataNode_push1;
146
- (_dummyDataNode_push1 = dummyDataNode.push) === null || _dummyDataNode_push1 === void 0 ? void 0 : _dummyDataNode_push1.call(dummyDataNode, value);
147
- } else {
105
+ (_h = dummyDataNode.push) === null || _h === void 0 ? void 0 : _h.call(dummyDataNode, value);
106
+ }
107
+ else {
148
108
  dummyDataNode[nodeKey] = value;
149
109
  }
150
110
  }
151
111
  }
152
112
  };
153
113
  processNode(schema, '', [], false, dummyData);
154
- return {
155
- map: fieldsMap,
156
- dummyData
157
- };
114
+ return { map: fieldsMap, dummyData };
158
115
  };
159
-
160
116
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/schema.ts"],"sourcesContent":["export type SchemaNodeAvailableTypes = 'object' | 'array' | 'string' | 'number' | 'date';\nexport const schemaNodeAvailableTypes = ['object', 'array', 'string', 'number', 'date'];\n\nexport type SchemaNodeStringSubTypes = 'string' | 'text' | 'html' | 'image';\nexport const schemaNodeStringSubTypes = ['string', 'text', 'html', 'image'];\n\nexport const schemaIsAvailableType = (type: string): type is SchemaNodeAvailableTypes =>\n schemaNodeAvailableTypes.includes(type);\n\nexport interface SchemaFieldBaseOptions {\n placeholder?: any;\n description?: any;\n sampleData?: any;\n showInEditor?: boolean;\n useInCalculatedFields?: boolean;\n useInConditionals?: boolean;\n isHighlighted?: boolean;\n fieldLookupSource?: string;\n}\n\ninterface SchemaNodeProps {\n title?: string;\n options?: SchemaFieldBaseOptions;\n}\n\nexport interface SchemaObject extends SchemaNodeProps {\n type: 'object';\n properties: Record<string, SchemaNode>;\n}\n\nexport interface SchemaArray extends SchemaNodeProps {\n type: 'array';\n items: SchemaNode;\n}\n\nexport interface SchemaSimpleString extends SchemaNodeProps {\n type: 'string';\n subType?: SchemaNodeStringSubTypes;\n}\n\nexport interface SchemaSimpleNumber extends SchemaNodeProps {\n type: 'number';\n}\n\nexport interface SchemaSimpleDate extends SchemaNodeProps {\n type: 'date';\n}\n\nexport type SchemaSimple = SchemaSimpleString | SchemaSimpleNumber | SchemaSimpleDate;\n\nexport const schemaArrayRootKey = '[]';\nexport type SchemaNode = SchemaObject | SchemaArray | SchemaSimple;\n\nexport const schemaIsObject = (node?: SchemaNode): node is SchemaObject => node?.type === 'object';\nexport const schemaIsArrayOfObjects = (node?: SchemaNode): node is SchemaArray =>\n node?.type === 'array' && node?.items.type === 'object';\nexport const schemaIsArray = (node?: SchemaNode): node is SchemaArray => node?.type === 'array';\nexport const schemaIsString = (node?: SchemaNode): node is SchemaSimpleString =>\n node?.type === 'string';\nexport const schemaIsNumber = (node?: SchemaNode): node is SchemaSimpleNumber =>\n node?.type === 'number';\nexport const schemaIsDate = (node?: SchemaNode): node is SchemaSimpleDate => node?.type === 'date';\nexport const schemaIsStringHtml = (node?: SchemaNode): node is SchemaSimpleString =>\n node?.type === 'string' && node?.subType === 'html';\n\nexport const schemaIsStringImage = (node?: SchemaNode): node is SchemaSimpleString =>\n node?.type === 'string' && node?.subType === 'image';\n\nexport const schemaFindNode = (schema: SchemaNode, key: string): SchemaNode | undefined => {\n const nodeFinder = (node: SchemaNode, keys: string[]): SchemaNode | undefined => {\n if (!node) {\n return undefined;\n }\n\n if (!keys.length) {\n return node;\n }\n\n const key = keys.shift();\n\n if (!key) {\n return undefined;\n }\n\n if (key === schemaArrayRootKey) {\n return schemaIsArray(node) ? nodeFinder(node.items, keys) : undefined;\n }\n\n if (schemaIsObject(node)) {\n return nodeFinder(node.properties[key], keys);\n }\n\n if (schemaIsArrayOfObjects(node)) {\n return nodeFinder(((node as SchemaArray)?.items as SchemaObject).properties[key], keys);\n }\n\n return undefined;\n };\n\n return nodeFinder(schema, key.split('.'));\n};\n\nexport const schemaFindParentNode = (schema: SchemaNode, key: string): SchemaNode | undefined => {\n const keys = key.split('.');\n\n keys.pop();\n\n return keys.length\n ? schemaFindNode(schema, keys.join('.'))\n : schemaIsObject(schema) && schema.properties[key]\n ? schema\n : undefined;\n};\n\nexport const schemaGetFieldKey = (fullKey: string): string => fullKey.split('.').pop() ?? '';\n\nexport const schemaBuildNode = (\n type: SchemaNodeAvailableTypes,\n arrayItemType?: SchemaNodeAvailableTypes,\n): SchemaNode => {\n if (type === 'object') {\n return { type: 'object', properties: {}, options: {} };\n }\n if (type === 'array') {\n return { type: 'array', items: schemaBuildNode(arrayItemType ?? 'object'), options: {} };\n }\n\n return { type, options: {} };\n};\n\nexport interface SchemaMetaField {\n fieldKey: string;\n fullKey: string;\n node: SchemaNode;\n title: string; // node.title or fullTitle\n fullTitle: string; // joined title of all parents and field\n isArrayed: boolean;\n isValue: boolean;\n}\n\nexport type SchemaMap = Record<string, SchemaMetaField>;\n\nexport const schemaBuildMap = (schema: SchemaObject): { map: SchemaMap; dummyData: any } => {\n const fieldsMap: Record<string, SchemaMetaField> = {};\n const dummyData: any = {};\n\n const processNode = (\n node: SchemaNode,\n nodeKey: string,\n parentNodes: { key: string; title: string }[],\n isArrayed: boolean,\n dummyDataNode: any,\n ) => {\n const nodeLabel = node.title ?? nodeKey;\n const isArrayRoot = nodeKey === schemaArrayRootKey;\n\n if (nodeKey) {\n const fullKey = [...parentNodes.map(n => n.key), nodeKey].join('.');\n const fullTitle = [...parentNodes.map(n => n.title), nodeLabel].join(' - ');\n\n fieldsMap[fullKey] = {\n fieldKey: nodeKey,\n fullKey,\n fullTitle,\n title: (node.title ?? isArrayed) ? nodeLabel : fullTitle,\n node,\n isArrayed,\n isValue: !schemaIsObject(node) && !schemaIsArray(node),\n };\n }\n\n if (schemaIsObject(node)) {\n const properties = node.properties ?? {};\n const keys = Object.keys(properties ?? {}).sort();\n let dummyDataObject = {};\n\n if (isArrayRoot) {\n dummyDataNode.push?.(dummyDataObject);\n } else if (nodeKey) {\n dummyDataNode[nodeKey] = dummyDataObject;\n } else {\n dummyDataObject = dummyDataNode;\n }\n\n for (const key of keys) {\n processNode(\n properties[key],\n key,\n nodeKey ? [...parentNodes, { key: nodeKey, title: nodeLabel }] : [],\n isArrayed,\n dummyDataObject,\n );\n }\n } else if (schemaIsArray(node)) {\n const items = node.items ?? {};\n\n dummyDataNode[nodeKey] = [];\n processNode(\n items,\n schemaArrayRootKey,\n nodeKey ? [...parentNodes, { key: nodeKey, title: nodeLabel }] : [],\n true,\n dummyDataNode[nodeKey],\n );\n } else if (nodeKey) {\n const sampleData = node?.options?.sampleData;\n const placeholder = node?.options?.placeholder;\n const value = sampleData !== undefined ? sampleData : placeholder;\n\n if (value !== undefined) {\n if (isArrayRoot) {\n dummyDataNode.push?.(value);\n } else {\n dummyDataNode[nodeKey] = value;\n }\n }\n }\n };\n\n processNode(schema, '', [], false, dummyData);\n\n return { map: fieldsMap, dummyData };\n};\n"],"names":["schemaNodeAvailableTypes","schemaNodeStringSubTypes","schemaIsAvailableType","type","includes","schemaArrayRootKey","schemaIsObject","node","schemaIsArrayOfObjects","items","schemaIsArray","schemaIsString","schemaIsNumber","schemaIsDate","schemaIsStringHtml","subType","schemaIsStringImage","schemaFindNode","schema","key","nodeFinder","keys","undefined","length","shift","properties","split","schemaFindParentNode","pop","join","schemaGetFieldKey","fullKey","schemaBuildNode","arrayItemType","options","schemaBuildMap","fieldsMap","dummyData","processNode","nodeKey","parentNodes","isArrayed","dummyDataNode","nodeLabel","title","isArrayRoot","map","n","fullTitle","fieldKey","isVal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,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,UAAU,CAAC;YAC7C,MAAM,WAAW,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,0CAAE,WAAW,CAAC;YAC/C,MAAM,KAAK,GAAG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;YAElE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,IAAI,WAAW,EAAE,CAAC;oBACd,MAAA,aAAa,CAAC,IAAI,8DAAG,KAAK,CAAC,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACJ,aAAa,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;gBACnC,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAE9C,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AACzC,CAAC,CAAC"}
@@ -1,22 +1,15 @@
1
- export const unlayerToolsGenerateUnitKey = (unitId, unitGeneric)=>`${unitGeneric}:unit:${unitId}`;
2
- export const unlayerToolsParseUnitKey = (toolKey)=>{
1
+ export const unlayerToolsGenerateUnitKey = (unitId, unitGeneric) => `${unitGeneric}:unit:${unitId}`;
2
+ export const unlayerToolsParseUnitKey = (toolKey) => {
3
3
  const [generic, type, id] = (toolKey !== null && toolKey !== void 0 ? toolKey : '').split(':');
4
4
  if (type === 'unit' && generic && id) {
5
- return {
6
- id,
7
- generic
8
- };
5
+ return { id, generic };
9
6
  }
10
7
  };
11
- export const unlayerToolsGenerateTwinKey = (toolType, toolSlug)=>`|twin|${toolType}|${toolSlug !== null && toolSlug !== void 0 ? toolSlug : ''}|${Date.now()}${Math.round(Math.random() * 10000)}`;
12
- export const unlayerToolsParseTwinKey = (toolKey)=>{
8
+ export const unlayerToolsGenerateTwinKey = (toolType, toolSlug) => `|twin|${toolType}|${toolSlug !== null && toolSlug !== void 0 ? toolSlug : ''}|${Date.now()}${Math.round(Math.random() * 10000)}`;
9
+ export const unlayerToolsParseTwinKey = (toolKey) => {
13
10
  const [, twin, type, slug] = (toolKey !== null && toolKey !== void 0 ? toolKey : '').split('|');
14
11
  if (twin === 'twin' && type) {
15
- return {
16
- type,
17
- slug: slug || undefined
18
- };
12
+ return { type, slug: slug || undefined };
19
13
  }
20
14
  };
21
-
22
15
  //# sourceMappingURL=tools.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/tools.ts"],"sourcesContent":["export const unlayerToolsGenerateUnitKey = (unitId: string, unitGeneric: string) =>\n `${unitGeneric}:unit:${unitId}`;\n\nexport const unlayerToolsParseUnitKey = (\n toolKey: string\n): { id: string; generic: string } | undefined => {\n const [generic, type, id] = (toolKey ?? '').split(':');\n\n if (type === 'unit' && generic && id) {\n return { id, generic };\n }\n};\n\nexport const unlayerToolsGenerateTwinKey = (toolType: string, toolSlug?: string) =>\n `|twin|${toolType}|${toolSlug ?? ''}|${Date.now()}${Math.round(Math.random() * 10000)}`;\n\nexport const unlayerToolsParseTwinKey = (\n toolKey: string\n): { type: string; slug?: string } | undefined => {\n const [, twin, type, slug] = (toolKey ?? '').split('|');\n\n if (twin === 'twin' && type) {\n return { type, slug: slug || undefined };\n }\n};\n\nexport interface UnlayerStore {\n renderHtml(html: string, data: any): string;\n sendData(type: string, data?: any): void;\n getTool(key: string): { getModel(): object; dataSources(values?: any): string[] } | undefined;\n}\n"],"names":["unlayerToolsGenerateUnitKey","unitId","unitGeneric","unlayerToolsParseUnitKey","toolKey","generic","type","id","split","unlayerToolsGenerateTwinKey","toolType","toolSlug","Date","now","Math","round","random","unlayerToolsParseTwinKey","twin","slug","undefined"],"mappings":"AAAA,OAAO,MAAMA,8BAA8B,CAACC,QAAgBC,cACxD,GAAGA,YAAY,MAAM,EAAED,QAAQ,CAAC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