@useinsider/guido 3.20.1-beta.49b58ed → 3.20.1-beta.55d63aa

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 (135) hide show
  1. package/README.md +1 -1
  2. package/dist/@types/config/schemas.js +38 -37
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/components/Guido.vue.js +6 -6
  5. package/dist/components/Guido.vue2.js +101 -112
  6. package/dist/components/organisms/AutoSaveController.vue2.js +9 -19
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +20 -0
  8. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +30 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +71 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +34 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +57 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  15. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  16. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  17. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  18. package/dist/components/organisms/header/EditorActions.vue2.js +72 -57
  19. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  20. package/dist/components/organisms/header/HeaderWrapper.vue2.js +17 -9
  21. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  22. package/dist/components/organisms/header/LeftSlot.vue2.js +23 -28
  23. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  24. package/dist/components/organisms/header/MiddleSlot.vue2.js +7 -8
  25. package/dist/components/organisms/header/RightSlot.vue.js +8 -9
  26. package/dist/components/organisms/header/RightSlot.vue2.js +18 -13
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +35 -60
  29. package/dist/composables/useBlocksConfig.js +32 -24
  30. package/dist/composables/useCustomInterfaceAppearance.js +41 -42
  31. package/dist/composables/useDisplayConditions.js +111 -0
  32. package/dist/composables/useLegacyStrategyConversion.js +16 -16
  33. package/dist/composables/useStripo.js +4 -3
  34. package/dist/config/i18n/en/labels.json.js +4 -36
  35. package/dist/config/i18n/en/tooltips.json.js +1 -2
  36. package/dist/enums/academy.js +1 -0
  37. package/dist/enums/display-condition.js +12 -0
  38. package/dist/extensions/Blocks/Items/block.js +43 -42
  39. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
  40. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +219 -205
  41. package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
  42. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
  43. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
  44. package/dist/extensions/DisplayConditions/bridge.js +17 -0
  45. package/dist/extensions/DisplayConditions/constants.js +17 -0
  46. package/dist/extensions/DisplayConditions/control.js +169 -0
  47. package/dist/extensions/DisplayConditions/display-conditions.css.js +201 -0
  48. package/dist/extensions/DisplayConditions/extension.js +28 -0
  49. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  50. package/dist/extensions/DisplayConditions/library.js +25 -0
  51. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  52. package/dist/guido.css +1 -1
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +272 -192
  54. package/dist/node_modules/valibot/dist/index.js +297 -261
  55. package/dist/package.json.js +1 -1
  56. package/dist/services/displayConditionApi.js +39 -0
  57. package/dist/sprite.svg +0 -10
  58. package/dist/src/@types/config/schemas.d.ts +4 -2
  59. package/dist/src/@types/display-condition.d.ts +59 -0
  60. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +1 -19
  61. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  62. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +19 -1
  63. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +19 -1
  64. package/dist/src/composables/useActionsApi.d.ts +2 -2
  65. package/dist/src/composables/useConfig.d.ts +2 -2
  66. package/dist/src/composables/useDisplayConditions.d.ts +16 -0
  67. package/dist/src/enums/academy.d.ts +1 -0
  68. package/dist/src/enums/display-condition.d.ts +15 -0
  69. package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
  70. package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
  71. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
  72. package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
  73. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
  74. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
  75. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
  76. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
  77. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +18 -3
  78. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
  79. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
  80. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
  81. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
  82. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
  84. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +8 -1
  85. package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
  86. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
  87. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
  88. package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
  89. package/dist/src/extensions/DisplayConditions/bridge.d.ts +6 -0
  90. package/dist/src/extensions/DisplayConditions/constants.d.ts +14 -0
  91. package/dist/src/extensions/DisplayConditions/control.d.ts +21 -0
  92. package/dist/src/extensions/DisplayConditions/extension.d.ts +2 -0
  93. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +4 -0
  94. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  95. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  96. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  97. package/dist/src/services/displayConditionApi.d.ts +9 -0
  98. package/dist/src/stores/autosave.d.ts +1 -73
  99. package/dist/src/stores/config.d.ts +20 -20
  100. package/dist/src/stores/display-condition.d.ts +81 -0
  101. package/dist/src/stores/editor.d.ts +0 -109
  102. package/dist/src/stores/onboarding.d.ts +21 -953
  103. package/dist/src/stores/version-history.d.ts +1 -1
  104. package/dist/src/utils/displayCondition.d.ts +4 -0
  105. package/dist/src/utils/protectTableText.d.ts +2 -0
  106. package/dist/src/utils/timeUtil.d.ts +0 -5
  107. package/dist/static/styles/components/button.css.js +5 -0
  108. package/dist/static/styles/variables.css.js +0 -2
  109. package/dist/stores/autosave.js +7 -12
  110. package/dist/stores/display-condition.js +28 -0
  111. package/dist/stores/editor.js +4 -7
  112. package/dist/stores/onboarding.js +21 -48
  113. package/dist/utils/displayCondition.js +21 -0
  114. package/dist/utils/pairProductVariables.js +15 -14
  115. package/dist/utils/protectTableText.js +22 -0
  116. package/dist/utils/timeUtil.js +17 -6
  117. package/package.json +3 -3
  118. package/dist/components/organisms/header/AutoSaveStatus.vue.js +0 -17
  119. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +0 -25
  120. package/dist/components/organisms/header/EditorActionsMenu.vue.js +0 -20
  121. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +0 -98
  122. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +0 -18
  123. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +0 -37
  124. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +0 -22
  125. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +0 -48
  126. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +0 -19
  127. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +0 -90
  128. package/dist/composables/useAccessibilityApi.js +0 -45
  129. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +0 -2
  130. package/dist/src/composables/useAccessibilityApi.d.ts +0 -13
  131. package/dist/static/styles/components/accessibility.css.js +0 -234
  132. /package/dist/src/components/organisms/{header/AutoSaveStatus.vue.d.ts → display-conditions/DisplayConditionCreateDrawer.vue.d.ts} +0 -0
  133. /package/dist/src/components/organisms/{header/EditorActionsMenu.vue.d.ts → display-conditions/DisplayConditionSelectDrawer.vue.d.ts} +0 -0
  134. /package/dist/src/components/organisms/{header/accessibility/AccessibilityToolbar.vue.d.ts → display-conditions/DisplayConditionsHost.vue.d.ts} +0 -0
  135. /package/dist/src/components/organisms/header/{accessibility/ColorVisionSelect.vue.d.ts → AutoSaveToggle.vue.d.ts} +0 -0
