@underverse-ui/underverse 2.0.42 → 2.0.44

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "2.0.42",
3
+ "version": "2.0.44",
4
4
  "sourceEntry": "src/index.ts",
5
5
  "totalExports": 264,
6
6
  "exports": [
@@ -111,7 +111,7 @@ import {
111
111
  sanitizeUEditorUrl,
112
112
  useEditorColors,
113
113
  useSharedEditorUiRenderState
114
- } from "./chunk-TVCZXO6G.js";
114
+ } from "./chunk-4IJ53MI3.js";
115
115
  import {
116
116
  Tooltip
117
117
  } from "./chunk-IW6FSDIT.js";
@@ -3172,7 +3172,7 @@ var UEditorTableRow = TableRow.extend({
3172
3172
  rowHeight: {
3173
3173
  default: DEFAULT_TABLE_ROW_HEIGHT,
3174
3174
  parseHTML: (element) => {
3175
- if (!(element instanceof HTMLElement)) return null;
3175
+ if (!isCrossRealmHTMLElement(element)) return null;
3176
3176
  return parseRowHeight(element.getAttribute("data-row-height")) ?? parseRowHeight(element.style.height);
3177
3177
  },
3178
3178
  renderHTML: (attributes) => {
@@ -3710,7 +3710,7 @@ var UEditorTable = Table2.extend({
3710
3710
  textAlign: {
3711
3711
  default: null,
3712
3712
  parseHTML: (element) => {
3713
- if (!(element instanceof HTMLElement)) return null;
3713
+ if (!isCrossRealmHTMLElement(element)) return null;
3714
3714
  return parseTableAlign(element);
3715
3715
  },
3716
3716
  renderHTML: (attributes) => {
@@ -3724,7 +3724,7 @@ var UEditorTable = Table2.extend({
3724
3724
  widthMode: {
3725
3725
  default: "fixed",
3726
3726
  parseHTML: (element) => {
3727
- if (!(element instanceof HTMLElement)) return "fixed";
3727
+ if (!isCrossRealmHTMLElement(element)) return "fixed";
3728
3728
  return parseTableWidthMode(element);
3729
3729
  },
3730
3730
  renderHTML: (attributes) => {
@@ -3737,7 +3737,7 @@ var UEditorTable = Table2.extend({
3737
3737
  widthBp: {
3738
3738
  default: null,
3739
3739
  parseHTML: (element) => {
3740
- if (!(element instanceof HTMLElement) || parseTableWidthMode(element) !== "responsive") return null;
3740
+ if (!isCrossRealmHTMLElement(element) || parseTableWidthMode(element) !== "responsive") return null;
3741
3741
  const stored = Number(element.getAttribute("data-table-width-bp"));
3742
3742
  if (Number.isFinite(stored) && stored > 0) return clampResponsiveTableWidthBp(stored);
3743
3743
  return parsePercentageToBasisPoints(element.getAttribute("data-table-width") ?? element.style.width) ?? DEFAULT_RESPONSIVE_TABLE_WIDTH_BP;
@@ -3747,7 +3747,7 @@ var UEditorTable = Table2.extend({
3747
3747
  offsetBp: {
3748
3748
  default: null,
3749
3749
  parseHTML: (element) => {
3750
- if (!(element instanceof HTMLElement) || parseTableWidthMode(element) !== "responsive") return null;
3750
+ if (!isCrossRealmHTMLElement(element) || parseTableWidthMode(element) !== "responsive") return null;
3751
3751
  const storedValue = element.getAttribute("data-table-offset-bp");
3752
3752
  const stored = Number(storedValue);
3753
3753
  if (storedValue !== null && Number.isFinite(stored) && stored >= 0) return Math.round(stored);
@@ -3766,7 +3766,7 @@ var UEditorTable = Table2.extend({
3766
3766
  columnRatios: {
3767
3767
  default: null,
3768
3768
  parseHTML: (element) => {
3769
- if (!(element instanceof HTMLElement)) return null;
3769
+ if (!isCrossRealmHTMLElement(element)) return null;
3770
3770
  const storedRatios = parseColumnRatios(
3771
3771
  element.getAttribute("data-table-column-ratios") ?? element.getAttribute("data-column-ratios")
3772
3772
  );
@@ -3962,7 +3962,7 @@ var UEditorTable = Table2.extend({
3962
3962
  if (event.button !== 0) return false;
3963
3963
  const target = resolveEventElement(event.target);
3964
3964
  const cell = target?.closest("th,td");
3965
- if (cell instanceof HTMLElement && isRowResizeHotspot(cell, event.clientX, event.clientY)) {
3965
+ if (isCrossRealmHTMLElement(cell) && isRowResizeHotspot(cell, event.clientX, event.clientY)) {
3966
3966
  isRowResizingGlobal.active = true;
3967
3967
  return true;
3968
3968
  }
@@ -5185,7 +5185,7 @@ var CustomBulletList = BulletList.extend({
5185
5185
  bulletStyle: {
5186
5186
  default: "disc",
5187
5187
  parseHTML: (element) => {
5188
- if (!(element instanceof HTMLElement)) return "disc";
5188
+ if (!isCrossRealmHTMLElement(element)) return "disc";
5189
5189
  const dataStyle = element.getAttribute("data-bullet-style");
5190
5190
  if (dataStyle) return parseBulletStyle(dataStyle);
5191
5191
  const style = element.style.listStyleType;
@@ -8933,8 +8933,11 @@ function useUEditorTableInteractions(editor, editable = true) {
8933
8933
  useEffect6(() => {
8934
8934
  if (!editor || !editable) return void 0;
8935
8935
  const proseMirror = editor.view.dom;
8936
- const editorDocument = proseMirror.ownerDocument;
8937
- const editorWindow = editorDocument.defaultView;
8936
+ const editorDocument = editorContentRef.current?.ownerDocument ?? editor?.view.dom.ownerDocument ?? document;
8937
+ const editorWindow = editorDocument.defaultView ?? window;
8938
+ if (editor?.view && editor.view.root !== editorDocument) {
8939
+ editor.view.updateRoot();
8940
+ }
8938
8941
  if (!editorWindow) return void 0;
8939
8942
  const surface = editorContentRef.current;
8940
8943
  let selectionSyncFrameId = 0;
@@ -9892,7 +9895,7 @@ function useUEditorOutput({
9892
9895
  // src/components/UEditor/UEditor.tsx
9893
9896
  import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
9894
9897
  var LazyMenuBar = React17.lazy(async () => {
9895
- const { MenuBar } = await import("./menu-bar-67LDC7IR.js");
9898
+ const { MenuBar } = await import("./menu-bar-SGKLM6IK.js");
9896
9899
  return { default: MenuBar };
9897
9900
  });
9898
9901
  var UEditor = React17.forwardRef(({
@@ -10388,4 +10391,4 @@ export {
10388
10391
  prepareUEditorContentForSave,
10389
10392
  UEditor_default
10390
10393
  };
10391
- //# sourceMappingURL=chunk-7YU3O5JK.js.map
10394
+ //# sourceMappingURL=chunk-2ELWYT7Y.js.map