@useinsider/guido 3.24.0-beta.adaba3e → 3.24.0-beta.d510b6c

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 (89) hide show
  1. package/README.md +6 -2
  2. package/dist/@types/config/schemas.js +37 -39
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +92 -98
  5. package/dist/composables/useActionsApi.js +2 -2
  6. package/dist/composables/useBlocksConfig.js +20 -31
  7. package/dist/composables/useEditorTrackingIds.js +49 -0
  8. package/dist/composables/useHtmlCompiler.js +2 -0
  9. package/dist/composables/useStripo.js +70 -70
  10. package/dist/composables/useTranslations.js +1 -2
  11. package/dist/config/compiler/htmlCompilerRules.js +14 -6
  12. package/dist/config/compiler/utils/itemsCompilerUtils.js +42 -43
  13. package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -67
  14. package/dist/config/migrator/unsubscribeMigrator.js +94 -98
  15. package/dist/enums/academy.js +0 -1
  16. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +10 -8
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +28 -24
  18. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +23 -22
  19. package/dist/extensions/Blocks/Unsubscribe/block.js +104 -96
  20. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
  21. package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +5 -0
  22. package/dist/guido.css +1 -1
  23. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
  24. package/dist/node_modules/valibot/dist/index.js +261 -297
  25. package/dist/package.json.js +4 -4
  26. package/dist/services/templateLibraryApi.js +39 -36
  27. package/dist/src/@types/config/schemas.d.ts +0 -4
  28. package/dist/src/composables/useConfig.d.ts +0 -2
  29. package/dist/src/composables/useEditorTrackingIds.d.ts +7 -0
  30. package/dist/src/composables/useStripo.d.ts +1 -1
  31. package/dist/src/enums/academy.d.ts +0 -1
  32. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -0
  33. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  34. package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +1 -0
  35. package/dist/src/stores/config.d.ts +0 -167
  36. package/dist/src/utils/linkTrackingIds.d.ts +24 -22
  37. package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
  38. package/dist/stores/config.js +6 -13
  39. package/dist/utils/linkTrackingIds.js +72 -72
  40. package/dist/utils/pairProductVariables.js +29 -30
  41. package/dist/utils/templatePreparation.js +59 -72
  42. package/dist/utils/trimHrefWhitespace.js +10 -0
  43. package/package.json +1 -1
  44. package/dist/@types/display-condition.js +0 -25
  45. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -18
  46. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -41
  47. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
  48. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -81
  49. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
  50. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -63
  51. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
  52. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
  53. package/dist/composables/useDisplayConditions.js +0 -117
  54. package/dist/enums/display-condition.js +0 -12
  55. package/dist/extensions/DisplayConditions/bridge.js +0 -25
  56. package/dist/extensions/DisplayConditions/constants.js +0 -17
  57. package/dist/extensions/DisplayConditions/control.js +0 -200
  58. package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
  59. package/dist/extensions/DisplayConditions/extension.js +0 -28
  60. package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
  61. package/dist/extensions/DisplayConditions/library.js +0 -30
  62. package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
  63. package/dist/extensions/LinkTracking/extension.js +0 -17
  64. package/dist/extensions/LinkTracking/writer.js +0 -41
  65. package/dist/services/displayConditionApi.js +0 -39
  66. package/dist/src/@types/display-condition.d.ts +0 -59
  67. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
  68. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
  69. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
  70. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
  71. package/dist/src/composables/useDisplayConditions.d.ts +0 -18
  72. package/dist/src/enums/display-condition.d.ts +0 -15
  73. package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -7
  74. package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
  75. package/dist/src/extensions/DisplayConditions/control.d.ts +0 -25
  76. package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
  77. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
  78. package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
  79. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
  80. package/dist/src/extensions/LinkTracking/extension.d.ts +0 -2
  81. package/dist/src/extensions/LinkTracking/writer.d.ts +0 -13
  82. package/dist/src/mock/api/display-conditions.d.ts +0 -2
  83. package/dist/src/services/displayConditionApi.d.ts +0 -8
  84. package/dist/src/stores/display-condition.d.ts +0 -84
  85. package/dist/src/utils/displayCondition.d.ts +0 -11
  86. package/dist/src/utils/protectTableText.d.ts +0 -2
  87. package/dist/stores/display-condition.js +0 -29
  88. package/dist/utils/displayCondition.js +0 -26
  89. package/dist/utils/protectTableText.js +0 -22