@@ -0,0 +1,111 @@
1
+ import { useToaster as x } from "./useToaster.js";
2
+ import { useTranslations as M } from "./useTranslations.js";
3
+ import { DISPLAY_CONDITION_LIMITS as r, DisplayConditionEvent as E } from "../enums/display-condition.js";
4
+ import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
+ import { useDisplayConditionApi as N } from "../services/displayConditionApi.js";
6
+ import { useConfigStore as T } from "../stores/config.js";
7
+ import { useDisplayConditionStore as _ } from "../stores/display-condition.js";
8
+ import { parseSource as O, findInvalidCodeFields as B } from "../utils/displayCondition.js";
9
+ import { escapeHtml as L } from "../utils/htmlEscape.js";
10
+ import { computed as X } from "vue";
11
+ const i = "email-editor.display-conditions", y = (n, f, a) => ({
12
+ id: f,
13
+ name: n.name.trim(),
14
+ description: n.description.trim(),
15
+ beforeScript: n.codeBefore,
16
+ afterScript: n.codeAfter,
17
+ extraData: JSON.stringify({ source: a })
18
+ }), Q = () => {
19
+ const n = _(), f = T(), a = N(), o = M(), { showToaster: c } = x(), p = X(() => {
20
+ var e;
21
+ return (e = f.features) != null && e.liquidSyntax ? "liquid" : "pongo";
22
+ }), v = (e) => {
23
+ const t = { condition: e };
24
+ document.dispatchEvent(new CustomEvent(E.APPLY, { detail: t })), n.close();
25
+ }, g = () => {
26
+ n.view !== "none" && (document.dispatchEvent(new CustomEvent(E.CANCEL)), n.close());
27
+ }, C = (e) => {
28
+ if (e.mode === "select") {
29
+ n.openSelect();
30
+ return;
31
+ }
32
+ n.openCreate(e.mode === "edit" ? e.current : null);
33
+ }, $ = async () => {
34
+ n.listStatus = "loading";
35
+ try {
36
+ const e = await a.list(p.value);
37
+ n.list = e.data, n.listStatus = "loaded";
38
+ } catch (e) {
39
+ console.warn("Display conditions could not be loaded.", e), n.listStatus = "error";
40
+ }
41
+ }, h = (e, t) => {
42
+ const s = {}, u = e.name.trim();
43
+ t === "save" && !u ? s.name = o(`${i}.error-name-required`) : u && u.length < r.NAME_MIN ? s.name = o(`${i}.error-name-min`, { min: r.NAME_MIN }) : u.length > r.NAME_MAX && (s.name = o(`${i}.error-name-max`, { max: r.NAME_MAX }));
44
+ const { DESCRIPTION_MAX: S } = r;
45
+ e.description.trim().length > S && (s.description = o(`${i}.error-description-max`, { max: S }));
46
+ const I = B(e.codeBefore, e.codeAfter);
47
+ return ["codeBefore", "codeAfter"].forEach((d) => {
48
+ e[d].trim() ? I.includes(d) ? s[d] = o(`${i}.error-code-invalid`) : e[d].length > r.CODE_MAX && (s[d] = o(`${i}.error-code-max`, { max: r.CODE_MAX })) : s[d] = o(`${i}.error-code-required`);
49
+ }), s;
50
+ }, D = () => {
51
+ c({ type: l.Error, message: o(`${i}.validation-failed`) });
52
+ }, m = (e) => ({ name: L(e) }), A = (e, t) => {
53
+ e != null && e.authReported || (console.warn(t, e), c({ type: l.Error, message: t }));
54
+ };
55
+ return {
56
+ syntax: p,
57
+ handleOpen: C,
58
+ cancel: g,
59
+ loadList: $,
60
+ validate: h,
61
+ notifyInvalid: D,
62
+ createInline: (e) => {
63
+ const t = n.editing && O(n.editing) === "inline" ? n.editing.id : Date.now();
64
+ v(y(e, t, "inline")), c({
65
+ type: l.Success,
66
+ message: o(`${i}.created`, m(e.name.trim()))
67
+ });
68
+ },
69
+ createAndSave: async (e) => {
70
+ try {
71
+ if (await a.nameExists(e.name, p.value))
72
+ return { name: o(`${i}.error-name-exists`) };
73
+ const t = await a.create(e, p.value);
74
+ return n.list = [t, ...n.list.filter((s) => s.id !== t.id)], v(y({
75
+ name: t.name,
76
+ description: t.description,
77
+ codeBefore: t.codeBefore,
78
+ codeAfter: t.codeAfter
79
+ }, t.id, "saved")), c({
80
+ type: l.Success,
81
+ message: o(`${i}.created-and-saved`, m(t.name))
82
+ }), {};
83
+ } catch (t) {
84
+ return A(t, o(`${i}.save-failed`, m(e.name.trim()))), null;
85
+ }
86
+ },
87
+ select: (e) => {
88
+ v(y({
89
+ name: e.name,
90
+ description: e.description,
91
+ codeBefore: e.codeBefore,
92
+ codeAfter: e.codeAfter
93
+ }, e.id, "saved")), c({ type: l.Success, message: o(`${i}.applied`, m(e.name)) });
94
+ },
95
+ deleteSaved: async (e) => {
96
+ try {
97
+ await a.remove(e.id), n.list = n.list.filter((t) => t.id !== e.id), c({
98
+ type: l.Success,
99
+ message: o(`${i}.deleted`, m(e.name))
100
+ });
101
+ } catch (t) {
102
+ A(t, o(`${i}.delete-failed`));
103
+ } finally {
104
+ n.pendingDelete = null;
105
+ }
106
+ }
107
+ };
108
+ };
109
+ export {
110
+ Q as useDisplayConditions
111
+ };
@@ -1,34 +1,34 @@
1
- import { useRecommendation as C } from "./useRecommendation.js";
1
+ import { useRecommendation as S } from "./useRecommendation.js";
2
2
  import { useToaster as I } from "./useToaster.js";
