@useinsider/guido 3.18.3-beta.ec88281 → 3.19.0-beta.0a1f92f

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 (74) hide show
  1. package/README.md +20 -0
  2. package/dist/@types/config/schemas.js +14 -13
  3. package/dist/components/Guido.vue.js +7 -7
  4. package/dist/components/Guido.vue2.js +55 -48
  5. package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
  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 +36 -52
  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 +5 -5
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +32 -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 +9 -8
  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 +54 -36
  28. package/dist/composables/useAccessibilityApi.js +35 -0
  29. package/dist/composables/useCustomInterfaceAppearance.js +29 -28
  30. package/dist/composables/useGuidoStateBridge.js +29 -24
  31. package/dist/composables/useStripo.js +7 -7
  32. package/dist/config/i18n/en/labels.json.js +36 -4
  33. package/dist/config/i18n/en/tooltips.json.js +2 -1
  34. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +4 -4
  35. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +6 -3
  36. package/dist/guido.css +1 -1
  37. package/dist/library.js +15 -13
  38. package/dist/package.json.js +1 -1
  39. package/dist/public/editorState.js +4 -0
  40. package/dist/sprite.svg +6 -0
  41. package/dist/src/@types/config/schemas.d.ts +2 -0
  42. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  43. package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
  44. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  45. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  46. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  47. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  48. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  49. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  50. package/dist/src/composables/useActionsApi.d.ts +2 -2
  51. package/dist/src/composables/useConfig.d.ts +2 -0
  52. package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
  53. package/dist/src/library.d.ts +2 -0
  54. package/dist/src/public/editorState.d.ts +14 -0
  55. package/dist/src/public/trackingIds.d.ts +6 -2
  56. package/dist/src/stores/config.d.ts +18 -0
  57. package/dist/src/stores/editor.d.ts +134 -0
  58. package/dist/src/stores/guido-email-editor.d.ts +27 -27
  59. package/dist/src/stores/onboarding.d.ts +717 -2
  60. package/dist/src/stores/version-history.d.ts +1 -1
  61. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  62. package/dist/src/utils/timeUtil.d.ts +5 -0
  63. package/dist/static/styles/components/accessibility.css.js +234 -0
  64. package/dist/static/styles/variables.css.js +2 -0
  65. package/dist/stores/editor.js +11 -4
  66. package/dist/stores/guido-email-editor.js +0 -4
  67. package/dist/stores/onboarding.js +68 -46
  68. package/dist/utils/genericUtil.js +64 -61
  69. package/dist/utils/liquidDynamicContent.js +15 -0
  70. package/dist/utils/timeUtil.js +6 -17
  71. package/package.json +10 -6
  72. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  73. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  74. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import type { VersionHistoryState } from '@@/Types/version-history-api';
1
+ import type { VersionHistoryState } from '@@/Types/api/version-history-api';
2
2
  export interface StoreState extends VersionHistoryState {
3
3
  editorVisualMode: 'desktop' | 'mobile';
4
4
  }
@@ -0,0 +1,20 @@
1
+ import type { BaseDynamicContent } from '@@/Types/generic';
2
+ export type DynamicContentFormat = NonNullable<BaseDynamicContent['format']>;
3
+ /** Format key the dynamic-content picker sends for a custom date/time format. */
4
+ export declare const TIME_FORMAT_KEY = "time-format";
5
+ /** Wraps a Liquid filter argument in whichever quote style the value itself does not use. */
6
+ export declare const quoteArgument: (value: string) => string | null;
7
+ /**
8
+ * `{ key: 'time-format', value: '%Y-%m-%d' }` -> `date: "%Y-%m-%d"`.
9
+ *
10
+ * Only a custom date/time strftime pattern has a Liquid equivalent. Anything else returns null so
11
+ * the caller emits a plain tag rather than one that silently lost — or literally printed — its
12
+ * format.
13
+ * @example formatToLiquidFilter({ key: 'time-format', value: '%b %-d, %Y' }) -> date: "%b %-d, %Y"
14
+ */
15
+ export declare const formatToLiquidFilter: (format: DynamicContentFormat) => string | null;
16
+ /**
17
+ * Inverse of `formatToLiquidFilter` — reads the picker format back out of one filter segment, so a
18
+ * reopened tag restores its selection in the host's format dropdown.
19
+ */
20
+ export declare const liquidFilterToFormat: (segment: string) => DynamicContentFormat | null;
@@ -6,3 +6,8 @@
6
6
  * @example formatLocalTime(date, true) -> 12:20:02 (UTC+3 Istanbul)
