@inshapardaz/likhari-react 0.1.21 → 0.1.22-dev.216

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.
Files changed (50) hide show
  1. package/dist/EditorRoot.d.ts +9 -0
  2. package/dist/EditorRoot.d.ts.map +1 -1
  3. package/dist/EditorRoot.js +14 -4
  4. package/dist/autocorrect/AutoCorrectPlugin.d.ts +27 -0
  5. package/dist/autocorrect/AutoCorrectPlugin.d.ts.map +1 -0
  6. package/dist/autocorrect/AutoCorrectPlugin.js +108 -0
  7. package/dist/autocorrect/autoCorrectActions.d.ts +35 -0
  8. package/dist/autocorrect/autoCorrectActions.d.ts.map +1 -0
  9. package/dist/autocorrect/autoCorrectActions.js +182 -0
  10. package/dist/autocorrect/autoCorrectStores.d.ts +52 -0
  11. package/dist/autocorrect/autoCorrectStores.d.ts.map +1 -0
  12. package/dist/autocorrect/autoCorrectStores.js +115 -0
  13. package/dist/autocorrect/punctuationRules.d.ts +26 -0
  14. package/dist/autocorrect/punctuationRules.d.ts.map +1 -0
  15. package/dist/autocorrect/punctuationRules.js +53 -0
  16. package/dist/cleanup/textCleanupActions.d.ts +8 -0
  17. package/dist/cleanup/textCleanupActions.d.ts.map +1 -0
  18. package/dist/cleanup/textCleanupActions.js +28 -0
  19. package/dist/components/AutoCorrectPanel.d.ts +15 -0
  20. package/dist/components/AutoCorrectPanel.d.ts.map +1 -0
  21. package/dist/components/AutoCorrectPanel.js +44 -0
  22. package/dist/components/SpellcheckPanel.d.ts +13 -0
  23. package/dist/components/SpellcheckPanel.d.ts.map +1 -0
  24. package/dist/components/SpellcheckPanel.js +81 -0
  25. package/dist/components/Toolbar.d.ts +7 -1
  26. package/dist/components/Toolbar.d.ts.map +1 -1
  27. package/dist/components/Toolbar.js +112 -109
  28. package/dist/find/findReplaceActions.d.ts +13 -0
  29. package/dist/find/findReplaceActions.d.ts.map +1 -1
  30. package/dist/find/findReplaceActions.js +2 -2
  31. package/dist/i18n/strings.d.ts +32 -0
  32. package/dist/i18n/strings.d.ts.map +1 -1
  33. package/dist/i18n/strings.js +101 -5
  34. package/dist/index.d.ts +5 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/normalization/urduNormalize.d.ts +24 -0
  38. package/dist/normalization/urduNormalize.d.ts.map +1 -0
  39. package/dist/normalization/urduNormalize.js +116 -0
  40. package/dist/spellcheck/SpellHighlightPlugin.d.ts +8 -0
  41. package/dist/spellcheck/SpellHighlightPlugin.d.ts.map +1 -0
  42. package/dist/spellcheck/SpellHighlightPlugin.js +57 -0
  43. package/dist/spellcheck/spellcheckActions.d.ts +21 -0
  44. package/dist/spellcheck/spellcheckActions.d.ts.map +1 -0
  45. package/dist/spellcheck/spellcheckActions.js +38 -0
  46. package/dist/spellcheck/spellingMenu.d.ts +15 -0
  47. package/dist/spellcheck/spellingMenu.d.ts.map +1 -0
  48. package/dist/spellcheck/spellingMenu.js +27 -0
  49. package/dist/theme/editor.css +185 -0
  50. package/package.json +1 -1
@@ -2,12 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
3
3
  import { Menu, Select } from '@mantine/core';
4
4
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
- import { $getSelection, $isRangeSelection, $isElementNode, $setSelection, $getRoot, $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';
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';
7
7
  import { $createParagraphNode } from 'lexical';
8
8
  import { $createHeadingNode, $createQuoteNode, $isHeadingNode, $isQuoteNode } from '@lexical/rich-text';
9
9
  import { $isListNode, INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, } from '@lexical/list';
10
10
  import { $findMatchingParent, $insertNodeToNearestRoot } from '@lexical/utils';
11
+ import { CORRECT_DOCUMENT_COMMAND } from '../autocorrect/AutoCorrectPlugin.js';
12
+ import { $replaceMatch } from '../find/findReplaceActions.js';
13
+ import { getSpeller } from '../spellcheck/spellDictionaries.js';
14
+ import { $wordAtDomPoint, textPointAt } from '../spellcheck/spellingMenu.js';
11
15
  import { INSERT_HORIZONTAL_RULE_COMMAND } from '@lexical/react/LexicalHorizontalRuleNode';
12
16
  import { ImageDialog } from '../image/ImageDialog.js';
13
17
  import { $createImageNode } from '../image/ImageNode.js';
@@ -29,7 +33,7 @@ import { CANVAS_FONT_DEFAULTS, DEFAULT_FONT_OPTIONS, FONT_SIZES_PX } from '../fo
29
33
  import { setStyleProperty } from '../utils/style.js';
30
34
  import { useStrings } from '../i18n/useStrings.js';
31
35
  import { usePortalTarget } from '../PortalTargetContext.js';
32
- 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, IconPageBreak, IconPencil, IconPhoto, IconPilcrow, IconQuote, IconSeparatorHorizontal, IconSparkles, IconStrikethrough, IconSubscript, IconSuperscript, IconArrowMergeBoth, IconArrowsSplit2, IconColumnInsertLeft, IconColumnInsertRight, IconColumnRemove, IconColumns, IconSearch, IconColumns1, IconColumns2, IconNumber1Small, IconRowInsertBottom, IconRowInsertTop, IconRowRemove, IconArrowsMaximize, IconArrowsMinimize, IconArrowsShuffle, IconTable, IconTableMinus, IconTrash, IconTableOptions, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
36
+ 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, 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, IconArrowsMaximize, IconArrowsMinimize, IconArrowsShuffle, IconTable, IconTableMinus, IconTrash, IconTableOptions, IconTextSize, IconTypography, IconUnderline, IconWand, } from '@tabler/icons-react';
33
37
  /** Sentinel for "no inline style": Lexical returns the default it is given when
34
38
  * the selection has none, so this tells "unstyled" (show the canvas default)
35
39
  * apart from "styled with a value the dropdown doesn't list" (show nothing). */
