@useinsider/guido 3.18.2-beta.963f84e → 3.18.2-beta.9be830c

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/dist/@types/config/schemas.js +15 -13
  2. package/dist/components/Guido.vue.js +7 -7
  3. package/dist/components/Guido.vue2.js +30 -30
  4. package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -70
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
  8. package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
  9. package/dist/components/organisms/header/AutoSaveStatus.vue2.js +27 -0
  10. package/dist/components/organisms/header/EditorActions.vue.js +13 -13
  11. package/dist/components/organisms/header/EditorActions.vue2.js +36 -52
  12. package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
  13. package/dist/components/organisms/header/EditorActionsMenu.vue2.js +48 -0
  14. package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
  15. package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
  16. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  17. package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
  18. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
  19. package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
  20. package/dist/components/organisms/header/RightSlot.vue.js +9 -8
  21. package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
  22. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
  23. package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
  24. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
  25. package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
  26. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
  27. package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +82 -0
  28. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
  29. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +54 -38
  30. package/dist/composables/useAccessibilityApi.js +35 -0
  31. package/dist/composables/useCustomInterfaceAppearance.js +45 -52
  32. package/dist/composables/useHtmlValidator.js +82 -87
  33. package/dist/composables/useRecommendation.js +35 -40
  34. package/dist/composables/useStripo.js +30 -30
  35. package/dist/config/i18n/en/labels.json.js +36 -4
  36. package/dist/config/i18n/en/tooltips.json.js +2 -1
  37. package/dist/enums/extensions/recommendationBlock.js +31 -38
  38. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  39. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  40. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -40
  41. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
  42. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
  43. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -189
  44. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +16 -26
  45. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  46. package/dist/guido.css +1 -1
  47. package/dist/node_modules/@vueuse/core/index.js +102 -0
  48. package/dist/node_modules/@vueuse/shared/index.js +40 -28
  49. package/dist/sprite.svg +6 -0
  50. package/dist/src/@types/config/schemas.d.ts +4 -0
  51. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +3 -1
  52. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -3
  53. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -3
  54. package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
  55. package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
  56. package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
  57. package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
  58. package/dist/src/composables/useActionsApi.d.ts +2 -2
  59. package/dist/src/composables/useConfig.d.ts +2 -0
  60. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  61. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  62. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  63. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +2 -7
  66. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -75
  67. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  68. package/dist/src/stores/config.d.ts +18 -0
  69. package/dist/src/stores/editor.d.ts +107 -0
  70. package/dist/src/stores/onboarding.d.ts +195 -21
  71. package/dist/src/stores/version-history.d.ts +1 -1
  72. package/dist/src/utils/timeUtil.d.ts +10 -0
  73. package/dist/static/styles/components/accessibility.css.js +282 -0
  74. package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
  75. package/dist/static/styles/variables.css.js +2 -0
  76. package/dist/stores/editor.js +13 -4
  77. package/dist/stores/onboarding.js +66 -50
  78. package/dist/utils/templatePreparation.js +55 -55
  79. package/dist/utils/timeUtil.js +7 -17
  80. package/package.json +1 -1
  81. package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
  82. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
  83. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  84. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
  85. package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +0 -24
  86. package/dist/src/extensions/Blocks/Recommendation/utils/strategyCommit.d.ts +0 -14
  87. package/dist/static/styles/components/skeleton.css.js +0 -23
  88. /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
  89. /package/dist/src/components/organisms/{onboarding/RecommendationStrategyOnboarding.vue.d.ts → header/EditorActionsMenu.vue.d.ts} +0 -0
