@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.
- package/README.md +1 -1
- package/dist/@types/config/schemas.js +37 -38
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +112 -103
- package/dist/components/organisms/AutoSaveController.vue2.js +20 -10
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +25 -0
- package/dist/components/organisms/header/EditorActions.vue.js +13 -13
- package/dist/components/organisms/header/EditorActions.vue2.js +58 -73
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +98 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +9 -17
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +11 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -18
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +22 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +19 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +90 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +60 -35
- package/dist/composables/useAccessibilityApi.js +51 -0
- package/dist/composables/useBlocksConfig.js +24 -32
- package/dist/composables/useCustomInterfaceAppearance.js +42 -41
- package/dist/config/i18n/en/labels.json.js +36 -4
- package/dist/config/i18n/en/tooltips.json.js +2 -1
- package/dist/enums/academy.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +92 -93
- package/dist/node_modules/valibot/dist/index.js +261 -297
- package/dist/sprite.svg +10 -0
- package/dist/src/@types/config/schemas.d.ts +2 -4
- package/dist/src/components/organisms/AutoSaveController.vue.d.ts +19 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -19
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -19
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +13 -0
- package/dist/src/composables/useActionsApi.d.ts +2 -2
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/stores/autosave.d.ts +73 -1
- package/dist/src/stores/config.d.ts +20 -166
- package/dist/src/stores/editor.d.ts +109 -0
- package/dist/src/stores/onboarding.d.ts +966 -35
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/timeUtil.d.ts +5 -8
- package/dist/static/styles/components/accessibility.css.js +234 -0
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/autosave.js +12 -7
- package/dist/stores/config.js +6 -13
- package/dist/stores/editor.js +8 -3
- package/dist/stores/onboarding.js +48 -22
- package/dist/utils/pairProductVariables.js +14 -15
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +1 -1
- package/dist/@types/display-condition.js +0 -25
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -20
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -71
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -34
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -57
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- package/dist/composables/useDisplayConditions.js +0 -102
- package/dist/enums/display-condition.js +0 -12
- package/dist/extensions/DisplayConditions/bridge.js +0 -17
- package/dist/extensions/DisplayConditions/constants.js +0 -17
- package/dist/extensions/DisplayConditions/control.js +0 -178
- package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -201
- package/dist/extensions/DisplayConditions/extension.js +0 -28
- package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
- package/dist/extensions/DisplayConditions/library.js +0 -27
- package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
- package/dist/services/displayConditionApi.js +0 -39
- package/dist/src/@types/display-condition.d.ts +0 -59
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
- package/dist/src/composables/useDisplayConditions.d.ts +0 -16
- package/dist/src/enums/display-condition.d.ts +0 -15
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -6
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -14
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -23
- package/dist/src/extensions/DisplayConditions/extension.d.ts +0 -2
- package/dist/src/extensions/DisplayConditions/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/DisplayConditions/library.d.ts +0 -8
- package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +0 -5
- package/dist/src/mock/api/display-conditions.d.ts +0 -2
- package/dist/src/services/displayConditionApi.d.ts +0 -8
- package/dist/src/stores/display-condition.d.ts +0 -81
- package/dist/src/utils/displayCondition.d.ts +0 -10
- package/dist/src/utils/protectTableText.d.ts +0 -2
- package/dist/stores/display-condition.js +0 -28
- package/dist/utils/displayCondition.js +0 -26
- package/dist/utils/protectTableText.js +0 -22
- /package/dist/src/components/organisms/{display-conditions/DisplayConditionCreateDrawer.vue.d.ts → header/AutoSaveStatus.vue.d.ts} +0 -0
- /package/dist/src/components/organisms/{display-conditions/DisplayConditionSelectDrawer.vue.d.ts → header/EditorActionsMenu.vue.d.ts} +0 -0
- /package/dist/src/components/organisms/{display-conditions/DisplayConditionsHost.vue.d.ts → header/accessibility/AccessibilityToolbar.vue.d.ts} +0 -0
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → accessibility/ColorVisionSelect.vue.d.ts} +0 -0
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @example formatLocalTime(date, true) -> 12:20:02 (UTC+3 Istanbul)
|
|
7
|
-
*/
|
|
8
|
-
export declare const formatLocalTime: (date: Date, useTimezone?: boolean) => string;
|
|
1
|
+
export declare const autoSaveTimestamp: (date: Date, now?: Date) => {
|
|
2
|
+
isToday: boolean;
|
|
3
|
+
time: string;
|
|
4
|
+
date: string;
|
|
5
|
+
};
|
|
@@ -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);
|
package/dist/stores/autosave.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
const
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
|
+
const s = {
|
|
3
3
|
IDLE: "idle",
|
|
4
4
|
SAVING: "saving",
|
|
5
5
|
SAVED: "saved",
|
|
6
6
|
ERROR: "error"
|
|
7
|
-
},
|
|
7
|
+
}, S = e("guidoAutosave", {
|
|
8
8
|
state: () => ({
|
|
9
9
|
isOn: !0,
|
|
10
10
|
lastSavedAt: null,
|
|
11
|
-
status:
|
|
12
|
-
})
|
|
11
|
+
status: s.IDLE
|
|
12
|
+
}),
|
|
13
|
+
getters: {
|
|
14
|
+
// Whether the header actually renders autosave text: the divider beside it must not be
|
|
15
|
+
// left hanging over empty space when it does not.
|
|
16
|
+
hasStatusLabel: (t) => t.status === s.SAVING || t.status === s.SAVED && t.lastSavedAt !== null
|
|
17
|
+
}
|
|
13
18
|
});
|
|
14
19
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
s as AUTOSAVE_STATUS,
|
|
21
|
+
S as useAutosaveStore
|
|
17
22
|
};
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MessageType as
|
|
1
|
+
import { MessageType as r } from "../@types/config/schemas.js";
|
|
2
2
|
import "../@types/config/defaults.js";
|
|
3
|
-
import { parseConfig as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
const g =
|
|
3
|
+
import { parseConfig as a } from "../@types/config/validator.js";
|
|
4
|
+
import { defineStore as o } from "pinia";
|
|
5
|
+
const g = o("guido-config", {
|
|
6
6
|
state: () => ({
|
|
7
7
|
initialized: !1,
|
|
8
8
|
config: null
|
|
@@ -132,7 +132,7 @@ const g = l("guido-config", {
|
|
|
132
132
|
* consumers stay safe in setup where a raw config read snapshots null (SD-147945).
|
|
133
133
|
*/
|
|
134
134
|
isTransactional() {
|
|
135
|
-
return this.messageType ===
|
|
135
|
+
return this.messageType === r.TRANSACTIONAL;
|
|
136
136
|
},
|
|
137
137
|
/**
|
|
138
138
|
* Soft-save policy: may the editor persist a template with validation errors?
|
|
@@ -158,13 +158,6 @@ const g = l("guido-config", {
|
|
|
158
158
|
var e, t;
|
|
159
159
|
return ((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.showHeader) ?? !0;
|
|
160
160
|
},
|
|
161
|
-
/**
|
|
162
|
-
* Check if the Insider display-condition UI replaces Stripo's
|
|
163
|
-
*/
|
|
164
|
-
externalDisplayConditions: (i) => {
|
|
165
|
-
var e, t, n, r;
|
|
166
|
-
return (((t = (e = i.config) == null ? void 0 : e.ui) == null ? void 0 : t.externalDisplayConditions) ?? !1) && (((r = (n = i.config) == null ? void 0 : n.features) == null ? void 0 : r.displayConditions) ?? !0);
|
|
167
|
-
},
|
|
168
161
|
/**
|
|
169
162
|
* Check if a specific feature is enabled.
|
|
170
163
|
* Returns false before init (config null) so header controls don't
|
|
@@ -181,7 +174,7 @@ const g = l("guido-config", {
|
|
|
181
174
|
* Initialize the config store with validated configuration
|
|
182
175
|
*/
|
|
183
176
|
init(i) {
|
|
184
|
-
const e =
|
|
177
|
+
const e = a(i);
|
|
185
178
|
this.config = e, this.initialized = !0;
|
|
186
179
|
},
|
|
187
180
|
/**
|
package/dist/stores/editor.js
CHANGED
|
@@ -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
|
// Bumped on every Stripo document change. `hasChanges` is a latch that stays
|
|
@@ -21,19 +24,21 @@ const o = e("guidoEditor", {
|
|
|
21
24
|
}),
|
|
22
25
|
getters: {
|
|
23
26
|
// Middle Slot
|
|
24
|
-
isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen,
|
|
27
|
+
isEditorToolbarVisible: (i) => !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isAccessibilityTestingOpen,
|
|
25
28
|
isUndoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
26
29
|
isRedoButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
27
30
|
isCodeEditorButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
28
31
|
isPreviewButtonDisabled: (i) => i.loadingStatus,
|
|
29
32
|
isViewOptionsDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
30
33
|
// Right Slot
|
|
34
|
+
isNormalMode: (i) => !i.isVersionHistoryOpen && !i.isAccessibilityTestingOpen,
|
|
31
35
|
isVersionHistoryButtonDisabled: (i) => i.loadingStatus || i.isPreviewModeOpen,
|
|
32
36
|
isExportButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
33
37
|
isSaveAsButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
34
38
|
isTestButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen,
|
|
35
|
-
isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen,
|
|
36
|
-
//
|
|
39
|
+
isSaveButtonDisabled: (i) => i.loadingStatus || i.isVersionHistoryOpen || i.isPreviewModeOpen || i.isAccessibilityTestingOpen,
|
|
40
|
+
// Accessibility Test is absent on purpose: it only simulates, but its Apply / Auto-tune
|
|
41
|
+
// edit the document, so pausing autosave there would lose those fixes.
|
|
37
42
|
isInSaveableState: (i) => !i.loadingStatus && !i.isVersionHistoryOpen && !i.isPreviewModeOpen && !i.isCodeEditorOpen
|
|
38
43
|
}
|
|
39
44
|
});
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
1
|
+
import { useOnboardingApi as t } from "../services/onboardingApi.js";
|
|
2
2
|
import { defineStore as s } from "pinia";
|
|
3
|
-
const
|
|
3
|
+
const e = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
6
|
-
config: []
|
|
6
|
+
config: [],
|
|
7
|
+
cardOffset: 0
|
|
7
8
|
}), a = () => ({
|
|
8
9
|
onboardings: {
|
|
9
|
-
newVersionPopup:
|
|
10
|
-
genericOnboarding:
|
|
11
|
-
textBlockOnboarding:
|
|
12
|
-
versionHistoryOnboarding:
|
|
13
|
-
ampOnboarding:
|
|
14
|
-
itemsOnboarding:
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
newVersionPopup: e(),
|
|
11
|
+
genericOnboarding: e(),
|
|
12
|
+
textBlockOnboarding: e(),
|
|
13
|
+
versionHistoryOnboarding: e(),
|
|
14
|
+
ampOnboarding: e(),
|
|
15
|
+
itemsOnboarding: e(),
|
|
16
|
+
editorTabBarOnboarding: e(),
|
|
17
|
+
recommendationStrategyOnboarding: e(),
|
|
18
|
+
recommendationLegacyStrategyOnboarding: e()
|
|
17
19
|
},
|
|
18
20
|
userModalState: {},
|
|
19
|
-
isFetched: !1
|
|
20
|
-
|
|
21
|
+
isFetched: !1,
|
|
22
|
+
closedThisSession: []
|
|
23
|
+
}), g = s("guidoOnboarding", {
|
|
21
24
|
state: () => a(),
|
|
22
25
|
getters: {
|
|
23
26
|
/** @deprecated Components use the type-specific getters. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
@@ -48,6 +51,14 @@ const t = () => ({
|
|
|
48
51
|
const { itemsOnboarding: o } = n.onboardings;
|
|
49
52
|
return o.config[o.cardIndex];
|
|
50
53
|
},
|
|
54
|
+
getEditorTabBarCurrentCard: (n) => {
|
|
55
|
+
const { editorTabBarOnboarding: o } = n.onboardings;
|
|
56
|
+
return o.config[o.cardIndex];
|
|
57
|
+
},
|
|
58
|
+
isEditorActionsMenuPinned: (n) => {
|
|
59
|
+
const { editorTabBarOnboarding: o } = n.onboardings, i = o.config[o.cardIndex];
|
|
60
|
+
return o.isActive && !!(i != null && i.pinsMenu);
|
|
61
|
+
},
|
|
51
62
|
getRecommendationStrategyCurrentCard: (n) => {
|
|
52
63
|
const { recommendationStrategyOnboarding: o } = n.onboardings;
|
|
53
64
|
return o.config[o.cardIndex];
|
|
@@ -65,7 +76,10 @@ const t = () => ({
|
|
|
65
76
|
closeOtherOnboardings(n) {
|
|
66
77
|
Object.keys(this.onboardings).forEach((o) => {
|
|
67
78
|
const i = o;
|
|
68
|
-
i !== n && this.onboardings[i].isActive
|
|
79
|
+
if (i !== n && this.onboardings[i].isActive) {
|
|
80
|
+
const r = this.onboardings[i];
|
|
81
|
+
r.cardOffset += r.cardIndex, r.isActive = !1, r.cardIndex = 0, r.config = [];
|
|
82
|
+
}
|
|
69
83
|
});
|
|
70
84
|
},
|
|
71
85
|
start(n) {
|
|
@@ -74,8 +88,16 @@ const t = () => ({
|
|
|
74
88
|
startOnboarding(n) {
|
|
75
89
|
this.shouldShowOnboarding(n) && !this.isActive(n) && this.start(n);
|
|
76
90
|
},
|
|
91
|
+
closeForSession(n) {
|
|
92
|
+
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;
|
|
93
|
+
},
|
|
77
94
|
async close(n) {
|
|
78
|
-
|
|
95
|
+
this.closeForSession(n);
|
|
96
|
+
try {
|
|
97
|
+
await this.setUserModalState(n, "true", "Guido");
|
|
98
|
+
} catch (o) {
|
|
99
|
+
console.warn("guido:onboarding:close-not-persisted", n, o);
|
|
100
|
+
}
|
|
79
101
|
},
|
|
80
102
|
next(n) {
|
|
81
103
|
this.onboardings[n].cardIndex < this.onboardings[n].config.length - 1 && this.onboardings[n].cardIndex++;
|
|
@@ -88,11 +110,16 @@ const t = () => ({
|
|
|
88
110
|
const r = this.onboardings[n].config[o];
|
|
89
111
|
r && (r.top = i.top, r.position = i.position);
|
|
90
112
|
},
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
// InOnboard always opens on its first slide, so a tour re-installing its config after a
|
|
114
|
+
// Guido remount has to come back to the first card or the two point at different ones.
|
|
115
|
+
resetCardIndex(n) {
|
|
116
|
+
this.onboardings[n].cardIndex = 0;
|
|
117
|
+
},
|
|
118
|
+
setConfig(n, o, i = 0) {
|
|
119
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardOffset = i, this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
93
120
|
},
|
|
94
121
|
async onDiscoverNowClicked() {
|
|
95
|
-
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido")
|
|
122
|
+
this.start("genericOnboarding"), await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido");
|
|
96
123
|
},
|
|
97
124
|
onRemindMeLater() {
|
|
98
125
|
sessionStorage.setItem("newVersionPopupDismissed", "true");
|
|
@@ -100,14 +127,13 @@ const t = () => ({
|
|
|
100
127
|
async onNewVersionPopupClose() {
|
|
101
128
|
await this.setUserModalState("newVersionPopup", "true", "Guido");
|
|
102
129
|
},
|
|
103
|
-
/** @deprecated No caller in src/. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
104
130
|
isOnboardingActive() {
|
|
105
131
|
return Object.values(this.onboardings).some((n) => n.isActive);
|
|
106
132
|
},
|
|
107
133
|
async fetchUserModalState() {
|
|
108
134
|
if (this.isFetched)
|
|
109
135
|
return;
|
|
110
|
-
const { fetchUserModalState: n } =
|
|
136
|
+
const { fetchUserModalState: n } = t();
|
|
111
137
|
try {
|
|
112
138
|
const o = await n();
|
|
113
139
|
this.userModalState = o, this.isFetched = !0;
|
|
@@ -115,11 +141,11 @@ const t = () => ({
|
|
|
115
141
|
}
|
|
116
142
|
},
|
|
117
143
|
async setUserModalState(n, o, i) {
|
|
118
|
-
const { setUserModalState: r } =
|
|
144
|
+
const { setUserModalState: r } = t();
|
|
119
145
|
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
120
146
|
}
|
|
121
147
|
}
|
|
122
148
|
});
|
|
123
149
|
export {
|
|
124
|
-
|
|
150
|
+
g as useOnboardingStore
|
|
125
151
|
};
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { ITEMS_CURRENCY_ATTR as
|
|
1
|
+
import { ITEMS_CURRENCY_ATTR as x, isCustomCurrencySymbol as Y } from "../extensions/Blocks/Items/constants/currency.js";
|
|
2
2
|
import { productPairs as w } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
3
3
|
import { escapeReplacement as X } from "../extensions/Blocks/Items/utils/nodeConfigUtils.js";
|
|
4
4
|
import { preserveTextStyles as P } from "./preserveTextStyles.js";
|
|
5
|
-
import {
|
|
6
|
-
import { unwrapProductNameLinks as j } from "./unwrapProductNameLink.js";
|
|
5
|
+
import { unwrapProductNameLinks as v } from "./unwrapProductNameLink.js";
|
|
7
6
|
const O = {
|
|
8
7
|
CART_ITEMS: "ins_apr",
|
|
9
8
|
BROWSED_ITEMS: "browsed_item",
|
|
10
9
|
PURCHASED_ITEMS: "purchased_item"
|
|
11
10
|
}, q = (S) => S.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
|
|
12
|
-
function
|
|
11
|
+
function B(S, y, b) {
|
|
13
12
|
let h = y;
|
|
14
13
|
for (; h > 0 && /\s/.test(S[h - 1]); )
|
|
15
14
|
h -= 1;
|
|
16
15
|
return b.some((I) => S.endsWith(I, h));
|
|
17
16
|
}
|
|
18
|
-
function
|
|
19
|
-
const y = q(
|
|
20
|
-
|
|
17
|
+
function Z(S) {
|
|
18
|
+
const y = q(S), b = new DOMParser().parseFromString(y, "text/html");
|
|
19
|
+
v(b);
|
|
21
20
|
const h = w.PAIRS_FOR_EXTENSION;
|
|
22
21
|
Object.entries(h).forEach(([n, d]) => {
|
|
23
22
|
b.querySelectorAll(".ins-product-td").forEach((r) => {
|
|
24
23
|
const E = r.getAttribute("data-number") || "1", m = r.getAttribute("data-type") || "CART_ITEMS";
|
|
25
24
|
r.querySelectorAll(`[product-attr="${n}"]`).forEach((t) => {
|
|
26
|
-
var $, F,
|
|
25
|
+
var $, F, D, N;
|
|
27
26
|
const g = t.getAttribute("data-type") || m, o = t.getAttribute("data-number") || E, f = d[g];
|
|
28
27
|
if (f)
|
|
29
28
|
switch (n) {
|
|
@@ -41,7 +40,7 @@ function rt(S) {
|
|
|
41
40
|
}
|
|
42
41
|
const i = (F = ($ = h.name) == null ? void 0 : $[g]) == null ? void 0 : F.ATTR;
|
|
43
42
|
if (i && e.setAttribute("alt", `{{${i}_${o}}}`), a) {
|
|
44
|
-
const s = (
|
|
43
|
+
const s = (D = h.itemLink) == null ? void 0 : D[g];
|
|
45
44
|
if (s) {
|
|
46
45
|
const _ = s.HREF, R = s.DEFAULT_HREF || "#!", u = a.href;
|
|
47
46
|
(u === "#" || u === "" || u.endsWith("#!") || u.endsWith(R) || u === `${window.location.href}${R}` || !u || u === window.location.href) && (a.href = `{{${_}_${o}}}`);
|
|
@@ -61,18 +60,18 @@ function rt(S) {
|
|
|
61
60
|
}
|
|
62
61
|
case "price":
|
|
63
62
|
case "originalPrice": {
|
|
64
|
-
const e = f, a = t.getAttribute("data-formated"), l = t.getAttribute("data-single_price"), c = a === "true", i = l === "true", s = t.getAttribute(
|
|
63
|
+
const e = f, a = t.getAttribute("data-formated"), l = t.getAttribute("data-single_price"), c = a === "true", i = l === "true", s = t.getAttribute(x.POSITION) || "before";
|
|
65
64
|
let _;
|
|
66
65
|
i ? _ = c ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : _ = c ? e.PRICE_FORMATTED : e.PRICE;
|
|
67
66
|
const R = e.CURRENCY;
|
|
68
67
|
let u = `{{${_}_${o}}}`;
|
|
69
|
-
const H = (t.getAttribute(
|
|
68
|
+
const H = (t.getAttribute(x.SYMBOL) || "").trim(), G = Y(H);
|
|
70
69
|
let C = "";
|
|
71
70
|
G ? C = H : R && (C = `{{${R}_${o}}}`), C && (u = s === "after" ? `${u} ${C}` : `${C} ${u}`), t.innerHTML = P(t, u);
|
|
72
71
|
break;
|
|
73
72
|
}
|
|
74
73
|
case "quantity": {
|
|
75
|
-
const e = f, a = e.ATTR, l = [e.DEFAULT, ...e.LEGACY_DEFAULTS], c = (
|
|
74
|
+
const e = f, a = e.ATTR, l = [e.DEFAULT, ...e.LEGACY_DEFAULTS], c = (N = t.textContent) == null ? void 0 : N.trim();
|
|
76
75
|
c && l.includes(c) && (t.innerHTML = P(t, `{{${a}_${o}}}`));
|
|
77
76
|
break;
|
|
78
77
|
}
|
|
@@ -140,12 +139,12 @@ function rt(S) {
|
|
|
140
139
|
const E = w.PAIRS_FOR_EXTENSION.price[d].PRICE, m = w.PAIRS_FOR_EXTENSION.originalPrice[d].PRICE, T = `{% if ${E}_${n} != ${m}_${n} %}`, t = [T, q(T)];
|
|
141
140
|
let g = "", o = 0, f = 0, $ = A.indexOf(r);
|
|
142
141
|
for (; $ !== -1; ) {
|
|
143
|
-
const F = p[f] === !0 && !
|
|
142
|
+
const F = p[f] === !0 && !B(A, $, t);
|
|
144
143
|
g += A.slice(o, $) + (F ? `${T}${r}{% endif %}` : r), o = $ + r.length, f += 1, $ = A.indexOf(r, o);
|
|
145
144
|
}
|
|
146
145
|
A = g + A.slice(o);
|
|
147
|
-
}),
|
|
146
|
+
}), A.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
148
147
|
}
|
|
149
148
|
export {
|
|
150
|
-
|
|
149
|
+
Z as pairProductVariables
|
|
151
150
|
};
|
package/dist/utils/timeUtil.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { timeZone: t } = new Intl.DateTimeFormat().resolvedOptions();
|
|
7
|
-
return ((e = t.split("/").pop()) == null ? void 0 : e.replace(/_/g, " ")) ?? t;
|
|
8
|
-
}, c = (t, e = !1) => {
|
|
9
|
-
const o = t.toLocaleTimeString([], {
|
|
10
|
-
hour: "2-digit",
|
|
11
|
-
hour12: !1,
|
|
12
|
-
minute: "2-digit",
|
|
13
|
-
second: "2-digit"
|
|
14
|
-
});
|
|
15
|
-
return e ? `${o} (${r(t)} ${a()})` : o;
|
|
16
|
-
};
|
|
1
|
+
const g = (t) => String(t).padStart(2, "0"), a = (t, e) => t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), o = (t, e = /* @__PURE__ */ new Date()) => ({
|
|
2
|
+
isToday: a(t, e),
|
|
3
|
+
time: `${g(t.getHours())}:${g(t.getMinutes())}`,
|
|
4
|
+
date: `${g(t.getDate())}.${g(t.getMonth() + 1)}.${t.getFullYear()}`
|
|
5
|
+
});
|
|
17
6
|
export {
|
|
18
|
-
|
|
7
|
+
o as autoSaveTimestamp
|
|
19
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.21.0-beta.
|
|
3
|
+
"version": "3.21.0-beta.c433290",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { object as e, optional as a, string as o, nullish as i, number as t, picklist as n, array as c } from "../node_modules/valibot/dist/index.js";
|
|
2
|
-
const s = n(["liquid", "pongo"]), d = n(["codeOnly", "logicBuilder"]), r = e({
|
|
3
|
-
id: t(),
|
|
4
|
-
name: o(),
|
|
5
|
-
description: i(o(), ""),
|
|
6
|
-
syntax: s,
|
|
7
|
-
method: d,
|
|
8
|
-
codeBefore: o(),
|
|
9
|
-
codeAfter: i(o(), ""),
|
|
10
|
-
createdAt: a(o())
|
|
11
|
-
}), p = e({
|
|
12
|
-
data: c(r),
|
|
13
|
-
meta: e({
|
|
14
|
-
totalCount: t(),
|
|
15
|
-
perPage: t(),
|
|
16
|
-
currentPage: t(),
|
|
17
|
-
lastPage: t()
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
export {
|
|
21
|
-
p as DisplayConditionListResponseSchema,
|
|
22
|
-
d as DisplayConditionMethodSchema,
|
|
23
|
-
s as DisplayConditionSyntaxSchema,
|
|
24
|
-
r as SavedDisplayConditionSchema
|
|
25
|
-
};
|