@react-email/editor 0.0.0-experimental.11 → 0.0.0-experimental.13

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.
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
15
19
  }
16
20
  return to;
17
21
  };
@@ -21,39 +25,30 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
25
  }) : target, mod));
22
26
 
23
27
  //#endregion
24
- let __tiptap_core = require("@tiptap/core");
25
- __tiptap_core = __toESM(__tiptap_core);
26
- let __tiptap_starter_kit = require("@tiptap/starter-kit");
27
- __tiptap_starter_kit = __toESM(__tiptap_starter_kit);
28
+ let _tiptap_core = require("@tiptap/core");
29
+ let _tiptap_starter_kit = require("@tiptap/starter-kit");
28
30
  let react_jsx_runtime = require("react/jsx-runtime");
29
- react_jsx_runtime = __toESM(react_jsx_runtime);
30
- let __react_email_components = require("@react-email/components");
31
- __react_email_components = __toESM(__react_email_components);
32
- let __tiptap_extension_code_block = require("@tiptap/extension-code-block");
33
- __tiptap_extension_code_block = __toESM(__tiptap_extension_code_block);
34
- let __tiptap_pm_state = require("@tiptap/pm/state");
35
- __tiptap_pm_state = __toESM(__tiptap_pm_state);
36
- let __tiptap_pm_view = require("@tiptap/pm/view");
37
- __tiptap_pm_view = __toESM(__tiptap_pm_view);
31
+ let _react_email_components = require("@react-email/components");
32
+ _react_email_components = __toESM(_react_email_components);
33
+ let _tiptap_extension_code_block = require("@tiptap/extension-code-block");
34
+ _tiptap_extension_code_block = __toESM(_tiptap_extension_code_block);
35
+ let _tiptap_pm_state = require("@tiptap/pm/state");
36
+ let _tiptap_pm_view = require("@tiptap/pm/view");
38
37
  let hast_util_from_html = require("hast-util-from-html");
39
- hast_util_from_html = __toESM(hast_util_from_html);
40
38
  let prismjs = require("prismjs");
41
39
  prismjs = __toESM(prismjs);
42
- let __tiptap_extension_placeholder = require("@tiptap/extension-placeholder");
43
- __tiptap_extension_placeholder = __toESM(__tiptap_extension_placeholder);
44
- let __tiptap_react = require("@tiptap/react");
45
- __tiptap_react = __toESM(__tiptap_react);
40
+ let _tiptap_extension_placeholder = require("@tiptap/extension-placeholder");
41
+ _tiptap_extension_placeholder = __toESM(_tiptap_extension_placeholder);
42
+ let _tiptap_react = require("@tiptap/react");
46
43
  let lucide_react = require("lucide-react");
47
- lucide_react = __toESM(lucide_react);
48
44
  let react = require("react");
49
45
  react = __toESM(react);
50
- let __radix_ui_react_popover = require("@radix-ui/react-popover");
51
- __radix_ui_react_popover = __toESM(__radix_ui_react_popover);
52
- let __tiptap_react_menus = require("@tiptap/react/menus");
53
- __tiptap_react_menus = __toESM(__tiptap_react_menus);
46
+ let _radix_ui_react_popover = require("@radix-ui/react-popover");
47
+ _radix_ui_react_popover = __toESM(_radix_ui_react_popover);
48
+ let _tiptap_react_menus = require("@tiptap/react/menus");
54
49
 
55
50
  //#region src/core/email-node.ts
