@ivanholiak/easy-email-extensions 4.16.24 → 4.16.25

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.
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function Code(): React.JSX.Element;
@@ -18,6 +18,7 @@ import { Hero } from './Hero';
18
18
  import { Navbar } from './Navbar';
19
19
  import { Social } from './Social';
20
20
  import { Table } from './Table';
21
+ import { Code } from './Code';
21
22
  import { AdvancedTable } from './AdvancedTable';
22
23
  export declare const blocks: {
23
24
  page: typeof Page;
@@ -40,6 +41,7 @@ export declare const blocks: {
40
41
  navbar: typeof Navbar;
41
42
  social: typeof Social;
42
43
  table: typeof Table;
44
+ code: typeof Code;
43
45
  advanced_text: typeof Text;
44
46
  advanced_image: typeof Image;
45
47
  advanced_button: typeof Button;
@@ -50,6 +52,7 @@ export declare const blocks: {
50
52
  advanced_navbar: typeof Navbar;
51
53
  advanced_social: typeof Social;
52
54
  advanced_table: typeof AdvancedTable;
55
+ advanced_code: typeof Code;
53
56
  advanced_hero: typeof Hero;
54
57
  advanced_wrapper: typeof Wrapper;
55
58
  advanced_section: typeof Section;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function CodeBlockItem(): React.JSX.Element;
package/lib/index2.js CHANGED
@@ -40212,8 +40212,8 @@ const ShadowDom = (props) => {
40212
40212
  ref: setRef
40213
40213
  }), root2 && ReactDOM$1.createPortal(props.children, root2)));
40214
40214
  };
40215
- const CodeMirrorEditorPromise = import("./index3.js");
40216
- const CodeMirrorEditor = React__default.lazy(() => CodeMirrorEditorPromise);
40215
+ const CodeMirrorEditorPromise$1 = import("./index3.js");
40216
+ const CodeMirrorEditor$1 = React__default.lazy(() => CodeMirrorEditorPromise$1);
40217
40217
  const HtmlEditor = (props) => {
40218
40218
  const { visible, setVisible } = props;
40219
40219
  const { focusBlock: focusBlock2, setValueByIdx: setValueByIdx2 } = useBlock();
@@ -40282,7 +40282,7 @@ const HtmlEditor = (props) => {
40282
40282
  color: "#fff"
40283
40283
  }
40284
40284
  }, t("Editor Loading..."))
40285
- }, /* @__PURE__ */ React__default.createElement(CodeMirrorEditor, {
40285
+ }, /* @__PURE__ */ React__default.createElement(CodeMirrorEditor$1, {
40286
40286
  value: content,
40287
40287
  onChange: setContent
40288
40288
  }))), /* @__PURE__ */ React__default.createElement("div", {
@@ -41397,6 +41397,47 @@ function Table() {
41397
41397
  setVisible
41398
41398
  }));
41399
41399
  }
