@useinsider/guido 3.21.2-beta.cfc5be2 → 3.21.2-beta.eda5c2e

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 (62) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +39 -41
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +79 -81
  5. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  6. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
  7. package/dist/composables/useBlocksConfig.js +24 -32
  8. package/dist/enums/academy.js +0 -1
  9. package/dist/guido.css +1 -1
  10. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
  11. package/dist/node_modules/valibot/dist/index.js +261 -297
  12. package/dist/src/@types/config/schemas.d.ts +0 -4
  13. package/dist/src/composables/useConfig.d.ts +0 -2
  14. package/dist/src/enums/academy.d.ts +0 -1
  15. package/dist/src/stores/config.d.ts +0 -166
  16. package/dist/src/stores/unsubscribe.d.ts +10 -0
  17. package/dist/stores/config.js +6 -13
  18. package/dist/stores/unsubscribe.js +28 -24
  19. package/dist/utils/pairProductVariables.js +14 -15
  20. package/package.json +1 -1
  21. package/dist/@types/display-condition.js +0 -25
  22. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
  23. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
  24. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
  25. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
  26. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
  27. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
  28. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
  29. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
  30. package/dist/composables/useDisplayConditions.js +0 -102
  31. package/dist/enums/display-condition.js +0 -12
  32. package/dist/extensions/DisplayConditions/bridge.js +0 -17
  33. package/dist/extensions/DisplayConditions/constants.js +0 -17
  34. package/dist/extensions/DisplayConditions/control.js +0 -178
  35. package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
  36. package/dist/extensions/DisplayConditions/extension.js +0 -28
  37. package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
  38. package/dist/extensions/DisplayConditions/library.js +0 -27
  39. package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
  40. package/dist/services/displayConditionApi.js +0 -39
  41. package/dist/src/@types/display-condition.d.ts +0 -59
  42. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
  43. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
  44. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
  45. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
  46. package/dist/src/composables/useDisplayConditions.d.ts +0 -16
  47. package/dist/src/enums/display-condition.d.ts +0 -15
  48. package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
  49. package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
  50. package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
  51. package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
  52. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
  53. package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
  54. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
  55. package/dist/src/mock/api/display-conditions.d.ts +0 -2
  56. package/dist/src/services/displayConditionApi.d.ts +0 -8
  57. package/dist/src/stores/display-condition.d.ts +0 -81
  58. package/dist/src/utils/displayCondition.d.ts +0 -10
  59. package/dist/src/utils/protectTableText.d.ts +0 -2
  60. package/dist/stores/display-condition.js +0 -28
  61. package/dist/utils/displayCondition.js +0 -26
  62. package/dist/utils/protectTableText.js +0 -22
