@useinsider/guido 1.0.3-beta.e9bec65 → 1.0.3-beta.ef63ed1

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 (183) hide show
  1. package/README.md +3 -147
  2. package/dist/components/Guido.vue.js +9 -11
  3. package/dist/components/Guido.vue2.js +74 -81
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  9. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  11. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  12. package/dist/composables/useGuidoActions.js +9 -19
  13. package/dist/composables/useStripo.js +55 -48
  14. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  15. package/dist/config/migrator/index.js +6 -7
  16. package/dist/enums/defaults.js +8 -16
  17. package/dist/enums/onboarding.js +1 -2
  18. package/dist/enums/unsubscribe.js +25 -27
  19. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  20. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  21. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  22. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  23. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  24. package/dist/guido.css +1 -1
  25. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -311
  26. package/dist/package.json.js +1 -1
  27. package/dist/services/stripoApi.js +1 -1
  28. package/dist/src/@types/generic.d.ts +4 -44
  29. package/dist/src/components/Guido.vue.d.ts +2 -4
  30. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  31. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  32. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  33. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  34. package/dist/src/enums/onboarding.d.ts +0 -1
  35. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  36. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  37. package/dist/src/stores/config.d.ts +2 -10
  38. package/dist/src/stores/dynamic-content.d.ts +3 -3
  39. package/dist/src/stores/editor.d.ts +1 -22
  40. package/dist/src/stores/onboarding.d.ts +1 -1
  41. package/dist/src/stores/preview.d.ts +1 -1
  42. package/dist/src/stores/recommendation.d.ts +1 -1
  43. package/dist/src/stores/save-as-template.d.ts +1 -1
  44. package/dist/src/stores/toaster.d.ts +1 -1
  45. package/dist/src/stores/unsubscribe.d.ts +1 -1
  46. package/dist/src/stores/version-history.d.ts +1 -1
  47. package/dist/src/utils/dateUtil.d.ts +0 -21
  48. package/dist/src/utils/genericUtil.d.ts +0 -2
  49. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  50. package/dist/static/styles/customEditorStyle.css.js +0 -5
  51. package/dist/stores/config.js +5 -5
  52. package/dist/stores/dynamic-content.js +2 -2
  53. package/dist/stores/editor.js +2 -3
  54. package/dist/stores/onboarding.js +27 -27
  55. package/dist/stores/preview.js +1 -1
  56. package/dist/stores/recommendation.js +3 -3
  57. package/dist/stores/save-as-template.js +2 -2
  58. package/dist/stores/toaster.js +1 -1
  59. package/dist/stores/unsubscribe.js +1 -1
  60. package/dist/stores/version-history.js +4 -4
  61. package/dist/utils/dateUtil.js +3 -24
  62. package/dist/utils/genericUtil.js +11 -23
  63. package/package.json +5 -5
  64. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  65. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  66. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  67. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  68. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  69. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  70. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  71. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  72. package/dist/composables/useBlocksConfig.js +0 -49
  73. package/dist/config/migrator/recommendationMigrator.js +0 -293
  74. package/dist/enums/date.js +0 -6
  75. package/dist/enums/extensions/recommendationBlock.js +0 -80
  76. package/dist/extensions/Blocks/Recommendation/block.js +0 -30
  77. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
  78. package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
  79. package/dist/extensions/Blocks/Recommendation/control.js +0 -306
  80. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
  81. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
  82. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
  83. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
  84. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
  85. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
  86. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
  87. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
  88. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
  89. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
  90. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
  91. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
  92. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
  93. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
  94. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
  95. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
  96. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
  97. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
  98. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
  99. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
  100. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
  101. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
  102. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
  103. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
  104. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
  105. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
  106. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
  107. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
  108. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
  109. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
  110. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
  111. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
  112. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
  113. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
  114. package/dist/extensions/Blocks/Recommendation/extension.js +0 -45
  115. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  116. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  117. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -117
  118. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  119. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -160
  120. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -152
  121. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -180
  122. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  123. package/dist/extensions/Blocks/common-control.js +0 -184
  124. package/dist/services/recommendationApi.js +0 -43
  125. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  126. package/dist/src/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
  127. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
  128. package/dist/src/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  129. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  130. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  131. package/dist/src/enums/date.d.ts +0 -4
  132. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -16
  133. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -11
  134. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
  135. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -51
  136. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -35
  137. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
  138. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
  139. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
  140. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
  141. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
  142. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
  143. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
  144. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
  145. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
  146. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
  147. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
  148. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
  149. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
  150. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
  151. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
  152. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
  153. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
  154. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
  155. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
  156. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
  157. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
  158. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
  159. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
  160. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
  161. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
  162. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
  163. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
  164. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
  165. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
  166. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
  167. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
  168. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
  169. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
  170. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
  171. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -2
  172. package/dist/src/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  173. package/dist/src/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
  174. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  175. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  176. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  177. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -44
  178. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  179. package/dist/src/extensions/Blocks/common-control.d.ts +0 -87
  180. package/dist/src/mock/api/recommendation.d.ts +0 -2
  181. package/dist/src/services/recommendationApi.d.ts +0 -6
  182. package/dist/src/utils/environmentUtil.d.ts +0 -5
  183. package/dist/utils/environmentUtil.js +0 -4