3
3
  import { useTranslations as v } from "./useTranslations.js";
4
4
  import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
5
  import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
6
  import { CURRENT_CONFIG_VERSION as L } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
- import { useRecommendationExtensionStore as b } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { resolveMigrationTarget as k, buildLegacyMigrationPayload as R } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
7
+ import { useRecommendationExtensionStore as R } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
+ import { resolveMigrationTarget as b, buildLegacyMigrationPayload as k } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
9
  import { commitBlockChangeOutsidePanel as T } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
10
  import { useConfigStore as h } from "../stores/config.js";
11
11
  const F = () => {
12
- const e = b(), r = h(), { buildCampaignUrl: m } = C(), { showToaster: c } = I(), a = v();
12
+ const e = R(), o = h(), { buildCampaignUrl: m } = S(), { showToaster: c } = I(), a = v();
13
13
  return { convertLegacyStrategy: async () => {
14
14
  const t = e.currentRecommendationId;
15
15
  if (t === null || !e.isLegacyStrategyBlock || e.legacyConversionLoading)
16
16
  return "";
17
- const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = k({
18
- campaignId: r.campaignId,
19
- templateLibraryId: r.templateLibraryId
20
- }), S = R({
17
+ const { strategy: d, productIds: y, size: l, strategyId: p, nodeConfigVersion: u } = e.recommendationConfigs, f = { strategyId: p, size: l, nodeConfigVersion: u }, s = b({
18
+ campaignId: o.campaignId,
19
+ templateLibraryId: o.templateLibraryId
20
+ }), C = k({
21
21
  blockId: t,
22
22
  url: m(String(t)),
23
- campaignId: r.campaignId,
24
- variationId: r.variationId,
23
+ campaignId: o.campaignId,
24
+ variationId: o.variationId,
25
25
  strategy: d,
26
26
  productIds: y,
27
27
  target: s
28
28
  });
29
- let o;
29
+ let r;
30
30
  try {
31
- o = await e.convertLegacyStrategy(S, s);
31
+ r = await e.convertLegacyStrategy(C, s);
32
32
  } catch (i) {
33
33
  return console.error("[useLegacyStrategyConversion] migration failed", i), c({
34
34
  type: g.Error,
@@ -40,7 +40,7 @@ const F = () => {
40
40
  }), "";
41
41
  }
42
42
  try {
43
- await e.fetchStrategyProductsForBlock(t);
43
+ await e.fetchRecommendationProductsForBlock(t);
44
44
  } catch (i) {
45
45
  console.error("[useLegacyStrategyConversion] product refetch failed", i);
46
46
  }
@@ -48,16 +48,16 @@ const F = () => {
48
48
  return n ? T(
49
49
  t,
50
50
  {
51
- strategyId: o,
51
+ strategyId: r,
52
52
  size: n.recommendationConfigs.size,
53
53
  configVersion: L
54
54
  },
55
55
  n.recommendationProducts,
56
56
  "Converted legacy recommendation strategy"
57
- ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), o) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
57
+ ) ? (e.currentRecommendationId === t && e.openLegacyStrategyUpdatedModal(), r) : (console.error("[useLegacyStrategyConversion] node write failed", t), e.revertLegacyConversion(t, f), c({
58
58
  type: g.Error,
59
59
  message: a("email-editor.legacy-strategy-update-failed")
60
- }), "") : o;
60
+ }), "") : r;
61
61
  } };
