@useinsider/guido 3.27.1-beta.11898c7 → 3.27.1-beta.2b26af9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +10 -0
  2. package/dist/@types/config/schemas.js +142 -129
  3. package/dist/@types/display-condition.js +45 -21
  4. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +25 -19
  5. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +77 -55
  6. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
  7. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +62 -43
  8. package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue.js +18 -0
  9. package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue2.js +25 -0
  10. package/dist/components/organisms/display-conditions/LogicBuilderField.vue.js +28 -0
  11. package/dist/components/organisms/display-conditions/LogicBuilderField.vue2.js +28 -0
  12. package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue.js +30 -0
  13. package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue2.js +32 -0
  14. package/dist/components/organisms/display-conditions/LogicBuilderRow.vue.js +28 -0
  15. package/dist/components/organisms/display-conditions/LogicBuilderRow.vue2.js +60 -0
  16. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +10 -9
  17. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +41 -42
  18. package/dist/composables/useDisplayConditions.js +83 -68
  19. package/dist/composables/useScrollToInvalid.js +15 -0
  20. package/dist/enums/html-validator.js +1 -1
  21. package/dist/extensions/DisplayConditions/constants.js +19 -10
  22. package/dist/extensions/DisplayConditions/control.js +120 -99
  23. package/dist/extensions/DisplayConditions/display-conditions.css.js +58 -6
  24. package/dist/extensions/DisplayConditions/extension.js +18 -14
  25. package/dist/guido.css +1 -1
  26. package/dist/node_modules/valibot/dist/index.js +118 -102
  27. package/dist/package.json.js +1 -1
  28. package/dist/services/displayConditionApi.js +18 -19
  29. package/dist/src/@types/config/schemas.d.ts +65 -0
  30. package/dist/src/@types/display-condition.d.ts +67 -0
  31. package/dist/src/components/organisms/display-conditions/LogicBuilderConnector.vue.d.ts +19 -0
  32. package/dist/src/components/organisms/display-conditions/LogicBuilderField.vue.d.ts +22 -0
  33. package/dist/src/components/organisms/display-conditions/LogicBuilderGroup.vue.d.ts +24 -0
  34. package/dist/src/components/organisms/display-conditions/LogicBuilderRow.vue.d.ts +25 -0
  35. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  36. package/dist/src/composables/useConfig.d.ts +42 -2
  37. package/dist/src/composables/useDisplayConditions.d.ts +1 -1
  38. package/dist/src/composables/useScrollToInvalid.d.ts +6 -0
  39. package/dist/src/extensions/DisplayConditions/constants.d.ts +2 -0
  40. package/dist/src/extensions/DisplayConditions/control.d.ts +1 -0
  41. package/dist/src/stores/config.d.ts +441 -21
  42. package/dist/src/utils/displayConditionBuilder.d.ts +29 -0
  43. package/dist/src/utils/displayConditionRules.d.ts +12 -0
  44. package/dist/src/utils/displayConditionSummary.d.ts +11 -0
  45. package/dist/utils/displayConditionBuilder.js +50 -0
  46. package/dist/utils/displayConditionRules.js +91 -0
  47. package/dist/utils/displayConditionSummary.js +28 -0
  48. package/package.json +2 -2