@@ -139,8 +143,6 @@ function OverflowItem({ icon: Icon, label, active, onClick, }) {
139
143
  // Keep the editor's selection: a mousedown here would blur the canvas.
140
144
  onMouseDown: (e) => e.preventDefault(), onClick: onClick, children: label }));
141
145
  }
142
- /** The link menu's contents — shared by the toolbar button and the right-click
143
- * menu: the URL (opens in a new tab), Edit link, Remove link. */
144
146
  function LinkMenuItems({ url, onEdit, onRemove, strings }) {
145
147
  // Only offer the link as clickable if it's a URL the editor would have accepted.
146
148
  const safeUrl = normalizeLinkUrl(url);
@@ -182,7 +184,7 @@ function PoetryMenuItems({ strings, layout, scale, centered, onAction, }) {
182
184
  };
183
185
  return (_jsxs(_Fragment, { children: [_jsx(Menu.Label, { children: t.menuLabel }), item(IconColumns1, t.singleColumn, setLayout('single'), layout === 'single'), item(IconColumns2, t.twoColumn, setLayout('two-column'), layout === 'two-column'), item(IconArrowsShuffle, t.staggered, setLayout('staggered'), layout === 'staggered'), _jsx(Menu.Divider, {}), _jsx(Menu.Divider, {}), item(IconRowInsertTop, t.insertCoupletBefore, () => $insertCoupletRelativeToSelection('before')), item(IconRowInsertBottom, t.insertCoupletAfter, () => $insertCoupletRelativeToSelection('after')), item(IconArrowsMinimize, t.tighterSpacing, () => $adjustPoetrySpacing(-1), !canStep(POETRY_SPACINGS, scale.spacing, -1)), item(IconArrowsMaximize, t.looserSpacing, () => $adjustPoetrySpacing(1), !canStep(POETRY_SPACINGS, scale.spacing, 1)), layout === 'staggered' && (_jsxs(_Fragment, { children: [item(IconArrowsMinimize, t.narrowerCouplets, () => $adjustPoetryStagger(-1), !canStep(POETRY_STAGGERS, scale.stagger, -1)), item(IconArrowsMaximize, t.widerCouplets, () => $adjustPoetryStagger(1), !canStep(POETRY_STAGGERS, scale.stagger, 1))] })), layout === 'two-column' && (_jsxs(_Fragment, { children: [item(IconAlignCenter, centered ? t.uncenterCouplet : t.centerCouplet, () => $setCoupletCentered(!centered)), item(IconColumns2, t.narrowerGutter, () => $adjustPoetryGutter(-1), !canStep(POETRY_GUTTERS, scale.gutter, -1)), item(IconColumns2, t.widerGutter, () => $adjustPoetryGutter(1), !canStep(POETRY_GUTTERS, scale.gutter, 1))] })), item(IconTrash, t.deleteCouplet, $deletePoetryCouplet, false, 'red'), item(IconTrash, t.deletePoetry, $deletePoetryBlock, false, 'red')] }));
184
186
  }
185
- export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, onToggleFind, fontOptions = DEFAULT_FONT_OPTIONS, direction = 'ltr', locale = 'en', drafts }) {
187
+ export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, onToggleFind, spellOpen = false, onToggleSpell, autoCorrectOpen = false, onToggleAutoCorrect, fontOptions = DEFAULT_FONT_OPTIONS, direction = 'ltr', locale = 'en', drafts }) {
186
188
  const [editor] = useLexicalComposerContext();
187
189
  const [state, setState] = useState(INITIAL_STATE);
188
190
  const strings = useStrings(locale);
@@ -463,112 +465,115 @@ export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, o
463
465
  editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
464
466
  closeLinkDialog();
465
467
  };