62
62
  };
63
63
  export {
@@ -31,13 +31,13 @@ const he = () => {
31
31
  n = null;
32
32
  }), n), D = async (r, s, o, a = [], i = !1) => {
33
33
  var y, E, h, C;
34
- const e = k(), { html: d, css: R } = r, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
34
+ const e = k(), { html: d, css: P } = r, { baseBlocks: g, extensions: R } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
35
35
  w().importCss(), await window.UIEditor.initEditor(
36
36
  document.querySelector("#guido-editor"),
37
37
  {
38
38
  metadata: s,
39
39
  html: d,
40
- css: R,
40
+ css: P,
41
41
  forceRecreate: I,
42
42
  locale: "en",
43
43
  undoButtonSelector: "#guido__undo-button",
@@ -60,6 +60,7 @@ const he = () => {
60
60
  keepModuleStylesEnabled: !0,
61
61
  displayTitle: !1,
62
62
  displayUTM: !1,
63
+ copyPasteEnabled: !1,
63
64
  selectElementAfterDrop: !0,
64
65
  sameFontSizeForOutlook: !0,
65
66
  allowedScriptSourceDomains: q,
@@ -120,7 +121,7 @@ const he = () => {
120
121
  ".in-modal-v2-wrapper",
121
122
  ".in-toasts-wrapper"
122
123
  ],
123
- extensions: P,
124
+ extensions: R,
124
125
  localePatch: J
125
126
  }
126
127
  );
@@ -1,51 +1,19 @@
1
- const e = "Items", o = "Default", i = "Custom", t = {
1
+ const e = "Items", o = "Default", t = "Custom", s = {
2
2
  "Global Styles & Layout": "Global Styles and Layout",
3
3
  "Structures & Modules": "Structures and Modules",
4
4
  "Recommendation Block": "Recommendation Block",
5
5
  Items: e,
6
6
  "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
7
7
  "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
8
- "email-editor.a11y-hide-images": "Hide images",
9
- "email-editor.a11y-show-images": "Show images",
10
- "email-editor.cvd-none": "No Color Deficiency",
11
- "email-editor.cvd-protanopia": "Protanopia",
12
- "email-editor.cvd-protanopia-description": "Causes red-green confusion and makes reds appear darker.",
13
- "email-editor.cvd-deuteranopia": "Deuteranopia",
14
- "email-editor.cvd-deuteranopia-description": "Causes red-green confusion.",
15
- "email-editor.cvd-tritanopia": "Tritanopia",
16
- "email-editor.cvd-tritanopia-description": "Causes blue-yellow confusion.",
17
- "email-editor.cvd-achromatopsia": "Achromatopsia",
18
- "email-editor.cvd-achromatopsia-description": "Causes complete color blindness.",
19
- "email-editor.more-actions": "More actions",
20
- "email-editor.preferences": "Preferences",
21
- "email-editor.actions": "Actions",
22
- "email-editor.accessibility-test": "Accessibility Test",
23
- "email-editor.autosaved-at-today": "{boldStart}Autosaved{boldEnd} at {time}, Today",
24
- "email-editor.autosaved-at-date": "{boldStart}Autosaved{boldEnd} at {date}",
25
- "email-editor.export-html": "Export HTML",
26
- "email-editor.onboarding-kebab-title": "Discover Preferences and Actions",
27
- "email-editor.onboarding-kebab-description": "You can now access your Preferences and Actions easily such as Autosave, Export HTML, Version History, Accessibility Test and Save As Template.",
28
- "email-editor.onboarding-autosave-title": "Autosave Your Design",
29
- "email-editor.onboarding-autosave-description": "You can save your design automatically by enabling Autosave without losing your work.",
30
- "email-editor.onboarding-accessibility-title": "Test Accessibility of Your Design",
31
- "email-editor.onboarding-accessibility-description": "You can test the accessibility of your design to see the Failed, Passed items and update the Failed ones accordingly.",
32
8
  "Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
33
9
  "OPT-IN SELECTION": "OPT-IN SELECTION",
34
10
  "UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS",
35
11
  Default: o,
36
- Custom: i,
37
- "Foreground color": "Foreground Color",
38
- "Contrast ratio": "Contrast Ratio",
39
- "You’ve fixed all issues!": `No Failed Items
40
- You have no failed items.`,
41
- "No accessibility issues found": `No Failed Items
42
- You have no failed items.`,
43
- "You have no ignored issues yet": `No Ignored Items
44
- You have no ignored items.`
12
+ Custom: t
45
13
  };
46
14
  export {
47
- i as Custom,
15
+ t as Custom,
48
16
  o as Default,
49
17
  e as Items,
50
- t as default
18
+ s as default
51
19
  };
@@ -76,8 +76,7 @@ const e = {
76
76
  "The data source link is unavailable. Please, make sure there is an access to the data source.": "Enter an accessible Data Source Link to contiue.",
77
77
  "The file should not exceed the maximum resolution of {maxImageResolution}px.": "Upload files up to 1024x512 pixels to continue.",
78
78
  "The option is disabled because was overridden in the Code editor": "The option is disabled because it was overridden in the Code Editor.",
79
- "Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit.",
80
- 'Read more about the issue on <a target="_blank" rel="noopener noreferrer" href="{url}">ACT Rules Community Group forum</a>': 'Read more about the issue on <a target="_blank" rel="noopener noreferrer" href="{url}">ACT Rules Community Group forum.</a>'
79
+ "Dropdown with a list of available data services, preliminarily created in the Data section → Services tab of the Account.": "Service for Data Collection lets you enter a form submission URL for the recipients to submit."
81
80
  };
82
81
  export {
83
82
  e as default
@@ -2,6 +2,7 @@ const e = "https://academy.insiderone.com", o = {
2
2
  EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
3
3
  GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
4
  AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
5
+ EMAIL_DISPLAY_CONDITIONS: `${e}/docs/new-editor-add-display-conditions-to-an-email`,
5
6
  EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`
6
7
  };
7
8
  export {
@@ -0,0 +1,12 @@
1
+ var N = /* @__PURE__ */ ((I) => (I.OPEN = "display-condition:open", I.APPLY = "display-condition:apply", I.CANCEL = "display-condition:cancel", I))(N || {}), A = /* @__PURE__ */ ((I) => (I.INLINE = "inline", I.SAVED = "saved", I))(A || {});
2
+ const M = {
3
+ NAME_MIN: 2,
4
+ NAME_MAX: 40,
5
+ DESCRIPTION_MAX: 200,
6
+ CODE_MAX: 65535
7
+ };
8
+ export {
9
+ M as DISPLAY_CONDITION_LIMITS,
10
+ N as DisplayConditionEvent,
11
+ A as DisplayConditionSourceType
12
+ };
@@ -1,6 +1,6 @@
1
1
  var k = Object.defineProperty;
2
- var S = (d, l, e) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[l] = e;
3
- var g = (d, l, e) => S(d, typeof l != "symbol" ? l + "" : l, e);
2
+ var S = (d, l, t) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[l] = t;
3
+ var g = (d, l, t) => S(d, typeof l != "symbol" ? l + "" : l, t);
4
4
  import { BlockId as D } from "../../../enums/block.js";
5
5
  import { useOnboardingStore as T } from "../../../stores/onboarding.js";
6
6
  import { getMigrationBannerHtml as N } from "../../../utils/migrationBannerHtml.js";
@@ -58,15 +58,15 @@ class $ extends H {
58
58
  canBeSavedAsModule() {
59
59
  return !0;
60
60
  }
61
- onCreated(e) {
62
- const t = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
- c.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
- const r = _(e);
61
+ onCreated(t) {
62
+ const e = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
63
+ c.querySelector('[product-attr="imageSrc"] img') || e.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
64
+ const r = _(t);
65
65
  if (!r)
66
66
  return;
67
- const o = r.getNodeConfig(), s = o && Object.keys(o).length > 0, i = C(e);
67
+ const o = r.getNodeConfig(), n = o && Object.keys(o).length > 0, i = C(t);
68
68
  if (i != null && i.initialized) {
69
- if (!s) {
69
+ if (!n) {
70
70
  const a = this.api.getDocumentModifier();
71
71
  a.modifyHtml(r).setNodeConfig(i), this._stampProductTdDomAttributes(r, i, a), this._healCollapsedWidths(r, a), this._shouldReconcileCurrency(i) && this._reconcileCurrencyDomAttributes(r, i, a), a.apply(new u("Migrate legacy config to nodeConfig")), this._markCurrencyHealed(i.blockInstanceId);
72
72
  return;
@@ -76,9 +76,9 @@ class $ extends H {
76
76
  I.modifyHtml(r).setNodeConfig(a), this._stampProductTdDomAttributes(r, a, I, !0), I.apply(new u("Initialize Items block with default configuration")), T().startOnboarding("itemsOnboarding");
77
77
  return;
78
78
  }
79
- const n = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
79
+ const s = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
80
80
  let h = !1;
81
- n !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: n }), h = !0), !this._currencyHealed.has(n) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(n);
81
+ s !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: s }), h = !0), !this._currencyHealed.has(s) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(s);
82
82
  }
83
83
  /**
84
84
  * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
@@ -86,24 +86,24 @@ class $ extends H {
86
86
  * into nodeConfig, so without this a reused module would reset to defaults.
87
87
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
88
88
  */
89
- onDocumentChanged(e) {
90
- const t = _(e);
91
- if (!t)
89
+ onDocumentChanged(t) {
90
+ const e = _(t);
91
+ if (!e)
92
92
  return;
93
- const c = t.getNodeConfig();
93
+ const c = e.getNodeConfig();
94
94
  if (c && Object.keys(c).length > 0) {
95
- const i = C(e);
95
+ const i = C(t);
96
96
  if (i != null && i.initialized && this._shouldReconcileCurrency(i)) {
97
- const n = this.api.getDocumentModifier();
98
- this._reconcileCurrencyDomAttributes(t, i, n) && n.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
97
+ const s = this.api.getDocumentModifier();
98
+ this._reconcileCurrencyDomAttributes(e, i, s) && s.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
99
99
  }
100
100
  return;
101
101
  }
102
- const o = C(e);
102
+ const o = C(t);
103
103
  if (!(o != null && o.initialized))
104
104
  return;
105
- const s = this.api.getDocumentModifier();
106
- s.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, s), this._healCollapsedWidths(t, s), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(t, o, s), s.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
105
+ const n = this.api.getDocumentModifier();
106
+ n.modifyHtml(e).setNodeConfig(o), this._stampProductTdDomAttributes(e, o, n), this._healCollapsedWidths(e, n), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(e, o, n), n.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
107
107
  }
108
108
  /**
109
109
  * Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
@@ -113,20 +113,21 @@ class $ extends H {
113
113
  * restored before export. The name `<a>` carries no data-type/data-number of its own and
114
114
  * relies on this td-level fallback in pairProductVariables.
115
115
  */
116
- _stampProductTdDomAttributes(e, t, c, r = !1) {
117
- const o = B(t.itemsSelectValue, t.type), s = (i, n) => {
118
- r && e.getAttribute(i) || c.modifyHtml(e).setAttribute(i, n);
116
+ _stampProductTdDomAttributes(t, e, c, r = !1) {
117
+ const o = B(e.itemsSelectValue, e.type), n = (i, s) => {
118
+ r && t.getAttribute(i) || c.modifyHtml(t).setAttribute(i, s);
119
119
  };
120
- s("data-type", t.type), s("data-number", o), s("data-nodup", String(t.priceHideDiscount));
120
+ n("data-type", e.type), n("data-number", o), n("data-nodup", String(e.priceHideDiscount));
121
121
  }
122
122
  /**
123
123
  * Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
124
124
  * on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
125
125
  */
126
- _healCollapsedWidths(e, t) {
127
- const r = e.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
- return !m(e.getAttribute("width")) && !r.length ? !1 : (e.hasClass("esd-container-frame") && t.modifyHtml(e).removeClass("esd-container-frame"), e.getAttribute("width") !== null && t.modifyHtml(e).removeAttribute("width"), r.forEach((o) => {
129
- m(o.getAttribute("width")) && t.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && t.modifyHtml(o).setStyle("width", "100%");
126
+ _healCollapsedWidths(t, e) {
127
+ const r = t.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
128
+ return !m(t.getAttribute("width")) && !r.length ? !1 : (t.hasClass("esd-container-frame") && e.modifyHtml(t).removeClass("esd-container-frame"), t.getAttribute("width") !== null && e.modifyHtml(t).removeAttribute("width"), r.forEach((o) => {
129
+ const n = o.getAttribute("width");
130
+ (n === null || m(n)) && e.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && e.modifyHtml(o).setStyle("width", "100%");
130
131
  }), !0);
131
132
  }
132
133
  /**
@@ -137,12 +138,12 @@ class $ extends H {
137
138
  * the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
138
139
  * on symbol customization here, or a default-symbol block with a toggled location never heals.
139
140
  */
140
- _shouldReconcileCurrency(e) {
141
- return !e.blockInstanceId || !this._currencyHealed.has(e.blockInstanceId);
141
+ _shouldReconcileCurrency(t) {
142
+ return !t.blockInstanceId || !this._currencyHealed.has(t.blockInstanceId);
142
143
  }
143
144
  /** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
144
- _markCurrencyHealed(e) {
145
- e && this._currencyHealed.add(e);
145
+ _markCurrencyHealed(t) {
146
+ t && this._currencyHealed.add(t);
146
147
  }
147
148
  /**
148
149
  * Resolves the id for a just-created block to one that is unique per live instance.
@@ -151,13 +152,13 @@ class $ extends H {
151
152
  * currency heal guard and settings-panel switch detection. Mint a fresh id on absence
152
153
  * or collision, otherwise keep the existing one. Registers the result as claimed.
153
154
  */
154
- _resolveInstanceId(e) {
155
- let t = e;
156
- if (!t || this._seenInstanceIds.has(t))
155
+ _resolveInstanceId(t) {
156
+ let e = t;
157
+ if (!e || this._seenInstanceIds.has(e))
157
158
  do
158
- t = P();
159
- while (this._seenInstanceIds.has(t));
160
- return this._seenInstanceIds.add(t), t;
159
+ e = P();
160
+ while (this._seenInstanceIds.has(e));
161
+ return this._seenInstanceIds.add(e), e;
161
162
  }
162
163
  /**
163
164
  * Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
@@ -170,11 +171,11 @@ class $ extends H {
170
171
  * Returns true only when an attr actually changed, so the caller can skip an empty apply that
171
172
  * would otherwise re-trigger onDocumentChanged and loop.
172
173
  */
173
- _reconcileCurrencyDomAttributes(e, t, c) {
174
- const { position: r, symbol: o } = w(t), s = e.querySelectorAll(`.${E.PRICE} p`);
174
+ _reconcileCurrencyDomAttributes(t, e, c) {
175
+ const { position: r, symbol: o } = w(e), n = t.querySelectorAll(`.${E.PRICE} p`);
175
176
  let i = !1;
176
- return s.forEach((n) => {
177
- r !== void 0 && n.getAttribute(y.POSITION) !== r && (c.modifyHtml(n).setAttribute(y.POSITION, r), i = !0), o !== void 0 && n.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(n).setAttribute(y.SYMBOL, o), i = !0);
177
+ return n.forEach((s) => {
178
+ r !== void 0 && s.getAttribute(y.POSITION) !== r && (c.modifyHtml(s).setAttribute(y.POSITION, r), i = !0), o !== void 0 && s.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(s).setAttribute(y.SYMBOL, o), i = !0);
178
179
  }), i;
179
180
  }
180
181
  }