@uniformdev/design-system 20.35.1-alpha.210 → 20.35.1-alpha.238
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/esm/index.js +68 -68
- package/dist/index.js +50 -50
- package/package.json +14 -14
package/dist/esm/index.js
CHANGED
|
@@ -7824,6 +7824,12 @@ var DateTimePickerVariant = /* @__PURE__ */ ((DateTimePickerVariant2) => {
|
|
|
7824
7824
|
// src/components/DateTimePicker/DateTimePicker.tsx
|
|
7825
7825
|
import { jsx as jsx65, jsxs as jsxs43 } from "@emotion/react/jsx-runtime";
|
|
7826
7826
|
var timeZoneOptions = typeof Intl !== "undefined" && typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : ["Etc/UTC"];
|
|
7827
|
+
function getTimezoneOffset(tz) {
|
|
7828
|
+
const now = /* @__PURE__ */ new Date();
|
|
7829
|
+
const utcDate = new Date(now.toLocaleString("en-US", { timeZone: "UTC" }));
|
|
7830
|
+
const tzDate = new Date(now.toLocaleString("en-US", { timeZone: tz }));
|
|
7831
|
+
return (tzDate.getTime() - utcDate.getTime()) / 6e4;
|
|
7832
|
+
}
|
|
7827
7833
|
var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => {
|
|
7828
7834
|
let tz = v;
|
|
7829
7835
|
if (tz === "Europe/Kiev") {
|
|
@@ -7831,8 +7837,14 @@ var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => {
|
|
|
7831
7837
|
}
|
|
7832
7838
|
return {
|
|
7833
7839
|
label: getTimeZoneLabel(tz),
|
|
7834
|
-
value: tz
|
|
7840
|
+
value: tz,
|
|
7841
|
+
offset: getTimezoneOffset(tz)
|
|
7835
7842
|
};
|
|
7843
|
+
}).sort((a, b) => {
|
|
7844
|
+
if (a.offset !== b.offset) {
|
|
7845
|
+
return a.offset - b.offset;
|
|
7846
|
+
}
|
|
7847
|
+
return a.value.localeCompare(b.value);
|
|
7836
7848
|
});
|
|
7837
7849
|
var DateTimePickerContext = createContext2({
|
|
7838
7850
|
clearValue() {
|
|
@@ -13636,7 +13648,7 @@ import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPl
|
|
|
13636
13648
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
13637
13649
|
import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
13638
13650
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
13639
|
-
import { TableCellNode as TableCellNode3, TableNode, TableRowNode
|
|
13651
|
+
import { TableCellNode as TableCellNode3, TableNode, TableRowNode } from "@lexical/table";
|
|
13640
13652
|
|
|
13641
13653
|
// ../richtext/dist/index.mjs
|
|
13642
13654
|
function isRichTextNode(node) {
|
|
@@ -14847,22 +14859,22 @@ import { css as css98 } from "@emotion/react";
|
|
|
14847
14859
|
import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
|
|
14848
14860
|
import { useLexicalEditable } from "@lexical/react/useLexicalEditable";
|
|
14849
14861
|
import {
|
|
14850
|
-
$
|
|
14851
|
-
$
|
|
14862
|
+
$computeTableMapSkipCellCheck,
|
|
14863
|
+
$deleteTableColumnAtSelection,
|
|
14864
|
+
$deleteTableRowAtSelection,
|
|
14852
14865
|
$getTableCellNodeFromLexicalNode,
|
|
14853
14866
|
$getTableColumnIndexFromTableCellNode,
|
|
14854
14867
|
$getTableNodeFromLexicalNodeOrThrow,
|
|
14855
14868
|
$getTableRowIndexFromTableCellNode,
|
|
14856
|
-
$
|
|
14857
|
-
$
|
|
14858
|
-
$isTableCellNode,
|
|
14859
|
-
$isTableRowNode,
|
|
14869
|
+
$insertTableColumnAtSelection,
|
|
14870
|
+
$insertTableRowAtSelection,
|
|
14860
14871
|
$isTableSelection,
|
|
14872
|
+
getTableElement,
|
|
14861
14873
|
getTableObserverFromTableElement,
|
|
14862
14874
|
TableCellHeaderStates,
|
|
14863
14875
|
TableCellNode
|
|
14864
14876
|
} from "@lexical/table";
|
|
14865
|
-
import { $
|
|
14877
|
+
import { $getSelection as $getSelection3, $isRangeSelection as $isRangeSelection3, $setSelection } from "lexical";
|
|
14866
14878
|
import { forwardRef as forwardRef27, useCallback as useCallback10, useEffect as useEffect21, useLayoutEffect, useState as useState18 } from "react";
|
|
14867
14879
|
import { jsx as jsx133, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
|
|
14868
14880
|
function computeSelectionCount(selection) {
|
|
@@ -14947,46 +14959,42 @@ function TableActionMenu({
|
|
|
14947
14959
|
editor.update(() => {
|
|
14948
14960
|
if (tableCellNode.isAttached()) {
|
|
14949
14961
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
14950
|
-
const tableElement2 = editor.getElementByKey(
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
if (!tableElement2) {
|
|
14954
|
-
throw new Error("Expected to find tableElement in DOM");
|
|
14962
|
+
const tableElement2 = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
14963
|
+
if (tableElement2 === null) {
|
|
14964
|
+
throw new Error("TableActionMenu: Expected to find tableElement in DOM");
|
|
14955
14965
|
}
|
|
14956
|
-
const
|
|
14957
|
-
if (
|
|
14958
|
-
|
|
14966
|
+
const tableObserver = getTableObserverFromTableElement(tableElement2);
|
|
14967
|
+
if (tableObserver !== null) {
|
|
14968
|
+
tableObserver.$clearHighlight();
|
|
14959
14969
|
}
|
|
14960
|
-
tableNode.markDirty();
|
|
14961
14970
|
updateTableCellNode(tableCellNode.getLatest());
|
|
14962
14971
|
}
|
|
14963
|
-
|
|
14964
|
-
rootNode.selectStart();
|
|
14972
|
+
$setSelection(null);
|
|
14965
14973
|
});
|
|
14966
14974
|
}, [editor, tableCellNode]);
|
|
14967
14975
|
const insertTableRowAtSelection = useCallback10(
|
|
14968
14976
|
(shouldInsertAfter) => {
|
|
14969
14977
|
editor.update(() => {
|
|
14970
|
-
|
|
14978
|
+
for (let i = 0; i < selectionCounts.rows; i++) {
|
|
14979
|
+
$insertTableRowAtSelection(shouldInsertAfter);
|
|
14980
|
+
}
|
|
14971
14981
|
});
|
|
14972
|
-
incrementMenuTriggerKey();
|
|
14973
14982
|
},
|
|
14974
|
-
[editor]
|
|
14983
|
+
[editor, selectionCounts.rows]
|
|
14975
14984
|
);
|
|
14976
14985
|
const insertTableColumnAtSelection = useCallback10(
|
|
14977
14986
|
(shouldInsertAfter) => {
|
|
14978
14987
|
editor.update(() => {
|
|
14979
14988
|
for (let i = 0; i < selectionCounts.columns; i++) {
|
|
14980
|
-
$
|
|
14989
|
+
$insertTableColumnAtSelection(shouldInsertAfter);
|
|
14981
14990
|
}
|
|
14982
14991
|
});
|
|
14983
|
-
incrementMenuTriggerKey();
|
|
14984
14992
|
},
|
|
14985
14993
|
[editor, selectionCounts.columns]
|
|
14986
14994
|
);
|
|
14987
14995
|
const deleteTableRowAtSelection = useCallback10(() => {
|
|
14988
14996
|
editor.update(() => {
|
|
14989
|
-
$
|
|
14997
|
+
$deleteTableRowAtSelection();
|
|
14990
14998
|
});
|
|
14991
14999
|
incrementMenuTriggerKey();
|
|
14992
15000
|
}, [editor]);
|
|
@@ -14999,7 +15007,7 @@ function TableActionMenu({
|
|
|
14999
15007
|
}, [editor, tableCellNode, clearTableSelection]);
|
|
15000
15008
|
const deleteTableColumnAtSelection = useCallback10(() => {
|
|
15001
15009
|
editor.update(() => {
|
|
15002
|
-
$
|
|
15010
|
+
$deleteTableColumnAtSelection();
|
|
15003
15011
|
});
|
|
15004
15012
|
incrementMenuTriggerKey();
|
|
15005
15013
|
}, [editor]);
|
|
@@ -15007,20 +15015,19 @@ function TableActionMenu({
|
|
|
15007
15015
|
editor.update(() => {
|
|
15008
15016
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
15009
15017
|
const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode);
|
|
15010
|
-
const
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
}
|
|
15018
|
-
tableRow2.getChildren().forEach((tableCell) => {
|
|
15019
|
-
if (!$isTableCellNode(tableCell)) {
|
|
15020
|
-
throw new Error("Expected table cell");
|
|
15018
|
+
const [gridMap] = $computeTableMapSkipCellCheck(tableNode, null, null);
|
|
15019
|
+
const rowCells = /* @__PURE__ */ new Set();
|
|
15020
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ TableCellHeaderStates.ROW;
|
|
15021
|
+
for (let col = 0; col < gridMap[tableRowIndex].length; col++) {
|
|
15022
|
+
const mapCell = gridMap[tableRowIndex][col];
|
|
15023
|
+
if (!(mapCell == null ? void 0 : mapCell.cell)) {
|
|
15024
|
+
continue;
|
|
15021
15025
|
}
|
|
15022
|
-
|
|
15023
|
-
|
|
15026
|
+
if (!rowCells.has(mapCell.cell)) {
|
|
15027
|
+
rowCells.add(mapCell.cell);
|
|
15028
|
+
mapCell.cell.setHeaderStyles(newStyle, TableCellHeaderStates.ROW);
|
|
15029
|
+
}
|
|
15030
|
+
}
|
|
15024
15031
|
clearTableSelection();
|
|
15025
15032
|
});
|
|
15026
15033
|
}, [editor, tableCellNode, clearTableSelection]);
|
|
@@ -15028,25 +15035,18 @@ function TableActionMenu({
|
|
|
15028
15035
|
editor.update(() => {
|
|
15029
15036
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
15030
15037
|
const tableColumnIndex = $getTableColumnIndexFromTableCellNode(tableCellNode);
|
|
15031
|
-
const
|
|
15032
|
-
const
|
|
15033
|
-
|
|
15034
|
-
|
|
15035
|
-
|
|
15036
|
-
|
|
15037
|
-
const tableRow2 = tableRows[r];
|
|
15038
|
-
if (!$isTableRowNode(tableRow2)) {
|
|
15039
|
-
throw new Error("Expected table row");
|
|
15040
|
-
}
|
|
15041
|
-
const tableCells = tableRow2.getChildren();
|
|
15042
|
-
if (tableColumnIndex >= tableCells.length) {
|
|
15038
|
+
const [gridMap] = $computeTableMapSkipCellCheck(tableNode, null, null);
|
|
15039
|
+
const columnCells = /* @__PURE__ */ new Set();
|
|
15040
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ TableCellHeaderStates.COLUMN;
|
|
15041
|
+
for (let row = 0; row < gridMap.length; row++) {
|
|
15042
|
+
const mapCell = gridMap[row][tableColumnIndex];
|
|
15043
|
+
if (!(mapCell == null ? void 0 : mapCell.cell)) {
|
|
15043
15044
|
continue;
|
|
15044
15045
|
}
|
|
15045
|
-
|
|
15046
|
-
|
|
15047
|
-
|
|
15046
|
+
if (!columnCells.has(mapCell.cell)) {
|
|
15047
|
+
columnCells.add(mapCell.cell);
|
|
15048
|
+
mapCell.cell.setHeaderStyles(newStyle, TableCellHeaderStates.COLUMN);
|
|
15048
15049
|
}
|
|
15049
|
-
tableCell.toggleHeaderStyle(TableCellHeaderStates.COLUMN);
|
|
15050
15050
|
}
|
|
15051
15051
|
clearTableSelection();
|
|
15052
15052
|
});
|
|
@@ -15157,7 +15157,7 @@ function TableCellActionMenuContainer({
|
|
|
15157
15157
|
return;
|
|
15158
15158
|
}
|
|
15159
15159
|
const tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
15160
|
-
if (tableCellParentNodeDOM == null) {
|
|
15160
|
+
if (tableCellParentNodeDOM == null || !tableCellNodeFromSelection.isAttached()) {
|
|
15161
15161
|
setTableMenuCellNode(null);
|
|
15162
15162
|
setTableMenuCellNodeElem(null);
|
|
15163
15163
|
return;
|
|
@@ -15175,7 +15175,7 @@ function TableCellActionMenuContainer({
|
|
|
15175
15175
|
$moveMenu();
|
|
15176
15176
|
});
|
|
15177
15177
|
});
|
|
15178
|
-
});
|
|
15178
|
+
}, [editor, $moveMenu]);
|
|
15179
15179
|
return tableCellNode != null && tableCellNodeEl != null && tableCellMenuPortalEl != null && /* @__PURE__ */ jsx133(
|
|
15180
15180
|
TableActionMenu,
|
|
15181
15181
|
{
|
|
@@ -15200,11 +15200,11 @@ import { css as css99 } from "@emotion/react";
|
|
|
15200
15200
|
import { useLexicalComposerContext as useLexicalComposerContext6 } from "@lexical/react/LexicalComposerContext";
|
|
15201
15201
|
import { useLexicalEditable as useLexicalEditable2 } from "@lexical/react/useLexicalEditable";
|
|
15202
15202
|
import {
|
|
15203
|
-
$computeTableMapSkipCellCheck,
|
|
15203
|
+
$computeTableMapSkipCellCheck as $computeTableMapSkipCellCheck2,
|
|
15204
15204
|
$getTableNodeFromLexicalNodeOrThrow as $getTableNodeFromLexicalNodeOrThrow2,
|
|
15205
15205
|
$getTableRowIndexFromTableCellNode as $getTableRowIndexFromTableCellNode2,
|
|
15206
|
-
$isTableCellNode
|
|
15207
|
-
$isTableRowNode
|
|
15206
|
+
$isTableCellNode,
|
|
15207
|
+
$isTableRowNode
|
|
15208
15208
|
} from "@lexical/table";
|
|
15209
15209
|
import { calculateZoomLevel } from "@lexical/utils";
|
|
15210
15210
|
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
@@ -15328,7 +15328,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
15328
15328
|
editor.update(
|
|
15329
15329
|
() => {
|
|
15330
15330
|
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
15331
|
-
if (!$
|
|
15331
|
+
if (!$isTableCellNode(tableCellNode)) {
|
|
15332
15332
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
15333
15333
|
}
|
|
15334
15334
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow2(tableCellNode);
|
|
@@ -15338,7 +15338,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
15338
15338
|
throw new Error("Expected table cell to be inside of table row.");
|
|
15339
15339
|
}
|
|
15340
15340
|
const tableRow2 = tableRows[tableRowIndex];
|
|
15341
|
-
if (!$
|
|
15341
|
+
if (!$isTableRowNode(tableRow2)) {
|
|
15342
15342
|
throw new Error("Expected table row");
|
|
15343
15343
|
}
|
|
15344
15344
|
let height = tableRow2.getHeight();
|
|
@@ -15390,11 +15390,11 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
15390
15390
|
editor.update(
|
|
15391
15391
|
() => {
|
|
15392
15392
|
const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);
|
|
15393
|
-
if (!$
|
|
15393
|
+
if (!$isTableCellNode(tableCellNode)) {
|
|
15394
15394
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
15395
15395
|
}
|
|
15396
15396
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow2(tableCellNode);
|
|
15397
|
-
const [tableMap] = $
|
|
15397
|
+
const [tableMap] = $computeTableMapSkipCellCheck2(tableNode, null, null);
|
|
15398
15398
|
const columnIndex = getCellColumnIndex(tableCellNode, tableMap);
|
|
15399
15399
|
if (columnIndex === void 0) {
|
|
15400
15400
|
throw new Error("TableCellResizer: Table column not found.");
|
|
@@ -15548,7 +15548,7 @@ import { $findCellNode } from "@lexical/table";
|
|
|
15548
15548
|
import {
|
|
15549
15549
|
$getSelection as $getSelection4,
|
|
15550
15550
|
$isRangeSelection as $isRangeSelection4,
|
|
15551
|
-
$setSelection,
|
|
15551
|
+
$setSelection as $setSelection2,
|
|
15552
15552
|
COMMAND_PRIORITY_NORMAL as COMMAND_PRIORITY_NORMAL2,
|
|
15553
15553
|
SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND2
|
|
15554
15554
|
} from "lexical";
|
|
@@ -15587,7 +15587,7 @@ var TableSelectionPlugin = () => {
|
|
|
15587
15587
|
event.preventDefault();
|
|
15588
15588
|
editor.update(() => {
|
|
15589
15589
|
const selection = closestTableCellNode.select(0, closestTableCellNode.getChildrenSize());
|
|
15590
|
-
$
|
|
15590
|
+
$setSelection2(selection);
|
|
15591
15591
|
});
|
|
15592
15592
|
}
|
|
15593
15593
|
};
|
|
@@ -16266,7 +16266,7 @@ var ParameterRichTextInner = ({
|
|
|
16266
16266
|
CustomCodeNode,
|
|
16267
16267
|
TableNode,
|
|
16268
16268
|
TableCellNode3,
|
|
16269
|
-
|
|
16269
|
+
TableRowNode,
|
|
16270
16270
|
...customNodes != null ? customNodes : []
|
|
16271
16271
|
],
|
|
16272
16272
|
theme: {
|
package/dist/index.js
CHANGED
|
@@ -9632,6 +9632,12 @@ var DateTimePickerVariant = /* @__PURE__ */ ((DateTimePickerVariant2) => {
|
|
|
9632
9632
|
// src/components/DateTimePicker/DateTimePicker.tsx
|
|
9633
9633
|
var import_jsx_runtime65 = require("@emotion/react/jsx-runtime");
|
|
9634
9634
|
var timeZoneOptions = typeof Intl !== "undefined" && typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : ["Etc/UTC"];
|
|
9635
|
+
function getTimezoneOffset(tz) {
|
|
9636
|
+
const now = /* @__PURE__ */ new Date();
|
|
9637
|
+
const utcDate = new Date(now.toLocaleString("en-US", { timeZone: "UTC" }));
|
|
9638
|
+
const tzDate = new Date(now.toLocaleString("en-US", { timeZone: tz }));
|
|
9639
|
+
return (tzDate.getTime() - utcDate.getTime()) / 6e4;
|
|
9640
|
+
}
|
|
9635
9641
|
var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => {
|
|
9636
9642
|
let tz = v;
|
|
9637
9643
|
if (tz === "Europe/Kiev") {
|
|
@@ -9639,8 +9645,14 @@ var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => {
|
|
|
9639
9645
|
}
|
|
9640
9646
|
return {
|
|
9641
9647
|
label: getTimeZoneLabel(tz),
|
|
9642
|
-
value: tz
|
|
9648
|
+
value: tz,
|
|
9649
|
+
offset: getTimezoneOffset(tz)
|
|
9643
9650
|
};
|
|
9651
|
+
}).sort((a, b) => {
|
|
9652
|
+
if (a.offset !== b.offset) {
|
|
9653
|
+
return a.offset - b.offset;
|
|
9654
|
+
}
|
|
9655
|
+
return a.value.localeCompare(b.value);
|
|
9644
9656
|
});
|
|
9645
9657
|
var DateTimePickerContext = (0, import_react79.createContext)({
|
|
9646
9658
|
clearValue() {
|
|
@@ -16840,46 +16852,42 @@ function TableActionMenu({
|
|
|
16840
16852
|
editor.update(() => {
|
|
16841
16853
|
if (tableCellNode.isAttached()) {
|
|
16842
16854
|
const tableNode = (0, import_table.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
16843
|
-
const tableElement2 = editor.getElementByKey(
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
if (!tableElement2) {
|
|
16847
|
-
throw new Error("Expected to find tableElement in DOM");
|
|
16855
|
+
const tableElement2 = (0, import_table.getTableElement)(tableNode, editor.getElementByKey(tableNode.getKey()));
|
|
16856
|
+
if (tableElement2 === null) {
|
|
16857
|
+
throw new Error("TableActionMenu: Expected to find tableElement in DOM");
|
|
16848
16858
|
}
|
|
16849
|
-
const
|
|
16850
|
-
if (
|
|
16851
|
-
|
|
16859
|
+
const tableObserver = (0, import_table.getTableObserverFromTableElement)(tableElement2);
|
|
16860
|
+
if (tableObserver !== null) {
|
|
16861
|
+
tableObserver.$clearHighlight();
|
|
16852
16862
|
}
|
|
16853
|
-
tableNode.markDirty();
|
|
16854
16863
|
updateTableCellNode(tableCellNode.getLatest());
|
|
16855
16864
|
}
|
|
16856
|
-
|
|
16857
|
-
rootNode.selectStart();
|
|
16865
|
+
(0, import_lexical6.$setSelection)(null);
|
|
16858
16866
|
});
|
|
16859
16867
|
}, [editor, tableCellNode]);
|
|
16860
16868
|
const insertTableRowAtSelection = (0, import_react160.useCallback)(
|
|
16861
16869
|
(shouldInsertAfter) => {
|
|
16862
16870
|
editor.update(() => {
|
|
16863
|
-
(0
|
|
16871
|
+
for (let i = 0; i < selectionCounts.rows; i++) {
|
|
16872
|
+
(0, import_table.$insertTableRowAtSelection)(shouldInsertAfter);
|
|
16873
|
+
}
|
|
16864
16874
|
});
|
|
16865
|
-
incrementMenuTriggerKey();
|
|
16866
16875
|
},
|
|
16867
|
-
[editor]
|
|
16876
|
+
[editor, selectionCounts.rows]
|
|
16868
16877
|
);
|
|
16869
16878
|
const insertTableColumnAtSelection = (0, import_react160.useCallback)(
|
|
16870
16879
|
(shouldInsertAfter) => {
|
|
16871
16880
|
editor.update(() => {
|
|
16872
16881
|
for (let i = 0; i < selectionCounts.columns; i++) {
|
|
16873
|
-
(0, import_table.$
|
|
16882
|
+
(0, import_table.$insertTableColumnAtSelection)(shouldInsertAfter);
|
|
16874
16883
|
}
|
|
16875
16884
|
});
|
|
16876
|
-
incrementMenuTriggerKey();
|
|
16877
16885
|
},
|
|
16878
16886
|
[editor, selectionCounts.columns]
|
|
16879
16887
|
);
|
|
16880
16888
|
const deleteTableRowAtSelection = (0, import_react160.useCallback)(() => {
|
|
16881
16889
|
editor.update(() => {
|
|
16882
|
-
(0, import_table.$
|
|
16890
|
+
(0, import_table.$deleteTableRowAtSelection)();
|
|
16883
16891
|
});
|
|
16884
16892
|
incrementMenuTriggerKey();
|
|
16885
16893
|
}, [editor]);
|
|
@@ -16892,7 +16900,7 @@ function TableActionMenu({
|
|
|
16892
16900
|
}, [editor, tableCellNode, clearTableSelection]);
|
|
16893
16901
|
const deleteTableColumnAtSelection = (0, import_react160.useCallback)(() => {
|
|
16894
16902
|
editor.update(() => {
|
|
16895
|
-
(0, import_table.$
|
|
16903
|
+
(0, import_table.$deleteTableColumnAtSelection)();
|
|
16896
16904
|
});
|
|
16897
16905
|
incrementMenuTriggerKey();
|
|
16898
16906
|
}, [editor]);
|
|
@@ -16900,20 +16908,19 @@ function TableActionMenu({
|
|
|
16900
16908
|
editor.update(() => {
|
|
16901
16909
|
const tableNode = (0, import_table.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
16902
16910
|
const tableRowIndex = (0, import_table.$getTableRowIndexFromTableCellNode)(tableCellNode);
|
|
16903
|
-
const
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
|
|
16910
|
-
}
|
|
16911
|
-
tableRow2.getChildren().forEach((tableCell) => {
|
|
16912
|
-
if (!(0, import_table.$isTableCellNode)(tableCell)) {
|
|
16913
|
-
throw new Error("Expected table cell");
|
|
16911
|
+
const [gridMap] = (0, import_table.$computeTableMapSkipCellCheck)(tableNode, null, null);
|
|
16912
|
+
const rowCells = /* @__PURE__ */ new Set();
|
|
16913
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ import_table.TableCellHeaderStates.ROW;
|
|
16914
|
+
for (let col = 0; col < gridMap[tableRowIndex].length; col++) {
|
|
16915
|
+
const mapCell = gridMap[tableRowIndex][col];
|
|
16916
|
+
if (!(mapCell == null ? void 0 : mapCell.cell)) {
|
|
16917
|
+
continue;
|
|
16914
16918
|
}
|
|
16915
|
-
|
|
16916
|
-
|
|
16919
|
+
if (!rowCells.has(mapCell.cell)) {
|
|
16920
|
+
rowCells.add(mapCell.cell);
|
|
16921
|
+
mapCell.cell.setHeaderStyles(newStyle, import_table.TableCellHeaderStates.ROW);
|
|
16922
|
+
}
|
|
16923
|
+
}
|
|
16917
16924
|
clearTableSelection();
|
|
16918
16925
|
});
|
|
16919
16926
|
}, [editor, tableCellNode, clearTableSelection]);
|
|
@@ -16921,25 +16928,18 @@ function TableActionMenu({
|
|
|
16921
16928
|
editor.update(() => {
|
|
16922
16929
|
const tableNode = (0, import_table.$getTableNodeFromLexicalNodeOrThrow)(tableCellNode);
|
|
16923
16930
|
const tableColumnIndex = (0, import_table.$getTableColumnIndexFromTableCellNode)(tableCellNode);
|
|
16924
|
-
const
|
|
16925
|
-
const
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
const tableRow2 = tableRows[r];
|
|
16931
|
-
if (!(0, import_table.$isTableRowNode)(tableRow2)) {
|
|
16932
|
-
throw new Error("Expected table row");
|
|
16933
|
-
}
|
|
16934
|
-
const tableCells = tableRow2.getChildren();
|
|
16935
|
-
if (tableColumnIndex >= tableCells.length) {
|
|
16931
|
+
const [gridMap] = (0, import_table.$computeTableMapSkipCellCheck)(tableNode, null, null);
|
|
16932
|
+
const columnCells = /* @__PURE__ */ new Set();
|
|
16933
|
+
const newStyle = tableCellNode.getHeaderStyles() ^ import_table.TableCellHeaderStates.COLUMN;
|
|
16934
|
+
for (let row = 0; row < gridMap.length; row++) {
|
|
16935
|
+
const mapCell = gridMap[row][tableColumnIndex];
|
|
16936
|
+
if (!(mapCell == null ? void 0 : mapCell.cell)) {
|
|
16936
16937
|
continue;
|
|
16937
16938
|
}
|
|
16938
|
-
|
|
16939
|
-
|
|
16940
|
-
|
|
16939
|
+
if (!columnCells.has(mapCell.cell)) {
|
|
16940
|
+
columnCells.add(mapCell.cell);
|
|
16941
|
+
mapCell.cell.setHeaderStyles(newStyle, import_table.TableCellHeaderStates.COLUMN);
|
|
16941
16942
|
}
|
|
16942
|
-
tableCell.toggleHeaderStyle(import_table.TableCellHeaderStates.COLUMN);
|
|
16943
16943
|
}
|
|
16944
16944
|
clearTableSelection();
|
|
16945
16945
|
});
|
|
@@ -17050,7 +17050,7 @@ function TableCellActionMenuContainer({
|
|
|
17050
17050
|
return;
|
|
17051
17051
|
}
|
|
17052
17052
|
const tableCellParentNodeDOM = editor.getElementByKey(tableCellNodeFromSelection.getKey());
|
|
17053
|
-
if (tableCellParentNodeDOM == null) {
|
|
17053
|
+
if (tableCellParentNodeDOM == null || !tableCellNodeFromSelection.isAttached()) {
|
|
17054
17054
|
setTableMenuCellNode(null);
|
|
17055
17055
|
setTableMenuCellNodeElem(null);
|
|
17056
17056
|
return;
|
|
@@ -17068,7 +17068,7 @@ function TableCellActionMenuContainer({
|
|
|
17068
17068
|
$moveMenu();
|
|
17069
17069
|
});
|
|
17070
17070
|
});
|
|
17071
|
-
});
|
|
17071
|
+
}, [editor, $moveMenu]);
|
|
17072
17072
|
return tableCellNode != null && tableCellNodeEl != null && tableCellMenuPortalEl != null && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
|
|
17073
17073
|
TableActionMenu,
|
|
17074
17074
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/design-system",
|
|
3
|
-
"version": "20.35.1-alpha.
|
|
3
|
+
"version": "20.35.1-alpha.238+9863606d41",
|
|
4
4
|
"description": "Uniform design system components",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"exports": {
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@storybook/theming": "^8.3.3",
|
|
39
39
|
"@types/react": "19.2.2",
|
|
40
40
|
"@types/react-dom": "19.2.2",
|
|
41
|
-
"@uniformdev/canvas": "^20.35.1-alpha.
|
|
42
|
-
"@uniformdev/richtext": "^20.35.1-alpha.
|
|
41
|
+
"@uniformdev/canvas": "^20.35.1-alpha.238+9863606d41",
|
|
42
|
+
"@uniformdev/richtext": "^20.35.1-alpha.238+9863606d41",
|
|
43
43
|
"autoprefixer": "10.4.21",
|
|
44
44
|
"hygen": "6.2.11",
|
|
45
45
|
"jsdom": "20.0.3",
|
|
@@ -59,19 +59,19 @@
|
|
|
59
59
|
"@emotion/css": "11.13.5",
|
|
60
60
|
"@emotion/react": "11.14.0",
|
|
61
61
|
"@internationalized/date": "^3.10.0",
|
|
62
|
-
"@lexical/code": "0.
|
|
63
|
-
"@lexical/link": "0.
|
|
64
|
-
"@lexical/list": "0.
|
|
65
|
-
"@lexical/markdown": "0.
|
|
66
|
-
"@lexical/react": "0.
|
|
67
|
-
"@lexical/rich-text": "0.
|
|
68
|
-
"@lexical/selection": "0.
|
|
69
|
-
"@lexical/table": "0.
|
|
70
|
-
"@lexical/utils": "0.
|
|
62
|
+
"@lexical/code": "0.39.0",
|
|
63
|
+
"@lexical/link": "0.39.0",
|
|
64
|
+
"@lexical/list": "0.39.0",
|
|
65
|
+
"@lexical/markdown": "0.39.0",
|
|
66
|
+
"@lexical/react": "0.39.0",
|
|
67
|
+
"@lexical/rich-text": "0.39.0",
|
|
68
|
+
"@lexical/selection": "0.39.0",
|
|
69
|
+
"@lexical/table": "0.39.0",
|
|
70
|
+
"@lexical/utils": "0.39.0",
|
|
71
71
|
"@monaco-editor/react": "4.7.0",
|
|
72
72
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
|
|
73
73
|
"fast-equals": "^5.3.2",
|
|
74
|
-
"lexical": "0.
|
|
74
|
+
"lexical": "0.39.0",
|
|
75
75
|
"monaco-editor": "0.54.0",
|
|
76
76
|
"react-aria-components": "^1.13.0",
|
|
77
77
|
"react-hotkeys-hook": "5.2.1",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "9863606d41f4248fa790dbf7da6db6a755bda19a"
|
|
95
95
|
}
|