@useinsider/guido 3.2.1-beta.d58ee72 → 3.3.0-beta.1778fd7

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 (158) hide show
  1. package/README.md +117 -1
  2. package/dist/@types/config/schemas.js +153 -95
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +106 -90
  5. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  6. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +9 -11
  8. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +70 -35
  9. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  10. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  11. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  12. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  13. package/dist/components/organisms/header/RightSlot.vue2.js +9 -8
  14. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +51 -31
  15. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  16. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +23 -22
  17. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +1 -1
  18. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +37 -39
  19. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  20. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +30 -41
  21. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +15 -14
  22. package/dist/composables/useAutoSave.js +71 -0
  23. package/dist/composables/useCortexBlueprintBridge.js +66 -0
  24. package/dist/composables/useEmailTemplateApplier.js +41 -0
  25. package/dist/composables/useFullStoryBridge.js +14 -0
  26. package/dist/composables/useGuidoStateBridge.js +48 -0
  27. package/dist/composables/useHtmlValidator.js +41 -36
  28. package/dist/composables/useRecommendation.js +46 -26
  29. package/dist/composables/useRibbonOffset.js +21 -0
  30. package/dist/composables/useSave.js +19 -16
  31. package/dist/composables/useStripo.js +66 -62
  32. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  33. package/dist/config/compiler/recommendationCompilerRules.js +25 -25
  34. package/dist/config/compiler/unsubscribeCompilerRules.js +40 -37
  35. package/dist/config/compiler/utils/recommendationCompilerUtils.js +107 -71
  36. package/dist/config/migrator/index.js +20 -9
  37. package/dist/config/migrator/radioButtonMigrator.js +92 -47
  38. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  39. package/dist/config/migrator/recommendation/extractors.js +27 -0
  40. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  41. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  42. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  43. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  44. package/dist/config/migrator/recommendationMigrator.js +74 -290
  45. package/dist/enums/extensions/recommendationBlock.js +103 -47
  46. package/dist/enums/onboarding.js +7 -2
  47. package/dist/enums/unsubscribe.js +39 -31
  48. package/dist/extensions/Blocks/Checkbox/control.js +23 -23
  49. package/dist/extensions/Blocks/RadioButton/control.js +15 -15
  50. package/dist/extensions/Blocks/RadioButton/template.js +7 -7
  51. package/dist/extensions/Blocks/Recommendation/block.js +60 -50
  52. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  53. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  54. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +21 -18
  55. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +99 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +27 -26
  57. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +3 -1
  58. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +228 -181
  59. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +27 -57
  60. package/dist/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.js +14 -0
  61. package/dist/extensions/Blocks/Recommendation/services/configService.js +76 -33
  62. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +18 -17
  63. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +144 -91
  64. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +19 -10
  65. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
  66. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +25 -15
  67. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +11 -11
  68. package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
  69. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +31 -15
  70. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  71. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  72. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +33 -0
  73. package/dist/guido.css +1 -1
  74. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +393 -264
  75. package/dist/node_modules/valibot/dist/index.js +450 -235
  76. package/dist/package.json.js +1 -1
  77. package/dist/services/templateLibraryApi.js +5 -4
  78. package/dist/services/unsubscribeApi.js +6 -6
  79. package/dist/src/@types/config/defaults.d.ts +5 -1
  80. package/dist/src/@types/config/index.d.ts +3 -3
  81. package/dist/src/@types/config/schemas.d.ts +217 -0
  82. package/dist/src/@types/config/types.d.ts +9 -1
  83. package/dist/src/components/Guido.vue.d.ts +1 -1
  84. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  85. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  86. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  87. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  88. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  89. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  90. package/dist/src/composables/useAutoSave.d.ts +3 -0
  91. package/dist/src/composables/useConfig.d.ts +58 -0
  92. package/dist/src/composables/useCortexBlueprintBridge.d.ts +25 -0
  93. package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
  94. package/dist/src/composables/useFullStoryBridge.d.ts +11 -0
  95. package/dist/src/composables/useGuidoStateBridge.d.ts +22 -0
  96. package/dist/src/composables/useRecommendation.d.ts +10 -1
  97. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  98. package/dist/src/composables/useRibbonOffset.d.ts +4 -0
  99. package/dist/src/composables/useSave.d.ts +1 -1
  100. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  101. package/dist/src/config/migrator/index.d.ts +2 -1
  102. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  103. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  104. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  105. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  106. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  107. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  108. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  109. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  110. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  111. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  112. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  113. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  114. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  115. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  116. package/dist/src/enums/extensions/recommendationBlock.d.ts +6 -1
  117. package/dist/src/enums/onboarding.d.ts +6 -0
  118. package/dist/src/enums/unsubscribe.d.ts +13 -3
  119. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  120. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  121. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +3 -0
  122. package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.d.ts +35 -0
  123. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  124. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +3 -20
  125. package/dist/src/extensions/Blocks/Recommendation/controls/shared/textTrimCssRules.d.ts +29 -0
  126. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +21 -3
  127. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  128. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +41 -1
  129. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  130. package/dist/src/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +2 -0
  131. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  132. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  133. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  134. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +21 -0
  135. package/dist/src/library.d.ts +1 -1
  136. package/dist/src/stores/autosave.d.ts +12 -0
  137. package/dist/src/stores/config.d.ts +522 -0
  138. package/dist/src/stores/editor.d.ts +23 -0
  139. package/dist/src/stores/guido-email-editor.d.ts +41 -0
  140. package/dist/src/stores/onboarding.d.ts +4 -0
  141. package/dist/src/utils/htmlEscape.d.ts +5 -0
  142. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  143. package/dist/src/utils/timeUtil.d.ts +8 -0
  144. package/dist/static/styles/components/button.css.js +16 -9
  145. package/dist/static/styles/components/loader.css.js +4 -0
  146. package/dist/static/styles/components/narrow-panel.css.js +52 -0
  147. package/dist/stores/autosave.js +17 -0
  148. package/dist/stores/editor.js +3 -1
  149. package/dist/stores/guido-email-editor.js +20 -0
  150. package/dist/stores/onboarding.js +4 -0
  151. package/dist/utils/htmlEscape.js +13 -0
  152. package/dist/utils/pairProductVariables.js +89 -88
  153. package/dist/utils/templatePreparation.js +74 -27
  154. package/dist/utils/timeUtil.js +19 -0
  155. package/package.json +7 -3
  156. package/dist/enums/displayConditions.js +0 -80
  157. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  158. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,53 +1,100 @@
