easy-email-pro-theme 1.55.1 → 1.56.1

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.
package/lib/index.js CHANGED
@@ -2913,12 +2913,23 @@ const defaultCategories = [
2913
2913
  ]
2914
2914
  }
2915
2915
  ];
2916
- const BlockList = ({ tab }) => {
2916
+ const BlockList = ({
2917
+ tab
2918
+ }) => {
2917
2919
  const universalElementEditing = useUniversalElementEditing();
2918
2920
  if (universalElementEditing) {
2919
2921
  return /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(DefaultBlockList, null));
2920
2922
  }
2921
- return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { style: { display: tab === "Default" ? void 0 : "none" } }, /* @__PURE__ */ React__default.createElement(DefaultBlockList, null)), /* @__PURE__ */ React__default.createElement("div", { style: { display: tab === "Universal" ? void 0 : "none" } }, /* @__PURE__ */ React__default.createElement(SharedComponents.UniversalList, null)));
2923
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { style: { display: tab === "Default" ? void 0 : "none" } }, /* @__PURE__ */ React__default.createElement(DefaultBlockList, null)), /* @__PURE__ */ React__default.createElement(
2924
+ "div",
2925
+ {
2926
+ style: {
2927
+ display: tab === "Prebuilt" ? void 0 : "none",
2928
+ height: "100%"
2929
+ }
2930
+ },
2931
+ /* @__PURE__ */ React__default.createElement(SharedComponents.PrebuiltBlockList, null)
2932
+ ), /* @__PURE__ */ React__default.createElement("div", { style: { display: tab === "Universal" ? void 0 : "none" } }, /* @__PURE__ */ React__default.createElement(SharedComponents.UniversalList, null)));
2922
2933
  };
2923
2934
  const DefaultBlockList = () => {
2924
2935
  const editorProps = useEditorProps();
@@ -3058,33 +3069,41 @@ const DefaultBlockList = () => {
3058
3069
  ]);
3059
3070
  };
3060
3071
  const BlocksPanel = () => {
3061
- const [tab, setTab] = useState("Default");
3072
+ const [tab, setTab] = useState(
3073
+ "Default"
3074
+ );
3062
3075
  const universalElementEditing = useUniversalElementEditing();
3063
- const { universalElementSetting } = useEditorProps();
3076
+ const { universalElementSetting, prebuiltBlocks } = useEditorProps();
3077
+ const showPrebuilt = prebuiltBlocks && prebuiltBlocks.length > 0;
3078
+ const width = showPrebuilt ? "33%" : "50%";
3064
3079
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, !universalElementEditing && universalElementSetting && /* @__PURE__ */ React__default.createElement("div", { style: { padding: 24 } }, /* @__PURE__ */ React__default.createElement(Button$2.Group, { style: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(
3065
3080
  Button$2,
3066
3081
  {
3067
- type: "outline",
3082
+ type: tab === "Default" ? "primary" : "outline",
3083
+ onClick: () => setTab("Default"),
3068
3084
  style: {
3069
- width: "50%",
3070
- borderColor: tab === "Default" ? void 0 : "#000",
3071
- color: tab === "Default" ? void 0 : "#000",
3072
- borderRightColor: tab === "Default" ? void 0 : "transparent"
3073
- },
3074
- onClick: () => setTab("Default")
3085
+ width
3086
+ }
3075
3087
  },
3076
3088
  /* @__PURE__ */ React__default.createElement(Space, null, t("Default"))
3089
+ ), showPrebuilt && /* @__PURE__ */ React__default.createElement(
3090
+ Button$2,
3091
+ {
3092
+ type: tab === "Prebuilt" ? "primary" : "outline",
3093
+ onClick: () => setTab("Prebuilt"),
3094
+ style: {
3095
+ width
3096
+ }
3097
+ },
3098
+ /* @__PURE__ */ React__default.createElement(Space, null, t("Prebuilt"))
3077
3099
  ), /* @__PURE__ */ React__default.createElement(
3078
3100
  Button$2,
3079
3101
  {
3080
- type: "outline",
3102
+ type: tab === "Universal" ? "primary" : "outline",
3103
+ onClick: () => setTab("Universal"),
3081
3104
  style: {
3082
- width: "50%",
3083
- borderColor: tab !== "Default" ? void 0 : "#000",
3084
- color: tab !== "Default" ? void 0 : "#000",
3085
- borderLeftColor: tab !== "Default" ? void 0 : "transparent"
3086
- },
3087
- onClick: () => setTab("Universal")
3105
+ width
3106
+ }
3088
3107
  },
3089
3108
  /* @__PURE__ */ React__default.createElement(Space, null, t("Universal"))
3090
3109
  ))), /* @__PURE__ */ React__default.createElement(BlockList, { tab }));
@@ -33159,6 +33178,25 @@ const SyncChildrenAttributes$2 = ({
33159
33178
  }
33160
33179
  ));
33161
33180
  };
