@useinsider/guido 3.11.0 → 3.12.0-beta.1afbcbb

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 (63) hide show
  1. package/README.md +29 -0
  2. package/dist/@types/config/schemas.js +104 -84
  3. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  4. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  5. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  7. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  8. package/dist/components/organisms/header/HeaderWrapper.vue.js +3 -3
  9. package/dist/components/organisms/header/HeaderWrapper.vue2.js +2 -0
  10. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +1 -1
  11. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -10
  12. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  13. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  14. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +20 -23
  15. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  16. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +8 -7
  17. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  18. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +2 -2
  19. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  20. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +9 -9
  21. package/dist/composables/useModuleDynamicContentRepair.js +37 -0
  22. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  23. package/dist/composables/useRecommendationPreview.js +61 -60
  24. package/dist/composables/useStripo.js +70 -67
  25. package/dist/config/migrator/index.js +7 -6
  26. package/dist/config/migrator/socialIconMigrator.js +29 -0
  27. package/dist/enums/academy.js +1 -1
  28. package/dist/enums/date.js +3 -4
  29. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +43 -41
  30. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  32. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  33. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  34. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  35. package/dist/extensions/Blocks/controlFactories.js +125 -75
  36. package/dist/guido.css +1 -1
  37. package/dist/node_modules/valibot/dist/index.js +148 -112
  38. package/dist/src/@types/config/schemas.d.ts +30 -0
  39. package/dist/src/@types/generic.d.ts +18 -0
  40. package/dist/src/composables/useConfig.d.ts +6 -0
  41. package/dist/src/composables/useModuleDynamicContentRepair.d.ts +18 -0
  42. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  43. package/dist/src/config/migrator/socialIconMigrator.d.ts +1 -0
  44. package/dist/src/enums/academy.d.ts +3 -3
  45. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  46. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  47. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  48. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  49. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  50. package/dist/src/library.d.ts +1 -1
  51. package/dist/src/stores/config.d.ts +54 -0
  52. package/dist/src/utils/dynamicContentConverter.d.ts +27 -0
  53. package/dist/src/utils/environmentUtil.d.ts +5 -2
  54. package/dist/src/utils/genericUtil.d.ts +18 -1
  55. package/dist/src/utils/urlSchemes.d.ts +6 -0
  56. package/dist/utils/dateUtil.js +10 -23
  57. package/dist/utils/dynamicContentConverter.js +31 -0
  58. package/dist/utils/environmentUtil.js +3 -2
  59. package/dist/utils/genericUtil.js +42 -21
  60. package/dist/utils/urlSchemes.js +4 -0
  61. package/package.json +10 -1
  62. package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
  63. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
