@useinsider/guido 3.12.0-beta.eb4ca1c → 3.12.0-beta.f48e1bc

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 CHANGED
@@ -161,16 +161,11 @@ const config: GuidoConfigInput = {
161
161
  modulesDisabled?: boolean, // Default: false - Disable modules panel
162
162
  liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
163
163
  autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
164
- allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (see below).
165
164
  },
166
165
 
167
166
  // Optional: Callbacks
168
167
  callbacks?: {
169
168
  externalValidation?: (data: SavedTemplateDetails) => Promise<boolean>, // Return false to cancel save
170
- // OPTIONAL override for the allowlist block toaster. By default Guido self-serves it: it resolves the user
171
- // role via /get-user-role-and-email, builds the settings deep-link, and reads copy from window.trans — so
172
- // consumers only set features.allowlistEnabled. Supply this only to replace that content; null/void keeps the default.
173
- resolveAllowlistToast?: (blockedDomains: string[]) => { message: string, actionButton?: { text: string, onClick: () => void } } | null | void,
174
169
  },
175
170
 
176
171
  // Optional: Block configuration
@@ -1,5 +1,5 @@
1
1
  import { ModuleFolderDefaults as y } from "../../enums/defaults.js";
2
- import { object as a, number as n, optional as e, string as t, picklist as i, pipe as p, minLength as b, custom as S, boolean as o, array as c, record as k, fallback as C, literal as m, looseObject as g, variant as R, union as h, unknown as l, lazy as T } from "../../node_modules/valibot/dist/index.js";
2
+ import { object as a, number as n, optional as e, string as t, picklist as l, pipe as p, minLength as b, custom as f, boolean as o, array as c, record as k, fallback as C, literal as i, looseObject as g, variant as R, union as h, unknown as s, lazy as T } from "../../node_modules/valibot/dist/index.js";
3
3
  const d = {
4
4
  /** Promotional/marketing emails */
5
5
  PROMOTIONAL: 1,
@@ -30,7 +30,7 @@ const d = {
30
30
  name: t(),
31
31
  /** Fallback font family (e.g., "serif" or "sans-serif") */
32
32
  family: t()
33
- }), v = a({
33
+ }), L = a({
34
34
  /** Partner/organization name (required) */
35
35
  name: p(
36
36
  t(),
@@ -38,7 +38,7 @@ const d = {
38
38
  ),
39
39
  /** Product type identifier */
40
40
  productType: e(
41
- i([
41
+ l([
42
42
  r.EMAIL,
43
43
  r.ARCHITECT,
44
44
  r.UNSUBSCRIBE_PAGES
@@ -47,14 +47,14 @@ const d = {
47
47
  ),
48
48
  /** Message type (promotional or transactional) */
49
49
  messageType: e(
50
- i([d.PROMOTIONAL, d.TRANSACTIONAL]),
50
+ l([d.PROMOTIONAL, d.TRANSACTIONAL]),
51
51
  d.PROMOTIONAL
52
52
  ),
53
53
  /** Display name for the current user */
54
54
  username: e(t(), "Guido User"),
55
55
  /** Fallback font settings from partner settings — used to match backend size calculation */
56
56
  fallbackFont: e(I)
57
- }), L = a({
57
+ }), v = a({
58
58
  /** Display text for the dynamic content */
59
59
  text: t(),
60
60
  /** Template variable value (e.g., {{username}}) */
@@ -68,40 +68,40 @@ const d = {
68
68
  value: t()
69
69
  })
70
70
  )
71
- }), f = T(() => g({
71
+ }), S = T(() => g({
72
72
  text: e(t()),
73
73
  // eslint-disable-next-line camelcase -- backend field name
74
74
  tag_text: e(t()),
75
75
  value: e(t()),
76
- children: e(c(f)),
76
+ children: e(c(S)),
77
77
  // eslint-disable-next-line camelcase -- backend field name
78
- select_items: e(c(f))
79
- })), E = k(
78
+ select_items: e(c(S))
79
+ })), P = k(
80
80
  t(),
81
- C(c(f), [])
82
- ), P = g({
81
+ C(c(S), [])
82
+ ), D = g({
83
83
  /** Block ID (matches the dictionary key and the legacy HTML element id) */
84
84
  id: e(n()),
85
85
  /** Decimal places for price display (legacy data may use string or number) */
86
86
  decimalCount: e(h([t(), n()])),
87
87
  /** Pinned product IDs (empty array when filter-driven) */
88
- productIds: e(c(l())),
88
+ productIds: e(c(s())),
89
89
  /** Whether the block requested live products at send time */
90
90
  sendProductRequestFlag: e(o()),
91
91
  /** Whether to randomize product order */
92
92
  shuffleProducts: e(o()),
93
93
  /** Filter rules driving product selection */
94
- filters: e(c(l())),
94
+ filters: e(c(s())),
95
95
  /** Currency code (e.g. 'EUR') — sometimes absent in legacy data */
96
96
  currency: e(t()),
97
97
  /** Currency display settings (separators, alignment, decimals) */
98
- currencySettings: e(l()),
98
+ currencySettings: e(s()),
99
99
  /** Locale (e.g. 'nl_NL') */
100
100
  language: e(t()),
101
101
  /** Recommendation strategy key (e.g. 'newArrivals') */
102
102
  strategy: e(t()),
103
103
  /** Snapshot of products as rendered by the legacy block */
104
- recommendedProducts: e(c(l())),
104
+ recommendedProducts: e(c(s())),
105
105
  /** Number of product cards per row */
106
106
  cardsInRow: e(n()),
107
107
  /** Mobile-only padding (right) */
@@ -124,7 +124,7 @@ const d = {
124
124
  isPriceMovedToNextLine: e(o()),
125
125
  /** Legacy "Hide if same as discounted" / delete-price-for-zero-sale toggle */
126
126
  isPriceDeletedForZeroSale: e(o())
127
- }), D = a({
127
+ }), E = a({
128
128
  /**
129
129
  * Legacy recommendation block configs keyed by block ID.
130
130
  * Pass this when loading a template authored with the v1
@@ -132,7 +132,7 @@ const d = {
132
132
  * strategy, currency, locale, and layout data.
133
133
  */
134
134
  recommendationConfigs: e(
135
- k(t(), P),
135
+ k(t(), D),
136
136
  {}
137
137
  )
138
138
  }), M = a({
@@ -142,7 +142,7 @@ const d = {
142
142
  css: e(t(), ""),
143
143
  /** Preselected dynamic content items */
144
144
  preselectedDynamicContent: e(
145
- c(L),
145
+ c(v),
146
146
  []
147
147
  ),
148
148
  /**
@@ -151,7 +151,7 @@ const d = {
151
151
  * (first) partner's leaf attributes into the label→token map that repairs
152
152
  * label-form placeholders (`{{ Phone Number }}`) in dropped saved modules.
153
153
  */
154
- dynamicContentList: e(E, {}),
154
+ dynamicContentList: e(P, {}),
155
155
  /** Valid custom field attribute names from the partner's categorized fields */
156
156
  customFieldAttributes: e(c(t()), []),
157
157
  /** Selected unsubscribe page IDs */
@@ -159,7 +159,7 @@ const d = {
159
159
  /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
160
160
  forceRecreate: e(o(), !1),
161
161
  /** Migration-only inputs (legacy block configs) */
162
- migration: e(D, {})
162
+ migration: e(E, {})
163
163
  }), N = a({
164
164
  /** Sender display name */
165
165
  senderName: e(t(), ""),
@@ -201,10 +201,8 @@ const d = {
201
201
  /** Enable Liquid template syntax */
202
202
  liquidSyntax: e(o(), !1),
203
203
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
204
- autosave: e(o(), !1),
205
- /** Enable pre-save domain-allowlist validation (opt-in; host supplies the block toaster via callbacks.resolveAllowlistToast) */
206
- allowlistEnabled: e(o(), !1)
207
- }), w = i([
204
+ autosave: e(o(), !1)
205
+ }), U = l([
208
206
  "amp-accordion",
209
207
  "amp-carousel",
210
208
  "amp-form-controls",
@@ -218,7 +216,7 @@ const d = {
218
216
  "text-block",
219
217
  "timer-block",
220
218
  "video-block"
221
- ]), U = i([
219
+ ]), B = l([
222
220
  "dynamic-content",
223
221
  "checkbox-block",
224
222
  "radio-button-block",
@@ -226,18 +224,18 @@ const d = {
226
224
  "unsubscribe-block",
227
225
  "coupon-block",
228
226
  "items-block"
229
- ]), B = a({
227
+ ]), w = a({
230
228
  /** Default blocks to exclude from the editor */
231
229
  excludeDefaults: e(
232
- c(w),
230
+ c(U),
233
231
  []
234
232
  ),
235
233
  /** Custom blocks to include in the editor */
236
234
  includeCustoms: e(
237
- c(U),
235
+ c(B),
238
236
  []
239
237
  )
240
- }), u = a({
238
+ }), m = a({
241
239
  /** Unique identifier for the rule */
242
240
  id: t(),
243
241
  /** Human-readable description */
@@ -245,8 +243,8 @@ const d = {
245
243
  /** Priority for rule ordering (lower = earlier) */
246
244
  priority: n()
247
245
  }), H = a({
248
- ...u.entries,
249
- type: m("replace"),
246
+ ...m.entries,
247
+ type: i("replace"),
250
248
  /** String to search for */
251
249
  search: t(),
252
250
  /** Replacement string */
@@ -254,8 +252,8 @@ const d = {
254
252
  /** Replace all occurrences (default: false) */
255
253
  replaceAll: e(o())
256
254
  }), _ = a({
257
- ...u.entries,
258
- type: m("regex"),
255
+ ...m.entries,
256
+ type: i("regex"),
259
257
  /** Regex pattern string */
260
258
  pattern: t(),
261
259
  /** Replacement string (supports $1, $2, etc.) */
@@ -263,16 +261,16 @@ const d = {
263
261
  /** Regex flags (e.g., 'gi') */
264
262
  flags: e(t())
265
263
  }), j = a({
266
- ...u.entries,
267
- type: m("remove"),
264
+ ...m.entries,
265
+ type: i("remove"),
268
266
  /** Strings or patterns to remove */
269
267
  targets: c(t())
270
268
  }), q = a({
271
- ...u.entries,
272
- type: m("custom"),
269
+ ...m.entries,
270
+ type: i("custom"),
273
271
  /** Custom processor function */
274
- processor: S(
275
- (s) => typeof s == "function",
272
+ processor: f(
273
+ (u) => typeof u == "function",
276
274
  "processor must be a function"
277
275
  )
278
276
  }), G = R("type", [
@@ -291,29 +289,17 @@ const d = {
291
289
  * Return false to cancel the save operation.
292
290
  */
293
291
  externalValidation: e(
294
- S(
295
- (s) => typeof s == "function",
292
+ f(
293
+ (u) => typeof u == "function",
296
294
  "externalValidation must be a function"
297
295
  )
298
- ),
299
- /**
300
- * OPTIONAL override for the domain-allowlist block toaster (features.allowlistEnabled). By
301
- * default Guido self-serves the toaster — resolves the user role via /get-user-role-and-email,
302
- * builds the settings deep-link, and reads copy from window.trans — so consumers only flip the
303
- * flag. Supply this only to replace that content. Returning null/void keeps Guido's default.
304
- */
305
- resolveAllowlistToast: e(
306
- S(
307
- (s) => typeof s == "function",
308
- "resolveAllowlistToast must be a function"
309
- )
310
296
  )
311
297
  }), K = a({
312
298
  // Required sections
313
299
  /** Identity configuration (required) */
314
300
  identity: A,
315
301
  /** Partner configuration (required) */
316
- partner: v,
302
+ partner: L,
317
303
  // Optional sections (with defaults)
318
304
  /** Template content and presets */
319
305
  template: e(M, {}),
@@ -324,37 +310,37 @@ const d = {
324
310
  /** Feature toggles */
325
311
  features: e(F, {}),
326
312
  /** Block configuration */
327
- blocks: e(B, {}),
313
+ blocks: e(w, {}),
328
314
  /** Compiler configuration */
329
315
  compiler: e(V, {}),
330
316
  /** Callbacks and event handlers */
331
317
  callbacks: e(z, {})
332
318
  });
333
319
  export {
334
- B as BlocksSchema,
320
+ w as BlocksSchema,
335
321
  z as CallbacksSchema,
336
322
  G as CompilerRuleSchema,
337
323
  V as CompilerSchema,
338
- U as CustomBlockTypeSchema,
324
+ B as CustomBlockTypeSchema,
339
325
  q as CustomRuleSchema,
340
- w as DefaultBlockTypeSchema,
341
- E as DynamicContentListSchema,
342
- f as DynamicContentNodeSchema,
343
- L as DynamicContentSchema,
326
+ U as DefaultBlockTypeSchema,
327
+ P as DynamicContentListSchema,
328
+ S as DynamicContentNodeSchema,
329
+ v as DynamicContentSchema,
344
330
  O as EditorSchema,
345
331
  N as EmailHeaderSchema,
346
332
  I as FallbackFontSchema,
347
333
  F as FeaturesSchema,
348
334
  K as GuidoConfigSchema,
349
335
  A as IdentitySchema,
350
- P as LegacyRecommendationConfigSchema,
336
+ D as LegacyRecommendationConfigSchema,
351
337
  d as MessageType,
352
- v as PartnerSchema,
338
+ L as PartnerSchema,
353
339
  r as ProductType,
354
340
  _ as RegexRuleSchema,
355
341
  j as RemoveRuleSchema,
356
342
  H as ReplaceRuleSchema,
357
- D as TemplateMigrationSchema,
343
+ E as TemplateMigrationSchema,
358
344
  M as TemplateSchema,
359
345
  x as UISchema
360
346
  };
@@ -1,52 +1,32 @@
1
- import { useActionsApi as B } from "./useActionsApi.js";
2
- import { useConfig as E } from "./useConfig.js";
3
- import { useSaveStart as q, useSaveComplete as C } from "./useGuidoActions.js";
4
- import { useSyncModuleExtractor as D } from "./useSyncModuleExtractor.js";
5
- import { ToasterTypeOptions as L } from "../enums/toaster.js";
6
- import { useStripoApi as P } from "../services/stripoApi.js";
7
- import { useTemplatePreparation as U } from "../utils/templatePreparation.js";
8
- import { useAllowlistToast as M } from "./useAllowlistToast.js";
9
- import { useHtmlValidator as h } from "./useHtmlValidator.js";
10
- import { useToaster as F } from "./useToaster.js";
11
- import { useAllowlistValidator as O } from "./validators/useAllowlistValidator.js";
12
- import { useCouponBlockValidator as W } from "./validators/useCouponBlockValidator.js";
13
- import { useLiquidValidator as j } from "./validators/useLiquidValidator.js";
14
- import { useUnsubscribeBlockValidator as z } from "./validators/useUnsubscribeBlockValidator.js";
15
- const at = () => {
16
- const c = q(), d = C(), { validateHtml: u } = h(), { validateLiquidSyntax: p } = j(), { validateCouponBlockTags: f } = W(), { validateUnsubscribeBlockUniqueness: v, validateUnsubscribeBlockHasTemplate: w } = z(), { callbacks: s, isFeatureEnabled: l } = E(), { extractSyncModuleData: S } = D(), { setSyncModuleUnsubscriptionPages: b } = P(), { editorSave: V } = B(), { showToaster: T } = F(), { getBlockedDomains: g } = O(), { resolveAllowlistToast: y } = M();
17
- return { save: async (H = !1, r = !1) => {
18
- var n, e, m;
19
- c();
20
- const { prepareTemplateDetails: x } = U(), t = await x();
21
- if (!f(t.compiledHtml) || !v(t.compiledHtml) || !w(t.compiledHtml))
1
+ import { useActionsApi as H } from "./useActionsApi.js";
2
+ import { useConfig as y } from "./useConfig.js";
3
+ import { useSaveStart as w, useSaveComplete as k } from "./useGuidoActions.js";
4
+ import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
5
+ import { useStripoApi as C } from "../services/stripoApi.js";
6
+ import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
7
+ import { useHtmlValidator as B } from "./useHtmlValidator.js";
8
+ import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
9
+ import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
10
+ import { useUnsubscribeBlockValidator as U } from "./validators/useUnsubscribeBlockValidator.js";
11
+ const K = () => {
12
+ const o = w(), s = k(), { validateHtml: r } = B(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { validateUnsubscribeBlockUniqueness: d, validateUnsubscribeBlockHasTemplate: c } = U(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: m } = q(), { setSyncModuleUnsubscriptionPages: p } = C(), { editorSave: v } = H();
13
+ return { save: async (f = !1, S = !1) => {
14
+ var a;
15
+ o();
16
+ const { prepareTemplateDetails: V } = E(), t = await V();
17
+ if (!n(t.compiledHtml) || !d(t.compiledHtml) || !c(t.compiledHtml))
22
18
  return;
23
- if (l("liquidSyntax")) {
24
- if (!await p(t.compiledHtml))
19
+ if (u("liquidSyntax")) {
20
+ if (!await l(t.compiledHtml))
25
21
  return;
26
- } else if (!await u(t.compiledHtml, t.dynamicContentList, !0))
22
+ } else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
27
23
  return;
28
- if ((n = s.value) != null && n.externalValidation && !await s.value.externalValidation(t))
24
+ if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await v())
29
25
  return;
30
- if (l("allowlistEnabled")) {
31
- const o = await g(t.compiledHtml, t.css);
32
- if (o.length) {
33
- if (!r) {
34
- const a = (m = (e = s.value) == null ? void 0 : e.resolveAllowlistToast) == null ? void 0 : m.call(e, o), i = a != null && a.message ? a : await y(o);
35
- i != null && i.message && T({
36
- type: L.Warning,
37
- message: i.message,
38
- actionButton: i.actionButton
39
- });
40
- }
41
- return;
42
- }
43
- }
44
- if (!await V())
45
- return;
46
- const { unsubscribePayload: k, stripoModules: A } = S(t.rawHtml);
47
- return await b(k), t.modules = A, H || d({ ...t, silent: r }), t;
26
+ const { unsubscribePayload: b, stripoModules: x } = m(t.rawHtml);
27
+ return await p(b), t.modules = x, f || s({ ...t, silent: S }), t;
48
28
  } };
49
29
  };
50
30
  export {
51
- at as useSave
31
+ K as useSave
52
32
  };
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import type { DynamicContentNode } from '../generic';
9
9
  import type { SavedTemplateDetails } from '../stripo';
10
- import type { ActionButton } from '../toaster';
11
10
  import * as v from 'valibot';
12
11
  /**
13
12
  * Handler function for external validation before save
@@ -15,19 +14,6 @@ import * as v from 'valibot';
15
14
  * @returns Promise<boolean> - true if valid, false to cancel save
16
15
  */
17
16
  export type ExternalValidationHandler = (data: Omit<SavedTemplateDetails, 'metadata'>) => Promise<boolean>;
18
- /**
19
- * Content for the domain-allowlist block toaster. By default Guido self-serves this (see
20
- * useAllowlistToast): it resolves the user role via /get-user-role-and-email, builds the
21
- * settings deep-link, and pulls copy from window.trans. A host may supply an override to
22
- * replace that content. `actionButton.onClick` runs the action (e.g. the "Add to allowlist"
23
- * deep-link). Returning null/void falls back to Guido's self-served toaster.
24
- * @param blockedDomains - the non-allowlisted domains found in the template
25
- */
26
- export interface AllowlistToastContent {
27
- message: string;
28
- actionButton?: ActionButton;
29
- }
30
- export type ResolveAllowlistToastHandler = (blockedDomains: string[]) => AllowlistToastContent | null | void;
31
17
  /**
32
18
  * Message type constants for email templates
33
19
  */
@@ -391,8 +377,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
391
377
  readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
392
378
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
393
379
  readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
394
- /** Enable pre-save domain-allowlist validation (opt-in; host supplies the block toaster via callbacks.resolveAllowlistToast) */
395
- readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
396
380
  }, undefined>;
397
381
  /**
398
382
  * Default block types available in Stripo
@@ -598,13 +582,6 @@ export declare const CallbacksSchema: v.ObjectSchema<{
598
582
  * Return false to cancel the save operation.
599
583
  */
600
584
  readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
601
- /**
602
- * OPTIONAL override for the domain-allowlist block toaster (features.allowlistEnabled). By
603
- * default Guido self-serves the toaster — resolves the user role via /get-user-role-and-email,
604
- * builds the settings deep-link, and reads copy from window.trans — so consumers only flip the
605
- * flag. Supply this only to replace that content. Returning null/void keeps Guido's default.
606
- */
607
- readonly resolveAllowlistToast: v.OptionalSchema<v.CustomSchema<ResolveAllowlistToastHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
608
585
  }, undefined>;
609
586
  /**
610
587
  * Complete Guido configuration schema
@@ -787,8 +764,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
787
764
  readonly liquidSyntax: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
788
765
  /** Enable autosave (3-min interval + tab-hide). User toggles on/off from the header. */
789
766
  readonly autosave: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
790
- /** Enable pre-save domain-allowlist validation (opt-in; host supplies the block toaster via callbacks.resolveAllowlistToast) */
791
- readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
792
767
  }, undefined>, {}>;
793
768
  /** Block configuration */
794
769
  readonly blocks: v.OptionalSchema<v.ObjectSchema<{
@@ -859,12 +834,5 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
859
834
  * Return false to cancel the save operation.
860
835
  */
861
836
  readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
862
- /**
863
- * OPTIONAL override for the domain-allowlist block toaster (features.allowlistEnabled). By
864
- * default Guido self-serves the toaster — resolves the user role via /get-user-role-and-email,
865
- * builds the settings deep-link, and reads copy from window.trans — so consumers only flip the
866
- * flag. Supply this only to replace that content. Returning null/void keeps Guido's default.
867
- */
868
- readonly resolveAllowlistToast: v.OptionalSchema<v.CustomSchema<ResolveAllowlistToastHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
869
837
  }, undefined>, {}>;
870
838
  }, undefined>;
@@ -96,7 +96,6 @@ export declare const useConfig: () => {
96
96
  modulesDisabled: boolean;
97
97
  liquidSyntax: boolean;
98
98
  autosave: boolean;
99
- allowlistEnabled: boolean;
100
99
  };
101
100
  blocks: {
102
101
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -136,7 +135,6 @@ export declare const useConfig: () => {
136
135
  };
137
136
  callbacks: {
138
137
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
139
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
140
138
  };
141
139
  } | null>;
142
140
  initialized: import("vue").Ref<boolean>;
@@ -229,7 +227,6 @@ export declare const useConfig: () => {
229
227
  modulesDisabled: boolean;
230
228
  liquidSyntax: boolean;
231
229
  autosave: boolean;
232
- allowlistEnabled: boolean;
233
230
  } | null>;
234
231
  blocks: import("vue").ComputedRef<{
235
232
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -269,7 +266,6 @@ export declare const useConfig: () => {
269
266
  } | null>;
270
267
  callbacks: import("vue").ComputedRef<{
271
268
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
272
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
273
269
  } | null>;
274
270
  templateId: import("vue").ComputedRef<string>;
275
271
  userId: import("vue").ComputedRef<string>;
@@ -101,7 +101,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
101
101
  modulesDisabled: boolean;
102
102
  liquidSyntax: boolean;
103
103
  autosave: boolean;
104
- allowlistEnabled: boolean;
105
104
  };
106
105
  blocks: {
107
106
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -141,7 +140,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
141
140
  };
142
141
  callbacks: {
143
142
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
144
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
145
143
  };
146
144
  } | null;
147
145
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => IdentityConfig | null;
@@ -240,7 +238,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
240
238
  modulesDisabled: boolean;
241
239
  liquidSyntax: boolean;
242
240
  autosave: boolean;
243
- allowlistEnabled: boolean;
244
241
  };
245
242
  blocks: {
246
243
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -280,7 +277,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
280
277
  };
281
278
  callbacks: {
282
279
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
283
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
284
280
  };
285
281
  } | null;
286
282
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => PartnerConfig | null;
@@ -379,7 +375,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
379
375
  modulesDisabled: boolean;
380
376
  liquidSyntax: boolean;
381
377
  autosave: boolean;
382
- allowlistEnabled: boolean;
383
378
  };
384
379
  blocks: {
385
380
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -419,7 +414,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
419
414
  };
420
415
  callbacks: {
421
416
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
422
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
423
417
  };
424
418
  } | null;
425
419
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => TemplateConfig | null;
@@ -518,7 +512,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
518
512
  modulesDisabled: boolean;
519
513
  liquidSyntax: boolean;
520
514
  autosave: boolean;
521
- allowlistEnabled: boolean;
522
515
  };
523
516
  blocks: {
524
517
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -558,7 +551,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
558
551
  };
559
552
  callbacks: {
560
553
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
561
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
562
554
  };
563
555
  } | null;
564
556
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => EditorConfig | null;
@@ -657,7 +649,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
657
649
  modulesDisabled: boolean;
658
650
  liquidSyntax: boolean;
659
651
  autosave: boolean;
660
- allowlistEnabled: boolean;
661
652
  };
662
653
  blocks: {
663
654
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -697,7 +688,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
697
688
  };
698
689
  callbacks: {
699
690
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
700
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
701
691
  };
702
692
  } | null;
703
693
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => UIConfig | null;
@@ -796,7 +786,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
796
786
  modulesDisabled: boolean;
797
787
  liquidSyntax: boolean;
798
788
  autosave: boolean;
799
- allowlistEnabled: boolean;
800
789
  };
801
790
  blocks: {
802
791
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -836,7 +825,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
836
825
  };
837
826
  callbacks: {
838
827
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
839
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
840
828
  };
841
829
  } | null;
842
830
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => FeaturesConfig | null;
@@ -935,7 +923,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
935
923
  modulesDisabled: boolean;
936
924
  liquidSyntax: boolean;
937
925
  autosave: boolean;
938
- allowlistEnabled: boolean;
939
926
  };
940
927
  blocks: {
941
928
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -975,7 +962,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
975
962
  };
976
963
  callbacks: {
977
964
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
978
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
979
965
  };
980
966
  } | null;
981
967
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => BlocksConfig | null;
@@ -1074,7 +1060,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1074
1060
  modulesDisabled: boolean;
1075
1061
  liquidSyntax: boolean;
1076
1062
  autosave: boolean;
1077
- allowlistEnabled: boolean;
1078
1063
  };
1079
1064
  blocks: {
1080
1065
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1114,7 +1099,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1114
1099
  };
1115
1100
  callbacks: {
1116
1101
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1117
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1118
1102
  };
1119
1103
  } | null;
1120
1104
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CompilerConfig | null;
@@ -1213,7 +1197,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1213
1197
  modulesDisabled: boolean;
1214
1198
  liquidSyntax: boolean;
1215
1199
  autosave: boolean;
1216
- allowlistEnabled: boolean;
1217
1200
  };
