@useinsider/guido 3.26.0-beta.61e9df0 → 3.26.0-beta.8251afd

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 (64) hide show
  1. package/dist/@types/email-be/html-validation.js +24 -0
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +45 -46
  4. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  5. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
  6. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  7. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +27 -28
  8. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
  9. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +27 -42
  10. package/dist/composables/useCustomInterfaceAppearance.js +50 -50
  11. package/dist/composables/useFullStoryBridge.js +9 -10
  12. package/dist/composables/useSave.js +19 -17
  13. package/dist/composables/useSaveValidation.js +142 -249
  14. package/dist/composables/useTranslations.js +14 -9
  15. package/dist/enums/email-be.js +27 -0
  16. package/dist/enums/save-validation.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +40 -52
  18. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +15 -17
  19. package/dist/extensions/Blocks/common-control.js +19 -19
  20. package/dist/extensions/DynamicContent/dynamic-content.js +17 -15
  21. package/dist/guido.css +1 -1
  22. package/dist/node_modules/valibot/dist/index.js +184 -122
  23. package/dist/package.json.js +2 -2
  24. package/dist/services/emailBe/errors/ApiError.js +50 -0
  25. package/dist/services/emailBe/errors/handleApiError.js +31 -0
  26. package/dist/services/emailBe/errors/toApiError.js +71 -0
  27. package/dist/services/emailBe/html/HtmlValidationService.js +35 -0
  28. package/dist/services/emailBe/html/index.js +6 -0
  29. package/dist/services/emailBe/http/HttpManager.js +68 -0
  30. package/dist/services/emailBe/http/RetryStack.js +23 -0
  31. package/dist/services/emailBe/http/client.js +61 -0
  32. package/dist/services/emailBe/http/index.js +10 -0
  33. package/dist/services/emailBe/http/transportErrors.js +20 -0
  34. package/dist/src/@types/email-be/html-validation.d.ts +35 -0
  35. package/dist/src/composables/useSaveValidation.d.ts +2 -2
  36. package/dist/src/enums/email-be.d.ts +26 -0
  37. package/dist/src/enums/save-validation.d.ts +3 -14
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
  39. package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +11 -0
  40. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
  41. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
  42. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
  43. package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +17 -0
  44. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +15 -0
  45. package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +2 -0
  46. package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +4 -0
  47. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
  48. package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +6 -0
  49. package/dist/src/services/emailBe/errors/ApiError.d.ts +40 -0
  50. package/dist/src/services/emailBe/errors/handleApiError.d.ts +11 -0
  51. package/dist/src/services/emailBe/errors/toApiError.d.ts +2 -0
  52. package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +8 -0
  53. package/dist/src/services/emailBe/html/index.d.ts +2 -0
  54. package/dist/src/services/emailBe/http/HttpManager.d.ts +13 -0
  55. package/dist/src/services/emailBe/http/RetryStack.d.ts +6 -0
  56. package/dist/src/services/emailBe/http/client.d.ts +3 -0
  57. package/dist/src/services/emailBe/http/index.d.ts +2 -0
  58. package/dist/src/services/emailBe/http/transportErrors.d.ts +15 -0
  59. package/dist/src/services/emailBe/http/types.d.ts +46 -0
  60. package/dist/src/stores/onboarding.d.ts +0 -1
  61. package/dist/stores/onboarding.js +1 -4
  62. package/package.json +2 -2
  63. package/dist/src/utils/editorShadowRoot.d.ts +0 -1
  64. package/dist/utils/editorShadowRoot.js +0 -8