@@ -1,47 +1,68 @@
1
- const s = (e) => {
2
- const a = e.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [n] = a, c = {
3
- text: e.label,
4
- value: n || ""
1
+ const o = (l) => {
2
+ const a = l.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((t) => t.trim()), [c] = a, r = {
3
+ text: l.label,
4
+ value: c || ""
5
5
  };
6
6
  if (a.length >= 2) {
7
- const [, l, r] = a;
8
- if (l.startsWith("default:")) {
9
- let t = l.slice(8).trim();
10
- t.startsWith('"') && t.endsWith('"') && (t = t.slice(1, -1)), c.fallback = t;
7
+ const [, t, e] = a;
8
+ if (t.startsWith("default:")) {
9
+ let n = t.slice(8).trim();
10
+ n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
11
  } else {
12
- const t = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
- t ? c.format = t : r || (c.fallback = l), r && (c.fallback = r);
12
+ const n = t.includes("=") ? { key: t.split("=")[0].trim(), value: t.split("=")[1].trim() } : null;
13
+ n ? r.format = n : e || (r.fallback = t), e && (r.fallback = e);
14
14
  }
15
15
  }
16
- return c;
17
- }, u = (e, f = !1) => e.map((a) => {
16
+ return r;
17
+ }, f = (l, s = !1) => l.map((a) => {
18
18
  if (a.format)
19
19
  return {
20
20
  label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
21
  value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
22
  };
23
- if (f) {
23
+ if (s) {
24
24
  if (!a.fallback)
25
25
  return {
26
26
  label: a.text,
27
27
  value: `{{ ${a.value} }}`
28
28
  };
29
- const c = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
29
+ const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
30
  return {
31
31
  label: `${a.text} | ${a.fallback}`,
32
- value: `{{ ${a.value} | default: ${c} }}`
32
+ value: `{{ ${a.value} | default: ${r} }}`
33
33
  };
34
34
  }
35
35
  return {
36
36
  label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
37
  value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
38
38
  };
39
- }), o = () => {
40
- var e;
41
- return ((e = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : e.getAttribute("content")) ?? "";
39
+ }), b = (l) => {
40
+ const s = [], a = /* @__PURE__ */ new Set(), c = (t) => {
41
+ Array.isArray(t) && t.forEach((e) => {
42
+ const n = [...e.children ?? [], ...e.select_items ?? []];
43
+ if (n.length > 0) {
44
+ c(n);
45
+ return;
46
+ }
47
+ const u = e.text || e.tag_text;
48
+ u && e.value && !a.has(e.value) && (a.add(e.value), s.push({ text: u, value: e.value }));
49
+ });
50
+ }, [r] = Object.values(l ?? {});
51
+ return c(r), s;
52
+ }, v = (l, s, a = !1) => {
53
+ const c = new Set(l.map((t) => t.value)), r = s.filter((t) => c.has(t.value) ? !1 : (c.add(t.value), !0));
54
+ return [
55
+ ...f(l, a),
56
+ ...f(r, a)
57
+ ];
58
+ }, i = () => {
59
+ var l;
60
+ return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
42
61
  };
43
62
  export {
44
- u as dynamicContentToMergeTags,
45
- o as getCsrfToken,
46
- s as mergeTagToDynamicContent
63
+ v as buildMergeTagEntries,
64
+ f as dynamicContentToMergeTags,
65
+ b as flattenDynamicContentList,
66
+ i as getCsrfToken,
67
+ o as mergeTagToDynamicContent
47
68
  };
@@ -0,0 +1,4 @@
1
+ const t = ["http:", "https:", "mailto:"];
2
+ export {
3
+ t as BASE_SAFE_URL_SCHEMES
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.11.0",
3
+ "version": "3.12.0-beta.1afbcbb",
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",
@@ -23,12 +23,19 @@
23
23
  "preview": "vite preview",
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
+ "lint:e2e-quality": "node scripts/lint-e2e-quality.mjs",
27
+ "lint:e2e-quality:ci": "node scripts/lint-e2e-quality.mjs --ci",
28
+ "lint:e2e-quality:update": "node scripts/lint-e2e-quality.mjs --update-baseline",
29
+ "lint:e2e-quality:baseline-growth": "node scripts/lint-e2e-quality.mjs --check-baseline-growth",
30
+ "test:e2e-mutation": "node scripts/e2e-mutation-check.mjs",
26
31
  "type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json",
27
32
  "test": "vitest run --coverage",
28
33
  "test:watch": "vitest",
29
34
  "test:visual-update": "npx playwright test --update-snapshots --reporter html",
30
35
  "test:e2e:coverage": "E2E_COVERAGE=true playwright test",
31
36
  "coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
37
+ "test:mutation": "stryker run",
38
+ "test:mutation:since": "CHANGED=$(git diff --name-only --diff-filter=AMR origin/develop...HEAD -- 'src/**/*.ts' ':(glob)src/components/organisms/onboarding/**/*.vue' ':(glob)src/components/organisms/header/**/*.vue' ':(glob)src/components/organisms/unsubscribe/**/*.vue' ':(glob)src/components/organisms/save-as-template/**/*.vue' ':(glob)src/components/organisms/email-preview/**/*.vue' ':(glob)src/components/wrappers/**/*.vue' 'src/components/Guido.vue' ':(exclude)src/**/*.test.ts' ':(exclude)src/**/index.ts' ':(exclude)src/@types/**' ':(exclude)src/enums/**' ':(exclude)src/mock/**' ':(exclude)src/**/_Boilerplate/**' | paste -sd, -); if [ -n \"$CHANGED\" ]; then stryker run --incremental --mutate \"$CHANGED\"; else echo \"No changed mutatable src files vs origin/develop\"; fi",
32
39
  "prepare": "husky",
33
40
  "preinstall": "rm -rf ./node_modules/.vite"
34
41
  },
@@ -52,6 +59,8 @@
52
59
  "@eslint/eslintrc": "3.3.0",
53
60
  "@eslint/js": "8.57.1",
54
61
  "@playwright/test": "1.57.0",
62
+ "@stryker-mutator/core": "9.6.1",
63
+ "@stryker-mutator/vitest-runner": "9.6.1",
55
64
  "@stylistic/eslint-plugin": "3.1.0",
56
65
  "@stylistic/eslint-plugin-migrate": "3.1.0",
57
66
  "@types/eslint": "8.56.12",
@@ -1 +0,0 @@
1
- export {};