@underverse-ui/underverse 2.0.24 → 2.0.26

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,8 +1,8 @@
1
1
  {
2
2
  "package": "@underverse-ui/underverse",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "sourceEntry": "src/index.ts",
5
- "totalExports": 260,
5
+ "totalExports": 263,
6
6
  "exports": [
7
7
  {
8
8
  "name": "*",
@@ -572,6 +572,20 @@
572
572
  "reexport": true,
573
573
  "local": false
574
574
  },
575
+ {
576
+ "name": "DropdownMenuItemProps",
577
+ "kind": "type",
578
+ "source": "./components/DropdownMenu",
579
+ "reexport": true,
580
+ "local": false
581
+ },
582
+ {
583
+ "name": "DropdownMenuProps",
584
+ "kind": "type",
585
+ "source": "./components/DropdownMenu",
586
+ "reexport": true,
587
+ "local": false
588
+ },
575
589
  {
576
590
  "name": "DropdownMenuSeparator",
577
591
  "kind": "value",
@@ -1213,6 +1227,13 @@
1213
1227
  "reexport": true,
1214
1228
  "local": false
1215
1229
  },
1230
+ {
1231
+ "name": "SelectDropdownProps",
1232
+ "kind": "type",
1233
+ "source": "./components/DropdownMenu",
1234
+ "reexport": true,
1235
+ "local": false
1236
+ },
1216
1237
  {
1217
1238
  "name": "setEmojiBaseUrl",
1218
1239
  "kind": "value",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getPanelBorderRadiusClass,
3
3
  useUnderverseUIConfig
4
- } from "./chunk-O7AAN6W6.js";
4
+ } from "./chunk-OJF3XRN7.js";
5
5
  import {
6
6
  cn,
7
7
  useGlobalI18n
@@ -196,4 +196,4 @@ var Modal_default = Modal;
196
196
  export {
197
197
  Modal_default
198
198
  };
199
- //# sourceMappingURL=chunk-ZQWVWDGS.js.map
199
+ //# sourceMappingURL=chunk-FFVBGTHU.js.map
@@ -55,7 +55,7 @@ import {
55
55
  sanitizeUEditorUrl,
56
56
  useEditorColors,
57
57
  useSharedEditorUiRenderState
58
- } from "./chunk-O7AAN6W6.js";
58
+ } from "./chunk-OJF3XRN7.js";
59
59
  import {
60
60
  Tooltip,
61
61
  UEditorPortalProvider,
@@ -505,7 +505,7 @@ import { wrappingInputRule } from "@tiptap/core";
505
505
  import { ReactNodeViewRenderer as ReactNodeViewRenderer7 } from "@tiptap/react";
506
506
 
507
507
  // src/components/UEditor/callout.ts
508
- import { Node as Node2, mergeAttributes } from "@tiptap/core";
508
+ import { Node, mergeAttributes } from "@tiptap/core";
509
509
  import { ReactNodeViewRenderer } from "@tiptap/react";
510
510
 
511
511
  // src/components/UEditor/CalloutView.tsx
@@ -586,7 +586,7 @@ var CalloutView = ({ node, updateAttributes, selected }) => {
586
586
  };
587
587
 
588
588
  // src/components/UEditor/callout.ts
589
- var Callout = Node2.create({
589
+ var Callout = Node.create({
590
590
  name: "callout",
591
591
  group: "block",
592
592
  content: "block+",
@@ -642,7 +642,7 @@ var Callout = Node2.create({
642
642
  });
643
643
 
644
644
  // src/components/UEditor/bookmark.ts
645
- import { Node as Node3, mergeAttributes as mergeAttributes2 } from "@tiptap/core";
645
+ import { Node as Node2, mergeAttributes as mergeAttributes2 } from "@tiptap/core";
646
646
  import { ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
647
647
 
648
648
  // src/components/UEditor/BookmarkView.tsx
@@ -836,7 +836,7 @@ var BookmarkView = ({ node, updateAttributes, selected, editor }) => {
836
836
  // src/components/UEditor/bookmark.ts
837
837
  import { Plugin, PluginKey } from "@tiptap/pm/state";
838
838
  var URL_REGEX = /^(https?:\/\/[^\s]+)$/i;
839
- var Bookmark = Node3.create({
839
+ var Bookmark = Node2.create({
840
840
  name: "bookmark",
841
841
  group: "block",
842
842
  atom: true,
@@ -949,7 +949,7 @@ var Bookmark = Node3.create({
949
949
  });
950
950
 
951
951
  // src/components/UEditor/file-card.ts
952
- import { Node as Node4, mergeAttributes as mergeAttributes3 } from "@tiptap/core";
952
+ import { Node as Node3, mergeAttributes as mergeAttributes3 } from "@tiptap/core";
953
953
  import { ReactNodeViewRenderer as ReactNodeViewRenderer3 } from "@tiptap/react";
954
954
 
955
955
  // src/components/UEditor/FileCardView.tsx
@@ -1120,7 +1120,7 @@ var FileCardView = ({ node, selected, editor, updateAttributes }) => {
1120
1120
  };
1121
1121
 
1122
1122
  // src/components/UEditor/file-card.ts
1123
- var FileCard = Node4.create({
1123
+ var FileCard = Node3.create({
1124
1124
  name: "fileCard",
1125
1125
  group: "block",
1126
1126
  atom: true,
@@ -1210,7 +1210,7 @@ var FileCard = Node4.create({
1210
1210
  });
1211
1211
 
1212
1212
  // src/components/UEditor/form-checkbox.ts
1213
- import { Node as Node5, mergeAttributes as mergeAttributes4 } from "@tiptap/core";
1213
+ import { Node as Node4, mergeAttributes as mergeAttributes4 } from "@tiptap/core";
1214
1214
  import { ReactNodeViewRenderer as ReactNodeViewRenderer4 } from "@tiptap/react";
1215
1215
 
1216
1216
  // src/components/UEditor/FormCheckboxView.tsx
@@ -1272,7 +1272,7 @@ var FormCheckboxView = ({ node, updateAttributes, editor, selected }) => {
1272
1272
  };
1273
1273
 
1274
1274
  // src/components/UEditor/form-checkbox.ts
1275
- var FormCheckbox = Node5.create({
1275
+ var FormCheckbox = Node4.create({
1276
1276
  name: "formCheckbox",
1277
1277
  group: "inline",
1278
1278
  inline: true,
@@ -1365,7 +1365,7 @@ var FormCheckbox = Node5.create({
1365
1365
  });
1366
1366
 
1367
1367
  // src/components/UEditor/form-radio.ts
1368
- import { Node as Node6, mergeAttributes as mergeAttributes5 } from "@tiptap/core";
1368
+ import { Node as Node5, mergeAttributes as mergeAttributes5 } from "@tiptap/core";
1369
1369
  import { ReactNodeViewRenderer as ReactNodeViewRenderer5 } from "@tiptap/react";
1370
1370
 
1371
1371
  // src/components/UEditor/FormRadioView.tsx
@@ -1455,7 +1455,7 @@ var FormRadioView = ({ node, updateAttributes, editor, selected }) => {
1455
1455
  };
1456
1456
 
1457
1457
  // src/components/UEditor/form-radio.ts
1458
- var FormRadio = Node6.create({
1458
+ var FormRadio = Node5.create({
1459
1459
  name: "formRadio",
1460
1460
  group: "inline",
1461
1461
  inline: true,
@@ -3365,9 +3365,10 @@ function setColumnStyle(column, width) {
3365
3365
  column.style.minWidth = "";
3366
3366
  }
3367
3367
  function isTableColumnElement(node) {
3368
- return node instanceof HTMLElement && node.tagName.toLowerCase() === "col";
3368
+ const realm = node?.ownerDocument?.defaultView;
3369
+ return Boolean(realm && node instanceof realm.HTMLTableColElement && node.tagName.toLowerCase() === "col");
3369
3370
  }
3370
- function updateDynamicColumns(node, colgroup, table, overrideCol, overrideValue) {
3371
+ function updateDynamicColumns(node, colgroup, table, ownerDocument, overrideCol, overrideValue) {
3371
3372
  let totalWidth = 0;
3372
3373
  let nextDOM = colgroup.firstChild;
3373
3374
  const row = node.firstChild;
@@ -3378,7 +3379,7 @@ function updateDynamicColumns(node, colgroup, table, overrideCol, overrideValue)
3378
3379
  const rawWidth = overrideCol === col ? overrideValue : colwidth?.[spanIndex];
3379
3380
  const width = rawWidth ? Math.max(rawWidth, MIN_RESIZED_TABLE_COLUMN_WIDTH) : null;
3380
3381
  totalWidth += width ?? DEFAULT_TABLE_COLUMN_WIDTH;
3381
- const colElement = isTableColumnElement(nextDOM) ? nextDOM : colgroup.appendChild(document.createElement("col"));
3382
+ const colElement = isTableColumnElement(nextDOM) ? nextDOM : colgroup.appendChild(ownerDocument.createElement("col"));
3382
3383
  setColumnStyle(colElement, width);
3383
3384
  nextDOM = colElement.nextSibling;
3384
3385
  }
@@ -3398,23 +3399,25 @@ function updateDynamicColumns(node, colgroup, table, overrideCol, overrideValue)
3398
3399
  }
3399
3400
  }
3400
3401
  var UEditorTableView = class {
3401
- constructor(node) {
3402
+ constructor(node, _defaultColumnWidth, maybeView) {
3402
3403
  this.node = node;
3403
- this.dom = document.createElement("div");
3404
+ const view = maybeView ?? _defaultColumnWidth;
3405
+ const ownerDocument = view.dom.ownerDocument;
3406
+ this.dom = ownerDocument.createElement("div");
3404
3407
  this.dom.className = "tableWrapper";
3405
- this.table = this.dom.appendChild(document.createElement("table"));
3408
+ this.table = this.dom.appendChild(ownerDocument.createElement("table"));
3406
3409
  if (node.attrs.style) {
3407
3410
  this.table.style.cssText = node.attrs.style;
3408
3411
  }
3409
3412
  this.table.style.tableLayout = "fixed";
3410
- this.colgroup = this.table.appendChild(document.createElement("colgroup"));
3411
- updateDynamicColumns(node, this.colgroup, this.table);
3412
- this.contentDOM = this.table.appendChild(document.createElement("tbody"));
3413
+ this.colgroup = this.table.appendChild(ownerDocument.createElement("colgroup"));
3414
+ updateDynamicColumns(node, this.colgroup, this.table, ownerDocument);
3415
+ this.contentDOM = this.table.appendChild(ownerDocument.createElement("tbody"));
3413
3416
  }
3414
3417
  update(node) {
3415
3418
  if (node.type !== this.node.type) return false;
3416
3419
  this.node = node;
3417
- updateDynamicColumns(node, this.colgroup, this.table);
3420
+ updateDynamicColumns(node, this.colgroup, this.table, this.dom.ownerDocument);
3418
3421
  return true;
3419
3422
  }
3420
3423
  ignoreMutation(mutation) {
@@ -3436,7 +3439,8 @@ function getCurrentColWidth(view, cellPos, { colspan, colwidth }) {
3436
3439
  if (width) return width;
3437
3440
  const dom = view.domAtPos(cellPos);
3438
3441
  const cellElement = dom.node.childNodes[dom.offset];
3439
- let domWidth = cellElement instanceof HTMLElement ? cellElement.offsetWidth : 0;
3442
+ const realm = view.dom.ownerDocument.defaultView;
3443
+ let domWidth = realm && cellElement instanceof realm.HTMLElement ? cellElement.offsetWidth : 0;
3440
3444
  let parts = Math.max(1, colspan);
3441
3445
  if (colwidth) {
3442
3446
  for (let index = 0; index < colspan; index += 1) {
@@ -3449,14 +3453,15 @@ function getCurrentColWidth(view, cellPos, { colspan, colwidth }) {
3449
3453
  }
3450
3454
  return domWidth / Math.max(1, parts);
3451
3455
  }
3452
- function domCellAround(target) {
3453
- let node = target instanceof Node ? target : null;
3456
+ function domCellAround(view, target) {
3457
+ const realm = view.dom.ownerDocument.defaultView;
3458
+ let node = realm && target instanceof realm.Node ? target : null;
3454
3459
  while (node && node.nodeName !== "TD" && node.nodeName !== "TH") {
3455
- const element = node instanceof Element ? node : null;
3460
+ const element = realm && node instanceof realm.Element ? node : null;
3456
3461
  if (element?.classList.contains("ProseMirror")) return null;
3457
3462
  node = node.parentNode;
3458
3463
  }
3459
- return node instanceof HTMLElement ? node : null;
3464
+ return realm && node instanceof realm.HTMLElement ? node : null;
3460
3465
  }
3461
3466
  function edgeCell(view, event, side, handleWidth) {
3462
3467
  const offset = side === "right" ? -handleWidth : handleWidth;
@@ -3474,12 +3479,14 @@ function edgeCell(view, event, side, handleWidth) {
3474
3479
  return index % map.width === 0 ? -1 : start + map.map[index - 1];
3475
3480
  }
3476
3481
  var handleHoverTimer = null;
3482
+ var handleHoverWindow = null;
3477
3483
  var pendingHandleCell = -1;
3478
3484
  function clearHandleHoverTimer() {
3479
3485
  if (handleHoverTimer !== null) {
3480
- window.clearTimeout(handleHoverTimer);
3486
+ handleHoverWindow?.clearTimeout(handleHoverTimer);
3481
3487
  handleHoverTimer = null;
3482
3488
  }
3489
+ handleHoverWindow = null;
3483
3490
  pendingHandleCell = -1;
3484
3491
  }
3485
3492
  function updateHandle(view, value) {
@@ -3489,7 +3496,7 @@ function handleMouseMove(view, event, handleWidth, lastColumnResizable) {
3489
3496
  if (!view.editable) return;
3490
3497
  const pluginState = columnResizingPluginKey.getState(view.state);
3491
3498
  if (!pluginState || pluginState.dragging) return;
3492
- const target = domCellAround(event.target);
3499
+ const target = domCellAround(view, event.target);
3493
3500
  let cell = -1;
3494
3501
  if (target) {
3495
3502
  const { left, right } = target.getBoundingClientRect();
@@ -3525,7 +3532,10 @@ function handleMouseMove(view, event, handleWidth, lastColumnResizable) {
3525
3532
  if (pendingHandleCell === cell) return;
3526
3533
  clearHandleHoverTimer();
3527
3534
  pendingHandleCell = cell;
3528
- handleHoverTimer = window.setTimeout(() => {
3535
+ const ownerWindow = view.dom.ownerDocument.defaultView;
3536
+ if (!ownerWindow) return;
3537
+ handleHoverWindow = ownerWindow;
3538
+ handleHoverTimer = ownerWindow.setTimeout(() => {
3529
3539
  handleHoverTimer = null;
3530
3540
  pendingHandleCell = -1;
3531
3541
  updateHandle(view, cell);
@@ -3597,7 +3607,8 @@ function getTableElementAtCell(view, cell) {
3597
3607
  const $cell = view.state.doc.resolve(cell);
3598
3608
  let dom = view.domAtPos($cell.start(-1)).node;
3599
3609
  while (dom && dom.nodeName !== "TABLE") dom = dom.parentNode;
3600
- return dom instanceof HTMLTableElement ? dom : null;
3610
+ const realm = view.dom.ownerDocument.defaultView;
3611
+ return realm && dom instanceof realm.HTMLTableElement ? dom : null;
3601
3612
  }
3602
3613
  function showColumnResizeGhost(view, cell, dragging, width) {
3603
3614
  const table = getTableElementAtCell(view, cell);
@@ -3654,7 +3665,8 @@ function handleMouseDown(view, event, cellMinWidth) {
3654
3665
  event.preventDefault();
3655
3666
  return true;
3656
3667
  }
3657
- function handleDecorations(state, cell) {
3668
+ function handleDecorations(state, cell, ownerDocument) {
3669
+ if (!ownerDocument) return DecorationSet2.empty;
3658
3670
  const decorations = [];
3659
3671
  const $cell = state.doc.resolve(cell);
3660
3672
  const table = $cell.node(-1);
@@ -3671,7 +3683,7 @@ function handleDecorations(state, cell) {
3671
3683
  const cellNode = table.nodeAt(cellPos);
3672
3684
  if (!cellNode) continue;
3673
3685
  const pos = start + cellPos + cellNode.nodeSize - 1;
3674
- const dom = document.createElement("div");
3686
+ const dom = ownerDocument.createElement("div");
3675
3687
  dom.className = "column-resize-handle";
3676
3688
  if (columnResizingPluginKey.getState(state)?.dragging) {
3677
3689
  decorations.push(Decoration2.node(start + cellPos, start + cellPos + cellNode.nodeSize, { class: "column-resize-dragging" }));
@@ -3688,6 +3700,7 @@ function dynamicColumnResizing({
3688
3700
  View = UEditorTableView,
3689
3701
  lastColumnResizable = true
3690
3702
  } = {}) {
3703
+ let ownerDocument = null;
3691
3704
  const plugin = new Plugin3({
3692
3705
  key: columnResizingPluginKey,
3693
3706
  state: {
@@ -3695,7 +3708,10 @@ function dynamicColumnResizing({
3695
3708
  const nodeViews = plugin.spec.props?.nodeViews;
3696
3709
  const tableName = tableNodeTypes(state.schema).table.name;
3697
3710
  if (View && nodeViews) {
3698
- nodeViews[tableName] = (node, view) => new View(node, defaultCellMinWidth, view);
3711
+ nodeViews[tableName] = (node, view) => {
3712
+ ownerDocument = view.dom.ownerDocument;
3713
+ return new View(node, defaultCellMinWidth, view);
3714
+ };
3699
3715
  }
3700
3716
  return new ResizeState(-1, false);
3701
3717
  },
@@ -3720,7 +3736,7 @@ function dynamicColumnResizing({
3720
3736
  decorations: (state) => {
3721
3737
  const pluginState = columnResizingPluginKey.getState(state);
3722
3738
  if (pluginState && pluginState.activeHandle > -1) {
3723
- return handleDecorations(state, pluginState.activeHandle);
3739
+ return handleDecorations(state, pluginState.activeHandle, ownerDocument);
3724
3740
  }
3725
3741
  return void 0;
3726
3742
  },
@@ -8387,7 +8403,7 @@ var NodeRange = class {
8387
8403
  }
8388
8404
  };
8389
8405
  var emptyAttrs = /* @__PURE__ */ Object.create(null);
8390
- var Node7 = class _Node {
8406
+ var Node6 = class _Node {
8391
8407
  /**
8392
8408
  @internal
8393
8409
  */
@@ -8789,7 +8805,7 @@ var Node7 = class _Node {
8789
8805
  return node;
8790
8806
  }
8791
8807
  };
8792
- Node7.prototype.text = void 0;
8808
+ Node6.prototype.text = void 0;
8793
8809
  function wrapMarks(marks, str) {
8794
8810
  for (let i = marks.length - 1; i >= 0; i--)
8795
8811
  str = marks[i].type.name + "(" + str + ")";
@@ -12325,7 +12341,7 @@ function TableResizeHandles({
12325
12341
  "data-table-resize-frame": "",
12326
12342
  "data-resizing": active ? "true" : "false",
12327
12343
  className: cn(
12328
- "pointer-events-none absolute z-[38] box-border border border-primary/55",
12344
+ "pointer-events-none absolute z-[38] box-border border border-transparent",
12329
12345
  active && "border-primary bg-primary/3"
12330
12346
  ),
12331
12347
  style: {
@@ -14525,7 +14541,7 @@ function useUEditorOutput({
14525
14541
  // src/components/UEditor/UEditor.tsx
14526
14542
  import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
14527
14543
  var LazyMenuBar = React15.lazy(async () => {
14528
- const { MenuBar } = await import("./menu-bar-E7MNW6UC.js");
14544
+ const { MenuBar } = await import("./menu-bar-4FM4Y273.js");
14529
14545
  return { default: MenuBar };
14530
14546
  });
14531
14547
  var UEditor = React15.forwardRef(({
@@ -14994,4 +15010,4 @@ export {
14994
15010
  prepareUEditorContentForSave,
14995
15011
  UEditor_default
14996
15012
  };
14997
- //# sourceMappingURL=chunk-HGOTCQXL.js.map
15013
+ //# sourceMappingURL=chunk-GS24SZVS.js.map