@inshapardaz/likhari-react 0.1.22 → 0.1.23-dev.221

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 (48) hide show
  1. package/dist/EditorRoot.d.ts +12 -0
  2. package/dist/EditorRoot.d.ts.map +1 -1
  3. package/dist/EditorRoot.js +24 -11
  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 +124 -0
  7. package/dist/autocorrect/autoCorrectActions.d.ts +41 -0
  8. package/dist/autocorrect/autoCorrectActions.d.ts.map +1 -0
  9. package/dist/autocorrect/autoCorrectActions.js +212 -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 +19 -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 +5 -1
  23. package/dist/components/SpellcheckPanel.d.ts.map +1 -1
  24. package/dist/components/SpellcheckPanel.js +12 -2
  25. package/dist/components/Toolbar.d.ts +10 -1
  26. package/dist/components/Toolbar.d.ts.map +1 -1
  27. package/dist/components/Toolbar.js +128 -109
  28. package/dist/i18n/strings.d.ts +25 -0
  29. package/dist/i18n/strings.d.ts.map +1 -1
  30. package/dist/i18n/strings.js +80 -5
  31. package/dist/index.d.ts +7 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3 -0
  34. package/dist/normalization/urduNormalize.d.ts +24 -0
  35. package/dist/normalization/urduNormalize.d.ts.map +1 -0
  36. package/dist/normalization/urduNormalize.js +116 -0
  37. package/dist/spellcheck/SpellHighlightPlugin.d.ts.map +1 -1
  38. package/dist/spellcheck/SpellHighlightPlugin.js +3 -0
  39. package/dist/spellcheck/spellDictionaries.d.ts.map +1 -1
  40. package/dist/spellcheck/spellDictionaries.js +8 -1
  41. package/dist/spellcheck/spellingMenu.d.ts +15 -0
  42. package/dist/spellcheck/spellingMenu.d.ts.map +1 -0
  43. package/dist/spellcheck/spellingMenu.js +27 -0
  44. package/dist/spellcheck/userWords.d.ts +39 -0
  45. package/dist/spellcheck/userWords.d.ts.map +1 -0
  46. package/dist/spellcheck/userWords.js +132 -0
  47. package/dist/theme/editor.css +58 -0
  48. package/package.json +1 -1
@@ -2,12 +2,17 @@ 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 { addUserWord, ignoreWord } from '../spellcheck/userWords.js';
15
+ import { $wordAtDomPoint, textPointAt } from '../spellcheck/spellingMenu.js';
11
16
  import { INSERT_HORIZONTAL_RULE_COMMAND } from '@lexical/react/LexicalHorizontalRuleNode';
12
17
  import { ImageDialog } from '../image/ImageDialog.js';
13
18
  import { $createImageNode } from '../image/ImageNode.js';
@@ -29,7 +34,7 @@ import { CANVAS_FONT_DEFAULTS, DEFAULT_FONT_OPTIONS, FONT_SIZES_PX } from '../fo
29
34
  import { setStyleProperty } from '../utils/style.js';
30
35
  import { useStrings } from '../i18n/useStrings.js';
31
36
  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';
37
+ 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
38
  /** Sentinel for "no inline style": Lexical returns the default it is given when
34
39
  * the selection has none, so this tells "unstyled" (show the canvas default)
35
40
  * apart from "styled with a value the dropdown doesn't list" (show nothing). */
@@ -139,8 +144,6 @@ function OverflowItem({ icon: Icon, label, active, onClick, }) {
139
144
  // Keep the editor's selection: a mousedown here would blur the canvas.
140
145
  onMouseDown: (e) => e.preventDefault(), onClick: onClick, children: label }));
141
146
  }
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
147
  function LinkMenuItems({ url, onEdit, onRemove, strings }) {
145
148
  // Only offer the link as clickable if it's a URL the editor would have accepted.
146
149
  const safeUrl = normalizeLinkUrl(url);
@@ -182,7 +185,7 @@ function PoetryMenuItems({ strings, layout, scale, centered, onAction, }) {
182
185
  };
183
186
  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
187
  }
