@useinsider/guido 1.0.3-beta.f7c323f → 1.0.3-beta.fc5a751

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 (161) hide show
  1. package/README.md +0 -3
  2. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  3. package/dist/composables/useActionsApi.js +1 -1
  4. package/dist/composables/useBlocksConfig.js +2 -1
  5. package/dist/composables/useHtmlCompiler.js +13 -15
  6. package/dist/composables/useHtmlValidator.js +35 -36
  7. package/dist/composables/useStripo.js +28 -32
  8. package/dist/enums/defaults.js +4 -5
  9. package/dist/enums/extensions/recommendationBlock.js +2 -2
  10. package/dist/enums/onboarding.js +3 -7
  11. package/dist/extensions/Blocks/Checkbox/block.js +2 -5
  12. package/dist/extensions/Blocks/Checkbox/control.js +14 -15
  13. package/dist/extensions/Blocks/Checkbox/template.js +9 -14
  14. package/dist/extensions/Blocks/RadioButton/block.js +2 -5
  15. package/dist/extensions/Blocks/RadioButton/control.js +17 -18
  16. package/dist/extensions/Blocks/RadioButton/template.js +9 -18
  17. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  18. package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
  19. package/dist/extensions/Blocks/common-control.js +110 -174
  20. package/dist/guido.css +1 -1
  21. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +168 -213
  22. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
  23. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  24. package/dist/package.json.js +1 -1
  25. package/dist/services/recommendationApi.js +19 -13
  26. package/dist/services/stripoApi.js +12 -25
  27. package/dist/src/enums/defaults.d.ts +0 -1
  28. package/dist/src/enums/onboarding.d.ts +0 -4
  29. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +0 -1
  30. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  31. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +0 -1
  32. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  33. package/dist/src/extensions/Blocks/common-control.d.ts +7 -44
  34. package/dist/src/stores/onboarding.d.ts +0 -334
  35. package/dist/static/styles/customEditorStyle.css.js +1 -1
  36. package/dist/stores/onboarding.js +12 -20
  37. package/dist/utils/genericUtil.js +17 -16
  38. package/package.json +3 -3
  39. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
  40. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
  41. package/dist/config/compiler/itemsCompilerRules.js +0 -14
  42. package/dist/extensions/Blocks/Items/block.js +0 -67
  43. package/dist/extensions/Blocks/Items/controls/button/link.js +0 -68
  44. package/dist/extensions/Blocks/Items/controls/cardComposition.js +0 -193
  45. package/dist/extensions/Blocks/Items/controls/image/link.js +0 -68
  46. package/dist/extensions/Blocks/Items/controls/index.js +0 -217
  47. package/dist/extensions/Blocks/Items/controls/name/trimming.js +0 -70
  48. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +0 -107
  49. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +0 -123
  50. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +0 -76
  51. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -61
  52. package/dist/extensions/Blocks/Items/controls/settingsControl.js +0 -312
  53. package/dist/extensions/Blocks/Items/enums/controlEnums.js +0 -5
  54. package/dist/extensions/Blocks/Items/enums/productEnums.js +0 -273
  55. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -76
  56. package/dist/extensions/Blocks/Items/extension.js +0 -19
  57. package/dist/extensions/Blocks/Items/iconsRegistry.js +0 -32
  58. package/dist/extensions/Blocks/Items/items.css.js +0 -23
  59. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +0 -62
  60. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +0 -60
  61. package/dist/extensions/Blocks/Items/settingsPanel.js +0 -131
  62. package/dist/extensions/Blocks/Items/store/items-block.js +0 -71
  63. package/dist/extensions/Blocks/Items/template.js +0 -189
  64. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
  65. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
  66. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -67
  67. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -44
  68. package/dist/extensions/Blocks/controlFactories.js +0 -223
  69. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  70. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  71. package/dist/node_modules/lodash-es/_Set.js +0 -6
  72. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  73. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  74. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  75. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  76. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  77. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  78. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  79. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  80. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  81. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  82. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  83. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  84. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  85. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  86. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  87. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  88. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  89. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  90. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  91. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  92. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  93. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  94. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  95. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  96. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  97. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  98. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  99. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  100. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  101. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  102. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  103. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  104. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  105. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  106. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  107. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  108. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  109. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  110. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  111. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  112. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  113. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  114. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  115. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  116. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  117. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  118. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  119. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  120. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  121. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  122. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  123. package/dist/node_modules/lodash-es/get.js +0 -8
  124. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  125. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  126. package/dist/node_modules/lodash-es/keys.js +0 -9
  127. package/dist/node_modules/lodash-es/map.js +0 -11
  128. package/dist/node_modules/lodash-es/property.js +0 -10
  129. package/dist/node_modules/lodash-es/range.js +0 -5
  130. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  131. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  132. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  133. package/dist/node_modules/lodash-es/toString.js +0 -7
  134. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
  135. package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
  136. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -27
  137. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -14
  138. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -33
  139. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -14
  140. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -501
  141. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -14
  142. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -19
  143. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -21
  144. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -14
  145. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -13
  146. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -48
  147. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -61
  148. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -162
  149. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -49
  150. package/dist/src/extensions/Blocks/Items/extension.d.ts +0 -2
  151. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +0 -4
  152. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +0 -4
  153. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -41
  154. package/dist/src/extensions/Blocks/Items/template.d.ts +0 -24
  155. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
  156. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
  157. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -44
  158. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
  159. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -312
  160. package/dist/src/utils/pairProductVariables.d.ts +0 -7
  161. package/dist/utils/pairProductVariables.js +0 -136
