@react-email/editor 0.0.0-experimental.17 → 0.0.0-experimental.19

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/dist/index.cjs CHANGED
@@ -118,6 +118,26 @@ var EditorEventBus = class {
118
118
  };
119
119
  const editorEventBus = new EditorEventBus();
120
120
 
121
+ //#endregion
122
+ //#region src/core/is-document-visually-empty.ts
123
+ function isDocumentVisuallyEmpty(doc) {
124
+ let nonGlobalNodeCount = 0;
125
+ let firstNonGlobalNode = null;
126
+ for (let index = 0; index < doc.childCount; index += 1) {
127
+ const node = doc.child(index);
128
+ if (node.type.name === "globalContent") continue;
129
+ nonGlobalNodeCount += 1;
130
+ if (firstNonGlobalNode === null) firstNonGlobalNode = {
131
+ type: node.type,
132
+ textContent: node.textContent,
133
+ childCount: node.content.childCount
134
+ };
135
+ }
136
+ if (nonGlobalNodeCount === 0) return true;
137
+ if (nonGlobalNodeCount !== 1) return false;
138
+ return firstNonGlobalNode?.type.name === "paragraph" && firstNonGlobalNode.textContent.trim().length === 0 && firstNonGlobalNode.childCount === 0;
139
+ }
140
+
121
141
  //#endregion
122
142
  //#region src/utils/styles.ts
123
143
  const WHITE_SPACE_REGEX = /\s+/;
@@ -2515,26 +2535,6 @@ function createPasteHandler({ onPaste, onUploadImage, extensions }) {
2515
2535
  };
2516
2536
  }
2517
2537
 
2518
- //#endregion
2519
- //#region src/core/is-document-visually-empty.ts
2520
- function isDocumentVisuallyEmpty(doc) {
2521
- let nonGlobalNodeCount = 0;
2522
- let firstNonGlobalNode = null;
2523
- for (let index = 0; index < doc.childCount; index += 1) {
2524
- const node = doc.child(index);
2525
- if (node.type.name === "globalContent") continue;
2526
- nonGlobalNodeCount += 1;
2527
- if (firstNonGlobalNode === null) firstNonGlobalNode = {
2528
- type: node.type,
2529
- textContent: node.textContent,
2530
- childCount: node.content.childCount
2531
- };
2532
- }
2533
- if (nonGlobalNodeCount === 0) return true;
2534
- if (nonGlobalNodeCount !== 1) return false;
2535
- return firstNonGlobalNode?.type.name === "paragraph" && firstNonGlobalNode.textContent.trim().length === 0 && firstNonGlobalNode.childCount === 0;
2536
- }
2537
-
2538
2538
  //#endregion
2539
2539
  //#region src/core/use-editor.ts
2540
2540
  const COLLABORATION_EXTENSION_NAMES = new Set(["liveblocksExtension", "collaboration"]);
@@ -4205,6 +4205,7 @@ exports.ColumnsColumn = ColumnsColumn;
4205
4205
  exports.CommandList = CommandList;
4206
4206
  exports.DIVIDER = DIVIDER;
4207
4207
  exports.Div = Div;
4208
+ exports.Divider = Divider;
4208
4209
  exports.EmailNode = EmailNode;
4209
4210
  exports.FOUR_COLUMNS = FOUR_COLUMNS;
4210
4211
  exports.FourColumns = FourColumns;
@@ -4213,12 +4214,14 @@ exports.H1 = H1;
4213
4214
  exports.H2 = H2;
4214
4215
  exports.H3 = H3;
4215
4216
  exports.HardBreak = HardBreak;
4217
+ exports.Heading = Heading;
4216
4218
  exports.ImageBubbleMenu = ImageBubbleMenu;
4217
4219
  exports.ImageBubbleMenuDefault = ImageBubbleMenuDefault;
4218
4220
  exports.ImageBubbleMenuEditLink = ImageBubbleMenuEditLink;
4219
4221
  exports.ImageBubbleMenuRoot = ImageBubbleMenuRoot;
4220
4222
  exports.ImageBubbleMenuToolbar = ImageBubbleMenuToolbar;
4221
4223
  exports.Italic = Italic;
4224
+ exports.Link = Link;
4222
4225
  exports.LinkBubbleMenu = LinkBubbleMenu;
4223
4226
  exports.LinkBubbleMenuDefault = LinkBubbleMenuDefault;
4224
4227
  exports.LinkBubbleMenuEditLink = LinkBubbleMenuEditLink;
@@ -4265,6 +4268,7 @@ exports.filterAndRankItems = filterAndRankItems;
4265
4268
  exports.getColumnsDepth = getColumnsDepth;
4266
4269
  exports.getGlobalContent = getGlobalContent;
4267
4270
  exports.isAtMaxColumnsDepth = isAtMaxColumnsDepth;
4271
+ exports.isDocumentVisuallyEmpty = isDocumentVisuallyEmpty;
4268
4272
  exports.isInsideNode = isInsideNode;
4269
4273
  exports.processStylesForUnlink = processStylesForUnlink;
4270
4274
  exports.scoreItem = scoreItem;