@topol.io/editor 1.0.0-alpha.8 → 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 +11 -6
  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 +150 -17
  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 +105 -69
  62. package/logo.svg +1 -0
  63. package/package.json +11 -13
  64. package/dist/topol-plugin.es.js +0 -284
  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
@@ -1,33 +1,27 @@
1
1
  import z from "zod";
2
2
  export declare const ApiSchema: z.ZodObject<{
3
- AUTOSAVE: z.ZodOptional<z.ZodString>;
4
3
  AUTOSAVES: z.ZodOptional<z.ZodString>;
5
- GET_AUTOSAVE: z.ZodOptional<z.ZodString>;
6
4
  CONVERSATIONS: z.ZodOptional<z.ZodString>;
7
5
  COMMENTS: z.ZodOptional<z.ZodString>;
6
+ GENERATE_META: z.ZodOptional<z.ZodString>;
8
7
  IMAGE_UPLOAD: z.ZodOptional<z.ZodString>;
9
8
  IMAGE_EDITOR_UPLOAD: z.ZodOptional<z.ZodString>;
10
9
  FOLDERS: z.ZodOptional<z.ZodString>;
11
- LOAD: z.ZodOptional<z.ZodString>;
12
- PREVIEW: z.ZodOptional<z.ZodString>;
13
- PRODUCTS: z.ZodOptional<z.ZodString>;
14
- SAVE: z.ZodOptional<z.ZodString>;
15
- SYNCED_SECTIONS: z.ZodOptional<z.ZodString>;
16
- SAVED_BLOCKS: z.ZodOptional<z.ZodString>;
17
- TEST_EMAIL: z.ZodOptional<z.ZodString>;
10
+ SAVED_SECTIONS: z.ZodOptional<z.ZodString>;
18
11
  PREMADE_TEMPLATES: z.ZodOptional<z.ZodString>;
19
12
  PREMADE_TEMPLATE_CATEGORIES: z.ZodOptional<z.ZodString>;
20
- PREMADE_TEMPLATES_KEYWORDS: z.ZodOptional<z.ZodString>;
13
+ PREMADE_TEMPLATE_KEYWORDS: z.ZodOptional<z.ZodString>;
21
14
  }, z.core.$strip>;
22
15
  export declare const LockedApiSchema: z.ZodObject<{
23
16
  AUTHORIZE: z.ZodString;
24
17
  GCS_SIGNED_URL: z.ZodString;
25
18
  GENERATE_CHAT: z.ZodString;
26
19
  GENERATE_IMAGE: z.ZodString;
20
+ GENERATE_META: z.ZodString;
27
21
  GENERATE_TEXT: z.ZodString;
28
22
  GIPHY_API_KEY: z.ZodString;
29
23
  GIPHY_SEARCH: z.ZodString;
30
- SAVE_SERVER: z.ZodString;
24
+ PREVIEW_SAVE: z.ZodString;
31
25
  }, z.core.$strip>;
32
26
  export type IAPI = z.infer<typeof ApiSchema>;
33
27
  export type ILockedAPI = z.infer<typeof LockedApiSchema>;
@@ -6,10 +6,10 @@ export declare const TopolBlockOptionsSchema: z.ZodObject<{
6
6
  disabledBadge: z.ZodOptional<z.ZodString>;
7
7
  }, z.core.$strip>;