56
- var EmailNode = class EmailNode extends __tiptap_core.Node {
51
+ var EmailNode = class EmailNode extends _tiptap_core.Node {
57
52
  constructor(config) {
58
53
  super(config);
59
54
  }
@@ -126,7 +121,7 @@ const editorEventBus = new EditorEventBus();
126
121
 
127
122
  //#endregion
128
123
  //#region src/extensions/alignment-attribute.tsx
129
- const AlignmentAttribute = __tiptap_core.Extension.create({
124
+ const AlignmentAttribute = _tiptap_core.Extension.create({
130
125
  name: "alignmentAttribute",
131
126
  addOptions() {
132
127
  return {
@@ -454,7 +449,7 @@ const Body = EmailNode.create({
454
449
  renderHTML({ HTMLAttributes }) {
455
450
  return [
456
451
  "div",
457
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
452
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
458
453
  0
459
454
  ];
460
455
  },
@@ -493,7 +488,7 @@ const underscorePasteRegex = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g;
493
488
  * This extension allows you to mark text as bold.
494
489
  * @see https://tiptap.dev/api/marks/bold
495
490
  */
496
- const Bold = __tiptap_core.Mark.create({
491
+ const Bold = _tiptap_core.Mark.create({
497
492
  name: "bold",
498
493
  addOptions() {
499
494
  return { HTMLAttributes: {} };
@@ -514,7 +509,7 @@ const Bold = __tiptap_core.Mark.create({
514
509
  renderHTML({ HTMLAttributes }) {
515
510
  return [
516
511
  "strong",
517
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
512
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
518
513
  0
519
514
  ];
520
515
  },
@@ -538,19 +533,19 @@ const Bold = __tiptap_core.Mark.create({
538
533
  };
539
534
  },
540
535
  addInputRules() {
541
- return [(0, __tiptap_core.markInputRule)({
536
+ return [(0, _tiptap_core.markInputRule)({
542
537
  find: starInputRegex,
543
538
  type: this.type
544
- }), (0, __tiptap_core.markInputRule)({
539
+ }), (0, _tiptap_core.markInputRule)({
545
540
  find: underscoreInputRegex,
546
541
  type: this.type
547
542
  })];
548
543
  },
549
544
  addPasteRules() {
550
- return [(0, __tiptap_core.markPasteRule)({
545
+ return [(0, _tiptap_core.markPasteRule)({
551
546
  find: starPasteRegex,
552
547
  type: this.type
553
- }), (0, __tiptap_core.markPasteRule)({
548
+ }), (0, _tiptap_core.markPasteRule)({
554
549
  find: underscorePasteRegex,
555
550
  type: this.type
556
551
  })];
@@ -590,10 +585,10 @@ const Button = EmailNode.create({
590
585
  renderHTML({ HTMLAttributes }) {
591
586
  return [
592
587
  "div",
593
- (0, __tiptap_core.mergeAttributes)({ class: `align-${HTMLAttributes?.alignment}` }),
588
+ (0, _tiptap_core.mergeAttributes)({ class: `align-${HTMLAttributes?.alignment}` }),
594
589
  [
595
590
  "a",
596
- (0, __tiptap_core.mergeAttributes)({
591
+ (0, _tiptap_core.mergeAttributes)({
597
592
  class: `node-button ${HTMLAttributes?.class}`,
598
593
  style: HTMLAttributes?.style,
599
594
  "data-id": "react-email-button",
@@ -621,9 +616,9 @@ const Button = EmailNode.create({
621
616
  },
622
617
  renderToReactEmail({ children, node, style }) {
623
618
  const inlineStyles = inlineCssToJs(node.attrs?.style);
624
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Row, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Column, {
619
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Row, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Column, {
625
620
  align: node.attrs?.align || node.attrs?.alignment,
626
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Button, {
621
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Button, {
627
622
  className: node.attrs?.class || void 0,
628
623
  href: node.attrs?.href,
629
624
  style: {
@@ -638,7 +633,7 @@ const Button = EmailNode.create({
638
633
 
639
634
  //#endregion
640
635
  //#region src/extensions/class-attribute.tsx
641
- const ClassAttribute = __tiptap_core.Extension.create({
636
+ const ClassAttribute = _tiptap_core.Extension.create({
642
637
  name: "classAttribute",
643
638
  addOptions() {
644
639
  return {
@@ -720,7 +715,7 @@ function registeredLang(aliasOrLanguage) {
720
715
  }
721
716
  function getDecorations({ doc, name, defaultLanguage, defaultTheme, loadingLanguages, onLanguageLoaded }) {
722
717
  const decorations = [];
723
- (0, __tiptap_core.findChildren)(doc, (node) => node.type.name === name).forEach((block) => {
718
+ (0, _tiptap_core.findChildren)(doc, (node) => node.type.name === name).forEach((block) => {
724
719
  let from = block.pos + 1;
725
720
  const language = block.node.attrs.language || defaultLanguage;
726
721
  const theme = block.node.attrs.theme || defaultTheme;
@@ -743,13 +738,13 @@ function getDecorations({ doc, name, defaultLanguage, defaultTheme, loadingLangu
743
738
  parseNodes(getHighlightNodes(html)).forEach((node) => {
744
739
  const to = from + node.text.length;
745
740
  if (node.classes.length) {
746
- const decoration = __tiptap_pm_view.Decoration.inline(from, to, { class: node.classes.join(" ") });
741
+ const decoration = _tiptap_pm_view.Decoration.inline(from, to, { class: node.classes.join(" ") });
747
742
  decorations.push(decoration);
748
743
  }
749
744
  from = to;
750
745
  });
751
746
  });
752
- return __tiptap_pm_view.DecorationSet.create(doc, decorations);
747
+ return _tiptap_pm_view.DecorationSet.create(doc, decorations);
753
748
  }
754
749
  function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
755
750
  if (!defaultLanguage) throw Error("You must specify the defaultLanguage parameter");
@@ -758,8 +753,8 @@ function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
758
753
  const onLanguageLoaded = (language) => {
759
754
  if (pluginView) pluginView.dispatch(pluginView.state.tr.setMeta(PRISM_LANGUAGE_LOADED_META, language));
760
755
  };
761
- const prismjsPlugin = new __tiptap_pm_state.Plugin({
762
- key: new __tiptap_pm_state.PluginKey("prism"),
756
+ const prismjsPlugin = new _tiptap_pm_state.Plugin({
757
+ key: new _tiptap_pm_state.PluginKey("prism"),
763
758
  view(view) {
764
759
  pluginView = view;
765
760
  return { destroy() {
@@ -780,8 +775,8 @@ function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
780
775
  apply: (transaction, decorationSet, oldState, newState) => {
781
776
  const oldNodeName = oldState.selection.$head.parent.type.name;
782
777
  const newNodeName = newState.selection.$head.parent.type.name;
783
- const oldNodes = (0, __tiptap_core.findChildren)(oldState.doc, (node) => node.type.name === name);
784
- const newNodes = (0, __tiptap_core.findChildren)(newState.doc, (node) => node.type.name === name);
778
+ const oldNodes = (0, _tiptap_core.findChildren)(oldState.doc, (node) => node.type.name === name);
779
+ const newNodes = (0, _tiptap_core.findChildren)(newState.doc, (node) => node.type.name === name);
785
780
  if (transaction.getMeta(PRISM_LANGUAGE_LOADED_META) || transaction.docChanged && ([oldNodeName, newNodeName].includes(name) || newNodes.length !== oldNodes.length || transaction.steps.some((step) => {
786
781
  const rangeStep = step;
787
782
  return rangeStep.from !== void 0 && rangeStep.to !== void 0 && oldNodes.some((node) => {
@@ -811,7 +806,7 @@ function PrismPlugin({ name, defaultLanguage, defaultTheme }) {
811
806
 
812
807
  //#endregion
813
808
  //#region src/extensions/code-block.tsx
814
- const CodeBlockPrism = EmailNode.from(__tiptap_extension_code_block.default.extend({
809
+ const CodeBlockPrism = EmailNode.from(_tiptap_extension_code_block.default.extend({
815
810
  addOptions() {
816
811
  return {
817
812
  languageClassPrefix: "language-",
@@ -848,7 +843,7 @@ const CodeBlockPrism = EmailNode.from(__tiptap_extension_code_block.default.exte
848
843
  renderHTML({ node, HTMLAttributes }) {
849
844
  return [
850
845
  "pre",
851
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { class: node.attrs.language ? `${this.options.languageClassPrefix}${node.attrs.language}` : null }, { "data-theme": node.attrs.theme }),
846
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { class: node.attrs.language ? `${this.options.languageClassPrefix}${node.attrs.language}` : null }, { "data-theme": node.attrs.theme }),
852
847
  [
853
848
  "code",
854
849
  { class: node.attrs.language ? `${this.options.languageClassPrefix}${node.attrs.language} node-codeTag` : "node-codeTag" },
@@ -867,7 +862,7 @@ const CodeBlockPrism = EmailNode.from(__tiptap_extension_code_block.default.exte
867
862
  const blockStart = $from.start(depth);
868
863
  const blockEnd = $from.end(depth);
869
864
  if (selection.from === blockStart && selection.to === blockEnd) return false;
870
- const tr = state.tr.setSelection(__tiptap_pm_state.TextSelection.create(state.doc, blockStart, blockEnd));
865
+ const tr = state.tr.setSelection(_tiptap_pm_state.TextSelection.create(state.doc, blockStart, blockEnd));
871
866
  editor.view.dispatch(tr);
872
867
  return true;
873
868
  }
@@ -884,7 +879,7 @@ const CodeBlockPrism = EmailNode.from(__tiptap_extension_code_block.default.exte
884
879
  }
885
880
  }), ({ node, style }) => {
886
881
  const language = node.attrs?.language ? `${node.attrs.language}` : "javascript";
887
- const userTheme = __react_email_components[node.attrs?.theme];
882
+ const userTheme = _react_email_components[node.attrs?.theme];
888
883
  const theme = userTheme ? {
889
884
  ...userTheme,
890
885
  base: {
@@ -900,7 +895,7 @@ const CodeBlockPrism = EmailNode.from(__tiptap_extension_code_block.default.exte
900
895
  padding: "0.75rem 1rem",
901
896
  borderRadius: "0.125rem"
902
897
  } };
903
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.CodeBlock, {
898
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.CodeBlock, {
904
899
  code: node.content?.[0]?.text ?? "",
905
900
  language,
906
901
  theme,
@@ -936,7 +931,7 @@ const Div = EmailNode.create({
936
931
  renderHTML({ HTMLAttributes }) {
937
932
  return [
938
933
  "div",
939
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
934
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
940
935
  0
941
936
  ];
942
937
  },
@@ -958,7 +953,7 @@ const Div = EmailNode.create({
958
953
 
959
954
  //#endregion
960
955
  //#region src/extensions/max-nesting.ts
961
- const MaxNesting = __tiptap_core.Extension.create({
956
+ const MaxNesting = _tiptap_core.Extension.create({
962
957
  name: "maxNesting",
963
958
  addOptions() {
964
959
  return {
@@ -969,8 +964,8 @@ const MaxNesting = __tiptap_core.Extension.create({
969
964
  addProseMirrorPlugins() {
970
965
  const { maxDepth, nodeTypes } = this.options;
971
966
  if (typeof maxDepth !== "number" || maxDepth < 1) throw new Error("maxDepth must be a positive number");
972
- return [new __tiptap_pm_state.Plugin({
973
- key: new __tiptap_pm_state.PluginKey("maxNesting"),
967
+ return [new _tiptap_pm_state.Plugin({
968
+ key: new _tiptap_pm_state.PluginKey("maxNesting"),
974
969
  appendTransaction(transactions, _oldState, newState) {
975
970
  if (!transactions.some((tr$1) => tr$1.docChanged)) return null;
976
971
  const rangesToLift = [];
@@ -1033,7 +1028,7 @@ const MaxNesting = __tiptap_core.Extension.create({
1033
1028
 
1034
1029
  //#endregion
1035
1030
  //#region src/extensions/placeholder.ts
1036
- const Placeholder = __tiptap_extension_placeholder.default.configure({
1031
+ const Placeholder = _tiptap_extension_placeholder.default.configure({
1037
1032
  placeholder: ({ node }) => {
1038
1033
  if (node.type.name === "heading") return `Heading ${node.attrs.level}`;
1039
1034
  return "Press '/' for commands";
@@ -1043,7 +1038,7 @@ const Placeholder = __tiptap_extension_placeholder.default.configure({
1043
1038
 
1044
1039
  //#endregion
1045
1040
  //#region src/extensions/preserved-style.ts
1046
- const PreservedStyle = __tiptap_core.Mark.create({
1041
+ const PreservedStyle = _tiptap_core.Mark.create({
1047
1042
  name: "preservedStyle",
1048
1043
  addAttributes() {
1049
1044
  return { style: {
@@ -1069,7 +1064,7 @@ const PreservedStyle = __tiptap_core.Mark.create({
1069
1064
  renderHTML({ HTMLAttributes }) {
1070
1065
  return [
1071
1066
  "span",
1072
- (0, __tiptap_core.mergeAttributes)(HTMLAttributes),
1067
+ (0, _tiptap_core.mergeAttributes)(HTMLAttributes),
1073
1068
  0
1074
1069
  ];
1075
1070
  }
@@ -1117,7 +1112,7 @@ function processStylesForUnlink(styleString) {
1117
1112
 
1118
1113
  //#endregion
1119
1114
  //#region src/extensions/preview-text.ts
1120
- const PreviewText = __tiptap_core.Node.create({
1115
+ const PreviewText = _tiptap_core.Node.create({
1121
1116
  name: "previewText",
1122
1117
  group: "block",
1123
1118
  selectable: false,
@@ -1181,7 +1176,7 @@ const Section = EmailNode.create({
1181
1176
  renderHTML({ HTMLAttributes }) {
1182
1177
  return [
1183
1178
  "section",
1184
- (0, __tiptap_core.mergeAttributes)({
1179
+ (0, _tiptap_core.mergeAttributes)({
1185
1180
  "data-type": "section",
1186
1181
  class: "node-section"
1187
1182
  }, HTMLAttributes),
@@ -1202,7 +1197,7 @@ const Section = EmailNode.create({
1202
1197
  renderToReactEmail({ children, node, style }) {
1203
1198
  const inlineStyles = inlineCssToJs(node.attrs?.style);
1204
1199
  const textAlign = node.attrs?.align || node.attrs?.alignment;
1205
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Section, {
1200
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
1206
1201
  className: node.attrs?.class || void 0,
1207
1202
  align: textAlign,
1208
1203
  style: {
@@ -1217,7 +1212,7 @@ const Section = EmailNode.create({
1217
1212
 
1218
1213
  //#endregion
1219
1214
  //#region src/extensions/style-attribute.tsx
1220
- const StyleAttribute = __tiptap_core.Extension.create({
1215
+ const StyleAttribute = _tiptap_core.Extension.create({
1221
1216
  name: "styleAttribute",
1222
1217
  priority: 101,
1223
1218
  addOptions() {
@@ -1269,7 +1264,7 @@ const StyleAttribute = __tiptap_core.Extension.create({
1269
1264
  * This extension allows you to mark text as superscript.
1270
1265
  * @see https://tiptap.dev/api/marks/superscript
1271
1266
  */
1272
- const Sup = __tiptap_core.Mark.create({
1267
+ const Sup = _tiptap_core.Mark.create({
1273
1268
  name: "sup",
1274
1269
  addOptions() {
1275
1270
  return { HTMLAttributes: {} };
@@ -1280,7 +1275,7 @@ const Sup = __tiptap_core.Mark.create({
1280
1275
  renderHTML({ HTMLAttributes }) {
1281
1276
  return [
1282
1277
  "sup",
1283
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
1278
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
1284
1279
  0
1285
1280
  ];
1286
1281
  },
@@ -1331,7 +1326,7 @@ const Table = EmailNode.create({
1331
1326
  renderHTML({ HTMLAttributes }) {
1332
1327
  return [
1333
1328
  "table",
1334
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
1329
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes),
1335
1330
  [
1336
1331
  "tbody",
1337
1332
  {},
@@ -1347,7 +1342,7 @@ const Table = EmailNode.create({
1347
1342
  marginLeft: "auto",
1348
1343
  marginRight: "auto"
1349
1344
  } : {};
1350
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Section, {
1345
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
1351
1346
  className: node.attrs?.class || void 0,
1352
1347
  align: alignment,
1353
1348
  style: resolveConflictingStyles(style, {
@@ -1438,7 +1433,7 @@ const TableCell = EmailNode.create({
1438
1433
  },
1439
1434
  renderToReactEmail({ children, node, style }) {
1440
1435
  const inlineStyles = inlineCssToJs(node.attrs?.style);
1441
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Column, {
1436
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Column, {
1442
1437
  className: node.attrs?.class || void 0,
1443
1438
  align: node.attrs?.align || node.attrs?.alignment,
1444
1439
  style: {
@@ -1449,7 +1444,7 @@ const TableCell = EmailNode.create({
1449
1444
  });
1450
1445
  }
1451
1446
  });
1452
- const TableHeader = __tiptap_core.Node.create({
1447
+ const TableHeader = _tiptap_core.Node.create({
1453
1448
  name: "tableHeader",
1454
1449
  group: "tableCell",
1455
1450
  content: "block+",
@@ -1487,7 +1482,7 @@ const TableHeader = __tiptap_core.Node.create({
1487
1482
 
1488
1483
  //#endregion
1489
1484
  //#region src/extensions/uppercase.ts
1490
- const Uppercase = __tiptap_core.Mark.create({
1485
+ const Uppercase = _tiptap_core.Mark.create({
1491
1486
  name: "uppercase",
1492
1487
  addOptions() {
1493
1488
  return { HTMLAttributes: {} };
@@ -1504,7 +1499,7 @@ const Uppercase = __tiptap_core.Mark.create({
1504
1499
  renderHTML({ HTMLAttributes }) {
1505
1500
  return [
1506
1501
  "span",
1507
- (0, __tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { style: "text-transform: uppercase" }),
1502
+ (0, _tiptap_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes, { style: "text-transform: uppercase" }),
1508
1503
  0
1509
1504
  ];
1510
1505
  },
@@ -1579,7 +1574,7 @@ function createColumnsNode(config, includeCommands) {
1579
1574
  renderHTML({ HTMLAttributes }) {
1580
1575
  return [
1581
1576
  "div",
1582
- (0, __tiptap_core.mergeAttributes)({
1577
+ (0, _tiptap_core.mergeAttributes)({
1583
1578
  "data-type": config.dataType,
1584
1579
  class: "node-columns"
1585
1580
  }, HTMLAttributes),
@@ -1605,7 +1600,7 @@ function createColumnsNode(config, includeCommands) {
1605
1600
  } },
1606
1601
  renderToReactEmail({ children, node, style }) {
1607
1602
  const inlineStyles = inlineCssToJs(node.attrs?.style);
1608
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Row, {
1603
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Row, {
1609
1604
  className: node.attrs?.class || void 0,
1610
1605
  style: {
1611
1606
  ...style,
@@ -1633,7 +1628,7 @@ const ColumnsColumn = EmailNode.create({
1633
1628
  renderHTML({ HTMLAttributes }) {
1634
1629
  return [
1635
1630
  "div",
1636
- (0, __tiptap_core.mergeAttributes)({
1631
+ (0, _tiptap_core.mergeAttributes)({
1637
1632
  "data-type": "column",
1638
1633
  class: "node-column"
1639
1634
  }, HTMLAttributes),
@@ -1671,7 +1666,7 @@ const ColumnsColumn = EmailNode.create({
1671
1666
  const columnEnd = $from.end(d);
1672
1667
  const { from, to } = state.selection;
1673
1668
  if (from === columnStart && to === columnEnd) return false;
1674
- editor.view.dispatch(state.tr.setSelection(__tiptap_pm_state.TextSelection.create(state.doc, columnStart, columnEnd)));
1669
+ editor.view.dispatch(state.tr.setSelection(_tiptap_pm_state.TextSelection.create(state.doc, columnStart, columnEnd)));
1675
1670
  return true;
1676
1671
  }
1677
1672
  return false;
@@ -1681,7 +1676,7 @@ const ColumnsColumn = EmailNode.create({
1681
1676
  renderToReactEmail({ children, node, style }) {
1682
1677
  const inlineStyles = inlineCssToJs(node.attrs?.style);
1683
1678
  const width = node.attrs?.width;
1684
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_email_components.Column, {
1679
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Column, {
1685
1680
  className: node.attrs?.class || void 0,
1686
1681
  style: {
1687
1682
  ...style,
@@ -1696,7 +1691,7 @@ const ColumnsColumn = EmailNode.create({
1696
1691
  //#endregion
1697
1692
  //#region src/extensions/index.ts
1698
1693
  const coreExtensions = [
1699
- __tiptap_starter_kit.StarterKit.configure({
1694
+ _tiptap_starter_kit.StarterKit.configure({
1700
1695
  undoRedo: false,
1701
1696
  heading: false,
1702
1697
  link: false,
@@ -1842,7 +1837,7 @@ function useBubbleMenuContext() {
1842
1837
 
1843
1838
  //#endregion
1844
1839
  //#region src/ui/bubble-menu/item.tsx
1845
- function BubbleMenuItem({ name, isActive, onCommand, className, children,...rest }) {
1840
+ function BubbleMenuItem({ name, isActive, onCommand, className, children, ...rest }) {
1846
1841
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1847
1842
  type: "button",
1848
1843
  "aria-label": name,
@@ -1864,7 +1859,7 @@ function BubbleMenuAlignCenter({ className, children }) {
1864
1859
  const { editor } = useBubbleMenuContext();
1865
1860
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1866
1861
  name: "align-center",
1867
- isActive: (0, __tiptap_react.useEditorState)({
1862
+ isActive: (0, _tiptap_react.useEditorState)({
1868
1863
  editor,
1869
1864
  selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "center" }) ?? false
1870
1865
  }),
@@ -1880,7 +1875,7 @@ function BubbleMenuAlignLeft({ className, children }) {
1880
1875
  const { editor } = useBubbleMenuContext();
1881
1876
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1882
1877
  name: "align-left",
1883
- isActive: (0, __tiptap_react.useEditorState)({
1878
+ isActive: (0, _tiptap_react.useEditorState)({
1884
1879
  editor,
1885
1880
  selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "left" }) ?? false
1886
1881
  }),
@@ -1896,7 +1891,7 @@ function BubbleMenuAlignRight({ className, children }) {
1896
1891
  const { editor } = useBubbleMenuContext();
1897
1892
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BubbleMenuItem, {
1898
1893
  name: "align-right",
1899
- isActive: (0, __tiptap_react.useEditorState)({
1894
+ isActive: (0, _tiptap_react.useEditorState)({
1900
1895
  editor,
1901
1896
  selector: ({ editor: editor$1 }) => editor$1?.isActive({ alignment: "right" }) ?? false
1902
1897
  }),
@@ -1911,7 +1906,7 @@ function BubbleMenuAlignRight({ className, children }) {
1911
1906
  function createMarkBubbleItem(config) {
1912
1907
  function MarkBubbleItem({ className, children }) {
1913
1908
  const { editor } = useBubbleMenuContext();
1914
- const isActive = (0, __tiptap_react.useEditorState)({
1909
+ const isActive = (0, _tiptap_react.useEditorState)({
1915
1910
  editor,
1916
1911
  selector: ({ editor: editor$1 }) => {
1917
1912
  if (config.activeParams) return editor$1?.isActive(config.activeName, config.activeParams) ?? false;
@@ -2029,7 +2024,7 @@ function BubbleMenuLinkSelector({ className, showToggle = true, validateUrl, onL
2029
2024
  if (!isControlled) setUncontrolledOpen(value);
2030
2025
  onOpenChange?.(value);
2031
2026
  }, [isControlled, onOpenChange]);
2032
- const editorState = (0, __tiptap_react.useEditorState)({
2027
+ const editorState = (0, _tiptap_react.useEditorState)({
2033
2028
  editor,
2034
2029
  selector: ({ editor: editor$1 }) => ({
2035
2030
  isLinkActive: editor$1?.isActive("link") ?? false,
@@ -2195,7 +2190,7 @@ function NodeSelectorRoot({ omit = [], open: controlledOpen, onOpenChange, class
2195
2190
  if (!isControlled) setUncontrolledOpen(value);
2196
2191
  onOpenChange?.(value);
2197
2192
  }, [isControlled, onOpenChange]);
2198
- const editorState = (0, __tiptap_react.useEditorState)({
2193
+ const editorState = (0, _tiptap_react.useEditorState)({
2199
2194
  editor,
2200
2195
  selector: ({ editor: editor$1 }) => ({
2201
2196
  isParagraphActive: (editor$1?.isActive("paragraph") ?? false) && !editor$1?.isActive("bulletList") && !editor$1?.isActive("orderedList"),
@@ -2274,7 +2269,7 @@ function NodeSelectorRoot({ omit = [], open: controlledOpen, onOpenChange, class
2274
2269
  if (!editorState || items.length === 0) return null;
2275
2270
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NodeSelectorContext.Provider, {
2276
2271
  value: contextValue,
2277
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_popover.Root, {
2272
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Root, {
2278
2273
  open: isOpen,
2279
2274
  onOpenChange: setIsOpen,
2280
2275
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -2288,7 +2283,7 @@ function NodeSelectorRoot({ omit = [], open: controlledOpen, onOpenChange, class
2288
2283
  }
2289
2284
  function NodeSelectorTrigger({ className, children }) {
2290
2285
  const { activeItem, isOpen, setIsOpen } = useNodeSelectorContext();
2291
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_popover.Trigger, {
2286
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Trigger, {
2292
2287
  "data-re-node-selector-trigger": "",
2293
2288
  className,
2294
2289
  onClick: () => setIsOpen(!isOpen),
@@ -2297,7 +2292,7 @@ function NodeSelectorTrigger({ className, children }) {
2297
2292
  }
2298
2293
  function NodeSelectorContent({ className, align = "start", children }) {
2299
2294
  const { items, setIsOpen } = useNodeSelectorContext();
2300
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__radix_ui_react_popover.Content, {
2295
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_react_popover.Content, {
2301
2296
  align,
2302
2297
  "data-re-node-selector-content": "",
2303
2298
  className,
@@ -2333,9 +2328,9 @@ function BubbleMenuNodeSelector({ omit = [], className, triggerContent, open, on
2333
2328
  //#endregion
2334
2329
  //#region src/ui/bubble-menu/root.tsx
2335
2330
  function BubbleMenuRoot({ excludeNodes = [], placement = "bottom", offset = 8, onHide, className, children }) {
2336
- const { editor } = (0, __tiptap_react.useCurrentEditor)();
2331
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
2337
2332
  if (!editor) return null;
2338
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react_menus.BubbleMenu, {
2333
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
2339
2334
  editor,
2340
2335
  "data-re-bubble-menu": "",
2341
2336
  shouldShow: ({ editor: editor$1, view }) => {
@@ -2481,7 +2476,7 @@ function useButtonBubbleMenuContext() {
2481
2476
 
2482
2477
  //#endregion
2483
2478
  //#region src/ui/button-bubble-menu/edit-link.tsx
2484
- function ButtonBubbleMenuEditLink({ className, children, onClick, onMouseDown,...rest }) {
2479
+ function ButtonBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
2485
2480
  const { setIsEditing } = useButtonBubbleMenuContext();
2486
2481
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2487
2482
  ...rest,
@@ -2505,10 +2500,10 @@ function ButtonBubbleMenuEditLink({ className, children, onClick, onMouseDown,..
2505
2500
  //#endregion
2506
2501
  //#region src/ui/button-bubble-menu/root.tsx
2507
2502
  function ButtonBubbleMenuRoot({ onHide, placement = "top", offset = 8, className, children }) {
2508
- const { editor } = (0, __tiptap_react.useCurrentEditor)();
2503
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
2509
2504
  const [isEditing, setIsEditing] = react.useState(false);
2510
2505
  if (!editor) return null;
2511
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react_menus.BubbleMenu, {
2506
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
2512
2507
  editor,
2513
2508
  "data-re-btn-bm": "",
2514
2509
  shouldShow: ({ editor: e, view }) => e.isActive("button") && !view.dom.classList.contains("dragging"),
@@ -2534,12 +2529,12 @@ function ButtonBubbleMenuRoot({ onHide, placement = "top", offset = 8, className
2534
2529
 
2535
2530
  //#endregion
2536
2531
  //#region src/ui/button-bubble-menu/toolbar.tsx
2537
- function ButtonBubbleMenuToolbar({ className, children }) {
2532
+ function ButtonBubbleMenuToolbar({ children, ...rest }) {
2538
2533
  const { isEditing } = useButtonBubbleMenuContext();
2539
2534
  if (isEditing) return null;
2540
2535
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2541
2536
  "data-re-btn-bm-toolbar": "",
2542
- className,
2537
+ ...rest,
2543
2538
  children
2544
2539
  });
2545
2540
  }
@@ -2552,6 +2547,88 @@ const ButtonBubbleMenu = {
2552
2547
  EditLink: ButtonBubbleMenuEditLink
2553
2548
  };
2554
2549
 
2550
+ //#endregion
2551
+ //#region src/ui/image-bubble-menu/context.tsx
2552
+ const ImageBubbleMenuContext = react.createContext(null);
2553
+ function useImageBubbleMenuContext() {
2554
+ const context = react.useContext(ImageBubbleMenuContext);
2555
+ if (!context) throw new Error("ImageBubbleMenu compound components must be used within <ImageBubbleMenu.Root>");
2556
+ return context;
2557
+ }
2558
+
2559
+ //#endregion
2560
+ //#region src/ui/image-bubble-menu/edit-link.tsx
2561
+ function ImageBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
2562
+ const { setIsEditing } = useImageBubbleMenuContext();
2563
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2564
+ ...rest,
2565
+ type: "button",
2566
+ "aria-label": "Edit link",
2567
+ "data-re-img-bm-item": "",
2568
+ "data-item": "edit-link",
2569
+ className,
2570
+ onMouseDown: (e) => {
2571
+ e.preventDefault();
2572
+ onMouseDown?.(e);
2573
+ },
2574
+ onClick: (e) => {
2575
+ onClick?.(e);
2576
+ setIsEditing(true);
2577
+ },
2578
+ children: children ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.LinkIcon, {})
2579
+ });
2580
+ }
2581
+
2582
+ //#endregion
2583
+ //#region src/ui/image-bubble-menu/root.tsx
2584
+ function ImageBubbleMenuRoot({ onHide, placement = "top", offset = 8, className, children }) {
2585
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
2586
+ const [isEditing, setIsEditing] = react.useState(false);
2587
+ if (!editor) return null;
2588
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
2589
+ editor,
2590
+ "data-re-img-bm": "",
2591
+ shouldShow: ({ editor: e, view }) => e.isActive("image") && !view.dom.classList.contains("dragging"),
2592
+ options: {
2593
+ placement,
2594
+ offset,
2595
+ onHide: () => {
2596
+ setIsEditing(false);
2597
+ onHide?.();
2598
+ }
2599
+ },
2600
+ className,
2601
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ImageBubbleMenuContext.Provider, {
2602
+ value: {
2603
+ editor,
2604
+ isEditing,
2605
+ setIsEditing
2606
+ },
2607
+ children
2608
+ })
2609
+ });
2610
+ }
2611
+
2612
+ //#endregion
2613
+ //#region src/ui/image-bubble-menu/toolbar.tsx
2614
+ function ImageBubbleMenuToolbar({ children, ...rest }) {
2615
+ const { isEditing } = useImageBubbleMenuContext();
2616
+ if (isEditing) return null;
2617
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2618
+ "data-re-img-bm-toolbar": "",
2619
+ ...rest,
2620
+ children
2621
+ });
2622
+ }
2623
+
2624
+ //#endregion
2625
+ //#region src/ui/image-bubble-menu/index.ts
2626
+ const ImageBubbleMenu = {
2627
+ Root: ImageBubbleMenuRoot,
2628
+ Toolbar: ImageBubbleMenuToolbar,
2629
+ EditLink: ImageBubbleMenuEditLink
2630
+ };
2631
+
2555
2632
  //#endregion
2556
2633
  //#region src/ui/link-bubble-menu/context.tsx
2557
2634
  const LinkBubbleMenuContext = react.createContext(null);
@@ -2563,7 +2640,7 @@ function useLinkBubbleMenuContext() {
2563
2640
 
2564
2641
  //#endregion
2565
2642
  //#region src/ui/link-bubble-menu/edit-link.tsx
2566
- function LinkBubbleMenuEditLink({ className, children, onClick, onMouseDown,...rest }) {
2643
+ function LinkBubbleMenuEditLink({ className, children, onClick, onMouseDown, ...rest }) {
2567
2644
  const { setIsEditing } = useLinkBubbleMenuContext();
2568
2645
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2569
2646
  type: "button",
@@ -2691,7 +2768,7 @@ function LinkBubbleMenuForm({ className, validateUrl, onLinkApply, onLinkRemove,
2691
2768
 
2692
2769
  //#endregion
2693
2770
  //#region src/ui/link-bubble-menu/open-link.tsx
2694
- function LinkBubbleMenuOpenLink({ className, children,...rest }) {
2771
+ function LinkBubbleMenuOpenLink({ className, children, ...rest }) {
2695
2772
  const { linkHref } = useLinkBubbleMenuContext();
2696
2773
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
2697
2774
  ...rest,
@@ -2709,14 +2786,14 @@ function LinkBubbleMenuOpenLink({ className, children,...rest }) {
2709
2786
  //#endregion
2710
2787
  //#region src/ui/link-bubble-menu/root.tsx
2711
2788
  function LinkBubbleMenuRoot({ onHide, placement = "top", offset = 8, className, children }) {
2712
- const { editor } = (0, __tiptap_react.useCurrentEditor)();
2789
+ const { editor } = (0, _tiptap_react.useCurrentEditor)();
2713
2790
  const [isEditing, setIsEditing] = react.useState(false);
2714
- const linkHref = (0, __tiptap_react.useEditorState)({
2791
+ const linkHref = (0, _tiptap_react.useEditorState)({
2715
2792
  editor,
2716
2793
  selector: ({ editor: e }) => e?.getAttributes("link").href ?? ""
2717
2794
  });
2718
2795
  if (!editor) return null;
2719
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tiptap_react_menus.BubbleMenu, {
2796
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_tiptap_react_menus.BubbleMenu, {
2720
2797
  editor,
2721
2798
  "data-re-link-bm": "",
2722
2799
  shouldShow: ({ editor: e }) => e.isActive("link") && e.view.state.selection.content().size === 0,
@@ -2743,19 +2820,19 @@ function LinkBubbleMenuRoot({ onHide, placement = "top", offset = 8, className,
2743
2820
 
2744
2821
  //#endregion
2745
2822
  //#region src/ui/link-bubble-menu/toolbar.tsx
2746
- function LinkBubbleMenuToolbar({ className, children }) {
2823
+ function LinkBubbleMenuToolbar({ children, ...rest }) {
2747
2824
  const { isEditing } = useLinkBubbleMenuContext();
2748
2825
  if (isEditing) return null;
2749
2826
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2750
2827
  "data-re-link-bm-toolbar": "",
2751
- className,
2828
+ ...rest,
2752
2829
  children
2753
2830
  });
2754
2831
  }
2755
2832
 
2756
2833
  //#endregion
2757
2834
  //#region src/ui/link-bubble-menu/unlink.tsx
2758
- function LinkBubbleMenuUnlink({ className, children, onClick, onMouseDown,...rest }) {
2835
+ function LinkBubbleMenuUnlink({ className, children, onClick, onMouseDown, ...rest }) {
2759
2836
  const { editor } = useLinkBubbleMenuContext();
2760
2837
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2761
2838
  type: "button",
@@ -2820,6 +2897,10 @@ exports.ColumnsColumn = ColumnsColumn;
2820
2897
  exports.Div = Div;
2821
2898
  exports.EmailNode = EmailNode;
2822
2899
  exports.FourColumns = FourColumns;
2900
+ exports.ImageBubbleMenu = ImageBubbleMenu;
2901
+ exports.ImageBubbleMenuEditLink = ImageBubbleMenuEditLink;
2902
+ exports.ImageBubbleMenuRoot = ImageBubbleMenuRoot;
2903
+ exports.ImageBubbleMenuToolbar = ImageBubbleMenuToolbar;
2823
2904
  exports.LinkBubbleMenu = LinkBubbleMenu;
2824
2905
  exports.LinkBubbleMenuEditLink = LinkBubbleMenuEditLink;
2825
2906
  exports.LinkBubbleMenuForm = LinkBubbleMenuForm;
@@ -2851,4 +2932,5 @@ exports.getColumnsDepth = getColumnsDepth;
2851
2932
  exports.processStylesForUnlink = processStylesForUnlink;
2852
2933
  exports.setTextAlignment = setTextAlignment;
2853
2934
  exports.useButtonBubbleMenuContext = useButtonBubbleMenuContext;
2935
+ exports.useImageBubbleMenuContext = useImageBubbleMenuContext;
2854
2936
  exports.useLinkBubbleMenuContext = useLinkBubbleMenuContext;