@topol.io/editor 1.0.0-alpha.9 → 1.0.0

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 (72) hide show
  1. package/README.md +160 -97
  2. package/dist/index.js +171 -0
  3. package/dist/types/src/email-editor/index.d.ts +16 -102
  4. package/dist/types/src/landing-page-editor/constants.d.ts +1 -1
  5. package/dist/types/src/landing-page-editor/index.d.ts +10 -5
  6. package/dist/types/src/landing-page-editor/schemas/api/apiSchema.d.ts +5 -11
  7. package/dist/types/src/landing-page-editor/schemas/contentBlock/contentBlockScheme.d.ts +34 -18
  8. package/dist/types/src/landing-page-editor/schemas/language/languageSchema.d.ts +1 -1
  9. package/dist/types/src/landing-page-editor/schemas/mjmlStore/mjmlStoreSchema.d.ts +8 -6
  10. package/dist/types/src/landing-page-editor/schemas/notification/notificationSchema.d.ts +0 -1
  11. package/dist/types/src/landing-page-editor/schemas/openAI/openAISchema.d.ts +1 -2
  12. package/dist/types/src/landing-page-editor/schemas/pluginOptions/pluginOptionsSchema.d.ts +65 -21
  13. package/dist/types/src/landing-page-editor/schemas/premadeSection/premadeSectionSchema.d.ts +30 -0
  14. package/dist/types/src/landing-page-editor/schemas/template/blocks/buttonBlockSchema.d.ts +687 -5
  15. package/dist/types/src/landing-page-editor/schemas/template/blocks/carouselBlockSchema.d.ts +9 -2
  16. package/dist/types/src/landing-page-editor/schemas/template/blocks/dividerBlockSchema.d.ts +11 -3
  17. package/dist/types/src/landing-page-editor/schemas/template/blocks/formBlockSchema.d.ts +1069 -0
  18. package/dist/types/src/landing-page-editor/schemas/template/blocks/imageAnGifBlockSchema.d.ts +35 -19
  19. package/dist/types/src/landing-page-editor/schemas/template/blocks/rawBlockSchema.d.ts +9 -1
  20. package/dist/types/src/landing-page-editor/schemas/template/blocks/socialBlockSchema.d.ts +11 -3
  21. package/dist/types/src/landing-page-editor/schemas/template/blocks/spacerBlockSchema.d.ts +18 -10
  22. package/dist/types/src/landing-page-editor/schemas/template/blocks/textBlockSchema.d.ts +9 -1
  23. package/dist/types/src/landing-page-editor/schemas/template/blocks/videoBlockSchema.d.ts +9 -1
  24. package/dist/types/src/landing-page-editor/schemas/template/commonSchema.d.ts +28 -8
  25. package/dist/types/src/landing-page-editor/schemas/template/navbarBlocks/navbarCTASchema.d.ts +335 -0
  26. package/dist/types/src/landing-page-editor/schemas/template/navbarBlocks/navbarHamburgerSchema.d.ts +1109 -0
  27. package/dist/types/src/landing-page-editor/schemas/template/navbarBlocks/navbarLogoSchema.d.ts +252 -0
  28. package/dist/types/src/landing-page-editor/schemas/template/navbarBlocks/navbarMenuSchema.d.ts +1209 -0
  29. package/dist/types/src/landing-page-editor/schemas/template/settingsSchema.d.ts +4058 -546
  30. package/dist/types/src/landing-page-editor/schemas/template/structure/blockSchema.d.ts +5007 -2328
  31. package/dist/types/src/landing-page-editor/schemas/template/structure/columnSchema.d.ts +5501 -2412
  32. package/dist/types/src/landing-page-editor/schemas/template/structure/navbarSchema.d.ts +4394 -0
  33. package/dist/types/src/landing-page-editor/schemas/template/structure/rowSchema.d.ts +11094 -0
  34. package/dist/types/src/landing-page-editor/schemas/template/structure/sectionSchema.d.ts +8602 -3337
  35. package/dist/types/src/landing-page-editor/schemas/template/styleSchema.d.ts +55 -44
  36. package/dist/types/src/landing-page-editor/schemas/templateSchema.d.ts +34865 -48464
  37. package/dist/types/src/landing-page-editor/schemas/templateSettings/templateSettingsSchema.d.ts +4304 -794
  38. package/dist/types/src/landing-page-editor/schemas/theme/themeSchema.d.ts +6 -1
  39. package/dist/types/src/landing-page-editor/schemas/utils/cssValue.d.ts +21 -0
  40. package/dist/types/src/landing-page-editor/schemas/utils/transformBorder.d.ts +10 -5
  41. package/dist/types/src/main.d.ts +28 -108
  42. package/dist/types/types/API/API.d.ts +8 -9
  43. package/dist/types/types/APIBlocks/APIBlocks.d.ts +9 -0
  44. package/dist/types/types/Auth/IAuthorize.d.ts +6 -0
  45. package/dist/types/types/Auth/INonceAuthCallbacks.d.ts +10 -0
  46. package/dist/types/types/Callbacks/ICallbackPayloads.d.ts +27 -23
  47. package/dist/types/types/Callbacks/IEmailCallbacks.d.ts +73 -155
  48. package/dist/types/types/Cloud/ICloudOptions.d.ts +32 -0
  49. package/dist/types/types/ContentBlock/IContentBlockOptions.d.ts +1 -1
  50. package/dist/types/types/Countdown/ICountdownOptions.d.ts +48 -0
  51. package/dist/types/types/{ITopolOptions.d.ts → IEmailConfig.d.ts} +80 -28
  52. package/dist/types/types/IEmailEditorInstance.d.ts +64 -0
  53. package/dist/types/types/IEmailOptions.d.ts +7 -0
  54. package/dist/types/types/Language/Language.d.ts +1 -1
  55. package/dist/types/types/MergeTag/IMergeTag.d.ts +18 -0
  56. package/dist/types/types/Notification/INotification.d.ts +2 -1
  57. package/dist/types/types/Sections/ISections.d.ts +41 -0
  58. package/dist/types/types/Shortcuts/EditorShortcut.d.ts +4 -0
  59. package/dist/types/types/Theme/ITheme.d.ts +12 -2
  60. package/dist/types/types/landing-page/ILandingPageEditorInstance.d.ts +65 -5
  61. package/dist/types/types/landing-page/ILandingPageOptions.d.ts +15 -12
  62. package/logo.svg +1 -0
  63. package/package.json +11 -13
  64. package/dist/topol-plugin.es.js +0 -277
  65. package/dist/topol-plugin.umd.js +0 -1
  66. package/dist/types/src/landing-page-editor/schemas/helpdesk/helpdeskSchema.d.ts +0 -8
  67. package/dist/types/src/landing-page-editor/schemas/premadeBlock/premadeBlockSchema.d.ts +0 -59750
  68. package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockApiSchema.d.ts +0 -44831
  69. package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockSchema.d.ts +0 -59725
  70. package/dist/types/src/landing-page-editor/schemas/template/blocks/index.d.ts +0 -12
  71. package/dist/types/types/ITopolPlugin.d.ts +0 -44
  72. package/dist/types/types/SavedBlock/ISavedBlock.d.ts +0 -6