1218
1201
  blocks: {
1219
1202
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1253,7 +1236,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1253
1236
  };
1254
1237
  callbacks: {
1255
1238
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1256
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1257
1239
  };
1258
1240
  } | null;
1259
1241
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => CallbacksConfig | null;
@@ -1352,7 +1334,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1352
1334
  modulesDisabled: boolean;
1353
1335
  liquidSyntax: boolean;
1354
1336
  autosave: boolean;
1355
- allowlistEnabled: boolean;
1356
1337
  };
1357
1338
  blocks: {
1358
1339
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1392,7 +1373,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1392
1373
  };
1393
1374
  callbacks: {
1394
1375
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1395
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1396
1376
  };
1397
1377
  } | null;
1398
1378
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
@@ -1491,7 +1471,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1491
1471
  modulesDisabled: boolean;
1492
1472
  liquidSyntax: boolean;
1493
1473
  autosave: boolean;
1494
- allowlistEnabled: boolean;
1495
1474
  };
1496
1475
  blocks: {
1497
1476
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1531,7 +1510,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1531
1510
  };
1532
1511
  callbacks: {
1533
1512
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1534
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1535
1513
  };
1536
1514
  } | null;
1537
1515
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
@@ -1630,7 +1608,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1630
1608
  modulesDisabled: boolean;