@@ -0,0 +1,50 @@
1
+ var o = Object.defineProperty;
2
+ var d = (e, r, s) => r in e ? o(e, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[r] = s;
3
+ var t = (e, r, s) => d(e, typeof r != "symbol" ? r + "" : r, s);
4
+ class a extends Error {
5
+ constructor(s) {
6
+ super(s.message);
7
+ t(this, "status");
8
+ t(this, "code");
9
+ t(this, "meta");
10
+ t(this, "errors");
11
+ t(this, "requestId");
12
+ // Guido already showed the auth modal/toast for this failure, so callers must not toast again.
13
+ t(this, "authReported");
14
+ t(this, "cause");
15
+ this.name = new.target.name, this.status = s.status, this.code = s.code, this.meta = s.meta ?? {}, this.errors = s.errors ?? {}, this.requestId = s.requestId ?? "", this.authReported = s.authReported ?? !1, this.cause = s.cause;
16
+ }
17
+ is(s) {
18
+ return this.code === s;
19
+ }
20
+ }
21
+ class u extends a {
22
+ firstMessage() {
23
+ const [r] = Object.values(this.errors);
24
+ return (r == null ? void 0 : r[0]) ?? this.message;
25
+ }
26
+ }
27
+ class h extends a {
28
+ }
29
+ class n extends a {
30
+ }
31
+ class l extends a {
32
+ }
33
+ class E extends a {
34
+ }
35
+ class x extends a {
36
+ }
37
+ class i extends a {
38
+ }
39
+ const m = (e) => e instanceof a;
40
+ export {
41
+ a as ApiError,
42
+ n as ForbiddenError,
43
+ i as NetworkError,
44
+ h as NotFoundError,
45
+ E as RateLimitError,
46
+ x as ServerError,
47
+ l as UnauthorizedError,
48
+ u as ValidationError,
49
+ m as isApiError
50
+ };
@@ -0,0 +1,31 @@
1
+ import { useToaster as a } from "../../../composables/useToaster.js";
2
+ import { useTranslations as f } from "../../../composables/useTranslations.js";
3
+ import { ToasterTypeOptions as i } from "../../../enums/toaster.js";
4
+ import { UnauthorizedError as u, ValidationError as c } from "./ApiError.js";
5
+ import { toApiError as m } from "./toApiError.js";
6
+ const p = "products.something-went-wrong";
7
+ function l(o) {
8
+ return o instanceof c ? o.firstMessage() : f()(p);
9
+ }
10
+ function E(o, t) {
11
+ return (t == null ? void 0 : t[o.code]) ?? (t == null ? void 0 : t[o.status]);
12
+ }
13
+ function A(o, t) {
14
+ const r = m(o);
15
+ if (r.authReported || r instanceof u)
16
+ return r;
17
+ const s = E(r, t.overrides);
18
+ let n = "";
19
+ if (s) {
20
+ const e = s(r);
21
+ if (e === !1)
22
+ return r;
23
+ n = typeof e == "string" ? e : "";
24
+ } else
25
+ n = l(r);
26
+ return console.error(`${t.context} failed`, r), n && !t.silent && a().showToaster({ type: i.Error, message: n }), r;
27
+ }
28
+ export {
29
+ p as GENERIC_MESSAGE_KEY,
30
+ A as handleApiError
31
+ };
@@ -0,0 +1,71 @@
1
+ import { EmailBeErrorCodes as t } from "../../../enums/email-be.js";
2
+ import { HttpStatusError as u, TransportNetworkError as i, SessionExpiredError as c } from "../http/transportErrors.js";
3
+ import { isApiError as d, NetworkError as m, UnauthorizedError as a, ServerError as E, ApiError as N, RateLimitError as A, ValidationError as T, NotFoundError as f, ForbiddenError as I } from "./ApiError.js";
4
+ const p = {
5
+ 400: t.BAD_REQUEST,
6
+ 401: t.UNAUTHENTICATED,
7
+ 403: t.FORBIDDEN,
8
+ 404: t.NOT_FOUND,
9
+ 409: t.CONFLICT,
10
+ 419: t.SESSION_EXPIRED,
11
+ 422: t.VALIDATION_FAILED,
12
+ 429: t.RATE_LIMITED,
13
+ 500: t.INTERNAL_ERROR,
14
+ 502: t.BAD_GATEWAY
15
+ };
16
+ function R(e) {
17
+ return typeof e == "object" && e !== null && !Array.isArray(e);
18
+ }
19
+ function S(e) {
20
+ const { status: n } = e, o = R(e.body) ? e.body : {}, r = o.error ?? {}, s = {
21
+ status: n,
22
+ code: r.code ?? p[n] ?? t.UNKNOWN,
23
+ message: r.message ?? e.message,
24
+ meta: r.meta ?? {},
25
+ errors: r.errors ?? {},
26
+ requestId: o.requestId ?? e.requestId,
27
+ authReported: e.authReported,
28
+ cause: e
29
+ };
30
+ switch (n) {
31
+ case 401:
32
+ case 419:
33
+ return new a(s);
34
+ case 403:
35
+ return new I(s);
36
+ case 404:
37
+ return new f(s);
38
+ case 422:
39
+ return new T(s);
40
+ case 429:
41
+ return new A(s);
42
+ default:
43
+ return n >= 500 ? new E(s) : new N(s);
44
+ }
45
+ }
46
+ function g(e) {
47
+ if (d(e))
48
+ return e;
49
+ if (e instanceof u)
50
+ return S(e);
51
+ if (e instanceof i)
52
+ return new m({
53
+ status: 0,
54
+ code: e.isTimeout ? t.TIMEOUT : t.NETWORK,
55
+ message: e.message,
56
+ cause: e.cause
57
+ });
58
+ if (e instanceof c)
59
+ return new a({
60
+ status: 0,
61
+ code: t.SESSION_EXPIRED,
62
+ message: e.message,
63
+ authReported: !0,
64
+ cause: e
65
+ });
66
+ const n = e instanceof Error ? e.message : String(e);
67
+ return new E({ status: 0, code: t.UNKNOWN, message: n, cause: e });
68
+ }
69
+ export {
70
+ g as toApiError
71
+ };
@@ -0,0 +1,35 @@
1
+ import { EmailBeEndPoints as a, EmailBeErrorCodes as s } from "../../../enums/email-be.js";
2
+ import { ApiError as i } from "../errors/ApiError.js";
3
+ import { handleApiError as c } from "../errors/handleApiError.js";
4
+ import { HtmlValidationResultSchema as m } from "../../../@types/email-be/html-validation.js";
5
+ import { base64EncodeWithSpecialChars as n } from "../../../utils/base64.js";
6
+ import { safeParse as d } from "../../../node_modules/valibot/dist/index.js";
7
+ const l = "[HTML_VALIDATION_SERVICE]", p = { maxRetries: 1, backoffMs: [500] };
8
+ class I {
9
+ constructor(t) {
10
+ this.http = t;
11
+ }
12
+ async validate({ html: t, syntax: o }) {
13
+ try {
14
+ const r = await this.http.request({
15
+ method: "POST",
16
+ url: a.HTML_VALIDATE,
17
+ body: { html: n(t), syntax: o },
18
+ retry: p
19
+ }), e = d(m, r);
20
+ if (!e.success)
21
+ throw new i({
22
+ status: 200,
23
+ code: s.INVALID_RESPONSE,
24
+ message: "Validate answered with an unexpected body",
25
+ cause: e.issues
26
+ });
27
+ return { ok: !0, data: e.output };
28
+ } catch (r) {
29
+ return { ok: !1, error: c(r, { context: `${l} validate` }) };
30
+ }
31
+ }
32
+ }
33
+ export {
34
+ I as HtmlValidationService
35
+ };
@@ -0,0 +1,6 @@
1
+ import { emailBeHttp as t } from "../http/index.js";
2
+ import { HtmlValidationService as i } from "./HtmlValidationService.js";
3
+ const m = new i(t);
4
+ export {
5
+ m as htmlValidationService
6
+ };
@@ -0,0 +1,68 @@
1
+ var u = Object.defineProperty;
2
+ var l = (r, t, e) => t in r ? u(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var o = (r, t, e) => l(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { toApiError as y } from "../errors/toApiError.js";
5
+ import { defaultRetryFor as d, shouldRetry as h, delay as p, backoffDelay as c } from "./RetryStack.js";
6
+ const f = 204, m = (r, t) => {
7
+ if (t === null || typeof t != "object" || Array.isArray(t))
8
+ return t;
9
+ const e = t;
10
+ return Object.fromEntries(Object.keys(e).sort().map((s) => [s, e[s]]));
11
+ };
12
+ function a(r) {
13
+ return r == null ? "" : typeof r == "string" ? r : JSON.stringify(r, m);
14
+ }
15
+ class w {
16
+ constructor(t, e) {
17
+ o(this, "inFlight", /* @__PURE__ */ new Map());
18
+ this.transport = t, this.defaults = e;
19
+ }
20
+ async request(t) {
21
+ return (await this.requestEnvelope(t)).data;
22
+ }
23
+ async requestEnvelope(t) {
24
+ if (!this.shouldDedup(t))
25
+ return this.executeWithRetry(t);
26
+ const e = this.buildKey(t), s = this.inFlight.get(e);
27
+ if (s)
28
+ return s;
29
+ const i = this.executeWithRetry(t);
30
+ this.inFlight.set(e, i);
31
+ try {
32
+ return await i;
33
+ } finally {
34
+ this.inFlight.delete(e);
35
+ }
36
+ }
37
+ buildKey(t) {
38
+ return [
39
+ t.method,
40
+ t.url,
41
+ a(t.params),
42
+ a(t.body)
43
+ ].join("|");
44
+ }
45
+ shouldDedup(t) {
46
+ return t.body instanceof FormData || t.dedup === !1 ? !1 : t.dedup === !0 || this.defaults.dedup && t.method === "GET";
47
+ }
48
+ resolveRetry(t) {
49
+ return t.retry === null ? null : t.retry ?? d(t.method, this.defaults.retry);
50
+ }
51
+ async executeWithRetry(t) {
52
+ const e = this.resolveRetry(t);
53
+ let s = 0;
54
+ for (; ; )
55
+ try {
56
+ const { status: i, data: n } = await this.transport.request(t);
57
+ return i === f || n === "" || n == null ? { data: void 0, meta: [] } : n;
58
+ } catch (i) {
59
+ const n = y(i);
60
+ if (!h(n, e, s))
61
+ throw n;
62
+ await p(c(e, s)), s += 1;
63
+ }
64
+ }
65
+ }
66
+ export {
67
+ w as HttpManager
68
+ };
@@ -0,0 +1,23 @@
1
+ import { NetworkError as f } from "../errors/ApiError.js";
2
+ const s = /* @__PURE__ */ new Set(["GET", "PUT", "DELETE"]);
3
+ function a(t, e) {
4
+ return s.has(t) ? e : null;
5
+ }
6
+ function o(t, e, n) {
7
+ return !e || n >= e.maxRetries || t.authReported ? !1 : t instanceof f || t.status === 429 || t.status >= 500;
8
+ }
9
+ function r(t, e) {
10
+ const n = t.backoffMs[t.backoffMs.length - 1] ?? 0;
11
+ return t.backoffMs[e] ?? n;
12
+ }
13
+ function c(t) {
14
+ return new Promise((e) => {
15
+ setTimeout(e, t);
16
+ });
17
+ }
18
+ export {
19
+ r as backoffDelay,
20
+ a as defaultRetryFor,
21
+ c as delay,
22
+ o as shouldRetry
23
+ };
@@ -0,0 +1,61 @@
1
+ import { isPanelOrigin as u, reportAuthError as l } from "../../../composables/useAuthError.js";
2
+ import { getCsrfToken as p } from "../../../utils/genericUtil.js";
3
+ import { SessionExpiredError as h, TransportNetworkError as m, HttpStatusError as T } from "./transportErrors.js";
4
+ const w = 3e4, y = [401, 403, 419], S = ["POST", "PUT", "PATCH"], E = (t, s, e) => {
5
+ const o = new URLSearchParams();
6
+ Object.entries(e ?? {}).forEach(([i, r]) => {
7
+ r != null && o.append(i, String(r));
8
+ });
9
+ const n = o.toString();
10
+ return `${t}${s}${n ? `?${n}` : ""}`;
11
+ }, b = (t, s) => {
12
+ const e = {
13
+ Accept: "application/json",
14
+ "X-CSRF-TOKEN": p(),
15
+ // Without this a guest fetch gets a 302 to the login page, never an auth status.
16
+ "X-Requested-With": "XMLHttpRequest"
17
+ }, o = { method: t.method, headers: e, signal: s, credentials: "same-origin" };
18
+ return t.body !== void 0 && S.includes(t.method) && (t.body instanceof FormData ? o.body = t.body : (e["Content-Type"] = "application/json", o.body = JSON.stringify(t.body))), o;
19
+ }, f = (t) => {
20
+ if (t === "")
21
+ return null;
22
+ try {
23
+ return JSON.parse(t);
24
+ } catch {
25
+ return t;
26
+ }
27
+ }, O = (t, s, e) => {
28
+ try {
29
+ l(t, s, new URL(e, window.location.href).href);
30
+ } catch {
31
+ }
32
+ }, q = (t, s = w) => ({
33
+ async request(e) {
34
+ if (window.isSessionExpired)
35
+ throw new h();
36
+ const o = E(t, e.url, e.params), n = new AbortController(), i = setTimeout(() => n.abort(), e.timeoutMs ?? s);
37
+ let r, c;
38
+ try {
39
+ r = await fetch(o, b(e, n.signal)), c = await r.text();
40
+ } catch (a) {
41
+ throw new m(n.signal.aborted, a);
42
+ } finally {
43
+ clearTimeout(i);
44
+ }
45
+ const d = f(c);
46
+ if (!r.ok) {
47
+ const a = y.includes(r.status) && u(o);
48
+ throw a && O(r.status, c, o), new T(
49
+ r.status,
50
+ d,
51
+ r.headers.get("x-request-id") ?? "",
52
+ a
53
+ );
54
+ }
55
+ return { status: r.status, data: d };
56
+ }
57
+ });
58
+ export {
59
+ w as REQUEST_TIMEOUT_MS,
60
+ q as createFetchTransport
61
+ };
@@ -0,0 +1,10 @@
1
+ import { EMAIL_BE_BASE_URL as r } from "../../../enums/email-be.js";
2
+ import { createFetchTransport as t } from "./client.js";
3
+ import { HttpManager as e } from "./HttpManager.js";
4
+ const a = new e(t(r), {
5
+ retry: { maxRetries: 2, backoffMs: [250, 1e3] },
6
+ dedup: !0
7
+ });
8
+ export {
9
+ a as emailBeHttp
10
+ };
@@ -0,0 +1,20 @@
1
+ class i extends Error {
2
+ constructor(r, t, e, o) {
3
+ super(`HTTP Error: ${r}`), this.status = r, this.body = t, this.requestId = e, this.authReported = o, this.name = "HttpStatusError";
4
+ }
5
+ }
6
+ class n extends Error {
7
+ constructor(r, t) {
8
+ super(r ? "Request timeout" : "Network error"), this.isTimeout = r, this.cause = t, this.name = "TransportNetworkError";
9
+ }
10
+ }
11
+ class u extends Error {
12
+ constructor() {
13
+ super("Session expired"), this.name = "SessionExpiredError";
14
+ }
15
+ }
16
+ export {
17
+ i as HttpStatusError,
18
+ u as SessionExpiredError,
19
+ n as TransportNetworkError
20
+ };
@@ -0,0 +1,35 @@
1
+ import type { HtmlSyntaxValue } from '@@/Enums/email-be';
2
+ import * as v from 'valibot';
3
+ export declare const HtmlValidationErrorSchema: v.ObjectSchema<{
4
+ readonly code: v.StringSchema<undefined>;
5
+ readonly trans: v.ObjectSchema<{
6
+ readonly key: v.StringSchema<undefined>;
7
+ readonly replace: v.UnionSchema<[v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.SchemaWithPipe<readonly [v.TupleSchema<[], undefined>, v.TransformAction<[], {}>]>], undefined>;
8
+ }, undefined>;
9
+ readonly anchor: v.NullableSchema<v.ObjectSchema<{
10
+ readonly selector: v.StringSchema<undefined>;
11
+ readonly indexes: v.ArraySchema<v.NumberSchema<undefined>, undefined>;
12
+ }, undefined>, undefined>;
13
+ readonly details: v.ArraySchema<v.StringSchema<undefined>, undefined>;
14
+ }, undefined>;
15
+ export declare const HtmlValidationResultSchema: v.ObjectSchema<{
16
+ readonly valid: v.BooleanSchema<undefined>;
17
+ readonly errors: v.ArraySchema<v.ObjectSchema<{
18
+ readonly code: v.StringSchema<undefined>;
19
+ readonly trans: v.ObjectSchema<{
20
+ readonly key: v.StringSchema<undefined>;
21
+ readonly replace: v.UnionSchema<[v.RecordSchema<v.StringSchema<undefined>, v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>], undefined>, undefined>, v.SchemaWithPipe<readonly [v.TupleSchema<[], undefined>, v.TransformAction<[], {}>]>], undefined>;
22
+ }, undefined>;
23
+ readonly anchor: v.NullableSchema<v.ObjectSchema<{
24
+ readonly selector: v.StringSchema<undefined>;
25
+ readonly indexes: v.ArraySchema<v.NumberSchema<undefined>, undefined>;
26
+ }, undefined>, undefined>;
27
+ readonly details: v.ArraySchema<v.StringSchema<undefined>, undefined>;
28
+ }, undefined>, undefined>;
29
+ }, undefined>;
30
+ export type HtmlValidationError = v.InferOutput<typeof HtmlValidationErrorSchema>;
31
+ export type HtmlValidationResult = v.InferOutput<typeof HtmlValidationResultSchema>;
32
+ export type ValidateHtmlParams = {
33
+ html: string;
34
+ syntax: HtmlSyntaxValue;
35
+ };
@@ -1,6 +1,6 @@
1
1
  import type { DynamicContent } from '@@/Types/generic';
2
2
  import type { SaveValidationError } from '@@/Types/save-validation';
3
3
  export declare const useSaveValidation: () => {
4
- collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[], rawHtml: string) => Promise<SaveValidationError[]>;
5
- validateCurrentTemplate: () => Promise<SaveValidationError[]>;
4
+ collectSaveValidationErrors: (compiledHtml: string, dynamicContentList: DynamicContent[], rawHtml: string) => Promise<SaveValidationError[] | null>;
5
+ validateCurrentTemplate: () => Promise<SaveValidationError[] | null>;
6
6
  };
@@ -0,0 +1,26 @@
1
+ export declare const EMAIL_BE_BASE_URL = "/email-proxy";
2
+ export declare const EmailBeEndPoints: {
3
+ readonly HTML_VALIDATE: "/v1/html/validate";
4
+ };
5
+ export declare const EmailBeErrorCodes: {
6
+ readonly BAD_GATEWAY: "bad_gateway";
7
+ readonly BAD_REQUEST: "bad_request";
8
+ readonly CONFLICT: "conflict";
9
+ readonly FORBIDDEN: "forbidden";
10
+ readonly INTERNAL_ERROR: "internal_error";
11
+ readonly NOT_FOUND: "not_found";
12
+ readonly RATE_LIMITED: "rate_limited";
13
+ readonly UNAUTHENTICATED: "unauthenticated";
14
+ readonly VALIDATION_FAILED: "validation_failed";
15
+ readonly SESSION_EXPIRED: "session_expired";
16
+ readonly INVALID_RESPONSE: "invalid_response";
17
+ readonly NETWORK: "network_error";
18
+ readonly TIMEOUT: "timeout";
19
+ readonly UNKNOWN: "unknown";
20
+ };
21
+ export type ApiErrorCode = typeof EmailBeErrorCodes[keyof typeof EmailBeErrorCodes];
22
+ export declare const HtmlSyntax: {
23
+ readonly PONGO: "pongo";
24
+ readonly LIQUID: "liquid";
25
+ };
26
+ export type HtmlSyntaxValue = typeof HtmlSyntax[keyof typeof HtmlSyntax];
@@ -1,28 +1,17 @@
1
1
  /**
2
2
  * Stable discriminators for each save-validation rule site — one per rule that
3
- * can produce a drawer row, kept in sync with the collector + legacy validator chains.
3
+ * can produce a drawer row, kept in sync with the collector; email-be rows share EmailBeHtml.
4
4
  */
5
5
  export declare enum SaveValidationRule {
6
- CouponTagModified = "coupon-tag-modified",
7
- DuplicateUnsubBlock = "duplicate-unsub-block",
8
- UnsubBlockMissingTemplate = "unsub-block-missing-template",
9
- LiquidSyntax = "liquid-syntax",
10
- InvalidLinks = "invalid-links",
11
6
  LinkCheckInProgress = "link-check-in-progress",
12
7
  CustomFieldScript = "custom-field-script",
13
- EmptyHtml = "empty-html",
14
- MismatchedBraces = "mismatched-braces",
15
8
  InvalidDynamicTag = "invalid-dynamic-tag",
16
9
  InvalidCustomField = "invalid-custom-field",
17
- ConditionsSyntax = "conditions-syntax",
18
- WrongEqualityOperator = "wrong-equality-operator",
19
10
  MissingIfEndif = "missing-if-endif",
20
- ConditionTagSpacing = "condition-tag-spacing",
21
- BracesInsideIfTag = "braces-inside-if-tag",
22
11
  RecommendationRequiredFields = "recommendation-required-fields",
23
12
  RecommendationFilters = "recommendation-filters",
24
- InvalidImageType = "invalid-image-type",
25
13
  CheckboxUnsubGroup = "checkbox-unsub-group",
26
14
  RadioButtonUnsubGroup = "radio-button-unsub-group",
27
- ExternallyManagedUnsubscribe = "externally-managed-unsubscribe"
15
+ ExternallyManagedUnsubscribe = "externally-managed-unsubscribe",
16
+ EmailBeHtml = "email-be-html"
28
17
  }
@@ -22,7 +22,5 @@ export declare class StrategyControl extends CommonControl {
22
22
  onDestroy(): void;
23
23
  private _teardown;
24
24
  private _setupButtonListeners;
25
- private _closeLegacyOnboarding;
26
- private _syncLegacyOnboarding;
27
25
  private _renderState;
28
26
  }
@@ -0,0 +1,11 @@
1
+ import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
2
+ export declare const BLOCK_ID = "{{your-block}}";
3
+ export declare class CustomBlock extends Block {
4
+ constructor();
5
+ getId(): string;
6
+ getIcon(): string;
7
+ getBlockCompositionType(): BlockCompositionType;
8
+ getName(): string;
9
+ getDescription(): string;
10
+ getTemplate(): string;
11
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Control IDs used in the Extension
3
+ * These IDs are returned by the getId() method of each control
4
+ */
5
+ export declare enum BlockControlId {
6
+ BLOCK_BACKGROUND = "{{your-block}}-background-color-control"
7
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Extension Constants
3
+ *
4
+ * This module re-exports all constants for the extension.
5
+ * Import from this file for cleaner imports.
6
+ * @example
7
+ * import { BlockControlId, BLOCK_ROOT_SELECTOR } from './constants';
8
+ */
9
+ export { BlockControlId } from './controlIds';
10
+ export { BLOCK_ROOT_SELECTOR, CSS_CLASS_BLOCK, CSS_CLASS_BLOCK_V2, } from './selectors';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * CSS selectors and class names used across the extension
3
+ *
4
+ * Declare them ONCE here and import everywhere (template, migrator, save validator,
5
+ * controls). The same literal re-typed across those files is how a rename half-lands.
6
+ */
7
+ /** Stable contract class, if the backend selects this block by name. Renaming breaks it. */
8
+ export declare const CSS_CLASS_BLOCK = "{{your-block}}";
9
+ /** Current block class — what the template emits and the migrator upgrades legacy blocks to. */
10
+ export declare const CSS_CLASS_BLOCK_V2 = "{{your-block}}-v2";
11
+ /**
12
+ * Block root selector — the block `<td>` itself.
13
+ * Used across block-level controls so edits apply to the whole block, not the title cell.
14
+ * Derived from the class so a rename cannot half-land.
15
+ */
16
+ export declare const BLOCK_ROOT_SELECTOR = ".{{your-block}}-v2";
@@ -0,0 +1,17 @@
1
+ import { Control, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ export declare const CONTROL_BLOCK_ID = "ui-elements-{{your-control-block}}";
3
+ export declare class CustomControl extends Control {
4
+ private currentNode?;
5
+ private selectedUnsubGroup?;
6
+ private unsubList;
7
+ getId(): string;
8
+ _setFormValues(): void;
9
+ _getLabel(text: string, name?: string): string;
10
+ _getSelectItem(text: string, value: string): string;
11
+ _getSelect(): string;
12
+ getTemplate(): string;
13
+ _onSelectChange(value: string | number): void;
14
+ _listenToFormUpdates(): void;
15
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
16
+ onRender(): Promise<void>;
17
+ }
@@ -0,0 +1,15 @@
1
+ export declare const BlockBackgroundControl: {
2
+ new (): {
3
+ getId(): string;
4
+ getLabels(): {
5
+ title: string;
6
+ };
7
+ getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
8
+ getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
9
+ getParentControlId(): string;
10
+ api: import("@stripoinc/ui-editor-extensions").ControlApi;
11
+ getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
12
+ isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
13
+ getElementLockCategory(): import("@stripoinc/ui-editor-extensions").ElementLockCategory | undefined;
14
+ };
15
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@stripoinc/ui-editor-extensions").Extension;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { IconsRegistry } from '@stripoinc/ui-editor-extensions';
2
+ export declare class MyIconsRegistry extends IconsRegistry {
3
+ registerIconsSvg(iconsMap: Record<string, string>): void;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { SettingsPanelRegistry, SettingsPanelTab } from '@stripoinc/ui-editor-extensions';
2
+ export declare class SettingsPanel extends SettingsPanelRegistry {
3
+ registerBlockControls(blockControlsMap: Record<string, SettingsPanelTab[]>): void;
4
+ }
@@ -0,0 +1,6 @@
1
+ declare const migrationTemplate = "\n <td \n align=\"left\" \n esd-extension-block-id=\"checkbox-block\" \n class=\"checkbox-block-v2 esd-block-checkbox esd-checkbox-block esd-extension-block es-p20\"\n >\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"left\" width=\"39\" style=\"vertical-align: top\">\n <input type=\"checkbox\">\n </td>\n <td align=\"left\" width=\"816\" style=\"vertical-align: top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n <tr>{-{-TITLE-}-}</tr>\n <tr>{-{-DESCRIPTION-}-}</tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n";
2
+ /**
3
+ * @returns The template for the default checkbox block
4
+ */
5
+ export declare function getDefaultTemplate(): string;
6
+ export default migrationTemplate;
@@ -0,0 +1,40 @@
1
+ import type { ApiErrorCode } from '@@/Enums/email-be';
2
+ export type ValidationErrors = Record<string, string[]>;
3
+ export interface ApiErrorInit {
4
+ status: number;
5
+ code: string;
6
+ message: string;
7
+ meta?: Record<string, unknown>;
8
+ errors?: ValidationErrors;
9
+ requestId?: string;
10
+ authReported?: boolean;
11
+ cause?: unknown;
12
+ }
13
+ export declare class ApiError extends Error {
14
+ readonly status: number;
15
+ readonly code: string;
16
+ readonly meta: Record<string, unknown>;
17
+ readonly errors: ValidationErrors;
18
+ readonly requestId: string;
19
+ readonly authReported: boolean;
20
+ readonly cause: unknown;
21
+ constructor(init: ApiErrorInit);
22
+ is(code: ApiErrorCode): boolean;
23
+ }
24
+ export declare class ValidationError extends ApiError {
25
+ firstMessage(): string;
26
+ }
27
+ export declare class NotFoundError extends ApiError {
28
+ }
29
+ export declare class ForbiddenError extends ApiError {
30
+ }
31
+ export declare class UnauthorizedError extends ApiError {
32
+ }
33
+ export declare class RateLimitError extends ApiError {
34
+ }
35
+ export declare class ServerError extends ApiError {
36
+ }
37
+ export declare class NetworkError extends ApiError {
38
+ }
39
+ export declare const isApiError: (error: unknown) => error is ApiError;
40
+ export declare const isValidationError: (error: unknown) => error is ValidationError;