@copilotkit/react-textarea 0.15.1 → 0.16.0
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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-TSF4AJIK.mjs → chunk-42QG2O6L.mjs} +6 -2
- package/dist/chunk-42QG2O6L.mjs.map +1 -0
- package/dist/{chunk-K3P3PCV7.mjs → chunk-ERPZ5XG5.mjs} +2 -2
- package/dist/{chunk-4XYYSJ5C.mjs → chunk-F3MHL6ZY.mjs} +9 -2
- package/dist/chunk-F3MHL6ZY.mjs.map +1 -0
- package/dist/{chunk-AOEXKPIX.mjs → chunk-YFA7S5ER.mjs} +2 -2
- package/dist/{chunk-QZ2PN6ZU.mjs → chunk-ZSQLGOES.mjs} +4 -4
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +4 -4
- package/dist/components/copilot-textarea/copilot-textarea.mjs +5 -5
- package/dist/components/index.mjs +5 -5
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +2 -2
- package/dist/index.mjs +5 -5
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +1 -1
- package/dist/lib/slatejs-edits/replace-text.mjs +1 -1
- package/package.json +1 -1
- package/src/lib/slatejs-edits/clear-autocompletions.ts +9 -2
- package/src/lib/slatejs-edits/replace-text.ts +6 -2
- package/dist/chunk-4XYYSJ5C.mjs.map +0 -1
- package/dist/chunk-TSF4AJIK.mjs.map +0 -1
- /package/dist/{chunk-K3P3PCV7.mjs.map → chunk-ERPZ5XG5.mjs.map} +0 -0
- /package/dist/{chunk-AOEXKPIX.mjs.map → chunk-YFA7S5ER.mjs.map} +0 -0
- /package/dist/{chunk-QZ2PN6ZU.mjs.map → chunk-ZSQLGOES.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @copilotkit/react-textarea@0.
|
|
2
|
+
> @copilotkit/react-textarea@0.16.0 build /home/runner/work/CopilotKit/CopilotKit/CopilotKit/packages/react-textarea
|
|
3
3
|
> tsup --treeshake
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx, src/components/index.ts, src/context/index.ts, src/hooks/index.ts, src/lib/debouncer.ts, src/lib/editor-to-text.ts, src/lib/get-text-around-cursor.ts, src/lib/utils.test.ts, src/lib/utils.ts, src/types/html-copilot-textarea-element.ts, src/types/index.ts, src/components/base-copilot-textarea/base-copilot-textarea.tsx, src/components/base-copilot-textarea/render-element.tsx, src/components/base-copilot-textarea/render-placeholder.tsx, src/components/base-copilot-textarea/use-add-branding-css.tsx, src/components/copilot-textarea/copilot-textarea.tsx, src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts, src/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.tsx, src/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.ts, src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx, src/lib/slatejs-edits/add-autocompletions.ts, src/lib/slatejs-edits/clear-autocompletions.ts, src/lib/slatejs-edits/replace-text.ts, src/lib/slatejs-edits/with-partial-history.ts, src/types/base/autosuggestion-state.ts, src/types/base/autosuggestions-bare-function.ts, src/types/base/base-autosuggestions-config.tsx, src/types/base/base-copilot-textarea-props.tsx, src/types/base/custom-editor.tsx, src/types/base/editor-autocomplete-state.ts, src/types/base/index.ts, src/types/standard-autosuggestions/autosuggestions-config.tsx, src/types/standard-autosuggestions/chatlike-api-endpoint.tsx, src/types/standard-autosuggestions/index.ts, src/types/standard-autosuggestions/minimal-chat-gpt-message.tsx
|
|
@@ -57,18 +57,18 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
57
57
|
[32mESM[39m [1mdist/components/copilot-textarea/copilot-textarea.mjs [22m[32m907.00 B[39m
|
|
58
58
|
[32mESM[39m [1mdist/index.mjs [22m[32m1.12 KB[39m
|
|
59
59
|
[32mESM[39m [1mdist/components/index.mjs [22m[32m888.00 B[39m
|
|
60
|
-
[32mESM[39m [1mdist/chunk-
|
|
60
|
+
[32mESM[39m [1mdist/chunk-ERPZ5XG5.mjs [22m[32m1.23 KB[39m
|
|
61
61
|
[32mESM[39m [1mdist/chunk-4ES2IIB6.mjs [22m[32m1.76 KB[39m
|
|
62
62
|
[32mESM[39m [1mdist/chunk-LGK56BTO.mjs [22m[32m2.86 KB[39m
|
|
63
63
|
[32mESM[39m [1mdist/chunk-3A2CNIG5.mjs [22m[32m949.00 B[39m
|
|
64
|
-
[32mESM[39m [1mdist/chunk-
|
|
64
|
+
[32mESM[39m [1mdist/chunk-ZSQLGOES.mjs [22m[32m6.02 KB[39m
|
|
65
65
|
[32mESM[39m [1mdist/chunk-HZGSG7ST.mjs [22m[32m3.02 KB[39m
|
|
66
66
|
[32mESM[39m [1mdist/chunk-UW3ITU2Y.mjs [22m[32m496.00 B[39m
|
|
67
67
|
[32mESM[39m [1mdist/chunk-CSGFJU3L.mjs [22m[32m2.01 KB[39m
|
|
68
|
-
[32mESM[39m [1mdist/chunk-
|
|
68
|
+
[32mESM[39m [1mdist/chunk-YFA7S5ER.mjs [22m[32m2.57 KB[39m
|
|
69
69
|
[32mESM[39m [1mdist/chunk-WJYQWL4I.mjs [22m[32m595.00 B[39m
|
|
70
|
-
[32mESM[39m [1mdist/chunk-
|
|
71
|
-
[32mESM[39m [1mdist/chunk-
|
|
70
|
+
[32mESM[39m [1mdist/chunk-F3MHL6ZY.mjs [22m[32m680.00 B[39m
|
|
71
|
+
[32mESM[39m [1mdist/chunk-42QG2O6L.mjs [22m[32m832.00 B[39m
|
|
72
72
|
[32mESM[39m [1mdist/chunk-KCHYD3EB.mjs [22m[32m3.08 KB[39m
|
|
73
73
|
[32mESM[39m [1mdist/chunk-KGKLUWKW.mjs [22m[32m1.37 KB[39m
|
|
74
74
|
[32mESM[39m [1mdist/chunk-LNAIMEB2.mjs [22m[32m1.09 KB[39m
|
|
@@ -122,18 +122,18 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
122
122
|
[32mESM[39m [1mdist/components/copilot-textarea/copilot-textarea.mjs.map [22m[32m51.00 B[39m
|
|
123
123
|
[32mESM[39m [1mdist/index.mjs.map [22m[32m51.00 B[39m
|
|
124
124
|
[32mESM[39m [1mdist/components/index.mjs.map [22m[32m51.00 B[39m
|
|
125
|
-
[32mESM[39m [1mdist/chunk-
|
|
125
|
+
[32mESM[39m [1mdist/chunk-ERPZ5XG5.mjs.map [22m[32m2.17 KB[39m
|
|
126
126
|
[32mESM[39m [1mdist/chunk-4ES2IIB6.mjs.map [22m[32m4.41 KB[39m
|
|
127
127
|
[32mESM[39m [1mdist/chunk-LGK56BTO.mjs.map [22m[32m4.17 KB[39m
|
|
128
128
|
[32mESM[39m [1mdist/chunk-3A2CNIG5.mjs.map [22m[32m2.15 KB[39m
|
|
129
|
-
[32mESM[39m [1mdist/chunk-
|
|
129
|
+
[32mESM[39m [1mdist/chunk-ZSQLGOES.mjs.map [22m[32m10.79 KB[39m
|
|
130
130
|
[32mESM[39m [1mdist/chunk-HZGSG7ST.mjs.map [22m[32m5.83 KB[39m
|
|
131
131
|
[32mESM[39m [1mdist/chunk-UW3ITU2Y.mjs.map [22m[32m878.00 B[39m
|
|
132
132
|
[32mESM[39m [1mdist/chunk-CSGFJU3L.mjs.map [22m[32m3.82 KB[39m
|
|
133
|
-
[32mESM[39m [1mdist/chunk-
|
|
133
|
+
[32mESM[39m [1mdist/chunk-YFA7S5ER.mjs.map [22m[32m4.80 KB[39m
|
|
134
134
|
[32mESM[39m [1mdist/chunk-WJYQWL4I.mjs.map [22m[32m1.04 KB[39m
|
|
135
|
-
[32mESM[39m [1mdist/chunk-
|
|
136
|
-
[32mESM[39m [1mdist/chunk-
|
|
135
|
+
[32mESM[39m [1mdist/chunk-F3MHL6ZY.mjs.map [22m[32m1.14 KB[39m
|
|
136
|
+
[32mESM[39m [1mdist/chunk-42QG2O6L.mjs.map [22m[32m1.50 KB[39m
|
|
137
137
|
[32mESM[39m [1mdist/chunk-KCHYD3EB.mjs.map [22m[32m6.12 KB[39m
|
|
138
138
|
[32mESM[39m [1mdist/chunk-KGKLUWKW.mjs.map [22m[32m2.45 KB[39m
|
|
139
139
|
[32mESM[39m [1mdist/chunk-LNAIMEB2.mjs.map [22m[32m1.73 KB[39m
|
|
@@ -159,12 +159,12 @@ Generated an empty chunk: "chunk-H4VKQGVU".
|
|
|
159
159
|
[32mESM[39m [1mdist/types/standard-autosuggestions/autosuggestions-config.mjs.map [22m[32m51.00 B[39m
|
|
160
160
|
[32mESM[39m [1mdist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map [22m[32m51.00 B[39m
|
|
161
161
|
[32mESM[39m [1mdist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map [22m[32m51.00 B[39m
|
|
162
|
-
[32mESM[39m ⚡️ Build success in
|
|
162
|
+
[32mESM[39m ⚡️ Build success in 2717ms
|
|
163
163
|
Export "AutosuggestionsConfig" of module "src/types/standard-autosuggestions/autosuggestions-config.tsx" was reexported through module "src/types/standard-autosuggestions/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
|
|
164
164
|
Either change the import in "src/components/copilot-textarea/copilot-textarea.tsx" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.
|
|
165
165
|
Export "MakeSystemPrompt" of module "src/types/standard-autosuggestions/autosuggestions-config.tsx" was reexported through module "src/types/standard-autosuggestions/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
|
|
166
166
|
Either change the import in "src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx" to point directly to the exporting module or do not use "preserveModules" to ensure these modules end up in the same chunk.
|
|
167
|
-
[32mDTS[39m ⚡️ Build success in
|
|
167
|
+
[32mDTS[39m ⚡️ Build success in 5119ms
|
|
168
168
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.01 KB[39m
|
|
169
169
|
[32mDTS[39m [1mdist/components/base-copilot-textarea/base-copilot-textarea.d.ts [22m[32m669.00 B[39m
|
|
170
170
|
[32mDTS[39m [1mdist/components/copilot-textarea/copilot-textarea.d.ts [22m[32m875.00 B[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -9,7 +9,11 @@ function replaceEditorText(editor, newText) {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
for (const path of paths) {
|
|
12
|
-
|
|
12
|
+
try {
|
|
13
|
+
Transforms.removeNodes(editor, { at: path });
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.log("CopilotTextarea.replaceEditorText: error removing node", e);
|
|
16
|
+
}
|
|
13
17
|
}
|
|
14
18
|
Transforms.insertNodes(
|
|
15
19
|
editor,
|
|
@@ -27,4 +31,4 @@ function replaceEditorText(editor, newText) {
|
|
|
27
31
|
|
|
28
32
|
export { replaceEditorText };
|
|
29
33
|
//# sourceMappingURL=out.js.map
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
34
|
+
//# sourceMappingURL=chunk-42QG2O6L.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/slatejs-edits/replace-text.ts"],"names":[],"mappings":";AAAA,SAAiB,SAAS,MAAY,kBAAkB;AAEjD,SAAS,kBAAkB,QAAgB,SAAiB;AAEjE,QAAM,QAAgB,CAAC;AACvB,aAAW,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM,MAAM,GAAG;AAC7C,QACE,QAAQ,UAAU,IAAI,MACrB,KAAK,SAAS,eAAe,KAAK,SAAS,iBAC5C,KAAK,WAAW,GAChB;AACA,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,QAAI;AACF,iBAAW,YAAY,QAAQ,EAAE,IAAI,KAAK,CAAC;AAAA,IAC7C,SAAS,GAAP;AACA,cAAQ,IAAI,0DAA0D,CAAC;AAAA,IACzE;AAAA,EACF;AAGA,aAAW;AAAA,IACT;AAAA,IACA;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,QAAQ,CAAC;AAAA,MAC9B;AAAA,IACF;AAAA,IACA;AAAA,MACE,IAAI,CAAC,CAAC;AAAA,IACR;AAAA,EACF;AACF","sourcesContent":["import { Editor, Element, Node, Path, Transforms } from \"slate\";\n\nexport function replaceEditorText(editor: Editor, newText: string) {\n // clear all previous text\n const paths: Path[] = [];\n for (const [node, path] of Node.nodes(editor)) {\n if (\n Element.isElement(node) &&\n (node.type === \"paragraph\" || node.type === \"suggestion\") &&\n path.length === 1\n ) {\n paths.push(path);\n }\n }\n for (const path of paths) {\n try {\n Transforms.removeNodes(editor, { at: path });\n } catch (e) {\n console.log(\"CopilotTextarea.replaceEditorText: error removing node\", e);\n }\n }\n\n // insert new text\n Transforms.insertNodes(\n editor,\n [\n {\n type: \"paragraph\",\n children: [{ text: newText }],\n },\n ],\n {\n at: [0],\n }\n );\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMakeStandardAutosuggestionFunction } from './chunk-4ES2IIB6.mjs';
|
|
2
2
|
import { defaultAutosuggestionsConfig } from './chunk-LGK56BTO.mjs';
|
|
3
|
-
import { BaseCopilotTextarea } from './chunk-
|
|
3
|
+
import { BaseCopilotTextarea } from './chunk-ZSQLGOES.mjs';
|
|
4
4
|
import { __spreadValues, __spreadProps } from './chunk-MRXNTQOX.mjs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -29,4 +29,4 @@ var CopilotTextarea = React.forwardRef(
|
|
|
29
29
|
|
|
30
30
|
export { CopilotTextarea };
|
|
31
31
|
//# sourceMappingURL=out.js.map
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-ERPZ5XG5.mjs.map
|
|
@@ -9,10 +9,17 @@ function clearAutocompletionsFromEditor(editor) {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
for (const path of paths) {
|
|
12
|
-
|
|
12
|
+
try {
|
|
13
|
+
Transforms.removeNodes(editor, { at: path });
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.log(
|
|
16
|
+
"CopilotTextarea.clearAutocompletionsFromEditor: error removing node",
|
|
17
|
+
e
|
|
18
|
+
);
|
|
19
|
+
}
|
|
13
20
|
}
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
export { clearAutocompletionsFromEditor };
|
|
17
24
|
//# sourceMappingURL=out.js.map
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-F3MHL6ZY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/slatejs-edits/clear-autocompletions.ts"],"names":[],"mappings":";AAAA,SAAS,SAAS,MAAY,kBAAkB;AAGzC,SAAS,+BAA+B,QAAsB;AAEnE,QAAM,QAAgB,CAAC;AACvB,aAAW,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM,MAAM,GAAG;AAC7C,QAAI,QAAQ,UAAU,IAAI,KAAK,KAAK,SAAS,cAAc;AACzD,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,QAAI;AACF,iBAAW,YAAY,QAAQ,EAAE,IAAI,KAAK,CAAC;AAAA,IAC7C,SAAS,GAAP;AACA,cAAQ;AAAA,QACN;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import { Element, Node, Path, Transforms } from \"slate\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nexport function clearAutocompletionsFromEditor(editor: CustomEditor) {\n // clear previous suggestion\n const paths: Path[] = [];\n for (const [node, path] of Node.nodes(editor)) {\n if (Element.isElement(node) && node.type === \"suggestion\") {\n paths.push(path);\n }\n }\n for (const path of paths) {\n try {\n Transforms.removeNodes(editor, { at: path });\n } catch (e) {\n console.log(\n \"CopilotTextarea.clearAutocompletionsFromEditor: error removing node\",\n e\n );\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { replaceEditorText } from './chunk-
|
|
1
|
+
import { replaceEditorText } from './chunk-42QG2O6L.mjs';
|
|
2
2
|
import { getFullEditorTextWithNewlines } from './chunk-3UQM3NLM.mjs';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ReactEditor } from 'slate-react';
|
|
@@ -80,4 +80,4 @@ function usePopulateCopilotTextareaRef(editor, ref) {
|
|
|
80
80
|
|
|
81
81
|
export { usePopulateCopilotTextareaRef };
|
|
82
82
|
//# sourceMappingURL=out.js.map
|
|
83
|
-
//# sourceMappingURL=chunk-
|
|
83
|
+
//# sourceMappingURL=chunk-YFA7S5ER.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useAutosuggestions } from './chunk-HZGSG7ST.mjs';
|
|
2
2
|
import { useCopilotTextareaEditor } from './chunk-CSGFJU3L.mjs';
|
|
3
|
-
import { usePopulateCopilotTextareaRef } from './chunk-
|
|
3
|
+
import { usePopulateCopilotTextareaRef } from './chunk-YFA7S5ER.mjs';
|
|
4
4
|
import { addAutocompletionsToEditor } from './chunk-WJYQWL4I.mjs';
|
|
5
|
-
import { clearAutocompletionsFromEditor } from './chunk-
|
|
6
|
-
import { replaceEditorText } from './chunk-
|
|
5
|
+
import { clearAutocompletionsFromEditor } from './chunk-F3MHL6ZY.mjs';
|
|
6
|
+
import { replaceEditorText } from './chunk-42QG2O6L.mjs';
|
|
7
7
|
import { defaultBaseAutosuggestionsConfig } from './chunk-7KWRVIYV.mjs';
|
|
8
8
|
import { makeRenderElementFunction } from './chunk-LNAIMEB2.mjs';
|
|
9
9
|
import { makeRenderPlaceholderFunction } from './chunk-OELUUJZY.mjs';
|
|
@@ -160,4 +160,4 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
|
|
|
160
160
|
|
|
161
161
|
export { BaseCopilotTextarea };
|
|
162
162
|
//# sourceMappingURL=out.js.map
|
|
163
|
-
//# sourceMappingURL=chunk-
|
|
163
|
+
//# sourceMappingURL=chunk-ZSQLGOES.mjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { BaseCopilotTextarea } from '../../chunk-
|
|
1
|
+
export { BaseCopilotTextarea } from '../../chunk-ZSQLGOES.mjs';
|
|
2
2
|
import '../../chunk-HZGSG7ST.mjs';
|
|
3
3
|
import '../../chunk-UW3ITU2Y.mjs';
|
|
4
4
|
import '../../chunk-CSGFJU3L.mjs';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-YFA7S5ER.mjs';
|
|
6
6
|
import '../../chunk-WJYQWL4I.mjs';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-F3MHL6ZY.mjs';
|
|
8
|
+
import '../../chunk-42QG2O6L.mjs';
|
|
9
9
|
import '../../chunk-KCHYD3EB.mjs';
|
|
10
10
|
import '../../chunk-KGKLUWKW.mjs';
|
|
11
11
|
import '../../chunk-WJHSY5T6.mjs';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { CopilotTextarea } from '../../chunk-
|
|
1
|
+
export { CopilotTextarea } from '../../chunk-ERPZ5XG5.mjs';
|
|
2
2
|
import '../../chunk-4ES2IIB6.mjs';
|
|
3
3
|
import '../../chunk-SL4J5HMW.mjs';
|
|
4
4
|
import '../../chunk-LGK56BTO.mjs';
|
|
5
5
|
import '../../chunk-3A2CNIG5.mjs';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-ZSQLGOES.mjs';
|
|
7
7
|
import '../../chunk-HZGSG7ST.mjs';
|
|
8
8
|
import '../../chunk-UW3ITU2Y.mjs';
|
|
9
9
|
import '../../chunk-CSGFJU3L.mjs';
|
|
10
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-YFA7S5ER.mjs';
|
|
11
11
|
import '../../chunk-WJYQWL4I.mjs';
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-F3MHL6ZY.mjs';
|
|
13
|
+
import '../../chunk-42QG2O6L.mjs';
|
|
14
14
|
import '../../chunk-KCHYD3EB.mjs';
|
|
15
15
|
import '../../chunk-KGKLUWKW.mjs';
|
|
16
16
|
import '../../chunk-WJHSY5T6.mjs';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import '../chunk-MMVDU6DF.mjs';
|
|
2
|
-
export { CopilotTextarea } from '../chunk-
|
|
2
|
+
export { CopilotTextarea } from '../chunk-ERPZ5XG5.mjs';
|
|
3
3
|
import '../chunk-4ES2IIB6.mjs';
|
|
4
4
|
import '../chunk-SL4J5HMW.mjs';
|
|
5
5
|
import '../chunk-LGK56BTO.mjs';
|
|
6
6
|
import '../chunk-3A2CNIG5.mjs';
|
|
7
|
-
export { BaseCopilotTextarea } from '../chunk-
|
|
7
|
+
export { BaseCopilotTextarea } from '../chunk-ZSQLGOES.mjs';
|
|
8
8
|
import '../chunk-HZGSG7ST.mjs';
|
|
9
9
|
import '../chunk-UW3ITU2Y.mjs';
|
|
10
10
|
import '../chunk-CSGFJU3L.mjs';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-YFA7S5ER.mjs';
|
|
12
12
|
import '../chunk-WJYQWL4I.mjs';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-F3MHL6ZY.mjs';
|
|
14
|
+
import '../chunk-42QG2O6L.mjs';
|
|
15
15
|
import '../chunk-KCHYD3EB.mjs';
|
|
16
16
|
import '../chunk-KGKLUWKW.mjs';
|
|
17
17
|
import '../chunk-WJHSY5T6.mjs';
|
package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { usePopulateCopilotTextareaRef } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { usePopulateCopilotTextareaRef } from '../../chunk-YFA7S5ER.mjs';
|
|
2
|
+
import '../../chunk-42QG2O6L.mjs';
|
|
3
3
|
import '../../chunk-3UQM3NLM.mjs';
|
|
4
4
|
import '../../chunk-MRXNTQOX.mjs';
|
|
5
5
|
//# sourceMappingURL=out.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import './chunk-DE5K76I2.mjs';
|
|
2
2
|
import './chunk-WADHCMPK.mjs';
|
|
3
3
|
import './chunk-MMVDU6DF.mjs';
|
|
4
|
-
export { CopilotTextarea } from './chunk-
|
|
4
|
+
export { CopilotTextarea } from './chunk-ERPZ5XG5.mjs';
|
|
5
5
|
import './chunk-4ES2IIB6.mjs';
|
|
6
6
|
import './chunk-SL4J5HMW.mjs';
|
|
7
7
|
export { defaultAutosuggestionsConfig, defaultFewShotMessages, defaultMakeSystemPrompt } from './chunk-LGK56BTO.mjs';
|
|
8
8
|
export { ChatlikeApiEndpoint } from './chunk-3A2CNIG5.mjs';
|
|
9
|
-
export { BaseCopilotTextarea } from './chunk-
|
|
9
|
+
export { BaseCopilotTextarea } from './chunk-ZSQLGOES.mjs';
|
|
10
10
|
import './chunk-HZGSG7ST.mjs';
|
|
11
11
|
import './chunk-UW3ITU2Y.mjs';
|
|
12
12
|
import './chunk-CSGFJU3L.mjs';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-YFA7S5ER.mjs';
|
|
14
14
|
import './chunk-WJYQWL4I.mjs';
|
|
15
|
-
import './chunk-
|
|
16
|
-
import './chunk-
|
|
15
|
+
import './chunk-F3MHL6ZY.mjs';
|
|
16
|
+
import './chunk-42QG2O6L.mjs';
|
|
17
17
|
import './chunk-KCHYD3EB.mjs';
|
|
18
18
|
import './chunk-KGKLUWKW.mjs';
|
|
19
19
|
import './chunk-WJHSY5T6.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { clearAutocompletionsFromEditor } from '../../chunk-
|
|
1
|
+
export { clearAutocompletionsFromEditor } from '../../chunk-F3MHL6ZY.mjs';
|
|
2
2
|
import '../../chunk-MRXNTQOX.mjs';
|
|
3
3
|
//# sourceMappingURL=out.js.map
|
|
4
4
|
//# sourceMappingURL=clear-autocompletions.mjs.map
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Element, Node, Path, Transforms } from "slate";
|
|
2
2
|
import { CustomEditor } from "../../types/base/custom-editor";
|
|
3
3
|
|
|
4
4
|
export function clearAutocompletionsFromEditor(editor: CustomEditor) {
|
|
@@ -10,6 +10,13 @@ export function clearAutocompletionsFromEditor(editor: CustomEditor) {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
for (const path of paths) {
|
|
13
|
-
|
|
13
|
+
try {
|
|
14
|
+
Transforms.removeNodes(editor, { at: path });
|
|
15
|
+
} catch (e) {
|
|
16
|
+
console.log(
|
|
17
|
+
"CopilotTextarea.clearAutocompletionsFromEditor: error removing node",
|
|
18
|
+
e
|
|
19
|
+
);
|
|
20
|
+
}
|
|
14
21
|
}
|
|
15
22
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Editor,
|
|
1
|
+
import { Editor, Element, Node, Path, Transforms } from "slate";
|
|
2
2
|
|
|
3
3
|
export function replaceEditorText(editor: Editor, newText: string) {
|
|
4
4
|
// clear all previous text
|
|
@@ -13,7 +13,11 @@ export function replaceEditorText(editor: Editor, newText: string) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
for (const path of paths) {
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
Transforms.removeNodes(editor, { at: path });
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.log("CopilotTextarea.replaceEditorText: error removing node", e);
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
// insert new text
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/slatejs-edits/clear-autocompletions.ts"],"names":[],"mappings":";AAAA,SAAe,MAAM,SAAS,kBAAkB;AAGzC,SAAS,+BAA+B,QAAsB;AAEnE,QAAM,QAAgB,CAAC;AACvB,aAAW,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM,MAAM,GAAG;AAC7C,QAAI,QAAQ,UAAU,IAAI,KAAK,KAAK,SAAS,cAAc;AACzD,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,eAAW,YAAY,QAAQ,EAAE,IAAI,KAAK,CAAC;AAAA,EAC7C;AACF","sourcesContent":["import { Path, Node, Element, Transforms } from \"slate\";\nimport { CustomEditor } from \"../../types/base/custom-editor\";\n\nexport function clearAutocompletionsFromEditor(editor: CustomEditor) {\n // clear previous suggestion\n const paths: Path[] = [];\n for (const [node, path] of Node.nodes(editor)) {\n if (Element.isElement(node) && node.type === \"suggestion\") {\n paths.push(path);\n }\n }\n for (const path of paths) {\n Transforms.removeNodes(editor, { at: path });\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/slatejs-edits/replace-text.ts"],"names":[],"mappings":";AAAA,SAAuB,YAAY,MAAM,eAAe;AAEjD,SAAS,kBAAkB,QAAgB,SAAiB;AAEjE,QAAM,QAAgB,CAAC;AACvB,aAAW,CAAC,MAAM,IAAI,KAAK,KAAK,MAAM,MAAM,GAAG;AAC7C,QACE,QAAQ,UAAU,IAAI,MACrB,KAAK,SAAS,eAAe,KAAK,SAAS,iBAC5C,KAAK,WAAW,GAChB;AACA,YAAM,KAAK,IAAI;AAAA,IACjB;AAAA,EACF;AACA,aAAW,QAAQ,OAAO;AACxB,eAAW,YAAY,QAAQ,EAAE,IAAI,KAAK,CAAC;AAAA,EAC7C;AAGA,aAAW;AAAA,IACT;AAAA,IACA;AAAA,MACE;AAAA,QACE,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,QAAQ,CAAC;AAAA,MAC9B;AAAA,IACF;AAAA,IACA;AAAA,MACE,IAAI,CAAC,CAAC;AAAA,IACR;AAAA,EACF;AACF","sourcesContent":["import { Editor, Path, Transforms, Node, Element } from \"slate\";\n\nexport function replaceEditorText(editor: Editor, newText: string) {\n // clear all previous text\n const paths: Path[] = [];\n for (const [node, path] of Node.nodes(editor)) {\n if (\n Element.isElement(node) &&\n (node.type === \"paragraph\" || node.type === \"suggestion\") &&\n path.length === 1\n ) {\n paths.push(path);\n }\n }\n for (const path of paths) {\n Transforms.removeNodes(editor, { at: path });\n }\n\n // insert new text\n Transforms.insertNodes(\n editor,\n [\n {\n type: \"paragraph\",\n children: [{ text: newText }],\n },\n ],\n {\n at: [0],\n }\n );\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|