1631
1609
  liquidSyntax: boolean;
1632
1610
  autosave: boolean;
1633
- allowlistEnabled: boolean;
1634
1611
  };
1635
1612
  blocks: {
1636
1613
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1670,7 +1647,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1670
1647
  };
1671
1648
  callbacks: {
1672
1649
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1673
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1674
1650
  };
1675
1651
  } | null;
1676
1652
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
@@ -1769,7 +1745,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1769
1745
  modulesDisabled: boolean;
1770
1746
  liquidSyntax: boolean;
1771
1747
  autosave: boolean;
1772
- allowlistEnabled: boolean;
1773
1748
  };
1774
1749
  blocks: {
1775
1750
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1809,7 +1784,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1809
1784
  };
1810
1785
  callbacks: {
1811
1786
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1812
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1813
1787
  };
1814
1788
  } | null;
1815
1789
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
@@ -1908,7 +1882,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1908
1882
  modulesDisabled: boolean;
1909
1883
  liquidSyntax: boolean;
1910
1884
  autosave: boolean;
1911
- allowlistEnabled: boolean;
1912
1885
  };
1913
1886
  blocks: {
1914
1887
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1948,7 +1921,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1948
1921
  };
1949
1922
  callbacks: {
1950
1923
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
1951
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
1952
1924
  };