185
- export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, onToggleFind, spellOpen = false, onToggleSpell, fontOptions = DEFAULT_FONT_OPTIONS, direction = 'ltr', locale = 'en', drafts }) {
188
+ export function Toolbar({ config, dictionaryStores = [], onAddAutoCorrect, onSave, isDirty, showSave, findOpen = false, onToggleFind, spellOpen = false, onToggleSpell, autoCorrectOpen = false, onToggleAutoCorrect, fontOptions = DEFAULT_FONT_OPTIONS, direction = 'ltr', locale = 'en', drafts }) {
186
189
  const [editor] = useLexicalComposerContext();
187
190
  const [state, setState] = useState(INITIAL_STATE);
188
191
  const strings = useStrings(locale);
@@ -463,112 +466,116 @@ export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, o
463
466
  editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
464
467
  closeLinkDialog();
465
468
  };
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.
469
+ // One right-click menu for the whole editor, replacing the browser's own. It
470
+ // adds what applies to what is under the pointer (a spelling fix, a link, a
471
+ // table cell, a poetry couplet) and always offers cut, copy, paste and select all.
498
472
  const runMenuAction = (action) => () => {
499
473
  restoreSelection();
500
474
  editor.update(action);
501
475
  editor.focus();
502
476
  };
503
- // Right-clicking a table cell opens the same actions at the pointer.
504
- const [tableContext, setTableContext] = useState(null);
477
+ const [contextMenu, setContextMenu] = useState(null);
505
478
  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;
479
+ const onContextMenu = async (event) => {
530
480
  event.preventDefault();
531
481
  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;
482
+ const target = event.target;
483
+ const anchor = config.links ? (target?.closest?.('a') ?? null) : null;
484
+ const cell = config.tables ? (target?.closest?.('td, th') ?? null) : null;
485
+ const couplet = config.poetry.enabled ? (target?.closest?.('.likhari-poetry') ?? null) : null;
486
+ const point = config.language.spellCheck ? textPointAt(event.clientX, event.clientY) : null;
487
+ const menu = { x: event.clientX, y: event.clientY };
488
+ let word = null;
552
489
  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();
490
+ if (anchor) {
491
+ const node = $getNearestNodeFromDOMNode(anchor);
492
+ const link = node ? $findMatchingParent(node, $isLinkNode) : null;
493
+ if ($isLinkNode(link)) {
494
+ menu.link = link.getURL();
495
+ // Select the whole link first, so Edit / Remove act on it wherever the caret was.
496
+ link.select(0, link.getChildrenSize());
497
+ }
498
+ }
499
+ if (cell) {
500
+ const node = $getNearestNodeFromDOMNode(cell);
501
+ const tableCell = node ? $getTableCellNodeFromLexicalNode(node) : null;
502
+ if (tableCell) {
503
+ const selection = $getSelection();
504
+ // Keep a multi-cell selection that includes this cell.
505
+ const insideSelection = $isTableSelection(selection) && selection.getNodes().some((n) => n.getKey() === tableCell.getKey());
506
+ if (!insideSelection)
507
+ tableCell.selectEnd();
508
+ const size = $getTableSelectionSize();
509
+ menu.table = { rows: size.rows, columns: size.columns };
510
+ }
511
+ }
512
+ if (couplet) {
513
+ const node = $getNearestNodeFromDOMNode(couplet);
514
+ const block = node ? $findMatchingParent(node, $isPoetryBlockNode) : null;
515
+ if (block) {
516
+ menu.poetry = true;
517
+ if (!$getPoetryBlockFromSelection())
518
+ block.selectStart();
519
+ }
520
+ }
521
+ if (point)
522
+ word = $wordAtDomPoint(point.node, point.offset);
560
523
  }, { discrete: true });
561
- if (!handled)
562
- return;
563
- event.preventDefault();
564
- snapshotSelectionRef.current();
565
- setPoetryContext({ x: event.clientX, y: event.clientY });
524
+ if (word) {
525
+ const language = word.direction === 'rtl' ? 'ur' : 'en';
526
+ const speller = getSpeller(language);
527
+ if (speller) {
528
+ const checked = await speller;
529
+ if (!checked.correct(word.word)) {
530
+ menu.spelling = { word: word.word, language, suggestions: checked.suggest(word.word).slice(0, 5), match: word.match };
531
+ }
532
+ }
533
+ }
534
+ setContextMenu(menu);
566
535
  };
567
536
  return editor.registerRootListener((root, previous) => {
568
537
  previous?.removeEventListener('contextmenu', onContextMenu);
569
538
  root?.addEventListener('contextmenu', onContextMenu);
570
539
  });
