@inshapardaz/likhari-react 0.1.49 → 0.1.51-dev.407
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/autocorrect/AutoCorrectPlugin.d.ts.map +1 -1
- package/dist/autocorrect/AutoCorrectPlugin.js +25 -5
- package/dist/autocorrect/autoCorrectActions.d.ts.map +1 -1
- package/dist/autocorrect/autoCorrectActions.js +5 -3
- package/dist/autocorrect/autoCorrectStores.d.ts +17 -1
- package/dist/autocorrect/autoCorrectStores.d.ts.map +1 -1
- package/dist/autocorrect/autoCorrectStores.js +68 -12
- package/dist/autocorrect/punctuationRules.d.ts +8 -0
- package/dist/autocorrect/punctuationRules.d.ts.map +1 -1
- package/dist/autocorrect/punctuationRules.js +13 -2
- package/dist/cleanup/textCleanupActions.d.ts +3 -2
- package/dist/cleanup/textCleanupActions.d.ts.map +1 -1
- package/dist/cleanup/textCleanupActions.js +21 -3
- package/dist/components/AutoCorrectPanel.d.ts.map +1 -1
- package/dist/components/AutoCorrectPanel.js +3 -2
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/components/Toolbar.js +111 -35
- package/dist/components/ToolbarSettingsPanel.d.ts +17 -0
- package/dist/components/ToolbarSettingsPanel.d.ts.map +1 -0
- package/dist/components/ToolbarSettingsPanel.js +12 -0
- package/dist/i18n/strings.d.ts +18 -0
- package/dist/i18n/strings.d.ts.map +1 -1
- package/dist/i18n/strings.js +48 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/join/joinLinesActions.d.ts.map +1 -1
- package/dist/join/joinLinesActions.js +12 -14
- package/dist/theme/editor.css +54 -0
- package/dist/toolbar/toolbarVisibility.d.ts +23 -0
- package/dist/toolbar/toolbarVisibility.d.ts.map +1 -0
- package/dist/toolbar/toolbarVisibility.js +40 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment, forwardRef, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { Menu, Select, Toolbar as MantineToolbar } from '@mantine/core';
|
|
3
|
+
import { Menu, Popover, Select, Toolbar as MantineToolbar } from '@mantine/core';
|
|
4
4
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
5
5
|
import { $getSelection, $isRangeSelection, $isElementNode, $setSelection, $getRoot, $selectAll, $getNearestNodeFromDOMNode, $createTextNode, KEY_MODIFIER_COMMAND, COMMAND_PRIORITY_NORMAL, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, UNDO_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, COMMAND_PRIORITY_LOW, } from 'lexical';
|
|
6
6
|
import { $getSelectionStyleValueForProperty, $patchStyleText, $setBlocksType } from '@lexical/selection';
|
|
@@ -31,12 +31,14 @@ import { $canMergeSelectedCells, $canUnmergeSelectedCell, $deleteTable, $deleteT
|
|
|
31
31
|
import { $createLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
32
32
|
import { LinkDialog } from './LinkDialog.js';
|
|
33
33
|
import { DraftsDialog } from './DraftsDialog.js';
|
|
34
|
+
import { ToolbarSettingsPanel } from './ToolbarSettingsPanel.js';
|
|
35
|
+
import { useToolbarItemVisibility } from '../toolbar/toolbarVisibility.js';
|
|
34
36
|
import { normalizeLinkUrl } from '../utils/linkUrl.js';
|
|
35
37
|
import { CANVAS_FONT_DEFAULTS, DEFAULT_FONT_OPTIONS, FONT_SIZES_PX, ZOOM_LEVELS_PERCENT } from '../fonts/index.js';
|
|
36
38
|
import { setStyleProperty } from '../utils/style.js';
|
|
37
39
|
import { useStrings } from '../i18n/useStrings.js';
|
|
38
40
|
import { usePortalTarget } from '../PortalTargetContext.js';
|
|
39
|
-
import { IconAbc, IconAlignCenter, IconAlignJustified, IconAlignLeft, IconAlignRight, IconArrowBackUp, IconArrowForwardUp, IconArrowsJoin, IconBold, IconClearFormatting, IconDeviceFloppy, IconBook, IconChevronDown, IconChevronUp, IconDots, IconHelpCircle, IconHistory, IconExternalLink, IconFeather, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconIndentDecrease, IconIndentIncrease, IconItalic, IconLetterCase, IconLetterCaseLower, IconLetterCaseUpper, IconLink, IconLinkOff, IconList, IconListCheck, IconListNumbers, IconPageBreak, IconPencil, IconPhoto, IconPilcrow, IconQuote, IconSeparatorHorizontal, IconSparkles, IconStrikethrough, IconSubscript, IconSuperscript, IconArrowMergeBoth, IconArrowsSplit2, IconColumnInsertLeft, IconColumnInsertRight, IconColumnRemove, IconColumns, IconClipboard, IconCopy, IconCut, IconSearch, IconSelectAll, IconColumns1, IconColumns2, IconNumber1Small, IconRowInsertBottom, IconRowInsertTop, IconRowRemove, IconArrowsShuffle, IconTable, IconTableMinus, IconTableOptions, IconMinus, IconPlus, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
|
|
41
|
+
import { IconAbc, IconAlignCenter, IconAlignJustified, IconAlignLeft, IconAlignRight, IconArrowBackUp, IconArrowForwardUp, IconArrowsJoin, IconBold, IconClearFormatting, IconDeviceFloppy, IconBook, IconChevronDown, IconChevronUp, IconDots, IconHelpCircle, IconHistory, IconExternalLink, IconFeather, IconH1, IconH2, IconH3, IconH4, IconH5, IconH6, IconIndentDecrease, IconIndentIncrease, IconItalic, IconLetterCase, IconLetterCaseLower, IconLetterCaseUpper, IconLink, IconLinkOff, IconList, IconListCheck, IconListNumbers, IconPageBreak, IconPencil, IconPhoto, IconPilcrow, IconQuote, IconSeparatorHorizontal, IconSettings, IconSparkles, IconStrikethrough, IconSubscript, IconSuperscript, IconArrowMergeBoth, IconArrowsSplit2, IconColumnInsertLeft, IconColumnInsertRight, IconColumnRemove, IconColumns, IconClipboard, IconCopy, IconCut, IconSearch, IconSelectAll, IconColumns1, IconColumns2, IconNumber1Small, IconRowInsertBottom, IconRowInsertTop, IconRowRemove, IconArrowsShuffle, IconTable, IconTableMinus, IconTableOptions, IconMinus, IconPlus, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
|
|
40
42
|
import { IconCoupletCenterNarrow, IconCoupletCenterWide, IconCoupletDelete, IconCoupletGutterNarrow, IconCoupletGutterWide, IconCoupletSpacingLoose, IconCoupletSpacingTight, IconCoupletStaggerNarrow, IconCoupletStaggerWide, IconPoetryDelete, } from '../icons/poetryIcons.js';
|
|
41
43
|
/** Sentinel for "no inline style": Lexical returns the default it is given when
|
|
42
44
|
* the selection has none, so this tells "unstyled" (show the canvas default)
|
|
@@ -277,6 +279,8 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
277
279
|
const strings = useStrings(locale);
|
|
278
280
|
const portalTarget = usePortalTarget();
|
|
279
281
|
const [draftsOpen, setDraftsOpen] = useState(false);
|
|
282
|
+
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
283
|
+
const { isHidden, toggle: toggleHidden } = useToolbarItemVisibility();
|
|
280
284
|
const rtl = direction === 'rtl';
|
|
281
285
|
const ALIGN_ICONS = rtl ? ALIGN_ICONS_RTL : ALIGN_ICONS_LTR;
|
|
282
286
|
// Responsive "priority+" overflow (UI spec §3.3): the toolbar's outer
|
|
@@ -289,6 +293,7 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
289
293
|
// join lines) is lower priority still, so it is first to move.
|
|
290
294
|
const toolbarContainerRef = useRef(null);
|
|
291
295
|
const toolbarMeasureRef = useRef(null);
|
|
296
|
+
const toolbarOverflowMeasureRef = useRef(null);
|
|
292
297
|
const [overflowGroupKeys, setOverflowGroupKeys] = useState(EMPTY_OVERFLOW);
|
|
293
298
|
const updateToolbar = useCallback(() => {
|
|
294
299
|
editor.getEditorState().read(() => {
|
|
@@ -691,8 +696,7 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
691
696
|
word = atPoint;
|
|
692
697
|
}
|
|
693
698
|
if (!cell && !couplet && config.joinLines) {
|
|
694
|
-
menu.text =
|
|
695
|
-
menu.canJoin = $canJoinLines();
|
|
699
|
+
menu.text = $canJoinLines();
|
|
696
700
|
}
|
|
697
701
|
}, { discrete: true });
|
|
698
702
|
const language = spellCheckLanguage !== 'auto' ? spellCheckLanguage : word?.direction === 'rtl' ? 'ur' : 'en';
|
|
@@ -846,9 +850,9 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
846
850
|
(config.poetry.enabled && locale !== 'en') ||
|
|
847
851
|
(config.tables && state.inTable) ||
|
|
848
852
|
(config.poetry.enabled && state.inPoetry);
|
|
849
|
-
const
|
|
853
|
+
const allMoreItems = [];
|
|
850
854
|
if (fmt.superscript) {
|
|
851
|
-
|
|
855
|
+
allMoreItems.push({
|
|
852
856
|
key: 'superscript',
|
|
853
857
|
icon: IconSuperscript,
|
|
854
858
|
label: strings.toolbar.superscript,
|
|
@@ -857,7 +861,7 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
857
861
|
});
|
|
858
862
|
}
|
|
859
863
|
if (fmt.subscript) {
|
|
860
|
-
|
|
864
|
+
allMoreItems.push({
|
|
861
865
|
key: 'subscript',
|
|
862
866
|
icon: IconSubscript,
|
|
863
867
|
label: strings.toolbar.subscript,
|
|
@@ -866,14 +870,16 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
866
870
|
});
|
|
867
871
|
}
|
|
868
872
|
if (fmt.caseTransforms) {
|
|
869
|
-
|
|
873
|
+
allMoreItems.push({ key: 'upper', icon: IconLetterCaseUpper, label: strings.toolbar.uppercase, onClick: () => applyCaseTransform('upper') }, { key: 'lower', icon: IconLetterCaseLower, label: strings.toolbar.lowercase, onClick: () => applyCaseTransform('lower') }, { key: 'capitalize', icon: IconLetterCase, label: strings.toolbar.capitalize, onClick: () => applyCaseTransform('capitalize') });
|
|
870
874
|
}
|
|
871
875
|
if (fmt.clearFormatting) {
|
|
872
|
-
|
|
876
|
+
allMoreItems.push({ key: 'clear', icon: IconClearFormatting, label: strings.toolbar.clearFormatting, onClick: clearFormatting });
|
|
873
877
|
}
|
|
878
|
+
// The user can hide any of these individually from the toolbar settings panel.
|
|
879
|
+
const moreItems = allMoreItems.filter((item) => !isHidden(item.key));
|
|
874
880
|
// UI spec §5: indent/outdent arrows are direction-relative and swap in RTL
|
|
875
881
|
// (outdent moves content toward the start edge, which is the right in RTL).
|
|
876
|
-
const
|
|
882
|
+
const allIndentItems = config.indent
|
|
877
883
|
? [
|
|
878
884
|
{
|
|
879
885
|
key: 'outdent',
|
|
@@ -889,6 +895,7 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
889
895
|
},
|
|
890
896
|
]
|
|
891
897
|
: [];
|
|
898
|
+
const indentItems = allIndentItems.filter((item) => !isHidden(item.key));
|
|
892
899
|
// Grouped for the dropdown when options declare groups (Latin / Urdu).
|
|
893
900
|
const fontData = (() => {
|
|
894
901
|
const data = [];
|
|
@@ -934,22 +941,31 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
934
941
|
];
|
|
935
942
|
const formattingValue = state.listType ?? state.blockType;
|
|
936
943
|
const AlignIcon = ALIGN_ICONS[state.elementFormat] ?? IconAlignLeft;
|
|
937
|
-
const
|
|
938
|
-
const
|
|
939
|
-
const
|
|
944
|
+
const showParagraphStyle = showFormattingGroup && !isHidden('paragraphStyle');
|
|
945
|
+
const showBold = fmt.bold && !isHidden('bold');
|
|
946
|
+
const showItalic = fmt.italic && !isHidden('italic');
|
|
947
|
+
const showUnderline = fmt.underline && !isHidden('underline');
|
|
948
|
+
const showStrikethrough = fmt.strikethrough && !isHidden('strikethrough');
|
|
949
|
+
const formatSection = (showParagraphStyle || showBold || showItalic || showUnderline || showStrikethrough || moreItems.length > 0) && (_jsxs(Fragment, { children: [showParagraphStyle && (_jsx(MantineToolbar.Group, { children: _jsx(ToolbarSelect, { icon: IconPilcrow, label: strings.toolbar.formattingLabel, width: 148, value: formattingValue, data: formattingOptions, comingSoon: strings.toolbar.comingSoon, renderOption: iconOptionRenderer(FORMATTING_ICONS, IconPilcrow), onMouseDown: snapshotSelection, onChange: withRefocus((v) => applyFormatting(v)) }) })), (showBold || showItalic || showUnderline || showStrikethrough || moreItems.length > 0) && (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: [showBold && _jsx(ToolbarButton, { icon: IconBold, title: strings.toolbar.bold, active: state.activeFormats.has('bold'), onClick: () => formatText('bold') }), showItalic && (_jsx(ToolbarButton, { icon: IconItalic, title: strings.toolbar.italic, active: state.activeFormats.has('italic'), onClick: () => formatText('italic') })), showUnderline && (_jsx(ToolbarButton, { icon: IconUnderline, title: strings.toolbar.underline, active: state.activeFormats.has('underline'), onClick: () => formatText('underline') })), showStrikethrough && (_jsx(ToolbarButton, { icon: IconStrikethrough, title: strings.toolbar.strikethrough, active: state.activeFormats.has('strikethrough'), onClick: () => formatText('strikethrough') })), moreItems.length > 0 && (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 210, closeOnItemClick: true, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconDots, title: strings.toolbar.moreFormatting }) }), _jsx(Menu.Dropdown, { children: moreItems.map((item) => (_jsx(MoreMenuItem, { icon: item.icon, label: item.label, active: item.active, onClick: runMenuItem(item.onClick) }, item.key))) })] }))] }))] }, "format"));
|
|
950
|
+
const showAlignSelect = showAlignGroup && !isHidden('alignment');
|
|
951
|
+
const alignSection = (showAlignSelect || indentItems.length > 0) && (_jsxs(Fragment, { children: [showAlignSelect && (_jsx(MantineToolbar.Group, { children: _jsx(ToolbarSelect, { icon: AlignIcon, label: strings.toolbar.alignment, width: 138, value: state.elementFormat || 'start', data: alignOptions, renderOption: iconOptionRenderer(ALIGN_ICONS, IconAlignLeft), onMouseDown: snapshotSelection, onChange: withRefocus((v) => formatElement(v)) }) })), indentItems.length > 0 && (_jsx(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: indentItems.map((item) => (_jsx(ToolbarButton, { icon: item.icon, title: item.label, onClick: item.onClick }, item.key))) }))] }, "align"));
|
|
952
|
+
const showFontFamily = config.font.family && !isHidden('fontFamily');
|
|
953
|
+
const showFontSize = config.font.size && !uniform && !isHidden('fontSize');
|
|
954
|
+
const fontSection = (showFontFamily || showFontSize) && (_jsxs(MantineToolbar.Group, { children: [showFontFamily && (_jsx(ToolbarSelect, { icon: IconTypography, label: strings.toolbar.fontFamily, width: 150, value: fontOptions.some((f) => f.family === shownFontFamily) ? shownFontFamily : null, placeholder: strings.toolbar.fontFamilyPlaceholder, data: fontData, searchable: true, noMatchMessage: strings.toolbar.noMatch, renderOption: ({ option }) => _jsx("span", { style: { fontFamily: option.value }, children: option.label }), onMouseDown: snapshotSelection, onChange: uniform
|
|
940
955
|
? // A view setting: leave the editor state and selection alone, just hand the caret back.
|
|
941
956
|
(v) => {
|
|
942
957
|
onUniformFontFamilyChange?.(v);
|
|
943
958
|
editor.focus();
|
|
944
959
|
}
|
|
945
|
-
: withRefocus((v) => applyFont('font-family', v)) })),
|
|
960
|
+
: withRefocus((v) => applyFont('font-family', v)) })), showFontSize && (_jsx(ToolbarSelect, { icon: IconTextSize, label: strings.toolbar.fontSize, width: 84, value: FONT_SIZES_PX.some((px) => `${px}px` === shownFontSize) ? shownFontSize : null, placeholder: strings.toolbar.fontSizePlaceholder, data: FONT_SIZES_PX.map((px) => ({ value: `${px}px`, label: String(px) })), onMouseDown: snapshotSelection, onChange: withRefocus((v) => applyFont('font-size', v)) }))] }, "font"));
|
|
946
961
|
/** The insert commands. `contextual` also puts the link, table and poetry option menus among them (the classic
|
|
947
962
|
* toolbar); the ribbon shows those on their own tabs instead. */
|
|
948
963
|
const insertButtons = (contextual) => (_jsxs(_Fragment, { children: [config.links &&
|
|
964
|
+
!isHidden('link') &&
|
|
949
965
|
(contextual && state.isLink ? (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconLink, title: strings.toolbar.linkOptions, active: true, "aria-haspopup": "menu" }) }), _jsx(Menu.Dropdown, { children: _jsx(LinkMenuItems, { url: state.linkUrl, onEdit: () => {
|
|
950
966
|
restoreSelection();
|
|
951
967
|
openLinkDialog();
|
|
952
|
-
}, onRemove: removeLink, strings: strings }) })] })) : (_jsx(ToolbarButton, { icon: IconLink, title: strings.toolbar.insertLink, onClick: openLinkDialog }))), (config.images.linked || config.images.embedded) && (_jsx(ToolbarButton, { icon: IconPhoto, title: strings.toolbar.insertImage, onClick: openImageDialog })), config.blocks.horizontalRule && (_jsx(ToolbarButton, { icon: IconSeparatorHorizontal, title: strings.toolbar.insertHorizontalRule, onClick: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined) })), config.tables && _jsx(ToolbarButton, { icon: IconTable, title: strings.toolbar.insertTable, onClick: openTableDialog }), contextual && config.tables && state.inTable && (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconTableOptions, title: strings.toolbar.tableOptions, active: true, "aria-haspopup": "menu" }) }), _jsx(Menu.Dropdown, { children: _jsx(TableMenuItems, { strings: strings, direction: direction, rows: state.tableRows, columns: state.tableColumns, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction }) })] })), config.columns && _jsx(ToolbarButton, { icon: IconColumns, title: strings.toolbar.insertColumns, onClick: openLayoutDialog }), config.footnotes && (_jsx(ToolbarButton, { icon: IconNumber1Small, title: strings.toolbar.insertFootnote, onClick: () => editor.dispatchCommand(INSERT_FOOTNOTE_COMMAND, undefined) })), config.blocks.pageBreak && (_jsx(ToolbarButton, { icon: IconPageBreak, title: strings.toolbar.insertPageBreak, onClick: () => editor.dispatchCommand(INSERT_PAGE_BREAK_COMMAND, undefined) })), config.poetry.enabled && locale !== 'en' && (_jsx(ToolbarButton, { icon: IconFeather, title: strings.toolbar.insertPoetryCouplet, onClick: () => editor.dispatchCommand(INSERT_POETRY_COUPLET_COMMAND, { layout: config.poetry.defaultLayout }) })), contextual && config.poetry.enabled && state.inPoetry && (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 200, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconFeather, title: strings.toolbar.poetryOptions, active: true, "aria-haspopup": "menu" }) }), _jsx(Menu.Dropdown, { children: _jsx(PoetryMenuItems, { strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction }) })] }))] }));
|
|
968
|
+
}, onRemove: removeLink, strings: strings }) })] })) : (_jsx(ToolbarButton, { icon: IconLink, title: strings.toolbar.insertLink, onClick: openLinkDialog }))), (config.images.linked || config.images.embedded) && !isHidden('image') && (_jsx(ToolbarButton, { icon: IconPhoto, title: strings.toolbar.insertImage, onClick: openImageDialog })), config.blocks.horizontalRule && !isHidden('horizontalRule') && (_jsx(ToolbarButton, { icon: IconSeparatorHorizontal, title: strings.toolbar.insertHorizontalRule, onClick: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined) })), config.tables && !isHidden('table') && _jsx(ToolbarButton, { icon: IconTable, title: strings.toolbar.insertTable, onClick: openTableDialog }), contextual && config.tables && state.inTable && (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 240, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconTableOptions, title: strings.toolbar.tableOptions, active: true, "aria-haspopup": "menu" }) }), _jsx(Menu.Dropdown, { children: _jsx(TableMenuItems, { strings: strings, direction: direction, rows: state.tableRows, columns: state.tableColumns, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction }) })] })), config.columns && !isHidden('columns') && _jsx(ToolbarButton, { icon: IconColumns, title: strings.toolbar.insertColumns, onClick: openLayoutDialog }), config.footnotes && !isHidden('footnote') && (_jsx(ToolbarButton, { icon: IconNumber1Small, title: strings.toolbar.insertFootnote, onClick: () => editor.dispatchCommand(INSERT_FOOTNOTE_COMMAND, undefined) })), config.blocks.pageBreak && !isHidden('pageBreak') && (_jsx(ToolbarButton, { icon: IconPageBreak, title: strings.toolbar.insertPageBreak, onClick: () => editor.dispatchCommand(INSERT_PAGE_BREAK_COMMAND, undefined) })), config.poetry.enabled && locale !== 'en' && !isHidden('poetry') && (_jsx(ToolbarButton, { icon: IconFeather, title: strings.toolbar.insertPoetryCouplet, onClick: () => editor.dispatchCommand(INSERT_POETRY_COUPLET_COMMAND, { layout: config.poetry.defaultLayout }) })), contextual && config.poetry.enabled && state.inPoetry && (_jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 200, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconFeather, title: strings.toolbar.poetryOptions, active: true, "aria-haspopup": "menu" }) }), _jsx(Menu.Dropdown, { children: _jsx(PoetryMenuItems, { strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction }) })] }))] }));
|
|
953
969
|
const insertSection = showInsertGroup && (_jsx(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: insertButtons(true) }, "insert"));
|
|
954
970
|
const joinLines = () => {
|
|
955
971
|
editor.update(() => {
|
|
@@ -991,9 +1007,8 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
991
1007
|
void wordActionAtCaret((language, word) => onAddAutoCorrect(word, language));
|
|
992
1008
|
};
|
|
993
1009
|
// Keyboard shortcuts mirroring the right-click menu: Ctrl/Cmd+Alt+J joins the
|
|
994
|
-
// selected lines
|
|
995
|
-
//
|
|
996
|
-
// way the menu's Ignore / Add to dictionary / Add to auto-correct items do.
|
|
1010
|
+
// selected lines, and Ctrl/Cmd+Alt+I/D/A act on the misspelled word at the caret
|
|
1011
|
+
// the way the menu's Ignore / Add to dictionary / Add to auto-correct items do.
|
|
997
1012
|
// Matched on event.code (the physical key), not event.key, so they still fire
|
|
998
1013
|
// while typing in Urdu or another non-Latin layout, where event.key would be
|
|
999
1014
|
// whatever character that layout produces rather than "j"/"i"/"d"/"a".
|
|
@@ -1033,23 +1048,79 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1033
1048
|
});
|
|
1034
1049
|
// The tools group is always built, even when every command in it is off, so the ribbon asks first.
|
|
1035
1050
|
const hasToolsGroup = config.language.autocorrect || config.language.textCleanup || config.language.spellCheck || config.joinLines;
|
|
1036
|
-
const toolsSection = (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: [config.language.autocorrect && (_jsx(ToolbarButton, { icon: IconWand, title: strings.toolbar.autocorrect, active: autoCorrectOpen, onClick: onToggleAutoCorrect })), config.language.textCleanup && (_jsx(ToolbarButton, { icon: IconSparkles, title: strings.autoCorrect.correctDocument, onClick: () => editor.dispatchCommand(CORRECT_DOCUMENT_COMMAND, undefined) })), config.language.spellCheck && (_jsx(ToolbarButton, { icon: IconAbc, title: strings.toolbar.spellChecker, active: spellOpen, onClick: onToggleSpell })), config.joinLines && (_jsx(ToolbarButton, { icon: IconArrowsJoin, title: strings.toolbar.joinLines,
|
|
1051
|
+
const toolsSection = (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: [config.language.autocorrect && !isHidden('autocorrect') && (_jsx(ToolbarButton, { icon: IconWand, title: strings.toolbar.autocorrect, active: autoCorrectOpen, onClick: onToggleAutoCorrect })), config.language.textCleanup && !isHidden('textCleanup') && (_jsx(ToolbarButton, { icon: IconSparkles, title: strings.autoCorrect.correctDocument, onClick: () => editor.dispatchCommand(CORRECT_DOCUMENT_COMMAND, undefined) })), config.language.spellCheck && !isHidden('spellCheck') && (_jsx(ToolbarButton, { icon: IconAbc, title: strings.toolbar.spellChecker, active: spellOpen, onClick: onToggleSpell })), config.joinLines && state.canJoinLines && !isHidden('joinLines') && (_jsx(ToolbarButton, { icon: IconArrowsJoin, title: strings.toolbar.joinLines, onClick: joinLines }))] }, "tools"));
|
|
1037
1052
|
// Uniform mode's zoom: [-] 100% [+], stepping through the preset levels; the
|
|
1038
1053
|
// percentage resets to 100%. Always laid out left-to-right, like a number.
|
|
1039
|
-
const showZoom = uniform && config.font.size;
|
|
1054
|
+
const showZoom = uniform && config.font.size && !isHidden('zoom');
|
|
1040
1055
|
const zoomOutTo = [...ZOOM_LEVELS_PERCENT].reverse().find((level) => level < zoom);
|
|
1041
1056
|
const zoomInTo = ZOOM_LEVELS_PERCENT.find((level) => level > zoom);
|
|
1042
|
-
const hasEndUtilities = Boolean(drafts || config.findReplace || helpUrl !== false);
|
|
1043
1057
|
const zoomGroup = showZoom && (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", role: "group", "aria-label": strings.toolbar.zoom, dir: "ltr", children: [_jsx(ToolbarButton, { icon: IconMinus, title: strings.toolbar.zoomOut, disabled: zoomOutTo === undefined, onClick: () => zoomOutTo !== undefined && onZoomChange?.(zoomOutTo) }), _jsxs(MantineToolbar.Toggle, { title: strings.toolbar.zoomReset, "aria-label": `${strings.toolbar.zoomReset} (${zoom}%)`, onMouseDown: (e) => e.preventDefault(), onClick: () => onZoomChange?.(100), style: { width: 'auto', minWidth: 52, padding: '0 6px', fontSize: 12 }, children: [zoom, "%"] }), _jsx(ToolbarButton, { icon: IconPlus, title: strings.toolbar.zoomIn, disabled: zoomInTo === undefined, onClick: () => zoomInTo !== undefined && onZoomChange?.(zoomInTo) })] }, "zoom"));
|
|
1044
|
-
const draftsButton = drafts && _jsx(ToolbarButton, { icon: IconHistory, title: strings.toolbar.drafts, onClick: () => setDraftsOpen(true) });
|
|
1045
|
-
const findButton = config.findReplace && (_jsx(ToolbarButton, { icon: IconSearch, title: strings.findReplace.toggle, active: findOpen, onClick: onToggleFind }));
|
|
1046
|
-
const helpButton = helpUrl !== false && (_jsx(MantineToolbar.Toggle, { component: "a", href: helpUrl ?? DEFAULT_HELP_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": strings.toolbar.help, title: strings.toolbar.help, children: _jsx(IconHelpCircle, { size: ICON_SIZE, stroke: ICON_STROKE }) }));
|
|
1047
|
-
//
|
|
1048
|
-
|
|
1049
|
-
|
|
1058
|
+
const draftsButton = drafts && !isHidden('drafts') && _jsx(ToolbarButton, { icon: IconHistory, title: strings.toolbar.drafts, onClick: () => setDraftsOpen(true) });
|
|
1059
|
+
const findButton = config.findReplace && !isHidden('find') && (_jsx(ToolbarButton, { icon: IconSearch, title: strings.findReplace.toggle, active: findOpen, onClick: onToggleFind }));
|
|
1060
|
+
const helpButton = helpUrl !== false && !isHidden('help') && (_jsx(MantineToolbar.Toggle, { component: "a", href: helpUrl ?? DEFAULT_HELP_URL, target: "_blank", rel: "noopener noreferrer", "aria-label": strings.toolbar.help, title: strings.toolbar.help, children: _jsx(IconHelpCircle, { size: ICON_SIZE, stroke: ICON_STROKE }) }));
|
|
1061
|
+
// Every item the settings panel can show/hide, grouped the way it appears in the
|
|
1062
|
+
// toolbar. Built from what the host's EditorFeatureConfig makes available — a
|
|
1063
|
+
// feature the host turned off is never offered here, since this panel only lets
|
|
1064
|
+
// the user declutter what the host already enabled.
|
|
1065
|
+
const settingsGroup = (id, label, items) => {
|
|
1066
|
+
const present = items.filter((item) => Boolean(item));
|
|
1067
|
+
return present.length > 0 ? { id, label, items: present } : null;
|
|
1068
|
+
};
|
|
1069
|
+
const t = strings.toolbar;
|
|
1070
|
+
const settingsGroups = [
|
|
1071
|
+
settingsGroup('formatting', strings.toolbarSettings.groups.formatting, [
|
|
1072
|
+
showFormattingGroup && { id: 'paragraphStyle', label: t.formattingLabel },
|
|
1073
|
+
fmt.bold && { id: 'bold', label: t.bold },
|
|
1074
|
+
fmt.italic && { id: 'italic', label: t.italic },
|
|
1075
|
+
fmt.underline && { id: 'underline', label: t.underline },
|
|
1076
|
+
fmt.strikethrough && { id: 'strikethrough', label: t.strikethrough },
|
|
1077
|
+
...allMoreItems.map((item) => ({ id: item.key, label: item.label })),
|
|
1078
|
+
]),
|
|
1079
|
+
settingsGroup('alignment', strings.toolbarSettings.groups.alignment, [
|
|
1080
|
+
showAlignGroup && { id: 'alignment', label: t.alignment },
|
|
1081
|
+
...allIndentItems.map((item) => ({ id: item.key, label: item.label })),
|
|
1082
|
+
]),
|
|
1083
|
+
settingsGroup('font', strings.toolbarSettings.groups.font, [
|
|
1084
|
+
config.font.family && { id: 'fontFamily', label: t.fontFamily },
|
|
1085
|
+
config.font.size && !uniform && { id: 'fontSize', label: t.fontSize },
|
|
1086
|
+
]),
|
|
1087
|
+
settingsGroup('insert', strings.toolbarSettings.groups.insert, [
|
|
1088
|
+
config.links && { id: 'link', label: t.insertLink },
|
|
1089
|
+
(config.images.linked || config.images.embedded) && { id: 'image', label: t.insertImage },
|
|
1090
|
+
config.blocks.horizontalRule && { id: 'horizontalRule', label: t.insertHorizontalRule },
|
|
1091
|
+
config.tables && { id: 'table', label: t.insertTable },
|
|
1092
|
+
config.columns && { id: 'columns', label: t.insertColumns },
|
|
1093
|
+
config.footnotes && { id: 'footnote', label: t.insertFootnote },
|
|
1094
|
+
config.blocks.pageBreak && { id: 'pageBreak', label: t.insertPageBreak },
|
|
1095
|
+
config.poetry.enabled && locale !== 'en' && { id: 'poetry', label: t.insertPoetryCouplet },
|
|
1096
|
+
]),
|
|
1097
|
+
settingsGroup('tools', strings.toolbarSettings.groups.tools, [
|
|
1098
|
+
config.language.autocorrect && { id: 'autocorrect', label: t.autocorrect },
|
|
1099
|
+
config.language.textCleanup && { id: 'textCleanup', label: strings.autoCorrect.correctDocument },
|
|
1100
|
+
config.language.spellCheck && { id: 'spellCheck', label: t.spellChecker },
|
|
1101
|
+
config.joinLines && { id: 'joinLines', label: t.joinLines },
|
|
1102
|
+
]),
|
|
1103
|
+
settingsGroup('zoom', strings.toolbarSettings.groups.zoom, [uniform && config.font.size && { id: 'zoom', label: t.zoom }]),
|
|
1104
|
+
settingsGroup('utilities', strings.toolbarSettings.groups.utilities, [
|
|
1105
|
+
drafts && { id: 'drafts', label: t.drafts },
|
|
1106
|
+
config.findReplace && { id: 'find', label: strings.findReplace.toggle },
|
|
1107
|
+
helpUrl !== false && { id: 'help', label: t.help },
|
|
1108
|
+
]),
|
|
1109
|
+
settingsGroup('history', strings.toolbarSettings.groups.history, [
|
|
1110
|
+
showSave && { id: 'save', label: t.save },
|
|
1111
|
+
config.history && { id: 'undo', label: t.undo },
|
|
1112
|
+
config.history && { id: 'redo', label: t.redo },
|
|
1113
|
+
]),
|
|
1114
|
+
].filter((g) => g !== null);
|
|
1115
|
+
const settingsButton = (_jsxs(Popover, { opened: settingsOpen, onChange: setSettingsOpen, position: "bottom-end", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 280, children: [_jsx(Popover.Target, { children: _jsx(ToolbarButton, { icon: IconSettings, title: strings.toolbar.settings, active: settingsOpen, onClick: () => setSettingsOpen((v) => !v) }) }), _jsx(Popover.Dropdown, { p: 0, children: _jsx(ToolbarSettingsPanel, { strings: strings, dir: direction, groups: settingsGroups, isHidden: isHidden, onToggle: toggleHidden, onClose: () => setSettingsOpen(false) }) })] }));
|
|
1116
|
+
// Drafts, search, help and the settings gear: the far-end group (see `endMovable` below).
|
|
1117
|
+
const utilitiesGroup = (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: [draftsButton, findButton, helpButton, settingsButton] }, "end"));
|
|
1118
|
+
const saveGroup = showSave && !isHidden('save') && (_jsx(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: _jsx(ToolbarButton, { icon: IconDeviceFloppy, title: strings.toolbar.save, dirty: Boolean(isDirty),
|
|
1050
1119
|
// Nothing to save until the content has changed since it was loaded or last saved.
|
|
1051
1120
|
disabled: !isDirty, onClick: onSave }) }, "save"));
|
|
1052
|
-
const
|
|
1121
|
+
const showUndo = !isHidden('undo');
|
|
1122
|
+
const showRedo = !isHidden('redo');
|
|
1123
|
+
const historyGroup = config.history && (showUndo || showRedo) && (_jsxs(MantineToolbar.Group, { className: "likhari-toolbar-cluster", children: [showUndo && (_jsx(ToolbarButton, { icon: IconArrowBackUp, title: strings.toolbar.undo, disabled: !state.canUndo, onClick: () => editor.dispatchCommand(UNDO_COMMAND, undefined) })), showRedo && (_jsx(ToolbarButton, { icon: IconArrowForwardUp, title: strings.toolbar.redo, disabled: !state.canRedo, onClick: () => editor.dispatchCommand(REDO_COMMAND, undefined) }))] }, "history"));
|
|
1053
1124
|
const startSections = [
|
|
1054
1125
|
saveGroup,
|
|
1055
1126
|
historyGroup,
|
|
@@ -1081,10 +1152,9 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1081
1152
|
const measure = toolbarMeasureRef.current;
|
|
1082
1153
|
if (!container || !measure)
|
|
1083
1154
|
return;
|
|
1084
|
-
//
|
|
1085
|
-
//
|
|
1086
|
-
|
|
1087
|
-
const OVERFLOW_BUTTON_WIDTH = 38;
|
|
1155
|
+
// Fallback only, in case the overflow button's own hidden measurement
|
|
1156
|
+
// element (below) isn't mounted yet on the very first pass.
|
|
1157
|
+
const OVERFLOW_BUTTON_FALLBACK_WIDTH = 38;
|
|
1088
1158
|
const recompute = () => {
|
|
1089
1159
|
const available = container.clientWidth;
|
|
1090
1160
|
const total = measure.scrollWidth;
|
|
@@ -1096,6 +1166,10 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1096
1166
|
measure.querySelectorAll('[data-group-key]').forEach((el) => {
|
|
1097
1167
|
widths.set(el.dataset.groupKey, el.getBoundingClientRect().width);
|
|
1098
1168
|
});
|
|
1169
|
+
// Measured from a real (hidden) copy of the "..." button, in the toolbar's own
|
|
1170
|
+
// CSS, rather than guessed — only charged against the budget once something
|
|
1171
|
+
// has actually moved into it, since it isn't rendered at all otherwise.
|
|
1172
|
+
const overflowButtonWidth = toolbarOverflowMeasureRef.current?.scrollWidth ?? OVERFLOW_BUTTON_FALLBACK_WIDTH;
|
|
1099
1173
|
let remaining = total;
|
|
1100
1174
|
const next = new Set();
|
|
1101
1175
|
for (const key of movableGroupKeys.split(',').filter(Boolean)) {
|
|
@@ -1108,13 +1182,15 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1108
1182
|
next.add(key);
|
|
1109
1183
|
}
|
|
1110
1184
|
if (next.size > 0)
|
|
1111
|
-
remaining +=
|
|
1185
|
+
remaining += overflowButtonWidth;
|
|
1112
1186
|
setOverflowGroupKeys((prev) => (setsEqual(prev, next) ? prev : next));
|
|
1113
1187
|
};
|
|
1114
1188
|
recompute();
|
|
1115
1189
|
const ro = new ResizeObserver(recompute);
|
|
1116
1190
|
ro.observe(container);
|
|
1117
1191
|
ro.observe(measure);
|
|
1192
|
+
if (toolbarOverflowMeasureRef.current)
|
|
1193
|
+
ro.observe(toolbarOverflowMeasureRef.current);
|
|
1118
1194
|
return () => ro.disconnect();
|
|
1119
1195
|
});
|
|
1120
1196
|
const isVisible = (section) => !overflowGroupKeys.has(section.key);
|
|
@@ -1162,7 +1238,7 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1162
1238
|
}, children: synonym }, synonym)))] })] })), contextMenu?.link !== undefined && (_jsxs(Menu.Sub, { ...CONTEXT_SUBMENU_PROPS, children: [_jsx(Menu.Sub.Target, { children: _jsx(Menu.Sub.Item, { leftSection: _jsx(IconLink, { size: ICON_SIZE, stroke: ICON_STROKE }), children: strings.link.menuLabel }) }), _jsx(Menu.Sub.Dropdown, { children: _jsx(LinkMenuItems, { mode: "submenu", url: contextMenu.link, onEdit: () => {
|
|
1163
1239
|
restoreSelection();
|
|
1164
1240
|
openLinkDialog();
|
|
1165
|
-
}, onRemove: removeLink, strings: strings }) })] })), contextMenu?.table && (_jsx(TableMenuItems, { mode: "icons", strings: strings, direction: direction, rows: contextMenu.table.rows, columns: contextMenu.table.columns, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction })), contextMenu?.poetry && (_jsx(PoetryMenuItems, { mode: "icons", strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction })), contextMenu?.text && (_jsx(Menu.Item, { leftSection: _jsx(IconArrowsJoin, { size: ICON_SIZE, stroke: ICON_STROKE }), rightSection: _jsx(ShortcutHint, { keys: "Ctrl+Alt+J" }), "aria-keyshortcuts": "Control+Alt+J",
|
|
1241
|
+
}, onRemove: removeLink, strings: strings }) })] })), contextMenu?.table && (_jsx(TableMenuItems, { mode: "icons", strings: strings, direction: direction, rows: contextMenu.table.rows, columns: contextMenu.table.columns, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction })), contextMenu?.poetry && (_jsx(PoetryMenuItems, { mode: "icons", strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction })), contextMenu?.text && (_jsx(Menu.Item, { leftSection: _jsx(IconArrowsJoin, { size: ICON_SIZE, stroke: ICON_STROKE }), rightSection: _jsx(ShortcutHint, { keys: "Ctrl+Alt+J" }), "aria-keyshortcuts": "Control+Alt+J", onClick: runMenuAction(() => {
|
|
1166
1242
|
$joinSelectedLines();
|
|
1167
1243
|
}), children: strings.contextMenu.joinLines })), ((contextMenu?.thesaurus && contextMenu.thesaurus.items?.length !== 0) ||
|
|
1168
1244
|
contextMenu?.link !== undefined ||
|
|
@@ -1257,5 +1333,5 @@ export function Toolbar({ config, toolbarStyle, dictionaryStores = [], thesaurus
|
|
|
1257
1333
|
setRibbonPeek(false);
|
|
1258
1334
|
}, children: _jsx(MantineToolbar, { "aria-label": strings.toolbar.ariaLabel, className: bordered ? 'likhari-toolbar likhari-ribbon-panel' : 'likhari-toolbar likhari-toolbar--plain likhari-ribbon-panel', withBorder: bordered, variant: variant, color: "var(--editor-accent)", children: withDividers(activeTab.groups) }) })), contextMenuEl, dialogsEl] }));
|
|
1259
1335
|
}
|
|
1260
|
-
return (_jsxs(MantineToolbar, { ref: toolbarContainerRef, "aria-label": strings.toolbar.ariaLabel, className: bordered ? 'likhari-toolbar' : 'likhari-toolbar likhari-toolbar--plain', withBorder: bordered, variant: variant, color: "var(--editor-accent)", children: [withDividers(startSections), visibleMovable.map((section) => (_jsxs(Fragment, { children: [_jsx(MantineToolbar.Divider, {}), section.node] }, section.key))), hiddenMovable.length > 0 && (_jsxs(_Fragment, { children: [_jsx(MantineToolbar.Divider, {}), _jsxs(Menu, { opened: overflowMenuOpen, onChange: handleOverflowMenuChange, position: "bottom-end", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: "max-content", closeOnItemClick: false, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconDots, title: strings.toolbar.moreFormatting }) }), _jsx(Menu.Dropdown, { p: 6, children: _jsx(MantineToolbar, { withBorder: false, variant: variant, color: "var(--editor-accent)", style: { maxWidth: 320 }, children: withDividers(hiddenMovable.map((section) => section.node)) }) })] })] })), _jsx("span", { "aria-hidden": "true", style: { flex: '1 1 auto' } }), visibleEnd.map((section) => section.node), contextMenuEl, overflowEnabled && (_jsxs(MantineToolbar, { "aria-hidden": "true", ref: toolbarMeasureRef, withBorder: bordered, variant: variant, color: "var(--editor-accent)", style: { position: 'absolute', visibility: 'hidden', pointerEvents: 'none', top: 0, left: 0, flexWrap: 'nowrap', width: 'max-content' }, children: [withDividers(startSections),
|
|
1336
|
+
return (_jsxs(MantineToolbar, { ref: toolbarContainerRef, "aria-label": strings.toolbar.ariaLabel, className: bordered ? 'likhari-toolbar' : 'likhari-toolbar likhari-toolbar--plain', withBorder: bordered, variant: variant, color: "var(--editor-accent)", children: [withDividers(startSections), visibleMovable.map((section) => (_jsxs(Fragment, { children: [_jsx(MantineToolbar.Divider, {}), section.node] }, section.key))), hiddenMovable.length > 0 && (_jsxs(_Fragment, { children: [_jsx(MantineToolbar.Divider, {}), _jsxs(Menu, { opened: overflowMenuOpen, onChange: handleOverflowMenuChange, position: "bottom-end", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: "max-content", closeOnItemClick: false, children: [_jsx(Menu.Target, { children: _jsx(ToolbarButton, { icon: IconDots, title: strings.toolbar.moreFormatting }) }), _jsx(Menu.Dropdown, { p: 6, children: _jsx(MantineToolbar, { withBorder: false, variant: variant, color: "var(--editor-accent)", style: { maxWidth: 320 }, children: withDividers(hiddenMovable.map((section) => section.node)) }) })] })] })), _jsx("span", { "aria-hidden": "true", style: { flex: '1 1 auto' } }), visibleEnd.map((section) => section.node), contextMenuEl, overflowEnabled && (_jsxs(MantineToolbar, { "aria-hidden": "true", ref: toolbarMeasureRef, className: bordered ? 'likhari-toolbar' : 'likhari-toolbar likhari-toolbar--plain', withBorder: bordered, variant: variant, color: "var(--editor-accent)", style: { position: 'absolute', visibility: 'hidden', pointerEvents: 'none', top: 0, left: 0, flexWrap: 'nowrap', width: 'max-content' }, children: [withDividers(startSections), mainMovable.map((section) => (_jsxs(Fragment, { children: [_jsx(MantineToolbar.Divider, {}), _jsx("span", { "data-group-key": section.key, style: { display: 'inline-flex' }, children: section.node })] }, section.key))), endMovable.map((section) => (_jsx("span", { "data-group-key": section.key, style: { display: 'inline-flex' }, children: section.node }, section.key)))] })), overflowEnabled && (_jsxs(MantineToolbar, { "aria-hidden": "true", ref: toolbarOverflowMeasureRef, className: bordered ? 'likhari-toolbar' : 'likhari-toolbar likhari-toolbar--plain', withBorder: bordered, variant: variant, color: "var(--editor-accent)", style: { position: 'absolute', visibility: 'hidden', pointerEvents: 'none', top: 0, left: 0, width: 'max-content' }, children: [_jsx(MantineToolbar.Divider, {}), _jsx(ToolbarButton, { icon: IconDots, title: "Toolbar overflow measurement" })] })), dialogsEl] }));
|
|
1261
1337
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Strings } from '../i18n/strings.js';
|
|
2
|
+
import type { ToolbarVisibilityGroup } from '../toolbar/toolbarVisibility.js';
|
|
3
|
+
/**
|
|
4
|
+
* Lets the user show or hide individual toolbar buttons and dropdowns, grouped
|
|
5
|
+
* the way they appear in the toolbar. The choice is read from and saved to
|
|
6
|
+
* localStorage by the caller (`useToolbarItemVisibility`); this component only
|
|
7
|
+
* renders the checkboxes and reports clicks.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ToolbarSettingsPanel({ strings, dir, groups, isHidden, onToggle, onClose, }: {
|
|
10
|
+
strings: Strings;
|
|
11
|
+
dir: 'ltr' | 'rtl';
|
|
12
|
+
groups: ToolbarVisibilityGroup[];
|
|
13
|
+
isHidden: (id: string) => boolean;
|
|
14
|
+
onToggle: (id: string) => void;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=ToolbarSettingsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarSettingsPanel.d.ts","sourceRoot":"","sources":["../../src/components/ToolbarSettingsPanel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,KAAK,GAAG,KAAK,CAAC;IACnB,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAClC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,+BAyBA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconX } from '@tabler/icons-react';
|
|
3
|
+
/**
|
|
4
|
+
* Lets the user show or hide individual toolbar buttons and dropdowns, grouped
|
|
5
|
+
* the way they appear in the toolbar. The choice is read from and saved to
|
|
6
|
+
* localStorage by the caller (`useToolbarItemVisibility`); this component only
|
|
7
|
+
* renders the checkboxes and reports clicks.
|
|
8
|
+
*/
|
|
9
|
+
export function ToolbarSettingsPanel({ strings, dir, groups, isHidden, onToggle, onClose, }) {
|
|
10
|
+
const t = strings.toolbarSettings;
|
|
11
|
+
return (_jsxs("div", { className: "likhari-toolbar-settings-panel", role: "region", "aria-label": t.title, dir: dir, children: [_jsxs("div", { className: "likhari-spell-header", children: [_jsx("strong", { children: t.title }), _jsx("button", { type: "button", className: "likhari-spell-icon", onClick: onClose, "aria-label": t.close, title: t.close, children: _jsx(IconX, { size: 14, stroke: 1.75 }) })] }), _jsx("div", { className: "likhari-toolbar-settings-groups", children: groups.map((group) => (_jsxs("fieldset", { className: "likhari-toolbar-settings-group", children: [_jsx("legend", { children: group.label }), group.items.map((item) => (_jsxs("label", { className: "likhari-toolbar-settings-item", children: [_jsx("input", { type: "checkbox", checked: !isHidden(item.id), onChange: () => onToggle(item.id) }), item.label] }, item.id)))] }, group.id))) })] }));
|
|
12
|
+
}
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -74,6 +74,8 @@ export interface Strings {
|
|
|
74
74
|
clearFormatting: string;
|
|
75
75
|
outdent: string;
|
|
76
76
|
indent: string;
|
|
77
|
+
/** Opens/closes the toolbar settings panel (show/hide individual toolbar items). */
|
|
78
|
+
settings: string;
|
|
77
79
|
/** The ribbon layout (`toolbarStyle.layout: 'ribbon'`): its tab strip and tabs. */
|
|
78
80
|
ribbon: {
|
|
79
81
|
/** aria-label on the tab strip. */
|
|
@@ -110,6 +112,21 @@ export interface Strings {
|
|
|
110
112
|
right: string;
|
|
111
113
|
};
|
|
112
114
|
};
|
|
115
|
+
/** The toolbar settings panel (the gear button): show/hide individual toolbar buttons and dropdowns. Grouped the way they appear in the toolbar; group labels are below. */
|
|
116
|
+
toolbarSettings: {
|
|
117
|
+
title: string;
|
|
118
|
+
close: string;
|
|
119
|
+
groups: {
|
|
120
|
+
formatting: string;
|
|
121
|
+
alignment: string;
|
|
122
|
+
font: string;
|
|
123
|
+
insert: string;
|
|
124
|
+
tools: string;
|
|
125
|
+
zoom: string;
|
|
126
|
+
utilities: string;
|
|
127
|
+
history: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
113
130
|
/** The popup `EditorRef.confirmDiscard()` shows when the user is about to leave with unsaved changes (lexical-editor-spec.md §6.4). */
|
|
114
131
|
leaveDialog: {
|
|
115
132
|
title: string;
|
|
@@ -221,6 +238,7 @@ export interface Strings {
|
|
|
221
238
|
failed: string;
|
|
222
239
|
close: string;
|
|
223
240
|
correctDocument: string;
|
|
241
|
+
wholeWord: string;
|
|
224
242
|
};
|
|
225
243
|
contextMenu: {
|
|
226
244
|
cut: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/i18n/strings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;+DAC+D;AAC/D,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,cAAc,CAAC;AAElD,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QACN,mGAAmG;QACnG,WAAW,EAAE,MAAM,CAAC;QACpB,gDAAgD;QAChD,YAAY,EAAE,MAAM,CAAC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AQ,EAAE,CAAC,OAAO,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,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;AAs7BD,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
|
@@ -62,6 +62,7 @@ const en = {
|
|
|
62
62
|
clearFormatting: 'Clear formatting',
|
|
63
63
|
outdent: 'Outdent',
|
|
64
64
|
indent: 'Indent',
|
|
65
|
+
settings: 'Toolbar settings',
|
|
65
66
|
ribbon: {
|
|
66
67
|
tabsLabel: 'Ribbon tabs',
|
|
67
68
|
quickAccess: 'Quick access',
|
|
@@ -92,6 +93,20 @@ const en = {
|
|
|
92
93
|
right: 'Align right',
|
|
93
94
|
},
|
|
94
95
|
},
|
|
96
|
+
toolbarSettings: {
|
|
97
|
+
title: 'Toolbar settings',
|
|
98
|
+
close: 'Close',
|
|
99
|
+
groups: {
|
|
100
|
+
formatting: 'Formatting',
|
|
101
|
+
alignment: 'Alignment & indent',
|
|
102
|
+
font: 'Font',
|
|
103
|
+
insert: 'Insert',
|
|
104
|
+
tools: 'Tools',
|
|
105
|
+
zoom: 'Zoom',
|
|
106
|
+
utilities: 'Drafts, search & help',
|
|
107
|
+
history: 'Save, undo & redo',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
95
110
|
leaveDialog: {
|
|
96
111
|
title: 'Unsaved changes',
|
|
97
112
|
message: 'You have unsaved changes. What would you like to do before leaving?',
|
|
@@ -196,6 +211,7 @@ const en = {
|
|
|
196
211
|
failed: 'Could not save the correction',
|
|
197
212
|
close: 'Close',
|
|
198
213
|
correctDocument: 'Correct whole document',
|
|
214
|
+
wholeWord: 'Whole word only',
|
|
199
215
|
},
|
|
200
216
|
contextMenu: {
|
|
201
217
|
cut: 'Cut',
|
|
@@ -360,6 +376,7 @@ const ur = {
|
|
|
360
376
|
clearFormatting: 'فارمیٹنگ ختم کریں',
|
|
361
377
|
outdent: 'حاشیہ کم کریں',
|
|
362
378
|
indent: 'حاشیہ بڑھائیں',
|
|
379
|
+
settings: 'ٹول بار کی ترتیبات',
|
|
363
380
|
ribbon: {
|
|
364
381
|
tabsLabel: 'ربن کے ٹیب',
|
|
365
382
|
quickAccess: 'فوری رسائی',
|
|
@@ -390,6 +407,20 @@ const ur = {
|
|
|
390
407
|
right: 'دائیں سیدھ',
|
|
391
408
|
},
|
|
392
409
|
},
|
|
410
|
+
toolbarSettings: {
|
|
411
|
+
title: 'ٹول بار کی ترتیبات',
|
|
412
|
+
close: 'بند کریں',
|
|
413
|
+
groups: {
|
|
414
|
+
formatting: 'فارمیٹنگ',
|
|
415
|
+
alignment: 'سیدھ اور حاشیہ',
|
|
416
|
+
font: 'فونٹ',
|
|
417
|
+
insert: 'داخل کریں',
|
|
418
|
+
tools: 'آلات',
|
|
419
|
+
zoom: 'زوم',
|
|
420
|
+
utilities: 'ڈرافٹس، تلاش اور مدد',
|
|
421
|
+
history: 'محفوظ کریں، واپس اور آگے',
|
|
422
|
+
},
|
|
423
|
+
},
|
|
393
424
|
leaveDialog: {
|
|
394
425
|
title: 'غیر محفوظ شدہ تبدیلیاں',
|
|
395
426
|
message: 'آپ کی تبدیلیاں محفوظ نہیں ہوئیں۔ جانے سے پہلے آپ کیا کرنا چاہیں گے؟',
|
|
@@ -494,6 +525,7 @@ const ur = {
|
|
|
494
525
|
failed: 'تصحیح محفوظ نہیں ہو سکی',
|
|
495
526
|
close: 'بند کریں',
|
|
496
527
|
correctDocument: 'تمام متن کی تصحیح کریں',
|
|
528
|
+
wholeWord: 'صرف پورا لفظ',
|
|
497
529
|
},
|
|
498
530
|
contextMenu: {
|
|
499
531
|
cut: 'کاٹیں',
|
|
@@ -658,6 +690,7 @@ const paShahmukhi = {
|
|
|
658
690
|
clearFormatting: 'فارمیٹنگ ہٹاؤ',
|
|
659
691
|
outdent: 'حاشیہ گھٹاؤ',
|
|
660
692
|
indent: 'حاشیہ ودھاؤ',
|
|
693
|
+
settings: 'ٹول بار دیاں ترتیباں',
|
|
661
694
|
ribbon: {
|
|
662
695
|
tabsLabel: 'ربن دے ٹیب',
|
|
663
696
|
quickAccess: 'جھٹ رسائی',
|
|
@@ -688,6 +721,20 @@ const paShahmukhi = {
|
|
|
688
721
|
right: 'سجے سیدھ',
|
|
689
722
|
},
|
|
690
723
|
},
|
|
724
|
+
toolbarSettings: {
|
|
725
|
+
title: 'ٹول بار دیاں ترتیباں',
|
|
726
|
+
close: 'بند کرو',
|
|
727
|
+
groups: {
|
|
728
|
+
formatting: 'فارمیٹنگ',
|
|
729
|
+
alignment: 'سیدھ تے حاشیہ',
|
|
730
|
+
font: 'فونٹ',
|
|
731
|
+
insert: 'داخل کرو',
|
|
732
|
+
tools: 'اوزار',
|
|
733
|
+
zoom: 'زوم',
|
|
734
|
+
utilities: 'ڈرافٹس، تلاش تے مدد',
|
|
735
|
+
history: 'سانبھو، واپس تے اگے',
|
|
736
|
+
},
|
|
737
|
+
},
|
|
691
738
|
leaveDialog: {
|
|
692
739
|
title: 'غیر محفوظ تبدیلیاں',
|
|
693
740
|
message: 'تہاڈیاں تبدیلیاں سنبھالیاں نئیں گئیاں۔ جان توں پہلاں تسی کی کرنا چاہو گے؟',
|
|
@@ -792,6 +839,7 @@ const paShahmukhi = {
|
|
|
792
839
|
failed: 'درستی سانبھی نئیں جا سکی',
|
|
793
840
|
close: 'بند کرو',
|
|
794
841
|
correctDocument: 'پورے متن دی درستی کرو',
|
|
842
|
+
wholeWord: 'صرف پورا لفظ',
|
|
795
843
|
},
|
|
796
844
|
contextMenu: {
|
|
797
845
|
cut: 'کٹو',
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { FontOption, FontMode } from './fonts/index.js';
|
|
|
11
11
|
export { STRINGS, getStrings, useStrings, useUiStrings, UiStringsContext } from './i18n/index.js';
|
|
12
12
|
export type { Locale, Strings } from './i18n/index.js';
|
|
13
13
|
export { registerSpellDictionary, hasSpellDictionary, setEnglishDictionaryBaseUrl, type HunspellFiles, type SpellLanguage } from './spellcheck/spellDictionaries.js';
|
|
14
|
-
export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
|
|
14
|
+
export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore, nawishtaAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
|
|
15
15
|
export type { AutoCorrectStore, AutoCorrectEntry } from './autocorrect/autoCorrectStores.js';
|
|
16
16
|
export { normalizeUrdu, normalizeUrduCharacters, removeUrduDiacritics, replaceUrduDigits } from './normalization/urduNormalize.js';
|
|
17
17
|
export type { UrduNormalizationOptions } from './normalization/urduNormalize.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,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O,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChG,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { ImageNode, $createImageNode, $isImageNode } from './image/ImageNode.js'
|
|
|
5
5
|
export { DEFAULT_FONT_OPTIONS, URDU_WEB_FONT_OPTIONS, FONT_SIZES_PX, ZOOM_LEVELS_PERCENT } from './fonts/index.js';
|
|
6
6
|
export { STRINGS, getStrings, useStrings, useUiStrings, UiStringsContext } from './i18n/index.js';
|
|
7
7
|
export { registerSpellDictionary, hasSpellDictionary, setEnglishDictionaryBaseUrl } from './spellcheck/spellDictionaries.js';
|
|
8
|
-
export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
|
|
8
|
+
export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore, nawishtaAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
|
|
9
9
|
export { normalizeUrdu, normalizeUrduCharacters, removeUrduDiacritics, replaceUrduDigits } from './normalization/urduNormalize.js';
|
|
10
10
|
export { localStorageUserWordStore, apiUserWordStore, ignoreWord, addUserWord, onSpellWordsChange } from './spellcheck/userWords.js';
|
|
11
11
|
export { dictionaryCompletionStore, apiCompletionStore } from './autocomplete/completionStores.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinLinesActions.d.ts","sourceRoot":"","sources":["../../src/join/joinLinesActions.ts"],"names":[],"mappings":"AAqCA,wBAAgB,aAAa,IAAI,OAAO,CAKvC;
|
|
1
|
+
{"version":3,"file":"joinLinesActions.d.ts","sourceRoot":"","sources":["../../src/join/joinLinesActions.ts"],"names":[],"mappings":"AAqCA,wBAAgB,aAAa,IAAI,OAAO,CAKvC;AAgFD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAgC5C"}
|