1
- import { useActionsApi as T } from "../composables/useActionsApi.js";
2
- import { useHtmlCompiler as P } from "../composables/useHtmlCompiler.js";
1
+ import { useActionsApi as R } from "../composables/useActionsApi.js";
2
+ import { useHtmlCompiler as U } from "../composables/useHtmlCompiler.js";
3
+ import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as i } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
3
4
  import { useRecommendationExtensionStore as A } from "../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { DATA_ATTRIBUTES as l } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
5
- import { parsePageList as h } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
6
- import { useDynamicContentStore as C } from "../stores/dynamic-content.js";
7
- import { useUnsubscribeStore as D } from "../stores/unsubscribe.js";
8
- function x(i, e) {
9
- const r = new DOMParser().parseFromString(i, "text/html").querySelectorAll(`[${l.PAGE_LIST}]`), n = [];
10
- return r.forEach((t) => {
11
- const o = t.getAttribute(l.PAGE_LIST);
12
- o && n.push(...h(o));
13
- }), e.filter((t) => n.includes(t));
5
+ import { DATA_ATTRIBUTES as T } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
6
+ import { parsePageList as F } from "../extensions/Blocks/Unsubscribe/utils/utils.js";
7
+ import { useDynamicContentStore as H } from "../stores/dynamic-content.js";
8
+ import { useUnsubscribeStore as w } from "../stores/unsubscribe.js";
9
+ function x(m, r) {
10
+ const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${T.PAGE_LIST}]`), c = [];
11
+ return n.forEach((t) => {
12
+ const o = t.getAttribute(T.PAGE_LIST);
13
+ o && c.push(...F(o));
14
+ }), r.filter((t) => c.includes(t));
14
15
  }
15
- const I = () => {
16
- const i = C(), e = D(), { getCompiledEmail: a, getTemplateData: m } = T(), { compileHtml: r } = P();
16
+ function z(m) {
17
+ const l = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
18
+ if (l.length === 0)
19
+ return;
20
+ const p = A();
21
+ l.forEach((n) => {
22
+ var g, f, a, s, S;
23
+ const c = n.getAttribute("recommendation-id"), t = c ? Number(c) : NaN;
24
+ if (!Number.isFinite(t))
25
+ return;
26
+ const o = n.getAttribute("esd-ext-config");
27
+ if (!o)
28
+ return;
29
+ let e;
30
+ try {
31
+ e = JSON.parse(o);
32
+ } catch {
33
+ return;
34
+ }
35
+ if (!e || typeof e != "object" || Array.isArray(e))
36
+ return;
37
+ const u = {
38
+ strategy: e.strategy ?? i.strategy,
39
+ language: e.language ?? i.language,
40
+ size: e.size ?? i.size,
41
+ // Spread the default arrays so each block gets a fresh reference
42
+ // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
43
+ productIds: e.productIds ?? [...i.productIds],
44
+ filters: e.filters ?? [...i.filters],
45
+ shuffleProducts: e.shuffleProducts ?? i.shuffleProducts,
46
+ currencyCode: ((g = e.currency) == null ? void 0 : g.code) ?? d.code,
47
+ currencyAlignment: ((f = e.currency) == null ? void 0 : f.alignment) ?? d.alignment,
48
+ currencyDecimalCount: ((a = e.currency) == null ? void 0 : a.decimalCount) ?? d.decimalCount,
49
+ currencyDecimalSeparator: ((s = e.currency) == null ? void 0 : s.decimalSeparator) ?? d.decimalSeparator,
50
+ currencyThousandSeparator: ((S = e.currency) == null ? void 0 : S.thousandSeparator) ?? d.thousandSeparator
51
+ };
52
+ p.seedBlockUrlConfig(t, u);
53
+ });
54
+ }
55
+ const G = () => {
56
+ const m = H(), r = w(), { getCompiledEmail: l, getTemplateData: p } = R(), { compileHtml: n } = U();
17
57
  return {
18
58
  prepareTemplateDetails: async () => {
19
- const { html: t, ampHtml: o = "", ampErrors: p = [] } = await a({
59
+ const { html: t, ampHtml: o = "", ampErrors: e = [] } = await l({
20
60
  minimize: !0,
21
61
  resetDataSavedFlag: !1
22
- }), { html: u, css: d, syncModulesIds: g = [] } = await m();
23
- e.selectedUnsubscribePages.length && await e.fetchTemplates();
24
- const { compiledHtml: c, stats: s, appliedRules: S } = r(t), b = i.getSelectedDynamicContentList, f = A();
62
+ }), { html: u, css: g, syncModulesIds: f = [] } = await p();
63
+ r.selectedUnsubscribePages.length && await r.fetchTemplates(), z(u);
64
+ const { compiledHtml: a, stats: s, appliedRules: S } = n(t), C = m.getSelectedDynamicContentList, P = A(), b = (D) => (D.match(/<td[^>]*radio-button-v2[^>]*>/gi) ?? []).map((E) => {
65
+ var h;
66
+ const y = (((h = E.match(/class="([^"]*)"/)) == null ? void 0 : h[1]) ?? "").split(/\s+/).filter(Boolean);
67
+ return { hasBlock: y.includes("radio-button-block"), classes: y };
68
+ });
25
69
  return console.debug("HTML Compilation Stats:", {
26
70
  originalSize: s.originalSize,
27
71
  compiledSize: s.compiledSize,
28
72
  reduction: `${s.reductionPercentage.toFixed(2)}%`,
29
73
  appliedRules: S,
30
74
  executionTime: `${s.executionTime.toFixed(2)}ms`
75
+ }), console.debug("[guido:radio-migrator] template-prep", {
76
+ rawHtmlRadioTds: b(u),
77
+ compiledHtmlRadioTds: b(a)
31
78
  }), {
32
- dynamicContentList: b,
33
- compiledHtml: c,
79
+ dynamicContentList: C,
80
+ compiledHtml: a,
34
81
  rawHtml: u,
35
- css: d,
82
+ css: g,
36
83
  ampHtml: o,
37
- ampErrors: p,
38
- modules: g.map(Number),
84
+ ampErrors: e,
85
+ modules: f.map(Number),
39
86
  recommendation: {
40
- campaignUrls: f.recommendationCampaignUrls,
87
+ campaignUrls: P.recommendationCampaignUrls,
41
88
  configs: {}
42
89
  },
43
90
  unsubscribe: {
44
- status: e.unsubscribePagesStatus,
45
- config: x(c, e.selectedUnsubscribePages)
91
+ status: r.unsubscribePagesStatus,
92
+ config: x(a, r.selectedUnsubscribePages)
46
93
  }
47
94
  };
48
95
  }
49
96
  };
50
97
  };
51
98
  export {
52
- I as useTemplatePreparation
99
+ G as useTemplatePreparation
53
100
  };
@@ -0,0 +1,19 @@
1
+ const r = (t) => {
2
+ const e = -t.getTimezoneOffset(), o = e >= 0 ? "+" : "-", n = Math.abs(e), s = Math.floor(n / 60), i = n % 60;
3
+ return i === 0 ? `UTC${o}${s}` : `UTC${o}${s}:${String(i).padStart(2, "0")}`;
4
+ }, a = () => {
5
+ var e;
6
+ const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
7
+ return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
8
+ }, c = (t, e = !1) => {
9
+ const o = t.toLocaleTimeString([], {
10
+ hour: "2-digit",
11
+ hour12: !1,
12
+ minute: "2-digit",
13
+ second: "2-digit"
14
+ });
15
+ return e ? `${o} (${r(t)} ${a()})` : o;
16
+ };
17
+ export {
18
+ c as formatLocalTime
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.2.1-beta.d58ee72",
3
+ "version": "3.3.0-beta.1778fd7",
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",
@@ -24,6 +24,8 @@
24
24
  "lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ && bun run type-check",
25
25
  "lint:fix": "NODE_OPTIONS=--max-old-space-size=2048 eslint --fix ./",
26
26
  "type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest",
27
29
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
28
30
  "prepare": "husky",
29
31
  "preinstall": "rm -rf ./node_modules/.vite"
@@ -32,7 +34,7 @@
32
34
  "author": "",
33
35
  "license": "ISC",
34
36
  "dependencies": {
35
- "@stripoinc/ui-editor-extensions": "3.5.0",
37
+ "@stripoinc/ui-editor-extensions": "3.8.0",
36
38
  "@useinsider/design-system-vue": "1.1.0-beta.73ec2fa",
37
39
  "@vueuse/core": "11.3.0",
38
40
  "lodash-es": "4.17.21",
@@ -69,12 +71,14 @@
69
71
  "eslint-plugin-vue": "10.1.0",
70
72
  "eslint-plugin-vue-scoped-css": "2.6.1",
71
73
  "globals": "16.0.0",
74
+ "happy-dom": "15.11.7",
72
75
  "husky": "9.1.7",
73
76
  "msw": "2.10.3",
74
77
  "sass": "1.69.7",
75
78
  "typescript": "5.5.4",
76
79
  "typescript-eslint": "8.26.0",
77
80
  "vite-plugin-dts": "4.5.4",
81
+ "vitest": "2.1.9",
78
82
  "vue-tsc": "2.2.10"
79
83
  },
80
84
  "overrides": {
@@ -86,7 +90,7 @@
86
90
  },
87
91
  "guido": {
88
92
  "stripo": {
89
- "version": "2.54.0"
93
+ "version": "2.62.0"
90
94
  }
91
95
  }
92
96
  }
@@ -1,80 +0,0 @@
1
- const e = [
2
- {
3
- category: "Demographics",
4
- conditions: [
5
- {
6
- id: 1,
7
- name: "Language",
8
- description: "Users who are in the English will see the banner",
9
- beforeScript: '{% if language == "en_US" %}',
10
- afterScript: "{% endif %}"
11
- },
12
- {
13
- id: 2,
14
- name: "Country",
15
- description: "Only people who live in Australia will see the banner",
16
- beforeScript: '{% if country == "Australia" %}',
17
- afterScript: "{% endif %}"
18
- },
19
- {
20
- id: 3,
21
- name: "Country & City",
22
- description: "Only people who are located in that country and city",
23
- beforeScript: '{% if country == "United Kingdom" and city == "London" %}',
24
- afterScript: "{% endif %}"
25
- },
26
- {
27
- id: 4,
28
- name: "Age (Less than operator)",
29
- description: "Users whose age is less than 18",
30
- beforeScript: "{% if age < 18 %}",
31
- afterScript: "{% endif %}"
32
- },
33
- {
34
- id: 5,
35
- name: "Age (Equal and greater than operator)",
36
- description: "Users whose age is equal or greater than 25",
37
- beforeScript: "{% if age >= 25 %}",
38
- afterScript: "{% endif %}"
39
- },
40
- {
41
- id: 6,
42
- name: "Age (Greater than & less than operators)",
43
- description: "Users whose age is between 18 and 25",
44
- beforeScript: "{% if age > 18 and age < 25 %}",
45
- afterScript: "{% endif %}"
46
- },
47
- {
48
- id: 7,
49
- name: "Gender",
50
- description: "Users whose gender is Female",
51
- beforeScript: '{% if gender == "Female" %}',
52
- afterScript: "{% endif %}"
53
- },
54
- {
55
- id: 8,
56
- name: "State",
57
- description: "Users whose state is one of the followings. c_state is a custom attribute. Use this condition if you have the attribute with the same naming. ",
58
- beforeScript: '{% if c_state == "VIC" or c_state == "NSW" or c_state == "QLD" %}',
59
- afterScript: "{% endif %}"
60
- },
61
- {
62
- id: 9,
63
- name: "VIP User",
64
- description: "Users who are VIP users for that brand. c_is_vip_user = true. c_is_vip_user is a custom attribute. Use this condition if you have the attribute with the same naming.",
65
- beforeScript: "{% if c_is_vip_user %}",
66
- afterScript: "{% endif %}"
67
- },
68
- {
69
- id: 10,
70
- name: "Membership Type",
71
- description: "Users who belong to gold or silver membership type. c_is_gold_member = true, c_is_silver_member = true. These are custom attributes. Use this condition if you have the attribute with the same naming.",
72
- beforeScript: "{% if c_is_gold_member or c_is_silver_member %}",
73
- afterScript: "{% endif %}"
74
- }
75
- ]
76
- }
77
- ];
78
- export {
79
- e as displayConditions
80
- };
@@ -1,251 +0,0 @@
1
- import { ATTR_PRODUCT_BUTTON as s, ATTR_PRODUCT_OMNIBUS_DISCOUNT as d, ATTR_PRODUCT_OMNIBUS_PRICE as c, ATTR_PRODUCT_OLD_PRICE as o, ATTR_PRODUCT_PRICE as i, ATTR_PRODUCT_NAME as r, ATTR_PRODUCT_IMAGE as p } from "../../constants/selectors.js";
2
- import { prepareGridProductRows as b } from "./template.js";
3
- const u = `
4
- <td
5
- align="left"
6
- esd-extension-block-id="recommendation-block"
7
- esd-handler-name="esd-extension-RecommendationBlock"
8
- class="recommendation-block-v2 esd-block-recommendation-v3-block esd-extension-block es-p20"
9
- >
10
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
11
- <tr>
12
- <td align="center">
13
- <table
14
- class="container"
15
- width="100%"
16
- cellpadding="0"
17
- cellspacing="0"
18
- border="0">
19
- <tbody>
20
- <tr>
21
- <td>
22
- <table
23
- width="100%"
24
- cellpadding="0"
25
- cellspacing="0"
26
- border="0">
27
- <tbody>
28
- <tr>
29
- {-{-TITLE-}-}
30
- </tr>
31
- </tbody>
32
- </table>
33
- </td>
34
- </tr>
35
- <tr>
36
- <td class="spacer" style="height: 20px;"></td>
37
- </tr>
38
- <tr>
39
- <td>
40
- <table
41
- class="ins-recommendation-product-container"
42
- width="100%"
43
- cellpadding="0"
44
- cellspacing="0"
45
- border="0"
46
- >
47
- {-{-PRODUCT_ROWS-}-}
48
- </table>
49
- </td>
50
- </tr>
51
- </tbody>
52
- </table>
53
- </td>
54
- </tr>
55
- </table>
56
- </td>
57
- `, e = "0 5px", a = "attribute-cell", g = {
58
- [p]: (t) => `
59
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
60
- <table
61
- class="product-card-segment"
62
- width="100%"
63
- height="100%"
64
- cellpadding="0"
65
- cellspacing="0"
66
- border="0">
67
- <tr>
68
- <td
69
- class="esd-block-image product-image"
70
- esd-extension-block-id="recommendation-block-image"
71
- align="center"
72
- style="font-size: 0px;">
73
- <a target="_blank" href="${t.url}">
74
- <img
75
- src="${t.image_url}"
76
- alt="${t.name}"
77
- width="120"
78
- style="display: block; max-width: 100%; height: auto;"
79
- class="adapt-img">
80
- </a>
81
- </td>
82
- </tr>
83
- </table>
84
- </td>
85
- `,
86
- [r]: (t) => `
87
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
88
- <table
89
- class="product-card-segment"
90
- width="100%"
91
- height="100%"
92
- cellpadding="0"
93
- cellspacing="0"
94
- border="0">
95
- <tr>
96
- <td
97
- class="esd-block-text product-name"
98
- esd-extension-block-id="recommendation-block-name"
99
- align="center">
100
- <p
101
- path="1"
102
- contenteditable="false"
103
- style="font-size: 16px; color: #333333; font-weight: 600; text-align: center;">
104
- <strong path="1,0">${t.name}</strong>
105
- </p>
106
- </td>
107
- </tr>
108
- </table>
109
- </td>
110
- `,
111
- [i]: () => `
112
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
113
- <table
114
- class="product-card-segment"
115
- width="100%"
116
- height="100%"
117
- cellpadding="0"
118
- cellspacing="0"
119
- border="0">
120
- <tr>
121
- <td
122
- class="esd-block-text product-price"
123
- esd-extension-block-id="recommendation-block-price"
124
- align="center">
125
- <p
126
- path="1"
127
- contenteditable="false"
128
- style="font-size: 16px; color: #333333; font-weight: bold; text-align: center;">
129
- <strong path="1,0">18,00 TRY</strong>
130
- </p>
131
- </td>
132
- </tr>
133
- </table>
134
- </td>
135
- `,
136
- [o]: () => `
137
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
138
- <table
139
- class="product-card-segment"
140
- width="100%"
141
- height="100%"
142
- cellpadding="0"
143
- cellspacing="0"
144
- border="0">
145
- <tr>
146
- <td
147
- class="esd-block-text product-old-price"
148
- esd-extension-block-id="recommendation-block-old-price"
149
- align="center">
150
- <p
151
- path="1"
152
- contenteditable="false"
153
- style="font-size: 14px; color: #999999; text-decoration: line-through; text-align: center;">
154
- <s path="1,0">20,00 TRY</s>
155
- </p>
156
- </td>
157
- </tr>
158
- </table>
159
- </td>
160
- `,
161
- [c]: () => `
162
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
163
- <table
164
- class="product-card-segment"
165
- width="100%"
166
- height="100%"
167
- cellpadding="0"
168
- cellspacing="0"
169
- border="0">
170
- <tr>
171
- <td
172
- class="esd-block-text product-omnibus-price"
173
- esd-extension-block-id="recommendation-block-omnibus-price"
174
- data-text-before="Lowest 30-day price: "
175
- data-text-after=""
176
- align="center">
177
- <p
178
- path="1"
179
- contenteditable="false"
180
- style="font-size: 14px; color: #666666; text-align: center;"><span
181
- class="omnibus-text-before">Lowest 30-day price: </span><span
182
- class="omnibus-price-value">17,00 TRY</span><span
183
- class="omnibus-text-after"></span></p>
184
- </td>
185
- </tr>
186
- </table>
187
- </td>
188
- `,
189
- [d]: () => `
190
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
191
- <table
192
- class="product-card-segment"
193
- width="100%"
194
- height="100%"
195
- cellpadding="0"
196
- cellspacing="0"
197
- border="0">
198
- <tr>
199
- <td
200
- class="esd-block-text product-omnibus-discount"
201
- esd-extension-block-id="recommendation-block-omnibus-discount"
202
- data-text-before=""
203
- data-text-after=""
204
- align="center">
205
- <p
206
- path="1"
207
- contenteditable="false"
208
- style="font-size: 14px; color: #666666; text-align: center;"><span
209
- class="omnibus-text-before"></span><span
210
- class="omnibus-discount-value">-6%</span><span
211
- class="omnibus-text-after"></span></p>
212
- </td>
213
- </tr>
214
- </table>
215
- </td>
216
- `,
217
- [s]: (t) => `
218
- <td class="${a}" style="padding: ${e}; height: 100%;" valign="top">
219
- <table
220
- class="product-card-segment"
221
- width="100%"
222
- height="100%"
223
- cellpadding="0"
224
- cellspacing="0"
225
- border="0">
226
- <tr>
227
- <td
228
- class="esd-block-button product-button"
229
- esd-extension-block-id="recommendation-block-button"
230
- align="center">
231
- <span class="es-button-border" style="display: block;">
232
- <a
233
- href="${t.url}"
234
- target="_blank"
235
- class="es-button">
236
- {-{-PRODUCT_BUTTON_TEXT-}-}
237
- </a>
238
- </span>
239
- </td>
240
- </tr>
241
- </table>
242
- </td>
243
- `
244
- };
245
- function T(t, l, n) {
246
- return b(t, l, g, n);
247
- }
248
- export {
249
- u as default,
250
- T as prepareProductRows
251
- };
@@ -1,2 +0,0 @@
1
- import type { ConditionCategories } from '@@/Types/condition-categories';
2
- export declare const displayConditions: ConditionCategories;