@@ -1,84 +0,0 @@
1
- import type { AppliedDisplayCondition, SavedDisplayCondition } from '@@/Types/display-condition';
2
- export type DisplayConditionView = 'none' | 'create' | 'select';
3
- export type DisplayConditionListStatus = 'idle' | 'loading' | 'loaded' | 'error';
4
- interface DisplayConditionState {
5
- view: DisplayConditionView;
6
- editing: AppliedDisplayCondition | null;
7
- list: SavedDisplayCondition[];
8
- listStatus: DisplayConditionListStatus;
9
- listRequest: number;
10
- pendingDelete: SavedDisplayCondition | null;
11
- }
12
- export declare const useDisplayConditionStore: import("pinia").StoreDefinition<"guidoDisplayCondition", DisplayConditionState, {
13
- isCreateOpen: (state: {
14
- view: DisplayConditionView;
15
- editing: {
16
- id: number;
17
- name: string;
18
- description: string;
19
- beforeScript: string;
20
- afterScript: string;
21
- extraData?: string | undefined;
22
- } | null;
23
- list: {
24
- id: number;
25
- name: string;
26
- description: string;
27
- syntax: "liquid" | "pongo";
28
- method: "codeOnly" | "logicBuilder";
29
- codeBefore: string;
30
- codeAfter: string;
31
- createdAt?: string | undefined;
32
- }[];
33
- listStatus: DisplayConditionListStatus;
34
- listRequest: number;
35
- pendingDelete: {
36
- id: number;
37
- name: string;
38
- description: string;
39
- syntax: "liquid" | "pongo";
40
- method: "codeOnly" | "logicBuilder";
41
- codeBefore: string;
42
- codeAfter: string;
43
- createdAt?: string | undefined;
44
- } | null;
45
- } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
46
- isSelectOpen: (state: {
47
- view: DisplayConditionView;
48
- editing: {
49
- id: number;
50
- name: string;
51
- description: string;
52
- beforeScript: string;
53
- afterScript: string;
54
- extraData?: string | undefined;
55
- } | null;
56
- list: {
57
- id: number;
58
- name: string;
59
- description: string;
60
- syntax: "liquid" | "pongo";
61
- method: "codeOnly" | "logicBuilder";
62
- codeBefore: string;
63
- codeAfter: string;
64
- createdAt?: string | undefined;
65
- }[];
66
- listStatus: DisplayConditionListStatus;
67
- listRequest: number;
68
- pendingDelete: {
69
- id: number;
70
- name: string;
71
- description: string;
72
- syntax: "liquid" | "pongo";
73
- method: "codeOnly" | "logicBuilder";
74
- codeBefore: string;
75
- codeAfter: string;
76
- createdAt?: string | undefined;
77
- } | null;
78
- } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
79
- }, {
80
- openCreate(editing?: AppliedDisplayCondition | null): void;
81
- openSelect(): void;
82
- close(): void;
83
- }>;
84
- export {};
@@ -1,11 +0,0 @@
1
- import type { AppliedDisplayCondition, DisplayConditionSyntax } from '@@/Types/display-condition';
2
- import { DisplayConditionSourceType } from '@@/Enums/display-condition';
3
- export declare const parseSource: (condition: AppliedDisplayCondition | null | undefined) => DisplayConditionSourceType | null;
4
- type ConditionLike = Omit<AppliedDisplayCondition, 'description'> & {
5
- description?: string | null;
6
- };
7
- export declare const toAppliedCondition: (condition: ConditionLike | null | undefined) => AppliedDisplayCondition | null;
8
- export declare const nextConditionId: () => number;
9
- export type CodeField = 'codeBefore' | 'codeAfter';
10
- export declare const findInvalidCodeFields: (codeBefore: string, codeAfter: string, syntax?: DisplayConditionSyntax) => CodeField[];
11
- export {};
@@ -1,2 +0,0 @@
1
- export declare function protectTableText(html: string): string;
2
- export declare const restoreTableText: (html: string) => string;
@@ -1,29 +0,0 @@
1
- import { defineStore as t } from "pinia";
2
- const n = t("guidoDisplayCondition", {
3
- state: () => ({
4
- view: "none",
5
- editing: null,
6
- list: [],
7
- listStatus: "idle",
8
- listRequest: 0,
9
- pendingDelete: null
10
- }),
11
- getters: {
12
- isCreateOpen: (e) => e.view === "create",
13
- isSelectOpen: (e) => e.view === "select"
14
- },
15
- actions: {
16
- openCreate(e = null) {
17
- this.editing = e, this.view = "create";
18
- },
19
- openSelect() {
20
- this.editing = null, this.view = "select";
21
- },
22
- close() {
23
- this.view = "none", this.pendingDelete = null;
24
- }
25
- }
26
- });
27
- export {
28
- n as useDisplayConditionStore
29
- };
@@ -1,26 +0,0 @@
1
- import { DisplayConditionSourceType as n } from "../enums/display-condition.js";
2
- const m = (e) => {
3
- if (!e)
4
- return null;
5
- try {
6
- return JSON.parse(e.extraData ?? "{}").source === n.INLINE ? n.INLINE : n.SAVED;
7
- } catch {
8
- return n.SAVED;
9
- }
10
- }, I = (e) => !e || !(e.name || e.beforeScript || e.afterScript) ? null : { ...e, description: e.description ?? "" };
11
- let c = 0;
12
- const C = () => (c = Math.max(Date.now(), c + 1), c), p = /{%-?\s*(\w+)[\s\S]*?-?%}/g, S = /{%[\s\S]*?%}|{{[\s\S]*?}}/g, u = /{%-?\s*(comment|raw)\s*-?%}[\s\S]*?{%-?\s*end\1\s*-?%}/g, A = /{#[\s\S]*?#}/g, d = /* @__PURE__ */ new Set(["if", "unless", "for", "case", "capture", "tablerow", "comment"]), T = /* @__PURE__ */ new Set(["else", "elsif", "elif", "when"]), h = (e) => /{%|%}|{{|}}/.test(e.replace(S, "")), D = (e, a, f = "liquid") => {
13
- const t = /* @__PURE__ */ new Set(), r = [];
14
- return [["codeBefore", e], ["codeAfter", a]].forEach(([o, l]) => {
15
- const i = (f === "pongo" ? l.replace(A, "") : l).replace(u, "");
16
- h(i) && t.add(o), Array.from(i.matchAll(p), (s) => s[1]).forEach((s) => {
17
- d.has(s) ? r.push(s) : s.startsWith("end") && d.has(s.slice(3)) ? r.pop() !== s.slice(3) && t.add(o) : T.has(s) && !r.length && t.add(o);
18
- });
19
- }), r.length && t.add("codeAfter"), [...t];
20
- };
21
- export {
22
- D as findInvalidCodeFields,
23
- C as nextConditionId,
24
- m as parseSource,
25
- I as toAppliedCondition
26
- };
@@ -1,22 +0,0 @@
1
- const n = "guido-table-text:", i = new RegExp(`<!--${n}([A-Za-z0-9+/=]*)-->`, "g"), T = /<!--[\s\S]*?-->|\{%[\s\S]*?%\}|<[a-zA-Z/!?](?:[^>"']|"[^"]*"|'[^']*')*>|[^<{]+|[<{]/g, o = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr", "colgroup"]), r = /* @__PURE__ */ new Set(["col"]), f = /* @__PURE__ */ new Set([...o, ...r, "td", "th", "caption"]), p = (s) => btoa(unescape(encodeURIComponent(s))), u = (s) => decodeURIComponent(escape(atob(s))), d = (s) => {
2
- const e = /^<(\/?)([a-zA-Z][\w-]*)/.exec(s);
3
- return { name: e ? e[2].toLowerCase() : "", closing: e ? e[1] === "/" : !1 };
4
- };
5
- function E(s) {
6
- const e = [];
7
- let a = !1;
8
- return s.replace(T, (t) => {
9
- if (t.startsWith("<!--") || t.startsWith("{%"))
10
- return t;
11
- if (t.length > 1 && t.startsWith("<")) {
12
- const { name: c, closing: l } = d(t);
13
- return a = f.has(c), !a || r.has(c) || (l ? e.includes(c) && e.splice(e.lastIndexOf(c)) : e.push(c)), t;
14
- }
15
- return a && o.has(e[e.length - 1] ?? "") && t.trim() ? `<!--${n}${p(t)}-->` : t;
16
- });
17
- }
18
- const g = (s) => s.replace(i, (e, a) => u(a));
19
- export {
20
- E as protectTableText,
21
- g as restoreTableText
22
- };