8
8
  export declare const TopolBlockTypeSchema: z.ZodEnum<{
9
- text: "text";
10
9
  image: "image";
11
- gif: "gif";
12
10
  button: "button";
11
+ text: "text";
12
+ gif: "gif";
13
13
  divider: "divider";
14
14
  spacer: "spacer";
15
15
  social: "social";
@@ -17,19 +17,33 @@ export declare const TopolBlockTypeSchema: z.ZodEnum<{
17
17
  html: "html";
18
18
  raw: "raw";
19
19
  "custom-raw": "custom-raw";
20
+ form: "form";
20
21
  }>;
21
- export declare const TopolContentBlockOptionsSchema: z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
22
- text: "text";
22
+ /** Block types `contentBlocks` can configure. The HTML block's palette entry is keyed `html`; custom blocks use `customBlocks[].disabled`. */
23
+ export declare const TopolContentBlockOptionKeySchema: z.ZodEnum<{
23
24
  image: "image";
25
+ button: "button";
26
+ text: "text";
24
27
  gif: "gif";
28
+ divider: "divider";
29
+ spacer: "spacer";
30
+ social: "social";
31
+ video: "video";
32
+ html: "html";
33
+ form: "form";
34
+ }>;
35
+ export type TopolContentBlockOptionKey = z.infer<typeof TopolContentBlockOptionKeySchema>;
36
+ export declare const TopolContentBlockOptionsSchema: z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
37
+ image: "image";
25
38
  button: "button";
39
+ text: "text";
40
+ gif: "gif";
26
41
  divider: "divider";
27
42
  spacer: "spacer";
28
43
  social: "social";
29
44
  video: "video";
30
45
  html: "html";
31
- raw: "raw";
32
- "custom-raw": "custom-raw";
46
+ form: "form";
33
47
  }>, z.ZodNever]> & z.core.$partial, z.ZodObject<{
34
48
  disabled: z.ZodOptional<z.ZodBoolean>;
35
49
  disabledText: z.ZodOptional<z.ZodString>;
@@ -172,6 +186,7 @@ export declare const ButtonAttributesSchema: z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
172
186
  align: "align";
173
187
  "inner-padding": "inner-padding";
174
188
  border: "border";
189
+ gradient: "gradient";
175
190
  }>, z.ZodNever]> & z.core.$partial, z.ZodUnion<[z.ZodObject<{
176
191
  value: z.ZodAny;
177
192
  disabled: z.ZodOptional<z.ZodBoolean>;
@@ -228,9 +243,9 @@ export declare const ButtonStyleAttributesSchema: z.ZodRecord<z.ZodUnion<[z.ZodE
228
243
  validatorErrorMessage: z.ZodOptional<z.ZodString>;
229
244
  }, z.core.$strip>, z.ZodAny]>>;
230
245
  export declare const ImageAttributesSchema: z.ZodRecord<z.ZodUnion<[z.ZodEnum<{
246
+ title: "title";
231
247
  src: "src";
232
248
  transform: "transform";
233
- title: "title";
234
249
  filter: "filter";
235
250
  display: "display";
236
251
  width: "width";
@@ -301,9 +316,9 @@ export declare const ImageStyleAttributesSchema: z.ZodRecord<z.ZodUnion<[z.ZodEn
301
316
  }, z.core.$strip>, z.ZodAny]>>;
302
317
  export declare const TopolCustomBlockMixContentSchema: z.ZodObject<{
303
318
  type: z.ZodEnum<{
304
- text: "text";
305
319
  image: "image";
306
320
  button: "button";
321
+ text: "text";
307
322
  video: "video";
308
323
  }>;
309
324
  attributes: z.ZodAny;
@@ -323,9 +338,9 @@ export declare const TopolCustomBlockDataSchema: z.ZodObject<{
323
338
  disabled: z.ZodOptional<z.ZodBoolean>;
324
339
  disabledBadge: z.ZodOptional<z.ZodString>;
325
340
  type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
326
- text: "text";
327
341
  image: "image";
328
342
  button: "button";
343
+ text: "text";
329
344
  video: "video";
330
345
  }>, z.ZodLiteral<"mix">]>>;
331
346
  attributes: z.ZodOptional<z.ZodAny>;
@@ -334,9 +349,9 @@ export declare const TopolCustomBlockDataSchema: z.ZodObject<{
334
349
  xsAttributes: z.ZodOptional<z.ZodAny>;
335
350
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
336
351
  type: z.ZodEnum<{
337
- text: "text";
338
352
  image: "image";
339
353
  button: "button";
354
+ text: "text";
340
355
  video: "video";
341
356
  }>;
342
357
  attributes: z.ZodAny;
@@ -357,9 +372,9 @@ export declare const TopolCustomBlocksDataSchema: z.ZodArray<z.ZodObject<{
357
372
  disabled: z.ZodOptional<z.ZodBoolean>;
358
373
  disabledBadge: z.ZodOptional<z.ZodString>;
359
374
  type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
360
- text: "text";
361
375
  image: "image";
362
376
  button: "button";
377
+ text: "text";
363
378
  video: "video";
364
379
  }>, z.ZodLiteral<"mix">]>>;
365
380
  attributes: z.ZodOptional<z.ZodAny>;
@@ -368,9 +383,9 @@ export declare const TopolCustomBlocksDataSchema: z.ZodArray<z.ZodObject<{
368
383
  xsAttributes: z.ZodOptional<z.ZodAny>;
369
384
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
370
385
  type: z.ZodEnum<{
371
- text: "text";
372
386
  image: "image";
373
387
  button: "button";
388
+ text: "text";
374
389
  video: "video";
375
390
  }>;
376
391
  attributes: z.ZodAny;
@@ -390,9 +405,9 @@ export declare const TopolCustomBlockMixContentWithKeySchema: z.ZodObject<{
390
405
  disabled: z.ZodOptional<z.ZodBoolean>;
391
406
  disabledBadge: z.ZodOptional<z.ZodString>;
392
407
  type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
393
- text: "text";
394
408
  image: "image";
395
409
  button: "button";
410
+ text: "text";
396
411
  video: "video";
397
412
  }>, z.ZodLiteral<"mix">]>>;
398
413
  attributes: z.ZodOptional<z.ZodAny>;
@@ -401,9 +416,9 @@ export declare const TopolCustomBlockMixContentWithKeySchema: z.ZodObject<{
401
416
  xsAttributes: z.ZodOptional<z.ZodAny>;
402
417
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
403
418
  type: z.ZodEnum<{
404
- text: "text";
405
419
  image: "image";
406
420
  button: "button";
421
+ text: "text";
407
422
  video: "video";
408
423
  }>;
409
424
  attributes: z.ZodAny;
@@ -416,10 +431,10 @@ export declare const TopolCustomBlockMixContentWithKeySchema: z.ZodObject<{
416
431
  }, z.core.$strip>;
417
432
  export declare const TopolBlockClickedEventSchema: z.ZodObject<{
418
433
  type: z.ZodEnum<{
419
- text: "text";
420
434
  image: "image";
421
- gif: "gif";
422
435
  button: "button";
436
+ text: "text";
437
+ gif: "gif";
423
438
  divider: "divider";
424
439
  spacer: "spacer";
425
440
  social: "social";
@@ -427,6 +442,7 @@ export declare const TopolBlockClickedEventSchema: z.ZodObject<{
427
442
  html: "html";
428
443
  raw: "raw";
429
444
  "custom-raw": "custom-raw";
445
+ form: "form";
430
446
  }>;
431
447
  customBlockData: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
432
448
  key: z.ZodString;
@@ -439,9 +455,9 @@ export declare const TopolBlockClickedEventSchema: z.ZodObject<{
439
455
  disabled: z.ZodOptional<z.ZodBoolean>;
440
456
  disabledBadge: z.ZodOptional<z.ZodString>;
441
457
  type: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
442
- text: "text";
443
458
  image: "image";
444
459
  button: "button";
460
+ text: "text";
445
461
  video: "video";
446
462
  }>, z.ZodLiteral<"mix">]>>;
447
463
  attributes: z.ZodOptional<z.ZodAny>;
@@ -450,9 +466,9 @@ export declare const TopolBlockClickedEventSchema: z.ZodObject<{
450
466
  xsAttributes: z.ZodOptional<z.ZodAny>;
451
467
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
452
468
  type: z.ZodEnum<{
453
- text: "text";
454
469
  image: "image";
455
470
  button: "button";
471
+ text: "text";
456
472
  video: "video";
457
473
  }>;
458
474
  attributes: z.ZodAny;
@@ -1,3 +1,3 @@
1
1
  import z from "zod";
2
- export declare const LanguageSchema: z.ZodUnion<readonly [z.ZodLiteral<"en">, z.ZodLiteral<"fr">, z.ZodLiteral<"pt">, z.ZodLiteral<"es">, z.ZodLiteral<"ja">, z.ZodLiteral<"zh">, z.ZodLiteral<"ru">, z.ZodLiteral<"tr">, z.ZodLiteral<"de">, z.ZodLiteral<"sv">, z.ZodLiteral<"nl">, z.ZodLiteral<"it">, z.ZodLiteral<"fi">, z.ZodLiteral<"ro">, z.ZodLiteral<"cs">, z.ZodLiteral<"pl">, z.ZodLiteral<"ko">, z.ZodLiteral<"vi">, z.ZodLiteral<"he">, z.ZodLiteral<"ar">]>;
2
+ export declare const LanguageSchema: z.ZodUnion<readonly [z.ZodLiteral<"en">, z.ZodLiteral<"fr">, z.ZodLiteral<"pt">, z.ZodLiteral<"es">, z.ZodLiteral<"ja">, z.ZodLiteral<"zh">, z.ZodLiteral<"ru">, z.ZodLiteral<"tr">, z.ZodLiteral<"de">, z.ZodLiteral<"sv">, z.ZodLiteral<"sk">, z.ZodLiteral<"nl">, z.ZodLiteral<"it">, z.ZodLiteral<"fi">, z.ZodLiteral<"ro">, z.ZodLiteral<"cs">, z.ZodLiteral<"pl">, z.ZodLiteral<"ko">, z.ZodLiteral<"vi">, z.ZodLiteral<"he">, z.ZodLiteral<"ar">]>;
3
3
  export type ILanguage = z.infer<typeof LanguageSchema>;
@@ -1,8 +1,5 @@
1
1
  import { z } from "zod";
2
- import { topolTemplateSchema } from "../templateSchema";
3
- import type { TopolSection } from "../template/structure/sectionSchema";
4
- import type { TopolColumn } from "../template/structure/columnSchema";
5
- import type { TopolBlock } from "../template/structure/blockSchema";
2
+ import { topolTemplateSchema, TopolSection, TopolColumn, TopolBlock, TopolNavbar, TopolNavbarChild, TopolNavbarMenuItem, TopolNavbarHamburger, TopolRow } from "../templateSchema";
6
3
  export declare const MjmlStateSchema: z.ZodObject<{
7
4
  mjml: typeof topolTemplateSchema;
8
5
  selectedPath: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>>>;
@@ -12,7 +9,7 @@ export declare const MjmlStateSchema: z.ZodObject<{
12
9
  productTab: z.ZodDefault<z.ZodString>;
13
10
  defaultTemplate: typeof topolTemplateSchema;
14
11
  }>;
15
- export type Element = TopolSection | TopolColumn | TopolBlock | TopolSection["container"] | undefined;
12
+ export type Element = TopolSection | TopolNavbar | TopolNavbarChild | TopolNavbarMenuItem | TopolColumn | TopolBlock | TopolSection["container"] | TopolRow | TopolNavbarHamburger["container"] | undefined;
16
13
  export type baseAttributesKeys = keyof z.infer<typeof topolTemplateSchema>["attributes"];
17
14
  export type TopolStyleKeys = keyof z.infer<typeof topolTemplateSchema>["style"];
18
15
  export type MjmlState = z.infer<typeof MjmlStateSchema>;
@@ -20,12 +17,17 @@ export type MjmlStateGetters = {
20
17
  getBase: any;
21
18
  getElementByPath: (path: Array<string | number>) => Element;
22
19
  getActiveElement: Element | null;
23
- getSettingsElementAttribute: (elementName: string, prop: string, hover?: boolean) => any;
20
+ getSettingsElementAttribute: (elementName: string, prop: string, elState?: "hover" | "open") => any;
24
21
  getSettingsElementHoverAttribute: (elementName: string, prop: string) => any;
25
22
  getActiveElementHoverAttribute: (prop: string) => any;
23
+ getActiveElementOpenAttribute: (prop: string) => any;
24
+ getActiveElementSubTagHoverAttribute: (prop: string, subPath: Array<string | number>) => any;
26
25
  getActiveElementAttribute: (prop: string) => any;
26
+ getActiveElementSubTagAttribute: (prop: string, subPath: Array<string | number>, elState?: "hover" | "open") => any;
27
27
  getSettingsContainerAttribute: (prop: string) => any;
28
28
  getBlockAttribute: (block: Element | null, prop: string) => any;
29
+ getBlockSubTagAttribute: (block: Element | null, prop: string, subPath: Array<string | number>, elState?: "hover" | "open") => any;
29
30
  getSettingsContainerWasChanged: () => boolean;
31
+ getSettingsHoverStyle: (elementName: string) => any;
30
32
  };
31
33
  export type MjmlStateWithGetters = MjmlState & MjmlStateGetters;
@@ -9,7 +9,6 @@ export declare const NotificationSchema: z.ZodObject<{
9
9
  error: "error";
10
10
  success: "success";
11
11
  }>;
12
- extarnalUse: z.ZodOptional<z.ZodBoolean>;
13
12
  id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
14
13
  }, z.core.$strip>;
15
14
  export type Notification = z.infer<typeof NotificationSchema>;
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
- declare const OpenAIMessageSchema: z.ZodObject<{
2
+ export declare const OpenAIMessageSchema: z.ZodObject<{
3
3
  role: z.ZodString;
4
4
  content: z.ZodString;
5
5
  }, z.core.$strip>;
6
6
  export type IOpenAIMessage = z.infer<typeof OpenAIMessageSchema>;
7
- export {};
@@ -2,27 +2,40 @@ import { type IAuthHeaderConfig } from "../authHeaderConfig/authHeaderConfigSche
2
2
  import { type IAPI } from "../api/apiSchema";
3
3
  import { type IFont } from "../font/fontSchema";
4
4
  import { type ILanguage } from "../language/languageSchema";
5
- import { type ISavedBlocks } from "../savedBlock/savedBlockSchema";
6
5
  import { type ITheme } from "../theme/themeSchema";
7
6
  import { type IContentBlockOptions, type TopolCustomBlockData } from "../contentBlock/contentBlockScheme";
8
- import { type IHelpdesk } from "../helpdesk/helpdeskSchema";
9
7
  import { type IOptionsUser } from "../user/userSchema";
10
8
  import { type TopolTemplateSettings } from "../templateSettings/templateSettingsSchema";
9
+ import { type IOptionsPremadeSection } from "../premadeSection/premadeSectionSchema";
10
+ import type { LandingPageEditorShortcut } from "../../../../types/Shortcuts/EditorShortcut";
11
+ import type { IAuthorize } from "../../../../types/Auth/IAuthorize";
11
12
  import z from "zod";
12
- import { type IOptionsPremadeBlock } from "../premadeBlock/premadeBlockSchema";
13
+ export declare const EditorShortcutSchema: z.ZodEnum<{
14
+ delete: "delete";
15
+ duplicate: "duplicate";
16
+ save: "save";
17
+ saveAndClose: "saveAndClose";
18
+ undo: "undo";
19
+ redo: "redo";
20
+ preview: "preview";
21
+ developerMode: "developerMode";
22
+ copy: "copy";
23
+ escape: "escape";
24
+ addBelow: "addBelow";
25
+ cut: "cut";
26
+ }>;
13
27
  export declare const PluginOptionsSchema: z.ZodTypeAny;
14
28
  export type LambdaStage = "local" | "production" | "stage1" | "stage2" | "stage3";
15
29
  export type UserRole = "manager" | "editor" | "reader";
16
- export interface IPluginOptions {
17
- authorize: {
18
- apiKey: string;
19
- userId: string | number;
20
- };
30
+ /** Options of the Landing Page Editor: the `config` of `LandingPageEditor.init({ config, ...callbacks })`. */
31
+ export interface ILandingPageConfig {
32
+ authorize: IAuthorize;
33
+ aiLabeledElements?: boolean;
21
34
  api?: IAPI;
22
35
  apiAuthorizationHeader?: IAuthHeaderConfig | string;
23
36
  autosaveInterval?: number;
24
- chatAI?: boolean;
25
37
  colors?: string[];
38
+ /** Keyed by block type. Custom blocks are switched off with `customBlocks[].disabled`. */
26
39
  contentBlocks?: IContentBlockOptions;
27
40
  currentUser?: IOptionsUser;
28
41
  customBlocks?: TopolCustomBlockData[];
@@ -34,15 +47,20 @@ export interface IPluginOptions {
34
47
  defaultTemplateSettings?: TopolTemplateSettings;
35
48
  disableAiAssistant?: boolean;
36
49
  disableAlerts?: boolean;
37
- disableExtendedComparators?: boolean;
50
+ /** `true` turns every editor keyboard shortcut off; an array only the listed ones. */
51
+ disableShortcuts?: boolean | LandingPageEditorShortcut[];
38
52
  enableAutosaves?: boolean;
39
53
  enableComments?: boolean;
54
+ enableFileManagerInGif?: boolean;
40
55
  fileManagerPreferences?: {
41
56
  defaultTilesView?: boolean;
57
+ hidePexelsIntegration?: boolean;
58
+ /** Positive integer. */
59
+ maxUploadingFiles?: number;
42
60
  };
43
61
  fontSizes?: number[];
44
- googleApiKey?: string;
45
- helpdesk?: IHelpdesk;
62
+ hideSelectionPanel?: boolean;
63
+ hideSelectionPanelExpand?: boolean;
46
64
  hideSettingsTab?: boolean;
47
65
  hideTopbarControls?: string[];
48
66
  htmlMinified?: boolean;
@@ -52,22 +70,30 @@ export interface IPluginOptions {
52
70
  enableAutoResize?: boolean;
53
71
  enableCompression?: boolean;
54
72
  };
55
- imageEditor?: boolean;
73
+ imageEditorOptions?: {
74
+ hideControls?: string[];
75
+ };
56
76
  imageMaxSize?: number;
57
77
  lambdaStage?: LambdaStage;
58
78
  language?: ILanguage;
59
79
  light?: boolean;
60
- premadeBlocks?: IOptionsPremadeBlock;
80
+ premadeSections?: IOptionsPremadeSection;
61
81
  premadeTemplates?: boolean;
62
82
  premadeTemplatesOptions?: {
63
83
  hideSearch?: boolean;
64
- showDelete?: boolean;
65
84
  };
66
85
  removeTopBar?: boolean;
86
+ /**
87
+ * How Save and Save & Close are laid out when both are visible: `"dropdown"` (default) tucks
88
+ * Save & Close under the Save button's menu, `"separate"` renders two standalone buttons.
89
+ * Ignored when either button is hidden via `hideTopbarControls`.
90
+ */
91
+ saveAndCloseButton?: "dropdown" | "separate";
67
92
  renameTemplate?: boolean;
68
93
  role?: UserRole;
69
- savedBlocks?: ISavedBlocks;
94
+ savedSections?: boolean;
70
95
  showUnsavedDialogBeforeExit?: boolean;
96
+ startWithOpenElementsPanel?: boolean;
71
97
  syncedSectionsEnabled?: boolean;
72
98
  teamUsers?: IOptionsUser[];
73
99
  templateId?: number | string;
@@ -76,6 +102,113 @@ export interface IPluginOptions {
76
102
  title?: string;
77
103
  windowBar?: string[];
78
104
  }
79
- export type IPluginOptionsPartial = Omit<IPluginOptions, "authorize" | "callbacks">;
105
+ export type IPluginOptionsPartial = Omit<ILandingPageConfig, "authorize">;
106
+ /** A file or folder deleted in the built-in file manager (`onImageDelete`). */
107
+ export declare const DeletedItemSchema: z.ZodObject<{
108
+ name: z.ZodString;
109
+ type: z.ZodUnion<readonly [z.ZodLiteral<"file">, z.ZodLiteral<"folder">]>;
110
+ path: z.ZodString;
111
+ url: z.ZodOptional<z.ZodString>;
112
+ key: z.ZodNullable<z.ZodString>;
113
+ }, z.core.$strip>;
114
+ /** Payload of `onSave` and `onSaveAndClose`. */
115
+ export declare const SavePayloadSchema: z.ZodObject<{
116
+ json: z.ZodJSONSchema;
117
+ html: z.ZodString;
118
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
119
+ }, z.core.$strip>;
120
+ /**
121
+ * Host callbacks — top-level zoid props of `LandingPageEditor({ config, onSave, ... })`.
122
+ *
123
+ * Convention: every callback receives at most one argument — a payload object with named
124
+ * properties, so payloads can grow without breaking host integrations. Zero-payload
125
+ * callbacks receive nothing.
126
+ *
127
+ * `onEditorClose` / `onEditorError` are named so because zoid reserves `onClose` / `onError`
128
+ * for its own lifecycle (those never reach the child).
129
+ */
130
+ export declare const HostCallbacksSchema: z.ZodObject<{
131
+ onSave: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
132
+ json: z.ZodJSONSchema;
133
+ html: z.ZodString;
134
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
135
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
136
+ onSaveAndClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
137
+ json: z.ZodJSONSchema;
138
+ html: z.ZodString;
139
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
140
+ }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
141
+ onOpenFileManager: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodVoid>>;
142
+ onImageDelete: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
143
+ items: z.ZodArray<z.ZodObject<{
144
+ name: z.ZodString;
145
+ type: z.ZodUnion<readonly [z.ZodLiteral<"file">, z.ZodLiteral<"folder">]>;
146
+ path: z.ZodString;
147
+ url: z.ZodOptional<z.ZodString>;
148
+ key: z.ZodNullable<z.ZodString>;
149
+ }, z.core.$strip>>;
150
+ }, z.core.$strip>], null>, z.ZodVoid>>;
151
+ onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodVoid>>;
152
+ onInit: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodVoid>>;
153
+ onUndoChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
154
+ count: z.ZodNumber;
155
+ }, z.core.$strip>], null>, z.ZodVoid>>;
156
+ onRedoChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
157
+ count: z.ZodNumber;
158
+ }, z.core.$strip>], null>, z.ZodVoid>>;
159
+ onPreview: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
160
+ html: z.ZodString;
161
+ }, z.core.$strip>], null>, z.ZodVoid>>;
162
+ onPreviewClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodVoid>>;
163
+ onAlert: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
164
+ notification: z.ZodObject<{
165
+ title: z.ZodOptional<z.ZodString>;
166
+ text: z.ZodString;
167
+ expectSideEffect: z.ZodOptional<z.ZodBoolean>;
168
+ persistent: z.ZodOptional<z.ZodBoolean>;
169
+ type: z.ZodEnum<{
170
+ info: "info";
171
+ error: "error";
172
+ success: "success";
173
+ }>;
174
+ id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
175
+ }, z.core.$strip>;
176
+ }, z.core.$strip>], null>, z.ZodVoid>>;
177
+ onEditorClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
178
+ onUnsavedChangesChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
179
+ hasUnsavedChanges: z.ZodBoolean;
180
+ }, z.core.$strip>], null>, z.ZodVoid>>;
181
+ onOpenCustomBlockDialog: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
182
+ block: z.ZodUnknown;
183
+ }, z.core.$strip>], null>, z.ZodVoid>>;
184
+ onTemplateRename: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
185
+ name: z.ZodString;
186
+ }, z.core.$strip>], null>, z.ZodVoid>>;
187
+ onEditorError: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
188
+ source: z.ZodEnum<{
189
+ save: "save";
190
+ integration: "integration";
191
+ init: "init";
192
+ authorize: "authorize";
193
+ nonceAuth: "nonceAuth";
194
+ network: "network";
195
+ load: "load";
196
+ updateTemplate: "updateTemplate";
197
+ testSend: "testSend";
198
+ cloudTemplates: "cloudTemplates";
199
+ cloudSync: "cloudSync";
200
+ }>;
201
+ message: z.ZodString;
202
+ detail: z.ZodOptional<z.ZodUnknown>;
203
+ }, z.core.$strip>], null>, z.ZodVoid>>;
204
+ }, z.core.$strip>;
205
+ export type IHostCallbacks = z.infer<typeof HostCallbacksSchema>;
206
+ /** Top-level zoid prop of `LandingPageEditor({ config, getNonce, ... })`. */
207
+ export declare const NonceAuthCallbacksSchema: z.ZodObject<{
208
+ getNonce: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodPromise<z.ZodString>>>;
209
+ }, z.core.$strip>;
210
+ export type ISavePayload = z.infer<typeof SavePayloadSchema>;
211
+ export type IDeletedItem = z.infer<typeof DeletedItemSchema>;
212
+ /** Everything zoid sets on `window.xprops`: `config`, the host callbacks and zoid's child helpers. */
80
213
  export declare const XpropsSchema: z.ZodTypeAny;