466
- // Right-clicking a link in the text opens the same menu, at the pointer.
467
- const [linkContext, setLinkContext] = useState(null);
468
- useEffect(() => {
469
- if (!config.links)
470
- return;
471
- const onContextMenu = (event) => {
472
- const anchor = event.target?.closest?.('a');
473
- if (!anchor)
474
- return;
475
- let url = null;
476
- // Select the whole link first, so Edit / Remove act on it wherever the caret was.
477
- editor.update(() => {
478
- const node = $getNearestNodeFromDOMNode(anchor);
479
- const link = node ? $findMatchingParent(node, $isLinkNode) : null;
480
- if (!link || !$isLinkNode(link))
481
- return;
482
- url = link.getURL();
483
- link.select(0, link.getChildrenSize());
484
- }, { discrete: true });
485
- if (url === null)
486
- return;
487
- event.preventDefault();
488
- snapshotSelectionRef.current();
489
- setLinkContext({ x: event.clientX, y: event.clientY, url });
490
- };
491
- return editor.registerRootListener((root, previous) => {
492
- previous?.removeEventListener('contextmenu', onContextMenu);
493
- root?.addEventListener('contextmenu', onContextMenu);
494
- });
495
- }, [editor, config.links]);
496
- // Table/poetry contextual-menu actions. The menu takes focus, so the
497
- // selection is snapshotted when it opens and restored before an action runs.
468
+ // One right-click menu for the whole editor, replacing the browser's own. It
469
+ // adds what applies to what is under the pointer (a spelling fix, a link, a
470
+ // table cell, a poetry couplet) and always offers cut, copy, paste and select all.
498
471
  const runMenuAction = (action) => () => {
499
472
  restoreSelection();
500
473
  editor.update(action);
501
474
  editor.focus();
502
475
  };