571
- }, [editor, config.poetry.enabled]);
540
+ }, [editor, config.links, config.tables, config.poetry.enabled, config.language.spellCheck]);
541
+ // Cut and copy put the selected text on the clipboard as plain text.
542
+ const copyOrCut = (cut) => async () => {
543
+ restoreSelection();
544
+ let text = '';
545
+ editor.update(() => {
546
+ const selection = $getSelection();
547
+ if (!$isRangeSelection(selection))
548
+ return;
549
+ text = selection.getTextContent();
550
+ if (cut)
551
+ selection.removeText();
552
+ }, { discrete: true });
553
+ if (text)
554
+ await navigator.clipboard?.writeText(text).catch(() => undefined);
555
+ editor.focus();
556
+ };
557
+ // Paste reads plain text from the clipboard (the browser may ask for permission).
558
+ const paste = async () => {
559
+ restoreSelection();
560
+ let text;
561
+ try {
562
+ text = await navigator.clipboard.readText();
563
+ }
564
+ catch {
565
+ return;
566
+ }
567
+ editor.update(() => {
568
+ const selection = $getSelection();
569
+ if (!$isRangeSelection(selection))
570
+ return;
571
+ text.split(/\r?\n/).forEach((line, index) => {
572
+ if (index > 0)
573
+ selection.insertParagraph();
574
+ selection.insertText(line);
575
+ });
576
+ }, { discrete: true });
577
+ editor.focus();
578
+ };
572
579
  // Ctrl/Cmd+K opens the link dialog.
573
580
  useEffect(() => {
574
581
  if (!config.links)
@@ -811,25 +818,37 @@ export function Toolbar({ config, onSave, isDirty, showSave, findOpen = false, o
811
818
  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
819
  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
820
  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(ToolbarButton, { icon: IconAbc, title: strings.toolbar.spellChecker, active: spellOpen, onClick: onToggleSpell }))] }, "language")),
821
+ 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
822
  ];
