@useinsider/guido 3.21.0-beta.1bd7edd → 3.21.0-beta.c433290

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 (106) hide show
  1. package/README.md +1 -1
  2. package/dist/@types/config/schemas.js +37 -38
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +112 -103
  5. package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
  6. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  7. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  9. package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
  10. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  11. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
  12. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  13. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  14. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  16. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  17. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  18. package/dist/components/organisms/header/RightSlot.vue.js +11 -10
  19. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  20. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  21. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  22. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
  23. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  24. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  25. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
  26. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  27. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
  28. package/dist/composables/useAccessibilityApi.js +51 -0
  29. package/dist/composables/useBlocksConfig.js +24 -32
  30. package/dist/composables/useCustomInterfaceAppearance.js +42 -41
  31. package/dist/config/i18n/en/labels.json.js +36 -4
  32. package/dist/config/i18n/en/tooltips.json.js +2 -1
  33. package/dist/enums/academy.js +0 -1
  34. package/dist/guido.css +1 -1
  35. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
  36. package/dist/node_modules/valibot/dist/index.js +261 -297
  37. package/dist/sprite.svg +10 -0
  38. package/dist/src/@types/config/schemas.d.ts +2 -4
  39. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
  40. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
  41. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
  42. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  43. package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
  44. package/dist/src/composables/useActionsApi.d.ts +2 -2
  45. package/dist/src/composables/useConfig.d.ts +2 -2
  46. package/dist/src/enums/academy.d.ts +0 -1
  47. package/dist/src/stores/autosave.d.ts +73 -1
  48. package/dist/src/stores/config.d.ts +20 -166
  49. package/dist/src/stores/editor.d.ts +109 -0
  50. package/dist/src/stores/onboarding.d.ts +966 -35
  51. package/dist/src/stores/version-history.d.ts +1 -1
  52. package/dist/src/utils/timeUtil.d.ts +5 -8
  53. package/dist/static/styles/components/accessibility.css.js +234 -0
  54. package/dist/static/styles/variables.css.js +2 -0
  55. package/dist/stores/autosave.js +12 -7
  56. package/dist/stores/config.js +6 -13
  57. package/dist/stores/editor.js +8 -3
  58. package/dist/stores/onboarding.js +48 -22
  59. package/dist/utils/pairProductVariables.js +14 -15
  60. package/dist/utils/timeUtil.js +6 -17
  61. package/package.json +1 -1
  62. package/dist/@types/display-condition.js +0 -25
  63. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
  64. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
  65. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
  66. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
  67. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
  68. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
  69. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
  70. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
  71. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  72. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  73. package/dist/composables/useDisplayConditions.js +0 -102
  74. package/dist/enums/display-condition.js +0 -12
  75. package/dist/extensions/DisplayConditions/bridge.js +0 -17
  76. package/dist/extensions/DisplayConditions/constants.js +0 -17
  77. package/dist/extensions/DisplayConditions/control.js +0 -178
  78. package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
  79. package/dist/extensions/DisplayConditions/extension.js +0 -28
  80. package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
  81. package/dist/extensions/DisplayConditions/library.js +0 -27
  82. package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
  83. package/dist/services/displayConditionApi.js +0 -39
  84. package/dist/src/@types/display-condition.d.ts +0 -59
  85. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
  86. package/dist/src/composables/useDisplayConditions.d.ts +0 -16
  87. package/dist/src/enums/display-condition.d.ts +0 -15
  88. package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
  89. package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
  90. package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
  91. package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
  92. package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
  93. package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
  94. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
  95. package/dist/src/mock/api/display-conditions.d.ts +0 -2
  96. package/dist/src/services/displayConditionApi.d.ts +0 -8
  97. package/dist/src/stores/display-condition.d.ts +0 -81
  98. package/dist/src/utils/displayCondition.d.ts +0 -10
  99. package/dist/src/utils/protectTableText.d.ts +0 -2
  100. package/dist/stores/display-condition.js +0 -28
  101. package/dist/utils/displayCondition.js +0 -26
  102. package/dist/utils/protectTableText.js +0 -22
  103. /package/dist/src/components/organisms/{display-conditions/DisplayConditionCreateDrawer.vue.d.ts → header/AutoSaveStatus.vue.d.ts} +0 -0
  104. /package/dist/src/components/organisms/{display-conditions/DisplayConditionSelectDrawer.vue.d.ts → header/EditorActionsMenu.vue.d.ts} +0 -0
  105. /package/dist/src/components/organisms/{display-conditions/DisplayConditionsHost.vue.d.ts → header/accessibility/AccessibilityToolbar.vue.d.ts} +0 -0
  106. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → accessibility/ColorVisionSelect.vue.d.ts} +0 -0
@@ -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
- };