81
214
  export type IXprops = z.infer<typeof XpropsSchema>;
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ import { type TopolSection } from "../template/structure/sectionSchema";
3
+ export declare const PremadeSectionSchema: z.ZodTypeAny;
4
+ export declare const PremadeSectionsItemSchema: z.ZodTypeAny;
5
+ export declare const PremadeSectionsSchema: z.ZodTypeAny;
6
+ export declare const LegacyPremadeSectionsSchema: z.ZodTypeAny;
7
+ export declare const PremadeSectionsOverrideSchema: z.ZodTypeAny;
8
+ export declare const OptionsPremadeSectionSchema: z.ZodTypeAny;
9
+ export interface IPremadeSection {
10
+ name?: string;
11
+ img?: string;
12
+ definition: TopolSection[] | TopolSection;
13
+ }
14
+ export interface IPremadeSectionItem {
15
+ id?: number;
16
+ name: string;
17
+ blocks: IPremadeSection[];
18
+ }
19
+ export type IPremadeSections = IPremadeSectionItem[];
20
+ export interface ILegacyPremadeSections {
21
+ content?: IPremadeSection[];
22
+ ecomm?: IPremadeSection[];
23
+ footers?: IPremadeSection[];
24
+ headers?: IPremadeSection[];
25
+ }
26
+ export interface IPremadeSectionsOverride {
27
+ blocks: IPremadeSections | ILegacyPremadeSections;
28
+ override: boolean;
29
+ }
30
+ export type IOptionsPremadeSection = IPremadeSectionsOverride | IPremadeSections | ILegacyPremadeSections | false;