@@ -1,20 +1,19 @@
1
- import a from "./_baseTimes.js";
1
+ import p from "./_baseTimes.js";
2
2
  import g from "./isArguments.js";
3
3
  import h from "./isArray.js";
4
- import b from "./isBuffer.js";
5
- import A from "./_isIndex.js";
6
- import c from "./isTypedArray.js";
7
- var d = Object.prototype, O = d.hasOwnProperty;
8
- function l(t, p) {
9
- var o = h(t), i = !o && g(t), s = !o && !i && b(t), e = !o && !i && !s && c(t), n = o || i || s || e, f = n ? a(t.length, String) : [], m = f.length;
10
- for (var r in t)
11
- (p || O.call(t, r)) && !(n && // Safari 9 has enumerable `arguments.length` in strict mode.
4
+ import a from "./isBuffer.js";
5
+ import d from "./_isIndex.js";
6
+ import A from "./isTypedArray.js";
7
+ function c(i, b) {
8
+ var t = h(i), f = !t && g(i), s = !t && !f && a(i), o = !t && !f && !s && A(i), n = t || f || s || o, e = n ? p(i.length, String) : [], m = e.length;
9
+ for (var r in i)
10
+ n && // Safari 9 has enumerable `arguments.length` in strict mode.
12
11
  (r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13
12
  s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
14
- e && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
15
- A(r, m))) && f.push(r);
16
- return f;
13
+ o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
14
+ d(r, m)) || e.push(r);
15
+ return e;
17
16
  }
18
17
  export {
19
- l as default
18
+ c as default
20
19
  };
@@ -1,9 +1,9 @@
1
1
  import e from "./_arrayLikeKeys.js";
2
2
  import i from "./_baseKeysIn.js";
3
3
  import a from "./isArrayLike.js";