1953
1925
  } | null;
1954
1926
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
@@ -2047,7 +2019,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2047
2019
  modulesDisabled: boolean;
2048
2020
  liquidSyntax: boolean;
2049
2021
  autosave: boolean;
2050
- allowlistEnabled: boolean;
2051
2022
  };
2052
2023
  blocks: {
2053
2024
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2087,7 +2058,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2087
2058
  };
2088
2059
  callbacks: {
2089
2060
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2090
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
2091
2061
  };
2092
2062
  } | null;
2093
2063
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => number;
@@ -2186,7 +2156,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2186
2156
  modulesDisabled: boolean;
2187
2157
  liquidSyntax: boolean;
2188
2158
  autosave: boolean;
2189
- allowlistEnabled: boolean;
2190
2159
  };
2191
2160
  blocks: {
2192
2161
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2226,7 +2195,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2226
2195
  };
2227
2196
  callbacks: {
2228
2197
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2229
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
2230
2198
  };
2231
2199
  } | null;
2232
2200
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => string;
@@ -2325,7 +2293,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2325
2293
  modulesDisabled: boolean;
2326
2294
  liquidSyntax: boolean;
2327
2295
  autosave: boolean;
2328
- allowlistEnabled: boolean;
2329
2296
  };
2330
2297
  blocks: {
2331
2298
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2365,7 +2332,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2365
2332
  };
