@forgedevstack/ink 1.1.3 → 1.1.5
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 +64 -1
- package/dist/common-components/Box/Box.cjs +1 -0
- package/dist/common-components/Box/Box.const.cjs +1 -0
- package/dist/common-components/Box/Box.const.d.ts +3 -0
- package/dist/common-components/Box/Box.const.d.ts.map +1 -0
- package/dist/common-components/Box/Box.const.js +5 -0
- package/dist/common-components/Box/Box.d.ts +4 -0
- package/dist/common-components/Box/Box.d.ts.map +1 -0
- package/dist/common-components/Box/Box.js +14 -0
- package/dist/common-components/Box/Box.types.d.ts +6 -0
- package/dist/common-components/Box/Box.types.d.ts.map +1 -0
- package/dist/common-components/Box/index.d.ts +3 -0
- package/dist/common-components/Box/index.d.ts.map +1 -0
- package/dist/common-components/Button/Button.cjs +1 -0
- package/dist/common-components/Button/Button.const.cjs +1 -0
- package/dist/common-components/Button/Button.const.d.ts +5 -0
- package/dist/common-components/Button/Button.const.d.ts.map +1 -0
- package/dist/common-components/Button/Button.const.js +7 -0
- package/dist/common-components/Button/Button.d.ts +4 -0
- package/dist/common-components/Button/Button.d.ts.map +1 -0
- package/dist/common-components/Button/Button.js +28 -0
- package/dist/common-components/Button/Button.types.d.ts +6 -0
- package/dist/common-components/Button/Button.types.d.ts.map +1 -0
- package/dist/common-components/Button/index.d.ts +3 -0
- package/dist/common-components/Button/index.d.ts.map +1 -0
- package/dist/common-components/Canvas/Canvas.cjs +1 -0
- package/dist/common-components/Canvas/Canvas.const.cjs +1 -0
- package/dist/common-components/Canvas/Canvas.const.d.ts +2 -0
- package/dist/common-components/Canvas/Canvas.const.d.ts.map +1 -0
- package/dist/common-components/Canvas/Canvas.const.js +4 -0
- package/dist/common-components/Canvas/Canvas.d.ts +4 -0
- package/dist/common-components/Canvas/Canvas.d.ts.map +1 -0
- package/dist/common-components/Canvas/Canvas.js +14 -0
- package/dist/common-components/Canvas/Canvas.types.d.ts +5 -0
- package/dist/common-components/Canvas/Canvas.types.d.ts.map +1 -0
- package/dist/common-components/Canvas/index.d.ts +3 -0
- package/dist/common-components/Canvas/index.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.cjs +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.const.cjs +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.const.d.ts +11 -0
- package/dist/common-components/ContextMenu/ContextMenu.const.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.const.js +14 -0
- package/dist/common-components/ContextMenu/ContextMenu.d.ts +4 -0
- package/dist/common-components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.js +69 -0
- package/dist/common-components/ContextMenu/ContextMenu.types.d.ts +33 -0
- package/dist/common-components/ContextMenu/ContextMenu.types.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.cjs +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.d.ts +3 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.js +11 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.test.d.ts +2 -0
- package/dist/common-components/ContextMenu/ContextMenu.utils.test.d.ts.map +1 -0
- package/dist/common-components/ContextMenu/index.d.ts +5 -0
- package/dist/common-components/ContextMenu/index.d.ts.map +1 -0
- package/dist/common-components/Field/Field.cjs +1 -0
- package/dist/common-components/Field/Field.const.cjs +1 -0
- package/dist/common-components/Field/Field.const.d.ts +3 -0
- package/dist/common-components/Field/Field.const.d.ts.map +1 -0
- package/dist/common-components/Field/Field.const.js +5 -0
- package/dist/common-components/Field/Field.d.ts +4 -0
- package/dist/common-components/Field/Field.d.ts.map +1 -0
- package/dist/common-components/Field/Field.js +26 -0
- package/dist/common-components/Field/Field.types.d.ts +10 -0
- package/dist/common-components/Field/Field.types.d.ts.map +1 -0
- package/dist/common-components/Field/index.d.ts +3 -0
- package/dist/common-components/Field/index.d.ts.map +1 -0
- package/dist/common-components/icons/GripIcon.cjs +1 -0
- package/dist/common-components/icons/GripIcon.d.ts +3 -0
- package/dist/common-components/icons/GripIcon.d.ts.map +1 -0
- package/dist/common-components/icons/GripIcon.js +13 -0
- package/dist/common-components/icons/Icon.const.cjs +1 -0
- package/dist/common-components/icons/Icon.const.d.ts +7 -0
- package/dist/common-components/icons/Icon.const.d.ts.map +1 -0
- package/dist/common-components/icons/Icon.const.js +10 -0
- package/dist/common-components/icons/RedoIcon.cjs +1 -0
- package/dist/common-components/icons/RedoIcon.d.ts +3 -0
- package/dist/common-components/icons/RedoIcon.d.ts.map +1 -0
- package/dist/common-components/icons/RedoIcon.js +9 -0
- package/dist/common-components/icons/UndoIcon.cjs +1 -0
- package/dist/common-components/icons/UndoIcon.d.ts +3 -0
- package/dist/common-components/icons/UndoIcon.d.ts.map +1 -0
- package/dist/common-components/icons/UndoIcon.js +9 -0
- package/dist/common-components/icons/index.d.ts +4 -0
- package/dist/common-components/icons/index.d.ts.map +1 -0
- package/dist/common-components/index.d.ts +12 -0
- package/dist/common-components/index.d.ts.map +1 -0
- package/dist/components/InkEditor/InkEditor.cjs +1 -1
- package/dist/components/InkEditor/InkEditor.d.ts.map +1 -1
- package/dist/components/InkEditor/InkEditor.js +917 -432
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.cjs +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.cjs +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.d.ts +7 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.js +10 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.d.ts +4 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.js +17 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.d.ts +12 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.cjs +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.d.ts +4 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.js +25 -0
- package/dist/components/InkEditor/components/AiAutocomplete/index.d.ts +5 -0
- package/dist/components/InkEditor/components/AiAutocomplete/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/AiPanel/AiPanel.cjs +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts +1 -0
- package/dist/components/InkEditor/components/AiPanel/AiPanel.d.ts.map +1 -1
- package/dist/components/InkEditor/components/AiPanel/AiPanel.js +53 -49
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.cjs +1 -1
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.cjs +1 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.d.ts +15 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.const.js +18 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts +1 -6
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.d.ts.map +1 -1
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.js +53 -8
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.types.d.ts +9 -0
- package/dist/components/InkEditor/components/BlockHandles/BlockHandles.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/BlockHandles/index.d.ts +2 -1
- package/dist/components/InkEditor/components/BlockHandles/index.d.ts.map +1 -1
- package/dist/components/InkEditor/components/FindReplace/FindReplace.cjs +1 -1
- package/dist/components/InkEditor/components/FindReplace/FindReplace.d.ts.map +1 -1
- package/dist/components/InkEditor/components/FindReplace/FindReplace.js +63 -44
- package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts +2 -0
- package/dist/components/InkEditor/components/FindReplace/FindReplace.types.d.ts.map +1 -1
- package/dist/components/InkEditor/components/FindReplace/index.d.ts +1 -1
- package/dist/components/InkEditor/components/FindReplace/index.d.ts.map +1 -1
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.cjs +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.cjs +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.d.ts +25 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.const.js +28 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.d.ts +4 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.js +140 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.types.d.ts +32 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.cjs +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.d.ts +4 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.js +16 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.test.d.ts +2 -0
- package/dist/components/InkEditor/components/InlineToolbar/InlineToolbar.utils.test.d.ts.map +1 -0
- package/dist/components/InkEditor/components/InlineToolbar/index.d.ts +5 -0
- package/dist/components/InkEditor/components/InlineToolbar/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/InkEditor/components/SignPad/SignPad.d.ts.map +1 -1
- package/dist/components/InkEditor/components/SignPad/SignPad.js +47 -51
- 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 +20 -16
- package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/InkEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +16 -12
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.cjs +1 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.cjs +1 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.d.ts +10 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.const.js +18 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.d.ts +4 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.js +43 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.types.d.ts +12 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/ToolbarCustomize.types.d.ts.map +1 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/index.d.ts +4 -0
- package/dist/components/InkEditor/components/ToolbarCustomize/index.d.ts.map +1 -0
- package/dist/components/InkEditor/components/index.d.ts +7 -1
- package/dist/components/InkEditor/components/index.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.cjs +2 -1
- package/dist/components/InkEditor/helpers/format.utils.d.ts +9 -0
- package/dist/components/InkEditor/helpers/format.utils.d.ts.map +1 -1
- package/dist/components/InkEditor/helpers/format.utils.js +113 -20
- package/dist/components/InkEditor/helpers/index.d.ts +1 -1
- package/dist/components/InkEditor/helpers/index.d.ts.map +1 -1
- package/dist/constants/blocks.const.cjs +1 -0
- package/dist/constants/blocks.const.d.ts +11 -0
- package/dist/constants/blocks.const.d.ts.map +1 -0
- package/dist/constants/blocks.const.js +14 -0
- package/dist/constants/colorMode.const.cjs +1 -0
- package/dist/constants/colorMode.const.d.ts +6 -0
- package/dist/constants/colorMode.const.d.ts.map +1 -0
- package/dist/constants/colorMode.const.js +7 -0
- package/dist/constants/contextMenu.const.cjs +1 -0
- package/dist/constants/contextMenu.const.d.ts +37 -0
- package/dist/constants/contextMenu.const.d.ts.map +1 -0
- package/dist/constants/contextMenu.const.js +39 -0
- package/dist/constants/defaultIcons.cjs +1 -0
- package/dist/constants/defaultIcons.d.ts +4 -0
- package/dist/constants/defaultIcons.d.ts.map +1 -0
- package/dist/constants/defaultIcons.js +42 -0
- package/dist/constants/defaults.const.cjs +1 -1
- package/dist/constants/defaults.const.d.ts +4 -0
- package/dist/constants/defaults.const.d.ts.map +1 -1
- package/dist/constants/defaults.const.js +56 -48
- package/dist/constants/findReplaceMenu.const.cjs +1 -0
- package/dist/constants/findReplaceMenu.const.d.ts +10 -0
- package/dist/constants/findReplaceMenu.const.d.ts.map +1 -0
- package/dist/constants/findReplaceMenu.const.js +14 -0
- package/dist/constants/fonts.const.cjs +1 -0
- package/dist/constants/fonts.const.d.ts +25 -0
- package/dist/constants/fonts.const.d.ts.map +1 -0
- package/dist/constants/fonts.const.js +40 -0
- package/dist/constants/index.d.ts +11 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/keyboard.const.cjs +1 -0
- package/dist/constants/keyboard.const.d.ts +5 -0
- package/dist/constants/keyboard.const.d.ts.map +1 -0
- package/dist/constants/keyboard.const.js +7 -0
- package/dist/constants/lists.const.cjs +1 -0
- package/dist/constants/lists.const.d.ts +24 -0
- package/dist/constants/lists.const.d.ts.map +1 -0
- package/dist/constants/lists.const.js +28 -0
- package/dist/constants/numbers.cjs +1 -1
- package/dist/constants/numbers.js +30 -15
- package/dist/constants/openai.const.cjs +1 -0
- package/dist/constants/openai.const.d.ts +42 -0
- package/dist/constants/openai.const.d.ts.map +1 -0
- package/dist/constants/openai.const.js +58 -0
- package/dist/constants/premium.const.cjs +1 -1
- package/dist/constants/premium.const.d.ts +1 -2
- package/dist/constants/premium.const.d.ts.map +1 -1
- package/dist/constants/premium.const.js +6 -34
- package/dist/constants/table.const.cjs +1 -0
- package/dist/constants/table.const.d.ts +8 -0
- package/dist/constants/table.const.d.ts.map +1 -0
- package/dist/constants/table.const.js +10 -0
- package/dist/constants/toolbar.const.cjs +1 -1
- package/dist/constants/toolbar.const.d.ts +7 -0
- package/dist/constants/toolbar.const.d.ts.map +1 -1
- package/dist/constants/toolbar.const.js +11 -4
- package/dist/constants/toolbarMenu.const.cjs +1 -0
- package/dist/constants/toolbarMenu.const.d.ts +20 -0
- package/dist/constants/toolbarMenu.const.d.ts.map +1 -0
- package/dist/constants/toolbarMenu.const.js +66 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -47
- package/dist/plugins/ai/demoProvider.cjs +1 -1
- package/dist/plugins/ai/demoProvider.d.ts.map +1 -1
- package/dist/plugins/ai/demoProvider.js +65 -40
- package/dist/plugins/ai/index.cjs +1 -1
- package/dist/plugins/ai/index.d.ts +3 -1
- package/dist/plugins/ai/index.d.ts.map +1 -1
- package/dist/plugins/ai/index.js +28 -14
- package/dist/plugins/ai/inkServerProvider.cjs +1 -0
- package/dist/plugins/ai/inkServerProvider.d.ts +4 -0
- package/dist/plugins/ai/inkServerProvider.d.ts.map +1 -0
- package/dist/plugins/ai/inkServerProvider.js +52 -0
- package/dist/plugins/ai/inkServerProvider.types.d.ts +15 -0
- package/dist/plugins/ai/inkServerProvider.types.d.ts.map +1 -0
- package/dist/plugins/ai/openaiProvider.cjs +1 -0
- package/dist/plugins/ai/openaiProvider.d.ts +4 -0
- package/dist/plugins/ai/openaiProvider.d.ts.map +1 -0
- package/dist/plugins/ai/openaiProvider.js +128 -0
- package/dist/plugins/ai/openaiProvider.types.d.ts +32 -0
- package/dist/plugins/ai/openaiProvider.types.d.ts.map +1 -0
- package/dist/plugins/ai/openaiProvider.utils.cjs +5 -0
- package/dist/plugins/ai/openaiProvider.utils.d.ts +14 -0
- package/dist/plugins/ai/openaiProvider.utils.d.ts.map +1 -0
- package/dist/plugins/ai/openaiProvider.utils.js +57 -0
- package/dist/styles.css +1 -721
- package/dist/types/ai.types.d.ts +2 -1
- package/dist/types/ai.types.d.ts.map +1 -1
- package/dist/types/features.types.d.ts +3 -1
- package/dist/types/features.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/ink.types.d.ts +7 -2
- package/dist/types/ink.types.d.ts.map +1 -1
- package/dist/types/premium.types.d.ts +1 -1
- package/dist/types/premium.types.d.ts.map +1 -1
- package/dist/utils/blocks.utils.cjs +1 -1
- package/dist/utils/blocks.utils.d.ts +8 -0
- package/dist/utils/blocks.utils.d.ts.map +1 -1
- package/dist/utils/blocks.utils.js +61 -19
- package/dist/utils/blocks.utils.test.d.ts +2 -0
- package/dist/utils/blocks.utils.test.d.ts.map +1 -0
- package/dist/utils/comments.utils.cjs +1 -1
- package/dist/utils/comments.utils.js +23 -18
- package/dist/utils/history.utils.cjs +1 -1
- package/dist/utils/history.utils.js +7 -2
- package/dist/utils/index.d.ts +6 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/license.utils.cjs +1 -1
- package/dist/utils/license.utils.js +15 -10
- package/dist/utils/paste.utils.cjs +1 -1
- package/dist/utils/paste.utils.js +27 -23
- package/dist/utils/premium.utils.cjs +1 -1
- package/dist/utils/premium.utils.js +23 -18
- package/dist/utils/selection.utils.cjs +1 -0
- package/dist/utils/selection.utils.d.ts +10 -0
- package/dist/utils/selection.utils.d.ts.map +1 -0
- package/dist/utils/selection.utils.js +58 -0
- package/dist/utils/selection.utils.test.d.ts +2 -0
- package/dist/utils/selection.utils.test.d.ts.map +1 -0
- package/dist/utils/slash.utils.cjs +1 -1
- package/dist/utils/slash.utils.js +13 -8
- package/dist/utils/table.utils.cjs +1 -1
- package/dist/utils/table.utils.d.ts +5 -0
- package/dist/utils/table.utils.d.ts.map +1 -1
- package/dist/utils/table.utils.js +69 -10
- package/dist/utils/table.utils.test.d.ts +2 -0
- package/dist/utils/table.utils.test.d.ts.map +1 -0
- package/dist/utils/toolbarStorage.utils.cjs +1 -0
- package/dist/utils/toolbarStorage.utils.d.ts +12 -0
- package/dist/utils/toolbarStorage.utils.d.ts.map +1 -0
- package/dist/utils/toolbarStorage.utils.js +92 -0
- package/dist/utils/toolbarStorage.utils.test.d.ts +2 -0
- package/dist/utils/toolbarStorage.utils.test.d.ts.map +1 -0
- package/dist/utils/trackChanges.utils.cjs +1 -1
- package/dist/utils/trackChanges.utils.js +14 -9
- package/dist/utils/typo.utils.cjs +1 -1
- package/dist/utils/typo.utils.js +15 -10
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./AiAutocomplete.const.cjs"),l=i=>{const{suggestion:e,position:t,visible:s}=i;return!s||!e?null:n.jsx("span",{className:o.AI_AUTOCOMPLETE_CLASS,style:{top:t.top,left:t.left},"aria-hidden":o.AI_AUTOCOMPLETE_ARIA_HIDDEN,children:e})};exports.AiAutocomplete=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../../../../constants/numbers.cjs"),_="Ink-AiAutocomplete",A=!0,T=E.NUMBER_SIX*E.NUMBER_ONE_HUNDRED,O=E.NUMBER_FOUR*E.NUMBER_ONE_HUNDRED,M=E.NUMBER_FOUR,U="insertText";exports.AI_AUTOCOMPLETE_ARIA_HIDDEN=A;exports.AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX=M;exports.AI_AUTOCOMPLETE_CLASS=_;exports.AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT=U;exports.AI_AUTOCOMPLETE_DEBOUNCE_MS=T;exports.AI_AUTOCOMPLETE_MAX_PREFIX_CHARS=O;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const AI_AUTOCOMPLETE_CLASS = "Ink-AiAutocomplete";
|
|
2
|
+
export declare const AI_AUTOCOMPLETE_ARIA_HIDDEN = true;
|
|
3
|
+
export declare const AI_AUTOCOMPLETE_DEBOUNCE_MS: number;
|
|
4
|
+
export declare const AI_AUTOCOMPLETE_MAX_PREFIX_CHARS: number;
|
|
5
|
+
export declare const AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX = 4;
|
|
6
|
+
export declare const AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT = "insertText";
|
|
7
|
+
//# sourceMappingURL=AiAutocomplete.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAutocomplete.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.const.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,uBAAuB,CAAC;AAC1D,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,2BAA2B,QAAkC,CAAC;AAC3E,eAAO,MAAM,gCAAgC,QAAmC,CAAC;AACjF,eAAO,MAAM,iCAAiC,IAAc,CAAC;AAC7D,eAAO,MAAM,mCAAmC,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NUMBER_SIX as A, NUMBER_ONE_HUNDRED as E, NUMBER_FOUR as _ } from "../../../../constants/numbers.js";
|
|
2
|
+
const O = "Ink-AiAutocomplete", t = !0, M = A * E, I = _ * E, U = _, o = "insertText";
|
|
3
|
+
export {
|
|
4
|
+
t as AI_AUTOCOMPLETE_ARIA_HIDDEN,
|
|
5
|
+
U as AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX,
|
|
6
|
+
O as AI_AUTOCOMPLETE_CLASS,
|
|
7
|
+
o as AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT,
|
|
8
|
+
M as AI_AUTOCOMPLETE_DEBOUNCE_MS,
|
|
9
|
+
I as AI_AUTOCOMPLETE_MAX_PREFIX_CHARS
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAutocomplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAalD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { AI_AUTOCOMPLETE_ARIA_HIDDEN as s, AI_AUTOCOMPLETE_CLASS as n } from "./AiAutocomplete.const.js";
|
|
3
|
+
const p = (e) => {
|
|
4
|
+
const { suggestion: t, position: o, visible: i } = e;
|
|
5
|
+
return !i || !t ? null : /* @__PURE__ */ r(
|
|
6
|
+
"span",
|
|
7
|
+
{
|
|
8
|
+
className: n,
|
|
9
|
+
style: { top: o.top, left: o.left },
|
|
10
|
+
"aria-hidden": s,
|
|
11
|
+
children: t
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
p as AiAutocomplete
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AiAutocompletePosition {
|
|
2
|
+
top: number;
|
|
3
|
+
left: number;
|
|
4
|
+
}
|
|
5
|
+
export interface AiAutocompleteProps {
|
|
6
|
+
suggestion: string;
|
|
7
|
+
position: AiAutocompletePosition;
|
|
8
|
+
visible: boolean;
|
|
9
|
+
onAccept: () => void;
|
|
10
|
+
onDismiss: () => void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AiAutocomplete.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAutocomplete.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../constants/generals.const.cjs"),s=require("../../../../constants/numbers.cjs"),i=require("./AiAutocomplete.const.cjs"),l=(e,t=i.AI_AUTOCOMPLETE_MAX_PREFIX_CHARS)=>{const n=window.getSelection();if(!n||n.rangeCount===s.NUMBER_ZERO||!n.isCollapsed||!e.contains(n.anchorNode))return c.EMPTY_STRING;const r=n.getRangeAt(s.NUMBER_ZERO),o=document.createRange();return o.selectNodeContents(e),o.setEnd(r.startContainer,r.startOffset),o.toString().slice(-t)},a=e=>{const t=window.getSelection();if(!t||t.rangeCount===s.NUMBER_ZERO||!t.isCollapsed||!e.contains(t.anchorNode))return null;const r=t.getRangeAt(s.NUMBER_ZERO).getBoundingClientRect(),o=e.getBoundingClientRect();return{top:r.top-o.top+e.scrollTop+i.AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX,left:r.left-o.left+e.scrollLeft}};exports.getCaretPositionInRoot=a;exports.getTextBeforeCaret=l;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AiAutocompletePosition } from './AiAutocomplete.types';
|
|
2
|
+
export declare const getTextBeforeCaret: (root: HTMLElement, maxChars?: number) => string;
|
|
3
|
+
export declare const getCaretPositionInRoot: (root: HTMLElement) => AiAutocompletePosition | null;
|
|
4
|
+
//# sourceMappingURL=AiAutocomplete.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AiAutocomplete.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/AiAutocomplete.utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE,eAAO,MAAM,kBAAkB,GAC7B,MAAM,WAAW,EACjB,iBAA2C,KAC1C,MAcF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,MAAM,WAAW,KAAG,sBAAsB,GAAG,IAenF,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EMPTY_STRING as s } from "../../../../constants/generals.const.js";
|
|
2
|
+
import { NUMBER_ZERO as c } from "../../../../constants/numbers.js";
|
|
3
|
+
import { AI_AUTOCOMPLETE_MAX_PREFIX_CHARS as i, AI_AUTOCOMPLETE_CARET_OFFSET_Y_PX as l } from "./AiAutocomplete.const.js";
|
|
4
|
+
const R = (t, e = i) => {
|
|
5
|
+
const n = window.getSelection();
|
|
6
|
+
if (!n || n.rangeCount === c || !n.isCollapsed)
|
|
7
|
+
return s;
|
|
8
|
+
if (!t.contains(n.anchorNode))
|
|
9
|
+
return s;
|
|
10
|
+
const r = n.getRangeAt(c), o = document.createRange();
|
|
11
|
+
return o.selectNodeContents(t), o.setEnd(r.startContainer, r.startOffset), o.toString().slice(-e);
|
|
12
|
+
}, u = (t) => {
|
|
13
|
+
const e = window.getSelection();
|
|
14
|
+
if (!e || e.rangeCount === c || !e.isCollapsed || !t.contains(e.anchorNode))
|
|
15
|
+
return null;
|
|
16
|
+
const r = e.getRangeAt(c).getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
17
|
+
return {
|
|
18
|
+
top: r.top - o.top + t.scrollTop + l,
|
|
19
|
+
left: r.left - o.left + t.scrollLeft
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
u as getCaretPositionInRoot,
|
|
24
|
+
R as getTextBeforeCaret
|
|
25
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AiAutocomplete } from './AiAutocomplete';
|
|
2
|
+
export type { AiAutocompleteProps, AiAutocompletePosition } from './AiAutocomplete.types';
|
|
3
|
+
export { AI_AUTOCOMPLETE_DEBOUNCE_MS, AI_AUTOCOMPLETE_MAX_PREFIX_CHARS, AI_AUTOCOMPLETE_COMMAND_INSERT_TEXT, } from './AiAutocomplete.const';
|
|
4
|
+
export { getTextBeforeCaret, getCaretPositionInRoot } from './AiAutocomplete.utils';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiAutocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EACL,2BAA2B,EAC3B,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),k=require("../../../../constants/defaults.const.cjs"),G=require("../../../../constants/aiModels.const.cjs");require("../../../../constants/openai.const.cjs");const C=require("../../../../utils/id.utils.cjs");require("../../../../utils/paste.utils.cjs");require("react-dom");const $=require("../../../../plugins/ai/aiPlugin.cjs"),B=T=>{var N,f,y,S;const{config:s,documentHtml:v,selectionHtml:b,onApplyHtml:L,onClose:x,onBusyChange:_}=T,[a,H]=i.useState("chat"),[g,j]=i.useState(""),[r,h]=i.useState([]),[l,q]=i.useState(!1),[o,m]=i.useState(null),[D,M]=i.useState([]),[A,R]=i.useState(k.INK_TRANSLATE_LANGUAGES[1]),K=s.providerId||G.INK_AI_DEMO_PROVIDER_ID,O=((N=s.uiTheme)==null?void 0:N.className)||s.className||"",p=e=>{q(e),_==null||_(e)},c=async(e,d,u)=>{var E;p(!0);try{const w=e==="chat"&&u?[...r,{id:C.createInkId("turn"),role:"user",content:u,timestamp:Date.now(),capability:e}]:r;e==="chat"&&u&&h(w);const n=await $.inkAi.runProvider(K,{capability:e,html:v,selectionHtml:b||void 0,prompt:u,history:w,options:d,modelId:s.modelId,documentSnapshot:{html:v,selectionHtml:b||void 0}});(E=n.turns)!=null&&E.length?h(I=>[...I,...n.turns]):n.text&&e!=="chat"&&h(I=>[...I,{id:C.createInkId("turn"),role:"assistant",content:n.text||"",timestamp:Date.now(),capability:e}]),n.diff&&m(n.diff),n.reviewSuggestions&&M(n.reviewSuggestions)}finally{p(!1)}},P=e=>{e.preventDefault();const d=g.trim();!d||l||(j(""),c("chat",void 0,d))};return t.jsxs("aside",{className:`Ink-Ai ${O}`.trim(),"data-placement":s.placement||"sidebar",style:{"--ink-ai-accent":(f=s.uiTheme)==null?void 0:f.accent,"--ink-ai-surface":(y=s.uiTheme)==null?void 0:y.surface,"--ink-ai-border":(S=s.uiTheme)==null?void 0:S.border},"aria-label":"Ink AI",children:[t.jsxs("div",{className:"Ink-Ai__header",children:[t.jsx("strong",{children:"Ink AI"}),x?t.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:x,title:"Close AI",children:"×"}):null]}),t.jsx("div",{className:"Ink-Ai__tabs",role:"tablist",children:["chat","actions","review","translate"].map(e=>t.jsx("button",{type:"button",role:"tab",className:`Ink-Editor__button${a===e?" Ink-Editor__button--active":""}`,"aria-selected":a===e,onClick:()=>H(e),children:e},e))}),t.jsxs("div",{className:"Ink-Ai__body",children:[a==="chat"?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"Ink-Ai__history",children:r.length===0?t.jsxs("p",{className:"Ink-Ai__empty",children:["Multi-turn chat with local demo provider. Bring your own LLM via"," ",t.jsx("code",{children:"inkAi.registerProvider"}),"."]}):r.map(e=>t.jsxs("div",{className:`Ink-Ai__turn Ink-Ai__turn--${e.role}`,children:[t.jsx("span",{children:e.role}),t.jsx("p",{children:e.content})]},e.id))}),t.jsxs("form",{className:"Ink-Ai__form",onSubmit:P,children:[t.jsx("input",{value:g,onChange:e=>j(e.target.value),placeholder:"Ask Ink AI…",disabled:l}),t.jsx("button",{type:"submit",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,children:"Send"})]})]}):null,a==="actions"?t.jsxs("div",{className:"Ink-Ai__actions",children:[t.jsx("p",{className:"Ink-Ai__hint",children:"Quick actions use the current selection (or full document)."}),k.INK_QUICK_ACTIONS.map(e=>t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Ai__action",disabled:l,onClick:()=>void c(e.capability),children:e.label},e.id))]}):null,a==="review"?t.jsxs("div",{className:"Ink-Ai__review",children:[t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void c("review"),children:"Run grammar & style review"}),D.map(e=>t.jsxs("article",{className:`Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`,children:[t.jsx("strong",{children:e.severity}),t.jsx("p",{children:e.message}),t.jsx("code",{children:e.suggestedText})]},e.id))]}):null,a==="translate"?t.jsxs("div",{className:"Ink-Ai__translate",children:[t.jsxs("label",{children:["Language",t.jsx("select",{value:A,onChange:e=>R(e.target.value),children:k.INK_TRANSLATE_LANGUAGES.map(e=>t.jsx("option",{value:e,children:e},e))})]}),t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",disabled:l,onClick:()=>void c("translate",{language:A}),children:"Translate"})]}):null,o?t.jsxs("div",{className:"Ink-Ai__diff",children:[t.jsx("strong",{children:"Suggested change"}),t.jsx("p",{children:o.summary}),t.jsx("div",{className:"Ink-Ai__diff-preview",dangerouslySetInnerHTML:{__html:o.suggestedHtml}}),t.jsxs("div",{className:"Ink-Ai__diff-actions",children:[t.jsx("button",{type:"button",className:"Ink-Editor__button Ink-Editor__button--active",onClick:()=>{L(o.suggestedHtml),m(null)},children:"Apply"}),t.jsx("button",{type:"button",className:"Ink-Editor__button",onClick:()=>m(null),children:"Dismiss"})]})]}):null]}),t.jsx("footer",{className:"Ink-Ai__footer",children:"Demo provider · BYO LLM"})]})};exports.AiPanel=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AiPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiPanel/AiPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAM1D,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"AiPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/AiPanel/AiPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAM1D,OAAO,KAAK,EAEV,WAAW,EAGZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAkOpC,CAAC"}
|
|
@@ -1,85 +1,89 @@
|
|
|
1
|
-
import { jsxs as n, jsx as t, Fragment as
|
|
1
|
+
import { jsxs as n, jsx as t, Fragment as P } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l } from "react";
|
|
3
|
-
import { INK_TRANSLATE_LANGUAGES as
|
|
4
|
-
import { INK_AI_DEMO_PROVIDER_ID as
|
|
5
|
-
import
|
|
6
|
-
import { createInkId as
|
|
3
|
+
import { INK_TRANSLATE_LANGUAGES as H, INK_QUICK_ACTIONS as Q } from "../../../../constants/defaults.const.js";
|
|
4
|
+
import { INK_AI_DEMO_PROVIDER_ID as U } from "../../../../constants/aiModels.const.js";
|
|
5
|
+
import "../../../../constants/openai.const.js";
|
|
6
|
+
import { createInkId as D } from "../../../../utils/id.utils.js";
|
|
7
7
|
import "../../../../utils/paste.utils.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import "react-dom";
|
|
9
|
+
import { inkAi as F } from "../../../../plugins/ai/aiPlugin.js";
|
|
10
|
+
const te = (L) => {
|
|
11
|
+
var y, E, w, C;
|
|
12
|
+
const { config: i, documentHtml: p, selectionHtml: v, onApplyHtml: x, onClose: b, onBusyChange: _ } = L, [o, M] = l("chat"), [f, g] = l(""), [r, h] = l([]), [a, R] = l(!1), [c, I] = l(null), [K, O] = l([]), [A, $] = l(H[1]), B = i.providerId || U, j = ((y = i.uiTheme) == null ? void 0 : y.className) || i.className || "", N = (e) => {
|
|
13
|
+
R(e), _ == null || _(e);
|
|
14
|
+
}, d = async (e, u, m) => {
|
|
15
|
+
var S;
|
|
16
|
+
N(!0);
|
|
13
17
|
try {
|
|
14
|
-
const
|
|
18
|
+
const T = e === "chat" && m ? [
|
|
15
19
|
...r,
|
|
16
20
|
{
|
|
17
|
-
id:
|
|
21
|
+
id: D("turn"),
|
|
18
22
|
role: "user",
|
|
19
23
|
content: m,
|
|
20
24
|
timestamp: Date.now(),
|
|
21
25
|
capability: e
|
|
22
26
|
}
|
|
23
27
|
] : r;
|
|
24
|
-
e === "chat" && m &&
|
|
25
|
-
const s = await
|
|
28
|
+
e === "chat" && m && h(T);
|
|
29
|
+
const s = await F.runProvider(B, {
|
|
26
30
|
capability: e,
|
|
27
|
-
html:
|
|
31
|
+
html: p,
|
|
28
32
|
selectionHtml: v || void 0,
|
|
29
33
|
prompt: m,
|
|
30
|
-
history:
|
|
34
|
+
history: T,
|
|
31
35
|
options: u,
|
|
32
36
|
modelId: i.modelId,
|
|
33
|
-
documentSnapshot: { html:
|
|
37
|
+
documentSnapshot: { html: p, selectionHtml: v || void 0 }
|
|
34
38
|
});
|
|
35
|
-
(
|
|
36
|
-
...
|
|
39
|
+
(S = s.turns) != null && S.length ? h((k) => [...k, ...s.turns]) : s.text && e !== "chat" && h((k) => [
|
|
40
|
+
...k,
|
|
37
41
|
{
|
|
38
|
-
id:
|
|
42
|
+
id: D("turn"),
|
|
39
43
|
role: "assistant",
|
|
40
44
|
content: s.text || "",
|
|
41
45
|
timestamp: Date.now(),
|
|
42
46
|
capability: e
|
|
43
47
|
}
|
|
44
|
-
]), s.diff &&
|
|
48
|
+
]), s.diff && I(s.diff), s.reviewSuggestions && O(s.reviewSuggestions);
|
|
45
49
|
} finally {
|
|
46
|
-
|
|
50
|
+
N(!1);
|
|
47
51
|
}
|
|
48
|
-
},
|
|
52
|
+
}, G = (e) => {
|
|
49
53
|
e.preventDefault();
|
|
50
|
-
const u =
|
|
51
|
-
!u ||
|
|
54
|
+
const u = f.trim();
|
|
55
|
+
!u || a || (g(""), d("chat", void 0, u));
|
|
52
56
|
};
|
|
53
57
|
return /* @__PURE__ */ n(
|
|
54
58
|
"aside",
|
|
55
59
|
{
|
|
56
|
-
className: `Ink-Ai ${
|
|
60
|
+
className: `Ink-Ai ${j}`.trim(),
|
|
57
61
|
"data-placement": i.placement || "sidebar",
|
|
58
62
|
style: {
|
|
59
|
-
"--ink-ai-accent": (
|
|
60
|
-
"--ink-ai-surface": (
|
|
63
|
+
"--ink-ai-accent": (E = i.uiTheme) == null ? void 0 : E.accent,
|
|
64
|
+
"--ink-ai-surface": (w = i.uiTheme) == null ? void 0 : w.surface,
|
|
61
65
|
"--ink-ai-border": (C = i.uiTheme) == null ? void 0 : C.border
|
|
62
66
|
},
|
|
63
67
|
"aria-label": "Ink AI",
|
|
64
68
|
children: [
|
|
65
69
|
/* @__PURE__ */ n("div", { className: "Ink-Ai__header", children: [
|
|
66
70
|
/* @__PURE__ */ t("strong", { children: "Ink AI" }),
|
|
67
|
-
|
|
71
|
+
b ? /* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: b, title: "Close AI", children: "×" }) : null
|
|
68
72
|
] }),
|
|
69
73
|
/* @__PURE__ */ t("div", { className: "Ink-Ai__tabs", role: "tablist", children: ["chat", "actions", "review", "translate"].map((e) => /* @__PURE__ */ t(
|
|
70
74
|
"button",
|
|
71
75
|
{
|
|
72
76
|
type: "button",
|
|
73
77
|
role: "tab",
|
|
74
|
-
className: `Ink-Editor__button${
|
|
75
|
-
"aria-selected":
|
|
76
|
-
onClick: () =>
|
|
78
|
+
className: `Ink-Editor__button${o === e ? " Ink-Editor__button--active" : ""}`,
|
|
79
|
+
"aria-selected": o === e,
|
|
80
|
+
onClick: () => M(e),
|
|
77
81
|
children: e
|
|
78
82
|
},
|
|
79
83
|
e
|
|
80
84
|
)) }),
|
|
81
85
|
/* @__PURE__ */ n("div", { className: "Ink-Ai__body", children: [
|
|
82
|
-
|
|
86
|
+
o === "chat" ? /* @__PURE__ */ n(P, { children: [
|
|
83
87
|
/* @__PURE__ */ t("div", { className: "Ink-Ai__history", children: r.length === 0 ? /* @__PURE__ */ n("p", { className: "Ink-Ai__empty", children: [
|
|
84
88
|
"Multi-turn chat with local demo provider. Bring your own LLM via",
|
|
85
89
|
" ",
|
|
@@ -89,61 +93,61 @@ const W = (D) => {
|
|
|
89
93
|
/* @__PURE__ */ t("span", { children: e.role }),
|
|
90
94
|
/* @__PURE__ */ t("p", { children: e.content })
|
|
91
95
|
] }, e.id)) }),
|
|
92
|
-
/* @__PURE__ */ n("form", { className: "Ink-Ai__form", onSubmit:
|
|
96
|
+
/* @__PURE__ */ n("form", { className: "Ink-Ai__form", onSubmit: G, children: [
|
|
93
97
|
/* @__PURE__ */ t(
|
|
94
98
|
"input",
|
|
95
99
|
{
|
|
96
|
-
value:
|
|
100
|
+
value: f,
|
|
97
101
|
onChange: (e) => g(e.target.value),
|
|
98
102
|
placeholder: "Ask Ink AI…",
|
|
99
|
-
disabled:
|
|
103
|
+
disabled: a
|
|
100
104
|
}
|
|
101
105
|
),
|
|
102
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "Ink-Editor__button Ink-Editor__button--active", disabled:
|
|
106
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "Ink-Editor__button Ink-Editor__button--active", disabled: a, children: "Send" })
|
|
103
107
|
] })
|
|
104
108
|
] }) : null,
|
|
105
|
-
|
|
109
|
+
o === "actions" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__actions", children: [
|
|
106
110
|
/* @__PURE__ */ t("p", { className: "Ink-Ai__hint", children: "Quick actions use the current selection (or full document)." }),
|
|
107
|
-
|
|
111
|
+
Q.map((e) => /* @__PURE__ */ t(
|
|
108
112
|
"button",
|
|
109
113
|
{
|
|
110
114
|
type: "button",
|
|
111
115
|
className: "Ink-Editor__button Ink-Ai__action",
|
|
112
|
-
disabled:
|
|
116
|
+
disabled: a,
|
|
113
117
|
onClick: () => void d(e.capability),
|
|
114
118
|
children: e.label
|
|
115
119
|
},
|
|
116
120
|
e.id
|
|
117
121
|
))
|
|
118
122
|
] }) : null,
|
|
119
|
-
|
|
123
|
+
o === "review" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__review", children: [
|
|
120
124
|
/* @__PURE__ */ t(
|
|
121
125
|
"button",
|
|
122
126
|
{
|
|
123
127
|
type: "button",
|
|
124
128
|
className: "Ink-Editor__button Ink-Editor__button--active",
|
|
125
|
-
disabled:
|
|
129
|
+
disabled: a,
|
|
126
130
|
onClick: () => void d("review"),
|
|
127
131
|
children: "Run grammar & style review"
|
|
128
132
|
}
|
|
129
133
|
),
|
|
130
|
-
|
|
134
|
+
K.map((e) => /* @__PURE__ */ n("article", { className: `Ink-Ai__suggestion Ink-Ai__suggestion--${e.severity}`, children: [
|
|
131
135
|
/* @__PURE__ */ t("strong", { children: e.severity }),
|
|
132
136
|
/* @__PURE__ */ t("p", { children: e.message }),
|
|
133
137
|
/* @__PURE__ */ t("code", { children: e.suggestedText })
|
|
134
138
|
] }, e.id))
|
|
135
139
|
] }) : null,
|
|
136
|
-
|
|
140
|
+
o === "translate" ? /* @__PURE__ */ n("div", { className: "Ink-Ai__translate", children: [
|
|
137
141
|
/* @__PURE__ */ n("label", { children: [
|
|
138
142
|
"Language",
|
|
139
|
-
/* @__PURE__ */ t("select", { value: A, onChange: (e) =>
|
|
143
|
+
/* @__PURE__ */ t("select", { value: A, onChange: (e) => $(e.target.value), children: H.map((e) => /* @__PURE__ */ t("option", { value: e, children: e }, e)) })
|
|
140
144
|
] }),
|
|
141
145
|
/* @__PURE__ */ t(
|
|
142
146
|
"button",
|
|
143
147
|
{
|
|
144
148
|
type: "button",
|
|
145
149
|
className: "Ink-Editor__button Ink-Editor__button--active",
|
|
146
|
-
disabled:
|
|
150
|
+
disabled: a,
|
|
147
151
|
onClick: () => void d("translate", { language: A }),
|
|
148
152
|
children: "Translate"
|
|
149
153
|
}
|
|
@@ -160,12 +164,12 @@ const W = (D) => {
|
|
|
160
164
|
type: "button",
|
|
161
165
|
className: "Ink-Editor__button Ink-Editor__button--active",
|
|
162
166
|
onClick: () => {
|
|
163
|
-
|
|
167
|
+
x(c.suggestedHtml), I(null);
|
|
164
168
|
},
|
|
165
169
|
children: "Apply"
|
|
166
170
|
}
|
|
167
171
|
),
|
|
168
|
-
/* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: () =>
|
|
172
|
+
/* @__PURE__ */ t("button", { type: "button", className: "Ink-Editor__button", onClick: () => I(null), children: "Dismiss" })
|
|
169
173
|
] })
|
|
170
174
|
] }) : null
|
|
171
175
|
] }),
|
|
@@ -175,5 +179,5 @@ const W = (D) => {
|
|
|
175
179
|
);
|
|
176
180
|
};
|
|
177
181
|
export {
|
|
178
|
-
|
|
182
|
+
te as AiPanel
|
|
179
183
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");require("react");require("react-dom");const i=require("../../../../common-components/icons/GripIcon.cjs"),e=require("./BlockHandles.const.cjs"),l=n=>{const{visible:L,top:_,onMoveUp:r,onMoveDown:o,onDragStart:s}=n;return L?t.jsxs("div",{className:e.BLOCK_HANDLES_CLASS,style:{top:_},"aria-hidden":!L,children:[t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_PLUS_CLASS,title:e.BLOCK_HANDLES_TITLE_PLUS,tabIndex:-1,children:e.BLOCK_HANDLES_PLUS_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_GRIP_CLASS,title:e.BLOCK_HANDLES_TITLE_GRIP,tabIndex:-1,draggable:!0,onDragStart:s,children:t.jsx(i.GripIcon,{})}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_UP,onClick:r,children:e.BLOCK_HANDLES_UP_LABEL}),t.jsx("button",{type:"button",className:e.BLOCK_HANDLES_BTN_CLASS,title:e.BLOCK_HANDLES_TITLE_DOWN,onClick:o,children:e.BLOCK_HANDLES_DOWN_LABEL})]}):null};exports.BlockHandles=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../../../../constants/blocks.const.cjs"),_="Ink-BlockHandles",A="Ink-BlockHandles__plus",S="Ink-BlockHandles__grip",E="Ink-BlockHandles__btn",D="+",B="↑",C="↓",O="Add",N="Drag block",o="Move block up",H="Move block down",n="text/plain",K="move",c=L.BLOCK_DRAG_PAYLOAD;exports.BLOCK_HANDLES_BTN_CLASS=E;exports.BLOCK_HANDLES_CLASS=_;exports.BLOCK_HANDLES_DOWN_LABEL=C;exports.BLOCK_HANDLES_DRAG_EFFECT_MOVE=K;exports.BLOCK_HANDLES_DRAG_MIME=n;exports.BLOCK_HANDLES_DRAG_PAYLOAD=c;exports.BLOCK_HANDLES_GRIP_CLASS=S;exports.BLOCK_HANDLES_PLUS_CLASS=A;exports.BLOCK_HANDLES_PLUS_LABEL=D;exports.BLOCK_HANDLES_TITLE_DOWN=H;exports.BLOCK_HANDLES_TITLE_GRIP=N;exports.BLOCK_HANDLES_TITLE_PLUS=O;exports.BLOCK_HANDLES_TITLE_UP=o;exports.BLOCK_HANDLES_UP_LABEL=B;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const BLOCK_HANDLES_CLASS = "Ink-BlockHandles";
|
|
2
|
+
export declare const BLOCK_HANDLES_PLUS_CLASS = "Ink-BlockHandles__plus";
|
|
3
|
+
export declare const BLOCK_HANDLES_GRIP_CLASS = "Ink-BlockHandles__grip";
|
|
4
|
+
export declare const BLOCK_HANDLES_BTN_CLASS = "Ink-BlockHandles__btn";
|
|
5
|
+
export declare const BLOCK_HANDLES_PLUS_LABEL = "+";
|
|
6
|
+
export declare const BLOCK_HANDLES_UP_LABEL = "\u2191";
|
|
7
|
+
export declare const BLOCK_HANDLES_DOWN_LABEL = "\u2193";
|
|
8
|
+
export declare const BLOCK_HANDLES_TITLE_PLUS = "Add";
|
|
9
|
+
export declare const BLOCK_HANDLES_TITLE_GRIP = "Drag block";
|
|
10
|
+
export declare const BLOCK_HANDLES_TITLE_UP = "Move block up";
|
|
11
|
+
export declare const BLOCK_HANDLES_TITLE_DOWN = "Move block down";
|
|
12
|
+
export declare const BLOCK_HANDLES_DRAG_MIME = "text/plain";
|
|
13
|
+
export declare const BLOCK_HANDLES_DRAG_EFFECT_MOVE = "move";
|
|
14
|
+
export declare const BLOCK_HANDLES_DRAG_PAYLOAD = "ink-block";
|
|
15
|
+
//# sourceMappingURL=BlockHandles.const.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockHandles.const.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,wBAAwB,2BAA2B,CAAC;AACjE,eAAO,MAAM,uBAAuB,0BAA0B,CAAC;AAC/D,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,sBAAsB,WAAM,CAAC;AAC1C,eAAO,MAAM,wBAAwB,WAAM,CAAC;AAC5C,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,wBAAwB,eAAe,CAAC;AACrD,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AACtD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,uBAAuB,eAAe,CAAC;AACpD,eAAO,MAAM,8BAA8B,SAAS,CAAC;AACrD,eAAO,MAAM,0BAA0B,cAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BLOCK_DRAG_PAYLOAD as _ } from "../../../../constants/blocks.const.js";
|
|
2
|
+
const A = "Ink-BlockHandles", o = "Ink-BlockHandles__plus", n = "Ink-BlockHandles__grip", E = "Ink-BlockHandles__btn", S = "+", B = "↑", D = "↓", c = "Add", C = "Drag block", O = "Move block up", s = "Move block down", t = "text/plain", H = "move", N = _;
|
|
3
|
+
export {
|
|
4
|
+
E as BLOCK_HANDLES_BTN_CLASS,
|
|
5
|
+
A as BLOCK_HANDLES_CLASS,
|
|
6
|
+
D as BLOCK_HANDLES_DOWN_LABEL,
|
|
7
|
+
H as BLOCK_HANDLES_DRAG_EFFECT_MOVE,
|
|
8
|
+
t as BLOCK_HANDLES_DRAG_MIME,
|
|
9
|
+
N as BLOCK_HANDLES_DRAG_PAYLOAD,
|
|
10
|
+
n as BLOCK_HANDLES_GRIP_CLASS,
|
|
11
|
+
o as BLOCK_HANDLES_PLUS_CLASS,
|
|
12
|
+
S as BLOCK_HANDLES_PLUS_LABEL,
|
|
13
|
+
s as BLOCK_HANDLES_TITLE_DOWN,
|
|
14
|
+
C as BLOCK_HANDLES_TITLE_GRIP,
|
|
15
|
+
c as BLOCK_HANDLES_TITLE_PLUS,
|
|
16
|
+
O as BLOCK_HANDLES_TITLE_UP,
|
|
17
|
+
B as BLOCK_HANDLES_UP_LABEL
|
|
18
|
+
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
|
|
3
|
-
visible: boolean;
|
|
4
|
-
top: number;
|
|
5
|
-
onMoveUp: () => void;
|
|
6
|
-
onMoveDown: () => void;
|
|
7
|
-
}
|
|
2
|
+
import { BlockHandlesProps } from './BlockHandles.types';
|
|
8
3
|
export declare const BlockHandles: FC<BlockHandlesProps>;
|
|
9
4
|
//# sourceMappingURL=BlockHandles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockHandles.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BlockHandles.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAehC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAyC9C,CAAC"}
|
|
@@ -1,12 +1,57 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import "../../../../constants/openai.const.js";
|
|
3
|
+
import "../../../../utils/paste.utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
import { GripIcon as S } from "../../../../common-components/icons/GripIcon.js";
|
|
7
|
+
import { BLOCK_HANDLES_CLASS as a, BLOCK_HANDLES_PLUS_LABEL as N, BLOCK_HANDLES_TITLE_PLUS as s, BLOCK_HANDLES_PLUS_CLASS as A, BLOCK_HANDLES_TITLE_GRIP as E, BLOCK_HANDLES_GRIP_CLASS as C, BLOCK_HANDLES_UP_LABEL as c, BLOCK_HANDLES_TITLE_UP as B, BLOCK_HANDLES_BTN_CLASS as o, BLOCK_HANDLES_DOWN_LABEL as m, BLOCK_HANDLES_TITLE_DOWN as p } from "./BlockHandles.const.js";
|
|
8
|
+
const I = (_) => {
|
|
9
|
+
const { visible: L, top: e, onMoveUp: n, onMoveDown: r, onDragStart: i } = _;
|
|
10
|
+
return L ? /* @__PURE__ */ l("div", { className: a, style: { top: e }, "aria-hidden": !L, children: [
|
|
11
|
+
/* @__PURE__ */ t(
|
|
12
|
+
"button",
|
|
13
|
+
{
|
|
14
|
+
type: "button",
|
|
15
|
+
className: A,
|
|
16
|
+
title: s,
|
|
17
|
+
tabIndex: -1,
|
|
18
|
+
children: N
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ t(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
className: C,
|
|
26
|
+
title: E,
|
|
27
|
+
tabIndex: -1,
|
|
28
|
+
draggable: !0,
|
|
29
|
+
onDragStart: i,
|
|
30
|
+
children: /* @__PURE__ */ t(S, {})
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ t(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
className: o,
|
|
38
|
+
title: B,
|
|
39
|
+
onClick: n,
|
|
40
|
+
children: c
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
type: "button",
|
|
47
|
+
className: o,
|
|
48
|
+
title: p,
|
|
49
|
+
onClick: r,
|
|
50
|
+
children: m
|
|
51
|
+
}
|
|
52
|
+
)
|
|
8
53
|
] }) : null;
|
|
9
54
|
};
|
|
10
55
|
export {
|
|
11
|
-
|
|
56
|
+
I as BlockHandles
|
|
12
57
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DragEvent } from 'react';
|
|
2
|
+
export interface BlockHandlesProps {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
top: number;
|
|
5
|
+
onMoveUp: () => void;
|
|
6
|
+
onMoveDown: () => void;
|
|
7
|
+
onDragStart?: (event: DragEvent<HTMLButtonElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=BlockHandles.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockHandles.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/BlockHandles.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC7D"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { BlockHandles } from './BlockHandles';
|
|
2
|
-
export type { BlockHandlesProps } from './BlockHandles';
|
|
2
|
+
export type { BlockHandlesProps } from './BlockHandles.types';
|
|
3
|
+
export { BLOCK_HANDLES_DRAG_EFFECT_MOVE, BLOCK_HANDLES_DRAG_MIME, BLOCK_HANDLES_DRAG_PAYLOAD, } from './BlockHandles.const';
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/BlockHandles/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),o=require("../../../../constants/generals.const.cjs"),a=require("../../../../constants/findReplaceMenu.const.cjs");require("../../../../constants/openai.const.cjs");require("../../../../utils/paste.utils.cjs");const r=require("../../../../common-components/Button/Button.cjs"),u=require("../../../../common-components/Field/Field.cjs");require("react-dom");const e=require("./FindReplace.const.cjs"),p=L=>{const{open:F,onClose:C,onReplace:A,findLabel:D=e.FIND_REPLACE_DEFAULT_FIND,replaceLabel:N=e.FIND_REPLACE_DEFAULT_REPLACE,replaceOneLabel:R=e.FIND_REPLACE_DEFAULT_ONE,replaceAllLabel:d=e.FIND_REPLACE_DEFAULT_ALL,closeLabel:I=e.FIND_REPLACE_DEFAULT_CLOSE,title:c=e.FIND_REPLACE_DEFAULT_TITLE,focusField:s=a.FIND_REPLACE_FOCUS_FIND}=L,[l,S]=i.useState(o.EMPTY_STRING),[E,P]=i.useState(o.EMPTY_STRING);if(!F)return null;const _=(n,b)=>{n.preventDefault(),l&&A(l,E,b)};return t.jsxs("form",{className:e.FIND_REPLACE_CLASS,"aria-label":c,onSubmit:n=>_(n,!1),children:[t.jsx("p",{className:e.FIND_REPLACE_TITLE_CLASS,children:c}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:D,value:l,onChange:S,autoFocus:s===a.FIND_REPLACE_FOCUS_FIND}),t.jsx(u.Field,{className:e.FIND_REPLACE_FIELD_CLASS,label:N,value:E,onChange:P,autoFocus:s===a.FIND_REPLACE_FOCUS_REPLACE}),t.jsxs("div",{className:e.FIND_REPLACE_ACTIONS_CLASS,children:[t.jsx(r.Button,{type:"button",onClick:C,children:I}),t.jsx(r.Button,{type:"submit",disabled:!l,children:R}),t.jsx(r.Button,{type:"button",active:!0,disabled:!l,onClick:n=>_(n,!0),children:d})]})]},s)};exports.FindReplace=p;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FindReplace.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FindReplace.d.ts","sourceRoot":"","sources":["../../../../../src/components/InkEditor/components/FindReplace/FindReplace.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAmB1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2D5C,CAAC"}
|