41400
+ const CodeMirrorEditorPromise = import("./index3.js");
41401
+ const CodeMirrorEditor = React__default.lazy(() => CodeMirrorEditorPromise);
41402
+ function Code() {
41403
+ const { focusBlock: focusBlock2, setValueByIdx: setValueByIdx2 } = useBlock();
41404
+ const { focusIdx: focusIdx2 } = useFocusIdx();
41405
+ const content = (focusBlock2 == null ? void 0 : focusBlock2.data.value.content) || "";
41406
+ const onChangeContent = (val) => {
41407
+ if (!focusBlock2)
41408
+ return;
41409
+ focusBlock2.data.value.content = val;
41410
+ setValueByIdx2(focusIdx2, __spreadValues({}, focusBlock2));
41411
+ };
41412
+ return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(CollapseWrapper, {
41413
+ defaultActiveKey: ["0", "1", "2"]
41414
+ }, /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
41415
+ name: "0",
41416
+ header: t("Code content")
41417
+ }, /* @__PURE__ */ React__default.createElement(Suspense, {
41418
+ fallback: /* @__PURE__ */ React__default.createElement("div", null, t("Loading..."))
41419
+ }, /* @__PURE__ */ React__default.createElement(CodeMirrorEditor, {
41420
+ value: content,
41421
+ onChange: onChangeContent
41422
+ }))), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
41423
+ name: "1",
41424
+ header: t("Dimension")
41425
+ }, /* @__PURE__ */ React__default.createElement(Space$1, {
41426
+ direction: "vertical"
41427
+ }, /* @__PURE__ */ React__default.createElement(Padding, {
41428
+ showResetAll: true
41429
+ }))), /* @__PURE__ */ React__default.createElement(Collapse$1.Item, {
41430
+ name: "2",
41431
+ header: t("Color")
41432
+ }, /* @__PURE__ */ React__default.createElement(Grid$1.Row, null, /* @__PURE__ */ React__default.createElement(Grid$1.Col, {
41433
+ span: 11
41434
+ }, /* @__PURE__ */ React__default.createElement(Color, null)), /* @__PURE__ */ React__default.createElement(Grid$1.Col, {
41435
+ offset: 1,
41436
+ span: 11
41437
+ }, /* @__PURE__ */ React__default.createElement(ContainerBackgroundColor, {
41438
+ title: t("Background color")
41439
+ }))))));
41440
+ }
41400
41441
  function AdvancedTable() {
41401
41442
  const { focusIdx: focusIdx2 } = useFocusIdx();
41402
41443
  return /* @__PURE__ */ React__default.createElement(AttributesPanelWrapper, null, /* @__PURE__ */ React__default.createElement(CollapseWrapper, {
@@ -41452,6 +41493,7 @@ const blocks = {
41452
41493
  [BasicType.NAVBAR]: Navbar,
41453
41494
  [BasicType.SOCIAL]: Social,
41454
41495
  [BasicType.TABLE]: Table,
41496
+ [BasicType.CODE]: Code,
41455
41497
  [AdvancedType.TEXT]: Text,
41456
41498
  [AdvancedType.IMAGE]: Image$1,
41457
41499
  [AdvancedType.BUTTON]: Button,
@@ -41462,6 +41504,7 @@ const blocks = {
41462
41504
  [AdvancedType.NAVBAR]: Navbar,
41463
41505
  [AdvancedType.SOCIAL]: Social,
41464
41506
  [AdvancedType.TABLE]: AdvancedTable,
41507
+ [AdvancedType.CODE]: Code,
41465
41508
  [AdvancedType.HERO]: Hero,
41466
41509
  [AdvancedType.WRAPPER]: Wrapper,
41467
41510
  [AdvancedType.SECTION]: Section,
@@ -57185,6 +57228,36 @@ function SocialBlockItem() {
57185
57228
  })));
57186
57229
  })));
57187
57230
  }
57231
+ function CodeBlockItem() {
57232
+ return /* @__PURE__ */ React__default.createElement(Stack$4.Item, {
57233
+ fill: true
57234
+ }, /* @__PURE__ */ React__default.createElement(Stack$4, {
57235
+ vertical: true
57236
+ }, /* @__PURE__ */ React__default.createElement(Stack$4.Item, {
57237
+ fill: true
57238
+ }, /* @__PURE__ */ React__default.createElement(BlockMaskWrapper, {
57239
+ type: AdvancedType.CODE,
57240
+ payload: {
57241
+ data: {
57242
+ value: {
57243
+ content: "const greet = (name) => {\n console.log(`Hello, ${name}!`);\n};\ngreet('World');"
57244
+ }
57245
+ }
57246
+ }
57247
+ }, /* @__PURE__ */ React__default.createElement("div", {
57248
+ style: {
57249
+ backgroundColor: "#f4f4f4",
57250
+ borderRadius: 4,
57251
+ padding: "12px 16px",
57252
+ fontFamily: "'Courier New', Courier, monospace",
57253
+ fontSize: 12,
57254
+ lineHeight: 1.5,
57255
+ whiteSpace: "pre-wrap",
57256
+ wordWrap: "break-word",
57257
+ color: "#333"
57258
+ }
57259
+ }, "const greet = (name) => {\n console.log(`Hello, ${name}!`);\n};")))));
57260
+ }
57188
57261
  function WrapperBlockItem() {
57189
57262
  return /* @__PURE__ */ React__default.createElement(Stack$4.Item, {
57190
57263
  fill: true
@@ -58077,6 +58150,16 @@ const defaultCategories$1 = [
58077
58150
  );
58078
58151
  },
58079
58152
  component: SocialBlockItem
58153
+ },
58154
+ {
58155
+ type: AdvancedType.CODE,
58156
+ get title() {
58157
+ return t("Code");
58158
+ },
58159
+ get description() {
58160
+ return t("Displays a formatted code snippet in your email.");
58161
+ },
58162
+ component: CodeBlockItem
58080
58163
  }
58081
58164
  ]
58082
58165
  },