2366
2333
  callbacks: {
2367
2334
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2368
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
2369
2335
  };
2370
2336
  } | null;
2371
2337
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => boolean;
@@ -2464,7 +2430,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2464
2430
  modulesDisabled: boolean;
2465
2431
  liquidSyntax: boolean;
2466
2432
  autosave: boolean;
2467
- allowlistEnabled: boolean;
2468
2433
  };
2469
2434
  blocks: {
2470
2435
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2504,7 +2469,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2504
2469
  };
2505
2470
  callbacks: {
2506
2471
  externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
2507
- resolveAllowlistToast?: import("../@types/config/schemas").ResolveAllowlistToastHandler | undefined;
2508
2472
  };
2509
2473
  } | null;
2510
2474
  } & import("pinia").PiniaCustomStateProperties<ConfigStoreState>) => (feature: keyof FeaturesConfig) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.12.0-beta.eb4ca1c",
3
+ "version": "3.12.0-beta.f48e1bc",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -1,21 +0,0 @@
1
- import { base64EncodeWithSpecialChars as o } from "../utils/base64.js";
2
- import { useTranslations as a } from "./useTranslations.js";
3
- import { useUserRole as i } from "./useUserRole.js";
4
- const s = {
5
- MANAGE: "journey-builder.domain-allowlist-warning",
6
- NON_MANAGE: "settings.allow-list-warning-not-admin-architect",
7
- ADD_BUTTON: "settings.allow-list-warning-add-button"
8
- }, l = (t) => `/settings?openAddModal=true&type=domain&values=${o(t)}#security`, w = () => {
9
- const t = a(), { getIsManageUser: n } = i();
10
- return { resolveAllowlistToast: async (e) => await n() ? {
11
- message: t(s.MANAGE),
12
- actionButton: {
13
- text: t(s.ADD_BUTTON),
14
- onClick: () => window.open(l(e.join(",")), "_blank")
15
- }
16
- } : { message: t(s.NON_MANAGE) } };
17
- };
18
- export {
19
- l as buildAllowlistSettingsUrl,
20
- w as useAllowlistToast
21
- };
@@ -1,13 +0,0 @@
1
- import { RoleEnums as t } from "../enums/roles.js";
2
- import { useHttp as o } from "./useHttp.js";
3
- const s = "/get-user-role-and-email";
4
- let r = null, n = null;
5
- const f = () => {
6
- const { get: l } = o();
7
- return { getIsManageUser: async () => r !== null ? r : (n || (n = l(s).then(({ data: e }) => (r = (e == null ? void 0 : e.role) === t.MANAGE_USERS, r)).catch((e) => (console.error("[GUIDO_ALLOWLIST] role fetch failed", e), !1)).finally(() => {
8
- n = null;
9
- })), n) };
10
- };
11
- export {
12
- f as useUserRole
13
- };
@@ -1,31 +0,0 @@
1
- import { base64EncodeWithSpecialChars as d } from "../../utils/base64.js";
2
- import { useHttp as p } from "../useHttp.js";
3
- const w = "/allowlist/check-single-item", h = /(?:https?:\/\/|www\.)[^\s"'<>()]+/gi, u = /&quot;\/\//gi, D = () => {
4
- const { get: i } = p(), r = (e, o) => {
5
- const c = `${e || ""} ${o || ""}`.replace(u, "https://").match(h) || [], t = /* @__PURE__ */ new Set();
6
- return c.forEach((n) => {
7
- const m = /^https?:\/\//i.test(n) ? n : `https://${n}`;
8
- try {
9
- const { hostname: a } = new URL(m);
10
- a && t.add(a.replace(/^www\./i, "").toLowerCase());
11
- } catch {
12
- }
13
- }), [...t];
14
- }, l = async (e) => {
15
- const o = encodeURIComponent(d(`https://${e}`)), { data: s } = await i(`${w}?item=${o}&type=domain`);
16
- return s.type === "success";
17
- };
18
- return { getBlockedDomains: async (e, o) => {
19
- try {
20
- const s = r(e, o);
21
- return s.length ? (await Promise.all(
22
- s.map(async (t) => ({ domain: t, allowlisted: await l(t) }))
23
- )).filter((t) => !t.allowlisted).map((t) => t.domain) : [];
24
- } catch (s) {
25
- return console.error("[GUIDO_ALLOWLIST] getBlockedDomains failed", s), [];
26
- }
27
- } };
28
- };
29
- export {
30
- D as useAllowlistValidator
31
- };
@@ -1,4 +0,0 @@
1
- var e = /* @__PURE__ */ ((r) => (r.MANAGE_USERS = "manage-users", r))(e || {});
2
- export {
3
- e as RoleEnums
4
- };
@@ -1,17 +0,0 @@
1
- import type { AllowlistToastContent } from '@@/Types/config/schemas';
2
- /**
3
- * Builds the "Add to allowlist" InOne Settings deep-link (Security tab, add-domain modal
4
- * prefilled). The route is identical across InOne products, so Guido builds it generically.
5
- * @param value - domain(s) to prefill; base64-encoded into the `values` query param.
6
- */
7
- export declare const buildAllowlistSettingsUrl: (value: string) => string;
8
- /**
9
- * Builds the domain-allowlist block-toaster content Guido renders when a save is blocked.
10
- * Guido owns the whole toaster: it resolves the user role itself (useUserRole → the shared
11
- * /get-user-role-and-email endpoint) and pulls copy from window.trans, so consumers only need
12
- * to set features.allowlistEnabled. Manage users get the "Add to allowlist" deep-link button;
13
- * everyone else gets a message-only warning. SD-143197.
14
- */
15
- export declare const useAllowlistToast: () => {
16
- resolveAllowlistToast: (blockedDomains: string[]) => Promise<AllowlistToastContent>;
17
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * Resolves whether the current user may manage the partner's domain allowlist, via the shared
3
- * InOne endpoint GET /get-user-role-and-email. Fail-open: on any error the user is treated as
4
- * non-manage (message-only toaster, no "Add to allowlist" deep-link they may not be able to use).
5
- */
6
- export declare const useUserRole: () => {
7
- getIsManageUser: () => Promise<boolean>;
8
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Pre-save domain-allowlist validation. Extracts every external domain from the compiled
3
- * HTML/CSS and asks the backend whether each is allowlisted, so an un-allowlisted link can
4
- * block the save BEFORE anything is persisted. Gated by `features.allowlistEnabled` in
5
- * `useSave`; the block toaster is rendered by Guido from host-supplied content.
6
- */
7
- export declare const useAllowlistValidator: () => {
8
- getBlockedDomains: (html: string, css: string) => Promise<string[]>;
9
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Insider user-role aliases — the kebab-case wire values returned by
3
- * GET /get-user-role-and-email (the same set honey-badger's RoleEnums defines).
4
- * Only the manage-user role is needed in Guido: it gates the "Add to allowlist"
5
- * action in the domain-allowlist block toaster. SD-143197.
6
- */
7
- export declare enum RoleEnums {
8
- MANAGE_USERS = "manage-users"
9
- }