@useinsider/guido 3.24.0-beta.0abeefe → 3.24.0-beta.297168
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 +6 -2
- package/dist/@types/config/schemas.js +37 -39
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +92 -98
- package/dist/composables/useBlocksConfig.js +20 -31
- package/dist/composables/useHtmlCompiler.js +2 -0
- package/dist/composables/useStripo.js +70 -70
- package/dist/composables/useTranslations.js +1 -2
- package/dist/config/compiler/htmlCompilerRules.js +14 -6
- package/dist/config/compiler/utils/itemsCompilerUtils.js +42 -43
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -67
- package/dist/config/migrator/unsubscribeMigrator.js +91 -100
- package/dist/enums/academy.js +0 -1
- package/dist/extensions/Blocks/Unsubscribe/block.js +104 -96
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
- package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +5 -0
- 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/package.json.js +6 -6
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useStripo.d.ts +1 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +1 -0
- package/dist/src/stores/config.d.ts +0 -167
- package/dist/src/utils/linkTrackingIds.d.ts +5 -22
- package/dist/src/utils/trimHrefWhitespace.d.ts +5 -0
- package/dist/stores/config.js +6 -13
- package/dist/utils/linkTrackingIds.js +48 -82
- package/dist/utils/pairProductVariables.js +29 -30
- package/dist/utils/templatePreparation.js +57 -67
- package/dist/utils/trimHrefWhitespace.js +10 -0
- package/package.json +1 -1
- package/dist/@types/display-condition.js +0 -25
- package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +0 -17
- package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +0 -41
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +0 -30
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +0 -81
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +0 -45
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +0 -36
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +0 -63
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +0 -17
- package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +0 -22
- package/dist/composables/useDisplayConditions.js +0 -117
- package/dist/enums/display-condition.js +0 -12
- package/dist/extensions/DisplayConditions/bridge.js +0 -25
- package/dist/extensions/DisplayConditions/constants.js +0 -26
- package/dist/extensions/DisplayConditions/control.js +0 -215
- package/dist/extensions/DisplayConditions/display-conditions.css.js +0 -226
- package/dist/extensions/DisplayConditions/extension.js +0 -28
- package/dist/extensions/DisplayConditions/iconsRegistry.js +0 -20
- package/dist/extensions/DisplayConditions/library.js +0 -30
- package/dist/extensions/DisplayConditions/settingsPanel.js +0 -17
- package/dist/extensions/LinkTracking/extension.js +0 -17
- package/dist/extensions/LinkTracking/writer.js +0 -41
- package/dist/services/displayConditionApi.js +0 -39
- package/dist/src/@types/display-condition.d.ts +0 -60
- package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +0 -43
- package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +0 -18
- package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +0 -2
- package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +0 -2
- package/dist/src/composables/useDisplayConditions.d.ts +0 -18
- package/dist/src/enums/display-condition.d.ts +0 -15
- package/dist/src/extensions/DisplayConditions/bridge.d.ts +0 -7
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -23
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -25
- 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/extensions/LinkTracking/extension.d.ts +0 -2
- package/dist/src/extensions/LinkTracking/writer.d.ts +0 -13
- 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 -84
- package/dist/src/utils/displayCondition.d.ts +0 -11
- package/dist/src/utils/protectTableText.d.ts +0 -2
- package/dist/stores/display-condition.js +0 -29
- package/dist/utils/displayCondition.js +0 -26
- package/dist/utils/protectTableText.js +0 -22
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
const n = `.guido-display-conditions {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
font-family: inherit;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.guido-display-conditions__header {
|
|
8
|
-
padding: 16px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.guido-display-conditions__title {
|
|
12
|
-
margin: 0 0 8px;
|
|
13
|
-
color: var(--guido-color-gray-800);
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
font-weight: 600;
|
|
16
|
-
line-height: 24px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.guido-display-conditions__description {
|
|
20
|
-
margin: 0;
|
|
21
|
-
color: var(--guido-color-gray-600);
|
|
22
|
-
font-size: 13px;
|
|
23
|
-
line-height: 16px;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.guido-display-conditions__empty {
|
|
27
|
-
padding: 8px 16px 16px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/* ue-button draws Stripo's themed .button inside; restyle that, not the host. */
|
|
31
|
-
.guido-display-conditions .guido-display-conditions__add,
|
|
32
|
-
.guido-display-conditions .guido-display-conditions__menu-item {
|
|
33
|
-
display: block;
|
|
34
|
-
width: 100%;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.guido-display-conditions .button {
|
|
38
|
-
min-width: 0;
|
|
39
|
-
min-height: 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.guido-display-conditions .button .icon-button {
|
|
43
|
-
color: inherit;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.guido-display-conditions .guido-display-conditions__add > .button {
|
|
47
|
-
display: flex;
|
|
48
|
-
gap: 8px;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
width: 100%;
|
|
52
|
-
height: 40px;
|
|
53
|
-
padding: 0 16px;
|
|
54
|
-
border: none;
|
|
55
|
-
border-radius: 4px;
|
|
56
|
-
background: var(--guido-color-primary-100);
|
|
57
|
-
color: var(--guido-color-primary-500);
|
|
58
|
-
font: inherit;
|
|
59
|
-
font-size: 15px;
|
|
60
|
-
line-height: 24px;
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Stripo draws registered icons at 100% of ue-icon-component (Figma: 20px glyph in a 24px box). */
|
|
65
|
-
.guido-display-conditions ue-icon-component {
|
|
66
|
-
display: inline-flex;
|
|
67
|
-
flex-shrink: 0;
|
|
68
|
-
align-items: center;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
width: 24px;
|
|
71
|
-
height: 24px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.guido-display-conditions ue-icon-component svg {
|
|
75
|
-
width: 20px;
|
|
76
|
-
height: 20px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.guido-display-conditions .guido-display-conditions__add > .button:hover {
|
|
80
|
-
background: var(--guido-color-primary-200);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.guido-display-conditions .guido-display-conditions__add > .button:focus-visible,
|
|
84
|
-
.guido-display-conditions .guido-display-conditions__action > .button:focus-visible,
|
|
85
|
-
.guido-display-conditions .guido-display-conditions__toggle > .button:focus-visible {
|
|
86
|
-
outline: 2px solid var(--guido-color-primary-500);
|
|
87
|
-
outline-offset: 2px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.guido-display-conditions__code-box {
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-direction: column;
|
|
93
|
-
gap: 8px;
|
|
94
|
-
padding: 16px;
|
|
95
|
-
background: var(--guido-color-gray-0);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.guido-display-conditions__sections {
|
|
99
|
-
display: flex;
|
|
100
|
-
flex-direction: column;
|
|
101
|
-
gap: 8px;
|
|
102
|
-
overflow: hidden;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.guido-display-conditions__name,
|
|
106
|
-
.guido-display-conditions__section-label {
|
|
107
|
-
margin: 0;
|
|
108
|
-
color: var(--guido-color-gray-800);
|
|
109
|
-
font-size: 15px;
|
|
110
|
-
font-weight: 600;
|
|
111
|
-
line-height: 24px;
|
|
112
|
-
word-break: break-word;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.guido-display-conditions__code {
|
|
116
|
-
margin: 0;
|
|
117
|
-
color: #101727;
|
|
118
|
-
font-family: inherit;
|
|
119
|
-
font-size: 15px;
|
|
120
|
-
line-height: 24px;
|
|
121
|
-
white-space: pre-wrap;
|
|
122
|
-
word-break: break-word;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
.guido-display-conditions .guido-display-conditions__toggle {
|
|
126
|
-
align-self: flex-start;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.guido-display-conditions .guido-display-conditions__toggle > .button {
|
|
130
|
-
display: inline-flex;
|
|
131
|
-
align-items: center;
|
|
132
|
-
padding: 8px 0;
|
|
133
|
-
border: none;
|
|
134
|
-
background: none;
|
|
135
|
-
color: var(--guido-color-primary-500);
|
|
136
|
-
font: inherit;
|
|
137
|
-
font-size: 15px;
|
|
138
|
-
line-height: 24px;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.guido-display-conditions__toggle span {
|
|
143
|
-
padding: 0 8px;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.guido-display-conditions__toggle--less ue-icon-component {
|
|
147
|
-
transform: rotate(180deg);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.guido-display-conditions__actions {
|
|
151
|
-
display: flex;
|
|
152
|
-
gap: 16px;
|
|
153
|
-
align-items: center;
|
|
154
|
-
height: 48px;
|
|
155
|
-
padding: 0 8px;
|
|
156
|
-
background: var(--guido-color-white);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.guido-display-conditions .guido-display-conditions__action > .button {
|
|
160
|
-
display: inline-flex;
|
|
161
|
-
align-items: center;
|
|
162
|
-
padding: 8px;
|
|
163
|
-
border: none;
|
|
164
|
-
background: none;
|
|
165
|
-
font: inherit;
|
|
166
|
-
font-size: 15px;
|
|
167
|
-
line-height: 24px;
|
|
168
|
-
cursor: pointer;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.guido-display-conditions__action span {
|
|
172
|
-
padding: 0 8px;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.guido-display-conditions .guido-display-conditions__toggle > .button:hover,
|
|
176
|
-
.guido-display-conditions .guido-display-conditions__action > .button:hover {
|
|
177
|
-
background: none;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.guido-display-conditions .guido-display-conditions__action--edit > .button {
|
|
181
|
-
color: var(--guido-color-primary-500);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.guido-display-conditions .guido-display-conditions__action--remove > .button {
|
|
185
|
-
color: var(--guido-color-danger-500);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.guido-display-conditions [hidden] {
|
|
189
|
-
display: none !important;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/* No positioned ancestor inside Stripo's clipping scroller: the menu keeps its static spot but escapes the clip. */
|
|
193
|
-
.guido-display-conditions__menu {
|
|
194
|
-
position: absolute;
|
|
195
|
-
z-index: 2;
|
|
196
|
-
margin-top: 4px;
|
|
197
|
-
padding: 4px 0;
|
|
198
|
-
border-radius: 4px;
|
|
199
|
-
background-color: #FFFFFF;
|
|
200
|
-
box-shadow: 0 4px 16px rgba(34, 41, 56, 0.16);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.guido-display-conditions .guido-display-conditions__menu-item > .button {
|
|
204
|
-
display: flex;
|
|
205
|
-
justify-content: flex-start;
|
|
206
|
-
width: 100%;
|
|
207
|
-
padding: 8px 16px;
|
|
208
|
-
border: 0;
|
|
209
|
-
background: none;
|
|
210
|
-
color: var(--guido-color-neutral-800);
|
|
211
|
-
cursor: pointer;
|
|
212
|
-
font: inherit;
|
|
213
|
-
font-size: 14px;
|
|
214
|
-
line-height: 24px;
|
|
215
|
-
text-align: left;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.guido-display-conditions .guido-display-conditions__menu-item > .button:hover,
|
|
219
|
-
.guido-display-conditions .guido-display-conditions__menu-item > .button:focus-visible {
|
|
220
|
-
background-color: var(--guido-color-neutral-100);
|
|
221
|
-
outline: none;
|
|
222
|
-
}
|
|
223
|
-
`;
|
|
224
|
-
export {
|
|
225
|
-
n as default
|
|
226
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ExtensionBuilder as t } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { APPLIED_DESCRIPTION as o, EMPTY_DESCRIPTION as i } from "./constants.js";
|
|
3
|
-
import { DisplayConditionsControl as e } from "./control.js";
|
|
4
|
-
import n from "./display-conditions.css.js";
|
|
5
|
-
import { DisplayConditionsIconsRegistry as s } from "./iconsRegistry.js";
|
|
6
|
-
import { DisplayConditionsLibrary as d } from "./library.js";
|
|
7
|
-
import { DisplayConditionsSettingsPanel as r } from "./settingsPanel.js";
|
|
8
|
-
const S = new t().addControl(e).withIconsRegistry(s).withSettingsPanelRegistry(r).withExternalDisplayCondition(d).withStyles(n).withLocalization({
|
|
9
|
-
en: {
|
|
10
|
-
[i]: i,
|
|
11
|
-
[o]: o,
|
|
12
|
-
Conditions: "Conditions",
|
|
13
|
-
Edit: "Edit",
|
|
14
|
-
Remove: "Remove",
|
|
15
|
-
"Display Conditions": "Display Conditions",
|
|
16
|
-
"Add Display Condition": "Add Display Condition",
|
|
17
|
-
"Create New Condition": "Create New Condition",
|
|
18
|
-
"Select Saved Condition": "Select Saved Condition",
|
|
19
|
-
"Show More": "Show More",
|
|
20
|
-
"Show Less": "Show Less",
|
|
21
|
-
"Code Before Module": "Code Before Module",
|
|
22
|
-
"Code After Module": "Code After Module",
|
|
23
|
-
"Insider Display Conditions": "Insider Display Conditions"
|
|
24
|
-
}
|
|
25
|
-
}).build();
|
|
26
|
-
export {
|
|
27
|
-
S as default
|
|
28
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IconsRegistry as n } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CONDITION_ICONS as r } from "./constants.js";
|
|
3
|
-
const h = 'fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"', s = (t, o, e = 1.3) => `
|
|
4
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 ${t} ${t}">
|
|
5
|
-
<path d="${o}" ${h} stroke-width="${e}"/>
|
|
6
|
-
</svg>`;
|
|
7
|
-
class g extends n {
|
|
8
|
-
registerIconsSvg(o) {
|
|
9
|
-
o[r.PLUS] = s(20, "M10 4v12M4 10h12", 1.5), o[r.EDIT] = s(
|
|
10
|
-
20,
|
|
11
|
-
"M3.5 16.5h13M5 12.6 13.1 4.5a1.4 1.4 0 0 1 2 0l.4.4a1.4 1.4 0 0 1 0 2L7.4 15H5v-2.4Z"
|
|
12
|
-
), o[r.TRASH] = s(
|
|
13
|
-
20,
|
|
14
|
-
"M3.5 5.5h13M8 5.5V4h4v1.5M5 5.5l.8 11h8.4l.8-11M8.5 8.5v5M11.5 8.5v5"
|
|
15
|
-
), o[r.CHEVRON] = s(20, "m5 7.5 5 5 5-5", 1.5);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
g as DisplayConditionsIconsRegistry
|
|
20
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DisplayConditionSourceType as s } from "../../enums/display-condition.js";
|
|
2
|
-
import { toAppliedCondition as a, parseSource as p } from "../../utils/displayCondition.js";
|
|
3
|
-
import { ExternalDisplayConditionsLibrary as l } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
4
|
-
import { requestDisplayCondition as d } from "./bridge.js";
|
|
5
|
-
class x extends l {
|
|
6
|
-
getCategoryName() {
|
|
7
|
-
return this.api.translate("Insider Display Conditions");
|
|
8
|
-
}
|
|
9
|
-
openExternalDisplayConditionsDialog(n, r, t) {
|
|
10
|
-
const e = a(n), o = p(e) === s.INLINE;
|
|
11
|
-
d(
|
|
12
|
-
{ mode: o ? "edit" : "select", current: o ? e : null },
|
|
13
|
-
{
|
|
14
|
-
onApply: (i) => (i ? r(i) : t(), !0),
|
|
15
|
-
onCancel: t
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
// The Conditions tab is the only entry point; no Display Conditions button on the block toolbar.
|
|
20
|
-
getIsContextActionEnabled() {
|
|
21
|
-
return !1;
|
|
22
|
-
}
|
|
23
|
-
// Stripo reads the index at registration even when disabled; the base method throws.
|
|
24
|
-
getContextActionIndex() {
|
|
25
|
-
return -1;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
x as DisplayConditionsLibrary
|
|
30
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as a, SettingsTab as r, SettingsPanelTab as o } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CONDITION_BLOCK_TYPES as I, BUILT_IN_CONDITION_CONTROLS as O, CONDITIONS_TAB_ID as T, CONDITIONS_CONTROL_ID as N } from "./constants.js";
|
|
3
|
-
class _ extends a {
|
|
4
|
-
// Stripo hands over the map pre-filled with its default tabs, so they are extended, not replaced.
|
|
5
|
-
registerBlockControls(e) {
|
|
6
|
-
I.forEach((i) => {
|
|
7
|
-
const n = e[i] ?? [];
|
|
8
|
-
n.filter((t) => t.getTabId() === String(r.SETTINGS)).forEach((t) => O.forEach((s) => t.deleteControl(s))), e[i] = [
|
|
9
|
-
...n,
|
|
10
|
-
new o(T, [N]).withLabel(this.api.translate("Conditions"))
|
|
11
|
-
];
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
_ as DisplayConditionsSettingsPanel
|
|
17
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ExtensionBuilder as r, Control as t } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { registerTrackingIdWriter as i } from "./writer.js";
|
|
3
|
-
class e extends t {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(), i(() => this.api);
|
|
6
|
-
}
|
|
7
|
-
getId() {
|
|
8
|
-
return "guidoLinkTrackingWriter";
|
|
9
|
-
}
|
|
10
|
-
getTemplate() {
|
|
11
|
-
return "<div></div>";
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const a = new r().addControl(e).build();
|
|
15
|
-
export {
|
|
16
|
-
a as default
|
|
17
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { TRACK_ID_ATTRIBUTE as h, TRACK_SEQ_ATTRIBUTE as I } from "../../utils/linkTrackingIds.js";
|
|
2
|
-
import { ModificationDescription as k } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
-
let s = null;
|
|
4
|
-
const q = (e) => {
|
|
5
|
-
s = e;
|
|
6
|
-
}, C = () => {
|
|
7
|
-
s = null;
|
|
8
|
-
};
|
|
9
|
-
function w(e) {
|
|
10
|
-
return "getTagName" in e && e.getTagName().toLowerCase() === "a";
|
|
11
|
-
}
|
|
12
|
-
const T = (e, r) => (w(e) && r.push(e), e.children().forEach((i) => T(i, r)), r), E = ({ anchorIds: e, inComment: r, plan: i }) => {
|
|
13
|
-
const g = s == null ? void 0 : s();
|
|
14
|
-
if (!g)
|
|
15
|
-
return !1;
|
|
16
|
-
try {
|
|
17
|
-
const c = g.getDocumentRootHtmlNode(), f = T(c, []), l = f.map((t) => t.getAttribute(h) ?? ""), o = /* @__PURE__ */ new Map();
|
|
18
|
-
e.forEach((t, n) => {
|
|
19
|
-
r[n] || o.set(n, o.size);
|
|
20
|
-
});
|
|
21
|
-
const d = e.filter((t, n) => o.has(n)), p = l.length === d.length && l.every((t, n) => t === d[n]), u = [...i.assignments.keys()].some((t) => !o.has(t)), a = i.seqChanged ? c.querySelector("body") : void 0;
|
|
22
|
-
if (!p || u || i.seqChanged && !a)
|
|
23
|
-
return console.debug(
|
|
24
|
-
"In-place tracking-id write skipped, replacing the document instead:",
|
|
25
|
-
`live [${l.join(",")}] planned [${d.join(",")}]`,
|
|
26
|
-
`commentWrite ${String(u)} seqHost ${String(!!a)}`
|
|
27
|
-
), !1;
|
|
28
|
-
const m = g.getDocumentModifier();
|
|
29
|
-
return i.assignments.forEach((t, n) => {
|
|
30
|
-
const A = f[o.get(n)];
|
|
31
|
-
m.modifyHtml(A).setAttribute(h, String(t));
|
|
32
|
-
}), a && m.modifyHtml(a).setAttribute(I, String(i.nextSeq)), m.apply(new k("Assign link tracking ids").asHidden()), !0;
|
|
33
|
-
} catch (c) {
|
|
34
|
-
return console.warn("In-place tracking-id write failed, replacing the document instead:", c), !1;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
export {
|
|
38
|
-
C as disposeTrackingIdWriter,
|
|
39
|
-
q as registerTrackingIdWriter,
|
|
40
|
-
E as writeTrackingIdsInPlace
|
|
41
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useHttp as p } from "../composables/useHttp.js";
|
|
2
|
-
import { SavedDisplayConditionSchema as y, DisplayConditionListResponseSchema as S } from "../@types/display-condition.js";
|
|
3
|
-
import { parse as r } from "../node_modules/valibot/dist/index.js";
|
|
4
|
-
const s = "/email-proxy/v1/display-conditions", u = 100, P = () => {
|
|
5
|
-
const { get: c, post: m, delete: l } = p(), i = async (t, e) => {
|
|
6
|
-
const o = new URLSearchParams({
|
|
7
|
-
page: String(e),
|
|
8
|
-
limit: String(u),
|
|
9
|
-
sortColumn: "id",
|
|
10
|
-
sortDirection: "desc",
|
|
11
|
-
"filter[syntax]": t
|
|
12
|
-
}), { data: n } = await c(`${s}?${o.toString()}`);
|
|
13
|
-
return r(S, n);
|
|
14
|
-
};
|
|
15
|
-
return { list: async (t) => {
|
|
16
|
-
const e = await i(t, 1), o = await Promise.all(Array.from(
|
|
17
|
-
{ length: Math.max(e.meta.lastPage - 1, 0) },
|
|
18
|
-
(a, d) => i(t, d + 2)
|
|
19
|
-
)), n = [e, ...o].flatMap((a) => a.data);
|
|
20
|
-
return [...new Map(n.map((a) => [a.id, a])).values()];
|
|
21
|
-
}, create: async (t, e) => {
|
|
22
|
-
const { data: o } = await m(s, {
|
|
23
|
-
name: t.name.trim(),
|
|
24
|
-
description: t.description.trim() || null,
|
|
25
|
-
syntax: e,
|
|
26
|
-
method: "codeOnly",
|
|
27
|
-
codeBefore: t.codeBefore,
|
|
28
|
-
codeAfter: t.codeAfter
|
|
29
|
-
});
|
|
30
|
-
return r(y, o.data);
|
|
31
|
-
}, remove: async (t) => {
|
|
32
|
-
await l(`${s}/${t}`);
|
|
33
|
-
} };
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
u as DISPLAY_CONDITIONS_PAGE_LIMIT,
|
|
37
|
-
s as DISPLAY_CONDITIONS_URL,
|
|
38
|
-
P as useDisplayConditionApi
|
|
39
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import * as v from 'valibot';
|
|
2
|
-
export declare const DisplayConditionSyntaxSchema: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
3
|
-
export declare const DisplayConditionMethodSchema: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
4
|
-
export declare const SavedDisplayConditionSchema: v.ObjectSchema<{
|
|
5
|
-
readonly id: v.NumberSchema<undefined>;
|
|
6
|
-
readonly name: v.StringSchema<undefined>;
|
|
7
|
-
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
8
|
-
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
9
|
-
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
10
|
-
readonly codeBefore: v.StringSchema<undefined>;
|
|
11
|
-
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
12
|
-
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
13
|
-
}, undefined>;
|
|
14
|
-
export declare const DisplayConditionListResponseSchema: v.ObjectSchema<{
|
|
15
|
-
readonly data: v.ArraySchema<v.ObjectSchema<{
|
|
16
|
-
readonly id: v.NumberSchema<undefined>;
|
|
17
|
-
readonly name: v.StringSchema<undefined>;
|
|
18
|
-
readonly description: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
19
|
-
readonly syntax: v.PicklistSchema<["liquid", "pongo"], undefined>;
|
|
20
|
-
readonly method: v.PicklistSchema<["codeOnly", "logicBuilder"], undefined>;
|
|
21
|
-
readonly codeBefore: v.StringSchema<undefined>;
|
|
22
|
-
readonly codeAfter: v.NullishSchema<v.StringSchema<undefined>, "">;
|
|
23
|
-
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
24
|
-
}, undefined>, undefined>;
|
|
25
|
-
readonly meta: v.ObjectSchema<{
|
|
26
|
-
readonly totalCount: v.NumberSchema<undefined>;
|
|
27
|
-
readonly perPage: v.NumberSchema<undefined>;
|
|
28
|
-
readonly currentPage: v.NumberSchema<undefined>;
|
|
29
|
-
readonly lastPage: v.NumberSchema<undefined>;
|
|
30
|
-
}, undefined>;
|
|
31
|
-
}, undefined>;
|
|
32
|
-
export type DisplayConditionSyntax = v.InferOutput<typeof DisplayConditionSyntaxSchema>;
|
|
33
|
-
export type DisplayConditionMethod = v.InferOutput<typeof DisplayConditionMethodSchema>;
|
|
34
|
-
export type SavedDisplayCondition = v.InferOutput<typeof SavedDisplayConditionSchema>;
|
|
35
|
-
export type DisplayConditionListResponse = v.InferOutput<typeof DisplayConditionListResponseSchema>;
|
|
36
|
-
export interface DisplayConditionDraft {
|
|
37
|
-
name: string;
|
|
38
|
-
description: string;
|
|
39
|
-
codeBefore: string;
|
|
40
|
-
codeAfter: string;
|
|
41
|
-
}
|
|
42
|
-
/** Mirrors Stripo's `DisplayCondition`; kept local so Vue code does not import the Stripo package. */
|
|
43
|
-
export interface AppliedDisplayCondition {
|
|
44
|
-
id: number;
|
|
45
|
-
name: string;
|
|
46
|
-
description: string;
|
|
47
|
-
beforeScript: string;
|
|
48
|
-
afterScript: string;
|
|
49
|
-
extraData?: string;
|
|
50
|
-
}
|
|
51
|
-
export type DisplayConditionOpenMode = 'select' | 'create' | 'edit';
|
|
52
|
-
export type DisplayConditionListState = 'error' | 'empty' | 'no-result';
|
|
53
|
-
export interface DisplayConditionOpenDetail {
|
|
54
|
-
mode: DisplayConditionOpenMode;
|
|
55
|
-
current: AppliedDisplayCondition | null;
|
|
56
|
-
}
|
|
57
|
-
export interface DisplayConditionApplyDetail {
|
|
58
|
-
condition: AppliedDisplayCondition | null;
|
|
59
|
-
applied?: boolean;
|
|
60
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
type __VLS_Props = {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
placeholder?: string;
|
|
6
|
-
error?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
10
|
-
placeholder: string;
|
|
11
|
-
error: string;
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
}>, {
|
|
14
|
-
read: () => Promise<string>;
|
|
15
|
-
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
16
|
-
input: (value: string) => void;
|
|
17
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
18
|
-
placeholder: string;
|
|
19
|
-
error: string;
|
|
20
|
-
disabled: boolean;
|
|
21
|
-
}>>>, {
|
|
22
|
-
error: string;
|
|
23
|
-
placeholder: string;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
}>;
|
|
26
|
-
export default _default;
|
|
27
|
-
type __VLS_WithDefaults<P, D> = {
|
|
28
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
29
|
-
default: D[K];
|
|
30
|
-
}> : P[K];
|
|
31
|
-
};
|
|
32
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
-
type __VLS_TypePropsToOption<T> = {
|
|
34
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
-
} : {
|
|
37
|
-
type: import('vue').PropType<T[K]>;
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type __VLS_PrettifyLocal<T> = {
|
|
42
|
-
[K in keyof T]: T[K];
|
|
43
|
-
} & {};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DisplayConditionListState } from '@@/Types/display-condition';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
state: DisplayConditionListState;
|
|
4
|
-
};
|
|
5
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
6
|
-
retry: () => void;
|
|
7
|
-
create: () => void;
|
|
8
|
-
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
9
|
-
export default _default;
|
|
10
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
|
-
type __VLS_TypePropsToOption<T> = {
|
|
12
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
13
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
14
|
-
} : {
|
|
15
|
-
type: import('vue').PropType<T[K]>;
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
18
|
-
};
|
package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { DisplayConditionDraft, DisplayConditionOpenDetail, SavedDisplayCondition } from '@@/Types/display-condition';
|
|
2
|
-
export type DraftField = keyof DisplayConditionDraft;
|
|
3
|
-
export type DraftErrors = Partial<Record<DraftField, string>>;
|
|
4
|
-
export type CreateIntent = 'inline' | 'save';
|
|
5
|
-
export declare const DISPLAY_CONDITIONS_TRANS_KEY = "email-editor.display-conditions";
|
|
6
|
-
export declare const useDisplayConditions: () => {
|
|
7
|
-
syntax: import("vue").ComputedRef<"liquid" | "pongo">;
|
|
8
|
-
handleOpen: (detail: DisplayConditionOpenDetail) => void;
|
|
9
|
-
cancel: () => void;
|
|
10
|
-
loadList: () => Promise<void>;
|
|
11
|
-
validate: (draft: DisplayConditionDraft) => DraftErrors;
|
|
12
|
-
notifyInvalid: () => void;
|
|
13
|
-
describeWithAcademyLink: (descriptionKey: "create-description" | "select-description") => string;
|
|
14
|
-
createInline: (draft: DisplayConditionDraft) => void;
|
|
15
|
-
createAndSave: (draft: DisplayConditionDraft) => Promise<DraftErrors | null>;
|
|
16
|
-
select: (row: SavedDisplayCondition) => void;
|
|
17
|
-
deleteSaved: (row: SavedDisplayCondition) => Promise<void>;
|
|
18
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare enum DisplayConditionEvent {
|
|
2
|
-
OPEN = "display-condition:open",
|
|
3
|
-
APPLY = "display-condition:apply",
|
|
4
|
-
CANCEL = "display-condition:cancel"
|
|
5
|
-
}
|
|
6
|
-
export declare enum DisplayConditionSourceType {
|
|
7
|
-
INLINE = "inline",
|
|
8
|
-
SAVED = "saved"
|
|
9
|
-
}
|
|
10
|
-
export declare const DISPLAY_CONDITION_LIMITS: {
|
|
11
|
-
readonly NAME_MIN: 2;
|
|
12
|
-
readonly NAME_MAX: 40;
|
|
13
|
-
readonly DESCRIPTION_MAX: 200;
|
|
14
|
-
readonly CODE_MAX: 65535;
|
|
15
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { AppliedDisplayCondition, DisplayConditionOpenDetail } from '@@/Types/display-condition';
|
|
2
|
-
export interface ConditionRequestHandlers {
|
|
3
|
-
onApply: (condition: AppliedDisplayCondition | null) => boolean;
|
|
4
|
-
onCancel?: () => void;
|
|
5
|
-
}
|
|
6
|
-
export declare const disposeDisplayConditionRequest: () => void;
|
|
7
|
-
export declare const requestDisplayCondition: (detail: DisplayConditionOpenDetail, handlers: ConditionRequestHandlers) => () => void;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BlockType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare const CONDITIONS_TAB_ID = "conditions";
|
|
3
|
-
export declare const CONDITIONS_CONTROL_ID = "guido-display-conditions-control";
|
|
4
|
-
export declare const MAX_COLLAPSED_LINES = 10;
|
|
5
|
-
export declare const CONDITION_BLOCK_TYPES: readonly [BlockType.STRIPE, BlockType.STRUCTURE, BlockType.CONTAINER];
|
|
6
|
-
export declare const CONDITION_ICONS: {
|
|
7
|
-
readonly PLUS: "guido-display-condition-plus";
|
|
8
|
-
readonly EDIT: "guido-display-condition-edit";
|
|
9
|
-
readonly TRASH: "guido-display-condition-trash";
|
|
10
|
-
readonly CHEVRON: "guido-display-condition-chevron";
|
|
11
|
-
};
|
|
12
|
-
export declare const CONDITION_BUTTONS: {
|
|
13
|
-
readonly ADD: "guidoDisplayConditionAdd";
|
|
14
|
-
readonly CREATE: "guidoDisplayConditionCreate";
|
|
15
|
-
readonly SELECT: "guidoDisplayConditionSelect";
|
|
16
|
-
readonly SHOW_MORE: "guidoDisplayConditionShowMore";
|
|
17
|
-
readonly SHOW_LESS: "guidoDisplayConditionShowLess";
|
|
18
|
-
readonly EDIT: "guidoDisplayConditionEdit";
|
|
19
|
-
readonly REMOVE: "guidoDisplayConditionRemove";
|
|
20
|
-
};
|
|
21
|
-
export declare const BUILT_IN_CONDITION_CONTROLS: string[];
|
|
22
|
-
export declare const EMPTY_DESCRIPTION: string;
|
|
23
|
-
export declare const APPLIED_DESCRIPTION: string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '@@/Extensions/Blocks/common-control';
|
|
3
|
-
export declare class DisplayConditionsControl extends CommonControl {
|
|
4
|
-
private expanded;
|
|
5
|
-
private listeners;
|
|
6
|
-
private resizeObserver;
|
|
7
|
-
private detachOutsideClick;
|
|
8
|
-
getId(): string;
|
|
9
|
-
getTemplate(): string;
|
|
10
|
-
onRender(): void;
|
|
11
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
12
|
-
onDestroy(): void;
|
|
13
|
-
private setExpanded;
|
|
14
|
-
private getCondition;
|
|
15
|
-
private toggleMenu;
|
|
16
|
-
private listenOutsideClick;
|
|
17
|
-
private openDrawer;
|
|
18
|
-
private removeCondition;
|
|
19
|
-
private applyCondition;
|
|
20
|
-
private wire;
|
|
21
|
-
private teardown;
|
|
22
|
-
private observeCodeSize;
|
|
23
|
-
private paint;
|
|
24
|
-
private collapsedHeight;
|
|
25
|
-
}
|