4
- function t(r) {
5
- return a(r) ? e(r, !0) : i(r);
4
+ function f(r) {
5
+ return a(r) ? e(r) : i(r);
6
6
  }
7
7
  export {
8
- t as default
8
+ f as default
9
9
  };
@@ -1,4 +1,4 @@
1
- const o = { stripo: { version: "2.47.0" } }, s = {
1
+ const o = { stripo: { version: "2.46.0" } }, s = {
2
2
  guido: o
3
3
  };
4
4
  export {
@@ -1,13 +1,19 @@
1
1
  import { useHttp as c } from "../composables/useHttp.js";
2
2
  import { URLS as a } from "../enums/extensions/recommendationBlock.js";
3
- const R = () => {
3
+ import { useEditorStore as m } from "../stores/editor.js";
4
+ import { replaceString as s } from "../utils/genericUtil.js";
5
+ const l = () => {
4
6
  const { get: o } = c();
5
7
  return {
6
8
  fetchRecommendationCreateData: async () => {
9
+ const e = m();
7
10
  try {
8
- return (await o("/newsletter/recommendations/create-data")).data;
9
- } catch (e) {
10
- throw console.error("fetchUserModalState error:", e), e;
11
+ return (await o(s(
12
+ "/newsletter/{id}/recommendations/get-campaign-create-data",
13
+ { id: e.templateId }
14
+ ))).data;
15
+ } catch (t) {
16
+ throw console.error("fetchUserModalState error:", t), t;
11
17
  }
12
18
  },
13
19
  fetchRecommendationFilters: async () => {
@@ -18,20 +24,20 @@ const R = () => {
18
24
  throw console.error("fetchRecommendationFilters error:", e), e;
19
25
  }
20
26
  },
21
- fetchRecommendationProducts: async (e, n) => {
27
+ fetchRecommendationProducts: async (e, t) => {
22
28
  try {
23
- const t = decodeURIComponent(new URLSearchParams(Object.entries(n)).toString());
24
- console.debug("🏁 Recommendation API Query:", t);
25
- const r = await o(
26
- `${a.RECOMMENDATION_API_URL}/v2/${e}?${t}`
29
+ const r = decodeURIComponent(new URLSearchParams(Object.entries(t)).toString());
30
+ console.debug("🏁 Recommendation API Query:", r);
31
+ const n = await o(
32
+ `${a.RECOMMENDATION_API_URL}/v2/${e}?${r}`
27
33
  );
28
- return (r == null ? void 0 : r.data) ?? [];
29
- } catch (t) {
30
- throw console.error("fetchRecommendationProducts error:", t), t;
34
+ return (n == null ? void 0 : n.data) ?? [];
35
+ } catch (r) {
36
+ throw console.error("fetchRecommendationProducts error:", r), r;
31
37
  }
32
38
  }
33
39
  };
34
40
  };
35
41
  export {
36
- R as useRecommendationApi
42
+ l as useRecommendationApi
37
43
  };
@@ -1,26 +1,25 @@
1
- import { useHttp as d } from "../composables/useHttp.js";
2
- import { useToaster as m } from "../composables/useToaster.js";
3
- import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
4
- const y = () => {
5
- const { get: a } = d(), { handleError: r } = m();
1
+ import { useHttp as a } from "../composables/useHttp.js";
2
+ import { useToaster as s } from "../composables/useToaster.js";
3
+ const m = () => {
4
+ const { get: r } = a(), { handleError: o } = s();
6
5
  return {
7
6
  getToken: async () => {
8
7
  try {
9
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await a(`/stripo/get-user-token?test=${t}`);
8
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
10
9
  return e.body.token;
11
10
  } catch (t) {
12
- return r(t, "Failed to fetch token"), "";
11
+ return o(t, "Failed to fetch token"), "";
13
12
  }
14
13
  },
15
14
  getCustomFonts: async () => {
16
15
  try {
17
- const { data: t = [] } = await a("/stripo/get-partner-custom-fonts");
16
+ const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
18
17
  return t.map((e) => ({
19
18
  ...e,
20
19
  active: !0
21
20
  }));
22
21
  } catch (t) {
23
- return r(t, "Failed to fetch custom fonts"), [];
22
+ return o(t, "Failed to fetch custom fonts"), [];
24
23
  }
25
24
  },
26
25
  getDefaultTemplate: async () => {
@@ -30,33 +29,21 @@ const y = () => {
30
29
  forceRecreate: !0
31
30
  };
32
31
  try {
33
- const e = window.location.search;
34
- console.debug("guido:default-template", e);
35
- const l = window.top;
36
- console.debug("guido:default-template", l);
37
- const n = new URLSearchParams(window.location.search);
38
- console.debug("guido:default-template", n);
39
- const s = n.get("default-template");
40
- console.debug("guido:default-template", s);
41
- const o = s ? parseInt(s) : 0;
42
- console.debug("guido:default-template", o);
43
- const c = o >= 1 && o <= p ? o : 0;
44
- console.debug("guido:default-template", c);
45
- const { data: u } = await a(`/stripo/default-template/${c}`);
32
+ const { data: e } = await r("/stripo/default-template/0");
46
33
  try {
47
34
  return {
48
- ...JSON.parse(u),
35
+ ...JSON.parse(e),
49
36
  forceRecreate: !0
50
37
  };
51
38
  } catch {
52
39
  return t;
53
40
  }
54
41
  } catch (e) {
55
- return r(e, "Failed to fetch default template"), t;
42
+ return o(e, "Failed to fetch default template"), t;
56
43
  }
57
44
  }
58
45
  };
59
46
  };
60
47
  export {
61
- y as useStripoApi
48
+ m as useStripoApi
62
49
  };
@@ -8,6 +8,5 @@ export declare const DefaultProductType = "email";
8
8
  export declare const DefaultUsername = "Guido User";
9
9
  export declare const DefaultMessageType: number;
10
10
  export declare const EditorType: number;
11
- export declare const MAX_DEFAULT_TEMPLATE_ID = 13;
12
11
  export declare const ProductIds: Record<string, number>;
13
12
  export declare const TEST_PARTNER_LIST: string[];
@@ -1,6 +1,2 @@
1
1
  export declare const SERVICE_HOVER_SELECTORS: string[];
2
- export declare const UI_EDITOR_SELECTOR = "ui-editor";
3
- export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
4
- export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
5
- export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
6
2
  export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
@@ -8,5 +8,4 @@ export declare class CheckboxBlock extends Block {
8
8
  getName(): string;
9
9
  getDescription(): string;
10
10
  getTemplate(): string;
11
- allowInnerBlocksDND(): boolean;
12
11
  }
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"checkbox-block\"\n class=\"\n checkbox-block\n checkbox-block-v2\n esd-block-checkbox\n esd-checkbox-block\n esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -8,5 +8,4 @@ export declare class RadioButtonCustomBlock extends Block {
8
8
  getName(): string;
9
9
  getDescription(): string;
10
10
  getTemplate(): string;
11
- allowInnerBlocksDND(): boolean;
12
11
  }
@@ -1,4 +1,4 @@
1
- declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"radio-button-block\"\n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"\n radio-button\n radio-button-v2\n esd-block-ra\n esd-radio-button-block\n esd-extension-block\n es-p10t\n es-p10b\n es-p30r\n es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
1
+ declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"radio-button-block\" \n esd-handler-name=\"esd-extension-RadioButtonBlock\"\n class=\"radio-button-v2 esd-block-ra esd-radio-button-block esd-extension-block es-p10t es-p10b es-p30r es-p30l\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"70%\" style=\"vertical-align: top;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n <tr>\n {-{-DESCRIPTION-}-}\n </tr>\n </tbody>\n </table>\n </td>\n <td align=\"right\" width=\"30%\" style=\"vertical-align: middle;\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioYes\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;>\n </td>\n {-{-YES-}-}\n </tr>\n </table>\n </td>\n <td width=\"50%\">\n <table width=\"100%\">\n <tr>\n <td width=\"24\">\n <input\n type=\"radio\"\n id=\"radioNo\"\n name=\"unsubscribe\"\n data-cke-editable=\"1\"\n style=\"margin: 0px; vertical-align: middle;\">\n </td>\n {-{-NO-}-}\n </tr>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
2
  /**
3
3
  * @returns The template for the default checkbox block
4
4
  */
@@ -1,10 +1,8 @@
1
- import { TextValueObject } from '@@/Types/generic';
2
- import { Control, ImmutableHtmlElementNode, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
1
+ import { Control, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
3
2
  interface TextInputProps {
4
3
  name: string;
5
4
  placeholder?: string;
6
5
  className?: string;
7
- disabled?: boolean;
8
6
  }
9
7
  interface LabelProps {
10
8
  text: string;
@@ -19,7 +17,10 @@ interface IconButtonProps {
19
17
  interface SelectProps {
20
18
  name: string;
21
19
  placeholder: string;
22
- options: TextValueObject[];
20
+ options: {
21
+ text: string;
22
+ value: string;
23
+ }[];
23
24
  className?: string;
24
25
  }
25
26
  interface CounterProps {
@@ -28,15 +29,6 @@ interface CounterProps {
28
29
  minValue?: number;
29
30
  step?: number;
30
31
  }
31
- interface RadioButtonProps {
32
- name: string;
33
- buttons: {
34
- text?: string;
35
- value: string;
36
- icon?: string;
37
- }[];
38
- id?: string;
39
- }
40
32
  interface ButtonProps {
41
33
  name: string;
42
34
  label: string;
@@ -48,33 +40,11 @@ interface ButtonProps {
48
40
  */
49
41
  export declare abstract class CommonControl extends Control {
50
42
  currentNode?: ImmutableHtmlNode;
51
- protected lastBlockInstanceId: string | null;
52
43
  abstract getId(): string;
53
44
  abstract getTemplate(): string;
54
45
  abstract onRender(): Promise<void> | void;
55
46
  getContainer(): ShadowRoot;
56
47
  onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
57
- onDestroy(): void;
58
- /**
59
- * Gets the config block element from the current node.
60
- * @returns The config block element or null if not found
61
- */
62
- protected getConfigBlock(): ImmutableHtmlElementNode | null;
63
- /**
64
- * Gets the current block instance ID from the config block.
65
- * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
66
- * @returns The block instance ID or null if not found
67
- */
68
- protected getBlockInstanceId(blockInstanceIdAttribute?: string): string | null;
69
- /**
70
- * Handles block instance change detection and syncing.
71
- * This is a helper method for controls that need to sync attributes when switching between block instances.
72
- * @param syncFunction - Function to call when block instance changes (to sync from attributes)
73
- * @param updateUI - Function to call to update the UI (called both on change and when same block)
74
- * @param blockInstanceIdAttribute - The attribute name for block instance ID (default: 'data-block-instance-id')
75
- * @returns true if block instance changed, false otherwise
76
- */
77
- protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
78
48
  _GuLabel({ text, name, position }: LabelProps): string;
79
49
  _GuToggle(name: string): string;
80
50
  _GuSelectItem({ text, value }: {
@@ -82,14 +52,8 @@ export declare abstract class CommonControl extends Control {
82
52
  value: string;
83
53
  }): string;
84
54
  _GuSelect({ name, placeholder, options, className }: SelectProps): string;
85
- _GuTextInput({ name, placeholder, className, disabled }: TextInputProps): string;
55
+ _GuTextInput({ name, placeholder, className }: TextInputProps): string;
86
56
  _GuCounter({ name, maxValue, minValue, step }: CounterProps): string;
87
- _GuRadioButtonItem({ text, value, icon }: {
88
- text?: string;
89
- value: string;
90
- icon?: string;
91
- }): string;
92
- _GuRadioButton({ name, buttons, id }: RadioButtonProps): string;
93
57
  _GuButton({ name, label, id }: ButtonProps): string;
94
58
  /**
95
59
  *
@@ -97,8 +61,7 @@ export declare abstract class CommonControl extends Control {
97
61
  * @returns It returns a button with an icon.
98
62
  */
99
63
  _GuIconButton({ name, icon, className }: IconButtonProps): string;
100
- _GuOneColumn(children: string[], className?: string): string;
101
- _GuTwoColumns(children: string[], className?: string): string;
64
+ _GuTwoColumns(children: string[]): string;
102
65
  /**
103
66
  * Creates an orderable (sortable) list control
104
67
  * @param name - The control name for value binding