@@ -1,8 +1,8 @@
1
1
  import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
2
2
  import { defineStore as a } from "pinia";
3
- const s = a("guidoDynamicContent", {
3
+ const s = a("dynamicContent", {
4
4
  state: () => ({
5
- selectedDynamicContent: { text: "", value: "" },
5
+ selectedDynamicContent: { text: "", value: "", fallback: "" },
6
6
  selectedDynamicContentList: []
7
7
  }),
8
8
  actions: {
@@ -1,5 +1,5 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = e("guidoEditor", {
2
+ const o = e("editor", {
3
3
  state: () => ({
4
4
  loadingStatus: !0,
5
5
  isCodeEditorOpen: !1,
@@ -8,8 +8,7 @@ const o = e("guidoEditor", {
8
8
  isPreviewModeOpen: !1,
9
9
  editorVisualMode: "desktop",
10
10
  hasChanges: !1,
11
- isStripoInitialized: !1,
12
- templateId: ""
11
+ isStripoInitialized: !1
13
12
  }),
14
13
  getters: {
15
14
  // Middle Slot
@@ -14,41 +14,41 @@ const e = () => ({
14
14
  },
15
15
  userModalState: {},
16
16
  isFetched: !1
17
- }), c = s("guidoOnboarding", {
17
+ }), g = s("onboarding", {
18
18
  state: () => a(),
19
19
  getters: {
20
- getOnboarding: (n) => (i) => n.onboardings[i],
21
- isActive: (n) => (i) => n.onboardings[i].isActive,
22
- getCurrentCard: (n) => (i) => {
23
- const o = n.onboardings[i];
24
- return o.config[o.cardIndex];
20
+ getOnboarding: (n) => (o) => n.onboardings[o],
21
+ isActive: (n) => (o) => n.onboardings[o].isActive,
22
+ getCurrentCard: (n) => (o) => {
23
+ const i = n.onboardings[o];
24
+ return i.config[i.cardIndex];
25
25
  },
26
26
  getGenericCurrentCard: (n) => {
27
- const { genericOnboarding: i } = n.onboardings;
28
- return i.config[i.cardIndex];
27
+ const { genericOnboarding: o } = n.onboardings;
28
+ return o.config[o.cardIndex];
29
29
  },
30
30
  getTextBlockCurrentCard: (n) => {
31
- const { textBlockOnboarding: i } = n.onboardings;
32
- return i.config[i.cardIndex];
31
+ const { textBlockOnboarding: o } = n.onboardings;
32
+ return o.config[o.cardIndex];
33
33
  },
34
34
  getVersionHistoryCurrentCard: (n) => {
35
- const { versionHistoryOnboarding: i } = n.onboardings;
36
- return i.config[i.cardIndex];
35
+ const { versionHistoryOnboarding: o } = n.onboardings;
36
+ return o.config[o.cardIndex];
37
37
  },
38
38
  getAmpCurrentCard: (n) => {
39
- const { ampOnboarding: i } = n.onboardings;
40
- return i.config[i.cardIndex];
39
+ const { ampOnboarding: o } = n.onboardings;
40
+ return o.config[o.cardIndex];
41
41
  },
42
- shouldShowOnboarding: (n) => (i) => {
43
- const o = n.userModalState.Guido;
44
- return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
42
+ shouldShowOnboarding: (n) => (o) => {
43
+ const i = n.userModalState.Guido;
44
+ return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
45
45
  }
46
46
  },
47
47
  actions: {
48
48
  closeOtherOnboardings(n) {
49
- Object.keys(this.onboardings).forEach((i) => {
50
- const o = i;
51
- o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
49
+ Object.keys(this.onboardings).forEach((o) => {
50
+ const i = o;
51
+ i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
52
52
  });
53
53
  },
54
54
  start(n) {
@@ -63,8 +63,8 @@ const e = () => ({
63
63
  previous(n) {
64
64
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
65
65
  },
66
- setConfig(n, i) {
67
- this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
66
+ setConfig(n, o) {
67
+ this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
68
68
  },
69
69
  async onDiscoverNowClicked() {
70
70
  await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
@@ -81,15 +81,15 @@ const e = () => ({
81
81
  async fetchUserModalState() {
82
82
  if (this.isFetched)
83
83
  return;
84
- const { fetchUserModalState: n } = t(), i = await n();
85
- this.userModalState = i, this.isFetched = !0;
84
+ const { fetchUserModalState: n } = t(), o = await n();
85
+ this.userModalState = o, this.isFetched = !0;
86
86
  },
87
- async setUserModalState(n, i, o) {
87
+ async setUserModalState(n, o, i) {
88
88
  const { setUserModalState: r } = t();
89
- await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
89
+ await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
90
90
  }
91
91
  }
92
92
  });
93
93
  export {
94
- c as useOnboardingStore
94
+ g as useOnboardingStore
95
95
  };
@@ -6,7 +6,7 @@ const s = () => ({
6
6
  templateHtml: "",
7
7
  isLoaded: !1,
8
8
  isAMPErrorModalVisible: !1
9
- }), a = e("guidoPreview", {
9
+ }), a = e("preview", {
10
10
  state: () => s(),
11
11
  getters: {
12
12
  isAMPModeEnabled: (t) => t.emailFormat === "AMP",
@@ -1,8 +1,8 @@
1
1
  import { defineStore as e } from "pinia";
2
- const o = () => ({
2
+ const t = () => ({
3
3
  recommendationConfigs: []
4
- }), n = e("guidoRecommendation", {
5
- state: () => o()
4
+ }), n = e("recommendation", {
5
+ state: () => t()
6
6
  });
7
7
  export {
8
8
  n as useRecommendationStore
@@ -17,7 +17,7 @@ const r = () => ({
17
17
  editor: 2,
18
18
  message: 1
19
19
  }
20
- }), g = i("guidoSaveAsTemplate", {
20
+ }), n = i("saveAsTemplate", {
21
21
  state: () => r(),
22
22
  getters: {
23
23
  getTemplateName: (e) => e.templateName.trim(),
@@ -44,5 +44,5 @@ const r = () => ({
44
44
  }
45
45
  });
46
46
  export {
47
- g as useSaveAsTemplateStore
47
+ n as useSaveAsTemplateStore
48
48
  };
@@ -8,7 +8,7 @@ const a = () => ({
8
8
  withIcon: !0,
9
9
  withoutLeftMargin: !1,
10
10
  actionButton: void 0
11
- }), u = i("guidoToaster", {
11
+ }), u = i("toaster", {
12
12
  state: () => a(),
13
13
  getters: {
14
14
  shouldAutoHide: (t) => t.status && !!t.text
@@ -12,7 +12,7 @@ const p = () => ({
12
12
  typeSelectionDrawerStatus: !1,
13
13
  isGlobalUnsubscribeDisabled: !1,
14
14
  isSubscriptionPreferencesCenterDisabled: !1
15
- }), g = d("guidoUnsubscribe", {
15
+ }), g = d("unsubscribe", {
16
16
  state: () => p(),
17
17
  getters: {
18
18
  getSelectedCollection: (e) => i[e.selectedCollectionType],
@@ -5,13 +5,13 @@ const e = () => ({
5
5
  description: "",
6
6
  authorId: "",
7
7
  authorName: ""
8
- }), i = () => ({
8
+ }), r = () => ({
9
9
  previousPatch: e(),
10
10
  currentPatch: e(),
11
11
  nextPatch: e(),
12
12
  editorVisualMode: "desktop"
13
- }), r = a("guidoVersionHistory", {
14
- state: () => i(),
13
+ }), o = a("versionHistory", {
14
+ state: () => r(),
15
15
  getters: {
16
16
  hasPreviousPatch: (t) => !!t.previousPatch.id,
17
17
  hasCurrentPatch: (t) => !!t.currentPatch.id,
@@ -24,5 +24,5 @@ const e = () => ({
24
24
  }
25
25
  });
26
26
  export {
27
- r as useVersionHistoryStore
27
+ o as useVersionHistoryStore
28
28
  };
@@ -1,19 +1,4 @@
1
- import { DEFAULT_LOCALE as r, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
2
- const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
3
- const t = window.l10n;
4
- return (t == null ? void 0 : t.locale) === a ? r : (t == null ? void 0 : t.locale) || r;
5
- }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
6
- const t = window.l10n;
7
- return (t == null ? void 0 : t.timezone) || u || c;
8
- }, D = (t, e = s(), n = f()) => {
9
- const o = {
10
- year: "numeric",
11
- month: "2-digit",
12
- day: "2-digit",
13
- timeZone: n
14
- }, i = m(t);
15
- return new Intl.DateTimeFormat(e, o).format(i);
16
- }, T = (t) => {
1
+ const o = (t) => {
17
2
  if (!t)
18
3
  return "";
19
4
  const e = new Date(t);
@@ -25,13 +10,7 @@ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length ===
25
10
  second: "2-digit",
26
11
  hour12: !1
27
12
  }).format(e);
28
- }, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
13
+ };
29
14
  export {
30
- m as convertToDateObject,
31
- T as formatPatchDate,
32
- D as formatShortDate,
33
- h as isAfterDate,
34
- u as localTz,
35
- s as locale,
36
- f as timezone
15
+ o as formatPatchDate
37
16
  };
@@ -1,26 +1,14 @@
1
- const s = (e) => {
2
- const n = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [r] = n, l = {
3
- text: e.label,
4
- value: r || ""
5
- };
6
- if (n.length >= 2) {
7
- const [, a, c] = n, o = a.includes("=") ? { key: a.split("=")[0].trim(), value: a.split("=")[1].trim() } : null;
8
- o ? l.format = o : c || (l.fallback = a), c && (l.fallback = c);
9
- }
10
- return l;
11
- }, f = (e) => e.map((t) => t.format ? {
12
- label: `${t.text} | ${t.format.key}=${t.format.value}`,
13
- value: `{{${t.value}|${t.format.key}=${t.format.value}}}`
1
+ const e = (l) => l.map((a) => a.format ? {
2
+ label: `${a.text} | ${a.format.key}=${a.format.value}`,
3
+ value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
14
4
  } : {
15
- label: t.fallback ? `${t.text} | ${t.fallback}` : t.text,
16
- value: t.fallback ? `{{${t.value}|${t.fallback}}}` : `{{${t.value}}}`
17
- }), u = () => {
18
- var e;
19
- return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
20
- }, $ = (e = "", t = {}, n = !1) => Object.entries(t).reduce((r, [l, a]) => n && (a === "" || a === null || a === void 0) ? r.replace(`&${l}={${l}}`, "") : r.replace(`{${l}}`, String(a)), e);
5
+ label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
6
+ value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
7
+ }), r = () => {
8
+ var l;
9
+ return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
10
+ };
21
11
  export {
22
- f as dynamicContentToMergeTags,
23
- u as getCsrfToken,
24
- s as mergeTagToDynamicContent,
25
- $ as replaceString
12
+ e as dynamicContentToMergeTags,
13
+ r as getCsrfToken
26
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.3-beta.e9bec65",
3
+ "version": "1.0.3-beta.ef63ed1",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -31,8 +31,8 @@
31
31
  "author": "",
32
32
  "license": "ISC",
33
33
  "dependencies": {
34
- "@stripoinc/ui-editor-extensions": "3.1.0",
35
- "@useinsider/design-system-vue": "0.14.20",
34
+ "@stripoinc/ui-editor-extensions": "3.0.0",
35
+ "@useinsider/design-system-vue": "0.14.8",
36
36
  "@vueuse/core": "11.3.0",
37
37
  "lodash-es": "4.17.21",
38
38
  "pinia": "2.3.1",
@@ -44,7 +44,7 @@
44
44
  "@cspell/eslint-plugin": "8.17.5",
45
45
  "@eslint/eslintrc": "3.3.0",
46
46
  "@eslint/js": "8.57.1",
47
- "@playwright/test": "1.57.0",
47
+ "@playwright/test": "1.55.0",
48
48
  "@stylistic/eslint-plugin": "3.1.0",
49
49
  "@stylistic/eslint-plugin-migrate": "3.1.0",
50
50
  "@types/eslint": "8.56.12",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "guido": {
85
85
  "stripo": {
86
- "version": "2.46.0"
86
+ "version": "2.42.0"
87
87
  }
88
88
  }
89
89
  }
@@ -1,28 +0,0 @@
1
- import r from "./FilterItem.vue2.js";
2
- /* empty css */
3
- import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var l = function() {
5
- var a = this, e = a._self._c, t = a._self._setupProxy;
6
- return e("div", { staticClass: "d-f f-d-c w-1 gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
7
- return t.emit("delete-filter", t.props.filter);
8
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, value: [t.selectedAttributeType] }, on: { select: function(s) {
9
- return t.updateFilter({ text: "attribute", value: s.value });
10
- } } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), value: [t.selectedOperatorType] }, on: { select: function(s) {
11
- return t.updateFilter({ text: "operator", value: s.value });
12
- } } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", type: "text", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "tooltip-status": !1, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
13
- t.updateFilter({ text: "value", value: encodeURIComponent(s) });
14
- } } })], 1), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
15
- return t.updateFilter({ text: "innerGroupOperator", value: s });
16
- } } })], 1) : a._e()]);
17
- }, n = [], o = /* @__PURE__ */ i(
18
- r,
19
- l,
20
- n,
21
- !1,
22
- null,
23
- "6562e38c"
24
- );
25
- const f = o.exports;
26
- export {
27
- f as default
28
- };
@@ -1,38 +0,0 @@
1
- import { defineComponent as f, computed as i } from "vue";
2
- import { useTranslations as v } from "../../../../composables/useTranslations.js";
3
- import { getOperatorOptions as a } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { useRecommendationExtensionStore as x } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { InButtonV2 as y, InSelect as F, InBasicTextInput as T } from "@useinsider/design-system-vue";
6
- import _ from "./LogicAdapter.vue.js";
7
- import { useDebounceFn as b } from "../../../../node_modules/@vueuse/shared/index.js";
8
- const h = /* @__PURE__ */ f({
9
- __name: "FilterItem",
10
- props: {
11
- filter: null,
12
- index: null,
13
- hasLogicAdapter: { type: Boolean }
14
- },
15
- emits: ["delete-filter"],
16
- setup(p, { emit: u }) {
17
- const e = p, n = v(), r = x(), m = [
18
- {
19
- text: n("email-editor.standard-filter"),
20
- value: "standardFilter"
21
- }
22
- ], s = i(() => e.filter.attribute || ""), l = i(() => r.getFilterList.find((t) => t.value === s.value) || { text: "", value: "", type: "" }), c = i(() => {
23
- var t;
24
- return a((t = l.value) == null ? void 0 : t.type).find((o) => o.value === e.filter.operator);
25
- }), d = b((t) => {
26
- console.debug("updateFilter: ", t);
27
- const o = {
28
- ...e.filter,
29
- [t.text]: t.value
30
- };
31
- r.updateFilter(o);
32
- }, 500);
33
- return { __sfc: !0, trans: n, store: r, props: e, filterTypeOptions: m, attributeType: s, selectedAttributeType: l, selectedOperatorType: c, emit: u, updateFilter: d, getOperatorOptions: a, InBasicTextInput: T, InSelect: F, InButtonV2: y, LogicAdapter: _ };
34
- }
35
- });
36
- export {
37
- h as default
38
- };
@@ -1,17 +0,0 @@
1
- import o from "./FilterSelectionDrawer.vue2.js";
2
- import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
4
- var e = this, r = e._self._c, t = e._self._setupProxy;
5
- return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "title-text": "Filter Selection", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.applyFilter } }, [r(t.Filters)], 1);
6
- }, s = [], a = /* @__PURE__ */ n(
7
- o,
8
- l,
9
- s,
10
- !1,
11
- null,
12
- null
13
- );
14
- const p = a.exports;
15
- export {
16
- p as default
17
- };
@@ -1,37 +0,0 @@
1
- import { defineComponent as n, ref as a, computed as l } from "vue";
2
- import i from "../../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as p } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as c } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import u from "./Filters.vue.js";
6
- const b = /* @__PURE__ */ n({
7
- __name: "FilterSelectionDrawer",
8
- setup(m) {
9
- const t = p(), o = c(), e = a(!1), s = l(() => ({
10
- primaryButton: {
11
- styling: "solid",
12
- type: "primary",
13
- labelText: t(
14
- e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
15
- ),
16
- loadingStatus: e.value,
17
- disabledStatus: !1
18
- },
19
- cancelOrBackButton: {
20
- styling: "ghost",
21
- type: "secondary",
22
- labelText: t("products.cancel"),
23
- disabledStatus: e.value
24
- }
25
- })), r = () => {
26
- o.filterSelectionDrawerStatus = !1;
27
- };
28
- return { __sfc: !0, trans: t, store: o, isApplying: e, footerButtonGroupOptions: s, closeModal: r, applyFilter: () => {
29
- e.value = !0, setTimeout(() => {
30
- console.debug("Filter applied!"), r(), o.generateFilterQuery();
31
- }, 2e3);
32
- }, WpDrawer: i, Filters: u };
33
- }
34
- });
35
- export {
36
- b as default
37
- };
@@ -1,20 +0,0 @@
1
- import s from "./Filters.vue2.js";
2
- /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var i = this, e = i._self._c, t = i._self._setupProxy;
6
- return e("div", { staticClass: "d-f f-d-c gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e(t.InSegments, { staticClass: "f-g-1 w-1", attrs: { id: "guido__filter-group-segments", "segment-list": t.filterGroupList, selected: t.selectedFilterGroup, "with-icon": !1 }, on: { click: t.changeFilterGroup } }), e(t.InButtonV2, { staticClass: "w-20-s f-g-1", attrs: { id: "guido__add-filter-group-button", "left-icon": "line-plus-netural", type: "secondary", "disabled-status": t.isMaxFilterGroupCount, "label-text": t.trans("smart-recommender.add-filter-group"), "tooltip-text": t.isMaxFilterGroupCount ? t.trans("email-editor.add-filter-tooltip") : "" }, on: { click: t.handleAddFilterGroup } })], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e("div", { staticClass: "d-f a-i-c" }, [t.selectedFilterGroup > 1 ? e(t.LogicAdapter, { staticClass: "mr-2" }) : i._e(), e("p", [i._v(" " + i._s(t.trans("email-editor.filter-group")) + " " + i._s(t.selectedFilterGroup) + " ")])], 1), t.hasRemoveFilterButton ? e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: t.handleDeleteFilterGroup } }) : i._e()], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b f-d-c" }, i._l(t.selectedFilterGroupFilters, function(l, r) {
7
- return e(t.FilterItem, { key: r, attrs: { filter: l, "has-logic-adapter": t.hasLogicAdapter && r !== t.selectedFilterGroupFilters.length - 1, index: r }, on: { "delete-filter": t.handleDeleteFilter } });
8
- }), 1), e("div", { staticClass: "d-f a-i-c j-c-c mt-3" }, [e(t.InButtonV2, { staticClass: "w-11-s", attrs: { id: "filter-group--add-filter-button", "left-icon": "line-plus-netural", type: "subtle-primary", "label-text": t.trans("smart-recommender.add-filter-condition") }, on: { click: t.handleAddFilter } })], 1)]);
9
- }, d = [], n = /* @__PURE__ */ a(
10
- s,
11
- o,
12
- d,
13
- !1,
14
- null,
15
- "1ccb6d4a"
16
- );
17
- const _ = n.exports;
18
- export {
19
- _ as default
20
- };
@@ -1,44 +0,0 @@
1
- import { defineComponent as m, computed as o, ref as h } from "vue";
2
- import { useTranslations as G } from "../../../../composables/useTranslations.js";
3
- import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
- import _ from "./FilterItem.vue.js";
6
- import A from "./LogicAdapter.vue.js";
7
- const E = /* @__PURE__ */ m({
8
- __name: "Filters",
9
- setup(R) {
10
- const i = G(), l = g(), u = o(() => l.getFilterGroupCount), t = o(() => Array.from({ length: u.value }, (e, a) => ({
11
- text: (a + 1).toString(),
12
- value: a + 1
13
- }))), r = h(1), s = (e) => {
14
- r.value = e;
15
- }, d = () => {
16
- const e = t.value.length + 1;
17
- console.debug("handleAddFilterGroup", e), t.value.push({
18
- text: e.toString(),
19
- value: e
20
- }), l.addFilterGroup(e);
21
- }, p = o(() => t.value.length >= 3), n = o(() => l.getSelectedFilterGroup(r.value)), c = o(() => n.value.length > 1), F = o(() => t.value.length > 1);
22
- return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, trans: i, store: l, filterGroupCount: u, filterGroupList: t, selectedFilterGroup: r, changeFilterGroup: s, handleAddFilterGroup: d, isMaxFilterGroupCount: p, selectedFilterGroupFilters: n, hasLogicAdapter: c, hasRemoveFilterButton: F, handleAddFilter: () => {
23
- l.addFilter({
24
- type: "standardFilter",
25
- attribute: "",
26
- operatorReplace: "",
27
- operator: "",
28
- innerGroupOperator: "*",
29
- outerGroupOperator: "*",
30
- filterNumber: n.value.length + 1,
31
- filterGroup: r.value,
32
- isValid: !1,
33
- value: ""
34
- }), console.debug("handleAddFilter");
35
- }, handleDeleteFilter: (e) => {
36
- console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
37
- }, handleDeleteFilterGroup: () => {
38
- t.value.length !== 1 && (console.debug("handleDeleteFilterGroup"), t.value.splice(r.value - 1, 1), r.value > 1 && r.value--);
39
- }, InSegments: f, InButtonV2: v, FilterItem: _, LogicAdapter: A };
40
- }
41
- });
42
- export {
43
- E as default
44
- };
@@ -1,17 +0,0 @@
1
- import s from "./LogicAdapter.vue2.js";
2
- import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
- var o = function() {
4
- var t = this, r = t._self._c, e = t._self._setupProxy;
5
- return r(e.InSegments, { staticClass: "guido__logic-adapter f-g-1", attrs: { "segment-list": e.logicAdapterList, selected: e.selectedLogicAdapter, "with-icon": !1 }, on: { click: e.changeLogicAdapter } });
6
- }, a = [], c = /* @__PURE__ */ n(
7
- s,
8
- o,
9
- a,
10
- !1,
11
- null,
12
- null
13
- );
14
- const p = c.exports;
15
- export {
16
- p as default
17
- };
@@ -1,27 +0,0 @@
1
- import { defineComponent as s, ref as n } from "vue";
2
- import { InSegments as p } from "@useinsider/design-system-vue";
3
- const l = /* @__PURE__ */ s({
4
- __name: "LogicAdapter",
5
- props: {
6
- logic: null
7
- },
8
- emits: ["change"],
9
- setup(r, { emit: e }) {
10
- const t = r, a = n([
11
- {
12
- text: "and",
13
- value: "*"
14
- },
15
- {
16
- text: "or",
17
- value: "|"
18
- }
19
- ]), o = n(t.logic || "*");
20
- return { __sfc: !0, logicAdapterList: a, emit: e, props: t, selectedLogicAdapter: o, changeLogicAdapter: (c) => {
21
- o.value = c, e("change", c);
22
- }, InSegments: p };
23
- }
24
- });
25
- export {
26
- l as default
27
- };
@@ -1,49 +0,0 @@
1
- const l = {
2
- "amp-accordion": "ampAccordionEnabled",
3
- "amp-carousel": "ampCarouselEnabled",
4
- "amp-form-controls": "ampFormControlsEnabled",
5
- "banner-block": "bannerEnabled",
6
- "button-block": "buttonEnabled",
7
- "html-block": "htmlEnabled",
8
- "image-block": "imageEnabled",
9
- "menu-block": "menuEnabled",
10
- "social-block": "socialNetEnabled",
11
- "spacer-block": "spacerEnabled",
12
- "text-block": "textEnabled",
13
- "timer-block": "timerEnabled",
14
- "video-block": "videoEnabled"
15
- }, c = {
16
- "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
17
- "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
18
- "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
19
- "recommendation-block": () => import("../extensions/Blocks/Recommendation/extension.js"),
20
- "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
21
- "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
22
- "items-block": null
23
- // TODO: Add ItemsBlock extension when available
24
- }, a = (n) => {
25
- if (!n || !n.length)
26
- return {};
27
- const o = {};
28
- return n.forEach((e) => {
29
- const t = l[e];
30
- t && (o[t] = !1);
31
- }), o;
32
- }, r = async (n) => !n || !n.length ? [] : (await Promise.all(
33
- n.map(async (e) => {
34
- const t = c[e];
35
- return t ? (await t()).default : null;
36
- })
37
- )).filter((e) => e !== null), s = () => ({
38
- getStripoBlocksConfig: async () => {
39
- var e;
40
- const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
41
- return {
42
- baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
43
- extensions: await r(o == null ? void 0 : o.includeCustoms)
44
- };
45
- }
46
- });
47
- export {
48
- s as useBlocksConfig
49
- };