@useinsider/guido 2.0.0-beta.d2098bd → 2.0.0-beta.d295fc1

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 (53) hide show
  1. package/README.md +2 -0
  2. package/dist/@types/config/schemas.js +55 -39
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +15 -17
  5. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
  6. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +11 -12
  7. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +8 -7
  8. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +12 -14
  9. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +14 -10
  10. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +22 -18
  11. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  12. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  13. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  14. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +10 -10
  15. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +14 -15
  16. package/dist/components/organisms/header/LeftSlot.vue.js +2 -2
  17. package/dist/components/organisms/header/MiddleSlot.vue.js +4 -5
  18. package/dist/components/organisms/header/MiddleSlot.vue2.js +13 -14
  19. package/dist/components/organisms/header/RightSlot.vue.js +7 -7
  20. package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
  21. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  22. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  23. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +19 -20
  24. package/dist/components/wrappers/WpModal.vue.js +3 -4
  25. package/dist/composables/useConfig.js +29 -27
  26. package/dist/composables/useSave.js +13 -11
  27. package/dist/composables/useStripo.js +40 -40
  28. package/dist/enums/onboarding.js +2 -1
  29. package/dist/enums/unsubscribe.js +21 -20
  30. package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
  31. package/dist/extensions/Blocks/common-control.js +6 -7
  32. package/dist/guido.css +1 -1
  33. package/dist/services/stripoApi.js +6 -10
  34. package/dist/src/@types/config/index.d.ts +2 -2
  35. package/dist/src/@types/config/schemas.d.ts +30 -0
  36. package/dist/src/@types/config/types.d.ts +7 -1
  37. package/dist/src/composables/useConfig.d.ts +8 -0
  38. package/dist/src/enums/onboarding.d.ts +1 -0
  39. package/dist/src/enums/unsubscribe.d.ts +1 -0
  40. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  41. package/dist/src/stores/config.d.ts +164 -1
  42. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  43. package/dist/static/assets/phone-mockup.svg.js +4 -0
  44. package/dist/static/styles/components/button.css.js +1 -1
  45. package/dist/stores/config.js +7 -0
  46. package/package.json +1 -1
  47. package/dist/enums/academy.js +0 -8
  48. package/dist/src/enums/academy.d.ts +0 -12
  49. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +0 -4
  50. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +0 -4
  51. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +0 -4
  52. package/dist/static/assets/mobile/email-mockup.svg.js +0 -4
  53. package/dist/static/assets/mobile/inbox-mockup.svg.js +0 -4