33181
+ const SOCIAL_NETWORK_OPTIONS = [
33182
+ { value: "facebook", label: "Facebook" },
33183
+ { value: "x", label: "X" },
33184
+ { value: "twitter", label: "Twitter" },
33185
+ { value: "google", label: "Google" },
33186
+ { value: "pinterest", label: "Pinterest" },
33187
+ { value: "linkedin", label: "LinkedIn" },
33188
+ { value: "instagram", label: "Instagram" },
33189
+ { value: "web", label: "Web" },
33190
+ { value: "snapchat", label: "Snapchat" },
33191
+ { value: "youtube", label: "YouTube" },
33192
+ { value: "tumblr", label: "Tumblr" },
33193
+ { value: "github", label: "GitHub" },
33194
+ { value: "xing", label: "Xing" },
33195
+ { value: "vimeo", label: "Vimeo" },
33196
+ { value: "medium", label: "Medium" },
33197
+ { value: "soundcloud", label: "SoundCloud" },
33198
+ { value: "dribbble", label: "Dribbble" }
33199
+ ];
33162
33200
  const Social$1 = ({ nodePath }) => {
33163
33201
  return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(
33164
33202
  ResponsiveTabs,
@@ -33235,8 +33273,14 @@ function AttributesContainer$a({
33235
33273
  tabPosition: "top",
33236
33274
  name: `children`,
33237
33275
  label: "",
33238
- renderItem: (item2, index2) => /* @__PURE__ */ React__default.createElement(SocialItem$2, { index: index2, path: [...nodePath, index2] }),
33239
- renderHeader: (item2, index2) => item2.content || "Custom"
33276
+ renderItem: (_item, index2) => /* @__PURE__ */ React__default.createElement(SocialItem$2, { path: [...nodePath, index2], key: index2 }),
33277
+ renderHeader: (item2) => {
33278
+ var _a;
33279
+ if (item2.attributes.mode === "prebuilt") {
33280
+ return ((_a = SOCIAL_NETWORK_OPTIONS.find((option) => option.value === item2.attributes.name)) == null ? void 0 : _a.label) || "Custom";
33281
+ }
33282
+ return item2.content || "Custom";
33283
+ }
33240
33284
  }
33241
33285
  ), /* @__PURE__ */ React__default.createElement(Collapse.Item, { name: "0", header: t("Dimension") }, /* @__PURE__ */ React__default.createElement(
33242
33286
  ResponsiveField,
@@ -33306,15 +33350,130 @@ function AttributesContainer$a({
33306
33350
  }
33307
33351
  )));
33308
33352
  }
33309
- function SocialItem$2({ index: index2, path: path2 }) {
33310
- return /* @__PURE__ */ React__default.createElement("div", { className: "SocialItem" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement(
33353
+ function SocialItem$2({ path: path2 }) {
33354
+ const { getFieldValue } = useEditorContext();
33355
+ const editor = useSlate();
33356
+ const currentModeValue = getFieldValue(path2, "attributes.mode");
33357
+ const currentName = getFieldValue(path2, "attributes.name");
33358
+ const currentMode = useMemo(() => {
33359
+ if (currentModeValue === "prebuilt" || currentModeValue === "custom") {
33360
+ return currentModeValue;
33361
+ }
33362
+ return currentName ? "prebuilt" : "custom";
33363
+ }, [currentModeValue, currentName]);
33364
+ const [selectedMode, setSelectedMode] = useState(currentMode);
33365
+ useEffect(() => {
33366
+ setSelectedMode(currentMode);
33367
+ }, [currentMode]);
33368
+ const handleModeChange = useCallback(
33369
+ (mode) => {
33370
+ setSelectedMode(mode);
33371
+ HistoryEditor.withoutSaving(editor, () => {
33372
+ Editor.withoutNormalizing(editor, () => {
33373
+ const node = Node.get(editor, path2);
33374
+ const newAttributes = __spreadValues(__spreadProps(__spreadValues({}, node.attributes), {
33375
+ mode
33376
+ }), mode === "prebuilt" ? {
33377
+ name: node.attributes.name || "google"
33378
+ } : {});
33379
+ Transforms.setNodes(
33380
+ editor,
33381
+ {
33382
+ attributes: newAttributes
33383
+ },
33384
+ {
33385
+ at: path2
33386
+ }
33387
+ );
33388
+ });
33389
+ });
33390
+ },
33391
+ [editor, path2]
33392
+ );
33393
+ const handleNameChange = useCallback(
33394
+ (name) => {
33395
+ HistoryEditor.withoutSaving(editor, () => {
33396
+ Editor.withoutNormalizing(editor, () => {
33397
+ const node = Node.get(editor, path2);
33398
+ const newAttributes = __spreadProps(__spreadValues({}, node.attributes), {
33399
+ mode: "prebuilt",
33400
+ name: name || void 0,
33401
+ src: void 0
33402
+ // Clear src when using prebuilt
33403
+ });
33404
+ Transforms.setNodes(
33405
+ editor,
33406
+ {
33407
+ attributes: newAttributes
33408
+ },
33409
+ {
33410
+ at: path2
33411
+ }
33412
+ );
33413
+ });
33414
+ });
33415
+ },
33416
+ [editor, path2]
33417
+ );
33418
+ const handleImageChange = useCallback(
33419
+ (src) => {
33420
+ HistoryEditor.withoutSaving(editor, () => {
33421
+ Editor.withoutNormalizing(editor, () => {
33422
+ const node = Node.get(editor, path2);
33423
+ const newAttributes = __spreadProps(__spreadValues({}, node.attributes), {
33424
+ mode: "custom",
33425
+ src: src || void 0,
33426
+ name: void 0
33427
+ // Clear name when using custom
33428
+ });
33429
+ Transforms.setNodes(
33430
+ editor,
33431
+ {
33432
+ attributes: newAttributes
33433
+ },
33434
+ {
33435
+ at: path2
33436
+ }
33437
+ );
33438
+ });
33439
+ });
33440
+ },
33441
+ [editor, path2]
33442
+ );
33443
+ return /* @__PURE__ */ React__default.createElement("div", { className: "SocialItem" }, /* @__PURE__ */ React__default.createElement("div", { style: { marginTop: 10 } }), /* @__PURE__ */ React__default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ React__default.createElement("div", { style: { marginBottom: 8, fontSize: 14 } }, t("Icon source")), /* @__PURE__ */ React__default.createElement(Button$2.Group, { style: { width: "100%" } }, /* @__PURE__ */ React__default.createElement(
33444
+ Button$2,
33445
+ {
33446
+ type: selectedMode === "prebuilt" ? "primary" : "default",
33447
+ onClick: () => handleModeChange("prebuilt"),
33448
+ style: { width: "50%" }
33449
+ },
33450
+ t("Prebuilt")
33451
+ ), /* @__PURE__ */ React__default.createElement(
33452
+ Button$2,
33453
+ {
33454
+ type: selectedMode === "custom" ? "primary" : "default",
33455
+ onClick: () => handleModeChange("custom"),
33456
+ style: { width: "50%" }
33457
+ },
33458
+ t("Custom image")
33459
+ ))), /* @__PURE__ */ React__default.createElement(Divider$2, null), currentMode === "prebuilt" ? /* @__PURE__ */ React__default.createElement(
33460
+ AttributeField.SelectField,
33461
+ {
33462
+ path: path2,
33463
+ label: t("Social network"),
33464
+ name: "attributes.name",
33465
+ options: SOCIAL_NETWORK_OPTIONS,
33466
+ onChange: handleNameChange
33467
+ }
33468
+ ) : /* @__PURE__ */ React__default.createElement(
33311
33469
  AttributeField.ImageUrl,
33312
33470
  {
33313
33471
  path: path2,
33314
33472
  label: t("Icon"),
33315
- name: `attributes.src`
33473
+ name: `attributes.src`,
33474
+ onChange: handleImageChange
33316
33475
  }
33317
- ), /* @__PURE__ */ React__default.createElement(Divider$2, null), /* @__PURE__ */ React__default.createElement(
33476
+ ), /* @__PURE__ */ React__default.createElement(
33318
33477
  AttributeField.ColorPickerField,
33319
33478
  {
33320
33479
  path: path2,
@@ -39610,36 +39769,36 @@ const BlocksDrawer = () => {
39610
39769
  handleSelectBlock
39611
39770
  ]);
39612
39771
  };
39613
- const blocksModal = "_blocksModal_oes30_1";
39614
- const modalHeader = "_modalHeader_oes30_9";
39615
- const headerActions = "_headerActions_oes30_16";
39616
- const searchInput = "_searchInput_oes30_22";
39617
- const modalTitle = "_modalTitle_oes30_26";
39618
- const contentArea = "_contentArea_oes30_32";
39619
- const category = "_category_oes30_38";
39620
- const categoryHeader = "_categoryHeader_oes30_45";
39621
- const gridContainer = "_gridContainer_oes30_56";
39622
- const gridItem = "_gridItem_oes30_65";
39623
- const selected = "_selected_oes30_84";
39624
- const gridItemIcon = "_gridItemIcon_oes30_88";
39625
- const gridItemLabel = "_gridItemLabel_oes30_118";
39626
- const checkIcon = "_checkIcon_oes30_126";
39627
- const emptyState = "_emptyState_oes30_143";
39628
- const layoutPreview = "_layoutPreview_oes30_153";
39629
- const layoutSelected = "_layoutSelected_oes30_169";
39630
- const layoutRowLabel = "_layoutRowLabel_oes30_175";
39631
- const layoutRow = "_layoutRow_oes30_175";
39632
- const layoutColumn = "_layoutColumn_oes30_200";
39772
+ const blocksModal = "_blocksModal_12piq_1";
39773
+ const modalHeader = "_modalHeader_12piq_7";
39774
+ const headerActions = "_headerActions_12piq_14";
39775
+ const searchInput = "_searchInput_12piq_20";
39776
+ const modalTitle = "_modalTitle_12piq_24";
39777
+ const category = "_category_12piq_30";
39778
+ const categoryHeader = "_categoryHeader_12piq_37";
39779
+ const gridContainer = "_gridContainer_12piq_48";
39780
+ const prebuiltBlockContainer = "_prebuiltBlockContainer_12piq_57";
39781
+ const gridItem = "_gridItem_12piq_66";
39782
+ const selected = "_selected_12piq_85";
39783
+ const gridItemIcon = "_gridItemIcon_12piq_89";
39784
+ const gridItemLabel = "_gridItemLabel_12piq_119";
39785
+ const checkIcon = "_checkIcon_12piq_127";
39786
+ const emptyState = "_emptyState_12piq_144";
39787
+ const layoutPreview = "_layoutPreview_12piq_154";
39788
+ const layoutSelected = "_layoutSelected_12piq_170";
39789
+ const layoutRowLabel = "_layoutRowLabel_12piq_176";
39790
+ const layoutRow = "_layoutRow_12piq_176";
39791
+ const layoutColumn = "_layoutColumn_12piq_201";
39633
39792
  const styles = {
39634
39793
  blocksModal,
39635
39794
  modalHeader,
39636
39795
  headerActions,
39637
39796
  searchInput,
39638
39797
  modalTitle,
39639
- contentArea,
39640
39798
  category,
39641
39799
  categoryHeader,
39642
39800
  gridContainer,
39801
+ prebuiltBlockContainer,
39643
39802
  gridItem,
39644
39803
  selected,
39645
39804
  gridItemIcon,
@@ -39689,6 +39848,11 @@ const BlocksModal = () => {
39689
39848
  } = useBlocksDrawer();
39690
39849
  const editorProps = useEditorProps();
39691
39850
  const { categories: propsCategories } = editorProps;
39851
+ const prebuiltBlocks = editorProps.prebuiltBlocks;
39852
+ const [activeTab, setActiveTab] = useState(
39853
+ "default"
39854
+ /* DEFAULT */
39855
+ );
39692
39856
  const categories = useMemo(() => {
39693
39857
  const filtered = (propsCategories || []).map((categoryItem) => {
39694
39858
  if (!parentCategory)
@@ -39750,6 +39914,29 @@ const BlocksModal = () => {
39750
39914
  });
39751
39915
  return filtered;
39752
39916
  }, [propsCategories, parentCategory, searchQuery]);
39917
+ const filteredPrebuiltBlocks = useMemo(() => {
39918
+ if (!prebuiltBlocks || prebuiltBlocks.length === 0) {
39919
+ return [];
39920
+ }
39921
+ let result = prebuiltBlocks;
39922
+ if (searchQuery.trim()) {
39923
+ const query = searchQuery.toLowerCase().trim();
39924
+ result = result.map((category2) => {
39925
+ const filteredBlocks = category2.blocks.filter((block) => {
39926
+ const titleMatch = block.title.toLowerCase().includes(query);
39927
+ const categoryMatch = block.category.toLowerCase().includes(query);
39928
+ return titleMatch || categoryMatch;
39929
+ });
39930
+ if (filteredBlocks.length === 0) {
39931
+ return null;
39932
+ }
39933
+ return __spreadProps(__spreadValues({}, category2), {
39934
+ blocks: filteredBlocks
39935
+ });
39936
+ }).filter((category2) => category2 !== null);
39937
+ }
39938
+ return result;
39939
+ }, [prebuiltBlocks, searchQuery]);
39753
39940
  const handleSelectBlock = useCallback(
39754
39941
  (blockType) => {
39755
39942
  if (!insertPath)
@@ -39774,6 +39961,16 @@ const BlocksModal = () => {
39774
39961
  if (!selectedBlock)
39775
39962
  return;
39776
39963
  const { block, categoryIndex } = selectedBlock;
39964
+ if (activeTab === "prebuilt" && prebuiltBlocks) {
39965
+ const category22 = filteredPrebuiltBlocks[categoryIndex];
39966
+ if (category22) {
39967
+ const prebuiltBlock = category22.blocks[selectedBlock.blockIndex];
39968
+ if (prebuiltBlock) {
39969
+ handleSelectBlock(prebuiltBlock.payload);
39970
+ return;
39971
+ }
39972
+ }
39973
+ }
39777
39974
  const category2 = categories[categoryIndex];
39778
39975
  if ((category2 == null ? void 0 : category2.displayType) === "grid") {
39779
39976
  handleSelectBlock(__spreadProps(__spreadValues({}, block.payload), {
@@ -39838,10 +40035,14 @@ const BlocksModal = () => {
39838
40035
  handleSelectBlock(element);
39839
40036
  }
39840
40037
  }
39841
- }, [selectedBlock, categories, handleSelectBlock]);
40038
+ }, [selectedBlock, categories, handleSelectBlock, activeTab, prebuiltBlocks, filteredPrebuiltBlocks]);
39842
40039
  const handleModalClose = useCallback(() => {
39843
40040
  setSelectedBlock(null);
39844
40041
  setSearchQuery("");
40042
+ setActiveTab(
40043
+ "default"
40044
+ /* DEFAULT */
40045
+ );
39845
40046
  onClose();
39846
40047
  }, [onClose]);
39847
40048
  const handleSearchChange = useCallback((value) => {
@@ -39851,7 +40052,7 @@ const BlocksModal = () => {
39851
40052
  const renderGridContent = useMemo(() => {
39852
40053
  return categories.map((category2, categoryIndex) => {
39853
40054
  if (category2.displayType === "grid") {
39854
- return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { className: styles.gridContainer }, category2.blocks.map((block, blockIndex) => {
40055
+ return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex + category2.label, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { className: styles.gridContainer }, category2.blocks.map((block, blockIndex) => {
39855
40056
  const isSelected = (selectedBlock == null ? void 0 : selectedBlock.categoryIndex) === categoryIndex && (selectedBlock == null ? void 0 : selectedBlock.blockIndex) === blockIndex;
39856
40057
  const blockTitle = block.title || BlockManager.getBlockTitle(__spreadProps(__spreadValues({}, block.payload), {
39857
40058
  type: block.type
@@ -39870,7 +40071,7 @@ const BlocksModal = () => {
39870
40071
  })));
39871
40072
  }
39872
40073
  if (category2.displayType === "section") {
39873
- return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "0 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement("div", { key: index2 }, /* @__PURE__ */ React__default.createElement(
40074
+ return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex + category2.label, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "0 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement("div", { key: index2 }, /* @__PURE__ */ React__default.createElement(
39874
40075
  "div",
39875
40076
  {
39876
40077
  style: {
@@ -39910,7 +40111,7 @@ const BlocksModal = () => {
39910
40111
  )))));
39911
40112
  }
39912
40113
  if (category2.displayType === "column") {
39913
- return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "0 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement("div", { key: index2 }, /* @__PURE__ */ React__default.createElement(
40114
+ return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex + category2.label, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "0 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement("div", { key: index2 }, /* @__PURE__ */ React__default.createElement(
39914
40115
  "div",
39915
40116
  {
39916
40117
  style: {
@@ -39942,7 +40143,7 @@ const BlocksModal = () => {
39942
40143
  })))));
39943
40144
  }
39944
40145
  if (category2.displayType === "custom") {
39945
- return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "16px 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement(
40146
+ return /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex + category2.label, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { style: { padding: "16px 20px" } }, category2.blocks.map((item2, index2) => /* @__PURE__ */ React__default.createElement(
39946
40147
  "div",
39947
40148
  {
39948
40149
  key: index2,
@@ -39956,6 +40157,34 @@ const BlocksModal = () => {
39956
40157
  return null;
39957
40158
  });
39958
40159
  }, [categories, selectedBlock, handleGridItemClick]);
40160
+ const renderPrebuiltBlocks = useMemo(() => {
40161
+ if (!prebuiltBlocks || prebuiltBlocks.length === 0) {
40162
+ return /* @__PURE__ */ React__default.createElement("div", { className: styles.emptyState }, t("No blocks available"));
40163
+ }
40164
+ if (filteredPrebuiltBlocks.length === 0) {
40165
+ return /* @__PURE__ */ React__default.createElement("div", { className: styles.emptyState }, t("No blocks available"));
40166
+ }
40167
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, filteredPrebuiltBlocks.map((category2, categoryIndex) => /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: styles.category }, /* @__PURE__ */ React__default.createElement("div", { className: styles.categoryHeader }, /* @__PURE__ */ React__default.createElement(Text, { bold: true }, category2.label)), /* @__PURE__ */ React__default.createElement("div", { className: styles.prebuiltBlockContainer }, category2.blocks.map((block, blockIndex) => {
40168
+ const isSelected = (selectedBlock == null ? void 0 : selectedBlock.categoryIndex) === categoryIndex && (selectedBlock == null ? void 0 : selectedBlock.blockIndex) === blockIndex;
40169
+ return /* @__PURE__ */ React__default.createElement(
40170
+ "div",
40171
+ {
40172
+ key: blockIndex,
40173
+ className: `${styles.gridItem} ${isSelected ? styles.selected : ""}`,
40174
+ style: {
40175
+ backgroundImage: `url(${block.thumbnail})`,
40176
+ aspectRatio: "16 / 9",
40177
+ backgroundSize: "contain",
40178
+ backgroundPosition: "center",
40179
+ backgroundRepeat: "no-repeat"
40180
+ },
40181
+ onClick: () => handleGridItemClick(block, categoryIndex, blockIndex)
40182
+ },
40183
+ isSelected && /* @__PURE__ */ React__default.createElement("div", { className: styles.checkIcon }, /* @__PURE__ */ React__default.createElement(IconCheck, null))
40184
+ );
40185
+ })))));
40186
+ }, [prebuiltBlocks, filteredPrebuiltBlocks, selectedBlock == null ? void 0 : selectedBlock.categoryIndex, selectedBlock == null ? void 0 : selectedBlock.blockIndex, handleGridItemClick]);
40187
+ const hasPrebuiltBlocks = prebuiltBlocks && prebuiltBlocks.length > 0;
39959
40188
  return /* @__PURE__ */ React__default.createElement(
39960
40189
  Modal,
39961
40190
  {
@@ -39973,7 +40202,47 @@ const BlocksModal = () => {
39973
40202
  },
39974
40203
  cancelText: t("Cancel")
39975
40204
  },
39976
- /* @__PURE__ */ React__default.createElement("div", { className: styles.blocksModal }, /* @__PURE__ */ React__default.createElement("div", { className: styles.headerActions }, /* @__PURE__ */ React__default.createElement(
40205
+ /* @__PURE__ */ React__default.createElement("div", { className: styles.blocksModal, key: activeTab }, hasPrebuiltBlocks ? /* @__PURE__ */ React__default.createElement("div", { className: styles.tabsContainer }, /* @__PURE__ */ React__default.createElement(Button$2.Group, { style: { width: "100%", marginBottom: 16 } }, /* @__PURE__ */ React__default.createElement(
40206
+ Button$2,
40207
+ {
40208
+ size: "large",
40209
+ type: activeTab === "default" ? "primary" : "outline",
40210
+ onClick: () => {
40211
+ setActiveTab(
40212
+ "default"
40213
+ /* DEFAULT */
40214
+ );
40215
+ setSelectedBlock(null);
40216
+ },
40217
+ style: { width: "50%" }
40218
+ },
40219
+ t("Default")
40220
+ ), /* @__PURE__ */ React__default.createElement(
40221
+ Button$2,
40222
+ {
40223
+ size: "large",
40224
+ type: activeTab === "prebuilt" ? "primary" : "outline",
40225
+ onClick: () => {
40226
+ setActiveTab(
40227
+ "prebuilt"
40228
+ /* PREBUILT */
40229
+ );
40230
+ setSelectedBlock(null);
40231
+ },
40232
+ style: { width: "50%" }
40233
+ },
40234
+ t("Prebuilt")
40235
+ )), /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: styles.headerActions }, /* @__PURE__ */ React__default.createElement(
40236
+ Input,
40237
+ {
40238
+ className: styles.searchInput,
40239
+ placeholder: t("Search blocks..."),
40240
+ prefix: /* @__PURE__ */ React__default.createElement(IconSearch, null),
40241
+ value: searchQuery,
40242
+ onChange: handleSearchChange,
40243
+ allowClear: true
40244
+ }
40245
+ )), /* @__PURE__ */ React__default.createElement(SharedComponents.FullHeightOverlayScrollbars, { height: "calc(100vh - 350px)", maxHeight: "600px" }, activeTab === "default" ? categories.length > 0 ? renderGridContent : /* @__PURE__ */ React__default.createElement("div", { className: styles.emptyState }, t("No blocks available")) : renderPrebuiltBlocks))) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", { className: styles.headerActions }, /* @__PURE__ */ React__default.createElement(
39977
40246
  Input,
39978
40247
  {
39979
40248
  className: styles.searchInput,
@@ -39983,7 +40252,7 @@ const BlocksModal = () => {
39983
40252
  onChange: handleSearchChange,
39984
40253
  allowClear: true
39985
40254
  }
39986
- )), /* @__PURE__ */ React__default.createElement("div", { className: styles.contentArea }, categories.length > 0 ? renderGridContent : /* @__PURE__ */ React__default.createElement("div", { className: styles.emptyState }, t("No blocks available"))))
40255
+ )), /* @__PURE__ */ React__default.createElement("div", { className: styles.contentArea }, /* @__PURE__ */ React__default.createElement(SharedComponents.FullHeightOverlayScrollbars, { height: "calc(100vh - 350px)", maxHeight: "600px" }, categories.length > 0 ? renderGridContent : /* @__PURE__ */ React__default.createElement("div", { className: styles.emptyState }, t("No blocks available"))))))
39987
40256
  );
39988
40257
  };
39989
40258
  const styleText$8 = "[data-standard-table2-selected=true] ::selection {\n background: none !important;\n}\n\n[data-standard-table2-selected=true] [data-standard-table2-td-selected=true] {\n background-color: rgba(199, 199, 199, 0.4) !important;\n}";
@@ -40649,6 +40918,149 @@ const TableTools = (props) => {
40649
40918
  return null;
40650
40919
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("style", null, styleText$8), showContextMenu && /* @__PURE__ */ React__default.createElement(ContextMenu, { position }));
40651
40920
  };
40921
+ const PrebuiltBlockList$1 = "";
40922
+ function PrebuiltBlockItem({
40923
+ block,
40924
+ universalElementEditing,
40925
+ standaloneElementEditing,
40926
+ initialStandaloneElement
40927
+ }) {
40928
+ const elementType = block.payload.type;
40929
+ const blockDefinition = BlockManager.getBlockByType(elementType);
40930
+ const element = useMemo(() => {
40931
+ if (!blockDefinition) {
40932
+ return null;
40933
+ }
40934
+ return blockDefinition.create(block.payload);
40935
+ }, [blockDefinition, block.payload]);
40936
+ const { dragHandle } = useDragging({
40937
+ element: element || {},
40938
+ nodeElement: null,
40939
+ action: "copy",
40940
+ cloneGhost: false
40941
+ });
40942
+ if (!blockDefinition || !element) {
40943
+ return null;
40944
+ }
40945
+ if (universalElementEditing && !NodeUtils.isContentElement(element))
40946
+ return null;
40947
+ if (standaloneElementEditing && initialStandaloneElement && !NodeUtils.isParentCategoryType(element.type, initialStandaloneElement.type))
40948
+ return null;
40949
+ return /* @__PURE__ */ React__default.createElement("div", { className: "prebuilt-block-item" }, /* @__PURE__ */ React__default.createElement("div", __spreadValues({ className: "prebuilt-block-item-container" }, dragHandle), /* @__PURE__ */ React__default.createElement("div", { className: "prebuilt-block-thumbnail" }, /* @__PURE__ */ React__default.createElement(
40950
+ "img",
40951
+ {
40952
+ src: block.thumbnail,
40953
+ style: { objectFit: "contain" },
40954
+ alt: block.title,
40955
+ loading: "lazy"
40956
+ }
40957
+ ))));
40958
+ }
40959
+ const PrebuiltBlockList = () => {
40960
+ const editorProps = useEditorProps();
40961
+ const standaloneElementEditing = useStandaloneElementEditing();
40962
+ const initialStandaloneElement = useStandaloneElement();
40963
+ const universalElementEditing = useUniversalElementEditing();
40964
+ const [searchQuery, setSearchQuery] = useState("");
40965
+ const [selectedCategoryLabel, setSelectedCategoryLabel] = useState(void 0);
40966
+ const categories = useMemo(() => {
40967
+ return editorProps.prebuiltBlocks || [];
40968
+ }, [editorProps.prebuiltBlocks]);
40969
+ const filteredCategories = useMemo(() => {
40970
+ let result = categories;
40971
+ if (selectedCategoryLabel) {
40972
+ result = result.filter(
40973
+ (category2) => category2.label === selectedCategoryLabel
40974
+ );
40975
+ }
40976
+ if (searchQuery.trim()) {
40977
+ const query = searchQuery.toLowerCase().trim();
40978
+ result = result.map((category2) => {
40979
+ const filteredBlocks = category2.blocks.filter((block) => {
40980
+ const titleMatch = block.title.toLowerCase().includes(query);
40981
+ const categoryMatch = block.category.toLowerCase().includes(query);
40982
+ return titleMatch || categoryMatch;
40983
+ });
40984
+ if (filteredBlocks.length === 0) {
40985
+ return null;
40986
+ }
40987
+ return __spreadProps(__spreadValues({}, category2), {
40988
+ blocks: filteredBlocks
40989
+ });
40990
+ }).filter((category2) => category2 !== null);
40991
+ }
40992
+ return result;
40993
+ }, [categories, searchQuery, selectedCategoryLabel]);
40994
+ return useMemo(() => {
40995
+ return /* @__PURE__ */ React__default.createElement(
40996
+ "div",
40997
+ {
40998
+ "data-compact": Boolean(editorProps.compact || editorProps.widgetMode),
40999
+ className: "BlockSideBar-PrebuiltBlockList",
41000
+ style: {
41001
+ height: "100%"
41002
+ }
41003
+ },
41004
+ /* @__PURE__ */ React__default.createElement(
41005
+ Grid.Row,
41006
+ {
41007
+ style: {
41008
+ borderBottom: "1px solid var(--color-border, #e5e7eb)",
41009
+ paddingBottom: 10,
41010
+ paddingLeft: 25,
41011
+ paddingRight: 25
41012
+ }
41013
+ },
41014
+ /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 14, offset: 0 }, /* @__PURE__ */ React__default.createElement(
41015
+ Input,
41016
+ {
41017
+ placeholder: "Search blocks...",
41018
+ value: searchQuery,
41019
+ onChange: (value) => setSearchQuery(value),
41020
+ allowClear: true
41021
+ }
41022
+ )),
41023
+ /* @__PURE__ */ React__default.createElement(Grid.Col, { span: 7, offset: 3 }, /* @__PURE__ */ React__default.createElement(
41024
+ Select$1,
41025
+ {
41026
+ placeholder: "Category",
41027
+ value: selectedCategoryLabel,
41028
+ onChange: (value) => setSelectedCategoryLabel(value || void 0),
41029
+ allowClear: true,
41030
+ triggerProps: {
41031
+ autoAlignPopupWidth: false,
41032
+ autoAlignPopupMinWidth: true
41033
+ }
41034
+ },
41035
+ categories.map((category2) => /* @__PURE__ */ React__default.createElement(Select$1.Option, { key: category2.label, value: category2.label }, category2.label))
41036
+ ))
41037
+ ),
41038
+ /* @__PURE__ */ React__default.createElement(SharedComponents.FullHeightOverlayScrollbars, { height: "calc(100% - 115px)" }, /* @__PURE__ */ React__default.createElement("div", { className: "prebuilt-block-content" }, filteredCategories.map((category2, categoryIndex) => {
41039
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: categoryIndex }, /* @__PURE__ */ React__default.createElement("div", { key: categoryIndex, className: "prebuilt-block-category" }, /* @__PURE__ */ React__default.createElement("div", { className: "prebuilt-block-category-title" }, category2.label), /* @__PURE__ */ React__default.createElement("div", { className: "prebuilt-block-grid" }, category2.blocks.map((block, blockIndex) => {
41040
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: blockIndex }, /* @__PURE__ */ React__default.createElement(
41041
+ PrebuiltBlockItem,
41042
+ {
41043
+ block,
41044
+ universalElementEditing,
41045
+ standaloneElementEditing,
41046
+ initialStandaloneElement
41047
+ }
41048
+ ));
41049
+ }))));
41050
+ })))
41051
+ );
41052
+ }, [
41053
+ filteredCategories,
41054
+ editorProps.compact,
41055
+ editorProps.widgetMode,
41056
+ initialStandaloneElement,
41057
+ standaloneElementEditing,
41058
+ universalElementEditing,
41059
+ searchQuery,
41060
+ selectedCategoryLabel,
41061
+ categories
41062
+ ]);
41063
+ };
40652
41064
  ExternalComponents.ChildrenWithPlaceholderWrapper = DraggingPlaceholderWrapper;
40653
41065
  const SharedComponents = {
40654
41066
  PreviewEmailDrawer,
@@ -40677,6 +41089,7 @@ const SharedComponents = {
40677
41089
  BlockList,
40678
41090
  UniversalListItem,
40679
41091
  UniversalList,
41092
+ PrebuiltBlockList,
40680
41093
  MergeTagComponent,
40681
41094
  ImageAction,
40682
41095
  DesktopEmailPreview,
package/lib/style.css CHANGED
@@ -1876,51 +1876,43 @@ THEMES:
1876
1876
  opacity: 0;
1877
1877
  visibility: hidden;
1878
1878
  white-space: nowrap;
1879
- }._blocksModal_oes30_1 {
1879
+ }._blocksModal_12piq_1 {
1880
1880
  display: flex;
1881
1881
  flex-direction: column;
1882
- height: 70vh;
1883
- max-height: 600px;
1884
1882
  background-color: var(--color-bg-1);
1885
1883
  }
1886
1884
 
1887
- ._modalHeader_oes30_9 {
1885
+ ._modalHeader_12piq_7 {
1888
1886
  display: flex;
1889
1887
  justify-content: space-between;
1890
1888
  align-items: center;
1891
1889
  flex-shrink: 0;
1892
1890
  }
1893
1891
 
1894
- ._headerActions_oes30_16 {
1892
+ ._headerActions_12piq_14 {
1895
1893
  display: flex;
1896
1894
  align-items: center;
1897
1895
  gap: 12px;
1898
1896
  }
1899
1897
 
1900
- ._searchInput_oes30_22 {
1898
+ ._searchInput_12piq_20 {
1901
1899
  width: 240px;
1902
1900
  }
1903
1901
 
1904
- ._modalTitle_oes30_26 {
1902
+ ._modalTitle_12piq_24 {
1905
1903
  font-size: 16px;
1906
1904
  font-weight: 600;
1907
1905
  color: var(--color-text-1);
1908
1906
  }
1909
1907
 
1910
- ._contentArea_oes30_32 {
1911
- overflow-y: auto;
1912
- overflow-x: hidden;
1913
- flex: 1;
1908
+ ._category_12piq_30 {
1909
+ padding-bottom: 32px;
1914
1910
  }
1915
-
1916
- ._category_oes30_38 {
1917
- margin-bottom: 32px;
1918
- }
1919
- ._category_oes30_38:first-child {
1911
+ ._category_12piq_30:first-child {
1920
1912
  margin-top: 0;
1921
1913
  }
1922
1914
 
1923
- ._categoryHeader_oes30_45 {
1915
+ ._categoryHeader_12piq_37 {
1924
1916
  padding: 12px 0;
1925
1917
  margin-bottom: 16px;
1926
1918
  font-size: 14px;
@@ -1931,7 +1923,7 @@ THEMES:
1931
1923
  border-bottom: 1px solid var(--color-border-2);
1932
1924
  }
1933
1925
 
1934
- ._gridContainer_oes30_56 {
1926
+ ._gridContainer_12piq_48 {
1935
1927
  display: grid;
1936
1928
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
1937
1929
  gap: 16px;
@@ -1940,7 +1932,16 @@ THEMES:
1940
1932
  padding: 0 20px;
1941
1933
  }
1942
1934
 
1943
- ._gridItem_oes30_65 {
1935
+ ._prebuiltBlockContainer_12piq_57 {
1936
+ display: grid;
1937
+ grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
1938
+ gap: 16px;
1939
+ width: 100%;
1940
+ box-sizing: border-box;
1941
+ padding: 0 20px;
1942
+ }
1943
+
1944
+ ._gridItem_12piq_66 {
1944
1945
  position: relative;
1945
1946
  display: flex;
1946
1947
  flex-direction: column;
@@ -1955,15 +1956,15 @@ THEMES:
1955
1956
  box-sizing: border-box;
1956
1957
  min-width: 0;
1957
1958
  }
1958
- ._gridItem_oes30_65:hover {
1959
+ ._gridItem_12piq_66:hover {
1959
1960
  border-color: rgb(var(--primary-3));
1960
1961
  background-color: var(--color-fill-1);
1961
1962
  }
1962
- ._gridItem_oes30_65._selected_oes30_84 {
1963
+ ._gridItem_12piq_66._selected_12piq_85 {
1963
1964
  border: 2px solid rgb(var(--primary-6));
1964
1965
  }
1965
1966
 
1966
- ._gridItemIcon_oes30_88 {
1967
+ ._gridItemIcon_12piq_89 {
1967
1968
  width: 48px;
1968
1969
  height: 48px;
1969
1970
  display: flex;
@@ -1973,27 +1974,27 @@ THEMES:
1973
1974
  flex-shrink: 0;
1974
1975
  position: relative;
1975
1976
  }
1976
- ._gridItemIcon_oes30_88 * {
1977
+ ._gridItemIcon_12piq_89 * {
1977
1978
  max-width: 48px !important;
1978
1979
  max-height: 48px !important;
1979
1980
  }
1980
- ._gridItemIcon_oes30_88 img {
1981
+ ._gridItemIcon_12piq_89 img {
1981
1982
  width: 100% !important;
1982
1983
  height: 100% !important;
1983
1984
  max-width: 48px !important;
1984
1985
  max-height: 48px !important;
1985
1986
  object-fit: contain !important;
1986
1987
  }
1987
- ._gridItemIcon_oes30_88 svg {
1988
+ ._gridItemIcon_12piq_89 svg {
1988
1989
  max-width: 48px !important;
1989
1990
  max-height: 48px !important;
1990
1991
  }
1991
- ._gridItemIcon_oes30_88 div {
1992
+ ._gridItemIcon_12piq_89 div {
1992
1993
  max-width: 48px !important;
1993
1994
  max-height: 48px !important;
1994
1995
  }
1995
1996
 
1996
- ._gridItemLabel_oes30_118 {
1997
+ ._gridItemLabel_12piq_119 {
1997
1998
  font-size: 13px;
1998
1999
  color: var(--color-text-1);
1999
2000
  text-align: center;
@@ -2001,7 +2002,7 @@ THEMES:
2001
2002
  line-height: 1.4;
2002
2003
  }
2003
2004
 
2004
- ._checkIcon_oes30_126 {
2005
+ ._checkIcon_12piq_127 {
2005
2006
  position: absolute;
2006
2007
  bottom: 0px;
2007
2008
  right: 0px;
@@ -2018,7 +2019,7 @@ THEMES:
2018
2019
  z-index: 1;
2019
2020
  }
2020
2021
 
2021
- ._emptyState_oes30_143 {
2022
+ ._emptyState_12piq_144 {
2022
2023
  display: flex;
2023
2024
  flex-direction: column;
2024
2025
  align-items: center;
@@ -2028,7 +2029,7 @@ THEMES:
2028
2029
  font-size: 14px;
2029
2030
  }
2030
2031
 
2031
- ._layoutPreview_oes30_153 {
2032
+ ._layoutPreview_12piq_154 {
2032
2033
  border-bottom: 1px solid var(--color-border-2);
2033
2034
  cursor: pointer;
2034
2035
  transition: all 0.2s ease;
@@ -2041,16 +2042,16 @@ THEMES:
2041
2042
  width: 100%;
2042
2043
  max-width: 100%;
2043
2044
  }
2044
- ._layoutPreview_oes30_153:hover {
2045
+ ._layoutPreview_12piq_154:hover {
2045
2046
  background-color: var(--color-fill-3);
2046
2047
  }
2047
- ._layoutPreview_oes30_153._layoutSelected_oes30_169 {
2048
+ ._layoutPreview_12piq_154._layoutSelected_12piq_170 {
2048
2049
  border: 1px solid rgb(var(--primary-6));
2049
2050
  background-color: rgba(var(--primary-1), 0.3);
2050
2051
  box-shadow: 0 2px 4px rgba(var(--primary-6), 0.1);
2051
2052
  }
2052
2053
 
2053
- ._layoutRowLabel_oes30_175 {
2054
+ ._layoutRowLabel_12piq_176 {
2054
2055
  font-size: 11px;
2055
2056
  color: var(--color-text-3);
2056
2057
  margin-top: 8px;
@@ -2058,7 +2059,7 @@ THEMES:
2058
2059
  font-weight: 500;
2059
2060
  }
2060
2061
 
2061
- ._layoutRow_oes30_175 {
2062
+ ._layoutRow_12piq_176 {
2062
2063
  height: 50px;
2063
2064
  display: flex;
2064
2065
  border: 1px solid var(--color-border-2);
@@ -2071,11 +2072,11 @@ THEMES:
2071
2072
  width: 100%;
2072
2073
  min-width: 0;
2073
2074
  }
2074
- ._layoutRow_oes30_175:last-child {
2075
+ ._layoutRow_12piq_176:last-child {
2075
2076
  margin-bottom: 0;
2076
2077
  }
2077
2078
 
2078
- ._layoutColumn_oes30_200 {
2079
+ ._layoutColumn_12piq_201 {
2079
2080
  height: 100%;
2080
2081
  display: flex;
2081
2082
  align-items: center;
@@ -2088,20 +2089,107 @@ THEMES:
2088
2089
  min-width: 0;
2089
2090
  flex-shrink: 1;
2090
2091
  }
2091
- ._layoutColumn_oes30_200:not(:last-child) {
2092
+ ._layoutColumn_12piq_201:not(:last-child) {
2092
2093
  border-right: 1px solid var(--color-border-2);
2093
2094
  }
2094
2095
 
2095
- ._layoutPreview_oes30_153._layoutSelected_oes30_169 ._layoutRow_oes30_175 {
2096
+ ._layoutPreview_12piq_154._layoutSelected_12piq_170 ._layoutRow_12piq_176 {
2096
2097
  border-color: rgba(var(--primary-6), 0.3);
2097
2098
  background-color: rgba(var(--primary-1), 0.1);
2098
2099
  }
2099
- ._layoutPreview_oes30_153._layoutSelected_oes30_169 ._layoutColumn_oes30_200 {
2100
+ ._layoutPreview_12piq_154._layoutSelected_12piq_170 ._layoutColumn_12piq_201 {
2100
2101
  color: rgb(var(--primary-6));
2101
2102
  font-weight: 600;
2102
2103
  }
2103
- ._layoutPreview_oes30_153._layoutSelected_oes30_169 ._layoutColumn_oes30_200:not(:last-child) {
2104
+ ._layoutPreview_12piq_154._layoutSelected_12piq_170 ._layoutColumn_12piq_201:not(:last-child) {
2104
2105
  border-right-color: rgba(var(--primary-6), 0.2);
2106
+ }.BlockSideBar-PrebuiltBlockList {
2107
+ --prebuilt-block-item-size: 120px;
2108
+ }
2109
+
2110
+ @media screen and (max-width: 1600px) {
2111
+ [data-compact=true].BlockSideBar-PrebuiltBlockList {
2112
+ --prebuilt-block-item-size: 100px;
2113
+ }
2114
+ }
2115
+ .prebuilt-block-filters {
2116
+ padding: 12px 20px;
2117
+ border-bottom: 1px solid var(--color-border, #e5e7eb);
2118
+ display: flex;
2119
+ gap: 12px;
2120
+ }
2121
+
2122
+ .prebuilt-block-search-input {
2123
+ flex: 1;
2124
+ min-width: 0;
2125
+ }
2126
+
2127
+ .prebuilt-block-category-select {
2128
+ flex-shrink: 0;
2129
+ width: 160px;
2130
+ }
2131
+
2132
+ .prebuilt-block-content {
2133
+ padding: 20px;
2134
+ }
2135
+
2136
+ .prebuilt-block-category {
2137
+ margin-bottom: 24px;
2138
+ }
2139
+ .prebuilt-block-category:last-child {
2140
+ margin-bottom: 0;
2141
+ }
2142
+
2143
+ .prebuilt-block-category-title {
2144
+ font-size: 14px;
2145
+ font-weight: 600;
2146
+ color: var(--color-text-1, #1d2129);
2147
+ margin-bottom: 12px;
2148
+ padding: 0 4px;
2149
+ }
2150
+
2151
+ .prebuilt-block-grid {
2152
+ display: flex;
2153
+ flex-direction: column;
2154
+ gap: 12px;
2155
+ }
2156
+
2157
+ .prebuilt-block-item {
2158
+ display: flex;
2159
+ cursor: grab;
2160
+ width: 100%;
2161
+ margin-bottom: 0px;
2162
+ box-shadow: rgba(55, 63, 71, 0.04) 0px 0px 0px 1px, rgba(55, 63, 71, 0.08) 0px 4px 4px 0px, rgba(55, 63, 71, 0.08) 0px 8px 24px 0px;
2163
+ border: 2px solid transparent;
2164
+ border-radius: 4px;
2165
+ box-sizing: border-box;
2166
+ background-color: #fff;
2167
+ position: relative;
2168
+ transition: all 0.2s;
2169
+ }
2170
+ .prebuilt-block-item:hover {
2171
+ box-shadow: 0px 0px 2px 2px rgb(var(--primary-4, #1890ff)) !important;
2172
+ transform: translateY(-2px);
2173
+ }
2174
+ .prebuilt-block-item .prebuilt-block-item-container {
2175
+ display: flex;
2176
+ width: 100%;
2177
+ padding: 0;
2178
+ }
2179
+ .prebuilt-block-item .prebuilt-block-thumbnail {
2180
+ width: 100%;
2181
+ overflow: hidden;
2182
+ border-radius: 4px;
2183
+ background-color: #f5f5f5;
2184
+ display: flex;
2185
+ align-items: center;
2186
+ justify-content: center;
2187
+ }
2188
+ .prebuilt-block-item .prebuilt-block-thumbnail img {
2189
+ width: 100%;
2190
+ height: 100%;
2191
+ object-fit: cover;
2192
+ display: block;
2105
2193
  }/*---------------------------------------------------------------------------------------------
2106
2194
  * Copyright (c) Microsoft Corporation. All rights reserved.
2107
2195
  * Licensed under the MIT License. See License.txt in the project root for license information.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import "./index.scss";
3
- export declare const BlockList: ({ tab }: {
4
- tab: "Default" | "Universal";
3
+ export declare const BlockList: ({ tab, }: {
4
+ tab: "Default" | "Universal" | "Prebuilt";
5
5
  }) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { Element } from "easy-email-pro-core";
2
+ import React from "react";
3
+ import "./PrebuiltBlockList.scss";
4
+ import { PrebuiltBlock } from "../../../typings";
5
+ export declare function PrebuiltBlockItem({ block, universalElementEditing, standaloneElementEditing, initialStandaloneElement, }: {
6
+ block: PrebuiltBlock;
7
+ universalElementEditing: boolean;
8
+ standaloneElementEditing: boolean;
9
+ initialStandaloneElement: Element | null;
10
+ }): React.JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ import "./PrebuiltBlockList.scss";
3
+ export declare const PrebuiltBlockList: () => React.JSX.Element;
@@ -90,14 +90,15 @@ export declare const SharedComponents: {
90
90
  maxHeight: string | number;
91
91
  children: import("react").ReactNode;
92
92
  }>;
93
- BlockList: ({ tab }: {
94
- tab: "Default" | "Universal";
93
+ BlockList: ({ tab, }: {
94
+ tab: "Default" | "Universal" | "Prebuilt";
95
95
  }) => import("react").JSX.Element;
96
96
  UniversalListItem: ({ element, thumbnail, }: {
97
97
  element: import("../easy-email-pro-core/lib/typings").Element;
98
98
  thumbnail: string;
99
99
  }) => import("react").JSX.Element;
100
100
  UniversalList: () => import("react").JSX.Element | null;
101
+ PrebuiltBlockList: () => import("react").JSX.Element;
101
102
  MergeTagComponent: import("react").FC<{
102
103
  onChange: (v: string) => void;
103
104
  value: string;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- export declare const ContextMenu: ({ position, }: {
2
+ export declare const ContextMenu: React.FC<{
3
3
  position: {
4
4
  top: number;
5
5
  left: number;
6
6
  };
7
- }) => React.ReactPortal;
7
+ }>;
@@ -1,5 +1,5 @@
1
1
  import { defaultAttributeFields } from "../components/ConfigurationPanel/components/AttributeField";
2
- import type { ContentWidgetElement, Element, ElementMap, ExtendedType, PageElement, PickObjectValueByKey, SectionWidgetElement } from "easy-email-pro-core";
2
+ import type { ContentWidgetElement, Element, ElementMap, ExtendedType, PageElement, PickObjectValueByKey, SectionWidgetElement, StandardSectionElement, StandardWrapperElement } from "easy-email-pro-core";
3
3
  import type { BasicEditorProps, BasicEmailTemplate, CustomSlateEditor, EmailEditorProps, EmailTemplate } from "easy-email-pro-editor";
4
4
  import React from "react";
5
5
  import { Path } from "slate";
@@ -92,11 +92,23 @@ export type Categories = Array<CategoryGridItem | CategoryMenuItem | {
92
92
  blocks: Array<React.ReactNode>;
93
93
  displayType: "custom";
94
94
  }>;
95
+ export interface PrebuiltBlock {
96
+ thumbnail: string;
97
+ title: string;
98
+ payload: StandardWrapperElement | StandardSectionElement;
99
+ category: string;
100
+ }
101
+ export interface PrebuiltBlockCategory {
102
+ get label(): string;
103
+ active?: boolean;
104
+ blocks: PrebuiltBlock[];
105
+ }
95
106
  export interface PluginsCustomEditorTypes {
96
107
  AttributeFieldsMap?: AttributeFieldsMap;
97
108
  EmailEditorProps: BasicEditorProps & {
98
109
  instanceRef?: React.MutableRefObject<EditorContextProps | null>;
99
110
  categories?: Categories;
111
+ prebuiltBlocks?: PrebuiltBlockCategory[];
100
112
  attributeFields?: AttributeFieldsMap;
101
113
  showSourceCode?: boolean;
102
114
  sourceCodeEditable?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-email-pro-theme",
3
- "version": "1.55.1",
3
+ "version": "1.56.1",
4
4
  "description": "",
5
5
  "files": [
6
6
  "lib"