@@ -1,14 +0,0 @@
1
- import { BlockType } from '@stripoinc/ui-editor-extensions';
2
- export declare const CONDITIONS_TAB_ID = "conditions";
3
- export declare const CONDITIONS_CONTROL_ID = "guido-display-conditions-control";
4
- export declare const MAX_COLLAPSED_LINES = 10;
5
- export declare const CONDITION_BLOCK_TYPES: readonly [BlockType.STRIPE, BlockType.STRUCTURE, BlockType.CONTAINER];
6
- export declare const CONDITION_ICONS: {
7
- readonly PLUS: "guido-display-condition-plus";
8
- readonly EDIT: "guido-display-condition-edit";
9
- readonly TRASH: "guido-display-condition-trash";
10
- readonly CHEVRON: "guido-display-condition-chevron";
11
- };
12
- export declare const BUILT_IN_CONDITION_CONTROLS: string[];
13
- export declare const EMPTY_DESCRIPTION: string;
14
- export declare const APPLIED_DESCRIPTION: string;
@@ -1,23 +0,0 @@
1
- import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
- import { CommonControl } from '@@/Extensions/Blocks/common-control';
3
- export declare class DisplayConditionsControl extends CommonControl {
4
- private expanded;
5
- private listeners;
6
- private resizeObserver;
7
- private detachOutsideClick;
8
- getId(): string;
9
- getTemplate(): string;
10
- onRender(): void;
11
- onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
12
- onDestroy(): void;
13
- private getCondition;
14
- private toggleMenu;
15
- private listenOutsideClick;
16
- private openDrawer;
17
- private applyCondition;
18
- private wire;
19
- private teardown;
20
- private observeCodeSize;
21
- private paint;
22
- private collapsedHeight;
23
- }
@@ -1,2 +0,0 @@
1
- declare const _default: import("@stripoinc/ui-editor-extensions").Extension;
2
- export default _default;
@@ -1,4 +0,0 @@
1
- import { IconsRegistry } from '@stripoinc/ui-editor-extensions';
2
- export declare class DisplayConditionsIconsRegistry extends IconsRegistry {
3
- registerIconsSvg(iconsMap: Record<string, string>): void;
4
- }
@@ -1,8 +0,0 @@
1
- import type { DisplayCondition, ExternalDisplayConditionSelectedCB } from '@stripoinc/ui-editor-extensions';
2
- import { ExternalDisplayConditionsLibrary } from '@stripoinc/ui-editor-extensions';
3
- export declare class DisplayConditionsLibrary extends ExternalDisplayConditionsLibrary {
4
- getCategoryName(): string;
5
- openExternalDisplayConditionsDialog(currentCondition: DisplayCondition, successCallback: ExternalDisplayConditionSelectedCB, cancelCallback: () => void): void;
6
- getIsContextActionEnabled(): boolean;
7
- getContextActionIndex(): number;
8
- }
@@ -1,5 +0,0 @@
1
- import type { SettingsPanelTab as SettingsPanelTabType } from '@stripoinc/ui-editor-extensions';
2
- import { SettingsPanelRegistry } from '@stripoinc/ui-editor-extensions';
3
- export declare class DisplayConditionsSettingsPanel extends SettingsPanelRegistry {
4
- registerBlockControls(blockControlsMap: Record<string, SettingsPanelTabType[]>): void;
5
- }
@@ -1,2 +0,0 @@
1
- declare const _default: import("msw").HttpHandler[];
2
- export default _default;
@@ -1,8 +0,0 @@
1
- import type { DisplayConditionDraft, DisplayConditionSyntax, SavedDisplayCondition } from '@@/Types/display-condition';
2
- export declare const DISPLAY_CONDITIONS_URL = "/email-proxy/v1/display-conditions";
3
- export declare const DISPLAY_CONDITIONS_PAGE_LIMIT = 100;
4
- export declare const useDisplayConditionApi: () => {
5
- list: (syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition[]>;
6
- create: (draft: DisplayConditionDraft, syntax: DisplayConditionSyntax) => Promise<SavedDisplayCondition>;
7
- remove: (id: number) => Promise<void>;
8
- };
@@ -1,81 +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
- pendingDelete: SavedDisplayCondition | null;
10
- }
11
- export declare const useDisplayConditionStore: import("pinia").StoreDefinition<"guidoDisplayCondition", DisplayConditionState, {
12
- isCreateOpen: (state: {
13
- view: DisplayConditionView;
14
- editing: {
15
- id: number;
16
- name: string;
17
- description: string;
18
- beforeScript: string;
19
- afterScript: string;
20
- extraData?: string | undefined;
21
- } | null;
22
- list: {
23
- id: number;
24
- name: string;
25
- description: string;
26
- syntax: "liquid" | "pongo";
27
- method: "codeOnly" | "logicBuilder";
28
- codeBefore: string;
29
- codeAfter: string;
30
- createdAt?: string | undefined;
31
- }[];
32
- listStatus: DisplayConditionListStatus;
33
- pendingDelete: {
34
- id: number;
35
- name: string;
36
- description: string;
37
- syntax: "liquid" | "pongo";
38
- method: "codeOnly" | "logicBuilder";
39
- codeBefore: string;
40
- codeAfter: string;
41
- createdAt?: string | undefined;
42
- } | null;
43
- } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
44
- isSelectOpen: (state: {
45
- view: DisplayConditionView;
46
- editing: {
47
- id: number;
48
- name: string;
49
- description: string;
50
- beforeScript: string;
51
- afterScript: string;
52
- extraData?: string | undefined;
53
- } | null;
54
- list: {
55
- id: number;
56
- name: string;
57
- description: string;
58
- syntax: "liquid" | "pongo";
59
- method: "codeOnly" | "logicBuilder";
60
- codeBefore: string;
61
- codeAfter: string;
62
- createdAt?: string | undefined;
63
- }[];
64
- listStatus: DisplayConditionListStatus;
65
- pendingDelete: {
66
- id: number;
67
- name: string;
68
- description: string;
69
- syntax: "liquid" | "pongo";
70
- method: "codeOnly" | "logicBuilder";
71
- codeBefore: string;
72
- codeAfter: string;
73
- createdAt?: string | undefined;
74
- } | null;
75
- } & import("pinia").PiniaCustomStateProperties<DisplayConditionState>) => boolean;
76
- }, {
77
- openCreate(editing?: AppliedDisplayCondition | null): void;
78
- openSelect(): void;
79
- close(): void;
80
- }>;
81
- export {};
@@ -1,10 +0,0 @@
1
- import type { AppliedDisplayCondition, DisplayConditionSource } from '@@/Types/display-condition';
2
- export declare const parseSource: (condition: AppliedDisplayCondition | null | undefined) => DisplayConditionSource | null;
3
- type ConditionLike = Omit<AppliedDisplayCondition, 'description'> & {
4
- description?: string | null;
5
- };
6
- export declare const toAppliedCondition: (condition: ConditionLike | null | undefined) => AppliedDisplayCondition | null;
7
- export declare const nextConditionId: () => number;
8
- export type CodeField = 'codeBefore' | 'codeAfter';
9
- export declare const findInvalidCodeFields: (codeBefore: string, codeAfter: string) => CodeField[];
10
- export {};
@@ -1,2 +0,0 @@
1
- export declare function protectTableText(html: string): string;
2
- export declare const restoreTableText: (html: string) => string;
@@ -1,28 +0,0 @@
1
- import { defineStore as i } from "pinia";
2
- const n = i("guidoDisplayCondition", {
3
- state: () => ({
4
- view: "none",
5
- editing: null,
6
- list: [],
7
- listStatus: "idle",
8
- pendingDelete: null
9
- }),
10
- getters: {
11
- isCreateOpen: (e) => e.view === "create",
12
- isSelectOpen: (e) => e.view === "select"
13
- },
14
- actions: {
15
- openCreate(e = null) {
16
- this.editing = e, this.view = "create";
17
- },
18
- openSelect() {
19
- this.editing = null, this.view = "select";
20
- },
21
- close() {
22
- this.view = "none", this.pendingDelete = null;
23
- }
24
- }
25
- });
26
- export {
27
- n as useDisplayConditionStore
28
- };
@@ -1,26 +0,0 @@
1
- import { DisplayConditionSourceType as d } from "../enums/display-condition.js";
2
- const m = (e) => {
3
- if (!e)
4
- return null;
5
- try {
6
- return JSON.parse(e.extraData ?? "{}").source === d.INLINE ? "inline" : "saved";
7
- } catch {
8
- return "saved";
9
- }
10
- }, E = (e) => !e || !(e.name || e.beforeScript || e.afterScript) ? null : { ...e, description: e.description ?? "" };
11
- let o = 0;
12
- const w = () => (o = Math.max(Date.now(), o + 1), o), f = /{%-?\s*(\w+)[\s\S]*?-?%}/g, p = /{%[\s\S]*?%}|{{[\s\S]*?}}/g, u = /{%-?\s*(comment|raw)\s*-?%}[\s\S]*?{%-?\s*end\1\s*-?%}/g, l = /* @__PURE__ */ new Set(["if", "unless", "for", "case", "capture", "tablerow", "comment"]), h = /* @__PURE__ */ new Set(["else", "elsif", "elif", "when"]), S = (e) => /{%|%}|{{|}}/.test(e.replace(p, "")), C = (e, c) => {
13
- const t = /* @__PURE__ */ new Set(), r = [];
14
- return [["codeBefore", e], ["codeAfter", c]].forEach(([n, i]) => {
15
- const a = i.replace(u, "");
16
- S(a) && t.add(n), Array.from(a.matchAll(f), (s) => s[1]).forEach((s) => {
17
- l.has(s) ? r.push(s) : s.startsWith("end") && l.has(s.slice(3)) ? r.pop() !== s.slice(3) && t.add(n) : h.has(s) && !r.length && t.add(n);
18
- });
19
- }), r.length && t.add("codeAfter"), [...t];
20
- };
21
- export {
22
- C as findInvalidCodeFields,
23
- w as nextConditionId,
24
- m as parseSource,
25
- E as toAppliedCondition
26
- };
@@ -1,22 +0,0 @@
1
- const c = "guido-table-text:", l = new RegExp(`<!--${c}([A-Za-z0-9+/=]*)-->`, "g"), i = /<!--[\s\S]*?-->|\{%[\s\S]*?%\}|<[a-zA-Z/!?](?:[^>"']|"[^"]*"|'[^']*')*>|[^<{]+|[<{]/g, o = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), T = /* @__PURE__ */ new Set([...o, "td", "th", "caption"]), d = (s) => btoa(unescape(encodeURIComponent(s))), f = (s) => decodeURIComponent(escape(atob(s))), p = (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 u(s) {
6
- const e = [];
7
- let a = !1;
8
- return s.replace(i, (t) => {
9
- if (t.startsWith("<!--") || t.startsWith("{%"))
10
- return t;
11
- if (t.length > 1 && t.startsWith("<")) {
12
- const { name: n, closing: r } = p(t);
13
- return a = T.has(n), a && (r ? e.includes(n) && e.splice(e.lastIndexOf(n)) : e.push(n)), t;
14
- }
15
- return a && o.has(e[e.length - 1] ?? "") && t.trim() ? `<!--${c}${d(t)}-->` : t;
16
- });
17
- }
18
- const E = (s) => s.replace(l, (e, a) => f(a));
19
- export {
20
- u as protectTableText,
21
- E as restoreTableText
22
- };