@underverse-ui/underverse 2.0.22 → 2.0.24
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/AGENTS.md +2 -0
- package/api-reference.json +1 -1
- package/dist/{chunk-EVY3BTAU.js → chunk-HGOTCQXL.js} +37 -16
- package/dist/{chunk-EVY3BTAU.js.map → chunk-HGOTCQXL.js.map} +1 -1
- package/dist/{chunk-LWAKD7EK.js → chunk-O7AAN6W6.js} +2 -2
- package/dist/chunk-O7AAN6W6.js.map +1 -0
- package/dist/{chunk-F6KCGIJX.js → chunk-ZQWVWDGS.js} +2 -2
- package/dist/index.cjs +35 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{menu-bar-5FG5RVXQ.js → menu-bar-E7MNW6UC.js} +3 -3
- package/dist/ueditor.cjs +35 -14
- package/dist/ueditor.cjs.map +1 -1
- package/dist/ueditor.js +2 -2
- package/package.json +7 -6
- package/dist/chunk-LWAKD7EK.js.map +0 -1
- /package/dist/{chunk-F6KCGIJX.js.map → chunk-ZQWVWDGS.js.map} +0 -0
- /package/dist/{menu-bar-5FG5RVXQ.js.map → menu-bar-E7MNW6UC.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
extractImageSrcsFromHtml,
|
|
5
5
|
normalizeImageUrl,
|
|
6
6
|
prepareUEditorContentForSave
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HGOTCQXL.js";
|
|
8
8
|
import {
|
|
9
9
|
EmojiPicker_default
|
|
10
10
|
} from "./chunk-F7MX3XXK.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import "./chunk-4TYW5K4J.js";
|
|
17
17
|
import {
|
|
18
18
|
Modal_default
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZQWVWDGS.js";
|
|
20
20
|
import {
|
|
21
21
|
DropdownMenuItem,
|
|
22
22
|
DropdownMenuSeparator,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
shadcnAnimationStyles,
|
|
32
32
|
useShadCNAnimations,
|
|
33
33
|
useUnderverseUIConfig
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-O7AAN6W6.js";
|
|
35
35
|
import {
|
|
36
36
|
ForceInternalTranslationsProvider,
|
|
37
37
|
NextIntlAdapter,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
Modal_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZQWVWDGS.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_TABLE_ROW_HEIGHT,
|
|
7
7
|
DEFAULT_UEDITOR_IMAGE_MAX_FILE_SIZE,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
sanitizeUEditorUrl,
|
|
22
22
|
useDropdownMenuClose,
|
|
23
23
|
useSharedEditorUiRenderState
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-O7AAN6W6.js";
|
|
25
25
|
import {
|
|
26
26
|
cn,
|
|
27
27
|
useSmartTranslations
|
|
@@ -945,4 +945,4 @@ var MenuBar = ({
|
|
|
945
945
|
export {
|
|
946
946
|
MenuBar
|
|
947
947
|
};
|
|
948
|
-
//# sourceMappingURL=menu-bar-
|
|
948
|
+
//# sourceMappingURL=menu-bar-E7MNW6UC.js.map
|
package/dist/ueditor.cjs
CHANGED
|
@@ -2582,7 +2582,7 @@ var init_Popover = __esm({
|
|
|
2582
2582
|
const measuredHeight = positionerEl.offsetHeight;
|
|
2583
2583
|
const contentRect = positionerEl.getBoundingClientRect();
|
|
2584
2584
|
const contentBoxWidth = measuredWidth || contentRect.width;
|
|
2585
|
-
const contentBoxHeight = Math.max(measuredHeight, contentRect.height
|
|
2585
|
+
const contentBoxHeight = Math.max(measuredHeight, contentRect.height);
|
|
2586
2586
|
const next = computePopoverPosition({
|
|
2587
2587
|
triggerRect,
|
|
2588
2588
|
contentSize: { width: contentBoxWidth, height: contentBoxHeight },
|
|
@@ -20918,6 +20918,22 @@ init_table_dom_utils();
|
|
|
20918
20918
|
init_table_dom_utils();
|
|
20919
20919
|
var FALLBACK_TABLE_ROW_HEIGHT = DEFAULT_TABLE_ROW_HEIGHT;
|
|
20920
20920
|
var FALLBACK_TABLE_COLUMN_WIDTH = 160;
|
|
20921
|
+
function isTableCellElement(element) {
|
|
20922
|
+
const realm = element?.ownerDocument?.defaultView;
|
|
20923
|
+
return Boolean(realm && element instanceof realm.HTMLTableCellElement);
|
|
20924
|
+
}
|
|
20925
|
+
function isTableRowElement(element) {
|
|
20926
|
+
const realm = element?.ownerDocument?.defaultView;
|
|
20927
|
+
return Boolean(realm && element instanceof realm.HTMLTableRowElement);
|
|
20928
|
+
}
|
|
20929
|
+
function isTableElement(element) {
|
|
20930
|
+
const realm = element?.ownerDocument?.defaultView;
|
|
20931
|
+
return Boolean(realm && element instanceof realm.HTMLTableElement);
|
|
20932
|
+
}
|
|
20933
|
+
function isHTMLElement(element) {
|
|
20934
|
+
const realm = element?.ownerDocument?.defaultView;
|
|
20935
|
+
return Boolean(realm && element instanceof realm.HTMLElement);
|
|
20936
|
+
}
|
|
20921
20937
|
function getVisibleTableBounds(layout) {
|
|
20922
20938
|
const left = Math.max(layout.tableLeft, layout.wrapperLeft);
|
|
20923
20939
|
const top = Math.max(layout.tableTop, layout.wrapperTop);
|
|
@@ -20942,23 +20958,23 @@ function parsePixelMetric(value) {
|
|
|
20942
20958
|
}
|
|
20943
20959
|
function getPrimaryCell(table) {
|
|
20944
20960
|
const cell = table.querySelector("th,td");
|
|
20945
|
-
return cell
|
|
20961
|
+
return isTableCellElement(cell) ? cell : null;
|
|
20946
20962
|
}
|
|
20947
20963
|
function getLastCell(table) {
|
|
20948
20964
|
const lastRow = table.rows.item(table.rows.length - 1);
|
|
20949
|
-
if (!(lastRow
|
|
20965
|
+
if (!isTableRowElement(lastRow)) return null;
|
|
20950
20966
|
const cell = lastRow.cells.item(lastRow.cells.length - 1);
|
|
20951
|
-
return cell
|
|
20967
|
+
return isTableCellElement(cell) ? cell : null;
|
|
20952
20968
|
}
|
|
20953
20969
|
function getCellFromTarget(target) {
|
|
20954
20970
|
const element = resolveEventElement(target);
|
|
20955
20971
|
if (!element) return null;
|
|
20956
20972
|
const directCell = element.closest("th,td");
|
|
20957
|
-
if (directCell
|
|
20973
|
+
if (isTableCellElement(directCell)) {
|
|
20958
20974
|
return directCell;
|
|
20959
20975
|
}
|
|
20960
20976
|
const table = element.closest("table");
|
|
20961
|
-
if (table
|
|
20977
|
+
if (isTableElement(table)) {
|
|
20962
20978
|
return getPrimaryCell(table);
|
|
20963
20979
|
}
|
|
20964
20980
|
return null;
|
|
@@ -21004,7 +21020,7 @@ function buildLogicalColumnMetrics({
|
|
|
21004
21020
|
const visualColumns = [];
|
|
21005
21021
|
if (firstRow) {
|
|
21006
21022
|
for (const tableCell of Array.from(firstRow.cells)) {
|
|
21007
|
-
if (!(tableCell
|
|
21023
|
+
if (!isTableCellElement(tableCell)) continue;
|
|
21008
21024
|
const cellPos = editor.view.posAtDOM(tableCell, 0);
|
|
21009
21025
|
const relativeCellPos = getCellRelativePosFromDomPos(map, tableInfo.start, cellPos);
|
|
21010
21026
|
if (relativeCellPos == null) continue;
|
|
@@ -21061,7 +21077,8 @@ function buildLogicalRowMetrics({
|
|
|
21061
21077
|
seenCellPositions.add(relativeCellPos);
|
|
21062
21078
|
const cellMapRect = map.findCell(relativeCellPos);
|
|
21063
21079
|
const cellDom = editor.view.nodeDOM(tableInfo.start + relativeCellPos);
|
|
21064
|
-
const
|
|
21080
|
+
const cellCandidate = cellDom;
|
|
21081
|
+
const tableCell = isTableCellElement(cellCandidate) ? cellCandidate : null;
|
|
21065
21082
|
if (tableCell) {
|
|
21066
21083
|
const cellRect = tableCell.getBoundingClientRect();
|
|
21067
21084
|
const start = cellRect.height > 0 ? cellRect.top - surfaceRect.top + surface.scrollTop : tableTop + cellMapRect.top * fallbackHeight;
|
|
@@ -21111,14 +21128,14 @@ function getTableCellTextSelectionRange(editor, cellPos) {
|
|
|
21111
21128
|
function buildTableControlLayout(editor, surface, cell) {
|
|
21112
21129
|
const row = cell.closest("tr");
|
|
21113
21130
|
const table = cell.closest("table");
|
|
21114
|
-
if (!(row
|
|
21131
|
+
if (!isTableRowElement(row) || !isTableElement(table)) {
|
|
21115
21132
|
return null;
|
|
21116
21133
|
}
|
|
21117
|
-
const rows = Array.from(table.rows).filter(
|
|
21134
|
+
const rows = Array.from(table.rows).filter(isTableRowElement);
|
|
21118
21135
|
const cornerCell = getLastCell(table);
|
|
21119
21136
|
const cellPos = editor.view.posAtDOM(cell, 0);
|
|
21120
21137
|
const tableInfo = findTableInfo(editor, cellPos);
|
|
21121
|
-
if (rows.length === 0 || !tableInfo || !(cornerCell
|
|
21138
|
+
if (rows.length === 0 || !tableInfo || !isTableCellElement(cornerCell)) {
|
|
21122
21139
|
return null;
|
|
21123
21140
|
}
|
|
21124
21141
|
const map = TableMap4.get(tableInfo.node);
|
|
@@ -21129,7 +21146,7 @@ function buildTableControlLayout(editor, surface, cell) {
|
|
|
21129
21146
|
const explicitRowHeights = rows.map((tableRow) => parsePixelMetric(tableRow.getAttribute("data-row-height")) ?? parsePixelMetric(tableRow.style.height));
|
|
21130
21147
|
const explicitTableHeight = explicitRowHeights.every((height) => height !== null) ? explicitRowHeights.reduce((sum, height) => sum + height, 0) : null;
|
|
21131
21148
|
const wrapperElement = table.closest(".tableWrapper");
|
|
21132
|
-
const wrapper = wrapperElement
|
|
21149
|
+
const wrapper = isHTMLElement(wrapperElement) ? wrapperElement : null;
|
|
21133
21150
|
const wrapperRect = wrapper?.getBoundingClientRect() ?? tableRect;
|
|
21134
21151
|
const tableLeft = tableRect.left - surfaceRect.left + surface.scrollLeft;
|
|
21135
21152
|
const tableTop = tableRect.top - surfaceRect.top + surface.scrollTop;
|
|
@@ -21198,6 +21215,10 @@ var COLUMN_HANDLE_HOVER_HEIGHT = 28;
|
|
|
21198
21215
|
var ADD_COLUMN_HOVER_WIDTH = 24;
|
|
21199
21216
|
var ADD_ROW_HOVER_HEIGHT = 24;
|
|
21200
21217
|
var HANDLE_HOVER_RADIUS = 14;
|
|
21218
|
+
function isHTMLElement2(element) {
|
|
21219
|
+
const realm = element?.ownerDocument?.defaultView;
|
|
21220
|
+
return Boolean(realm && element instanceof realm.HTMLElement);
|
|
21221
|
+
}
|
|
21201
21222
|
var DEFAULT_TABLE_HOVER_STATE = {
|
|
21202
21223
|
menuVisible: false,
|
|
21203
21224
|
addColumnVisible: false,
|
|
@@ -21225,8 +21246,8 @@ function buildTableHoverState({
|
|
|
21225
21246
|
const directTableMenu = targetElement?.closest?.("[data-table-control='table-menu']");
|
|
21226
21247
|
const directAddColumn = targetElement?.closest?.("[data-table-control='add-column']");
|
|
21227
21248
|
const directAddRow = targetElement?.closest?.("[data-table-control='add-row']");
|
|
21228
|
-
const directRowHandleIndex = directRowHandle
|
|
21229
|
-
const directColumnHandleIndex = directColumnHandle
|
|
21249
|
+
const directRowHandleIndex = isHTMLElement2(directRowHandle) && relativeX <= layout.tableLeft ? Number.parseInt(directRowHandle.dataset.rowHandleIndex ?? "", 10) : Number.NaN;
|
|
21250
|
+
const directColumnHandleIndex = isHTMLElement2(directColumnHandle) && relativeY <= layout.tableTop ? Number.parseInt(directColumnHandle.dataset.columnHandleIndex ?? "", 10) : Number.NaN;
|
|
21230
21251
|
const visibleBounds = getVisibleTableBounds(layout);
|
|
21231
21252
|
const rowRailTop = layout.wrapperTop + layout.wrapperHeight;
|
|
21232
21253
|
const isMouseInTable = relativeX >= layout.tableLeft && relativeX <= layout.tableLeft + layout.tableWidth && relativeY >= layout.tableTop && relativeY <= layout.tableTop + layout.tableHeight;
|