@@ -0,0 +1,282 @@
1
+ const e = `/* Stripo Accessibility Checker panel (ue-accessibility-panel).
2
+ Stripo's defaults derive icon/button/outline colors from --ue-primary-color,
3
+ whose stock hue is green (129) — Figma DT-33912 wants Insider blue. */
4
+
5
+ /* Stripo sizes the panel to its content (max-height: 100%), so short tabs (Ignored, empty
6
+ states) end mid-page; the design keeps it full height in every state. */
7
+ ue-ui-simple-panel.accessibility-panel,
8
+ ue-accessibility-panel {
9
+ height: 100%;
10
+ }
11
+
12
+ /* The refresh button only renders once results land; reserve its 50x50 slot so the
13
+ header keeps the same height and title width while the check is loading. */
14
+ ue-accessibility-panel .header-control-panel-right {
15
+ min-width: 50px;
16
+ min-height: 50px;
17
+ }
18
+
19
+ /* Failed / Passed / Ignored count chips. Stripo paints them as filled
20
+ red/green/blue pills via .accent.error / .accent.success. */
21
+ ue-accessibility-panel .tabs-header .accent {
22
+ min-width: 21px;
23
+ margin-left: 8px;
24
+ padding: 3px 5px;
25
+ border: 1px solid var(--guido-color-gray-300);
26
+ border-radius: 4px;
27
+ background-color: var(--guido-color-white);
28
+ color: var(--guido-color-gray-800);
29
+ font-size: 13px;
30
+ font-weight: 400;
31
+ line-height: 16px;
32
+ }
33
+
34
+ ue-accessibility-panel .tabs-header button.checked .accent {
35
+ border-color: var(--guido-color-primary-500);
36
+ color: var(--guido-color-primary-500);
37
+ }
38
+
39
+ /* Issue card */
40
+ ue-accessibility-panel .issue-card-surface {
41
+ border-radius: 8px;
42
+ outline: 1px solid var(--guido-color-gray-300);
43
+ outline-offset: -1px;
44
+ }
45
+
46
+ ue-accessibility-panel .issue-card-surface--active {
47
+ outline-color: var(--guido-color-primary-500);
48
+ }
49
+
50
+ ue-accessibility-panel .issue-card-title {
51
+ color: var(--guido-color-gray-800);
52
+ }
53
+
54
+ /* Per-issue help "?" icon: 14x14 glyph centered in a 24x24 hit area. Stripo
55
+ renders the ue-icon svg at width/height 100%, so it fills the whole box —
56
+ pin the svg to 14px and center it. */
57
+ ue-accessibility-panel .issue-card-header-row .icon-help {
58
+ display: inline-flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ width: 24px;
62
+ height: 24px;
63
+ color: var(--guido-color-gray-600);
64
+ }
65
+
66
+ ue-accessibility-panel .issue-card-header-row .icon-help svg {
67
+ width: 14px;
68
+ height: 14px;
69
+ }
70
+
71
+ /* Severity icons: Critical (cross-circle), Serious (warning), Moderate (info) */
72
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.danger {
73
+ color: var(--guido-color-danger-500);
74
+ }
75
+
76
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.warning {
77
+ color: var(--guido-color-warning-500);
78
+ }
79
+
80
+ ue-accessibility-panel .issue-card-header-row ue-icon-component.info {
81
+ color: var(--guido-color-primary-500);
82
+ }
83
+
84
+ /* Passed tab is read-only. Stripo already blocks pointer events on these controls but only
85
+ styles the alt-text input as disabled; give the selects and color inputs the same look. */
86
+ ue-accessibility-passed-tab input,
87
+ ue-accessibility-passed-tab ue-select .toggle-select-button {
88
+ opacity: 0.6;
89
+ cursor: not-allowed;
90
+ }
91
+
92
+ /* Contrast card rows (Figma 4522:11243): a 10px section inset holding 50px rows with 16px
93
+ side padding, so labels and swatches sit 26px in while the action buttons stay at 10px. */
94
+ ue-accessibility-panel .controls-separator-line:has(.fit-to-color) {
95
+ padding: 10px;
96
+ }
97
+
98
+ /* Passed cards pin a 24px instance-count badge 8px off the bottom-right corner, where the
99
+ right-aligned ratio now ends; keep the last row clear of it. */
100
+ ue-accessibility-passed-tab .controls-separator-line:has(.fit-to-color) {
101
+ padding-bottom: 34px;
102
+ }
103
+
104
+ ue-accessibility-panel .controls-separator-line:has(.fit-to-color) .sub-container.two-columns {
105
+ box-sizing: border-box;
106
+ min-height: 50px;
107
+ padding: 5px 16px;
108
+ align-items: center;
109
+ }
110
+
111
+ /* Ratio value: Stripo left-aligns it in a swatch-wide box; the design ends it at the
112
+ swatches' right edge, behind a 16px glyph in a 24px icon box. */
113
+ ue-accessibility-panel .controls-list.fit-to-color {
114
+ justify-content: flex-end;
115
+ align-items: center;
116
+ gap: 0;
117
+ font-size: 13px;
118
+ line-height: 16px;
119
+ }
120
+
121
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component {
122
+ align-items: center;
123
+ justify-content: center;
124
+ width: 24px;
125
+ height: 24px;
126
+ margin: 0;
127
+ }
128
+
129
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component svg {
130
+ width: 16px;
131
+ height: 16px;
132
+ }
133
+
134
+ ue-accessibility-panel .controls-list.fit-to-color ue-icon-component.warning {
135
+ color: var(--guido-color-warning-500);
136
+ }
137
+
138
+ /* Empty states (Figma 5122:17577, DS InNoData): the DS "no-personalization" art above a
139
+ title and description, centered in the tab. Failed/Ignored text comes from localePatch as
140
+ "Title\\nDescription" and ::first-line styles the title; Passed renders nothing when empty,
141
+ so it gets the same box from generated content. */
142
+ ue-accessibility-panel {
143
+ --ue-accessibility-image-width: 240px;
144
+ --ue-accessibility-image-height: 240px;
145
+ }
146
+
147
+ /* The scroll area only grows to its content (max-height: 100%); stretch it to the panel
148
+ bottom so the empty state can center in the space below the tabs. */
149
+ ue-accessibility-panel ue-scrollable-container:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) {
150
+ flex-grow: 1;
151
+ }
152
+
153
+ ue-accessibility-panel ue-scrollable-container:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) .ue-scrollable {
154
+ height: 100%;
155
+ }
156
+
157
+ ue-accessibility-panel .ue-scrollable-content:has(.accessibility-list-empty, ue-accessibility-passed-tab:empty) {
158
+ display: flex;
159
+ flex-direction: column;
160
+ justify-content: center;
161
+ min-height: 100%;
162
+ }
163
+
164
+ ue-accessibility-panel .accessibility-list-empty.light-theme.failed-list,
165
+ ue-accessibility-panel .accessibility-list-empty.light-theme.ignored-list,
166
+ ue-accessibility-passed-tab:empty::before {
167
+ display: block;
168
+ height: auto;
169
+ margin: 0;
170
+ padding: 248px 16px 0;
171
+ background: url("https://image.useinsider.com/insider-design-system/img/speacial/no-personalization.svg") no-repeat center top / 240px 240px;
172
+ color: var(--guido-color-neutral-500);
173
+ font-size: 15px;
174
+ line-height: 24px;
175
+ text-align: center;
176
+ white-space: pre-line;
177
+ }
178
+
179
+ /* Stripo renders nothing at all for an empty Passed tab, so this copy cannot come from the
180
+ localePatch like its Failed/Ignored siblings in src/config/i18n/en/labels.json — keep the
181
+ three wordings in step by hand. \`display: block\` makes the host a block container so
182
+ ::first-line below can reach the title inside the generated content. */
183
+ ue-accessibility-passed-tab:empty {
184
+ display: block;
185
+ }
186
+
187
+ ue-accessibility-passed-tab:empty::before {
188
+ content: "No Passed Items\\A You have no passed items.";
189
+ }
190
+
191
+ /* Title is 18/24 with InNoData's 8px gap below it; a 40px line box gives both, and its
192
+ extra 8px on top is why the padding above is 248px, not 240 + 16. */
193
+ ue-accessibility-panel .accessibility-list-empty::first-line,
194
+ ue-accessibility-passed-tab:empty::first-line {
195
+ color: var(--guido-color-neutral-700);
196
+ font-size: 18px;
197
+ line-height: 40px;
198
+ }
199
+
200
+ /* Card actions: Ignore / Un-ignore / Auto-tune are neutral, Apply is primary */
201
+ ue-accessibility-panel .e2e-ignore-button > .button,
202
+ ue-accessibility-panel .e2e-unignore-button > .button,
203
+ ue-accessibility-panel .e2e-auto-tune-button > .button {
204
+ border: none;
205
+ background-color: var(--guido-color-neutral-200);
206
+ color: var(--guido-color-neutral-800);
207
+ }
208
+
209
+ ue-accessibility-panel .e2e-ignore-button > .button .icon-button,
210
+ ue-accessibility-panel .e2e-unignore-button > .button .icon-button,
211
+ ue-accessibility-panel .e2e-auto-tune-button > .button .icon-button {
212
+ color: var(--guido-color-neutral-800);
213
+ }
214
+
215
+ ue-accessibility-panel .e2e-ignore-button > .button:hover:not(:disabled,.disabled),
216
+ ue-accessibility-panel .e2e-unignore-button > .button:hover:not(:disabled,.disabled),
217
+ ue-accessibility-panel .e2e-auto-tune-button > .button:hover:not(:disabled,.disabled) {
218
+ background-color: var(--guido-color-neutral-100);
219
+ }
220
+
221
+ ue-accessibility-panel .e2e-apply-button > .button {
222
+ border: none;
223
+ background-color: var(--guido-color-primary-100);
224
+ color: var(--guido-color-primary-500);
225
+ }
226
+
227
+ ue-accessibility-panel .e2e-apply-button > .button .icon-button {
228
+ color: var(--guido-color-primary-500);
229
+ }
230
+
231
+ ue-accessibility-panel .e2e-apply-button > .button:hover:not(:disabled,.disabled) {
232
+ background-color: var(--guido-color-primary-0);
233
+ }
234
+
235
+ /* Re-run check button (header control). Stripo tints the rotate icon with
236
+ --ue-primary-color; Figma DT-33912 wants Insider primary. Not inside
237
+ ue-accessibility-panel, so scoped by its own e2e class. */
238
+ .e2e-accessibility-refresh .icon-button {
239
+ color: var(--guido-color-primary-500);
240
+ }
241
+
242
+ /* Help-icon hint. The popover is portalled outside the panel, so it cannot be
243
+ scoped to ue-accessibility-panel. Stripo tints the link with --ue-primary-color. */
244
+ .ue-popover.dark,
245
+ .ue-popover.dark-tiny {
246
+ border-radius: 4px;
247
+ background: var(--guido-color-gray-800);
248
+ box-shadow: 0 15px 17.5px rgb(0 0 0 / 10%), 0 8px 5px rgb(0 0 0 / 10%);
249
+ color: var(--guido-color-white);
250
+ font-size: 13px;
251
+ line-height: 16px;
252
+ }
253
+
254
+ .ue-popover.dark .popup-pointer ue-icon-component svg,
255
+ .ue-popover.dark-tiny .popup-pointer ue-icon-component svg {
256
+ fill: var(--guido-color-gray-800);
257
+ }
258
+
259
+ /* Any anchor in the hint, not just the ue-description wrapper: the accessibility
260
+ checker's "Read more … ACT Rules Community Group forum." link renders outside it
261
+ and would otherwise keep Stripo's primary tint, unreadable on the dark surface.
262
+ The ue-description forms match Stripo's own \`.ue-popover.dark-tiny ue-description a\`
263
+ specificity; this file is appended last, so the tie goes to Figma's white link. */
264
+ .ue-popover.dark a,
265
+ .ue-popover.dark-tiny a,
266
+ .ue-popover.dark ue-description a,
267
+ .ue-popover.dark-tiny ue-description a {
268
+ color: var(--guido-color-white);
269
+ text-decoration: underline;
270
+ }
271
+
272
+ /* Stripo ships \`ue-description a { display: none }\`, which hides the per-rule "Read more"
273
+ link even though it already carries the right ACT/Deque URL. Re-show only those links,
274
+ keyed by host, so no other editor hint starts showing links Stripo meant to hide. */
275
+ .ue-popover ue-description a[href^="https://act-rules.github.io/"],
276
+ .ue-popover ue-description a[href^="https://dequeuniversity.com/"] {
277
+ display: inline;
278
+ }
279
+ `;
280
+ export {
281
+ e as default
282
+ };
@@ -49,8 +49,11 @@ const n = `.strategy-control-header {
49
49
  white-space: nowrap;
50
50
  }
51
51
 
52
- .strategy-control-cta.primary > .button {
52
+ .strategy-control-cta.primary > .button:disabled,
53
+ .strategy-control-cta.primary > .button.disabled {
54
+ opacity: 1;
53
55
  color: var(--guido-color-gray-800);
56
+ cursor: default;
54
57
  }
55
58
 
56
59
  .strategy-control-name-band {
@@ -68,39 +71,6 @@ const n = `.strategy-control-header {
68
71
  line-height: 24px;
69
72
  }
