@forgedevstack/ink 1.1.6 → 1.1.8
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/CHANGELOG.md +57 -1
- package/README.md +9 -1
- package/bin/ink.const.mjs +26 -0
- package/bin/ink.mjs +58 -0
- package/dist/common-components/icons/BulletListIcon.cjs +1 -0
- package/dist/common-components/icons/BulletListIcon.d.ts +3 -0
- package/dist/common-components/icons/BulletListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/BulletListIcon.js +11 -0
- package/dist/common-components/icons/ChecklistIcon.cjs +1 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts +3 -0
- package/dist/common-components/icons/ChecklistIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ChecklistIcon.js +10 -0
- package/dist/common-components/icons/ImageToolIcon.cjs +1 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts +3 -0
- package/dist/common-components/icons/ImageToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/ImageToolIcon.js +10 -0
- package/dist/common-components/icons/LinkToolIcon.cjs +1 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts +3 -0
- package/dist/common-components/icons/LinkToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/LinkToolIcon.js +9 -0
- package/dist/common-components/icons/OrderedListIcon.cjs +1 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts +3 -0
- package/dist/common-components/icons/OrderedListIcon.d.ts.map +1 -0
- package/dist/common-components/icons/OrderedListIcon.js +9 -0
- package/dist/common-components/icons/QuoteIcon.cjs +1 -0
- package/dist/common-components/icons/QuoteIcon.d.ts +3 -0
- package/dist/common-components/icons/QuoteIcon.d.ts.map +1 -0
- package/dist/common-components/icons/QuoteIcon.js +6 -0
- package/dist/common-components/icons/TableToolIcon.cjs +1 -0
- package/dist/common-components/icons/TableToolIcon.d.ts +3 -0
- package/dist/common-components/icons/TableToolIcon.d.ts.map +1 -0
- package/dist/common-components/icons/TableToolIcon.js +9 -0
- package/dist/common-components/icons/index.d.ts +7 -0
- package/dist/common-components/icons/index.d.ts.map +1 -1
- package/dist/common-components/index.d.ts +1 -1
- package/dist/common-components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +1230 -778
- package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.js +58 -52
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.cjs +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts +4 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.js +209 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts +10 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/ExcelSheetPanel.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ExcelSheetPanel/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.cjs +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts +4 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.js +91 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts +11 -0
- package/dist/components/InkEditor/components/GraphEditModal/GraphEditModal.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphEditModal/index.d.ts +3 -0
- package/dist/components/InkEditor/components/GraphEditModal/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.cjs +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts +4 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.js +98 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts +10 -0
- package/dist/components/InkEditor/components/GraphPicker/GraphPicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/GraphPicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/GraphPicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.cjs +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts +4 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.js +27 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts +7 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/HtmlSourcePanel.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts +3 -0
- package/dist/components/InkEditor/components/HtmlSourcePanel/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.cjs +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts +4 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.js +36 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts +8 -0
- package/dist/components/InkEditor/components/OutlineRail/OutlineRail.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts +3 -0
- package/dist/components/InkEditor/components/OutlineRail/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.cjs +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts +1 -0
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.d.ts.map +1 -1
- package/dist/components/InkEditor/components/SlashMenu/SlashMenu.js +62 -17
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.cjs +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.cjs +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts +10 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.const.js +18 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts +4 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.js +95 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts +11 -0
- package/dist/components/InkEditor/components/TableSizePicker/TableSizePicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TableSizePicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/TableSizePicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.cjs +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts +4 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.js +81 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts +12 -0
- package/dist/components/InkEditor/components/ThemePicker/ThemePicker.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ThemePicker/index.d.ts +3 -0
- package/dist/components/InkEditor/components/ThemePicker/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.cjs +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts +4 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.js +79 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts +10 -0
- package/dist/components/InkEditor/components/TitleGallery/TitleGallery.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/TitleGallery/index.d.ts +3 -0
- package/dist/components/InkEditor/components/TitleGallery/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarButton/ToolbarButton.js +41 -17
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts.map +1 -1
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.js +93 -18
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts +6 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.cjs +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts +3 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/ToolbarDropdown.utils.js +15 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts +2 -0
- package/dist/components/InkEditor/components/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/components/InkEditor/components/index.d.ts +16 -0
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.cjs +2 -2
- package/dist/components/InkEditor/helpers/format.utils.d.ts +1 -1
- package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.js +72 -72
- package/dist/constants/colorMode.const.cjs +1 -1
- package/dist/constants/colorMode.const.d.ts +1 -1
- package/dist/constants/colorMode.const.d.ts.map +1 -1
- package/dist/constants/colorMode.const.js +4 -4
- package/dist/constants/contextMenu.const.cjs +1 -1
- package/dist/constants/contextMenu.const.d.ts +2 -0
- package/dist/constants/contextMenu.const.d.ts.map +1 -1
- package/dist/constants/contextMenu.const.js +17 -15
- package/dist/constants/defaultIcons.cjs +1 -1
- package/dist/constants/defaultIcons.d.ts.map +1 -1
- package/dist/constants/defaultIcons.js +35 -18
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts +95 -1
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +323 -57
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +90 -0
- package/dist/constants/generals.const.d.ts.map +1 -1
- package/dist/constants/generals.const.js +75 -4
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/keyboard.const.cjs +1 -1
- package/dist/constants/keyboard.const.d.ts +1 -0
- package/dist/constants/keyboard.const.d.ts.map +1 -1
- package/dist/constants/keyboard.const.js +2 -1
- package/dist/constants/lists.const.cjs +1 -1
- package/dist/constants/lists.const.d.ts +1 -0
- package/dist/constants/lists.const.d.ts.map +1 -1
- package/dist/constants/lists.const.js +10 -9
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.d.ts +19 -1
- package/dist/constants/numbers.d.ts.map +1 -1
- package/dist/constants/numbers.js +46 -27
- package/dist/constants/plugins.const.cjs +1 -0
- package/dist/constants/plugins.const.d.ts +13 -0
- package/dist/constants/plugins.const.d.ts.map +1 -0
- package/dist/constants/plugins.const.js +45 -0
- package/dist/constants/premium.const.cjs +1 -1
- package/dist/constants/premium.const.d.ts.map +1 -1
- package/dist/constants/premium.const.js +10 -9
- package/dist/constants/table.const.cjs +1 -1
- package/dist/constants/table.const.d.ts +4 -0
- package/dist/constants/table.const.d.ts.map +1 -1
- package/dist/constants/table.const.js +10 -6
- package/dist/constants/toolbar.const.cjs +1 -1
- package/dist/constants/toolbar.const.d.ts +8 -0
- package/dist/constants/toolbar.const.d.ts.map +1 -1
- package/dist/constants/toolbar.const.js +16 -8
- package/dist/constants/toolbarMenu.const.cjs +1 -1
- package/dist/constants/toolbarMenu.const.d.ts +2 -0
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -1
- package/dist/constants/toolbarMenu.const.js +80 -18
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useToolbarOverflow.cjs +1 -0
- package/dist/hooks/useToolbarOverflow.d.ts +8 -0
- package/dist/hooks/useToolbarOverflow.d.ts.map +1 -0
- package/dist/hooks/useToolbarOverflow.js +29 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -93
- package/dist/plugins/excel/excel.utils.cjs +1 -0
- package/dist/plugins/excel/excel.utils.d.ts +13 -0
- package/dist/plugins/excel/excel.utils.d.ts.map +1 -0
- package/dist/plugins/excel/excel.utils.js +40 -0
- package/dist/plugins/excel/index.d.ts +3 -0
- package/dist/plugins/excel/index.d.ts.map +1 -0
- package/dist/plugins/graph/graph.const.cjs +1 -0
- package/dist/plugins/graph/graph.const.d.ts +14 -0
- package/dist/plugins/graph/graph.const.d.ts.map +1 -0
- package/dist/plugins/graph/graph.const.js +24 -0
- package/dist/plugins/graph/graph.types.d.ts +7 -0
- package/dist/plugins/graph/graph.types.d.ts.map +1 -0
- package/dist/plugins/graph/graph.utils.cjs +1 -0
- package/dist/plugins/graph/graph.utils.d.ts +11 -0
- package/dist/plugins/graph/graph.utils.d.ts.map +1 -0
- package/dist/plugins/graph/graph.utils.js +76 -0
- package/dist/plugins/graph/index.d.ts +4 -0
- package/dist/plugins/graph/index.d.ts.map +1 -0
- package/dist/plugins/host/index.d.ts +2 -0
- package/dist/plugins/host/index.d.ts.map +1 -0
- package/dist/plugins/host/inkPlugins.cjs +1 -0
- package/dist/plugins/host/inkPlugins.d.ts +16 -0
- package/dist/plugins/host/inkPlugins.d.ts.map +1 -0
- package/dist/plugins/host/inkPlugins.js +20 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/theme/index.d.ts +4 -0
- package/dist/plugins/theme/index.d.ts.map +1 -0
- package/dist/plugins/theme/inkTheme.cjs +1 -0
- package/dist/plugins/theme/inkTheme.d.ts +5 -0
- package/dist/plugins/theme/inkTheme.d.ts.map +1 -0
- package/dist/plugins/theme/inkTheme.js +30 -0
- package/dist/plugins/theme/theme.const.cjs +1 -0
- package/dist/plugins/theme/theme.const.d.ts +9 -0
- package/dist/plugins/theme/theme.const.d.ts.map +1 -0
- package/dist/plugins/theme/theme.const.js +15 -0
- package/dist/plugins/theme/theme.types.d.ts +12 -0
- package/dist/plugins/theme/theme.types.d.ts.map +1 -0
- package/dist/plugins/titles/index.d.ts +4 -0
- package/dist/plugins/titles/index.d.ts.map +1 -0
- package/dist/plugins/titles/titles.const.cjs +1 -0
- package/dist/plugins/titles/titles.const.d.ts +4 -0
- package/dist/plugins/titles/titles.const.d.ts.map +1 -0
- package/dist/plugins/titles/titles.const.js +15 -0
- package/dist/plugins/titles/titles.types.d.ts +2 -0
- package/dist/plugins/titles/titles.types.d.ts.map +1 -0
- package/dist/plugins/titles/titles.utils.cjs +1 -0
- package/dist/plugins/titles/titles.utils.d.ts +3 -0
- package/dist/plugins/titles/titles.utils.d.ts.map +1 -0
- package/dist/plugins/titles/titles.utils.js +14 -0
- package/dist/styles.css +1 -1
- package/dist/types/features.types.d.ts +1 -1
- package/dist/types/features.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +15 -2
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/outline.types.d.ts +6 -0
- package/dist/types/outline.types.d.ts.map +1 -0
- package/dist/types/plugin.types.d.ts +8 -0
- package/dist/types/plugin.types.d.ts.map +1 -0
- package/dist/types/premium.types.d.ts +2 -2
- package/dist/types/premium.types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/outline.utils.cjs +1 -0
- package/dist/utils/outline.utils.d.ts +8 -0
- package/dist/utils/outline.utils.d.ts.map +1 -0
- package/dist/utils/outline.utils.js +49 -0
- package/dist/utils/slash.utils.cjs +1 -1
- package/dist/utils/slash.utils.d.ts +5 -0
- package/dist/utils/slash.utils.d.ts.map +1 -1
- package/dist/utils/slash.utils.js +24 -7
- package/dist/utils/table.utils.cjs +1 -1
- package/dist/utils/table.utils.d.ts +4 -0
- package/dist/utils/table.utils.d.ts.map +1 -1
- package/dist/utils/table.utils.js +84 -45
- package/dist/utils/words.utils.cjs +1 -0
- package/dist/utils/words.utils.d.ts +2 -0
- package/dist/utils/words.utils.d.ts.map +1 -0
- package/dist/utils/words.utils.js +14 -0
- package/package.json +7 -1
|
@@ -4,7 +4,7 @@ import { InkCommentThread, InkCommentsChangeHandler } from './comments.types';
|
|
|
4
4
|
import { InkColorMode, InkEditorChrome, InkEditorVariant, InkFeaturesConfig } from './features.types';
|
|
5
5
|
import { InkIconMap, InkImageUploadHandler, InkPasteMode, InkPremiumConfig, InkThemeTokens } from './premium.types';
|
|
6
6
|
import { InkTrackChange, InkTrackChangesChangeHandler } from './trackChanges.types';
|
|
7
|
-
export type ToolbarOption = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'headingDropdown' | 'fontDropdown' | 'bulletList' | 'orderedList' | 'listDropdown' | 'blockquote' | 'code' | 'link' | 'image' | 'table' | 'signature' | 'findReplace' | 'findReplaceDropdown' | 'horizontalRule' | 'undo' | 'redo' | 'trackChanges' | 'comments' | 'ai' | 'textColor' | 'highlightColor' | 'directionLtr' | 'directionRtl' | 'superscript' | 'subscript' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'indent' | 'outdent' | 'clearFormat' | 'divider';
|
|
7
|
+
export type ToolbarOption = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'headingDropdown' | 'fontDropdown' | 'bulletList' | 'orderedList' | 'checklist' | 'listDropdown' | 'blockquote' | 'code' | 'link' | 'image' | 'table' | 'signature' | 'findReplace' | 'findReplaceDropdown' | 'horizontalRule' | 'undo' | 'redo' | 'trackChanges' | 'comments' | 'ai' | 'textColor' | 'highlightColor' | 'directionLtr' | 'directionRtl' | 'superscript' | 'subscript' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'indent' | 'outdent' | 'clearFormat' | 'htmlSource' | 'titles' | 'excel' | 'graph' | 'outline' | 'fullscreen' | 'theme' | 'divider';
|
|
8
8
|
export interface InkEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
9
9
|
value?: string;
|
|
10
10
|
defaultValue?: string;
|
|
@@ -48,17 +48,25 @@ export interface InkEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
|
|
|
48
48
|
onToolbarChange?: (items: ToolbarOption[]) => void;
|
|
49
49
|
toolbarHidden?: boolean;
|
|
50
50
|
onToolbarHiddenChange?: (hidden: boolean) => void;
|
|
51
|
+
showOutline?: boolean;
|
|
52
|
+
onOutlineChange?: (open: boolean) => void;
|
|
51
53
|
}
|
|
52
54
|
export interface ToolbarButtonProps {
|
|
53
55
|
icon: ReactNode;
|
|
54
56
|
title: string;
|
|
57
|
+
hint?: string;
|
|
58
|
+
onHint?: (hint: string) => void;
|
|
59
|
+
pluginColor?: string;
|
|
55
60
|
active?: boolean;
|
|
56
61
|
onClick: () => void;
|
|
57
62
|
disabled?: boolean;
|
|
63
|
+
className?: string;
|
|
58
64
|
}
|
|
59
65
|
export interface DropdownOption {
|
|
60
66
|
value: string;
|
|
61
67
|
label: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
mark?: string;
|
|
62
70
|
}
|
|
63
71
|
export interface ToolbarDropdownProps {
|
|
64
72
|
options: DropdownOption[];
|
|
@@ -78,10 +86,15 @@ export interface TypoFixResult {
|
|
|
78
86
|
html: string;
|
|
79
87
|
fixedCount: number;
|
|
80
88
|
}
|
|
89
|
+
export type SlashInsert = 'heading1' | 'heading2' | 'heading3' | 'paragraph' | 'bulletList' | 'orderedList' | 'checklist' | 'table' | 'ai' | 'image' | 'code' | 'callout' | 'quote' | 'titles' | 'excel' | 'graph';
|
|
81
90
|
export interface SlashCommandItem {
|
|
82
91
|
id: string;
|
|
83
92
|
label: string;
|
|
84
93
|
keywords: string[];
|
|
85
|
-
insert:
|
|
94
|
+
insert: SlashInsert;
|
|
95
|
+
description: string;
|
|
96
|
+
category: string;
|
|
97
|
+
shortcut: string;
|
|
98
|
+
mark: string;
|
|
86
99
|
}
|
|
87
100
|
//# sourceMappingURL=ink.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ink.types.d.ts","sourceRoot":"","sources":["../../src/types/ink.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,UAAU,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EA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ACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.types.d.ts","sourceRoot":"","sources":["../../src/types/plugin.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;AAE5E,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,eAAe,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { ToolbarOption } from './ink.types';
|
|
3
|
-
export type InkPremiumFeature = 'icons' | 'theme' | 'richPaste' | 'imageUpload' | 'wysiwyg';
|
|
3
|
+
export type InkPremiumFeature = 'icons' | 'theme' | 'richPaste' | 'imageUpload' | 'wysiwyg' | 'splitEditors';
|
|
4
4
|
export type InkPasteMode = 'plain' | 'rich';
|
|
5
|
-
export type InkIconKey = Extract<ToolbarOption, 'bold' | 'italic' | 'underline' | 'strikethrough' | 'bulletList' | 'orderedList' | 'link' | 'image' | 'table' | 'signature' | 'findReplace' | 'horizontalRule' | 'undo' | 'redo' | 'trackChanges' | 'comments' | 'ai' | 'clearFormat' | 'directionLtr' | 'directionRtl' | 'superscript' | 'subscript' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'indent' | 'outdent' | 'blockquote' | 'code'>;
|
|
5
|
+
export type InkIconKey = Extract<ToolbarOption, 'bold' | 'italic' | 'underline' | 'strikethrough' | 'bulletList' | 'orderedList' | 'checklist' | 'link' | 'image' | 'table' | 'signature' | 'findReplace' | 'horizontalRule' | 'undo' | 'redo' | 'trackChanges' | 'comments' | 'ai' | 'clearFormat' | 'directionLtr' | 'directionRtl' | 'superscript' | 'subscript' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'indent' | 'outdent' | 'blockquote' | 'code' | 'htmlSource' | 'titles' | 'excel' | 'graph' | 'outline' | 'fullscreen' | 'theme'>;
|
|
6
6
|
export type InkIconMap = Partial<Record<InkIconKey, ReactNode>>;
|
|
7
7
|
export interface InkThemeTokens {
|
|
8
8
|
border?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"premium.types.d.ts","sourceRoot":"","sources":["../../src/types/premium.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB,OAAO,GACP,OAAO,GACP,WAAW,GACX,aAAa,GACb,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"premium.types.d.ts","sourceRoot":"","sources":["../../src/types/premium.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GACzB,OAAO,GACP,OAAO,GACP,WAAW,GACX,aAAa,GACb,SAAS,GACT,cAAc,CAAC;AAEnB,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG,OAAO,CAC9B,aAAa,EACX,MAAM,GACN,QAAQ,GACR,WAAW,GACX,eAAe,GACf,YAAY,GACZ,aAAa,GACb,WAAW,GACX,MAAM,GACN,OAAO,GACP,OAAO,GACP,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,MAAM,GACN,MAAM,GACN,cAAc,GACd,UAAU,GACV,IAAI,GACJ,aAAa,GACb,cAAc,GACd,cAAc,GACd,aAAa,GACb,WAAW,GACX,WAAW,GACX,aAAa,GACb,YAAY,GACZ,cAAc,GACd,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,OAAO,GACP,SAAS,GACT,YAAY,GACZ,OAAO,CACV,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CAC9C;AAED,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAE7E,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
export { cn } from './cn.utils';
|
|
2
2
|
export { applyTypoAutoFix } from './typo.utils';
|
|
3
3
|
export { createInkId } from './id.utils';
|
|
4
|
-
export { buildTableHtml, getTableCellFromSelection, insertTableRow, insertTableColumn, deleteTableRow, deleteTableColumn, } from './table.utils';
|
|
4
|
+
export { buildTableHtml, getTableCellFromSelection, insertTableRow, insertTableColumn, deleteTableRow, deleteTableColumn, toggleTableHeaderRow, getColumnResizeIndex, setTableColumnWidth, ensureTableColgroup, } from './table.utils';
|
|
5
5
|
export { getBlockElement, moveBlock, reorderBlockBefore, reorderBlockAfter, resolveDropPosition, clearBlockDragClasses, markDraggingBlock, markDropTarget, markActiveBlock, } from './blocks.utils';
|
|
6
6
|
export type { BlockDropPosition } from './blocks.utils';
|
|
7
7
|
export { wrapInsertHtml, wrapDeleteHtml, createTrackChange, acceptTrackChangeInHtml, rejectTrackChangeInHtml, } from './trackChanges.utils';
|
|
8
8
|
export { createCommentThread, wrapSelectionAsComment, removeCommentMark, } from './comments.utils';
|
|
9
9
|
export { InkHistoryStack } from './history.utils';
|
|
10
|
-
export { filterSlashCommands, extractSlashQuery } from './slash.utils';
|
|
10
|
+
export { filterSlashCommands, extractSlashQuery, groupSlashCommands } from './slash.utils';
|
|
11
|
+
export type { SlashCommandGroup } from './slash.utils';
|
|
12
|
+
export { countWords } from './words.utils';
|
|
13
|
+
export { collectOutlineItems, getCaretLineCol, scrollOutlineHeading } from './outline.utils';
|
|
11
14
|
export { resolveInkPremium, hasInkPremiumFeature, isInkPremiumLicenseKey, themeTokensToStyle, } from './premium.utils';
|
|
12
15
|
export { mintInkPremiumLicenseKey } from './license.utils';
|
|
13
16
|
export { sanitizePastedHtml, extractClipboardHtml, extractClipboardText, } from './paste.utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EACL,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC3F,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7F,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../constants/numbers.cjs"),_=require("../constants/generals.const.cjs"),u=require("../constants/defaults.const.cjs");require("../constants/openai.const.cjs");require("react/jsx-runtime");require("./paste.utils.cjs");require("react");require("react-dom");const N=`${u.INK_OUTLINE_HEADING_SELECTOR}, [${u.INK_ATTR_TITLE}]`,O={H1:e.NUMBER_ONE,H2:e.NUMBER_TWO,H3:e.NUMBER_THREE},R=t=>t.hasAttribute(u.INK_ATTR_TITLE)?e.NUMBER_ONE:O[t.tagName]??null,f=t=>{if(!t)return[];const o=t.querySelectorAll(N),n=[];return o.forEach((r,l)=>{if(!(r instanceof HTMLElement))return;const i=R(r);if(!i)return;const s=(r.textContent??_.EMPTY_STRING).trim();s&&n.push({index:l,level:i,text:s})}),n},M=(t,o)=>{const r=t.querySelectorAll(N).item(o);r instanceof HTMLElement&&r.scrollIntoView({block:"center",behavior:"smooth"})},T=t=>{if(!t)return{line:e.NUMBER_ONE,col:e.NUMBER_ONE};const o=window.getSelection();if(!o||o.rangeCount===e.NUMBER_ZERO)return{line:e.NUMBER_ONE,col:e.NUMBER_ONE};const n=o.getRangeAt(e.NUMBER_ZERO);if(!t.contains(n.startContainer))return{line:e.NUMBER_ONE,col:e.NUMBER_ONE};const r=t.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre");let l=e.NUMBER_ONE,i=!1;r.forEach((E,a)=>{i||!(E instanceof HTMLElement)||(E.contains(n.startContainer)||E===n.startContainer)&&(l=a+e.NUMBER_ONE,i=!0)});const s=i?r.item(l-e.NUMBER_ONE):null;if(!(s instanceof HTMLElement))return{line:l,col:e.NUMBER_ONE};const c=n.cloneRange();return c.selectNodeContents(s),c.setEnd(n.startContainer,n.startOffset),{line:l,col:c.toString().length+e.NUMBER_ONE}};exports.collectOutlineItems=f;exports.getCaretLineCol=T;exports.scrollOutlineHeading=M;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OutlineItem } from '../types';
|
|
2
|
+
export declare const collectOutlineItems: (root: HTMLElement | null) => OutlineItem[];
|
|
3
|
+
export declare const scrollOutlineHeading: (root: HTMLElement, index: number) => void;
|
|
4
|
+
export declare const getCaretLineCol: (root: HTMLElement | null) => {
|
|
5
|
+
line: number;
|
|
6
|
+
col: number;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=outline.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outline.utils.d.ts","sourceRoot":"","sources":["../../src/utils/outline.utils.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAe5C,eAAO,MAAM,mBAAmB,GAAI,MAAM,WAAW,GAAG,IAAI,KAAG,WAAW,EAazE,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,WAAW,EAAE,OAAO,MAAM,KAAG,IAKvE,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,MAAM,WAAW,GAAG,IAAI,KACvB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CA8B7B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NUMBER_ONE as t, NUMBER_THREE as T, NUMBER_TWO as N, NUMBER_ZERO as u } from "../constants/numbers.js";
|
|
2
|
+
import { EMPTY_STRING as _ } from "../constants/generals.const.js";
|
|
3
|
+
import { INK_OUTLINE_HEADING_SELECTOR as h, INK_ATTR_TITLE as E } from "../constants/defaults.const.js";
|
|
4
|
+
import "../constants/openai.const.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "./paste.utils.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import "react-dom";
|
|
9
|
+
const f = `${h}, [${E}]`, g = {
|
|
10
|
+
H1: t,
|
|
11
|
+
H2: N,
|
|
12
|
+
H3: T
|
|
13
|
+
}, p = (e) => e.hasAttribute(E) ? t : g[e.tagName] ?? null, S = (e) => {
|
|
14
|
+
if (!e) return [];
|
|
15
|
+
const o = e.querySelectorAll(f), n = [];
|
|
16
|
+
return o.forEach((r, i) => {
|
|
17
|
+
if (!(r instanceof HTMLElement)) return;
|
|
18
|
+
const l = p(r);
|
|
19
|
+
if (!l) return;
|
|
20
|
+
const c = (r.textContent ?? _).trim();
|
|
21
|
+
c && n.push({ index: i, level: l, text: c });
|
|
22
|
+
}), n;
|
|
23
|
+
}, U = (e, o) => {
|
|
24
|
+
const r = e.querySelectorAll(f).item(o);
|
|
25
|
+
r instanceof HTMLElement && r.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
26
|
+
}, b = (e) => {
|
|
27
|
+
if (!e) return { line: t, col: t };
|
|
28
|
+
const o = window.getSelection();
|
|
29
|
+
if (!o || o.rangeCount === u)
|
|
30
|
+
return { line: t, col: t };
|
|
31
|
+
const n = o.getRangeAt(u);
|
|
32
|
+
if (!e.contains(n.startContainer))
|
|
33
|
+
return { line: t, col: t };
|
|
34
|
+
const r = e.querySelectorAll("p, h1, h2, h3, h4, h5, h6, li, blockquote, pre");
|
|
35
|
+
let i = t, l = !1;
|
|
36
|
+
r.forEach((a, m) => {
|
|
37
|
+
l || !(a instanceof HTMLElement) || (a.contains(n.startContainer) || a === n.startContainer) && (i = m + t, l = !0);
|
|
38
|
+
});
|
|
39
|
+
const c = l ? r.item(i - t) : null;
|
|
40
|
+
if (!(c instanceof HTMLElement))
|
|
41
|
+
return { line: i, col: t };
|
|
42
|
+
const s = n.cloneRange();
|
|
43
|
+
return s.selectNodeContents(c), s.setEnd(n.startContainer, n.startOffset), { line: i, col: s.toString().length + t };
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
S as collectOutlineItems,
|
|
47
|
+
b as getCaretLineCol,
|
|
48
|
+
U as scrollOutlineHeading
|
|
49
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../constants/numbers.cjs"),o=require("../constants/defaults.const.cjs");require("../constants/openai.const.cjs");require("react/jsx-runtime");require("./paste.utils.cjs");require("react");require("react-dom");const a=(r,e)=>r.label.toLowerCase().includes(e)||r.description.toLowerCase().includes(e)||r.category.toLowerCase().includes(e)||r.shortcut.toLowerCase().includes(e)?!0:r.keywords.some(t=>t.includes(e)),S=r=>{const e=r.trim().toLowerCase();return e?o.INK_SLASH_COMMANDS.filter(t=>a(t,e)).slice(0,c.INK_SLASH_MENU_MAX_ITEMS):o.INK_SLASH_COMMANDS.slice(0,c.INK_SLASH_MENU_MAX_ITEMS)},i=r=>{const e=[],t=new Map;return r.forEach(s=>{const u=s.category||o.SLASH_CATEGORY_BASIC,n=t.get(u);if(!n){e.push(u),t.set(u,[s]);return}n.push(s)}),e.map(s=>({category:s,items:t.get(s)??[]}))},l=r=>{const e=r.match(/(?:^|\s)\/([^\s]*)$/);return e?e[1]??"":null};exports.extractSlashQuery=l;exports.filterSlashCommands=S;exports.groupSlashCommands=i;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { SlashCommandItem } from '../types';
|
|
2
|
+
export type SlashCommandGroup = {
|
|
3
|
+
category: string;
|
|
4
|
+
items: SlashCommandItem[];
|
|
5
|
+
};
|
|
2
6
|
export declare const filterSlashCommands: (query: string) => SlashCommandItem[];
|
|
7
|
+
export declare const groupSlashCommands: (items: SlashCommandItem[]) => SlashCommandGroup[];
|
|
3
8
|
export declare const extractSlashQuery: (text: string) => string | null;
|
|
4
9
|
//# sourceMappingURL=slash.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash.utils.d.ts","sourceRoot":"","sources":["../../src/utils/slash.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slash.utils.d.ts","sourceRoot":"","sources":["../../src/utils/slash.utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,CAAC;AAUF,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,KAAG,gBAAgB,EAOnE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,gBAAgB,EAAE,KAAG,iBAAiB,EAiB/E,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,IAIzD,CAAC"}
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
import { INK_SLASH_MENU_MAX_ITEMS as
|
|
2
|
-
import { INK_SLASH_COMMANDS as
|
|
1
|
+
import { INK_SLASH_MENU_MAX_ITEMS as u } from "../constants/numbers.js";
|
|
2
|
+
import { INK_SLASH_COMMANDS as c, SLASH_CATEGORY_BASIC as a } from "../constants/defaults.const.js";
|
|
3
3
|
import "../constants/openai.const.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "./paste.utils.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
const
|
|
8
|
+
const i = (t, r) => t.label.toLowerCase().includes(r) || t.description.toLowerCase().includes(r) || t.category.toLowerCase().includes(r) || t.shortcut.toLowerCase().includes(r) ? !0 : t.keywords.some((e) => e.includes(r)), d = (t) => {
|
|
9
9
|
const r = t.trim().toLowerCase();
|
|
10
|
-
return r ?
|
|
11
|
-
|
|
10
|
+
return r ? c.filter((e) => i(e, r)).slice(
|
|
11
|
+
0,
|
|
12
|
+
u
|
|
13
|
+
) : c.slice(0, u);
|
|
14
|
+
}, L = (t) => {
|
|
15
|
+
const r = [], e = /* @__PURE__ */ new Map();
|
|
16
|
+
return t.forEach((o) => {
|
|
17
|
+
const s = o.category || a, n = e.get(s);
|
|
18
|
+
if (!n) {
|
|
19
|
+
r.push(s), e.set(s, [o]);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
n.push(o);
|
|
23
|
+
}), r.map((o) => ({
|
|
24
|
+
category: o,
|
|
25
|
+
items: e.get(o) ?? []
|
|
26
|
+
}));
|
|
27
|
+
}, _ = (t) => {
|
|
12
28
|
const r = t.match(/(?:^|\s)\/([^\s]*)$/);
|
|
13
29
|
return r ? r[1] ?? "" : null;
|
|
14
30
|
};
|
|
15
31
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
32
|
+
_ as extractSlashQuery,
|
|
33
|
+
d as filterSlashCommands,
|
|
34
|
+
L as groupSlashCommands
|
|
18
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../constants/numbers.cjs"),u=require("../constants/generals.const.cjs");require("../constants/openai.const.cjs");require("react/jsx-runtime");const r=require("../constants/table.const.cjs");require("./paste.utils.cjs");require("react");require("react-dom");const m=(t,e,n)=>Math.min(n,Math.max(e,t)),A=t=>{const e=document.createElement(t);return e.contentEditable="true",e.innerHTML="<br>",e},d=t=>{const e=t.parentElement;return e?Array.from(e.cells).indexOf(t):0},B=(t=a.INK_DEFAULT_TABLE_ROWS,e=a.INK_DEFAULT_TABLE_COLS)=>{const n=m(t,a.INK_TABLE_MIN_ROWS,a.INK_TABLE_MAX_ROWS),o=m(e,a.INK_TABLE_MIN_COLS,a.INK_TABLE_MAX_COLS),l=Array.from({length:o},(c,T)=>`<th contenteditable="true">${r.TABLE_HEADER_PREFIX}${T+1}</th>`).join(u.EMPTY_STRING),s=Array.from({length:Math.max(0,n-1)},()=>`<tr>${Array.from({length:o},()=>'<td contenteditable="true"><br></td>').join(u.EMPTY_STRING)}</tr>`).join(u.EMPTY_STRING),_=`<${r.TABLE_COLGROUP}>${Array.from({length:o},()=>`<${r.TABLE_COL}>`).join(u.EMPTY_STRING)}</${r.TABLE_COLGROUP}>`;return`<table class="${r.TABLE_CLASS_NAME}">${_}<thead><tr>${l}</tr></thead><tbody>${s}</tbody></table><p><br></p>`},C=()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return null;let e=t.anchorNode;return e&&e.nodeType===Node.TEXT_NODE&&(e=e.parentElement),e instanceof Element?e.closest(r.TABLE_CELL_SELECTOR):null},h=(t,e)=>{var T,i;const n=t.closest(r.TABLE_ROW_TAG),o=t.closest(r.TABLE_TAG);if(!n||!o)return!1;const l=n.cells.length;if(o.rows.length>=a.INK_TABLE_MAX_ROWS)return!1;const _=!!n.closest(r.TABLE_SECTION_THEAD)?r.TABLE_CELL_TAG_TH:r.TABLE_CELL_TAG_TD,c=document.createElement(r.TABLE_ROW_TAG);for(let E=0;E<l;E+=1)c.appendChild(A(_));return e==="before"?(T=n.parentElement)==null||T.insertBefore(c,n):(i=n.parentElement)==null||i.insertBefore(c,n.nextSibling),!0},b=(t,e)=>{const n=t.closest(r.TABLE_TAG);if(!n)return!1;const o=d(t);if(o<0)return!1;const l=n.rows[0];if(!l||l.cells.length>=a.INK_TABLE_MAX_COLS)return!1;const s=e==="before"?o:o+1;return Array.from(n.rows).forEach(_=>{const c=_.cells[s]??null,T=_.closest(r.TABLE_SECTION_THEAD)?r.TABLE_CELL_TAG_TH:r.TABLE_CELL_TAG_TD,i=A(T);c?_.insertBefore(i,c):_.appendChild(i)}),L(n),!0},R=t=>{const e=t.closest(r.TABLE_ROW_TAG),n=t.closest(r.TABLE_TAG);return!e||!n||n.rows.length<=a.INK_TABLE_MIN_ROWS?!1:(e.remove(),!0)},g=t=>{const e=t.closest(r.TABLE_TAG);if(!e)return!1;const n=d(t);if(n<0)return!1;const o=e.rows[0];return!o||o.cells.length<=a.INK_TABLE_MIN_COLS?!1:(Array.from(e.rows).forEach(l=>{const s=l.cells[n];s&&s.remove()}),L(e),!0)},O=t=>{const e=t.closest(r.TABLE_TAG);if(!e)return!1;const n=e.tHead,o=n==null?void 0:n.querySelector(r.TABLE_ROW_TAG);if(n&&o){const T=e.tBodies[0]??e.createTBody(),i=document.createElement(r.TABLE_ROW_TAG);return Array.from(o.cells).forEach(E=>{const f=A(r.TABLE_CELL_TAG_TD);f.innerHTML=E.innerHTML,i.appendChild(f)}),T.insertBefore(i,T.firstChild),n.remove(),!0}const l=e.tBodies[0]??e.querySelector(r.TABLE_SECTION_TBODY),s=l==null?void 0:l.querySelector(r.TABLE_ROW_TAG);if(!l||!s)return!1;const _=e.createTHead(),c=document.createElement(r.TABLE_ROW_TAG);return Array.from(s.cells).forEach((T,i)=>{const E=A(r.TABLE_CELL_TAG_TH);E.innerHTML=T.innerHTML||`${r.TABLE_HEADER_PREFIX}${i+1}`,c.appendChild(E)}),_.appendChild(c),s.remove(),!0},L=t=>{var o,l;let e=t.querySelector(r.TABLE_COLGROUP);const n=((o=t.rows[0])==null?void 0:o.cells.length)??0;for(e||(e=document.createElement(r.TABLE_COLGROUP),t.insertBefore(e,t.firstChild));e.children.length<n;)e.appendChild(document.createElement(r.TABLE_COL));for(;e.children.length>n;)(l=e.lastElementChild)==null||l.remove();return e.getElementsByTagName(r.TABLE_COL)},I=(t,e,n)=>{const o=e.getBoundingClientRect();return Math.abs(o.right-t)>n?null:d(e)},N=(t,e,n)=>{const l=L(t).item(e);if(!l)return;const s=Math.max(a.INK_TABLE_COL_MIN_WIDTH_PX,n);l.style.width=`${s}px`};exports.buildTableHtml=B;exports.deleteTableColumn=g;exports.deleteTableRow=R;exports.ensureTableColgroup=L;exports.getColumnResizeIndex=I;exports.getTableCellFromSelection=C;exports.insertTableColumn=b;exports.insertTableRow=h;exports.setTableColumnWidth=N;exports.toggleTableHeaderRow=O;
|
|
@@ -4,4 +4,8 @@ export declare const insertTableRow: (cell: HTMLTableCellElement, position: "bef
|
|
|
4
4
|
export declare const insertTableColumn: (cell: HTMLTableCellElement, position: "before" | "after") => boolean;
|
|
5
5
|
export declare const deleteTableRow: (cell: HTMLTableCellElement) => boolean;
|
|
6
6
|
export declare const deleteTableColumn: (cell: HTMLTableCellElement) => boolean;
|
|
7
|
+
export declare const toggleTableHeaderRow: (cell: HTMLTableCellElement) => boolean;
|
|
8
|
+
export declare const ensureTableColgroup: (table: HTMLTableElement) => HTMLCollectionOf<HTMLTableColElement>;
|
|
9
|
+
export declare const getColumnResizeIndex: (clientX: number, cell: HTMLTableCellElement, edgePx: number) => number | null;
|
|
10
|
+
export declare const setTableColumnWidth: (table: HTMLTableElement, columnIndex: number, widthPx: number) => void;
|
|
7
11
|
//# sourceMappingURL=table.utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.utils.d.ts","sourceRoot":"","sources":["../../src/utils/table.utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.utils.d.ts","sourceRoot":"","sources":["../../src/utils/table.utils.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,cAAc,GACzB,aAA6B,EAC7B,aAA6B,KAC5B,MAeF,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAO,oBAAoB,GAAG,IASnE,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,MAAM,oBAAoB,EAC1B,UAAU,QAAQ,GAAG,OAAO,KAC3B,OAkBF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,MAAM,oBAAoB,EAC1B,UAAU,QAAQ,GAAG,OAAO,KAC3B,OAuBF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,oBAAoB,KAAG,OAO3D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,oBAAoB,KAAG,OAa9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,oBAAoB,KAAG,OA8BjE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,gBAAgB,KAAG,gBAAgB,CAAC,mBAAmB,CAcjG,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,SAAS,MAAM,EACf,MAAM,oBAAoB,EAC1B,QAAQ,MAAM,KACb,MAAM,GAAG,IAIX,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,gBAAgB,EACvB,aAAa,MAAM,EACnB,SAAS,MAAM,KACd,IAMF,CAAC"}
|
|
@@ -1,72 +1,111 @@
|
|
|
1
|
-
import { INK_DEFAULT_TABLE_ROWS as
|
|
1
|
+
import { INK_DEFAULT_TABLE_ROWS as I, INK_DEFAULT_TABLE_COLS as S, INK_TABLE_MIN_COLS as B, INK_TABLE_MIN_ROWS as b, INK_TABLE_MAX_COLS as w, INK_TABLE_MAX_ROWS as y, INK_TABLE_COL_MIN_WIDTH_PX as M } from "../constants/numbers.js";
|
|
2
2
|
import { EMPTY_STRING as m } from "../constants/generals.const.js";
|
|
3
3
|
import "../constants/openai.const.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
|
-
import { TABLE_CLASS_NAME as
|
|
5
|
+
import { TABLE_HEADER_PREFIX as N, TABLE_COLGROUP as T, TABLE_COL as _, TABLE_CLASS_NAME as O, TABLE_TAG as d, TABLE_ROW_TAG as u, TABLE_CELL_SELECTOR as x, TABLE_SECTION_THEAD as R, TABLE_CELL_TAG_TH as h, TABLE_CELL_TAG_TD as A, TABLE_SECTION_TBODY as H } from "../constants/table.const.js";
|
|
6
6
|
import "./paste.utils.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "react-dom";
|
|
9
|
-
const
|
|
9
|
+
const g = (t, e, n) => Math.min(n, Math.max(e, t)), E = (t) => {
|
|
10
10
|
const e = document.createElement(t);
|
|
11
11
|
return e.contentEditable = "true", e.innerHTML = "<br>", e;
|
|
12
|
-
},
|
|
12
|
+
}, L = (t) => {
|
|
13
13
|
const e = t.parentElement;
|
|
14
14
|
return e ? Array.from(e.cells).indexOf(t) : 0;
|
|
15
|
-
},
|
|
16
|
-
const n =
|
|
15
|
+
}, q = (t = I, e = S) => {
|
|
16
|
+
const n = g(t, b, y), r = g(e, B, w), o = Array.from(
|
|
17
17
|
{ length: r },
|
|
18
|
-
(
|
|
19
|
-
).join(m),
|
|
18
|
+
(s, c) => `<th contenteditable="true">${N}${c + 1}</th>`
|
|
19
|
+
).join(m), l = Array.from({ length: Math.max(0, n - 1) }, () => `<tr>${Array.from(
|
|
20
20
|
{ length: r },
|
|
21
21
|
() => '<td contenteditable="true"><br></td>'
|
|
22
|
-
).join(m)}</tr>`).join(m)
|
|
23
|
-
return `<table class="${
|
|
24
|
-
},
|
|
22
|
+
).join(m)}</tr>`).join(m), a = `<${T}>${Array.from({ length: r }, () => `<${_}>`).join(m)}</${T}>`;
|
|
23
|
+
return `<table class="${O}">${a}<thead><tr>${o}</tr></thead><tbody>${l}</tbody></table><p><br></p>`;
|
|
24
|
+
}, F = () => {
|
|
25
25
|
const t = window.getSelection();
|
|
26
26
|
if (!t || t.rangeCount === 0) return null;
|
|
27
27
|
let e = t.anchorNode;
|
|
28
|
-
return e && e.nodeType === Node.TEXT_NODE && (e = e.parentElement), e instanceof Element ? e.closest(
|
|
29
|
-
},
|
|
30
|
-
var
|
|
31
|
-
const n = t.closest(u), r = t.closest(
|
|
28
|
+
return e && e.nodeType === Node.TEXT_NODE && (e = e.parentElement), e instanceof Element ? e.closest(x) : null;
|
|
29
|
+
}, P = (t, e) => {
|
|
30
|
+
var c, i;
|
|
31
|
+
const n = t.closest(u), r = t.closest(d);
|
|
32
32
|
if (!n || !r) return !1;
|
|
33
33
|
const o = n.cells.length;
|
|
34
|
-
if (r.rows.length >=
|
|
35
|
-
const
|
|
36
|
-
for (let
|
|
37
|
-
s.appendChild(
|
|
38
|
-
return e === "before" ? (
|
|
39
|
-
},
|
|
40
|
-
const n = t.closest(
|
|
34
|
+
if (r.rows.length >= y) return !1;
|
|
35
|
+
const a = !!n.closest(R) ? h : A, s = document.createElement(u);
|
|
36
|
+
for (let f = 0; f < o; f += 1)
|
|
37
|
+
s.appendChild(E(a));
|
|
38
|
+
return e === "before" ? (c = n.parentElement) == null || c.insertBefore(s, n) : (i = n.parentElement) == null || i.insertBefore(s, n.nextSibling), !0;
|
|
39
|
+
}, U = (t, e) => {
|
|
40
|
+
const n = t.closest(d);
|
|
41
41
|
if (!n) return !1;
|
|
42
|
-
const r =
|
|
42
|
+
const r = L(t);
|
|
43
43
|
if (r < 0) return !1;
|
|
44
44
|
const o = n.rows[0];
|
|
45
|
-
if (!o || o.cells.length >=
|
|
46
|
-
const
|
|
47
|
-
return Array.from(n.rows).forEach((
|
|
48
|
-
const s =
|
|
49
|
-
s ?
|
|
50
|
-
}), !0;
|
|
51
|
-
},
|
|
52
|
-
const e = t.closest(u), n = t.closest(
|
|
53
|
-
return !e || !n || n.rows.length <=
|
|
54
|
-
},
|
|
55
|
-
const e = t.closest(
|
|
45
|
+
if (!o || o.cells.length >= w) return !1;
|
|
46
|
+
const l = e === "before" ? r : r + 1;
|
|
47
|
+
return Array.from(n.rows).forEach((a) => {
|
|
48
|
+
const s = a.cells[l] ?? null, c = a.closest(R) ? h : A, i = E(c);
|
|
49
|
+
s ? a.insertBefore(i, s) : a.appendChild(i);
|
|
50
|
+
}), C(n), !0;
|
|
51
|
+
}, Y = (t) => {
|
|
52
|
+
const e = t.closest(u), n = t.closest(d);
|
|
53
|
+
return !e || !n || n.rows.length <= b ? !1 : (e.remove(), !0);
|
|
54
|
+
}, z = (t) => {
|
|
55
|
+
const e = t.closest(d);
|
|
56
56
|
if (!e) return !1;
|
|
57
|
-
const n =
|
|
57
|
+
const n = L(t);
|
|
58
58
|
if (n < 0) return !1;
|
|
59
59
|
const r = e.rows[0];
|
|
60
|
-
return !r || r.cells.length <=
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
}), !0);
|
|
60
|
+
return !r || r.cells.length <= B ? !1 : (Array.from(e.rows).forEach((o) => {
|
|
61
|
+
const l = o.cells[n];
|
|
62
|
+
l && l.remove();
|
|
63
|
+
}), C(e), !0);
|
|
64
|
+
}, k = (t) => {
|
|
65
|
+
const e = t.closest(d);
|
|
66
|
+
if (!e) return !1;
|
|
67
|
+
const n = e.tHead, r = n == null ? void 0 : n.querySelector(u);
|
|
68
|
+
if (n && r) {
|
|
69
|
+
const c = e.tBodies[0] ?? e.createTBody(), i = document.createElement(u);
|
|
70
|
+
return Array.from(r.cells).forEach((f) => {
|
|
71
|
+
const p = E(A);
|
|
72
|
+
p.innerHTML = f.innerHTML, i.appendChild(p);
|
|
73
|
+
}), c.insertBefore(i, c.firstChild), n.remove(), !0;
|
|
74
|
+
}
|
|
75
|
+
const o = e.tBodies[0] ?? e.querySelector(H), l = o == null ? void 0 : o.querySelector(u);
|
|
76
|
+
if (!o || !l) return !1;
|
|
77
|
+
const a = e.createTHead(), s = document.createElement(u);
|
|
78
|
+
return Array.from(l.cells).forEach((c, i) => {
|
|
79
|
+
const f = E(h);
|
|
80
|
+
f.innerHTML = c.innerHTML || `${N}${i + 1}`, s.appendChild(f);
|
|
81
|
+
}), a.appendChild(s), l.remove(), !0;
|
|
82
|
+
}, C = (t) => {
|
|
83
|
+
var r, o;
|
|
84
|
+
let e = t.querySelector(T);
|
|
85
|
+
const n = ((r = t.rows[0]) == null ? void 0 : r.cells.length) ?? 0;
|
|
86
|
+
for (e || (e = document.createElement(T), t.insertBefore(e, t.firstChild)); e.children.length < n; )
|
|
87
|
+
e.appendChild(document.createElement(_));
|
|
88
|
+
for (; e.children.length > n; )
|
|
89
|
+
(o = e.lastElementChild) == null || o.remove();
|
|
90
|
+
return e.getElementsByTagName(_);
|
|
91
|
+
}, J = (t, e, n) => {
|
|
92
|
+
const r = e.getBoundingClientRect();
|
|
93
|
+
return Math.abs(r.right - t) > n ? null : L(e);
|
|
94
|
+
}, Q = (t, e, n) => {
|
|
95
|
+
const o = C(t).item(e);
|
|
96
|
+
if (!o) return;
|
|
97
|
+
const l = Math.max(M, n);
|
|
98
|
+
o.style.width = `${l}px`;
|
|
64
99
|
};
|
|
65
100
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
101
|
+
q as buildTableHtml,
|
|
102
|
+
z as deleteTableColumn,
|
|
103
|
+
Y as deleteTableRow,
|
|
104
|
+
C as ensureTableColgroup,
|
|
105
|
+
J as getColumnResizeIndex,
|
|
106
|
+
F as getTableCellFromSelection,
|
|
107
|
+
U as insertTableColumn,
|
|
108
|
+
P as insertTableRow,
|
|
109
|
+
Q as setTableColumnWidth,
|
|
110
|
+
k as toggleTableHeaderRow
|
|
72
111
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../constants/numbers.cjs"),i=require("../constants/generals.const.cjs");require("../constants/openai.const.cjs");require("react/jsx-runtime");require("./paste.utils.cjs");require("react");require("react-dom");const n=r=>{const e=r.trim();return e?e.split(i.INK_WORD_SPLIT).filter(Boolean).length:t.NUMBER_ZERO};exports.countWords=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"words.utils.d.ts","sourceRoot":"","sources":["../../src/utils/words.utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,MAIzC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NUMBER_ZERO as o } from "../constants/numbers.js";
|
|
2
|
+
import { INK_WORD_SPLIT as i } from "../constants/generals.const.js";
|
|
3
|
+
import "../constants/openai.const.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "./paste.utils.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const c = (t) => {
|
|
9
|
+
const r = t.trim();
|
|
10
|
+
return r ? r.split(i).filter(Boolean).length : o;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
c as countWords
|
|
14
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgedevstack/ink",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "ForgeStack rich text editor for React — WYSIWYG with tables, track changes, comments, block handles, sign pad, and pluggable Ink AI (BYO LLM). The writing layer of ForgeStack.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,8 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"./styles.css": "./dist/styles.css"
|
|
29
29
|
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"ink": "./bin/ink.mjs"
|
|
32
|
+
},
|
|
30
33
|
"files": [
|
|
31
34
|
"dist",
|
|
35
|
+
"bin",
|
|
32
36
|
"README.md",
|
|
33
37
|
"CHANGELOG.md",
|
|
34
38
|
"LICENSE",
|
|
@@ -42,6 +46,7 @@
|
|
|
42
46
|
"prepublishOnly": "npm run build"
|
|
43
47
|
},
|
|
44
48
|
"peerDependencies": {
|
|
49
|
+
"@forgedevstack/bear": ">=1.3.2",
|
|
45
50
|
"react": ">=18.0.0",
|
|
46
51
|
"react-dom": ">=18.0.0"
|
|
47
52
|
},
|
|
@@ -54,6 +59,7 @@
|
|
|
54
59
|
}
|
|
55
60
|
},
|
|
56
61
|
"devDependencies": {
|
|
62
|
+
"@forgedevstack/bear": "^1.3.2",
|
|
57
63
|
"@types/react": "^18.3.18",
|
|
58
64
|
"@types/react-dom": "^18.3.5",
|
|
59
65
|
"@vitejs/plugin-react": "^4.3.4",
|