@inshapardaz/likhari-react 0.1.9-dev.94 → 0.1.9-dev.96
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/components/Toolbar.d.ts.map +1 -1
- package/dist/components/Toolbar.js +81 -3
- package/dist/i18n/strings.d.ts +20 -0
- package/dist/i18n/strings.d.ts.map +1 -1
- package/dist/i18n/strings.js +51 -0
- package/dist/table/tableActions.d.ts +21 -0
- package/dist/table/tableActions.d.ts.map +1 -0
- package/dist/table/tableActions.js +71 -0
- package/dist/theme/editor.css +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/components/Toolbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toolbar.d.ts","sourceRoot":"","sources":["../../src/components/Toolbar.tsx"],"names":[],"mappings":"AAsDA,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEzE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAA6D,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAItG,OAAO,KAAK,EAAE,MAAM,EAAW,MAAM,iBAAiB,CAAC;AA8YvD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,2BAA2B,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,wFAAwF;IACxF,SAAS,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IAC1B,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kGAAkG;IAClG,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,wBAAgB,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAkC,EAAE,SAAiB,EAAE,MAAa,EAAE,MAAM,EAAE,EAAE,YAAY,+BAo6BxJ"}
|
|
@@ -12,7 +12,8 @@ import { INSERT_HORIZONTAL_RULE_COMMAND } from '@lexical/react/LexicalHorizontal
|
|
|
12
12
|
import { ImageDialog } from '../image/ImageDialog.js';
|
|
13
13
|
import { $createImageNode } from '../image/ImageNode.js';
|
|
14
14
|
import { TableDialog } from './TableDialog.js';
|
|
15
|
-
import { INSERT_TABLE_COMMAND } from '@lexical/table';
|
|
15
|
+
import { $getTableCellNodeFromLexicalNode, $isTableSelection, INSERT_TABLE_COMMAND } from '@lexical/table';
|
|
16
|
+
import { $deleteTable, $deleteTableColumns, $deleteTableRows, $getTableSelectionSize, $insertTableColumns, $insertTableRows, } from '../table/tableActions.js';
|
|
16
17
|
import { $createLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
17
18
|
import { LinkDialog } from './LinkDialog.js';
|
|
18
19
|
import { DraftsDialog } from './DraftsDialog.js';
|
|
@@ -21,7 +22,7 @@ import { CANVAS_FONT_DEFAULTS, DEFAULT_FONT_OPTIONS, FONT_SIZES_PX } from '../fo
|
|
|
21
22
|
import { setStyleProperty } from '../utils/style.js';
|
|
22
23
|
import { useStrings } from '../i18n/useStrings.js';
|
|
23
24
|
import { usePortalTarget } from '../PortalTargetContext.js';
|
|
24
|
-
import { IconAbc, IconAlignCenter, IconAlignJustified, IconAlignLeft, IconAlignRight, IconArrowBackUp, IconArrowForwardUp, IconBold, IconClearFormatting, IconDeviceFloppy, IconDots, IconHistory, IconExternalLink, IconFeather, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconIndentDecrease, IconIndentIncrease, IconItalic, IconLetterCase, IconLetterCaseLower, IconLetterCaseUpper, IconLink, IconLinkOff, IconList, IconListCheck, IconListNumbers, IconPencil, IconPhoto, IconPilcrow, IconQuote, IconSeparatorHorizontal, IconSparkles, IconStrikethrough, IconSubscript, IconSuperscript, IconTable, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
|
|
25
|
+
import { IconAbc, IconAlignCenter, IconAlignJustified, IconAlignLeft, IconAlignRight, IconArrowBackUp, IconArrowForwardUp, IconBold, IconClearFormatting, IconDeviceFloppy, IconDots, IconHistory, IconExternalLink, IconFeather, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconIndentDecrease, IconIndentIncrease, IconItalic, IconLetterCase, IconLetterCaseLower, IconLetterCaseUpper, IconLink, IconLinkOff, IconList, IconListCheck, IconListNumbers, IconPencil, IconPhoto, IconPilcrow, IconQuote, IconSeparatorHorizontal, IconSparkles, IconStrikethrough, IconSubscript, IconSuperscript, IconColumnInsertLeft, IconColumnInsertRight, IconColumnRemove, IconRowInsertBottom, IconRowInsertTop, IconRowRemove, IconTable, IconTableMinus, IconTableOptions, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
|
|
25
26
|
/** Sentinel for "no inline style": Lexical returns the default it is given when
|
|
26
27
|
* the selection has none, so this tells "unstyled" (show the canvas default)
|
|
27
28
|
* apart from "styled with a value the dropdown doesn't list" (show nothing). */
|
|
@@ -35,6 +36,9 @@ const INITIAL_STATE = {
|
|
|
35
36
|
fontSize: UNSET_STYLE,
|
|
36
37
|
isLink: false,
|
|
37
38
|
linkUrl: '',
|
|
39
|
+
inTable: false,
|
|
40
|
+
tableRows: 1,
|
|
41
|
+
tableColumns: 1,
|
|
38
42
|
canUndo: false,
|
|
39
43
|
canRedo: false,
|
|
40
44
|
};
|
|
@@ -123,6 +127,21 @@ function LinkMenuItems({ url, onEdit, onRemove, strings }) {
|
|
|
123
127
|
// Not a URL the editor would accept (e.g. loaded from a document): show it, don't make it clickable.
|
|
124
128
|
_jsx(Menu.Item, { disabled: true, title: url, className: "likhari-link-menu-url", children: url || strings.link.noUrl })), _jsx(Menu.Item, { leftSection: _jsx(IconPencil, { size: ICON_SIZE, stroke: ICON_STROKE }), onMouseDown: (e) => e.preventDefault(), onClick: onEdit, children: strings.link.editLink }), _jsx(Menu.Item, { color: "red", leftSection: _jsx(IconLinkOff, { size: ICON_SIZE, stroke: ICON_STROKE }), onMouseDown: (e) => e.preventDefault(), onClick: onRemove, children: strings.link.removeLink })] }));
|
|
125
129
|
}
|
|
130
|
+
/** The table actions menu's contents — shared by the toolbar button and the
|
|
131
|
+
* right-click menu. Each acts on the selected cell, or on every row/column a
|
|
132
|
+
* multi-cell selection covers. */
|
|
133
|
+
function TableMenuItems({ strings, direction, rows, columns, onAction, }) {
|
|
134
|
+
const t = strings.tableMenu;
|
|
135
|
+
// "Before" is the start side, which is on the right in an RTL table.
|
|
136
|
+
const rtl = direction === 'rtl';
|
|
137
|
+
const manyRows = rows > 1;
|
|
138
|
+
const manyColumns = columns > 1;
|
|
139
|
+
const item = (icon, label, action, color) => {
|
|
140
|
+
const Icon = icon;
|
|
141
|
+
return (_jsx(Menu.Item, { color: color, leftSection: _jsx(Icon, { size: ICON_SIZE, stroke: ICON_STROKE }), onMouseDown: (e) => e.preventDefault(), onClick: onAction(action), children: label }));
|
|
142
|
+
};
|
|
143
|
+
return (_jsxs(_Fragment, { children: [_jsx(Menu.Label, { children: t.menuLabel }), item(IconRowInsertTop, manyRows ? t.insertRowsBefore : t.insertRowBefore, () => $insertTableRows(false)), item(IconRowInsertBottom, manyRows ? t.insertRowsAfter : t.insertRowAfter, () => $insertTableRows(true)), item(rtl ? IconColumnInsertRight : IconColumnInsertLeft, manyColumns ? t.insertColumnsBefore : t.insertColumnBefore, () => $insertTableColumns(false)), item(rtl ? IconColumnInsertLeft : IconColumnInsertRight, manyColumns ? t.insertColumnsAfter : t.insertColumnAfter, () => $insertTableColumns(true)), _jsx(Menu.Divider, {}), item(IconRowRemove, manyRows ? t.deleteRows : t.deleteRow, $deleteTableRows), item(IconColumnRemove, manyColumns ? t.deleteColumns : t.deleteColumn, $deleteTableColumns), item(IconTableMinus, t.deleteTable, $deleteTable, 'red')] }));
|
|
144
|
+
}
|
|
126
145
|
export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAULT_FONT_OPTIONS, direction = 'ltr', locale = 'en', drafts }) {
|
|
127
146
|
const [editor] = useLexicalComposerContext();
|
|
128
147
|
const [state, setState] = useState(INITIAL_STATE);
|
|
@@ -141,9 +160,17 @@ export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAU
|
|
|
141
160
|
const updateToolbar = useCallback(() => {
|
|
142
161
|
editor.getEditorState().read(() => {
|
|
143
162
|
const selection = $getSelection();
|
|
163
|
+
// A selection of several table cells isn't a range selection.
|
|
164
|
+
if ($isTableSelection(selection)) {
|
|
165
|
+
const { rows, columns } = $getTableSelectionSize();
|
|
166
|
+
setState((s) => ({ ...s, inTable: true, tableRows: rows, tableColumns: columns }));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
144
169
|
if (!$isRangeSelection(selection))
|
|
145
170
|
return;
|
|
146
171
|
const anchorNode = selection.anchor.getNode();
|
|
172
|
+
const inTable = $getTableCellNodeFromLexicalNode(anchorNode) !== null;
|
|
173
|
+
const tableSize = inTable ? $getTableSelectionSize() : { rows: 1, columns: 1 };
|
|
147
174
|
const element = anchorNode.getKey() === 'root' ? anchorNode : (anchorNode.getTopLevelElement() ?? anchorNode);
|
|
148
175
|
const listParent = $findMatchingParent(anchorNode, $isListNode);
|
|
149
176
|
const listType = listParent && $isListNode(listParent) ? listParent.getListType() : null;
|
|
@@ -179,6 +206,9 @@ export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAU
|
|
|
179
206
|
fontSize,
|
|
180
207
|
isLink,
|
|
181
208
|
linkUrl,
|
|
209
|
+
inTable,
|
|
210
|
+
tableRows: tableSize.rows,
|
|
211
|
+
tableColumns: tableSize.columns,
|
|
182
212
|
}));
|
|
183
213
|
});
|
|
184
214
|
}, [editor]);
|
|
@@ -391,6 +421,50 @@ export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAU
|
|
|
391
421
|
root?.addEventListener('contextmenu', onContextMenu);
|
|
392
422
|
});
|
|
393
423
|
}, [editor, config.links]);
|
|
424
|
+
// Table actions. The menu takes focus, so the selection is snapshotted when it
|
|
425
|
+
// opens and restored before an action runs.
|
|
426
|
+
const runTableAction = (action) => () => {
|
|
427
|
+
restoreSelection();
|
|
428
|
+
editor.update(action);
|
|
429
|
+
editor.focus();
|
|
430
|
+
};
|
|
431
|
+
// Right-clicking a table cell opens the same actions at the pointer.
|
|
432
|
+
const [tableContext, setTableContext] = useState(null);
|
|
433
|
+
useEffect(() => {
|
|
434
|
+
if (!config.tables)
|
|
435
|
+
return;
|
|
436
|
+
const onContextMenu = (event) => {
|
|
437
|
+
if (event.defaultPrevented)
|
|
438
|
+
return; // a link inside the cell already took it
|
|
439
|
+
const cellElement = event.target?.closest?.('td, th');
|
|
440
|
+
if (!cellElement)
|
|
441
|
+
return;
|
|
442
|
+
let handled = false;
|
|
443
|
+
editor.update(() => {
|
|
444
|
+
const node = $getNearestNodeFromDOMNode(cellElement);
|
|
445
|
+
const cell = node ? $getTableCellNodeFromLexicalNode(node) : null;
|
|
446
|
+
if (!cell)
|
|
447
|
+
return;
|
|
448
|
+
handled = true;
|
|
449
|
+
const selection = $getSelection();
|
|
450
|
+
// Keep a multi-cell selection that includes this cell, so "insert
|
|
451
|
+
// rows" / "delete columns" act on everything selected.
|
|
452
|
+
const insideSelection = $isTableSelection(selection) && selection.getNodes().some((n) => n.getKey() === cell.getKey());
|
|
453
|
+
if (!insideSelection)
|
|
454
|
+
cell.selectEnd();
|
|
455
|
+
}, { discrete: true });
|
|
456
|
+
if (!handled)
|
|
457
|
+
return;
|
|
458
|
+
event.preventDefault();
|
|
459
|
+
snapshotSelectionRef.current();
|
|
460
|
+
const size = editor.getEditorState().read($getTableSelectionSize);
|
|
461
|
+
setTableContext({ x: event.clientX, y: event.clientY, rows: size.rows, columns: size.columns });
|
|
462
|
+
};
|
|
463
|
+
return editor.registerRootListener((root, previous) => {
|
|
464
|
+
previous?.removeEventListener('contextmenu', onContextMenu);
|
|
465
|
+
root?.addEventListener('contextmenu', onContextMenu);
|
|
466
|
+
});
|
|
467
|
+
}, [editor, config.tables]);
|
|
394
468
|
// Ctrl/Cmd+K opens the link dialog.
|
|
395
469
|
useEffect(() => {
|
|
396
470
|
if (!config.links)
|
|
@@ -622,6 +696,7 @@ export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAU
|
|
|
622
696
|
openLinkDialog();
|
|
623
697
|
}, onRemove: removeLink, strings: strings }) })] })) : (_jsx(ToolbarButton, { icon: IconLink, title: strings.toolbar.insertLink, onClick: openLinkDialog })) }, "link")),
|
|
624
698
|
showStubInsertGroup && (_jsxs("div", { className: "likhari-toolbar-group likhari-toolbar-group--collapse-tablet", children: [(config.images.linked || config.images.embedded) && (_jsx(ToolbarButton, { icon: IconPhoto, title: strings.toolbar.insertImage, onClick: openImageDialog })), config.tables && _jsx(ToolbarButton, { icon: IconTable, title: strings.toolbar.insertTable, onClick: openTableDialog }), config.blocks.horizontalRule && (_jsx(ToolbarButton, { icon: IconSeparatorHorizontal, title: strings.toolbar.insertHorizontalRule, onClick: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined) })), config.poetry.enabled && _jsx(StubButton, { icon: IconFeather, title: strings.toolbar.poetryBlocks, comingSoon: strings.toolbar.comingSoon })] }, "stubInsert")),
|
|
699
|
+
config.tables && state.inTable && (_jsx("div", { className: "likhari-toolbar-group", children: _jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx("button", { type: "button", className: "likhari-toolbar-button", "data-active": "true", "aria-pressed": "true", "aria-haspopup": "menu", "aria-label": strings.toolbar.tableOptions, title: strings.toolbar.tableOptions, onMouseDown: (e) => e.preventDefault(), children: _jsx(IconTableOptions, { size: ICON_SIZE, stroke: ICON_STROKE }) }) }), _jsx(Menu.Dropdown, { children: _jsx(TableMenuItems, { strings: strings, direction: direction, rows: state.tableRows, columns: state.tableColumns, onAction: runTableAction }) })] }) }, "tableActions")),
|
|
625
700
|
showLanguageGroup && (_jsxs("div", { className: "likhari-toolbar-group likhari-toolbar-group--collapse-tablet", children: [config.language.autocorrect && _jsx(StubButton, { icon: IconWand, title: strings.toolbar.autocorrect, comingSoon: strings.toolbar.comingSoon }), config.language.textCleanup && _jsx(StubButton, { icon: IconSparkles, title: strings.toolbar.textCleanup, comingSoon: strings.toolbar.comingSoon }), config.language.spellCheck && _jsx(StubButton, { icon: IconAbc, title: strings.toolbar.spellChecker, comingSoon: strings.toolbar.comingSoon })] }, "language")),
|
|
626
701
|
];
|
|
627
702
|
return (_jsxs("div", { className: "likhari-toolbar", role: "toolbar", "aria-label": strings.toolbar.ariaLabel, ref: toolbarContainerRef, children: [fixedGroups, movableGroups
|
|
@@ -634,7 +709,10 @@ export function Toolbar({ config, onSave, isDirty, showSave, fontOptions = DEFAU
|
|
|
634
709
|
}, position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, children: [_jsx(Menu.Target, { children: _jsx("span", { "aria-hidden": "true", style: { position: 'fixed', left: linkContext?.x ?? -9999, top: linkContext?.y ?? -9999, width: 1, height: 1, pointerEvents: 'none' } }) }), _jsx(Menu.Dropdown, { children: _jsx(LinkMenuItems, { url: linkContext?.url ?? '', onEdit: () => {
|
|
635
710
|
restoreSelection();
|
|
636
711
|
openLinkDialog();
|
|
637
|
-
}, onRemove: removeLink, strings: strings }) })] })), _jsxs(
|
|
712
|
+
}, onRemove: removeLink, strings: strings }) })] })), config.tables && (_jsxs(Menu, { opened: tableContext !== null, onChange: (opened) => {
|
|
713
|
+
if (!opened)
|
|
714
|
+
setTableContext(null);
|
|
715
|
+
}, position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, children: [_jsx(Menu.Target, { children: _jsx("span", { "aria-hidden": "true", style: { position: 'fixed', left: tableContext?.x ?? -9999, top: tableContext?.y ?? -9999, width: 1, height: 1, pointerEvents: 'none' } }) }), _jsx(Menu.Dropdown, { children: _jsx(TableMenuItems, { strings: strings, direction: direction, rows: tableContext?.rows ?? 1, columns: tableContext?.columns ?? 1, onAction: runTableAction }) })] })), _jsxs("div", { "aria-hidden": "true", ref: toolbarMeasureRef, style: {
|
|
638
716
|
position: 'absolute',
|
|
639
717
|
visibility: 'hidden',
|
|
640
718
|
pointerEvents: 'none',
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -38,6 +38,8 @@ export interface Strings {
|
|
|
38
38
|
noMatch: string;
|
|
39
39
|
alignment: string;
|
|
40
40
|
linkOptions: string;
|
|
41
|
+
/** Toolbar button (shown while the caret is in a table) that opens the table actions menu. */
|
|
42
|
+
tableOptions: string;
|
|
41
43
|
insertLink: string;
|
|
42
44
|
insertImage: string;
|
|
43
45
|
insertTable: string;
|
|
@@ -109,6 +111,24 @@ export interface Strings {
|
|
|
109
111
|
delete: string;
|
|
110
112
|
close: string;
|
|
111
113
|
};
|
|
114
|
+
/** The table actions menu (toolbar button and right-click on a cell). */
|
|
115
|
+
tableMenu: {
|
|
116
|
+
menuLabel: string;
|
|
117
|
+
insertRowBefore: string;
|
|
118
|
+
insertRowAfter: string;
|
|
119
|
+
insertColumnBefore: string;
|
|
120
|
+
insertColumnAfter: string;
|
|
121
|
+
deleteRow: string;
|
|
122
|
+
deleteColumn: string;
|
|
123
|
+
deleteTable: string;
|
|
124
|
+
/** Plural forms, used when the selection spans several rows or columns. */
|
|
125
|
+
insertRowsBefore: string;
|
|
126
|
+
insertRowsAfter: string;
|
|
127
|
+
insertColumnsBefore: string;
|
|
128
|
+
insertColumnsAfter: string;
|
|
129
|
+
deleteRows: string;
|
|
130
|
+
deleteColumns: string;
|
|
131
|
+
};
|
|
112
132
|
link: {
|
|
113
133
|
menuLabel: string;
|
|
114
134
|
noUrl: string;
|
|
@@ -1 +1 @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,MAAM,CAAA;SAAE,GAAG,IAAI,KAAK,MAAM,CAAC;QACxE,MAAM,EAAE;YACN,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;SAC3C,CAAC;KACH,CAAC;IACF,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAqkBD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAI3C,CAAC;AAEF;;sDAEsD;AACtD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD"}
|
package/dist/i18n/strings.js
CHANGED
|
@@ -31,6 +31,7 @@ const en = {
|
|
|
31
31
|
noMatch: 'No match',
|
|
32
32
|
alignment: 'Alignment',
|
|
33
33
|
linkOptions: 'Link options',
|
|
34
|
+
tableOptions: 'Table options',
|
|
34
35
|
insertLink: 'Insert link (Ctrl+K)',
|
|
35
36
|
insertImage: 'Insert image',
|
|
36
37
|
insertTable: 'Insert table',
|
|
@@ -97,6 +98,22 @@ const en = {
|
|
|
97
98
|
delete: 'Delete',
|
|
98
99
|
close: 'Close',
|
|
99
100
|
},
|
|
101
|
+
tableMenu: {
|
|
102
|
+
menuLabel: 'Table',
|
|
103
|
+
insertRowBefore: 'Insert row before',
|
|
104
|
+
insertRowAfter: 'Insert row after',
|
|
105
|
+
insertColumnBefore: 'Insert column before',
|
|
106
|
+
insertColumnAfter: 'Insert column after',
|
|
107
|
+
deleteRow: 'Delete row',
|
|
108
|
+
deleteColumn: 'Delete column',
|
|
109
|
+
deleteTable: 'Delete table',
|
|
110
|
+
insertRowsBefore: 'Insert rows before',
|
|
111
|
+
insertRowsAfter: 'Insert rows after',
|
|
112
|
+
insertColumnsBefore: 'Insert columns before',
|
|
113
|
+
insertColumnsAfter: 'Insert columns after',
|
|
114
|
+
deleteRows: 'Delete rows',
|
|
115
|
+
deleteColumns: 'Delete columns',
|
|
116
|
+
},
|
|
100
117
|
link: {
|
|
101
118
|
menuLabel: 'Link',
|
|
102
119
|
noUrl: '(no URL)',
|
|
@@ -205,6 +222,7 @@ const ur = {
|
|
|
205
222
|
noMatch: 'کوئی مماثلت نہیں',
|
|
206
223
|
alignment: 'سیدھ',
|
|
207
224
|
linkOptions: 'لنک کے اختیارات',
|
|
225
|
+
tableOptions: 'جدول کے اختیارات',
|
|
208
226
|
insertLink: 'لنک شامل کریں (Ctrl+K)',
|
|
209
227
|
insertImage: 'تصویر شامل کریں',
|
|
210
228
|
insertTable: 'جدول شامل کریں',
|
|
@@ -271,6 +289,22 @@ const ur = {
|
|
|
271
289
|
delete: 'حذف کریں',
|
|
272
290
|
close: 'بند کریں',
|
|
273
291
|
},
|
|
292
|
+
tableMenu: {
|
|
293
|
+
menuLabel: 'جدول',
|
|
294
|
+
insertRowBefore: 'پہلے قطار شامل کریں',
|
|
295
|
+
insertRowAfter: 'بعد میں قطار شامل کریں',
|
|
296
|
+
insertColumnBefore: 'پہلے کالم شامل کریں',
|
|
297
|
+
insertColumnAfter: 'بعد میں کالم شامل کریں',
|
|
298
|
+
deleteRow: 'قطار حذف کریں',
|
|
299
|
+
deleteColumn: 'کالم حذف کریں',
|
|
300
|
+
deleteTable: 'جدول حذف کریں',
|
|
301
|
+
insertRowsBefore: 'پہلے قطاریں شامل کریں',
|
|
302
|
+
insertRowsAfter: 'بعد میں قطاریں شامل کریں',
|
|
303
|
+
insertColumnsBefore: 'پہلے کالمز شامل کریں',
|
|
304
|
+
insertColumnsAfter: 'بعد میں کالمز شامل کریں',
|
|
305
|
+
deleteRows: 'قطاریں حذف کریں',
|
|
306
|
+
deleteColumns: 'کالمز حذف کریں',
|
|
307
|
+
},
|
|
274
308
|
link: {
|
|
275
309
|
menuLabel: 'لنک',
|
|
276
310
|
noUrl: '(کوئی یو آر ایل نہیں)',
|
|
@@ -379,6 +413,7 @@ const paShahmukhi = {
|
|
|
379
413
|
noMatch: 'کوئی نئیں ملیا',
|
|
380
414
|
alignment: 'سیدھ',
|
|
381
415
|
linkOptions: 'لنک دے اختیار',
|
|
416
|
+
tableOptions: 'ٹیبل دے اختیار',
|
|
382
417
|
insertLink: 'لنک پاؤ (Ctrl+K)',
|
|
383
418
|
insertImage: 'تصویر پاؤ',
|
|
384
419
|
insertTable: 'ٹیبل پاؤ',
|
|
@@ -445,6 +480,22 @@ const paShahmukhi = {
|
|
|
445
480
|
delete: 'مٹاؤ',
|
|
446
481
|
close: 'بند کرو',
|
|
447
482
|
},
|
|
483
|
+
tableMenu: {
|
|
484
|
+
menuLabel: 'ٹیبل',
|
|
485
|
+
insertRowBefore: 'پہلاں قطار پاؤ',
|
|
486
|
+
insertRowAfter: 'بعد وچ قطار پاؤ',
|
|
487
|
+
insertColumnBefore: 'پہلاں کالم پاؤ',
|
|
488
|
+
insertColumnAfter: 'بعد وچ کالم پاؤ',
|
|
489
|
+
deleteRow: 'قطار مٹاؤ',
|
|
490
|
+
deleteColumn: 'کالم مٹاؤ',
|
|
491
|
+
deleteTable: 'ٹیبل مٹاؤ',
|
|
492
|
+
insertRowsBefore: 'پہلاں قطاراں پاؤ',
|
|
493
|
+
insertRowsAfter: 'بعد وچ قطاراں پاؤ',
|
|
494
|
+
insertColumnsBefore: 'پہلاں کالماں پاؤ',
|
|
495
|
+
insertColumnsAfter: 'بعد وچ کالماں پاؤ',
|
|
496
|
+
deleteRows: 'قطاراں مٹاؤ',
|
|
497
|
+
deleteColumns: 'کالماں مٹاؤ',
|
|
498
|
+
},
|
|
448
499
|
link: {
|
|
449
500
|
menuLabel: 'لنک',
|
|
450
501
|
noUrl: '(کوئی یو آر ایل نئیں)',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** How many rows and columns the selection spans (1 × 1 for a caret in a cell, 0 × 0 outside a table). */
|
|
2
|
+
export declare function $getTableSelectionSize(): {
|
|
3
|
+
rows: number;
|
|
4
|
+
columns: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Inserts as many rows as the selection spans, before its first row or after
|
|
8
|
+
* its last. Lexical's own insert works from the selection's focus cell and adds
|
|
9
|
+
* one row, so with several rows selected it would land mid-selection.
|
|
10
|
+
*/
|
|
11
|
+
export declare function $insertTableRows(insertAfter: boolean): void;
|
|
12
|
+
/** Like $insertTableRows, for columns. "Before" is the column index below the
|
|
13
|
+
* first selected one (the right-hand side in a right-to-left table). */
|
|
14
|
+
export declare function $insertTableColumns(insertAfter: boolean): void;
|
|
15
|
+
/** Deletes every row the selection touches (Lexical handles a multi-cell selection). */
|
|
16
|
+
export declare function $deleteTableRows(): void;
|
|
17
|
+
/** Deletes every column the selection touches. */
|
|
18
|
+
export declare function $deleteTableColumns(): void;
|
|
19
|
+
/** Removes the whole table the selection is in. */
|
|
20
|
+
export declare function $deleteTable(): void;
|
|
21
|
+
//# sourceMappingURL=tableActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableActions.d.ts","sourceRoot":"","sources":["../../src/table/tableActions.ts"],"names":[],"mappings":"AA2BA,0GAA0G;AAC1G,wBAAgB,sBAAsB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAS1E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAS3D;AAED;wEACwE;AACxE,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,CAQ9D;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED,kDAAkD;AAClD,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,mDAAmD;AACnD,wBAAgB,YAAY,IAAI,IAAI,CAInC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { $deleteTableColumn__EXPERIMENTAL, $deleteTableRow__EXPERIMENTAL, $getTableCellNodeFromLexicalNode, $getTableColumnIndexFromTableCellNode, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $insertTableColumn__EXPERIMENTAL, $insertTableRow__EXPERIMENTAL, $isTableCellNode, $isTableSelection, } from '@lexical/table';
|
|
2
|
+
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
3
|
+
/** Table cells the selection covers: the caret's own cell, or every cell of a
|
|
4
|
+
* multi-cell selection. Empty when the selection isn't in a table. */
|
|
5
|
+
function $selectedCells() {
|
|
6
|
+
const selection = $getSelection();
|
|
7
|
+
if ($isTableSelection(selection))
|
|
8
|
+
return selection.getNodes().filter($isTableCellNode);
|
|
9
|
+
if ($isRangeSelection(selection)) {
|
|
10
|
+
const cell = $getTableCellNodeFromLexicalNode(selection.anchor.getNode());
|
|
11
|
+
return cell ? [cell] : [];
|
|
12
|
+
}
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
/** How many rows and columns the selection spans (1 × 1 for a caret in a cell, 0 × 0 outside a table). */
|
|
16
|
+
export function $getTableSelectionSize() {
|
|
17
|
+
const cells = $selectedCells();
|
|
18
|
+
if (cells.length === 0)
|
|
19
|
+
return { rows: 0, columns: 0 };
|
|
20
|
+
const rows = cells.map($getTableRowIndexFromTableCellNode);
|
|
21
|
+
const columns = cells.map($getTableColumnIndexFromTableCellNode);
|
|
22
|
+
return {
|
|
23
|
+
rows: Math.max(...rows) - Math.min(...rows) + 1,
|
|
24
|
+
columns: Math.max(...columns) - Math.min(...columns) + 1,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Inserts as many rows as the selection spans, before its first row or after
|
|
29
|
+
* its last. Lexical's own insert works from the selection's focus cell and adds
|
|
30
|
+
* one row, so with several rows selected it would land mid-selection.
|
|
31
|
+
*/
|
|
32
|
+
export function $insertTableRows(insertAfter) {
|
|
33
|
+
const cells = $selectedCells();
|
|
34
|
+
if (cells.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
const rows = cells.map($getTableRowIndexFromTableCellNode);
|
|
37
|
+
const first = Math.min(...rows);
|
|
38
|
+
const last = Math.max(...rows);
|
|
39
|
+
// Park the caret in a cell on the edge row; every insert then lands right next to it.
|
|
40
|
+
cells[rows.indexOf(insertAfter ? last : first)].selectEnd();
|
|
41
|
+
for (let i = 0; i <= last - first; i++)
|
|
42
|
+
$insertTableRow__EXPERIMENTAL(insertAfter);
|
|
43
|
+
}
|
|
44
|
+
/** Like $insertTableRows, for columns. "Before" is the column index below the
|
|
45
|
+
* first selected one (the right-hand side in a right-to-left table). */
|
|
46
|
+
export function $insertTableColumns(insertAfter) {
|
|
47
|
+
const cells = $selectedCells();
|
|
48
|
+
if (cells.length === 0)
|
|
49
|
+
return;
|
|
50
|
+
const columns = cells.map($getTableColumnIndexFromTableCellNode);
|
|
51
|
+
const first = Math.min(...columns);
|
|
52
|
+
const last = Math.max(...columns);
|
|
53
|
+
cells[columns.indexOf(insertAfter ? last : first)].selectEnd();
|
|
54
|
+
for (let i = 0; i <= last - first; i++)
|
|
55
|
+
$insertTableColumn__EXPERIMENTAL(insertAfter);
|
|
56
|
+
}
|
|
57
|
+
/** Deletes every row the selection touches (Lexical handles a multi-cell selection). */
|
|
58
|
+
export function $deleteTableRows() {
|
|
59
|
+
$deleteTableRow__EXPERIMENTAL();
|
|
60
|
+
}
|
|
61
|
+
/** Deletes every column the selection touches. */
|
|
62
|
+
export function $deleteTableColumns() {
|
|
63
|
+
$deleteTableColumn__EXPERIMENTAL();
|
|
64
|
+
}
|
|
65
|
+
/** Removes the whole table the selection is in. */
|
|
66
|
+
export function $deleteTable() {
|
|
67
|
+
const selection = $getSelection();
|
|
68
|
+
const anchor = $isRangeSelection(selection) || $isTableSelection(selection) ? selection.anchor.getNode() : null;
|
|
69
|
+
if (anchor)
|
|
70
|
+
$getTableNodeFromLexicalNodeOrThrow(anchor).remove();
|
|
71
|
+
}
|
package/dist/theme/editor.css
CHANGED
|
@@ -51,6 +51,12 @@
|
|
|
51
51
|
pointer-events: none;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/* pointer-events is inherited, so without this every menu, dropdown and dialog
|
|
55
|
+
portaled into the (pointer-transparent) anchor would be unclickable. */
|
|
56
|
+
.likhari-portal-target > * {
|
|
57
|
+
pointer-events: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
.likhari-toolbar-group {
|
|
55
61
|
display: flex;
|
|
56
62
|
align-items: center;
|