package/package.json CHANGED
@@ -12,28 +12,24 @@
12
12
  "author": "Topol.io",
13
13
  "homepage": "https://topol.io",
14
14
  "license": "Apache-2.0",
15
- "version": "1.0.0-alpha.9",
15
+ "version": "1.0.0",
16
16
  "files": [
17
- "dist"
17
+ "dist",
18
+ "logo.svg"
18
19
  ],
19
20
  "type": "module",
20
- "module": "./dist/topol-plugin.es.js",
21
+ "main": "./dist/index.js",
22
+ "module": "./dist/index.js",
21
23
  "types": "./dist/types/src/main.d.ts",
22
24
  "exports": {
23
25
  ".": {
24
26
  "types": "./dist/types/src/main.d.ts",
25
- "import": "./dist/topol-plugin.es.js",
26
- "require": "./dist/topol-plugin.umd.js"
27
+ "default": "./dist/index.js"
27
28
  }
28
29
  },
29
30
  "devDependencies": {
30
31
  "@types/node": "^20.6.5",
31
- "@typescript-eslint/eslint-plugin": "^6.7.2",
32
- "@typescript-eslint/parser": "^6.7.2",
33
- "eslint": "^8.50.0",
34
- "eslint-config-prettier": "^9.0.0",
35
32
  "happy-dom": "^20.0.11",
36
- "prettier": "3.1.1",
37
33
  "typescript": "^5.2.2",
38
34
  "vite": "^5.0.11",
39
35
  "vitest": "^4.0.16"
@@ -49,10 +45,12 @@
49
45
  "dev": "vite",
50
46
  "build-watch": "vite build --watch",
51
47
  "build-with-types": "vite build && pnpm run build:types",
52
- "lint": "eslint --no-eslintrc --config '.eslintrc.cjs' 'src/**/*.ts' --fix",
53
- "format": "prettier --write .",
48
+ "lint": "oxlint --deny-warnings .",
49
+ "format": "oxfmt --write .",
54
50
  "build:types": "tsc -p tsconfig.prod.json",
55
51
  "test": "vitest run",
56
- "test:watch": "vitest"
52
+ "test:watch": "vitest",
53
+ "lint:fix": "oxlint --fix --deny-warnings .",
54
+ "format:check": "oxfmt --check ."
57
55
  }
