@haklex/rich-plugin-table 0.69.0 → 0.69.1
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/TableCellResizerPlugin.d.ts +1 -1
- package/dist/TableCellResizerPlugin.d.ts.map +1 -1
- package/dist/TableHandleMenus.d.ts +2 -2
- package/dist/TableHandleMenus.d.ts.map +1 -1
- package/dist/TableRowColumnHandlesPlugin.d.ts +1 -1
- package/dist/TableRowColumnHandlesPlugin.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +7 -5
- package/dist/styles.css.d.ts.map +1 -1
- package/dist/table-actions.d.ts +1 -1
- package/dist/table-actions.d.ts.map +1 -1
- package/package.json +3 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCellResizerPlugin.d.ts","
|
|
1
|
+
{"version":3,"file":"TableCellResizerPlugin.d.ts","sources":["../src/TableCellResizerPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAqC,YAAY,EAAE,MAAM,OAAO,CAAC;AAgP7E,wBAAgB,sBAAsB,IAAI,YAAY,CASrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { TableAction } from './table-actions';
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { TableAction } from './table-actions';
|
|
3
3
|
interface TableHandleMenuProps {
|
|
4
4
|
isHeader: boolean;
|
|
5
5
|
onAction: (action: TableAction) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHandleMenus.d.ts","
|
|
1
|
+
{"version":3,"file":"TableHandleMenus.d.ts","sources":["../src/TableHandleMenus.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAInD,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,YAAY,GACb,EAAE,oBAAoB,GAAG,YAAY,CA+BrC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,QAAQ,EACR,YAAY,GACb,EAAE,oBAAoB,GAAG,YAAY,CA+BrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowColumnHandlesPlugin.d.ts","
|
|
1
|
+
{"version":3,"file":"TableRowColumnHandlesPlugin.d.ts","sources":["../src/TableRowColumnHandlesPlugin.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAuPzD,wBAAgB,2BAA2B,IAAI,YAAY,CAS1D"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -376,10 +376,10 @@ function measure(editor, cellKey) {
|
|
|
376
376
|
const cellEl = editor.getElementByKey(cellKey);
|
|
377
377
|
const tableEl = cellEl?.closest("table");
|
|
378
378
|
if (!cellEl || !tableEl || !cellEl.isConnected) return null;
|
|
379
|
-
const header = editor.read(() => {
|
|
379
|
+
const header = editor.getEditorState().read(() => {
|
|
380
380
|
const node = $getNodeByKey(cellKey);
|
|
381
381
|
return $isTableCellNode(node) ? $getTableHeaderState(node) : null;
|
|
382
|
-
});
|
|
382
|
+
}, { editor });
|
|
383
383
|
if (!header) return null;
|
|
384
384
|
const scrollX = window.scrollX;
|
|
385
385
|
const scrollY = window.scrollY;
|
|
@@ -417,11 +417,16 @@ function TableRowColumnHandlesInner({ editor }) {
|
|
|
417
417
|
const [selectionKey, setSelectionKey] = useState(null);
|
|
418
418
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
419
419
|
const [layout, setLayout] = useState(null);
|
|
420
|
+
const [measuredKey, setMeasuredKey] = useState(null);
|
|
420
421
|
const [frozenKey, setFrozenKey] = useState(null);
|
|
421
422
|
const [editable, setEditable] = useState(() => editor.isEditable());
|
|
422
423
|
const hideTimerRef = useRef(null);
|
|
423
424
|
const overHandlesRef = useRef(false);
|
|
424
425
|
const activeKey = menuOpen ? frozenKey : hoverKey ?? selectionKey;
|
|
426
|
+
if (measuredKey !== activeKey) {
|
|
427
|
+
setMeasuredKey(activeKey);
|
|
428
|
+
setLayout(activeKey ? measure(editor, activeKey) : null);
|
|
429
|
+
}
|
|
425
430
|
const clearHideTimer = useCallback(() => {
|
|
426
431
|
if (hideTimerRef.current) {
|
|
427
432
|
clearTimeout(hideTimerRef.current);
|
|
@@ -437,9 +442,6 @@ function TableRowColumnHandlesInner({ editor }) {
|
|
|
437
442
|
const remeasure = useCallback(() => {
|
|
438
443
|
setLayout(activeKey ? measure(editor, activeKey) : null);
|
|
439
444
|
}, [activeKey, editor]);
|
|
440
|
-
useEffect(() => {
|
|
441
|
-
remeasure();
|
|
442
|
-
}, [remeasure]);
|
|
443
445
|
useEffect(() => {
|
|
444
446
|
const rootElement = editor.getRootElement();
|
|
445
447
|
if (!rootElement) return;
|
package/dist/styles.css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,QAQvB,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAE7B,CAAC;AAEH,eAAO,MAAM,iBAAiB,QAS5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,QAS7B,CAAC;AAEH,eAAO,MAAM,QAAQ,QAYnB,CAAC;AAEH,eAAO,MAAM,SAAS,QA2BpB,CAAC;AAEH,eAAO,MAAM,SAAS,QAqBpB,CAAC"}
|
package/dist/table-actions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableCellNode } from '@lexical/table';
|
|
1
|
+
import { type TableCellNode } from '@lexical/table';
|
|
2
2
|
export type TableAction = 'insert-row-above' | 'insert-row-below' | 'insert-column-left' | 'insert-column-right' | 'append-row' | 'append-column' | 'toggle-header-row' | 'toggle-header-column' | 'delete-row' | 'delete-column';
|
|
3
3
|
export interface TableHeaderState {
|
|
4
4
|
column: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-actions.d.ts","
|
|
1
|
+
{"version":3,"file":"table-actions.d.ts","sources":["../src/table-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,YAAY,GACZ,eAAe,GACf,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,eAAe,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,aAAa,GAAG,gBAAgB,CAK1E;AAsBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAgD9E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-plugin-table",
|
|
3
|
-
"version": "0.69.
|
|
3
|
+
"version": "0.69.1",
|
|
4
4
|
"description": "Table editing plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,13 +31,11 @@
|
|
|
31
31
|
"lucide-react": "^1.59.0",
|
|
32
32
|
"react": "^19.3.1",
|
|
33
33
|
"react-dom": "^19.3.1",
|
|
34
|
-
"typescript": "^7.0.2",
|
|
35
|
-
"unplugin-dts": "^1.1.2",
|
|
36
34
|
"vite": "^8.3.5"
|
|
37
35
|
},
|
|
38
36
|
"peerDependencies": {
|
|
39
|
-
"@haklex/rich-editor-ui": "^0.69.
|
|
40
|
-
"@haklex/rich-style-token": "^0.69.
|
|
37
|
+
"@haklex/rich-editor-ui": "^0.69.1",
|
|
38
|
+
"@haklex/rich-style-token": "^0.69.1",
|
|
41
39
|
"@lexical/react": "^0.53.0",
|
|
42
40
|
"@lexical/table": "^0.53.0",
|
|
43
41
|
"lexical": "^0.53.0",
|