503
- // Right-clicking a table cell opens the same actions at the pointer.
504
- const [tableContext, setTableContext] = useState(null);
476
+ const [contextMenu, setContextMenu] = useState(null);
505
477
  useEffect(() => {
506
- if (!config.tables)
507
- return;
508
- const onContextMenu = (event) => {
509
- if (event.defaultPrevented)
510
- return; // a link inside the cell already took it
511
- const cellElement = event.target?.closest?.('td, th');
512
- if (!cellElement)
513
- return;
514
- let handled = false;
515
- editor.update(() => {
516
- const node = $getNearestNodeFromDOMNode(cellElement);
517
- const cell = node ? $getTableCellNodeFromLexicalNode(node) : null;
518
- if (!cell)
519
- return;
520
- handled = true;
521
- const selection = $getSelection();
522
- // Keep a multi-cell selection that includes this cell, so "insert
523
- // rows" / "delete columns" act on everything selected.
524
- const insideSelection = $isTableSelection(selection) && selection.getNodes().some((n) => n.getKey() === cell.getKey());
525
- if (!insideSelection)
526
- cell.selectEnd();
527
- }, { discrete: true });
528
- if (!handled)
529
- return;
478
+ const onContextMenu = async (event) => {
530
479
  event.preventDefault();
531
480
  snapshotSelectionRef.current();
532
- const size = editor.getEditorState().read($getTableSelectionSize);
533
- setTableContext({ x: event.clientX, y: event.clientY, rows: size.rows, columns: size.columns });
534
- };
535
- return editor.registerRootListener((root, previous) => {
536
- previous?.removeEventListener('contextmenu', onContextMenu);
537
- root?.addEventListener('contextmenu', onContextMenu);
538
- });
539
- }, [editor, config.tables]);
540
- // Right-clicking a poetry couplet opens the same options menu at the pointer.
541
- const [poetryContext, setPoetryContext] = useState(null);
542
- useEffect(() => {
543
- if (!config.poetry.enabled)
544
- return;
545
- const onContextMenu = (event) => {
546
- if (event.defaultPrevented)
547
- return; // a link inside the couplet already took it
548
- const coupletElement = event.target?.closest?.('.likhari-poetry');
549
- if (!coupletElement)
550
- return;
551
- let handled = false;
481
+ const target = event.target;
482
+ const anchor = config.links ? (target?.closest?.('a') ?? null) : null;
483
+ const cell = config.tables ? (target?.closest?.('td, th') ?? null) : null;
484
+ const couplet = config.poetry.enabled ? (target?.closest?.('.likhari-poetry') ?? null) : null;
485
+ const point = config.language.spellCheck ? textPointAt(event.clientX, event.clientY) : null;
486
+ const menu = { x: event.clientX, y: event.clientY };
487
+ let word = null;
552
488
  editor.update(() => {
553
- const node = $getNearestNodeFromDOMNode(coupletElement);
554
- const couplet = node ? $findMatchingParent(node, $isPoetryBlockNode) : null;
555
- if (!couplet)
556
- return;
557
- handled = true;
558
- if (!$getPoetryBlockFromSelection())
559
- couplet.selectStart();
489
+ if (anchor) {
490
+ const node = $getNearestNodeFromDOMNode(anchor);
491
+ const link = node ? $findMatchingParent(node, $isLinkNode) : null;
492
+ if ($isLinkNode(link)) {
493
+ menu.link = link.getURL();
494
+ // Select the whole link first, so Edit / Remove act on it wherever the caret was.
495
+ link.select(0, link.getChildrenSize());
496
+ }
497
+ }
498
+ if (cell) {
499
+ const node = $getNearestNodeFromDOMNode(cell);
500
+ const tableCell = node ? $getTableCellNodeFromLexicalNode(node) : null;
501
+ if (tableCell) {
502
+ const selection = $getSelection();
503
+ // Keep a multi-cell selection that includes this cell.
504
+ const insideSelection = $isTableSelection(selection) && selection.getNodes().some((n) => n.getKey() === tableCell.getKey());
505
+ if (!insideSelection)
506
+ tableCell.selectEnd();
507
+ const size = $getTableSelectionSize();
508
+ menu.table = { rows: size.rows, columns: size.columns };
509
+ }
510
+ }
511
+ if (couplet) {
512
+ const node = $getNearestNodeFromDOMNode(couplet);
513
+ const block = node ? $findMatchingParent(node, $isPoetryBlockNode) : null;
514
+ if (block) {
515
+ menu.poetry = true;
516
+ if (!$getPoetryBlockFromSelection())
517
+ block.selectStart();
518
+ }
519
+ }
520
+ if (point)
521
+ word = $wordAtDomPoint(point.node, point.offset);
560
522
  }, { discrete: true });
561
- if (!handled)
562
- return;
563
- event.preventDefault();
564
- snapshotSelectionRef.current();
565
- setPoetryContext({ x: event.clientX, y: event.clientY });
523
+ if (word) {
524
+ const speller = getSpeller(word.direction === 'rtl' ? 'ur' : 'en');
525
+ if (speller) {
526
+ const checked = await speller;
527
+ if (!checked.correct(word.word)) {
528
+ menu.spelling = { suggestions: checked.suggest(word.word).slice(0, 5), match: word.match };
529
+ }
530
+ }
531
+ }
532
+ setContextMenu(menu);
566
533
  };
567
534
  return editor.registerRootListener((root, previous) => {
568
535
  previous?.removeEventListener('contextmenu', onContextMenu);
569
536
  root?.addEventListener('contextmenu', onContextMenu);
570
537
  });
571
- }, [editor, config.poetry.enabled]);
538
+ }, [editor, config.links, config.tables, config.poetry.enabled, config.language.spellCheck]);
539
+ // Cut and copy put the selected text on the clipboard as plain text.
540
+ const copyOrCut = (cut) => async () => {
541
+ restoreSelection();
542
+ let text = '';
543
+ editor.update(() => {
544
+ const selection = $getSelection();
545
+ if (!$isRangeSelection(selection))
546
+ return;
547
+ text = selection.getTextContent();
548
+ if (cut)
549
+ selection.removeText();
550
+ }, { discrete: true });
551
+ if (text)
552
+ await navigator.clipboard?.writeText(text).catch(() => undefined);
553
+ editor.focus();
554
+ };
555
+ // Paste reads plain text from the clipboard (the browser may ask for permission).
556
+ const paste = async () => {
557
+ restoreSelection();
558
+ let text;
559
+ try {
560
+ text = await navigator.clipboard.readText();
561
+ }
562
+ catch {
563
+ return;
564
+ }
565
+ editor.update(() => {
566
+ const selection = $getSelection();
567
+ if (!$isRangeSelection(selection))
568
+ return;
569
+ text.split(/\r?\n/).forEach((line, index) => {
570
+ if (index > 0)
571
+ selection.insertParagraph();
572
+ selection.insertText(line);
573
+ });
574
+ }, { discrete: true });
575
+ editor.focus();
576
+ };
572
577
  // Ctrl/Cmd+K opens the link dialog.
573
578
  useEffect(() => {
574
579
  if (!config.links)
@@ -811,25 +816,23 @@ export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, o
811
816
  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.blocks.pageBreak && (_jsx(ToolbarButton, { icon: IconPageBreak, title: strings.toolbar.insertPageBreak, onClick: () => editor.dispatchCommand(INSERT_PAGE_BREAK_COMMAND, undefined) })), config.tables && _jsx(ToolbarButton, { icon: IconTable, title: strings.toolbar.insertTable, onClick: openTableDialog }), 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.horizontalRule && (_jsx(ToolbarButton, { icon: IconSeparatorHorizontal, title: strings.toolbar.insertHorizontalRule, onClick: () => editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined) })), config.findReplace && (_jsx(ToolbarButton, { icon: IconSearch, title: strings.findReplace.toggle, active: findOpen, onClick: onToggleFind })), config.poetry.enabled && locale !== 'en' && (_jsx(ToolbarButton, { icon: IconFeather, title: strings.toolbar.insertPoetryCouplet, onClick: () => editor.dispatchCommand(INSERT_POETRY_COUPLET_COMMAND, { layout: config.poetry.defaultLayout }) }))] }, "stubInsert")),
812
817
  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, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction }) })] }) }, "tableActions")),