816
823
  return (_jsxs("div", { className: "likhari-toolbar", role: "toolbar", "aria-label": strings.toolbar.ariaLabel, ref: toolbarContainerRef, children: [fixedGroups, movableGroups
817
824
  .filter((group) => !overflowGroupKeys.has(group.key))
818
825
  .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
826
  .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) => {
827
+ .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
828
  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: {
829
+ setContextMenu(null);
830
+ }, 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: () => {
831
+ const match = contextMenu.spelling.match;
832
+ editor.update(() => $replaceMatch(match, suggestion), { discrete: true });
833
+ editor.focus();
834
+ }, children: suggestion }, suggestion))), _jsx(Menu.Item, { onClick: () => {
835
+ ignoreWord(contextMenu.spelling.language, contextMenu.spelling.word);
836
+ setContextMenu(null);
837
+ }, children: strings.contextMenu.ignore }), _jsx(Menu.Item, { onClick: () => {
838
+ const { language, word } = contextMenu.spelling;
839
+ // Without a writable store, the word is ignored for this session instead.
840
+ void addUserWord(dictionaryStores, language, word).then((added) => {
841
+ if (!added)
842
+ ignoreWord(language, word);
843
+ });
844
+ setContextMenu(null);
845
+ }, children: strings.contextMenu.addToDictionary }), onAddAutoCorrect && config.language.autocorrect && (_jsx(Menu.Item, { onClick: () => {
846
+ onAddAutoCorrect(contextMenu.spelling.word, contextMenu.spelling.language);
847
+ setContextMenu(null);
848
+ }, children: strings.contextMenu.addToAutoCorrect })), _jsx(Menu.Divider, {})] })), contextMenu?.link !== undefined && (_jsxs(_Fragment, { children: [_jsx(LinkMenuItems, { url: contextMenu.link, onEdit: () => {
849
+ restoreSelection();
850
+ openLinkDialog();
851
+ }, 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
852
  position: 'absolute',
834
853
  visibility: 'hidden',
835
854
  pointerEvents: 'none',
@@ -179,6 +179,31 @@ export interface Strings {
179
179
  next: string;
180
180
  noSuggestions: string;
181
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
+ ignore: string;
202
+ addToDictionary: string;
203
+ addToAutoCorrect: string;
204
+ spelling: string;
205
+ noSuggestions: string;
206
+ };
182
207
  link: {
183
208
  menuLabel: string;
184
209
  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,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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
+ ignore: 'Ignore',
185
+ addToDictionary: 'Add to dictionary',
186
+ addToAutoCorrect: 'Add to auto-correct',
187
+ spelling: 'Spelling suggestions',
188
+ noSuggestions: 'No suggestions',
189
+ },
165
190
  link: {
166
191
  menuLabel: 'Link',
167
192
  noUrl: '(no URL)',
@@ -405,6 +430,31 @@ const ur = {
405
430
  next: 'اگلا',
406
431
  noSuggestions: 'کوئی تجویز نہیں',
407
432
  },
433
+ autoCorrect: {
434
+ title: 'خودکار تصحیح',
435
+ language: 'زبان',
436
+ from: 'لکھا ہوا لفظ',
437
+ fromPlaceholder: 'جو لفظ لکھا جاتا ہے',
438
+ to: 'درست لفظ',
439
+ toPlaceholder: 'اسے درست کریں',
440
+ save: 'تصحیح محفوظ کریں',
441
+ saved: 'محفوظ ہو گئی۔ اگلے لفظ پر لاگو ہوگی۔',
442
+ noWritableStore: 'کوئی ذخیرہ نئی تصحیح قبول نہیں کرتا',
443
+ failed: 'تصحیح محفوظ نہیں ہو سکی',
444
+ close: 'بند کریں',
445
+ correctDocument: 'تمام متن کی تصحیح کریں',
446
+ },
447
+ contextMenu: {
448
+ cut: 'کاٹیں',
449
+ copy: 'کاپی کریں',
450
+ paste: 'چسپاں کریں',
451
+ selectAll: 'سب منتخب کریں',
452
+ ignore: 'نظرانداز کریں',
453
+ addToDictionary: 'لغت میں شامل کریں',
454
+ addToAutoCorrect: 'خودکار تصحیح میں شامل کریں',
455
+ spelling: 'ہجے کی تجاویز',
456
+ noSuggestions: 'کوئی تجویز نہیں',
457
+ },
408
458
  link: {
409
459
  menuLabel: 'لنک',
410
460
  noUrl: '(کوئی یو آر ایل نہیں)',
@@ -627,16 +677,16 @@ const paShahmukhi = {
627
677
  },
628
678
  findReplace: {
629
679
  toggle: 'لبھو تے بدلو',
630
- find: 'لبھo',
631
- replace: 'بدلo',
680
+ find: 'لبھو',
681
+ replace: 'بدلو',
632
682
  findPlaceholder: 'جو لبھنا اے',
633
683
  replacePlaceholder: 'بدلن والا متن',
634
684
  previous: 'پچھلا',
635
685
  next: 'اگلا',
636
- replaceOne: 'بدلo',
637
- replaceAll: 'سارے بدلo',
686
+ replaceOne: 'بدلو',
687
+ replaceAll: 'سارے بدلو',
638
688
  noMatches: 'کوئی ملدا نئیں',
639
- close: 'بند کرo',
689
+ close: 'بند کرو',
640
690
  },
641
691
  spellcheck: {
642
692
  title: 'ہجے دی جانچ',
@@ -648,6 +698,31 @@ const paShahmukhi = {
648
698
  next: 'اگلا',
649
699
  noSuggestions: 'کوئی تجویز نئیں',
650
700
  },
701
+ autoCorrect: {
702
+ title: 'خودکار درستی',
703
+ language: 'بولی',
704
+ from: 'لکھیا ہویا لفظ',
705
+ fromPlaceholder: 'جو لفظ لکھیا جاندا اے',
706
+ to: 'ٹھیک لفظ',
707
+ toPlaceholder: 'ایس نوں ٹھیک کرو',
708
+ save: 'درستی سانبھو',
709
+ saved: 'سانبھ لیا۔ اگلے لفظ تے لاگو ہووے گی۔',
710
+ noWritableStore: 'کوئی ذخیرہ نویں درستی نئیں منّدا',
711
+ failed: 'درستی سانبھی نئیں جا سکی',
712
+ close: 'بند کرو',
713
+ correctDocument: 'پورے متن دی درستی کرو',
714
+ },
715
+ contextMenu: {
716
+ cut: 'کٹو',
717
+ copy: 'کاپی کرو',
718
+ paste: 'چسپاں کرو',
719
+ selectAll: 'سارا چنو',
720
+ ignore: 'نظر انداز کرو',
721
+ addToDictionary: 'شبدکوش وچ پاؤ',
722
+ addToAutoCorrect: 'خودکار درستی وچ پاؤ',
723
+ spelling: 'ہجے دیاں تجویزاں',
724
+ noSuggestions: 'کوئی تجویز نئیں',
725
+ },
651
726
  link: {
652
727
  menuLabel: 'لنک',
653
728
  noUrl: '(کوئی یو آر ایل نئیں)',
package/dist/index.d.ts CHANGED
@@ -9,4 +9,11 @@ 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';
17
+ export { localStorageUserWordStore, apiUserWordStore, ignoreWord, addUserWord, onSpellWordsChange } from './spellcheck/userWords.js';
18
+ export type { UserWordStore } from './spellcheck/userWords.js';
12
19
  //# 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,YAA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,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;AAC1F,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAClI,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -4,3 +4,6 @@ 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';
9
+ export { localStorageUserWordStore, apiUserWordStore, ignoreWord, addUserWord, onSpellWordsChange } from './spellcheck/userWords.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"}