70
73
 
71
- /* Each skeleton mirrors the footprint of the element it stands in for, so retiring
72
- the loading state does not shift the panel. */
73
- .guido-skeleton--strategy-title {
74
- width: 366px;
75
- height: 38px;
76
- }
77
-
78
- .guido-skeleton--strategy-description {
79
- width: 366px;
80
- height: 48px;
81
- }
82
-
83
- .guido-skeleton--strategy-cta {
84
- width: 175px;
85
- height: 40px;
86
- }
87
-
88
- .guido-skeleton--strategy-name {
89
- width: 398px;
90
- height: 48px;
91
- }
92
-
93
- .strategy-control-skeleton-row {
94
- display: flex;
95
- gap: 16px;
96
- padding: 0 16px 16px;
97
- }
98
-
99
- [data-strategy-loading-state] .guido-skeleton {
100
- display: block;
101
- }
102
-
103
-
104
74
  .strategy-control-actions {
105
75
  display: flex;
106
76
  align-items: center;
@@ -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,6 +6,9 @@ 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,
11
14
  isStripoInitialized: !1,
@@ -17,20 +20,26 @@ const o = e("guidoEditor", {
17
20
  }),
18
21
  getters: {
19
22
  // Middle Slot
20
- isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen,
23
+ isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
21
24
  isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
22
25
  isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
23
26
  isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
24
27
  isPreviewButtonDisabled: (i) => i.loadingStatus,
25
28
  isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
26
29
  // Right Slot
30
+ // Normal editing: neither the version-history nor the accessibility-testing
31
+ // takeover, both of which swap the right slot — kebab included — for their own
32
+ // controls, so anything anchored to it has nothing to point at.
33
+ isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
27
34
  isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
28
35
  isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
29
36
  isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
30
37
  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
38
+ isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
39
+ // Autosave. Accessibility testing belongs with the other takeovers: the mode drives
40
+ // Stripo through simulations (hidden images, color-vision filters) that a save
41
+ // landing mid-simulation would capture.
42
+ isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen && !i.isAccessibilityTestingOpen
34
43
  }
35
44
  });