7
7
  */
8
8
  export declare const formatLocalTime: (date: Date, useTimezone?: boolean) => string;
9
+ export declare const autoSaveTimestamp: (date: Date, now?: Date) => {
10
+ isToday: boolean;
11
+ time: string;
12
+ date: string;
13
+ };
@@ -0,0 +1,234 @@
1
+ const n = `
2
+ ue-ui-simple-panel.accessibility-panel,
3
+ ue-accessibility-panel {
4
+ height: 100%;
5
+ }
6
+
7
+ ue-accessibility-panel .header-control-panel-right {
8
+ min-width: 50px;
9
+ min-height: 50px;
10
+ }
11
+
12
+ ue-accessibility-panel .tabs-header .accent {
13
+ min-width: 21px;
14
+ margin-left: 8px;
15
+ padding: 3px 5px;
16
+ border: 1px solid var(--guido-color-gray-300);
17
+ border-radius: 4px;
18
+ background-color: var(--guido-color-white);
19
+ color: var(--guido-color-gray-800);
20
+ font-size: 13px;
21
+ font-weight: 400;
22
+ line-height: 16px;
23
+ }
24
+
25
+ ue-accessibility-panel .tabs-header button.checked .accent {
26
+ border-color: var(--guido-color-primary-500);
27
+ color: var(--guido-color-primary-500);
28
+ }
29
+
30
+ ue-accessibility-panel .issue-card-surface {
31
+ border-radius: 8px;
32
+ outline: 1px solid var(--guido-color-gray-300);
33
+ outline-offset: -1px;
34
+ }
35
+
36
+ ue-accessibility-panel .issue-card-surface--active {
37
+ outline-color: var(--guido-color-primary-500);
38
+ }
39
+
40
+ ue-accessibility-panel .issue-card-title {
41
+ color: var(--guido-color-gray-800);
42
+ }
43
+
44
+ ue-accessibility-panel .issue-card-header-row .icon-help {
45
+ display: inline-flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ width: 24px;
49
+ height: 24px;
50
+ color: var(--guido-color-gray-600);
51
+ }
52
+
53
+ ue-accessibility-panel .issue-card-header-row .icon-help svg {
54
+ width: 14px;
55
+ height: 14px;
56
+ }
57
+
58
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.danger {
59
+ color: var(--guido-color-danger-500);
60
+ }
61
+
62
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.warning {
63
+ color: var(--guido-color-warning-500);
64
+ }
65
+
66
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.info {
67
+ color: var(--guido-color-primary-500);
68
+ }
69
+
70
+ ue-accessibility-passed-tab input,
71
+ ue-accessibility-passed-tab ue-select .toggle-select-button {
72
+ opacity: 0.6;
73
+ cursor: not-allowed;
74
+ }
75
+
76
+ ue-accessibility-panel .controls-separator-line:has(.fit-to-color) {
77
+ padding: 10px;
78
+ }
79
+
80
+ ue-accessibility-passed-tab .controls-separator-line:has(.fit-to-color) {
81
+ padding-bottom: 34px;
82
+ }
83
+
84
+ ue-accessibility-panel .controls-separator-line:has(.fit-to-color) .sub-container.two-columns {
85
+ box-sizing: border-box;
86
+ min-height: 50px;
87
+ padding: 5px 16px;
88
+ align-items: center;
89
+ }
90
+
91
+ ue-accessibility-panel .controls-list.fit-to-color {
92
+ justify-content: flex-end;
93
+ align-items: center;
94
+ gap: 0;
95
+ font-size: 13px;
96
+ line-height: 16px;
97
+ }
98
+
99
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component {
100
+ align-items: center;
101
+ justify-content: center;
102
+ width: 24px;
103
+ height: 24px;
104
+ margin: 0;
105
+ }
106
+
107
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component svg {
108
+ width: 16px;
109
+ height: 16px;
110
+ }
111
+
112
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component.warning {
113
+ color: var(--guido-color-warning-500);
114
+ }
115
+
116
+ ue-accessibility-panel {
117
+ --ue-accessibility-image-width: 240px;
118
+ --ue-accessibility-image-height: 240px;
119
+ }
120
+
121
+ ue-accessibility-panel ue-scrollable-container:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) {
122
+ flex-grow: 1;
123
+ }
124
+
125
+ ue-accessibility-panel ue-scrollable-container:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) .ue-scrollable {
126
+ height: 100%;
127
+ }
128
+
129
+ ue-accessibility-panel .ue-scrollable-content:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) {
130
+ display: flex;
131
+ flex-direction: column;
132
+ justify-content: center;
133
+ min-height: 100%;
134
+ }
135
+
136
+ ue-accessibility-panel .accessibility-list-empty.light-theme.failed-list,
137
+ ue-accessibility-panel .accessibility-list-empty.light-theme.ignored-list,
138
+ ue-accessibility-passed-tab:empty::before {
139
+ display: block;
140
+ height: auto;
141
+ margin: 0;
142
+ padding: 248px 16px 0;
143
+ background: url("https://image.useinsider.com/insider-design-system/img/speacial/no-personalization.svg") no-repeat center top / 240px 240px;
144
+ color: var(--guido-color-neutral-500);
145
+ font-size: 15px;
146
+ line-height: 24px;
147
+ text-align: center;
148
+ white-space: pre-line;
149
+ }
150
+
151
+ ue-accessibility-passed-tab:empty {
152
+ display: block;
153
+ }
154
+
155
+ ue-accessibility-passed-tab:empty::before {
156
+ content: "No Passed Items\\A You have no passed items.";
157
+ }
158
+
159
+ ue-accessibility-panel .accessibility-list-empty::first-line,
160
+ ue-accessibility-passed-tab:empty::first-line {
161
+ color: var(--guido-color-neutral-700);
162
+ font-size: 18px;
163
+ line-height: 40px;
164
+ }
165
+
166
+ ue-accessibility-panel .e2e-ignore-button > .button,
167
+ ue-accessibility-panel .e2e-unignore-button > .button,
168
+ ue-accessibility-panel .e2e-auto-tune-button > .button {
169
+ border: none;
170
+ background-color: var(--guido-color-neutral-200);
171
+ color: var(--guido-color-neutral-800);
172
+ }
173
+
174
+ ue-accessibility-panel .e2e-ignore-button > .button .icon-button,
175
+ ue-accessibility-panel .e2e-unignore-button > .button .icon-button,
176
+ ue-accessibility-panel .e2e-auto-tune-button > .button .icon-button {
177
+ color: var(--guido-color-neutral-800);
178
+ }
179
+
180
+ ue-accessibility-panel .e2e-ignore-button > .button:hover:not(:disabled,.disabled),
181
+ ue-accessibility-panel .e2e-unignore-button > .button:hover:not(:disabled,.disabled),
182
+ ue-accessibility-panel .e2e-auto-tune-button > .button:hover:not(:disabled,.disabled) {
183
+ background-color: var(--guido-color-neutral-100);
184
+ }
185
+
186
+ ue-accessibility-panel .e2e-apply-button > .button {
187
+ border: none;
188
+ background-color: var(--guido-color-primary-100);
189
+ color: var(--guido-color-primary-500);
190
+ }
191
+
192
+ ue-accessibility-panel .e2e-apply-button > .button .icon-button {
193
+ color: var(--guido-color-primary-500);
194
+ }
195
+
196
+ ue-accessibility-panel .e2e-apply-button > .button:hover:not(:disabled,.disabled) {
197
+ background-color: var(--guido-color-primary-0);
198
+ }
199
+
200
+ .e2e-accessibility-refresh .icon-button {
201
+ color: var(--guido-color-primary-500);
202
+ }
203
+
204
+ .ue-popover.dark,
205
+ .ue-popover.dark-tiny {
206
+ border-radius: 4px;
207
+ background: var(--guido-color-gray-800);
208
+ box-shadow: 0 15px 17.5px rgb(0 0 0 / 10%), 0 8px 5px rgb(0 0 0 / 10%);
209
+ color: var(--guido-color-white);
210
+ font-size: 13px;
211
+ line-height: 16px;
212
+ }
213
+
214
+ .ue-popover.dark .popup-pointer ue-icon-component svg,
215
+ .ue-popover.dark-tiny .popup-pointer ue-icon-component svg {
216
+ fill: var(--guido-color-gray-800);
217
+ }
218
+
219
+ .ue-popover.dark a,
220
+ .ue-popover.dark-tiny a,
221
+ .ue-popover.dark ue-description a,
222
+ .ue-popover.dark-tiny ue-description a {
223
+ color: var(--guido-color-white);
224
+ text-decoration: underline;
225
+ }
226
+
227
+ .ue-popover ue-description a[href^="https://act-rules.github.io/"],
228
+ .ue-popover ue-description a[href^="https://dequeuniversity.com/"] {
229
+ display: inline;
230
+ }
231
+ `;
232
+ export {
233
+ n as default
234
+ };
@@ -14,8 +14,10 @@ const o = `:host {
14
14
  --guido-color-gray-0: #F9F9F9;
15
15
  --guido-color-neutral-800: #222938;
16
16
  --guido-color-neutral-700: #2C3546;
17
+ --guido-color-neutral-500: #5D6980;
17
18
  --guido-color-neutral-200: #DCDFE6;
18
19
  --guido-color-neutral-100: #EFF2F4;
20
+ --guido-color-warning-500: #FFBF00;
19
21
  --guido-color-danger-300: #e84342;
20
22
  --guido-color-danger-500: #DC2A2A;
21
23
  --guido-box-shadow: 0 4px 12px 0 rgba(44,53,70,0.15);
@@ -6,8 +6,15 @@ const o = e("guidoEditor", {
6
6
  isSaveAsTemplateDrawerOpen: !1,
7
7
  isVersionHistoryOpen: !1,
8
8
  isPreviewModeOpen: !1,
9
+ isAccessibilityTestingOpen: !1,
10
+ imagesHidden: !1,
11
+ colorVisionDeficiency: "",
9
12
  editorVisualMode: "desktop",
10
13
  hasChanges: !1,
14
+ // Bumped on every Stripo document change. `hasChanges` is a latch that stays
15
+ // true until a save, so it cannot signal the second edit onwards; watchers
16
+ // that need every change (the outbound state bridge) watch this instead.
17
+ changeSeq: 0,
11
18
  isStripoInitialized: !1,
12
19
  templateId: "",
13
20
  syncModulesEnabled: !1,
@@ -17,20 +24,20 @@ const o = e("guidoEditor", {
17
24
  }),
18
25
  getters: {
19
26
  // Middle Slot
20
- isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen,
27
+ isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
21
28
  isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
22
29
  isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
23
30
  isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
24
31
  isPreviewButtonDisabled: (i) => i.loadingStatus,
25
32
  isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
26
33
  // Right Slot
34
+ isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
27
35
  isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
28
36
  isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
29
37
  isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
30
38
  isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
31
- isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen,
32
- // Autosave
33
- isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
39
+ isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
40
+ isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen && !i.isAccessibilityTestingOpen
34
41
  }
35
42
  });
36
43
  export {
@@ -1,13 +1,9 @@
1
1
  import { defineStore as e } from "pinia";
2
2
  const d = e("guidoEmailEditor", {
3
3
  state: () => ({
4
- /** Current Stripo HTML — stripe tables only, no DOCTYPE/wrapper. */
5
4
  html: "",
6
- /** Current Stripo CSS — es-p* utility classes used by the html. */
7
5
  css: "",
8
- /** Wall-clock ms when html/css were last written by the bridge. */
9
6
  lastUpdatedAt: 0,
10
- /** Template id from the editor config, for cortex-fe to scope per-template. */
11
7
  templateId: ""
12
8
  }),
13
9
  getters: {
@@ -1,59 +1,73 @@
1
- import { useOnboardingApi as s } from "../services/onboardingApi.js";
1
+ import { useOnboardingApi as t } from "../services/onboardingApi.js";
2
2
  import { defineStore as e } from "pinia";
3
- const t = () => ({
3
+ const r = () => ({
4
4
  cardIndex: 0,
5
5
  isActive: !1,
6
- config: []
6
+ config: [],
7
+ cardOffset: 0
7
8
  }), a = () => ({
8
9
  onboardings: {
9
- newVersionPopup: t(),
10
- genericOnboarding: t(),
11
- textBlockOnboarding: t(),
12
- versionHistoryOnboarding: t(),
13
- ampOnboarding: t(),
14
- itemsOnboarding: t()
10
+ newVersionPopup: r(),
11
+ genericOnboarding: r(),
12
+ textBlockOnboarding: r(),
13
+ versionHistoryOnboarding: r(),
14
+ ampOnboarding: r(),
15
+ itemsOnboarding: r(),
16
+ editorTabBarOnboarding: r()
15
17
  },
16
18
  userModalState: {},
17
- isFetched: !1
18
- }), c = e("guidoOnboarding", {
19
+ isFetched: !1,
20
+ closedThisSession: []
21
+ }), g = e("guidoOnboarding", {
19
22
  state: () => a(),
20
23
  getters: {
21
- getOnboarding: (n) => (i) => n.onboardings[i],
22
- isActive: (n) => (i) => n.onboardings[i].isActive,
23
- getCurrentCard: (n) => (i) => {
24
- const o = n.onboardings[i];
25
- return o.config[o.cardIndex];
24
+ getOnboarding: (n) => (o) => n.onboardings[o],
25
+ isActive: (n) => (o) => n.onboardings[o].isActive,
26
+ getCurrentCard: (n) => (o) => {
27
+ const i = n.onboardings[o];
28
+ return i.config[i.cardIndex];
26
29
  },
27
30
  getGenericCurrentCard: (n) => {
28
- const { genericOnboarding: i } = n.onboardings;
29
- return i.config[i.cardIndex];
31
+ const { genericOnboarding: o } = n.onboardings;
32
+ return o.config[o.cardIndex];
30
33
  },
31
34
  getTextBlockCurrentCard: (n) => {
32
- const { textBlockOnboarding: i } = n.onboardings;
33
- return i.config[i.cardIndex];
35
+ const { textBlockOnboarding: o } = n.onboardings;
36
+ return o.config[o.cardIndex];
34
37
  },
35
38
  getVersionHistoryCurrentCard: (n) => {
36
- const { versionHistoryOnboarding: i } = n.onboardings;
37
- return i.config[i.cardIndex];
39
+ const { versionHistoryOnboarding: o } = n.onboardings;
40
+ return o.config[o.cardIndex];
38
41
  },
39
42
  getAmpCurrentCard: (n) => {
40
- const { ampOnboarding: i } = n.onboardings;
41
- return i.config[i.cardIndex];
43
+ const { ampOnboarding: o } = n.onboardings;
44
+ return o.config[o.cardIndex];
42
45
  },
43
46
  getItemsCurrentCard: (n) => {
44
- const { itemsOnboarding: i } = n.onboardings;
45
- return i.config[i.cardIndex];
47
+ const { itemsOnboarding: o } = n.onboardings;
48
+ return o.config[o.cardIndex];
49
+ },
50
+ getEditorTabBarCurrentCard: (n) => {
51
+ const { editorTabBarOnboarding: o } = n.onboardings;
52
+ return o.config[o.cardIndex];
46
53
  },
47
- shouldShowOnboarding: (n) => (i) => {
48
- const o = n.userModalState.Guido;
49
- return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
54
+ isEditorActionsMenuPinned: (n) => {
55
+ const { editorTabBarOnboarding: o } = n.onboardings, i = o.config[o.cardIndex];
56
+ return o.isActive && !!(i != null && i.pinsMenu);
57
+ },
58
+ shouldShowOnboarding: (n) => (o) => {
59
+ const i = n.userModalState.Guido;
60
+ return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
50
61
  }
51
62
  },
52
63
  actions: {
53
64
  closeOtherOnboardings(n) {
54
- Object.keys(this.onboardings).forEach((i) => {
55
- const o = i;
56
- o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
65
+ Object.keys(this.onboardings).forEach((o) => {
66
+ const i = o;
67
+ if (i !== n && this.onboardings[i].isActive) {
68
+ const s = this.onboardings[i];
69
+ s.cardOffset += s.cardIndex, s.isActive = !1, s.cardIndex = 0, s.config = [];
70
+ }
57
71
  });
58
72
  },
59
73
  start(n) {
@@ -62,8 +76,16 @@ const t = () => ({
62
76
  startOnboarding(n) {
63
77
  this.shouldShowOnboarding(n) && !this.isActive(n) && this.start(n);
64
78
  },
79
+ closeForSession(n) {
80
+ this.closedThisSession.includes(n) || this.closedThisSession.push(n), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [], this.onboardings[n].cardOffset = 0;
81
+ },
65
82
  async close(n) {
66
- await this.setUserModalState(n, "true", "Guido"), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [];
83
+ this.closeForSession(n);
84
+ try {
85
+ await this.setUserModalState(n, "true", "Guido");
86
+ } catch (o) {
87
+ console.warn("guido:onboarding:close-not-persisted", n, o);
88
+ }
67
89
  },
68
90
  next(n) {
69
91
  this.onboardings[n].cardIndex < this.onboardings[n].config.length - 1 && this.onboardings[n].cardIndex++;
@@ -71,15 +93,15 @@ const t = () => ({
71
93
  previous(n) {
72
94
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
73
95
  },
74
- updateCardPosition(n, i, o) {
75
- const r = this.onboardings[n].config[i];
76
- r && (r.top = o.top, r.position = o.position);
96
+ updateCardPosition(n, o, i) {
97
+ const s = this.onboardings[n].config[o];
98
+ s && (s.top = i.top, s.position = i.position);
77
99
  },
78
- setConfig(n, i) {
79
- this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
100
+ setConfig(n, o, i = 0) {
101
+ this.onboardings[n].config = o ?? [], this.onboardings[n].cardOffset = i, this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
80
102
  },
81
103
  async onDiscoverNowClicked() {
82
- await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
104
+ this.start("genericOnboarding"), await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido");
83
105
  },
84
106
  onRemindMeLater() {
85
107
  sessionStorage.setItem("newVersionPopupDismissed", "true");
@@ -93,19 +115,19 @@ const t = () => ({
93
115
  async fetchUserModalState() {
94
116
  if (this.isFetched)
95
117
  return;
96
- const { fetchUserModalState: n } = s();
118
+ const { fetchUserModalState: n } = t();
97
119
  try {
98
- const i = await n();
99
- this.userModalState = i, this.isFetched = !0;
120
+ const o = await n();
121
+ this.userModalState = o, this.isFetched = !0;
100
122
  } catch {
101
123
  }
102
124
  },
103
- async setUserModalState(n, i, o) {
104
- const { setUserModalState: r } = s();
105
- await r(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
125
+ async setUserModalState(n, o, i) {
126
+ const { setUserModalState: s } = t();
127
+ await s(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
106
128
  }
107
129
  }
108
130
  });
109
131
  export {
110
- c as useOnboardingStore
132
+ g as useOnboardingStore
111
133
  };
@@ -1,75 +1,78 @@
1
- const o = (a) => {
2
- const t = a.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((e) => e.trim()), [s] = t, r = {
3
- text: a.label,
4
- value: s || ""
1
+ import { formatToLiquidFilter as b, quoteArgument as y, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
2
+ const g = (t) => {
3
+ if (!t.includes("="))
4
+ return null;
5
+ const [r, e] = t.split("=");
6
+ return { key: r.trim(), value: e.trim() };
7
+ }, c = "default:", f = (t) => {
8
+ if (!t.startsWith(c))
9
+ return t;
10
+ const r = t.slice(c.length).trim(), e = (l) => r.length >= 2 && r.startsWith(l) && r.endsWith(l);
11
+ return e('"') || e("'") ? r.slice(1, -1) : r;
12
+ }, k = (t) => {
13
+ const e = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((a) => a.trim()), [l] = e, s = {
14
+ text: t.label,
15
+ value: l || ""
5
16
  };
6
- if (t.length >= 2) {
7
- const [, e, l] = t;
8
- if (e.startsWith("default:")) {
9
- let n = e.slice(8).trim();
10
- n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
- } else {
12
- const n = e.includes("=") ? { key: e.split("=")[0].trim(), value: e.split("=")[1].trim() } : null;
13
- n ? r.format = n : l || (r.fallback = e), l && (r.fallback = l);
17
+ if (e.length >= 2) {
18
+ const [, a, n] = e;
19
+ if (a.startsWith(c))
20
+ s.fallback = f(a);
21
+ else {
22
+ const o = h(a) ?? g(a);
23
+ o ? s.format = o : n || (s.fallback = a), n && (s.fallback = f(n));
14
24
  }
15
25
  }
16
- return r;
17
- }, u = (a, c = !1) => a.map((t) => {
18
- if (t.format)
19
- return {
20
- label: `${t.text} | ${t.format.key}=${t.format.value}`,
21
- value: `{{${t.value}|${t.format.key}=${t.format.value}}}`
22
- };
23
- if (c) {
24
- if (!t.fallback)
25
- return {
26
- label: t.text,
27
- value: `{{ ${t.value} }}`
28
- };
29
- const r = !Number.isNaN(Number(t.fallback)) && t.fallback.trim() !== "" ? t.fallback : `"${t.fallback}"`;
30
- return {
31
- label: `${t.text} | ${t.fallback}`,
32
- value: `{{ ${t.value} | default: ${r} }}`
33
- };
34
- }
26
+ return s;
27
+ }, p = (t) => {
28
+ const e = !Number.isNaN(Number(t)) && t.trim() !== "" ? t : y(t);
29
+ return e === null ? null : `${c} ${e}`;
30
+ }, v = (t) => {
31
+ const r = t.format ? b(t.format) : null, e = t.fallback ? p(t.fallback) : null, l = [t.value, r, e].filter(Boolean);
35
32
  return {
36
- label: t.fallback ? `${t.text} | ${t.fallback}` : t.text,
37
- value: t.fallback ? `{{${t.value}|${t.fallback}}}` : `{{${t.value}}}`
33
+ label: [t.text, r, e && t.fallback].filter(Boolean).join(" | "),
34
+ value: `{{ ${l.join(" | ")} }}`
38
35
  };
39
- }), b = (a) => {
40
- const c = [], t = /* @__PURE__ */ new Set(), s = (e) => {
41
- Array.isArray(e) && e.forEach((l) => {
42
- const n = [...l.children ?? [], ...l.select_items ?? []];
43
- if (n.length > 0) {
44
- s(n);
36
+ }, i = (t, r = !1) => t.map((e) => r ? v(e) : e.format ? {
37
+ label: `${e.text} | ${e.format.key}=${e.format.value}`,
38
+ value: `{{${e.value}|${e.format.key}=${e.format.value}}}`
39
+ } : {
40
+ label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
41
+ value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
42
+ }), $ = (t) => {
43
+ const r = [], e = /* @__PURE__ */ new Set(), l = (a) => {
44
+ Array.isArray(a) && a.forEach((n) => {
45
+ const o = [...n.children ?? [], ...n.select_items ?? []];
46
+ if (o.length > 0) {
47
+ l(o);
45
48
  return;
46
49
  }
47
- const f = l.text || l.tag_text;
48
- f && l.value && !t.has(l.value) && (t.add(l.value), c.push({ text: f, value: l.value }));
50
+ const u = n.text || n.tag_text;
51
+ u && n.value && !e.has(n.value) && (e.add(n.value), r.push({ text: u, value: n.value }));
49
52
  });
50
- }, [r] = Object.values(a ?? {});
51
- return s(r), c;
52
- }, i = (a, c, t = !1) => {
53
- const s = new Set(a.map((e) => e.value)), r = c.filter((e) => s.has(e.value) ? !1 : (s.add(e.value), !0));
53
+ }, [s] = Object.values(t ?? {});
54
+ return l(s), r;
55
+ }, d = (t, r, e = !1) => {
56
+ const l = new Set(t.map((a) => a.value)), s = r.filter((a) => l.has(a.value) ? !1 : (l.add(a.value), !0));
54
57
  return [
55
- ...u(a, t),
56
- ...u(r, t)
58
+ ...i(t, e),
59
+ ...i(s, e)
57
60
  ];
58
- }, k = () => {
59
- var a;
60
- return ((a = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : a.getAttribute("content")) ?? "";
61
- }, v = (a) => typeof a == "string" ? a : typeof a == "number" ? String(a) : "", y = (a) => {
62
- if (a === null || typeof a != "object" || Array.isArray(a))
61
+ }, F = () => {
62
+ var t;
63
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
64
+ }, T = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "", x = (t) => {
65
+ if (t === null || typeof t != "object" || Array.isArray(t))
63
66
  return !1;
64
- const c = Object.getPrototypeOf(a);
65
- return c === Object.prototype || c === null;
67
+ const r = Object.getPrototypeOf(t);
68
+ return r === Object.prototype || r === null;
66
69
  };
67
70
  export {
68
- v as asText,
69
- i as buildMergeTagEntries,
70
- u as dynamicContentToMergeTags,
71
- b as flattenDynamicContentList,
72
- k as getCsrfToken,
73
- y as isPlainObject,
74
- o as mergeTagToDynamicContent
71
+ T as asText,
72
+ d as buildMergeTagEntries,
73
+ i as dynamicContentToMergeTags,
74
+ $ as flattenDynamicContentList,
75
+ F as getCsrfToken,
76
+ x as isPlainObject,
77
+ k as mergeTagToDynamicContent
75
78
  };
@@ -0,0 +1,15 @@
1
+ const E = "time-format", r = "date", u = new RegExp(`^${r}\\s*:\\s*(?:"([^"]*)"|'([^']*)')$`), s = /%[-_0^#]?\d*[a-zA-Z%]/, c = new RegExp(s, "g"), l = /\b(?:Y{2,4}|M{2,4}|D{1,4}|d{3,4}|H{2}|h{2}|m{2}|s{2}|S{1,3}|A|a)\b/, T = (t) => t.includes('"') ? t.includes("'") ? null : `'${t}'` : `"${t}"`, i = (t) => s.test(t) && !l.test(t.replace(c, "")), R = (t) => {
2
+ if (t.key !== E || !i(t.value ?? ""))
3
+ return null;
4
+ const n = T(t.value);
5
+ return n === null ? null : `${r}: ${n}`;
6
+ }, _ = (t) => {
7
+ const [, n, o] = t.match(u) ?? [], e = n ?? o;
8
+ return e ? { key: E, value: e } : null;
9
+ };
10
+ export {
11
+ E as TIME_FORMAT_KEY,
12
+ R as formatToLiquidFilter,
13
+ _ as liquidFilterToFormat,
14
+ T as quoteArgument
15
+ };