813
818
  config.poetry.enabled && state.inPoetry && (_jsx("div", { className: "likhari-toolbar-group", children: _jsxs(Menu, { position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 200, 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.poetryOptions, title: strings.toolbar.poetryOptions, onMouseDown: (e) => e.preventDefault(), children: _jsx(IconFeather, { size: ICON_SIZE, stroke: ICON_STROKE }) }) }), _jsx(Menu.Dropdown, { children: _jsx(PoetryMenuItems, { strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction }) })] }) }, "poetryActions")),
814
- 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")),
819
+ showLanguageGroup && (_jsxs("div", { className: "likhari-toolbar-group likhari-toolbar-group--collapse-tablet", 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 }))] }, "language")),
815
820
  ];
816
821
  return (_jsxs("div", { className: "likhari-toolbar", role: "toolbar", "aria-label": strings.toolbar.ariaLabel, ref: toolbarContainerRef, children: [fixedGroups, movableGroups
817
822
  .filter((group) => !overflowGroupKeys.has(group.key))
818
823
  .map((group) => (_jsx(MovableGroupButtons, { group: group }, group.key))), overflowGroupKeys.size > 0 && (_jsxs(Menu, { position: "bottom-end", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 210, closeOnItemClick: true, onOpen: snapshotSelection, children: [_jsx(Menu.Target, { children: _jsx("button", { type: "button", className: "likhari-toolbar-button", "aria-label": strings.toolbar.moreFormatting, title: strings.toolbar.moreFormatting, onMouseDown: (e) => e.preventDefault(), children: _jsx(IconDots, { size: ICON_SIZE, stroke: ICON_STROKE }) }) }), _jsx(Menu.Dropdown, { children: movableGroups
819
824
  .filter((group) => overflowGroupKeys.has(group.key))
820
- .flatMap((group) => group.items.map((item) => (_jsx(OverflowItem, { icon: item.icon, label: item.label, active: item.active, onClick: runOverflowAction(item.onClick) }, item.key)))) })] })), config.links && (_jsxs(Menu, { opened: linkContext !== null, onChange: (opened) => {
821
- if (!opened)
822
- setLinkContext(null);
823
- }, 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: () => {
824
- restoreSelection();
825
- openLinkDialog();
826
- }, onRemove: removeLink, strings: strings }) })] })), config.tables && (_jsxs(Menu, { opened: tableContext !== null, onChange: (opened) => {
827
- if (!opened)
828
- setTableContext(null);
829
- }, 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, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction }) })] })), config.poetry.enabled && (_jsxs(Menu, { opened: poetryContext !== null, onChange: (opened) => {
825
+ .flatMap((group) => group.items.map((item) => (_jsx(OverflowItem, { icon: item.icon, label: item.label, active: item.active, onClick: runOverflowAction(item.onClick) }, item.key)))) })] })), _jsxs(Menu, { opened: contextMenu !== null, onChange: (opened) => {
830
826
  if (!opened)
831
- setPoetryContext(null);
832
- }, position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 200, children: [_jsx(Menu.Target, { children: _jsx("span", { "aria-hidden": "true", style: { position: 'fixed', left: poetryContext?.x ?? -9999, top: poetryContext?.y ?? -9999, width: 1, height: 1, pointerEvents: 'none' } }) }), _jsx(Menu.Dropdown, { children: _jsx(PoetryMenuItems, { strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction }) })] })), _jsxs("div", { "aria-hidden": "true", ref: toolbarMeasureRef, style: {
827
+ setContextMenu(null);
828
+ }, position: "bottom-start", withinPortal: true, portalProps: { target: portalTarget }, shadow: "sm", width: 260, children: [_jsx(Menu.Target, { children: _jsx("span", { "aria-hidden": "true", style: { position: 'fixed', left: contextMenu?.x ?? -9999, top: contextMenu?.y ?? -9999, width: 1, height: 1, pointerEvents: 'none' } }) }), _jsxs(Menu.Dropdown, { children: [contextMenu?.spelling && (_jsxs(_Fragment, { children: [_jsx(Menu.Label, { children: strings.contextMenu.spelling }), contextMenu.spelling.suggestions.length === 0 && _jsx(Menu.Item, { disabled: true, children: strings.contextMenu.noSuggestions }), contextMenu.spelling.suggestions.map((suggestion) => (_jsx(Menu.Item, { onClick: () => {
829
+ const match = contextMenu.spelling.match;
830
+ editor.update(() => $replaceMatch(match, suggestion), { discrete: true });
831
+ editor.focus();
832
+ }, children: suggestion }, suggestion))), _jsx(Menu.Divider, {})] })), contextMenu?.link !== undefined && (_jsxs(_Fragment, { children: [_jsx(LinkMenuItems, { url: contextMenu.link, onEdit: () => {
833
+ restoreSelection();
834
+ openLinkDialog();
835
+ }, onRemove: removeLink, strings: strings }), _jsx(Menu.Divider, {})] })), contextMenu?.table && (_jsxs(_Fragment, { children: [_jsx(TableMenuItems, { strings: strings, direction: direction, rows: contextMenu.table.rows, columns: contextMenu.table.columns, canMergeCells: state.canMergeCells, canUnmergeCell: state.canUnmergeCell, onAction: runMenuAction }), _jsx(Menu.Divider, {})] })), contextMenu?.poetry && (_jsxs(_Fragment, { children: [_jsx(PoetryMenuItems, { strings: strings, layout: state.poetryLayout, scale: state.poetryScale, centered: state.poetryCentered, onAction: runMenuAction }), _jsx(Menu.Divider, {})] })), _jsx(Menu.Item, { leftSection: _jsx(IconCut, { size: ICON_SIZE, stroke: ICON_STROKE }), onClick: () => void copyOrCut(true)(), children: strings.contextMenu.cut }), _jsx(Menu.Item, { leftSection: _jsx(IconCopy, { size: ICON_SIZE, stroke: ICON_STROKE }), onClick: () => void copyOrCut(false)(), children: strings.contextMenu.copy }), _jsx(Menu.Item, { leftSection: _jsx(IconClipboard, { size: ICON_SIZE, stroke: ICON_STROKE }), onClick: () => void paste(), children: strings.contextMenu.paste }), _jsx(Menu.Item, { leftSection: _jsx(IconSelectAll, { size: ICON_SIZE, stroke: ICON_STROKE }), onClick: runMenuAction(() => $selectAll()), children: strings.contextMenu.selectAll })] })] }), _jsxs("div", { "aria-hidden": "true", ref: toolbarMeasureRef, style: {
833
836
  position: 'absolute',
834
837
  visibility: 'hidden',
835
838
  pointerEvents: 'none',
@@ -1,3 +1,4 @@
1
+ import { type TextNode } from 'lexical';
1
2
  /** A match as a Lexical selection range: start and end points, each in a text node. */
2
3
  export interface FindMatch {
3
4
  anchorKey: string;
@@ -5,6 +6,18 @@ export interface FindMatch {
5
6
  focusKey: string;
6
7
  focusOffset: number;
7
8
  }
9
+ /**
10
+ * Text nodes grouped by their parent, in document order. A match is searched
11
+ * for within one parent only, so it never spans two paragraphs or table
12
+ * cells, but it can span the several text nodes that formatting splits a
13
+ * paragraph into.
14
+ */
15
+ export declare function $textGroups(): TextNode[][];
16
+ /** The text node and offset that a character index in a group falls in. */
17
+ export declare function $locate(group: TextNode[], index: number, end: boolean): {
18
+ key: string;
19
+ offset: number;
20
+ };
8
21
  /** Every non-overlapping occurrence of `query` in the document, case-sensitive. */
9
22
  export declare function $findMatches(query: string): FindMatch[];
10
23
  /** Makes the match the editor's selection, so it's highlighted and scrolled to. */
@@ -1 +1 @@
1
- {"version":3,"file":"findReplaceActions.d.ts","sourceRoot":"","sources":["../../src/find/findReplaceActions.ts"],"names":[],"mappings":"AAEA,uFAAuF;AACvF,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAgCD,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAcvD;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAKnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAItE"}
1
+ {"version":3,"file":"findReplaceActions.d.ts","sourceRoot":"","sources":["../../src/find/findReplaceActions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoF,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE1H,uFAAuF;AACvF,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,QAAQ,EAAE,EAAE,CAS1C;AAED,2EAA2E;AAC3E,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAUvG;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,CAcvD;AAED,mFAAmF;AACnF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAKnD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAItE"}
@@ -5,7 +5,7 @@ import { $createRangeSelection, $getRoot, $getSelection, $isRangeSelection, $set
5
5
  * cells, but it can span the several text nodes that formatting splits a
6
6
  * paragraph into.
7
7
  */
8
- function $textGroups() {
8
+ export function $textGroups() {
9
9
  const groups = new Map();
10
10
  for (const node of $getRoot().getAllTextNodes()) {
11
11
  const parentKey = node.getParentOrThrow().getKey();
@@ -18,7 +18,7 @@ function $textGroups() {
18
18
  return [...groups.values()];
19
19
  }
20
20
  /** The text node and offset that a character index in a group falls in. */
21
- function $locate(group, index, end) {
21
+ export function $locate(group, index, end) {
22
22
  let start = 0;
23
23
  for (const node of group) {
24
24
  const length = node.getTextContent().length;
@@ -169,6 +169,38 @@ export interface Strings {
169
169
  noMatches: string;
170
170
  close: string;
171
171
  };
172
+ spellcheck: {
173
+ title: string;
174
+ language: string;
175
+ check: string;
176
+ close: string;
177
+ noMisspellings: string;
178
+ previous: string;
179
+ next: string;
180
+ noSuggestions: string;
181
+ };
182
+ autoCorrect: {
183
+ title: string;
184
+ language: string;
185
+ from: string;
186
+ fromPlaceholder: string;
187
+ to: string;
188
+ toPlaceholder: string;
189
+ save: string;
190
+ saved: string;
191
+ noWritableStore: string;
192
+ failed: string;
193
+ close: string;
194
+ correctDocument: string;
195
+ };
196
+ contextMenu: {
197
+ cut: string;
198
+ copy: string;
199
+ paste: string;
200
+ selectAll: string;
201
+ spelling: string;
202
+ noSuggestions: string;
203
+ };
172
204
  link: {
173
205
  menuLabel: string;
174
206
  noUrl: 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;QACrB,sEAAsE;QACtE,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,O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;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;AAmyBD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAI3C,CAAC;AAEF;;sDAEsD;AACtD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD"}
@@ -152,6 +152,38 @@ const en = {
152
152
  noMatches: 'No matches',
153
153
  close: 'Close',
154
154
  },
155
+ spellcheck: {
156
+ title: 'Spell check',
157
+ language: 'Language',
158
+ check: 'Check',
159
+ close: 'Close',
160
+ noMisspellings: 'No misspellings found',
161
+ previous: 'Previous',
162
+ next: 'Next',
163
+ noSuggestions: 'No suggestions',
164
+ },
165
+ autoCorrect: {
166
+ title: 'Auto-correct',
167
+ language: 'Language',
168
+ from: 'Typed word',
169
+ fromPlaceholder: 'Word as typed',
170
+ to: 'Corrected word',
171
+ toPlaceholder: 'Correct it to',
172
+ save: 'Save correction',
173
+ saved: 'Saved. It applies to the next word typed.',
174
+ noWritableStore: 'No store accepts new corrections',
175
+ failed: 'Could not save the correction',
176
+ close: 'Close',
177
+ correctDocument: 'Correct whole document',
178
+ },
179
+ contextMenu: {
180
+ cut: 'Cut',
181
+ copy: 'Copy',
182
+ paste: 'Paste',
183
+ selectAll: 'Select all',
184
+ spelling: 'Spelling suggestions',
185
+ noSuggestions: 'No suggestions',
186
+ },
155
187
  link: {
156
188
  menuLabel: 'Link',
157
189
  noUrl: '(no URL)',
@@ -385,6 +417,38 @@ const ur = {
385
417
  noMatches: 'کوئی میچ نہیں',
386
418
  close: 'بند کریں',
387
419
  },
420
+ spellcheck: {
421
+ title: 'ہجے کی جانچ',
422
+ language: 'زبان',
423
+ check: 'جانچیں',
424
+ close: 'بند کریں',
425
+ noMisspellings: 'کوئی غلط ہجے نہیں ملے',
426
+ previous: 'پچھلا',
427
+ next: 'اگلا',
428
+ noSuggestions: 'کوئی تجویز نہیں',
429
+ },
430
+ autoCorrect: {
431
+ title: 'خودکار تصحیح',
432
+ language: 'زبان',
433
+ from: 'لکھا ہوا لفظ',
434
+ fromPlaceholder: 'جو لفظ لکھا جاتا ہے',
435
+ to: 'درست لفظ',
436
+ toPlaceholder: 'اسے درست کریں',
437
+ save: 'تصحیح محفوظ کریں',
438
+ saved: 'محفوظ ہو گئی۔ اگلے لفظ پر لاگو ہوگی۔',
439
+ noWritableStore: 'کوئی ذخیرہ نئی تصحیح قبول نہیں کرتا',
440
+ failed: 'تصحیح محفوظ نہیں ہو سکی',
441
+ close: 'بند کریں',
442
+ correctDocument: 'تمام متن کی تصحیح کریں',
443
+ },
444
+ contextMenu: {
445
+ cut: 'کاٹیں',
446
+ copy: 'کاپی کریں',
447
+ paste: 'چسپاں کریں',
448
+ selectAll: 'سب منتخب کریں',
449
+ spelling: 'ہجے کی تجاویز',
450
+ noSuggestions: 'کوئی تجویز نہیں',
451
+ },
388
452
  link: {
389
453
  menuLabel: 'لنک',
390
454
  noUrl: '(کوئی یو آر ایل نہیں)',
@@ -607,16 +671,48 @@ const paShahmukhi = {
607
671
  },
608
672
  findReplace: {
609
673
  toggle: 'لبھو تے بدلو',
610
- find: 'لبھo',
611
- replace: 'بدلo',
674
+ find: 'لبھو',
675
+ replace: 'بدلو',
612
676
  findPlaceholder: 'جو لبھنا اے',
613
677
  replacePlaceholder: 'بدلن والا متن',
614
678
  previous: 'پچھلا',
615
679
  next: 'اگلا',
616
- replaceOne: 'بدلo',
617
- replaceAll: 'سارے بدلo',
680
+ replaceOne: 'بدلو',
681
+ replaceAll: 'سارے بدلو',
618
682
  noMatches: 'کوئی ملدا نئیں',
619
- close: 'بند کرo',
683
+ close: 'بند کرو',
684
+ },
685
+ spellcheck: {
686
+ title: 'ہجے دی جانچ',
687
+ language: 'بولی',
688
+ check: 'جانچو',
689
+ close: 'بند کرو',
690
+ noMisspellings: 'کوئی غلط ہجے نئیں لبھے',
691
+ previous: 'پچھلا',
692
+ next: 'اگلا',
693
+ noSuggestions: 'کوئی تجویز نئیں',
694
+ },
695
+ autoCorrect: {
696
+ title: 'خودکار درستی',
697
+ language: 'بولی',
698
+ from: 'لکھیا ہویا لفظ',
699
+ fromPlaceholder: 'جو لفظ لکھیا جاندا اے',
700
+ to: 'ٹھیک لفظ',
701
+ toPlaceholder: 'ایس نوں ٹھیک کرو',
702
+ save: 'درستی سانبھو',
703
+ saved: 'سانبھ لیا۔ اگلے لفظ تے لاگو ہووے گی۔',
704
+ noWritableStore: 'کوئی ذخیرہ نویں درستی نئیں منّدا',
705
+ failed: 'درستی سانبھی نئیں جا سکی',
706
+ close: 'بند کرو',
707
+ correctDocument: 'پورے متن دی درستی کرو',
708
+ },
709
+ contextMenu: {
710
+ cut: 'کٹو',
711
+ copy: 'کاپی کرو',
712
+ paste: 'چسپاں کرو',
713
+ selectAll: 'سارا چنو',
714
+ spelling: 'ہجے دیاں تجویزاں',
715
+ noSuggestions: 'کوئی تجویز نئیں',
620
716
  },
621
717
  link: {
622
718
  menuLabel: 'لنک',
package/dist/index.d.ts CHANGED
@@ -9,4 +9,9 @@ export type { FontOption } from './fonts/index.js';
9
9
  export { STRINGS, getStrings, useStrings, useUiStrings, UiStringsContext } from './i18n/index.js';
10
10
  export type { Locale, Strings } from './i18n/index.js';
11
11
  export { registerSpellDictionary, hasSpellDictionary, type HunspellFiles, type SpellLanguage } from './spellcheck/spellDictionaries.js';
12
+ export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
13
+ export type { AutoCorrectStore, AutoCorrectEntry } from './autocorrect/autoCorrectStores.js';
14
+ export { normalizeUrdu, normalizeUrduCharacters, removeUrduDiacritics, replaceUrduDigits } from './normalization/urduNormalize.js';
15
+ export type { UrduNormalizationOptions } from './normalization/urduNormalize.js';
16
+ export type { PunctuationOptions, PunctuationRule } from './autocorrect/punctuationRules.js';
12
17
  //# sourceMappingURL=index.d.ts.map
@@ -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,MAAM,cAAc,CAAC;AAC1G,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACzF,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC"}
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,MAAM,cAAc,CAAC;AAC1G,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACzF,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACrI,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC1H,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAChI,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,YAAY,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -4,3 +4,5 @@ export { ImageNode, $createImageNode, $isImageNode } from './image/ImageNode.js'
4
4
  export { DEFAULT_FONT_OPTIONS, URDU_WEB_FONT_OPTIONS, FONT_SIZES_PX } from './fonts/index.js';
5
5
  export { STRINGS, getStrings, useStrings, useUiStrings, UiStringsContext } from './i18n/index.js';
6
6
  export { registerSpellDictionary, hasSpellDictionary } from './spellcheck/spellDictionaries.js';
7
+ export { localStorageAutoCorrectStore, apiAutoCorrectStore, fileAutoCorrectStore } from './autocorrect/autoCorrectStores.js';
8
+ export { normalizeUrdu, normalizeUrduCharacters, removeUrduDiacritics, replaceUrduDigits } from './normalization/urduNormalize.js';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Urdu character normalisation, ported from urduhack's `normalization/character.py`
3
+ * (MIT licence, https://github.com/urduhack/urduhack). The mapping replaces
4
+ * Arabic and presentation-form letters with the standard Urdu letter, and
5
+ * the tables below keep the same entries and order as the original, so the
6
+ * output matches it character for character.
7
+ */
8
+ /** Replaces Arabic and presentation-form letters with standard Urdu letters, character by character. */
9
+ export declare function normalizeUrduCharacters(text: string): string;
10
+ export declare function removeUrduDiacritics(text: string): string;
11
+ /** Converts Urdu digits to English digits, or the reverse. */
12
+ export declare function replaceUrduDigits(text: string, to: 'english' | 'urdu'): string;
13
+ export interface UrduNormalizationOptions {
14
+ /** Remove harakat. Off by default, since they are meaningful in poetry and religious text. */
15
+ removeDiacritics?: boolean;
16
+ /** Digit style to convert to; 'keep' (the default) leaves digits as they are. */
17
+ digits?: 'keep' | 'english' | 'urdu';
18
+ }
19
+ /**
20
+ * The normalisation urduhack's `normalize` applies, with the diacritic and
21
+ * digit steps made optional. Character mapping always runs.
22
+ */
23
+ export declare function normalizeUrdu(text: string, options?: UrduNormalizationOptions): string;
24
+ //# sourceMappingURL=urduNormalize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urduNormalize.d.ts","sourceRoot":"","sources":["../../src/normalization/urduNormalize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8EH,wGAAwG;AACxG,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI5D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAS9E;AAED,MAAM,WAAW,wBAAwB;IACvC,8FAA8F;IAC9F,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;CACtC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B,GAAG,MAAM,CAK1F"}