36
45
  export {
@@ -1,64 +1,75 @@
1
- import { useOnboardingApi as e } from "../services/onboardingApi.js";
2
- import { defineStore as s } from "pinia";
3
- const t = () => ({
1
+ import { useOnboardingApi as t } from "../services/onboardingApi.js";
2
+ import { defineStore as e } from "pinia";
3
+ const r = () => ({
4
4
  cardIndex: 0,
5
5
  isActive: !1,
6
6
  config: []
7
7
  }), a = () => ({
8
8
  onboardings: {
9
- newVersionPopup: t(),
10
- genericOnboarding: t(),
11
- textBlockOnboarding: t(),
12
- versionHistoryOnboarding: t(),
13
- ampOnboarding: t(),
14
- itemsOnboarding: t(),
15
- recommendationStrategyOnboarding: t()
9
+ newVersionPopup: r(),
10
+ genericOnboarding: r(),
11
+ textBlockOnboarding: r(),
12
+ versionHistoryOnboarding: r(),
13
+ ampOnboarding: r(),
14
+ itemsOnboarding: r(),
15
+ editorTabBarOnboarding: r()
16
16
  },
17
17
  userModalState: {},
18
- isFetched: !1
19
- }), c = s("guidoOnboarding", {
18
+ isFetched: !1,
19
+ // Onboardings the user closed in this page session. The saved state cannot stand in
20
+ // for it: close() fills it even when the save fails, and a test stub can keep
21
+ // reporting "unseen". Being wiped by another onboarding is deliberately not in here,
22
+ // so an interrupted tour can come back once that other one is done.
23
+ closedThisSession: []
24
+ }), g = e("guidoOnboarding", {
20
25
  state: () => a(),
21
26
  getters: {
22
- getOnboarding: (n) => (o) => n.onboardings[o],
23
- isActive: (n) => (o) => n.onboardings[o].isActive,
24
- getCurrentCard: (n) => (o) => {
25
- const i = n.onboardings[o];
26
- return i.config[i.cardIndex];
27
+ getOnboarding: (n) => (i) => n.onboardings[i],
28
+ isActive: (n) => (i) => n.onboardings[i].isActive,
29
+ getCurrentCard: (n) => (i) => {
30
+ const o = n.onboardings[i];
31
+ return o.config[o.cardIndex];
27
32
  },
28
33
  getGenericCurrentCard: (n) => {
29
- const { genericOnboarding: o } = n.onboardings;
30
- return o.config[o.cardIndex];
34
+ const { genericOnboarding: i } = n.onboardings;
35
+ return i.config[i.cardIndex];
31
36
  },
32
37
  getTextBlockCurrentCard: (n) => {
33
- const { textBlockOnboarding: o } = n.onboardings;
34
- return o.config[o.cardIndex];
38
+ const { textBlockOnboarding: i } = n.onboardings;
39
+ return i.config[i.cardIndex];
35
40
  },
36
41
  getVersionHistoryCurrentCard: (n) => {
37
- const { versionHistoryOnboarding: o } = n.onboardings;
38
- return o.config[o.cardIndex];
42
+ const { versionHistoryOnboarding: i } = n.onboardings;
43
+ return i.config[i.cardIndex];
39
44
  },
40
45
  getAmpCurrentCard: (n) => {
41
- const { ampOnboarding: o } = n.onboardings;
42
- return o.config[o.cardIndex];
46
+ const { ampOnboarding: i } = n.onboardings;
47
+ return i.config[i.cardIndex];
43
48
  },
44
49
  getItemsCurrentCard: (n) => {
45
- const { itemsOnboarding: o } = n.onboardings;
46
- return o.config[o.cardIndex];
50
+ const { itemsOnboarding: i } = n.onboardings;
51
+ return i.config[i.cardIndex];
47
52
  },
48
- getRecommendationStrategyCurrentCard: (n) => {
49
- const { recommendationStrategyOnboarding: o } = n.onboardings;
50
- return o.config[o.cardIndex];
53
+ getEditorTabBarCurrentCard: (n) => {
54
+ const { editorTabBarOnboarding: i } = n.onboardings;
55
+ return i.config[i.cardIndex];
56
+ },
57
+ // Every tab-bar tour card after the first points at a row inside the kebab menu,
58
+ // so the menu has to stay open under them.
59
+ isEditorActionsMenuPinned: (n) => {
60
+ const { editorTabBarOnboarding: i } = n.onboardings;
61
+ return i.isActive && i.cardIndex > 0;
51
62
  },
52
- shouldShowOnboarding: (n) => (o) => {
53
- const i = n.userModalState.Guido;
54
- return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
63
+ shouldShowOnboarding: (n) => (i) => {
64
+ const o = n.userModalState.Guido;
65
+ return i === "newVersionPopup" && (o != null && o.genericOnboarding) ? !1 : o ? !o[i] : !0;
55
66
  }
56
67
  },
57
68
  actions: {
58
69
  closeOtherOnboardings(n) {
59
- Object.keys(this.onboardings).forEach((o) => {
60
- const i = o;
61
- i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
70
+ Object.keys(this.onboardings).forEach((i) => {
71
+ const o = i;
72
+ o !== n && this.onboardings[o].isActive && (this.onboardings[o].isActive = !1, this.onboardings[o].cardIndex = 0, this.onboardings[o].config = []);
62
73
  });
63
74
  },
64
75
  start(n) {
@@ -68,7 +79,12 @@ const t = () => ({
68
79
  this.shouldShowOnboarding(n) && !this.isActive(n) && this.start(n);
69
80
  },
70
81
  async close(n) {
71
- await this.setUserModalState(n, "true", "Guido"), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [];
82
+ this.closedThisSession.includes(n) || this.closedThisSession.push(n), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [];
83
+ try {
84
+ await this.setUserModalState(n, "true", "Guido");
85
+ } catch (i) {
86
+ console.warn("guido:onboarding:close-not-persisted", n, i);
87
+ }
72
88
  },
73
89
  next(n) {
74
90
  this.onboardings[n].cardIndex < this.onboardings[n].config.length - 1 && this.onboardings[n].cardIndex++;
@@ -76,15 +92,15 @@ const t = () => ({
76
92
  previous(n) {
77
93
  this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
78
94
  },
79
- updateCardPosition(n, o, i) {
80
- const r = this.onboardings[n].config[o];
81
- r && (r.top = i.top, r.position = i.position);
95
+ updateCardPosition(n, i, o) {
96
+ const s = this.onboardings[n].config[i];
97
+ s && (s.top = o.top, s.position = o.position);
82
98
  },
83
- setConfig(n, o) {
84
- this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
99
+ setConfig(n, i) {
100
+ this.onboardings[n].config = i ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
85
101
  },
86
102
  async onDiscoverNowClicked() {
87
- await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
103
+ this.start("genericOnboarding"), await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido");
88
104
  },
89
105
  onRemindMeLater() {
90
106
  sessionStorage.setItem("newVersionPopupDismissed", "true");
@@ -98,19 +114,19 @@ const t = () => ({
98
114
  async fetchUserModalState() {
99
115
  if (this.isFetched)
100
116
  return;
101
- const { fetchUserModalState: n } = e();
117
+ const { fetchUserModalState: n } = t();
102
118
  try {
103
- const o = await n();
104
- this.userModalState = o, this.isFetched = !0;
119
+ const i = await n();
120
+ this.userModalState = i, this.isFetched = !0;
105
121
  } catch {
106
122
  }
107
123
  },
108
- async setUserModalState(n, o, i) {
109
- const { setUserModalState: r } = e();
110
- await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
124
+ async setUserModalState(n, i, o) {
125
+ const { setUserModalState: s } = t();
126
+ await s(n, i, o), this.isFetched = !1, await this.fetchUserModalState();
111
127
  }
112
128
  }
113
129
  });
114
130
  export {
115
- c as useOnboardingStore
131
+ g as useOnboardingStore
116
132
  };