@useinsider/guido 3.28.1-beta.8272ff5 → 3.28.1-beta.d3309a6
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 +10 -0
- package/dist/@types/config/schemas.js +142 -129
- package/dist/@types/display-condition.js +45 -21
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +25 -19
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +77 -55
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +62 -43
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue.js +18 -0
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue2.js +25 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue2.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue.js +30 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue2.js +32 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +10 -9
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +41 -42
- package/dist/composables/useDisplayConditions.js +83 -68
- package/dist/composables/useScrollToInvalid.js +15 -0
- package/dist/enums/html-validator.js +1 -1
- package/dist/extensions/DisplayConditions/constants.js +19 -10
- package/dist/extensions/DisplayConditions/control.js +120 -99
- package/dist/extensions/DisplayConditions/display-conditions.css.js +58 -6
- package/dist/extensions/DisplayConditions/extension.js +18 -14
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +118 -102
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +18 -19
- package/dist/src/@types/config/schemas.d.ts +65 -0
- package/dist/src/@types/display-condition.d.ts +67 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderConnector.vue.d.ts +19 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderField.vue.d.ts +22 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderGroup.vue.d.ts +24 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderRow.vue.d.ts +25 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +42 -2
- package/dist/src/composables/useDisplayConditions.d.ts +1 -1
- package/dist/src/composables/useScrollToInvalid.d.ts +6 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +1 -0
- package/dist/src/stores/config.d.ts +441 -21
- package/dist/src/utils/displayConditionBuilder.d.ts +29 -0
- package/dist/src/utils/displayConditionRules.d.ts +12 -0
- package/dist/src/utils/displayConditionSummary.d.ts +11 -0
- package/dist/utils/displayConditionBuilder.js +50 -0
- package/dist/utils/displayConditionRules.js +91 -0
- package/dist/utils/displayConditionSummary.js +28 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -131,6 +131,16 @@ const config: GuidoConfigInput = {
|
|
|
131
131
|
// Behaviour change: releases up to v3.23.0 forced a recreate for any non-empty html and
|
|
132
132
|
// ignored this option, so a host that sends `false` now gets Stripo's stored copy.
|
|
133
133
|
forceRecreate?: boolean,
|
|
134
|
+
// Properties offered by the display-condition Logic Builder (features.externalDisplayConditions),
|
|
135
|
+
// listed under "Custom Attributes" and "Default Attributes". `key` is the Liquid/Pongo variable the
|
|
136
|
+
// compiled condition reads; `type` picks the operators and the value input; `options` turns the value
|
|
137
|
+
// into a select. Invalid items are dropped. Default: { custom: [], default: [] }.
|
|
138
|
+
// Item shape: { key: string, label: string, type?: 'string' | 'number' | 'boolean' | 'date' | 'strings'
|
|
139
|
+
// (default 'string'), options?: { label: string, value: string }[] }. Dates compare as YYYY-MM-DD strings.
|
|
140
|
+
displayConditionAttributes?: {
|
|
141
|
+
custom?: DisplayConditionAttributeItem[],
|
|
142
|
+
default?: DisplayConditionAttributeItem[],
|
|
143
|
+
},
|
|
134
144
|
migration?: {
|
|
135
145
|
// Legacy block configs keyed by block ID. Consumed once by the migrator
|
|
136
146
|
// when upgrading templates authored with v1 block formats. See the
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ModuleFolderDefaults as
|
|
2
|
-
import { object as
|
|
3
|
-
|
|
1
|
+
import { ModuleFolderDefaults as h } from "../../enums/defaults.js";
|
|
2
|
+
import { object as a, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as b, custom as C, boolean as o, array as s, transform as f, unknown as i, record as R, safeParse as L, fallback as T, literal as u, lazy as D, looseObject as A, variant as M, union as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
|
+
import { DisplayConditionAttributeSchema as P } from "../display-condition.js";
|
|
4
|
+
const p = {
|
|
4
5
|
/** Promotional/marketing emails */
|
|
5
6
|
PROMOTIONAL: 1,
|
|
6
7
|
/** Transactional/system emails */
|
|
@@ -12,16 +13,16 @@ const b = {
|
|
|
12
13
|
ARCHITECT: 49,
|
|
13
14
|
/** Unsubscribe page builder */
|
|
14
15
|
UNSUBSCRIBE_PAGES: 97
|
|
15
|
-
},
|
|
16
|
+
}, E = a({
|
|
16
17
|
/** Unique identifier for the template being edited */
|
|
17
18
|
templateId: r(
|
|
18
19
|
t(),
|
|
19
|
-
|
|
20
|
+
b(1, "templateId is required")
|
|
20
21
|
),
|
|
21
22
|
/** Unique identifier for the user editing the template */
|
|
22
23
|
userId: r(
|
|
23
24
|
t(),
|
|
24
|
-
|
|
25
|
+
b(1, "userId is required")
|
|
25
26
|
),
|
|
26
27
|
/** Optional variation ID for A/B testing */
|
|
27
28
|
variationId: e(t()),
|
|
@@ -33,16 +34,16 @@ const b = {
|
|
|
33
34
|
* Stripo doc id) and is never an endpoint id.
|
|
34
35
|
*/
|
|
35
36
|
templateLibraryId: e(t())
|
|
36
|
-
}),
|
|
37
|
+
}), v = a({
|
|
37
38
|
/** Fallback font name (e.g., "Georgia") */
|
|
38
39
|
name: t(),
|
|
39
40
|
/** Fallback font family (e.g., "serif" or "sans-serif") */
|
|
40
41
|
family: t()
|
|
41
|
-
}),
|
|
42
|
+
}), x = a({
|
|
42
43
|
/** Partner/organization name (required) */
|
|
43
44
|
name: r(
|
|
44
45
|
t(),
|
|
45
|
-
|
|
46
|
+
b(1, "partner.name is required")
|
|
46
47
|
),
|
|
47
48
|
/** Product type identifier */
|
|
48
49
|
productType: e(
|
|
@@ -55,14 +56,14 @@ const b = {
|
|
|
55
56
|
),
|
|
56
57
|
/** Message type (promotional or transactional) */
|
|
57
58
|
messageType: e(
|
|
58
|
-
m([
|
|
59
|
-
|
|
59
|
+
m([p.PROMOTIONAL, p.TRANSACTIONAL]),
|
|
60
|
+
p.PROMOTIONAL
|
|
60
61
|
),
|
|
61
62
|
/** Display name for the current user */
|
|
62
63
|
username: e(t(), "Guido User"),
|
|
63
64
|
/** Fallback font settings from partner settings — used to match backend size calculation */
|
|
64
|
-
fallbackFont: e(
|
|
65
|
-
}),
|
|
65
|
+
fallbackFont: e(v)
|
|
66
|
+
}), N = a({
|
|
66
67
|
/** Display text for the dynamic content */
|
|
67
68
|
text: t(),
|
|
68
69
|
/** Template variable value (e.g., {{username}}) */
|
|
@@ -71,35 +72,35 @@ const b = {
|
|
|
71
72
|
fallback: e(t()),
|
|
72
73
|
/** Optional formatting options */
|
|
73
74
|
format: e(
|
|
74
|
-
|
|
75
|
+
a({
|
|
75
76
|
key: t(),
|
|
76
77
|
value: t()
|
|
77
78
|
})
|
|
78
79
|
)
|
|
79
|
-
}),
|
|
80
|
+
}), y = D(() => A({
|
|
80
81
|
text: e(t()),
|
|
81
82
|
// eslint-disable-next-line camelcase -- backend field name
|
|
82
83
|
tag_text: e(t()),
|
|
83
84
|
value: e(t()),
|
|
84
|
-
children: e(
|
|
85
|
+
children: e(s(y)),
|
|
85
86
|
// eslint-disable-next-line camelcase -- backend field name
|
|
86
|
-
select_items: e(
|
|
87
|
-
})),
|
|
87
|
+
select_items: e(s(y))
|
|
88
|
+
})), O = R(
|
|
88
89
|
t(),
|
|
89
|
-
|
|
90
|
-
),
|
|
90
|
+
T(s(y), [])
|
|
91
|
+
), F = A({
|
|
91
92
|
/** Block ID (matches the dictionary key and the legacy HTML element id) */
|
|
92
93
|
id: e(c()),
|
|
93
94
|
/** Decimal places for price display (legacy data may use string or number) */
|
|
94
|
-
decimalCount: e(
|
|
95
|
+
decimalCount: e(k([t(), c()])),
|
|
95
96
|
/** Pinned product IDs (empty array when filter-driven) */
|
|
96
|
-
productIds: e(
|
|
97
|
+
productIds: e(s(i())),
|
|
97
98
|
/** Whether the block requested live products at send time */
|
|
98
|
-
sendProductRequestFlag: e(
|
|
99
|
+
sendProductRequestFlag: e(o()),
|
|
99
100
|
/** Whether to randomize product order */
|
|
100
|
-
shuffleProducts: e(
|
|
101
|
+
shuffleProducts: e(o()),
|
|
101
102
|
/** Filter rules driving product selection */
|
|
102
|
-
filters: e(
|
|
103
|
+
filters: e(s(i())),
|
|
103
104
|
/** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
|
|
104
105
|
currency: e(t()),
|
|
105
106
|
/** Currency display settings (separators, alignment, decimals) */
|
|
@@ -109,7 +110,7 @@ const b = {
|
|
|
109
110
|
/** Recommendation strategy key (e.g. 'newArrivals') */
|
|
110
111
|
strategy: e(t()),
|
|
111
112
|
/** Snapshot of products as rendered by the legacy block */
|
|
112
|
-
recommendedProducts: e(
|
|
113
|
+
recommendedProducts: e(s(i())),
|
|
113
114
|
/** Number of product cards per row */
|
|
114
115
|
cardsInRow: e(c()),
|
|
115
116
|
/** Mobile-only padding (right) */
|
|
@@ -117,22 +118,22 @@ const b = {
|
|
|
117
118
|
/** Mobile-only padding (left) */
|
|
118
119
|
mobileLeftPadding: e(c()),
|
|
119
120
|
/** Disable responsive scaling */
|
|
120
|
-
unresponsive: e(
|
|
121
|
+
unresponsive: e(o()),
|
|
121
122
|
/** Layout orientation ('vertical' | 'horizontal') */
|
|
122
123
|
orientation: e(t()),
|
|
123
124
|
/** Whether long text is trimmed */
|
|
124
|
-
textTrimming: e(
|
|
125
|
+
textTrimming: e(o()),
|
|
125
126
|
/** Block type marker used by some legacy variants */
|
|
126
127
|
blockType: e(t()),
|
|
127
128
|
/** Size variant marker (legacy data may use string or number) */
|
|
128
|
-
size: e(
|
|
129
|
+
size: e(k([t(), c()])),
|
|
129
130
|
/** Vertical responsiveness flag (legacy size=1 variants) */
|
|
130
|
-
verticalResponsiveness: e(
|
|
131
|
+
verticalResponsiveness: e(o()),
|
|
131
132
|
/** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
|
|
132
|
-
isPriceMovedToNextLine: e(
|
|
133
|
+
isPriceMovedToNextLine: e(o()),
|
|
133
134
|
/** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
|
|
134
|
-
isPriceDeletedForZeroSale: e(
|
|
135
|
-
}),
|
|
135
|
+
isPriceDeletedForZeroSale: e(o())
|
|
136
|
+
}), U = a({
|
|
136
137
|
/**
|
|
137
138
|
* Legacy recommendation block configs keyed by block ID.
|
|
138
139
|
* Pass this when loading a template authored with the v1
|
|
@@ -140,17 +141,26 @@ const b = {
|
|
|
140
141
|
* strategy, currency, locale, and layout data.
|
|
141
142
|
*/
|
|
142
143
|
recommendationConfigs: e(
|
|
143
|
-
|
|
144
|
+
R(t(), F),
|
|
144
145
|
{}
|
|
145
146
|
)
|
|
146
|
-
}),
|
|
147
|
+
}), g = r(
|
|
148
|
+
T(s(i()), []),
|
|
149
|
+
f((n) => n.flatMap((I) => {
|
|
150
|
+
const S = L(P, I);
|
|
151
|
+
return S.success ? [S.output] : [];
|
|
152
|
+
}))
|
|
153
|
+
), w = a({
|
|
154
|
+
custom: e(g, []),
|
|
155
|
+
default: e(g, [])
|
|
156
|
+
}), B = a({
|
|
147
157
|
/** Initial HTML content */
|
|
148
158
|
html: e(t(), ""),
|
|
149
159
|
/** Initial CSS content */
|
|
150
160
|
css: e(t(), ""),
|
|
151
161
|
/** Preselected dynamic content items */
|
|
152
162
|
preselectedDynamicContent: e(
|
|
153
|
-
|
|
163
|
+
s(N),
|
|
154
164
|
[]
|
|
155
165
|
),
|
|
156
166
|
/**
|
|
@@ -159,13 +169,15 @@ const b = {
|
|
|
159
169
|
* (first) partner's leaf attributes into the label→token map that repairs
|
|
160
170
|
* label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
|
|
161
171
|
*/
|
|
162
|
-
dynamicContentList: e(
|
|
172
|
+
dynamicContentList: e(O, {}),
|
|
163
173
|
/** Valid custom field attribute names from the partner's categorized fields */
|
|
164
|
-
customFieldAttributes: e(
|
|
174
|
+
customFieldAttributes: e(s(t()), []),
|
|
175
|
+
/** Attributes the display-condition Logic Builder offers (`ui.externalDisplayConditions`) */
|
|
176
|
+
displayConditionAttributes: e(w, {}),
|
|
165
177
|
/** Selected unsubscribe page IDs */
|
|
166
|
-
selectedUnsubscribePages: e(
|
|
178
|
+
selectedUnsubscribePages: e(s(c()), []),
|
|
167
179
|
/** Force recreate template in Stripo storage (use true when updating externally modified templates) */
|
|
168
|
-
forceRecreate: e(
|
|
180
|
+
forceRecreate: e(o(), !1),
|
|
169
181
|
/**
|
|
170
182
|
* Consumer-persisted tracking-id high-water mark (SD-141414). Used as the id floor
|
|
171
183
|
* during migration so a rolled-back document never re-mints retired tracking ids.
|
|
@@ -176,7 +188,7 @@ const b = {
|
|
|
176
188
|
trackIdCounter: e(
|
|
177
189
|
r(
|
|
178
190
|
c(),
|
|
179
|
-
|
|
191
|
+
f((n) => Number.isFinite(n) ? Math.max(0, Math.floor(n)) : 0)
|
|
180
192
|
),
|
|
181
193
|
0
|
|
182
194
|
),
|
|
@@ -190,17 +202,17 @@ const b = {
|
|
|
190
202
|
recommendationCampaignUrls: e(
|
|
191
203
|
r(
|
|
192
204
|
i(),
|
|
193
|
-
|
|
205
|
+
f((n) => n && typeof n == "object" ? { ...n } : void 0)
|
|
194
206
|
)
|
|
195
207
|
),
|
|
196
208
|
/** Migration-only inputs (legacy block configs) */
|
|
197
|
-
migration: e(
|
|
198
|
-
}),
|
|
209
|
+
migration: e(U, {})
|
|
210
|
+
}), j = a({
|
|
199
211
|
/** Sender display name */
|
|
200
212
|
senderName: e(t(), ""),
|
|
201
213
|
/** Email subject line */
|
|
202
214
|
subject: e(t(), "")
|
|
203
|
-
}),
|
|
215
|
+
}), H = a({
|
|
204
216
|
/** Locale for the editor UI */
|
|
205
217
|
locale: e(t(), "en"),
|
|
206
218
|
/** Path to translations object */
|
|
@@ -208,52 +220,52 @@ const b = {
|
|
|
208
220
|
/** Migration date for template compatibility */
|
|
209
221
|
migrationDate: e(c(), 1759696858),
|
|
210
222
|
/** Email header settings */
|
|
211
|
-
emailHeader: e(
|
|
223
|
+
emailHeader: e(j, { senderName: "", subject: "" }),
|
|
212
224
|
/** Folder name for user-saved modules (used by Stripo plugin panel for path construction) */
|
|
213
|
-
savedModulesFolderName: e(t(),
|
|
225
|
+
savedModulesFolderName: e(t(), h.SAVED_MODULES),
|
|
214
226
|
/** Folder name for default/prebuilt modules (used by Stripo plugin panel for path construction) */
|
|
215
|
-
defaultModulesFolderName: e(t(),
|
|
216
|
-
}),
|
|
227
|
+
defaultModulesFolderName: e(t(), h.DEFAULT_MODULES)
|
|
228
|
+
}), _ = a({
|
|
217
229
|
/** Whether to show the header bar */
|
|
218
|
-
showHeader: e(
|
|
230
|
+
showHeader: e(o(), !0),
|
|
219
231
|
/** Custom label for back button (if shown) */
|
|
220
232
|
backButtonLabel: e(t()),
|
|
221
233
|
/** Replace Stripo's display-condition UI with the Conditions tab and create/select drawers */
|
|
222
|
-
externalDisplayConditions: e(
|
|
223
|
-
}),
|
|
234
|
+
externalDisplayConditions: e(o(), !1)
|
|
235
|
+
}), q = a({
|
|
224
236
|
/** Enable dynamic content insertion */
|
|
225
|
-
dynamicContent: e(
|
|
237
|
+
dynamicContent: e(o(), !0),
|
|
226
238
|
/** Enable save as template functionality */
|
|
227
|
-
saveAsTemplate: e(
|
|
239
|
+
saveAsTemplate: e(o(), !0),
|
|
228
240
|
/** Enable version history */
|
|
229
|
-
versionHistory: e(
|
|
241
|
+
versionHistory: e(o(), !0),
|
|
230
242
|
/** Enable test message sending */
|
|
231
|
-
testMessage: e(
|
|
243
|
+
testMessage: e(o(), !0),
|
|
232
244
|
/** Enable display conditions */
|
|
233
|
-
displayConditions: e(
|
|
245
|
+
displayConditions: e(o(), !0),
|
|
234
246
|
/** Enable unsubscribe block */
|
|
235
|
-
unsubscribe: e(
|
|
247
|
+
unsubscribe: e(o(), !0),
|
|
236
248
|
/** Disable modules panel in the editor */
|
|
237
|
-
modulesDisabled: e(
|
|
249
|
+
modulesDisabled: e(o(), !1),
|
|
238
250
|
/** Enable Liquid template syntax */
|
|
239
|
-
liquidSyntax: e(
|
|
251
|
+
liquidSyntax: e(o(), !1),
|
|
240
252
|
/** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
|
|
241
|
-
autosave: e(
|
|
242
|
-
accessibilityTesting: e(
|
|
253
|
+
autosave: e(o(), !1),
|
|
254
|
+
accessibilityTesting: e(o(), !1),
|
|
243
255
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
244
|
-
allowlistEnabled: e(
|
|
256
|
+
allowlistEnabled: e(o(), !1),
|
|
245
257
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
246
|
-
linkTrackingIds: e(
|
|
258
|
+
linkTrackingIds: e(o(), !1),
|
|
247
259
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
248
|
-
allowSaveWithErrors: e(
|
|
249
|
-
reusableRecommendationStrategy: e(
|
|
260
|
+
allowSaveWithErrors: e(o(), !0),
|
|
261
|
+
reusableRecommendationStrategy: e(o(), !1),
|
|
250
262
|
/** Convert linkless legacy unsubscribe blocks into text blocks and warn with a modal (opt-in) */
|
|
251
|
-
legacyUnsubscribeConversion: e(
|
|
263
|
+
legacyUnsubscribeConversion: e(o(), !1),
|
|
252
264
|
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
253
|
-
itemsPriceFormatting: e(
|
|
265
|
+
itemsPriceFormatting: e(o(), !1),
|
|
254
266
|
/** Warn on save when the design carries an Insider unsubscribe link or code (host sets true for SFMC accounts) */
|
|
255
|
-
blockUnsubscribeLinks: e(
|
|
256
|
-
}),
|
|
267
|
+
blockUnsubscribeLinks: e(o(), !1)
|
|
268
|
+
}), G = m([
|
|
257
269
|
"amp-accordion",
|
|
258
270
|
"amp-carousel",
|
|
259
271
|
"amp-form-controls",
|
|
@@ -267,7 +279,7 @@ const b = {
|
|
|
267
279
|
"text-block",
|
|
268
280
|
"timer-block",
|
|
269
281
|
"video-block"
|
|
270
|
-
]),
|
|
282
|
+
]), V = m([
|
|
271
283
|
"dynamic-content",
|
|
272
284
|
"checkbox-block",
|
|
273
285
|
"radio-button-block",
|
|
@@ -275,25 +287,25 @@ const b = {
|
|
|
275
287
|
"unsubscribe-block",
|
|
276
288
|
"coupon-block",
|
|
277
289
|
"items-block"
|
|
278
|
-
]),
|
|
290
|
+
]), z = a({
|
|
279
291
|
/** Default blocks to exclude from the editor */
|
|
280
292
|
excludeDefaults: e(
|
|
281
|
-
|
|
293
|
+
s(G),
|
|
282
294
|
[]
|
|
283
295
|
),
|
|
284
296
|
/** Custom blocks to include in the editor */
|
|
285
297
|
includeCustoms: e(
|
|
286
|
-
|
|
298
|
+
s(V),
|
|
287
299
|
[]
|
|
288
300
|
)
|
|
289
|
-
}), d =
|
|
301
|
+
}), d = a({
|
|
290
302
|
/** Unique identifier for the rule */
|
|
291
303
|
id: t(),
|
|
292
304
|
/** Human-readable description */
|
|
293
305
|
description: e(t()),
|
|
294
306
|
/** Priority for rule ordering (lower = earlier) */
|
|
295
307
|
priority: c()
|
|
296
|
-
}),
|
|
308
|
+
}), W = a({
|
|
297
309
|
...d.entries,
|
|
298
310
|
type: u("replace"),
|
|
299
311
|
/** String to search for */
|
|
@@ -301,8 +313,8 @@ const b = {
|
|
|
301
313
|
/** Replacement string */
|
|
302
314
|
replacement: t(),
|
|
303
315
|
/** Replace all occurrences (default: false) */
|
|
304
|
-
replaceAll: e(
|
|
305
|
-
}),
|
|
316
|
+
replaceAll: e(o())
|
|
317
|
+
}), Z = a({
|
|
306
318
|
...d.entries,
|
|
307
319
|
type: u("regex"),
|
|
308
320
|
/** Regex pattern string */
|
|
@@ -311,87 +323,88 @@ const b = {
|
|
|
311
323
|
replacement: t(),
|
|
312
324
|
/** Regex flags (e.g., 'gi') */
|
|
313
325
|
flags: e(t())
|
|
314
|
-
}),
|
|
326
|
+
}), J = a({
|
|
315
327
|
...d.entries,
|
|
316
328
|
type: u("remove"),
|
|
317
329
|
/** Strings or patterns to remove */
|
|
318
|
-
targets:
|
|
319
|
-
}),
|
|
330
|
+
targets: s(t())
|
|
331
|
+
}), K = a({
|
|
320
332
|
...d.entries,
|
|
321
333
|
type: u("custom"),
|
|
322
334
|
/** Custom processor function */
|
|
323
|
-
processor:
|
|
324
|
-
(
|
|
335
|
+
processor: C(
|
|
336
|
+
(n) => typeof n == "function",
|
|
325
337
|
"processor must be a function"
|
|
326
338
|
)
|
|
327
|
-
}),
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
]),
|
|
339
|
+
}), Q = M("type", [
|
|
340
|
+
W,
|
|
341
|
+
Z,
|
|
342
|
+
J,
|
|
343
|
+
K
|
|
344
|
+
]), X = a({
|
|
333
345
|
/** Custom compiler rules to apply */
|
|
334
|
-
customRules: e(
|
|
346
|
+
customRules: e(s(Q), []),
|
|
335
347
|
/** Skip default compiler rules */
|
|
336
|
-
ignoreDefaultRules: e(
|
|
337
|
-
}),
|
|
348
|
+
ignoreDefaultRules: e(o(), !1)
|
|
349
|
+
}), Y = a({
|
|
338
350
|
/**
|
|
339
351
|
* External validation handler called before save completes.
|
|
340
352
|
* Return false to cancel the save operation.
|
|
341
353
|
*/
|
|
342
354
|
externalValidation: e(
|
|
343
|
-
|
|
344
|
-
(
|
|
355
|
+
C(
|
|
356
|
+
(n) => typeof n == "function",
|
|
345
357
|
"externalValidation must be a function"
|
|
346
358
|
)
|
|
347
359
|
)
|
|
348
|
-
}),
|
|
360
|
+
}), oe = a({
|
|
349
361
|
// Required sections
|
|
350
362
|
/** Identity configuration (required) */
|
|
351
|
-
identity:
|
|
363
|
+
identity: E,
|
|
352
364
|
/** Partner configuration (required) */
|
|
353
|
-
partner:
|
|
365
|
+
partner: x,
|
|
354
366
|
// Optional sections (with defaults)
|
|
355
367
|
/** Template content and presets */
|
|
356
|
-
template: e(
|
|
368
|
+
template: e(B, {}),
|
|
357
369
|
/** Editor settings */
|
|
358
|
-
editor: e(
|
|
370
|
+
editor: e(H, {}),
|
|
359
371
|
/** UI configuration */
|
|
360
|
-
ui: e(
|
|
372
|
+
ui: e(_, {}),
|
|
361
373
|
/** Feature toggles */
|
|
362
|
-
features: e(
|
|
374
|
+
features: e(q, {}),
|
|
363
375
|
/** Block configuration */
|
|
364
|
-
blocks: e(
|
|
376
|
+
blocks: e(z, {}),
|
|
365
377
|
/** Compiler configuration */
|
|
366
|
-
compiler: e(
|
|
378
|
+
compiler: e(X, {}),
|
|
367
379
|
/** Callbacks and event handlers */
|
|
368
|
-
callbacks: e(
|
|
380
|
+
callbacks: e(Y, {})
|
|
369
381
|
});
|
|
370
382
|
export {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
383
|
+
z as BlocksSchema,
|
|
384
|
+
Y as CallbacksSchema,
|
|
385
|
+
Q as CompilerRuleSchema,
|
|
386
|
+
X as CompilerSchema,
|
|
387
|
+
V as CustomBlockTypeSchema,
|
|
388
|
+
K as CustomRuleSchema,
|
|
389
|
+
G as DefaultBlockTypeSchema,
|
|
390
|
+
w as DisplayConditionAttributesSchema,
|
|
391
|
+
O as DynamicContentListSchema,
|
|
392
|
+
y as DynamicContentNodeSchema,
|
|
393
|
+
N as DynamicContentSchema,
|
|
394
|
+
H as EditorSchema,
|
|
395
|
+
j as EmailHeaderSchema,
|
|
396
|
+
v as FallbackFontSchema,
|
|
397
|
+
q as FeaturesSchema,
|
|
398
|
+
oe as GuidoConfigSchema,
|
|
399
|
+
E as IdentitySchema,
|
|
400
|
+
F as LegacyRecommendationConfigSchema,
|
|
401
|
+
p as MessageType,
|
|
402
|
+
x as PartnerSchema,
|
|
390
403
|
l as ProductType,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
Z as RegexRuleSchema,
|
|
405
|
+
J as RemoveRuleSchema,
|
|
406
|
+
W as ReplaceRuleSchema,
|
|
407
|
+
U as TemplateMigrationSchema,
|
|
408
|
+
B as TemplateSchema,
|
|
409
|
+
_ as UISchema
|
|
397
410
|
};
|
|
@@ -1,25 +1,49 @@
|
|
|
1
|
-
import { object as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { object as t, optional as c, string as e, nullish as r, number as n, picklist as i, array as a, pipe as o, minLength as s, literal as u, regex as l } from "../node_modules/valibot/dist/index.js";
|
|
2
|
+
const h = i(["liquid", "pongo"]), g = i(["codeOnly", "logicBuilder"]), p = i(["string", "number", "boolean", "date", "strings"]), d = i(["and", "or"]), y = i(["is", "isNot", "contains", "notContains", "isOneOf", "isNotOneOf"]), m = /^[A-Za-z_][\w.]*$/, O = t({
|
|
3
|
+
key: o(e(), l(m)),
|
|
4
|
+
label: o(e(), s(1)),
|
|
5
|
+
type: c(p, "string"),
|
|
6
|
+
options: c(a(t({ label: e(), value: e() })), [])
|
|
7
|
+
}), S = t({
|
|
8
|
+
attribute: o(e(), l(m)),
|
|
9
|
+
type: p,
|
|
10
|
+
operator: y,
|
|
11
|
+
values: o(a(e()), s(1))
|
|
12
|
+
}), b = t({
|
|
13
|
+
condition: d,
|
|
14
|
+
rules: o(a(S), s(1))
|
|
15
|
+
}), R = t({
|
|
16
|
+
version: u(1),
|
|
17
|
+
condition: d,
|
|
18
|
+
groups: o(a(b), s(1))
|
|
19
|
+
}), A = t({
|
|
20
|
+
id: n(),
|
|
21
|
+
name: e(),
|
|
22
|
+
description: r(e(), ""),
|
|
23
|
+
syntax: h,
|
|
24
|
+
method: g,
|
|
25
|
+
codeBefore: e(),
|
|
26
|
+
codeAfter: r(e(), ""),
|
|
27
|
+
createdAt: c(e())
|
|
28
|
+
}), T = t({
|
|
29
|
+
data: a(A),
|
|
30
|
+
meta: t({
|
|
31
|
+
totalCount: n(),
|
|
32
|
+
perPage: n(),
|
|
33
|
+
currentPage: n(),
|
|
34
|
+
lastPage: n()
|
|
18
35
|
})
|
|
19
36
|
});
|
|
20
37
|
export {
|
|
21
|
-
p as
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
p as AttributeTypeSchema,
|
|
39
|
+
O as DisplayConditionAttributeSchema,
|
|
40
|
+
T as DisplayConditionListResponseSchema,
|
|
41
|
+
g as DisplayConditionMethodSchema,
|
|
42
|
+
h as DisplayConditionSyntaxSchema,
|
|
43
|
+
d as LogicOperatorSchema,
|
|
44
|
+
b as RuleGroupSchema,
|
|
45
|
+
y as RuleOperatorSchema,
|
|
46
|
+
S as RuleSchema,
|
|
47
|
+
R as RuleTreeSchema,
|
|
48
|
+
A as SavedDisplayConditionSchema
|
|
25
49
|
};
|
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./DisplayConditionCreateDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
|
+
var o = this, i = o._self._c, e = o._self._setupProxy;
|
|
6
|
+
return i(e.WpDrawer, { attrs: { id: "guido__display-condition-create-drawer", "description-status": "", "class-name": "guido-display-condition-create-drawer", size: "large", "close-on-outside-click": !1, "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.store.isCreateOpen, "title-text": e.trans(`${e.KEY}.create-title`) }, on: { cancelOrBackButtonEvent: e.close, onCloseEvent: e.close, primaryButtonEvent: function(t) {
|
|
7
7
|
return e.submit("inline");
|
|
8
|
-
}, secondaryButtonEvent: function(
|
|
8
|
+
}, secondaryButtonEvent: function(t) {
|
|
9
9
|
return e.submit("save");
|
|
10
|
-
} } }, [
|
|
11
|
-
return e.updateField("name",
|
|
12
|
-
} } }),
|
|
13
|
-
return e.updateField("description",
|
|
14
|
-
} } }),
|
|
15
|
-
return e.
|
|
16
|
-
} } }),
|
|
17
|
-
return e.
|
|
18
|
-
} } })], 1)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
} } }, [i("div", { ref: "contentRef", staticClass: "guido-display-condition-create" }, [i(e.InBasicTextInput, o._b({ staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-name-input", name: "displayConditionName", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.trans(`${e.KEY}.condition-name`), "max-character-length": e.DISPLAY_CONDITION_LIMITS.NAME_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-name-placeholder`), "state-message": e.errors.name || "", states: e.errors.name ? "error" : "default", "tooltip-status": !1, value: e.draft.name }, on: { input: function(t) {
|
|
11
|
+
return e.updateField("name", t);
|
|
12
|
+
} } }, "InBasicTextInput", e.invalidFieldAttrs(e.errors.name), !1)), i(e.InBasicTextInput, o._b({ staticClass: "mb-4 w-1", attrs: { id: "guido__display-condition-description-input", name: "displayConditionDescription", "character-counter-status": !1, "disabled-status": e.isSaving, "label-text": e.descriptionLabel, "max-character-length": e.DISPLAY_CONDITION_LIMITS.DESCRIPTION_MAX, "placeholder-text": e.trans(`${e.KEY}.condition-description-placeholder`), "state-message": e.errors.description || "", states: e.errors.description ? "error" : "default", "tooltip-status": !1, value: e.draft.description }, on: { input: function(t) {
|
|
13
|
+
return e.updateField("description", t);
|
|
14
|
+
} } }, "InBasicTextInput", e.invalidFieldAttrs(e.errors.description), !1)), i("div", { staticClass: "guido-display-condition-create__separator t-c-3" }), i("p", { staticClass: "guido-display-condition-create__method-title mt-0 mb-4 f-s-1 f-w-600 l-h-6 l-s-5 t-t-u t-c-55" }, [o._v(" " + o._s(e.trans(`${e.KEY}.condition-method`)) + " ")]), i("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [i(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", name: "displayConditionMethod", value: "logicBuilder", disable: e.isSaving, label: e.trans(`${e.KEY}.logic-builder`), selected: e.draft.method }, on: { click: function(t) {
|
|
15
|
+
return e.selectMethod("logicBuilder");
|
|
16
|
+
} } }), i(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", value: "codeOnly", disable: e.isSaving, label: e.trans(`${e.KEY}.code-only`), selected: e.draft.method }, on: { click: function(t) {
|
|
17
|
+
return e.selectMethod("codeOnly");
|
|
18
|
+
} } })], 1), e.isLogicBuilder ? i(e.LogicBuilderField, { attrs: { "custom-attributes": e.attributes.custom, "default-attributes": e.attributes.default, disabled: e.isSaving, "show-errors": e.showRuleErrors }, model: { value: e.builder, callback: function(t) {
|
|
19
|
+
e.builder = t;
|
|
20
|
+
}, expression: "builder" } }) : o._e(), e.isLogicBuilder ? o._e() : i(e.CodeEditorField, o._b({ ref: "codeBeforeRef", staticClass: "mb-3", attrs: { id: "guido__display-condition-code-before", disabled: e.isSaving, error: e.errors.codeBefore, label: e.trans(`${e.KEY}.code-before`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeBefore }, on: { input: function(t) {
|
|
21
|
+
return e.updateField("codeBefore", t);
|
|
22
|
+
} } }, "CodeEditorField", e.invalidFieldAttrs(e.errors.codeBefore), !1)), e.isLogicBuilder ? o._e() : i(e.CodeEditorField, o._b({ ref: "codeAfterRef", attrs: { id: "guido__display-condition-code-after", disabled: e.isSaving, error: e.errors.codeAfter, label: e.trans(`${e.KEY}.code-after`), placeholder: e.trans(`${e.KEY}.code-placeholder`), value: e.draft.codeAfter }, on: { input: function(t) {
|
|
23
|
+
return e.updateField("codeAfter", t);
|
|
24
|
+
} } }, "CodeEditorField", e.invalidFieldAttrs(e.errors.codeAfter), !1))], 1)]);
|
|
25
|
+
}, n = [], d = /* @__PURE__ */ a(
|
|
26
|
+
r,
|
|
22
27
|
s,
|
|
28
|
+
n,
|
|
23
29
|
!1,
|
|
24
30
|
null,
|
|
25
|
-
"
|
|
31
|
+
"a7035356"
|
|
26
32
|
);
|
|
27
33
|
const f = d.exports;
|
|
28
34
|
export {
|