package/README.md CHANGED
@@ -130,6 +130,16 @@ const config: GuidoConfigInput = {
130
130
  // Behaviour change: releases up to v3.23.0 forced a recreate for any non-empty html and
131
131
  // ignored this option, so a host that sends `false` now gets Stripo's stored copy.
132
132
  forceRecreate?: boolean,
133
+ // Properties offered by the display-condition Logic Builder (features.externalDisplayConditions),
134
+ // listed under "Custom Attributes" and "Default Attributes". `key` is the Liquid/Pongo variable the
135
+ // compiled condition reads; `type` picks the operators and the value input; `options` turns the value
136
+ // into a select. Invalid items are dropped. Default: { custom: [], default: [] }.
137
+ // Item shape: { key: string, label: string, type?: 'string' | 'number' | 'boolean' | 'date' | 'strings'
138
+ // (default 'string'), options?: { label: string, value: string }[] }. Dates compare as YYYY-MM-DD strings.
139
+ displayConditionAttributes?: {
140
+ custom?: DisplayConditionAttributeItem[],
141
+ default?: DisplayConditionAttributeItem[],
142
+ },
133
143
  migration?: {
134
144
  // Legacy block configs keyed by block ID. Consumed once by the migrator
135
145
  // when upgrading templates authored with v1 block formats. See the
@@ -1,6 +1,7 @@
1
- import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as o, number as c, optional as e, string as t, picklist as m, pipe as r, minLength as p, custom as k, boolean as a, array as n, transform as S, unknown as i, record as g, fallback as R, literal as u, looseObject as C, variant as T, union as h, lazy as I } from "../../node_modules/valibot/dist/index.js";
3
- const b = {
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
- }, A = o({
16
+ }, E = a({
16
17
  /** Unique identifier for the template being edited */
17
18
  templateId: r(
18
19
  t(),
19
- p(1, "templateId is required")
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
- p(1, "userId is required")
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
- }), L = o({
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
- }), E = o({
42
+ }), x = a({
42
43
  /** Partner/organization name (required) */
43
44
  name: r(
44
45
  t(),
45
- p(1, "partner.name is required")
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([b.PROMOTIONAL, b.TRANSACTIONAL]),
59
- b.PROMOTIONAL
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(L)
65
- }), M = o({
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
- o({
75
+ a({
75
76
  key: t(),
76
77
  value: t()
77
78
  })
78
79
  )
79
- }), f = I(() => C({
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(n(f)),
85
+ children: e(s(y)),
85
86
  // eslint-disable-next-line camelcase -- backend field name
86
- select_items: e(n(f))
87
- })), P = g(
87
+ select_items: e(s(y))
88
+ })), O = R(
88
89
  t(),
89
- R(n(f), [])
90
- ), v = C({
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(h([t(), c()])),
95
+ decimalCount: e(k([t(), c()])),
95
96
  /** Pinned product IDs (empty array when filter-driven) */
96
- productIds: e(n(i())),
97
+ productIds: e(s(i())),
97
98
  /** Whether the block requested live products at send time */
98
- sendProductRequestFlag: e(a()),
99
+ sendProductRequestFlag: e(o()),
99
100
  /** Whether to randomize product order */
100
- shuffleProducts: e(a()),
101
+ shuffleProducts: e(o()),
101
102
  /** Filter rules driving product selection */
102
- filters: e(n(i())),
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(n(i())),
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(a()),
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(a()),
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(h([t(), c()])),
129
+ size: e(k([t(), c()])),
129
130
  /** Vertical responsiveness flag (legacy size=1 variants) */
130
- verticalResponsiveness: e(a()),
131
+ verticalResponsiveness: e(o()),
131
132
  /** Legacy "Move to next line" price placement toggle (cardPricePlacement.js) */
132
- isPriceMovedToNextLine: e(a()),
133
+ isPriceMovedToNextLine: e(o()),
133
134
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
134
- isPriceDeletedForZeroSale: e(a())
135
- }), x = o({
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
- g(t(), v),
144
+ R(t(), F),
144
145
  {}
145
146
  )
146
- }), D = o({
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
- n(M),
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(P, {}),
172
+ dynamicContentList: e(O, {}),
163
173
  /** Valid custom field attribute names from the partner's categorized fields */
164
- customFieldAttributes: e(n(t()), []),
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(n(c()), []),
178
+ selectedUnsubscribePages: e(s(c()), []),
167
179
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
168
- forceRecreate: e(a(), !1),
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
- S((s) => Number.isFinite(s) ? Math.max(0, Math.floor(s)) : 0)
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
- S((s) => s && typeof s == "object" ? { ...s } : void 0)
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(x, {})
198
- }), N = o({
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
- }), O = o({
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(N, { senderName: "", subject: "" }),
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(), y.SAVED_MODULES),
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(), y.DEFAULT_MODULES)
216
- }), F = o({
227
+ defaultModulesFolderName: e(t(), h.DEFAULT_MODULES)
228
+ }), _ = a({
217
229
  /** Whether to show the header bar */
218
- showHeader: e(a(), !0),
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(a(), !1)
223
- }), U = o({
234
+ externalDisplayConditions: e(o(), !1)
235
+ }), q = a({
224
236
  /** Enable dynamic content insertion */
225
- dynamicContent: e(a(), !0),
237
+ dynamicContent: e(o(), !0),
226
238
  /** Enable save as template functionality */
227
- saveAsTemplate: e(a(), !0),
239
+ saveAsTemplate: e(o(), !0),
228
240
  /** Enable version history */
229
- versionHistory: e(a(), !0),
241
+ versionHistory: e(o(), !0),
230
242
  /** Enable test message sending */
231
- testMessage: e(a(), !0),
243
+ testMessage: e(o(), !0),
232
244
  /** Enable display conditions */
233
- displayConditions: e(a(), !0),
245
+ displayConditions: e(o(), !0),
234
246
  /** Enable unsubscribe block */
235
- unsubscribe: e(a(), !0),
247
+ unsubscribe: e(o(), !0),
236
248
  /** Disable modules panel in the editor */
237
- modulesDisabled: e(a(), !1),
249
+ modulesDisabled: e(o(), !1),
238
250
  /** Enable Liquid template syntax */
239
- liquidSyntax: e(a(), !1),
251
+ liquidSyntax: e(o(), !1),
240
252
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
241
- autosave: e(a(), !1),
242
- accessibilityTesting: e(a(), !1),
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(a(), !1),
256
+ allowlistEnabled: e(o(), !1),
245
257
  /** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
246
- linkTrackingIds: e(a(), !1),
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(a(), !0),
249
- reusableRecommendationStrategy: e(a(), !1),
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(a(), !1),
263
+ legacyUnsubscribeConversion: e(o(), !1),
252
264
  /** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
253
- itemsPriceFormatting: e(a(), !1),
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(a(), !1)
256
- }), w = m([
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
- ]), B = m([
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
- ]), j = o({
290
+ ]), z = a({
279
291
  /** Default blocks to exclude from the editor */
280
292
  excludeDefaults: e(
281
- n(w),
293
+ s(G),
282
294
  []
283
295
  ),
284
296
  /** Custom blocks to include in the editor */
285
297
  includeCustoms: e(
286
- n(B),
298
+ s(V),
287
299
  []
288
300
  )
289
- }), d = o({
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
- }), H = o({
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(a())
305
- }), _ = o({
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
- }), q = o({
326
+ }), J = a({
315
327
  ...d.entries,
316
328
  type: u("remove"),
317
329
  /** Strings or patterns to remove */
318
- targets: n(t())
319
- }), G = o({
330
+ targets: s(t())
331
+ }), K = a({
320
332
  ...d.entries,
321
333
  type: u("custom"),
322
334
  /** Custom processor function */
323
- processor: k(
324
- (s) => typeof s == "function",
335
+ processor: C(
336
+ (n) => typeof n == "function",
325
337
  "processor must be a function"
326
338
  )
327
- }), V = T("type", [
328
- H,
329
- _,
330
- q,
331
- G
332
- ]), z = o({
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(n(V), []),
346
+ customRules: e(s(Q), []),
335
347
  /** Skip default compiler rules */
336
- ignoreDefaultRules: e(a(), !1)
337
- }), W = o({
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
- k(
344
- (s) => typeof s == "function",
355
+ C(
356
+ (n) => typeof n == "function",
345
357
  "externalValidation must be a function"
346
358
  )
347
359
  )
348
- }), K = o({
360
+ }), oe = a({
349
361
  // Required sections
350
362
  /** Identity configuration (required) */
351
- identity: A,
363
+ identity: E,
352
364
  /** Partner configuration (required) */
353
- partner: E,
365
+ partner: x,
354
366
  // Optional sections (with defaults)
355
367
  /** Template content and presets */
356
- template: e(D, {}),
368
+ template: e(B, {}),
357
369
  /** Editor settings */
358
- editor: e(O, {}),
370
+ editor: e(H, {}),
359
371
  /** UI configuration */
360
- ui: e(F, {}),
372
+ ui: e(_, {}),
361
373
  /** Feature toggles */
362
- features: e(U, {}),
374
+ features: e(q, {}),
363
375
  /** Block configuration */
364
- blocks: e(j, {}),
376
+ blocks: e(z, {}),
365
377
  /** Compiler configuration */
366
- compiler: e(z, {}),
378
+ compiler: e(X, {}),
367
379
  /** Callbacks and event handlers */
368
- callbacks: e(W, {})
380
+ callbacks: e(Y, {})
369
381
  });
370
382
  export {
371
- j as BlocksSchema,
372
- W as CallbacksSchema,
373
- V as CompilerRuleSchema,
374
- z as CompilerSchema,
375
- B as CustomBlockTypeSchema,
376
- G as CustomRuleSchema,
377
- w as DefaultBlockTypeSchema,
378
- P as DynamicContentListSchema,
379
- f as DynamicContentNodeSchema,
380
- M as DynamicContentSchema,
381
- O as EditorSchema,
382
- N as EmailHeaderSchema,
383
- L as FallbackFontSchema,
384
- U as FeaturesSchema,
385
- K as GuidoConfigSchema,
386
- A as IdentitySchema,
387
- v as LegacyRecommendationConfigSchema,
388
- b as MessageType,
389
- E as PartnerSchema,
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
- _ as RegexRuleSchema,
392
- q as RemoveRuleSchema,
393
- H as ReplaceRuleSchema,
394
- x as TemplateMigrationSchema,
395
- D as TemplateSchema,
396
- F as UISchema
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 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()
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 DisplayConditionListResponseSchema,
22
- d as DisplayConditionMethodSchema,
23
- s as DisplayConditionSyntaxSchema,
24
- r as SavedDisplayConditionSchema
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 a from "./DisplayConditionCreateDrawer.vue2.js";
1
+ import r from "./DisplayConditionCreateDrawer.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var i = this, t = i._self._c, e = i._self._setupProxy;
6
- return t(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(o) {
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(o) {
8
+ }, secondaryButtonEvent: function(t) {
9
9
  return e.submit("save");
10
- } } }, [t("div", { staticClass: "guido-display-condition-create" }, [t(e.InBasicTextInput, { 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(o) {
11
- return e.updateField("name", o);
12
- } } }), t(e.InBasicTextInput, { 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(o) {
13
- return e.updateField("description", o);
14
- } } }), t("div", { staticClass: "guido-display-condition-create__separator t-c-3" }), t("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" }, [i._v(" " + i._s(e.trans(`${e.KEY}.select-method`)) + " ")]), t("div", { staticClass: "guido-display-condition-create__methods d-f mb-4" }, [t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-logic-builder", disable: "", disabled: "", name: "displayConditionMethod", selected: "codeOnly", value: "logicBuilder", label: e.trans(`${e.KEY}.logic-builder`) } }), t(e.InRadioButton, { attrs: { id: "guido__display-condition-method-code-only", name: "displayConditionMethod", selected: "codeOnly", value: "codeOnly", label: e.trans(`${e.KEY}.code-only`) } })], 1), t(e.CodeEditorField, { 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(o) {
15
- return e.updateField("codeBefore", o);
16
- } } }), t(e.CodeEditorField, { 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(o) {
17
- return e.updateField("codeAfter", o);
18
- } } })], 1)]);
19
- }, s = [], d = /* @__PURE__ */ r(
20
- a,
21
- n,
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
- "929822bc"
31
+ "a7035356"
26
32
  );
27
33
  const f = d.exports;
28
34
  export {