@topol.io/editor 1.0.0-alpha.10 → 1.0.0-alpha.12

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 (67) hide show
  1. package/README.md +17 -14
  2. package/dist/topol-plugin.es.js +109 -95
  3. package/dist/topol-plugin.umd.cjs +1 -1
  4. package/dist/types/src/email-editor/index.d.ts +3 -3
  5. package/dist/types/src/landing-page-editor/constants.d.ts +1 -1
  6. package/dist/types/src/landing-page-editor/index.d.ts +10 -5
  7. package/dist/types/src/landing-page-editor/schemas/api/apiSchema.d.ts +5 -11
  8. package/dist/types/src/landing-page-editor/schemas/contentBlock/contentBlockScheme.d.ts +33 -17
  9. package/dist/types/src/landing-page-editor/schemas/language/languageSchema.d.ts +1 -1
  10. package/dist/types/src/landing-page-editor/schemas/mjmlStore/mjmlStoreSchema.d.ts +8 -6
  11. package/dist/types/src/landing-page-editor/schemas/notification/notificationSchema.d.ts +0 -1
  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 +685 -3
  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 +9 -1
  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 +29 -13
  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 +9 -1
  21. package/dist/types/src/landing-page-editor/schemas/template/blocks/spacerBlockSchema.d.ts +16 -8
  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 +4675 -1996
  31. package/dist/types/src/landing-page-editor/schemas/template/structure/columnSchema.d.ts +5445 -2356
  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 +8365 -3100
  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 +34901 -48500
  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 +23 -42
  42. package/dist/types/types/API/API.d.ts +1 -3
  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 +2 -1
  46. package/dist/types/types/Callbacks/ICallbackPayloads.d.ts +11 -4
  47. package/dist/types/types/Callbacks/IEmailCallbacks.d.ts +23 -15
  48. package/dist/types/types/ContentBlock/IContentBlockOptions.d.ts +1 -1
  49. package/dist/types/types/Countdown/ICountdownOptions.d.ts +2 -2
  50. package/dist/types/types/IEmailConfig.d.ts +33 -24
  51. package/dist/types/types/IEmailEditorInstance.d.ts +14 -4
  52. package/dist/types/types/{ITopolOptions.d.ts → IEmailOptions.d.ts} +1 -1
  53. package/dist/types/types/MergeTag/IMergeTag.d.ts +18 -0
  54. package/dist/types/types/Notification/INotification.d.ts +2 -1
  55. package/dist/types/types/Sections/ISections.d.ts +12 -1
  56. package/dist/types/types/Shortcuts/EditorShortcut.d.ts +4 -0
  57. package/dist/types/types/Theme/ITheme.d.ts +12 -2
  58. package/dist/types/types/landing-page/ILandingPageEditorInstance.d.ts +65 -5
  59. package/dist/types/types/landing-page/ILandingPageOptions.d.ts +15 -12
  60. package/package.json +1 -1
  61. package/dist/types/src/landing-page-editor/schemas/helpdesk/helpdeskSchema.d.ts +0 -8
  62. package/dist/types/src/landing-page-editor/schemas/premadeBlock/premadeBlockSchema.d.ts +0 -59750
  63. package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockApiSchema.d.ts +0 -44831
  64. package/dist/types/src/landing-page-editor/schemas/savedBlock/savedBlockSchema.d.ts +0 -59725
  65. package/dist/types/src/landing-page-editor/schemas/template/blocks/index.d.ts +0 -12
  66. package/dist/types/types/ITopolPlugin.d.ts +0 -2
  67. package/dist/types/types/SavedBlock/ISavedBlock.d.ts +0 -2
@@ -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>;
@@ -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>;
@@ -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,7 +102,7 @@ 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">;
80
106
  /** A file or folder deleted in the built-in file manager (`onImageDelete`). */
81
107
  export declare const DeletedItemSchema: z.ZodObject<{
82
108
  name: z.ZodString;
@@ -89,6 +115,7 @@ export declare const DeletedItemSchema: z.ZodObject<{
89
115
  export declare const SavePayloadSchema: z.ZodObject<{
90
116
  json: z.ZodJSONSchema;
91
117
  html: z.ZodString;
118
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
92
119
  }, z.core.$strip>;
93
120
  /**
94
121
  * Host callbacks — top-level zoid props of `LandingPageEditor({ config, onSave, ... })`.
@@ -104,10 +131,12 @@ export declare const HostCallbacksSchema: z.ZodObject<{
104
131
  onSave: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
105
132
  json: z.ZodJSONSchema;
106
133
  html: z.ZodString;
134
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
107
135
  }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
108
136
  onSaveAndClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
109
137
  json: z.ZodJSONSchema;
110
138
  html: z.ZodString;
139
+ syncedSections: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
111
140
  }, z.core.$strip>], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
112
141
  onOpenFileManager: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodVoid>>;
113
142
  onImageDelete: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
@@ -142,13 +171,12 @@ export declare const HostCallbacksSchema: z.ZodObject<{
142
171
  error: "error";
143
172
  success: "success";
144
173
  }>;
145
- extarnalUse: z.ZodOptional<z.ZodBoolean>;
146
174
  id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
147
175
  }, z.core.$strip>;
148
176
  }, z.core.$strip>], null>, z.ZodVoid>>;
149
177
  onEditorClose: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodUnion<readonly [z.ZodVoid, z.ZodPromise<z.ZodVoid>]>>>;
150
- onEdittedWithoutSaveChanged: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
151
- value: z.ZodBoolean;
178
+ onUnsavedChangesChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
179
+ hasUnsavedChanges: z.ZodBoolean;
152
180
  }, z.core.$strip>], null>, z.ZodVoid>>;
153
181
  onOpenCustomBlockDialog: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
154
182
  block: z.ZodUnknown;
@@ -157,12 +185,28 @@ export declare const HostCallbacksSchema: z.ZodObject<{
157
185
  name: z.ZodString;
158
186
  }, z.core.$strip>], null>, z.ZodVoid>>;
159
187
  onEditorError: z.ZodOptional<z.ZodFunction<z.ZodTuple<readonly [z.ZodObject<{
160
- source: z.ZodString;
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
+ }>;
161
201
  message: z.ZodString;
162
202
  detail: z.ZodOptional<z.ZodUnknown>;
163
203
  }, z.core.$strip>], null>, z.ZodVoid>>;
164
204
  }, z.core.$strip>;
165
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>;
166
210
  export type ISavePayload = z.infer<typeof SavePayloadSchema>;
167
211
  export type IDeletedItem = z.infer<typeof DeletedItemSchema>;
168
212
  /** Everything zoid sets on `window.xprops`: `config`, the host callbacks and zoid's child helpers. */
@@ -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;