@@ -2,8 +2,9 @@ const e = [
2
2
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
3
3
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
4
4
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
5
- ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
5
+ ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper", a = "https://academy.useinsider.com/docs/email-drag-drop-editor";
6
6
  export {
7
+ a as ACADEMY_LINK,
7
8
  n as CARD_COMPOSITION_TAB_SELECTOR,
8
9
  o as RIBBON_SELECTOR,
9
10
  e as SERVICE_HOVER_SELECTORS,
@@ -1,26 +1,26 @@
1
- import { useTranslations as e } from "../composables/useTranslations.js";
1
+ import { useTranslations as n } from "../composables/useTranslations.js";
2
2
  import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const I = {
3
+ const N = {
4
4
  UNSUBSCRIBE_LINK_TYPE: 1,
5
5
  PREFERENCES_LINK_TYPE: 3
6
- }, r = {
6
+ }, I = {
7
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), _ = {
11
+ }, s = R(), i = {
12
12
  UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
13
  PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, i = "iid", B = {
14
+ }, _ = "iid", B = {
15
15
  name: "Global Unsubscribe",
16
16
  sendGridId: "G"
17
- }, C = "/email/unsubscribe-pages", E = {
17
+ }, t = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", C = "/email/unsubscribe-pages", E = {
18
18
  GLOBAL_UNSUBSCRIBE: 1,
19
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
22
  RESUBSCRIBE: 5
23
- }, t = {
23
+ }, c = {
24
24
  [E.GLOBAL_UNSUBSCRIBE]: [
25
25
  E.GLOBAL_UNSUBSCRIBE,
26
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -31,28 +31,29 @@ const I = {
31
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
32
  ]
33
33
  }, U = () => {
34
- const n = e();
34
+ const e = n();
35
35
  return {
36
- [E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
37
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
38
- [E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
39
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
40
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
36
+ [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
37
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
38
+ [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
39
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
40
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
41
41
  };
42
- }, c = {
42
+ }, o = {
43
43
  default: "{{ins-unsubscribe-link}}",
44
44
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
45
45
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
46
46
  };
47
47
  export {
48
+ t as ACADEMY_LINK,
48
49
  B as DEFAULT_UNSUBSCRIBE_GROUP,
49
- i as INSIDER_ID,
50
- r as LINK_REGEXES,
51
- I as LINK_TYPES,
52
- c as MERGE_TAGS,
50
+ _ as INSIDER_ID,
51
+ I as LINK_REGEXES,
52
+ N as LINK_TYPES,
53
+ o as MERGE_TAGS,
53
54
  E as PAGE_TYPES,
54
- t as TYPE_COLLECTIONS,
55
+ c as TYPE_COLLECTIONS,
55
56
  C as UNSUBSCRIBE_PAGES_LINK,
56
- _ as URLS,
57
+ i as URLS,
57
58
  U as getTypeTranslations
58
59
  };
@@ -1,21 +1,21 @@
1
1
  import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { UnsubscribeBlock as i } from "./block.js";
3
3
  import { UnsubscribeControl as t } from "./control.js";
4
- import { PreviewUIElement as o } from "./elements/preview.js";
5
- import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
6
- import { SettingsPanel as s } from "./settingsPanel.js";
4
+ import { PreviewUIElement as s } from "./elements/preview.js";
5
+ import { UnsubscribeIconsRegistry as o } from "./iconsRegistry.js";
6
+ import { SettingsPanel as r } from "./settingsPanel.js";
7
7
  import n from "./styles.css.js";
8
- import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
9
- const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
8
+ import { UnsubscribeTagRegistry as c } from "./tagRegistry.js";
9
+ const g = new e().addBlock(i).withSettingsPanelRegistry(r).addControl(t).addUiElement(s).addStyles(n).withLocalization({
10
10
  en: {
11
- "Unsubscribe Block": "Unsubscribe Block",
12
- "Unsubscribe Block Description": "Add an unsubscribe link to your email",
11
+ "Unsubscribe Block": "Unsubscribe",
12
+ "Unsubscribe Block Description": "Unsubscribe lets you add an Unsubscribe Link to direct users to opt out of receiving your messages.",
13
13
  "Select Template": "Select Template",
14
14
  "Unsubscribe Template": "Unsubscribe Template",
15
15
  Showing: "Showing",
16
16
  of: "of"
17
17
  }
18
- }).withUiElementTagRegistry(l).withIconsRegistry(r).build();
18
+ }).withUiElementTagRegistry(c).withIconsRegistry(o).build();
19
19
  export {
20
- f as default
20
+ g as default
21
21
  };
@@ -1,12 +1,12 @@
1
1
  var c = Object.defineProperty;
2
2
  var I = (a, r, e) => r in a ? c(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
3
- var l = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
3
+ var u = (a, r, e) => I(a, typeof r != "symbol" ? r + "" : r, e);
4
4
  import { Control as O, UIElementType as t, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
5
  class _ extends O {
6
6
  constructor() {
7
7
  super(...arguments);
8
- l(this, "currentNode");
9
- l(this, "lastBlockInstanceId", null);
8
+ u(this, "currentNode");
9
+ u(this, "lastBlockInstanceId", null);
10
10
  }
11
11
  getContainer() {
12
12
  var e;
@@ -52,10 +52,9 @@ class _ extends O {
52
52
  const T = o !== this.lastBlockInstanceId;
53
53
  return T ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = o) : n(), T;
54
54
  }
55
- _GuLabel({ text: e, name: n = "", position: E = "top" }) {
55
+ _GuLabel({ text: e, name: n = "" }) {
56
56
  return `
57
57
  <${t.LABEL}
58
- style="${E === "top" ? "margin-bottom: 8px;" : ""}"
59
58
  ${$.LABEL.text}="${e}"
60
59
  ${$.LABEL.name}="${n || `${e} Label`}">
61
60
  </${t.LABEL}>
@@ -170,9 +169,9 @@ class _ extends O {
170
169
  _GuOrderable(e, n) {
171
170
  let E = "";
172
171
  n.forEach((T) => {
173
- const u = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
172
+ const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
174
173
  E += `
175
- <${t.ORDERABLE_ITEM} ${u}="${T.key}">
174
+ <${t.ORDERABLE_ITEM} ${l}="${T.key}">
176
175
  ${T.content}
177
176
  </${t.ORDERABLE_ITEM}>
178
177
  `;
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-f0b166f5] .in-button-v2__wrapper{line-height:0}[data-v-913a3417] .in-progress-wrapper__progress p span:last-child{display:none!important}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.middle-slot__buttons[data-v-421621fe]{gap:4px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-282ca4d1]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-282ca4d1]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-282ca4d1]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-5269640b] .in-modal-v2-wrapper__content{overflow-y:hidden}.error-list[data-v-5a366d74]{gap:16px}.desktop-preview[data-v-8ab430ce]{min-width:602px;height:70vh;border-radius:10px}.desktop-preview__browser-header[data-v-8ab430ce]{height:79px;min-height:79px}.desktop-preview__browser-header-left[data-v-8ab430ce]{height:79px;width:378px}.desktop-preview__browser-header-center[data-v-8ab430ce]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-preview__browser-header-right[data-v-8ab430ce]{height:79px;width:112px}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-06e6f7a7] .in-button-v2__wrapper{line-height:0}[data-v-5196584c] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-890b5336]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-890b5336]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-890b5336]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
@@ -1,8 +1,8 @@
1
1
  import { useHttp as m } from "../composables/useHttp.js";
2
- import { useToaster as u } from "../composables/useToaster.js";
3
- import { MAX_DEFAULT_TEMPLATE_ID as i } from "../enums/defaults.js";
2
+ import { useToaster as i } from "../composables/useToaster.js";
3
+ import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
4
4
  const y = () => {
5
- const { get: r } = m(), { handleError: o } = u();
5
+ const { get: r } = m(), { handleError: o } = i();
6
6
  return {
7
7
  getToken: async () => {
8
8
  try {
@@ -26,17 +26,13 @@ const y = () => {
26
26
  getDefaultTemplate: async () => {
27
27
  const t = {
28
28
  html: "",
29
- css: "",
30
- forceRecreate: !0
29
+ css: ""
31
30
  };
32
31
  try {
33
- const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= i ? s : 0, { data: n } = await r(
32
+ const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= p ? s : 0, { data: n } = await r(
34
33
  `/stripo/default-template/${l}`
35
34
  ), a = typeof n == "string" ? JSON.parse(n) : n;
36
- return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : {
37
- ...a,
38
- forceRecreate: !0
39
- };
35
+ return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : a;
40
36
  } catch (e) {
41
37
  return o(e, "Failed to fetch default template"), t;
42
38
  }
@@ -7,8 +7,8 @@
7
7
  * - Default values for optional configuration
8
8
  * - Validation utilities
9
9
  */
10
- export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
11
- export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
10
+ export { MessageType, ProductType, GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, CompilerRuleSchema, CompilerRuleTypeSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, } from './schemas';
11
+ export type { GuidoConfig, GuidoConfigInput, IdentityConfig, IdentityConfigInput, PartnerConfig, PartnerConfigInput, TemplateConfig, TemplateConfigInput, EditorConfig, EditorConfigInput, UIConfig, UIConfigInput, FeaturesConfig, FeaturesConfigInput, BlocksConfig, BlocksConfigInput, CompilerConfig, CompilerConfigInput, CallbacksConfig, CallbacksConfigInput, ExternalValidationHandler, EmailHeader, DynamicContent, DefaultBlockType, CustomBlockType, BlockType, FeatureName, CompilerRule, ReplaceRule, RegexRule, RemoveRule, CustomRule, DeepPartial, ConfigOverrides, } from './types';
12
12
  export { DEFAULT_EMAIL_HEADER, DEFAULT_TEMPLATE, DEFAULT_EDITOR, DEFAULT_UI, DEFAULT_FEATURES, DEFAULT_BLOCKS, DEFAULT_COMPILER, DEFAULT_PRODUCT_TYPE, DEFAULT_MESSAGE_TYPE, DEFAULT_USERNAME, EDITOR_TYPE, TEST_PARTNERS, isTestPartner, } from './defaults';
13
13
  export { validateConfig, parseConfig, parseConfigSafe, getValidationErrors, isValidConfig, validateIdentity, validatePartner, } from './validator';
14
14
  export type { ValidationResult, ValidationError, } from './validator';
@@ -5,7 +5,14 @@
5
5
  * All types are inferred from these schemas to ensure single source of truth.
6
6
  * @module @types/config/schemas
7
7
  */
8
+ import type { SavedTemplateDetails } from '../stripo';
8
9
  import * as v from 'valibot';
10
+ /**
11
+ * Handler function for external validation before save
12
+ * @param data - The template details to validate
13
+ * @returns Promise<boolean> - true if valid, false to cancel save
14
+ */
15
+ export type ExternalValidationHandler = (data: SavedTemplateDetails) => Promise<boolean>;
9
16
  /**
10
17
  * Message type constants for email templates
11
18
  */
@@ -90,6 +97,8 @@ export declare const TemplateSchema: v.ObjectSchema<{
90
97
  }, undefined>, undefined>, readonly []>;
91
98
  /** Selected unsubscribe page IDs */
92
99
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
100
+ /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
101
+ readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
93
102
  }, undefined>;
94
103
  /**
95
104
  * Email header configuration (sender name and subject)
@@ -344,6 +353,16 @@ export declare const CompilerSchema: v.ObjectSchema<{
344
353
  /** Skip default compiler rules */
345
354
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
346
355
  }, undefined>;
356
+ /**
357
+ * Callbacks configuration - event handlers and hooks
358
+ */
359
+ export declare const CallbacksSchema: v.ObjectSchema<{
360
+ /**
361
+ * External validation handler called before save completes.
362
+ * Return false to cancel the save operation.
363
+ */
364
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
365
+ }, undefined>;
347
366
  /**
348
367
  * Complete Guido configuration schema
349
368
  *
@@ -356,6 +375,7 @@ export declare const CompilerSchema: v.ObjectSchema<{
356
375
  * - features: Feature toggles
357
376
  * - blocks: Block configuration
358
377
  * - compiler: HTML compilation
378
+ * - callbacks: Event handlers and hooks
359
379
  */
360
380
  export declare const GuidoConfigSchema: v.ObjectSchema<{
361
381
  /** Identity configuration (required) */
@@ -400,6 +420,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
400
420
  }, undefined>, undefined>, readonly []>;
401
421
  /** Selected unsubscribe page IDs */
402
422
  readonly selectedUnsubscribePages: v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>;
423
+ /** Force recreate template in Stripo storage (use true when updating externally modified templates) */
424
+ readonly forceRecreate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
403
425
  }, undefined>, {}>;
404
426
  /** Editor settings */
405
427
  readonly editor: v.OptionalSchema<v.ObjectSchema<{
@@ -506,4 +528,12 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
506
528
  /** Skip default compiler rules */
507
529
  readonly ignoreDefaultRules: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
508
530
  }, undefined>, {}>;
531
+ /** Callbacks and event handlers */
532
+ readonly callbacks: v.OptionalSchema<v.ObjectSchema<{
533
+ /**
534
+ * External validation handler called before save completes.
535
+ * Return false to cancel the save operation.
536
+ */
537
+ readonly externalValidation: v.OptionalSchema<v.CustomSchema<ExternalValidationHandler, v.ErrorMessage<v.CustomIssue> | undefined>, undefined>;
538
+ }, undefined>, {}>;
509
539
  }, undefined>;
@@ -5,7 +5,7 @@
5
5
  * This ensures type definitions are always in sync with validation.
6
6
  * @module @types/config/types
7
7
  */
8
- import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema } from './schemas';
8
+ import type { GuidoConfigSchema, IdentitySchema, PartnerSchema, TemplateSchema, EditorSchema, UISchema, FeaturesSchema, BlocksSchema, CompilerSchema, CallbacksSchema, DynamicContentSchema, EmailHeaderSchema, CompilerRuleSchema, ReplaceRuleSchema, RegexRuleSchema, RemoveRuleSchema, CustomRuleSchema, DefaultBlockTypeSchema, CustomBlockTypeSchema, ExternalValidationHandler } from './schemas';
9
9
  import type * as v from 'valibot';
10
10
  /**
11
11
  * Complete validated Guido configuration.
@@ -41,6 +41,10 @@ export type FeaturesConfig = v.InferOutput<typeof FeaturesSchema>;
41
41
  export type BlocksConfig = v.InferOutput<typeof BlocksSchema>;
42
42
  /** Compiler configuration (custom rules, ignore defaults) */
43
43
  export type CompilerConfig = v.InferOutput<typeof CompilerSchema>;
44
+ /** Callbacks configuration (event handlers and hooks) */
45
+ export type CallbacksConfig = v.InferOutput<typeof CallbacksSchema>;
46
+ /** Re-export ExternalValidationHandler for convenience */
47
+ export type { ExternalValidationHandler };
44
48
  /** Email header configuration (senderName, subject) */
45
49
  export type EmailHeader = v.InferOutput<typeof EmailHeaderSchema>;
46
50
  /** Dynamic content item */
@@ -85,6 +89,8 @@ export type FeaturesConfigInput = v.InferInput<typeof FeaturesSchema>;
85
89
  export type BlocksConfigInput = v.InferInput<typeof BlocksSchema>;
86
90
  /** Input type for compiler configuration */
87
91
  export type CompilerConfigInput = v.InferInput<typeof CompilerSchema>;
92
+ /** Input type for callbacks configuration */
93
+ export type CallbacksConfigInput = v.InferInput<typeof CallbacksSchema>;
88
94
  /** Default Stripo block types */
89
95
  export type DefaultBlockType = v.InferOutput<typeof DefaultBlockTypeSchema>;
90
96
  /** Custom Guido block types */
@@ -31,6 +31,7 @@ export declare const useConfig: () => {
31
31
  } | undefined;
32
32
  }[];
33
33
  selectedUnsubscribePages: number[];
34
+ forceRecreate: boolean;
34
35
  };
35
36
  editor: {
36
37
  locale: string;
@@ -90,6 +91,9 @@ export declare const useConfig: () => {
90
91
  })[];
91
92
  ignoreDefaultRules: boolean;
92
93
  };
94
+ callbacks: {
95
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
96
+ };
93
97
  } | null>;
94
98
  initialized: import("vue").Ref<boolean>;
95
99
  identity: import("vue").ComputedRef<{
@@ -116,6 +120,7 @@ export declare const useConfig: () => {
116
120
  } | undefined;
117
121
  }[];
118
122
  selectedUnsubscribePages: number[];
123
+ forceRecreate: boolean;
119
124
  } | null>;
120
125
  editor: import("vue").ComputedRef<{
121
126
  locale: string;
@@ -175,6 +180,9 @@ export declare const useConfig: () => {
175
180
  })[];
176
181
  ignoreDefaultRules: boolean;
177
182
  } | null>;
183
+ callbacks: import("vue").ComputedRef<{
184
+ externalValidation?: import("@@/Types/config").ExternalValidationHandler | undefined;
185
+ } | null>;
178
186
  templateId: import("vue").ComputedRef<string>;
179
187
  userId: import("vue").ComputedRef<string>;
180
188
  variationId: import("vue").ComputedRef<string>;
@@ -3,3 +3,4 @@ export declare const UI_EDITOR_SELECTOR = "ui-editor";
3
3
  export declare const CARD_COMPOSITION_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Card Composition\"]";
4
4
  export declare const SETTINGS_TAB_SELECTOR = "button[role=\"tab\"][aria-label=\"Settings\"]";
5
5
  export declare const RIBBON_SELECTOR = ".in-ribbons-wrapper";
6
+ export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/email-drag-drop-editor";
@@ -17,6 +17,7 @@ export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
17
17
  readonly name: "Global Unsubscribe";
18
18
  readonly sendGridId: "G";
19
19
  };
20
+ export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
20
21
  export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
21
22
  export declare const PAGE_TYPES: {
22
23
  GLOBAL_UNSUBSCRIBE: number;
@@ -75,7 +75,7 @@ export declare abstract class CommonControl extends Control {
75
75
  * @returns true if block instance changed, false otherwise
76
76
  */
77
77
  protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void, blockInstanceIdAttribute?: string): boolean;
78
- _GuLabel({ text, name, position }: LabelProps): string;
78
+ _GuLabel({ text, name }: LabelProps): string;
79
79
  _GuToggle(name: string): string;
80
80
  _GuSelectItem({ text, value }: {
81
81
  text: string;