58
56
  }
@@ -1,277 +0,0 @@
1
- function f(o) {
2
- return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
3
- }
4
- var P = function(n, e, i) {
5
- var l = document.head || document.getElementsByTagName("head")[0], t = document.createElement("script");
6
- typeof e == "function" && (i = e, e = {}), e = e || {}, i = i || function() {
7
- }, t.type = e.type || "text/javascript", t.charset = e.charset || "utf8", t.async = "async" in e ? !!e.async : !0, t.src = n, e.attrs && m(t, e.attrs), e.text && (t.text = "" + e.text);
8
- var r = "onload" in t ? w : E;
9
- r(t, i), t.onload || w(t, i), l.appendChild(t);
10
- };
11
- function m(o, n) {
12
- for (var e in n)
13
- o.setAttribute(e, n[e]);
14
- }
15
- function w(o, n) {
16
- o.onload = function() {
17
- this.onerror = this.onload = null, n(null, o);
18
- }, o.onerror = function() {
19
- this.onerror = this.onload = null, n(new Error("Failed to load " + this.src), o);
20
- };
21
- }
22
- function E(o, n) {
23
- o.onreadystatechange = function() {
24
- this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, n(null, o));
25
- };
26
- }
27
- const g = /* @__PURE__ */ f(P);
28
- var s = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
29
- const h = "https://v3.email-assets.topol.io/loader/build.js", v = "https://v3.develop.email-assets.topol.io/loader/build.js", L = "https://v3.develop.email-assets.topol.io/loader/build.js", a = {
30
- production: s.VITE_TOPOL_URL || h,
31
- dev: s.VITE_TOPOL_DEV_URL || v,
32
- staging: s.VITE_TOPOL_STAGING_URL || L
33
- }, y = "https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";
34
- function _(o) {
35
- switch (o) {
36
- case "dev":
37
- return a.dev;
38
- case "staging":
39
- return a.staging;
40
- case "production":
41
- return a.production;
42
- default:
43
- return y.replace("{stage}", String(o));
44
- }
45
- }
46
- function S(o = "production") {
47
- const n = _(o);
48
- if (!n) {
49
- if (a.production)
50
- return console.error(`[@topol.io/editor] No loader URL resolved for stage "${o}"; falling back to the production loader.`), a.production;
51
- throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${o}". The editor cannot be loaded.`);
52
- }
53
- return n;
54
- }
55
- async function A(o) {
56
- return new Promise((n, e) => {
57
- g(a.production, (i) => {
58
- if (i !== null) {
59
- e(i);
60
- return;
61
- }
62
- window.TopolPlugin.init(o), n(!0);
63
- });
64
- });
65
- }
66
- const R = {
67
- /**
68
- * Initialize the Email Editor.
69
- * @param topolOptions - Configuration options for the editor
70
- * @param options - Plugin options including stage selection
71
- * @returns Promise that resolves to true when the editor is ready
72
- */
73
- init: (o, n) => new Promise((e, i) => {
74
- const l = S(n == null ? void 0 : n.stage);
75
- g(l, async (t) => {
76
- if (t !== null) {
77
- if (l !== a.production)
78
- try {
79
- return await A(o), e(!0);
80
- } catch (r) {
81
- i(r);
82
- }
83
- i(t);
84
- return;
85
- }
86
- window.TopolPlugin.init(o), e(!0);
87
- });
88
- }),
89
- /** Trigger the save callback with current editor content */
90
- save: (o) => {
91
- window.TopolPlugin.save(o);
92
- },
93
- /** Load a template JSON into the editor */
94
- load: (o) => {
95
- window.TopolPlugin.load(o);
96
- },
97
- /** Toggle the preview mode */
98
- togglePreview: () => {
99
- window.TopolPlugin.togglePreview();
100
- },
101
- /** Toggle between desktop and mobile preview sizes */
102
- togglePreviewSize: () => {
103
- window.TopolPlugin.togglePreviewSize();
104
- },
105
- /** Select a file from the custom file manager */
106
- chooseFile: (o) => {
107
- window.TopolPlugin.chooseFile(o);
108
- },
109
- /** Undo the last action */
110
- undo: () => {
111
- window.TopolPlugin.undo();
112
- },
113
- /** Redo the last undone action */
114
- redo: () => {
115
- window.TopolPlugin.redo();
116
- },
117
- /** Destroy the editor instance and clean up resources */
118
- destroy: () => {
119
- window.TopolPlugin.destroy();
120
- },
121
- /** Update the list of saved/reusable blocks */
122
- setSavedBlocks: (o) => {
123
- window.TopolPlugin.setSavedBlocks(o);
124
- },
125
- /** Set custom HTML for the preview */
126
- setPreviewHTML: (o) => {
127
- window.TopolPlugin.setPreviewHTML(o);
128
- },
129
- /** Display a notification in the editor */
130
- createNotification: (o) => {
131
- window.TopolPlugin.createNotification(o);
132
- },
133
- /** Set the list of active collaboration members */
134
- setActiveMembers: (o) => {
135
- window.TopolPlugin.setActiveMembers(o);
136
- },
137
- /** Switch to mobile view */
138
- changeEmailToMobile: () => {
139
- window.TopolPlugin.changeEmailToMobile();
140
- },
141
- /** Switch to desktop view */
142
- changeEmailToDesktop: () => {
143
- window.TopolPlugin.changeEmailToDesktop();
144
- },
145
- /** Toggle visibility of hidden blocks and structures */
146
- toggleBlocksAndStructuresVisibility: () => {
147
- window.TopolPlugin.toggleBlocksAndStructuresVisibility();
148
- },
149
- /** Update the content of a custom block */
150
- updateCustomBlockContent: (o) => {
151
- window.TopolPlugin.updateCustomBlockContent(o);
152
- },
153
- /** Refresh comments/conversations */
154
- refreshComments: (o) => {
155
- window.TopolPlugin.refreshComments(o);
156
- },
157
- /** Refresh synced rows */
158
- refreshSyncedRows: () => {
159
- window.TopolPlugin.refreshSyncedRows();
160
- },
161
- /** Open the premade templates selection modal */
162
- openPremadeTemplatesSelection: () => {
163
- window.TopolPlugin.openPremadeTemplatesSelection();
164
- },
165
- /** Update the API authorization header */
166
- updateApiAuthorizationHeader: (o) => {
167
- window.TopolPlugin.updateApiAuthorizationHeader(o);
168
- },
169
- /** Set the template name/title */
170
- setTemplateName: (o) => {
171
- window.TopolPlugin.setTemplateName(o);
172
- },
173
- updateOptions: (o) => {
174
- window.TopolPlugin.updateOptions(o);
175
- },
176
- /** Toggle the AI chat feature */
177
- toggleChatAI: () => {
178
- window.TopolPlugin.toggleChatAI();
179
- },
180
- /** Toggle the autosaves feature */
181
- toggleAutosaves: () => {
182
- window.TopolPlugin.toggleAutosaves();
183
- },
184
- /** Toggle the comments panel */
185
- toggleComments: () => {
186
- window.TopolPlugin.toggleComments();
187
- },
188
- /** Create a new language variant */
189
- createLanguage: (o) => {
190
- window.TopolPlugin.createLanguage(o);
191
- },
192
- /** Set the primary language */
193
- setPrimaryLanguage: (o) => {
194
- window.TopolPlugin.setPrimaryLanguage(o);
195
- },
196
- /** Delete a language variant */
197
- deleteLanguage: (o) => {
198
- window.TopolPlugin.deleteLanguage(o);
199
- },
200
- /** Select/switch to a language */
201
- selectLanguage: (o) => {
202
- window.TopolPlugin.selectLanguage(o);
203
- },
204
- /** Get the list of mutations */
205
- getMutations: () => window.TopolPlugin.getMutations(),
206
- /** Toggle the control panel visibility */
207
- toggleControlPanel: () => {
208
- window.TopolPlugin.toggleControlPanel();
209
- },
210
- /** Update the editor template with new JSON data */
211
- updateTemplate: (o, n) => {
212
- window.TopolPlugin.updateTemplate(o, n);
213
- },
214
- /** Toggle dark mode for the editor */
215
- toggleDarkMode: () => {
216
- window.TopolPlugin.toggleDarkMode();
217
- }
218
- }, O = "https://v1.page-assets.topol.io/topol-lpe.js", u = /* @__PURE__ */ new Map();
219
- function D(o, n) {
220
- if (n())
221
- return Promise.resolve();
222
- const e = u.get(o);
223
- if (e)
224
- return e;
225
- const i = new Promise((l, t) => {
226
- const r = typeof document < "u" ? U(o) : null;
227
- if (r) {
228
- const d = () => {
229
- p(), l();
230
- }, c = () => {
231
- p(), t(new Error(`Failed to load script: ${o}`));
232
- }, p = () => {
233
- r.removeEventListener("load", d), r.removeEventListener("error", c);
234
- };
235
- r.addEventListener("load", d), r.addEventListener("error", c);
236
- return;
237
- }
238
- g(o, (d) => {
239
- d !== null ? t(d) : l();
240
- });
241
- }).finally(() => {
242
- u.delete(o);
243
- });
244
- return u.set(o, i), i;
245
- }
246
- function U(o) {
247
- const n = document.getElementsByTagName("script");
248
- for (let e = 0; e < n.length; e++)
249
- if (n[e].src === o)
250
- return n[e];
251
- return null;
252
- }
253
- function T() {
254
- return typeof window < "u" && typeof window.LandingPageEditor == "function";
255
- }
256
- const C = {
257
- /**
258
- * Inits Landing Page Editor.
259
- *
260
- * @param options - Configuration options for the editor
261
- * @param pluginOptions - Plugin options (reserved for future staging/dev URL support)
262
- * @returns Promise that resolves with the editor instance
263
- */
264
- init: async (o, n) => {
265
- var r;
266
- if (await D(O, T), !T())
267
- throw new Error("[@topol.io/editor] topol-lpe.js loaded but window.LandingPageEditor is not defined.");
268
- const { onClose: e, ...i } = o, l = window.LandingPageEditor(i), t = ((r = l.destroy) == null ? void 0 : r.bind(l)) ?? (() => l.close());
269
- return l.destroy = () => t(), l;
270
- }
271
- }, I = R;
272
- export {
273
- R as EmailEditor,
274
- C as LandingPageEditor,
275
- I as TopolPlugin,
276
- I as default
277
- };
@@ -1 +0,0 @@
1
- (function(a,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a["topol-plugin"]={}))})(this,function(a){"use strict";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var h=function(n,o,i){var l=document.head||document.getElementsByTagName("head")[0],t=document.createElement("script");typeof o=="function"&&(i=o,o={}),o=o||{},i=i||function(){},t.type=o.type||"text/javascript",t.charset=o.charset||"utf8",t.async="async"in o?!!o.async:!0,t.src=n,o.attrs&&L(t,o.attrs),o.text&&(t.text=""+o.text);var r="onload"in t?w:v;r(t,i),t.onload||w(t,i),l.appendChild(t)};function L(e,n){for(var o in n)e.setAttribute(o,n[o])}function w(e,n){e.onload=function(){this.onerror=this.onload=null,n(null,e)},e.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+this.src),e)}}function v(e,n){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,n(null,e))}}const g=u(h);var c={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const d={production:c.VITE_TOPOL_URL||"https://v3.email-assets.topol.io/loader/build.js",dev:c.VITE_TOPOL_DEV_URL||"https://v3.develop.email-assets.topol.io/loader/build.js",staging:c.VITE_TOPOL_STAGING_URL||"https://v3.develop.email-assets.topol.io/loader/build.js"},_="https://d10h8ga60f7b91.cloudfront.net/preview-app-{stage}/loader/build.js";function y(e){switch(e){case"dev":return d.dev;case"staging":return d.staging;case"production":return d.production;default:return _.replace("{stage}",String(e))}}function A(e="production"){const n=y(e);if(!n){if(d.production)return console.error(`[@topol.io/editor] No loader URL resolved for stage "${e}"; falling back to the production loader.`),d.production;throw new Error(`[@topol.io/editor] Could not resolve a loader URL for stage "${e}". The editor cannot be loaded.`)}return n}async function S(e){return new Promise((n,o)=>{g(d.production,i=>{if(i!==null){o(i);return}window.TopolPlugin.init(e),n(!0)})})}const f={init:(e,n)=>new Promise((o,i)=>{const l=A(n==null?void 0:n.stage);g(l,async t=>{if(t!==null){if(l!==d.production)try{return await S(e),o(!0)}catch(r){i(r)}i(t);return}window.TopolPlugin.init(e),o(!0)})}),save:e=>{window.TopolPlugin.save(e)},load:e=>{window.TopolPlugin.load(e)},togglePreview:()=>{window.TopolPlugin.togglePreview()},togglePreviewSize:()=>{window.TopolPlugin.togglePreviewSize()},chooseFile:e=>{window.TopolPlugin.chooseFile(e)},undo:()=>{window.TopolPlugin.undo()},redo:()=>{window.TopolPlugin.redo()},destroy:()=>{window.TopolPlugin.destroy()},setSavedBlocks:e=>{window.TopolPlugin.setSavedBlocks(e)},setPreviewHTML:e=>{window.TopolPlugin.setPreviewHTML(e)},createNotification:e=>{window.TopolPlugin.createNotification(e)},setActiveMembers:e=>{window.TopolPlugin.setActiveMembers(e)},changeEmailToMobile:()=>{window.TopolPlugin.changeEmailToMobile()},changeEmailToDesktop:()=>{window.TopolPlugin.changeEmailToDesktop()},toggleBlocksAndStructuresVisibility:()=>{window.TopolPlugin.toggleBlocksAndStructuresVisibility()},updateCustomBlockContent:e=>{window.TopolPlugin.updateCustomBlockContent(e)},refreshComments:e=>{window.TopolPlugin.refreshComments(e)},refreshSyncedRows:()=>{window.TopolPlugin.refreshSyncedRows()},openPremadeTemplatesSelection:()=>{window.TopolPlugin.openPremadeTemplatesSelection()},updateApiAuthorizationHeader:e=>{window.TopolPlugin.updateApiAuthorizationHeader(e)},setTemplateName:e=>{window.TopolPlugin.setTemplateName(e)},updateOptions:e=>{window.TopolPlugin.updateOptions(e)},toggleChatAI:()=>{window.TopolPlugin.toggleChatAI()},toggleAutosaves:()=>{window.TopolPlugin.toggleAutosaves()},toggleComments:()=>{window.TopolPlugin.toggleComments()},createLanguage:e=>{window.TopolPlugin.createLanguage(e)},setPrimaryLanguage:e=>{window.TopolPlugin.setPrimaryLanguage(e)},deleteLanguage:e=>{window.TopolPlugin.deleteLanguage(e)},selectLanguage:e=>{window.TopolPlugin.selectLanguage(e)},getMutations:()=>window.TopolPlugin.getMutations(),toggleControlPanel:()=>{window.TopolPlugin.toggleControlPanel()},updateTemplate:(e,n)=>{window.TopolPlugin.updateTemplate(e,n)},toggleDarkMode:()=>{window.TopolPlugin.toggleDarkMode()}},R="https://v1.page-assets.topol.io/topol-lpe.js",p=new Map;function U(e,n){if(n())return Promise.resolve();const o=p.get(e);if(o)return o;const i=new Promise((l,t)=>{const r=typeof document<"u"?O(e):null;if(r){const s=()=>{E(),l()},m=()=>{E(),t(new Error(`Failed to load script: ${e}`))},E=()=>{r.removeEventListener("load",s),r.removeEventListener("error",m)};r.addEventListener("load",s),r.addEventListener("error",m);return}g(e,s=>{s!==null?t(s):l()})}).finally(()=>{p.delete(e)});return p.set(e,i),i}function O(e){const n=document.getElementsByTagName("script");for(let o=0;o<n.length;o++)if(n[o].src===e)return n[o];return null}function T(){return typeof window<"u"&&typeof window.LandingPageEditor=="function"}const D={init:async(e,n)=>{var r;if(await U(R,T),!T())throw new Error("[@topol.io/editor] topol-lpe.js loaded but window.LandingPageEditor is not defined.");const{onClose:o,...i}=e,l=window.LandingPageEditor(i),t=((r=l.destroy)==null?void 0:r.bind(l))??(()=>l.close());return l.destroy=()=>t(),l}},P=f;a.EmailEditor=f,a.LandingPageEditor=D,a.TopolPlugin=P,a.default=P,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,8 +0,0 @@
1
- import { z } from "zod";
2
- export declare const HelpSchema: z.ZodObject<{
3
- text: z.ZodString;
4
- url: z.ZodString;
5
- }, z.core.$strip>;
6
- export declare const HelpdeskSchema: z.ZodObject<{}, z.core.$strip>;
7
- export type IHelp = z.infer<typeof HelpSchema>;
8
- export type IHelpdesk = z.infer<typeof HelpdeskSchema>;