@copilotkit/react-textarea 0.21.0-alpha.1 → 0.21.0-alpha.2
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 +302 -170
- package/CHANGELOG.md +11 -0
- package/dist/{chunk-34D4UIYX.mjs → chunk-4ENJ4VF6.mjs} +4 -4
- package/dist/{chunk-IPM5WWPW.mjs → chunk-JHLXWI44.mjs} +5 -5
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js +1772 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +3 -3
- package/dist/components/base-copilot-textarea/render-element.js +75 -0
- package/dist/components/base-copilot-textarea/render-element.js.map +1 -0
- package/dist/components/base-copilot-textarea/render-placeholder.js +69 -0
- package/dist/components/base-copilot-textarea/render-placeholder.js.map +1 -0
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js +112 -0
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.js.map +1 -0
- package/dist/components/base-copilot-textarea/use-add-branding-css.js +83 -0
- package/dist/components/base-copilot-textarea/use-add-branding-css.js.map +1 -0
- package/dist/components/copilot-textarea/copilot-textarea.js +2246 -0
- package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -0
- package/dist/components/copilot-textarea/copilot-textarea.mjs +5 -5
- package/dist/components/hovering-toolbar/hovering-editor-provider.js +49 -0
- package/dist/components/hovering-toolbar/hovering-editor-provider.js.map +1 -0
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js +158 -0
- package/dist/components/hovering-toolbar/hovering-toolbar-components.js.map +1 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.js +915 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +622 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +639 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +140 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +639 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -0
- package/dist/components/index.js +2250 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +5 -5
- package/dist/components/manual-ui/chip-with-icon.js +53 -0
- package/dist/components/manual-ui/chip-with-icon.js.map +1 -0
- package/dist/components/source-search-box/source-search-box.js +243 -0
- package/dist/components/source-search-box/source-search-box.js.map +1 -0
- package/dist/components/ui/button.js +118 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/card.js +142 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/command.js +306 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/dialog.js +199 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/label.js +92 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/separator.js +96 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/textarea.js +91 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/context/index.js +19 -0
- package/dist/context/index.js.map +1 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +193 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js +194 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.js.map +1 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js +180 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.js.map +1 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js +167 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.js.map +1 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js +227 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -0
- package/dist/hooks/misc/use-autosize-textarea.js +39 -0
- package/dist/hooks/misc/use-autosize-textarea.js.map +1 -0
- package/dist/index.js +2256 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -6
- package/dist/lib/debouncer.js +76 -0
- package/dist/lib/debouncer.js.map +1 -0
- package/dist/lib/editor-to-text.js +69 -0
- package/dist/lib/editor-to-text.js.map +1 -0
- package/dist/lib/get-text-around-cursor.js +131 -0
- package/dist/lib/get-text-around-cursor.js.map +1 -0
- package/dist/lib/retry.js +43 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/slatejs-edits/add-autocompletions.js +51 -0
- package/dist/lib/slatejs-edits/add-autocompletions.js.map +1 -0
- package/dist/lib/slatejs-edits/clear-autocompletions.js +49 -0
- package/dist/lib/slatejs-edits/clear-autocompletions.js.map +1 -0
- package/dist/lib/slatejs-edits/replace-text.js +53 -0
- package/dist/lib/slatejs-edits/replace-text.js.map +1 -0
- package/dist/lib/slatejs-edits/with-partial-history.js +133 -0
- package/dist/lib/slatejs-edits/with-partial-history.js.map +1 -0
- package/dist/lib/stream-promise-flatten.js +72 -0
- package/dist/lib/stream-promise-flatten.js.map +1 -0
- package/dist/lib/utils.js +101 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/utils.test.js +9 -0
- package/dist/lib/utils.test.js.map +1 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js +19 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.js.map +1 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.js +275 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -0
- package/dist/types/autosuggestions-config/editing-api-config.js +109 -0
- package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -0
- package/dist/types/autosuggestions-config/index.js +331 -0
- package/dist/types/autosuggestions-config/index.js.map +1 -0
- package/dist/types/autosuggestions-config/insertions-api-config.js +103 -0
- package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -0
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.js +99 -0
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.js.map +1 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js +19 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.js.map +1 -0
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js +19 -0
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.js.map +1 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.js +92 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -0
- package/dist/types/base/autosuggestion-state.js +19 -0
- package/dist/types/base/autosuggestion-state.js.map +1 -0
- package/dist/types/base/autosuggestions-bare-function.js +19 -0
- package/dist/types/base/autosuggestions-bare-function.js.map +1 -0
- package/dist/types/base/base-autosuggestions-config.js +38 -0
- package/dist/types/base/base-autosuggestions-config.js.map +1 -0
- package/dist/types/base/base-copilot-textarea-props.js +19 -0
- package/dist/types/base/base-copilot-textarea-props.js.map +1 -0
- package/dist/types/base/custom-editor.js +19 -0
- package/dist/types/base/custom-editor.js.map +1 -0
- package/dist/types/base/editor-autocomplete-state.js +45 -0
- package/dist/types/base/editor-autocomplete-state.js.map +1 -0
- package/dist/types/base/index.js +40 -0
- package/dist/types/base/index.js.map +1 -0
- package/dist/types/html-copilot-textarea-element.js +19 -0
- package/dist/types/html-copilot-textarea-element.js.map +1 -0
- package/dist/types/index.js +333 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +4 -4
- package/tsup.config.ts +1 -1
- /package/dist/{chunk-34D4UIYX.mjs.map → chunk-4ENJ4VF6.mjs.map} +0 -0
- /package/dist/{chunk-IPM5WWPW.mjs.map → chunk-JHLXWI44.mjs.map} +0 -0
package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js
ADDED
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __objRest = (source, exclude) => {
|
|
23
|
+
var target = {};
|
|
24
|
+
for (var prop in source)
|
|
25
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
+
target[prop] = source[prop];
|
|
27
|
+
if (source != null && __getOwnPropSymbols)
|
|
28
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
+
target[prop] = source[prop];
|
|
31
|
+
}
|
|
32
|
+
return target;
|
|
33
|
+
};
|
|
34
|
+
var __export = (target, all) => {
|
|
35
|
+
for (var name in all)
|
|
36
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
37
|
+
};
|
|
38
|
+
var __copyProps = (to, from, except, desc) => {
|
|
39
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
40
|
+
for (let key of __getOwnPropNames(from))
|
|
41
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
42
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
43
|
+
}
|
|
44
|
+
return to;
|
|
45
|
+
};
|
|
46
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
47
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
48
|
+
mod
|
|
49
|
+
));
|
|
50
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
51
|
+
var __async = (__this, __arguments, generator) => {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
var fulfilled = (value) => {
|
|
54
|
+
try {
|
|
55
|
+
step(generator.next(value));
|
|
56
|
+
} catch (e) {
|
|
57
|
+
reject(e);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
var rejected = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
step(generator.throw(value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
68
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
|
|
73
|
+
var hovering_insertion_prompt_box_exports = {};
|
|
74
|
+
__export(hovering_insertion_prompt_box_exports, {
|
|
75
|
+
HoveringInsertionPromptBox: () => HoveringInsertionPromptBox
|
|
76
|
+
});
|
|
77
|
+
module.exports = __toCommonJS(hovering_insertion_prompt_box_exports);
|
|
78
|
+
|
|
79
|
+
// src/hooks/misc/use-autosize-textarea.tsx
|
|
80
|
+
var import_react = require("react");
|
|
81
|
+
var useAutosizeTextArea = (textAreaRef, value) => {
|
|
82
|
+
(0, import_react.useEffect)(() => {
|
|
83
|
+
if (textAreaRef.current !== null) {
|
|
84
|
+
textAreaRef.current.style.height = "0px";
|
|
85
|
+
const scrollHeight = textAreaRef.current.scrollHeight;
|
|
86
|
+
textAreaRef.current.style.height = scrollHeight + "px";
|
|
87
|
+
}
|
|
88
|
+
}, [textAreaRef, value]);
|
|
89
|
+
};
|
|
90
|
+
var use_autosize_textarea_default = useAutosizeTextArea;
|
|
91
|
+
|
|
92
|
+
// src/components/source-search-box/source-search-box.tsx
|
|
93
|
+
var import_react2 = require("react");
|
|
94
|
+
|
|
95
|
+
// src/components/ui/command.tsx
|
|
96
|
+
var React = __toESM(require("react"));
|
|
97
|
+
var import_cmdk = require("cmdk");
|
|
98
|
+
|
|
99
|
+
// src/lib/utils.ts
|
|
100
|
+
var import_clsx = require("clsx");
|
|
101
|
+
var import_nanoid = require("nanoid");
|
|
102
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
103
|
+
function cn(...inputs) {
|
|
104
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
105
|
+
}
|
|
106
|
+
var nanoid = (0, import_nanoid.customAlphabet)(
|
|
107
|
+
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
|
108
|
+
7
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// src/components/ui/command.tsx
|
|
112
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
113
|
+
"use client";
|
|
114
|
+
var Command = React.forwardRef((_a, ref) => {
|
|
115
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command, __spreadValues({
|
|
117
|
+
ref,
|
|
118
|
+
className: cn(
|
|
119
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
120
|
+
className
|
|
121
|
+
)
|
|
122
|
+
}, props));
|
|
123
|
+
});
|
|
124
|
+
Command.displayName = import_cmdk.Command.displayName;
|
|
125
|
+
var CommandInput = React.forwardRef((_a, ref) => {
|
|
126
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
128
|
+
className: "flex items-center border-b px-3",
|
|
129
|
+
"cmdk-input-wrapper": "",
|
|
130
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.Input, __spreadValues({
|
|
131
|
+
ref,
|
|
132
|
+
className: cn(
|
|
133
|
+
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
134
|
+
className
|
|
135
|
+
)
|
|
136
|
+
}, props))
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
140
|
+
var CommandList = React.forwardRef((_a, ref) => {
|
|
141
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.List, __spreadValues({
|
|
143
|
+
ref,
|
|
144
|
+
className: cn(
|
|
145
|
+
"max-h-[300px] overflow-y-auto overflow-x-hidden pb-2",
|
|
146
|
+
className
|
|
147
|
+
)
|
|
148
|
+
}, props));
|
|
149
|
+
});
|
|
150
|
+
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
151
|
+
var CommandEmpty = React.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.Empty, __spreadValues({
|
|
152
|
+
ref,
|
|
153
|
+
className: "py-6 text-center text-sm"
|
|
154
|
+
}, props)));
|
|
155
|
+
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
156
|
+
var CommandGroup = React.forwardRef((_a, ref) => {
|
|
157
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.Group, __spreadValues({
|
|
159
|
+
ref,
|
|
160
|
+
className: cn(
|
|
161
|
+
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
162
|
+
className
|
|
163
|
+
)
|
|
164
|
+
}, props));
|
|
165
|
+
});
|
|
166
|
+
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
167
|
+
var CommandSeparator = React.forwardRef((_a, ref) => {
|
|
168
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.Separator, __spreadValues({
|
|
170
|
+
ref,
|
|
171
|
+
className: cn("-mx-1 h-px bg-border", className)
|
|
172
|
+
}, props));
|
|
173
|
+
});
|
|
174
|
+
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
175
|
+
var CommandItem = React.forwardRef((_a, ref) => {
|
|
176
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cmdk.Command.Item, __spreadValues({
|
|
178
|
+
ref,
|
|
179
|
+
className: cn(
|
|
180
|
+
"relative flex cursor-default select-none items-center rounded-sm text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
181
|
+
className
|
|
182
|
+
)
|
|
183
|
+
}, props));
|
|
184
|
+
});
|
|
185
|
+
CommandItem.displayName = import_cmdk.Command.Item.displayName;
|
|
186
|
+
var CommandShortcut = (_a) => {
|
|
187
|
+
var _b = _a, {
|
|
188
|
+
className
|
|
189
|
+
} = _b, props = __objRest(_b, [
|
|
190
|
+
"className"
|
|
191
|
+
]);
|
|
192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", __spreadValues({
|
|
193
|
+
className: cn(
|
|
194
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
|
195
|
+
className
|
|
196
|
+
)
|
|
197
|
+
}, props));
|
|
198
|
+
};
|
|
199
|
+
CommandShortcut.displayName = "CommandShortcut";
|
|
200
|
+
|
|
201
|
+
// src/components/source-search-box/source-search-box.tsx
|
|
202
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
203
|
+
function SourceSearchBox(props) {
|
|
204
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)("");
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Command, {
|
|
206
|
+
className: "rounded-lg border shadow-md",
|
|
207
|
+
value: selectedValue,
|
|
208
|
+
onValueChange: (value) => {
|
|
209
|
+
setSelectedValue(value);
|
|
210
|
+
},
|
|
211
|
+
filter: (value, search) => {
|
|
212
|
+
if (props.searchTerm === "")
|
|
213
|
+
return 1;
|
|
214
|
+
if (value.startsWith(props.searchTerm))
|
|
215
|
+
return 1;
|
|
216
|
+
return 0;
|
|
217
|
+
},
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CommandInput, {
|
|
220
|
+
value: props.searchTerm,
|
|
221
|
+
className: "rounded-t-lg hidden",
|
|
222
|
+
placeholder: "Search for a command..."
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(CommandList, {
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CommandEmpty, {
|
|
227
|
+
children: "No results found."
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CommandGroup, {
|
|
230
|
+
heading: "Available resources",
|
|
231
|
+
children: props.suggestedFiles.map((filePointer) => {
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CommandItem, {
|
|
233
|
+
value: filePointer.name,
|
|
234
|
+
onSelect: (value) => {
|
|
235
|
+
props.onSelectedFile(filePointer);
|
|
236
|
+
},
|
|
237
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", {
|
|
238
|
+
className: " px-3 flex flex-row gap-1 items-center",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Logo, {
|
|
241
|
+
width: "20px",
|
|
242
|
+
height: "20px",
|
|
243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("img", {
|
|
244
|
+
src: filePointer.iconImageUri,
|
|
245
|
+
alt: filePointer.sourceApplication,
|
|
246
|
+
className: "w-full h-full"
|
|
247
|
+
})
|
|
248
|
+
}),
|
|
249
|
+
filePointer.name
|
|
250
|
+
]
|
|
251
|
+
})
|
|
252
|
+
}, `word-${filePointer.sourceApplication}.${filePointer.name}`);
|
|
253
|
+
})
|
|
254
|
+
}),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CommandSeparator, {})
|
|
256
|
+
]
|
|
257
|
+
})
|
|
258
|
+
]
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function Logo({
|
|
262
|
+
children,
|
|
263
|
+
width,
|
|
264
|
+
height
|
|
265
|
+
}) {
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", {
|
|
267
|
+
className: "flex items-center justify-center",
|
|
268
|
+
style: { width, height },
|
|
269
|
+
children
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
// src/components/ui/button.tsx
|
|
274
|
+
var React2 = __toESM(require("react"));
|
|
275
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
276
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
277
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
278
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
279
|
+
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
280
|
+
{
|
|
281
|
+
variants: {
|
|
282
|
+
variant: {
|
|
283
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
284
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
285
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
286
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
287
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
288
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
289
|
+
},
|
|
290
|
+
size: {
|
|
291
|
+
default: "h-10 px-4 py-2",
|
|
292
|
+
sm: "h-9 rounded-md px-3",
|
|
293
|
+
lg: "h-11 rounded-md px-8",
|
|
294
|
+
icon: "h-10 w-10"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
defaultVariants: {
|
|
298
|
+
variant: "default",
|
|
299
|
+
size: "default"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
var Button = React2.forwardRef(
|
|
304
|
+
(_a, ref) => {
|
|
305
|
+
var _b = _a, { className, variant, size, asChild = false } = _b, props = __objRest(_b, ["className", "variant", "size", "asChild"]);
|
|
306
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Comp, __spreadValues({
|
|
308
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
309
|
+
ref
|
|
310
|
+
}, props));
|
|
311
|
+
}
|
|
312
|
+
);
|
|
313
|
+
Button.displayName = "Button";
|
|
314
|
+
|
|
315
|
+
// src/components/ui/label.tsx
|
|
316
|
+
var React3 = __toESM(require("react"));
|
|
317
|
+
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
318
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
319
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
320
|
+
"use client";
|
|
321
|
+
var labelVariants = (0, import_class_variance_authority2.cva)(
|
|
322
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
323
|
+
);
|
|
324
|
+
var Label = React3.forwardRef((_a, ref) => {
|
|
325
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LabelPrimitive.Root, __spreadValues({
|
|
327
|
+
ref,
|
|
328
|
+
className: cn(labelVariants(), className)
|
|
329
|
+
}, props));
|
|
330
|
+
});
|
|
331
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
332
|
+
|
|
333
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
334
|
+
var import_react3 = require("react");
|
|
335
|
+
|
|
336
|
+
// src/lib/stream-promise-flatten.ts
|
|
337
|
+
function streamPromiseFlatten(promise) {
|
|
338
|
+
return new ReadableStream({
|
|
339
|
+
start(controller) {
|
|
340
|
+
return __async(this, null, function* () {
|
|
341
|
+
try {
|
|
342
|
+
const stream = yield promise;
|
|
343
|
+
const reader = stream.getReader();
|
|
344
|
+
while (true) {
|
|
345
|
+
const { done, value } = yield reader.read();
|
|
346
|
+
if (done) {
|
|
347
|
+
controller.close();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
controller.enqueue(value);
|
|
351
|
+
}
|
|
352
|
+
} catch (error) {
|
|
353
|
+
controller.error(error);
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
361
|
+
var import_react_core = require("@copilotkit/react-core");
|
|
362
|
+
|
|
363
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
|
|
364
|
+
var import_Chip = __toESM(require("@mui/material/Chip"));
|
|
365
|
+
var import_Avatar = __toESM(require("@mui/material/Avatar"));
|
|
366
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
367
|
+
var IncludedFilesPreview = ({
|
|
368
|
+
includedFiles,
|
|
369
|
+
setIncludedFiles
|
|
370
|
+
}) => {
|
|
371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", {
|
|
372
|
+
className: "flex flex-col gap-2 mt-2",
|
|
373
|
+
children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, {
|
|
375
|
+
className: "",
|
|
376
|
+
children: "Included context:"
|
|
377
|
+
}),
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", {
|
|
379
|
+
className: "flex flex-wrap gap-2",
|
|
380
|
+
children: includedFiles.map((filePointer, index) => {
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FileChipPreview, {
|
|
382
|
+
filePointer,
|
|
383
|
+
onDelete: () => {
|
|
384
|
+
setIncludedFiles(
|
|
385
|
+
(prev) => prev.filter((fp) => fp !== filePointer)
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
}, `file-${filePointer.sourceApplication}.${filePointer.name}`);
|
|
389
|
+
})
|
|
390
|
+
})
|
|
391
|
+
]
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
var FileChipPreview = ({
|
|
395
|
+
filePointer,
|
|
396
|
+
onDelete
|
|
397
|
+
}) => {
|
|
398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Chip.default, {
|
|
399
|
+
label: filePointer.name,
|
|
400
|
+
onDelete,
|
|
401
|
+
avatar: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Avatar.default, {
|
|
402
|
+
sx: { backgroundColor: "transparent" }
|
|
403
|
+
})
|
|
404
|
+
});
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx
|
|
408
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
409
|
+
var HoveringInsertionPromptBoxCore = ({
|
|
410
|
+
performInsertion,
|
|
411
|
+
state,
|
|
412
|
+
insertionOrEditingFunction,
|
|
413
|
+
contextCategories
|
|
414
|
+
}) => {
|
|
415
|
+
const { getDocumentsContext } = (0, import_react3.useContext)(import_react_core.CopilotContext);
|
|
416
|
+
const [editSuggestion, setEditSuggestion] = (0, import_react3.useState)("");
|
|
417
|
+
const [suggestionIsLoading, setSuggestionIsLoading] = (0, import_react3.useState)(false);
|
|
418
|
+
const [adjustmentPrompt, setAdjustmentPrompt] = (0, import_react3.useState)("");
|
|
419
|
+
const [generatingSuggestion, setGeneratingSuggestion] = (0, import_react3.useState)(null);
|
|
420
|
+
const adjustmentTextAreaRef = (0, import_react3.useRef)(null);
|
|
421
|
+
const suggestionTextAreaRef = (0, import_react3.useRef)(null);
|
|
422
|
+
const [filePointers, setFilePointers] = (0, import_react3.useState)([]);
|
|
423
|
+
const [suggestedFiles, setSuggestedFiles] = (0, import_react3.useState)([]);
|
|
424
|
+
(0, import_react3.useEffect)(() => {
|
|
425
|
+
setSuggestedFiles(getDocumentsContext(contextCategories));
|
|
426
|
+
}, [contextCategories, getDocumentsContext]);
|
|
427
|
+
use_autosize_textarea_default(suggestionTextAreaRef, editSuggestion || "");
|
|
428
|
+
use_autosize_textarea_default(adjustmentTextAreaRef, adjustmentPrompt || "");
|
|
429
|
+
(0, import_react3.useEffect)(() => {
|
|
430
|
+
var _a;
|
|
431
|
+
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
432
|
+
}, []);
|
|
433
|
+
(0, import_react3.useEffect)(() => {
|
|
434
|
+
if (!generatingSuggestion) {
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (generatingSuggestion.locked) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
setEditSuggestion("");
|
|
441
|
+
const reader = generatingSuggestion.getReader();
|
|
442
|
+
const read = () => __async(void 0, null, function* () {
|
|
443
|
+
setSuggestionIsLoading(true);
|
|
444
|
+
while (true) {
|
|
445
|
+
const { done, value } = yield reader.read();
|
|
446
|
+
if (done) {
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
setEditSuggestion((prev) => {
|
|
450
|
+
const newSuggestion = prev + value;
|
|
451
|
+
if (suggestionTextAreaRef.current) {
|
|
452
|
+
suggestionTextAreaRef.current.scrollTop = suggestionTextAreaRef.current.scrollHeight;
|
|
453
|
+
}
|
|
454
|
+
return newSuggestion;
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
setSuggestionIsLoading(false);
|
|
458
|
+
});
|
|
459
|
+
read();
|
|
460
|
+
return () => {
|
|
461
|
+
const releaseLockIfNotClosed = () => __async(void 0, null, function* () {
|
|
462
|
+
try {
|
|
463
|
+
yield reader.closed;
|
|
464
|
+
} catch (e) {
|
|
465
|
+
reader.releaseLock();
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
releaseLockIfNotClosed();
|
|
469
|
+
};
|
|
470
|
+
}, [generatingSuggestion]);
|
|
471
|
+
const beginGeneratingAdjustment = (0, import_react3.useCallback)(() => __async(void 0, null, function* () {
|
|
472
|
+
if (!adjustmentPrompt.trim()) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
let modificationState = state.editorState;
|
|
476
|
+
if (editSuggestion !== "") {
|
|
477
|
+
modificationState.selectedText = editSuggestion;
|
|
478
|
+
}
|
|
479
|
+
const adjustmentSuggestionTextStreamPromise = insertionOrEditingFunction(
|
|
480
|
+
modificationState,
|
|
481
|
+
adjustmentPrompt,
|
|
482
|
+
filePointers,
|
|
483
|
+
new AbortController().signal
|
|
484
|
+
);
|
|
485
|
+
const adjustmentSuggestionTextStream = streamPromiseFlatten(
|
|
486
|
+
adjustmentSuggestionTextStreamPromise
|
|
487
|
+
);
|
|
488
|
+
setGeneratingSuggestion(adjustmentSuggestionTextStream);
|
|
489
|
+
}), [
|
|
490
|
+
adjustmentPrompt,
|
|
491
|
+
editSuggestion,
|
|
492
|
+
state.editorState,
|
|
493
|
+
insertionOrEditingFunction,
|
|
494
|
+
filePointers
|
|
495
|
+
]);
|
|
496
|
+
const isLoading = suggestionIsLoading;
|
|
497
|
+
const textToEdit = editSuggestion || state.editorState.selectedText;
|
|
498
|
+
const adjustmentLabel = textToEdit === "" ? "Describe the text you want to insert" : "Describe adjustments to the suggested text";
|
|
499
|
+
const placeholder = textToEdit === "" ? "e.g. 'summarize the client's top 3 pain-points from @CallTranscript'" : "e.g. 'make it more formal', 'be more specific', ...";
|
|
500
|
+
const AdjustmentPromptComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, {
|
|
503
|
+
className: "",
|
|
504
|
+
children: adjustmentLabel
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
|
|
507
|
+
className: "relative w-full flex items-center",
|
|
508
|
+
children: [
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("textarea", {
|
|
510
|
+
disabled: suggestionIsLoading,
|
|
511
|
+
ref: adjustmentTextAreaRef,
|
|
512
|
+
value: adjustmentPrompt,
|
|
513
|
+
onChange: (e) => setAdjustmentPrompt(e.target.value),
|
|
514
|
+
onKeyDown: (e) => {
|
|
515
|
+
if (e.key === "Enter" && e.shiftKey) {
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
setAdjustmentPrompt(adjustmentPrompt + "\n");
|
|
518
|
+
} else if (e.key === "Enter") {
|
|
519
|
+
e.preventDefault();
|
|
520
|
+
beginGeneratingAdjustment();
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
placeholder,
|
|
524
|
+
style: { minHeight: "3rem" },
|
|
525
|
+
className: "w-full bg-slate-100 h-auto h-min-14 text-sm p-2 rounded-md resize-none overflow-visible focus:outline-none focus:ring-0 focus:border-non pr-[3rem]",
|
|
526
|
+
rows: 1
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", {
|
|
529
|
+
onClick: beginGeneratingAdjustment,
|
|
530
|
+
className: "absolute right-2 bg-blue-500 text-white w-8 h-8 rounded-full flex items-center justify-center",
|
|
531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", {
|
|
532
|
+
className: "material-icons",
|
|
533
|
+
children: "arrow_forward"
|
|
534
|
+
})
|
|
535
|
+
})
|
|
536
|
+
]
|
|
537
|
+
})
|
|
538
|
+
]
|
|
539
|
+
});
|
|
540
|
+
const SuggestionComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, {
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
|
|
543
|
+
className: "flex justify-between items-end w-full",
|
|
544
|
+
children: [
|
|
545
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Label, {
|
|
546
|
+
className: "mt-4",
|
|
547
|
+
children: "Suggested:"
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
550
|
+
className: "ml-auto",
|
|
551
|
+
children: isLoading && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
552
|
+
className: "flex justify-center items-center",
|
|
553
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
554
|
+
className: "inline-block h-4 w-4 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
|
|
555
|
+
role: "status",
|
|
556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
|
|
557
|
+
className: "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",
|
|
558
|
+
children: "Loading..."
|
|
559
|
+
})
|
|
560
|
+
})
|
|
561
|
+
})
|
|
562
|
+
})
|
|
563
|
+
]
|
|
564
|
+
}),
|
|
565
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("textarea", {
|
|
566
|
+
ref: suggestionTextAreaRef,
|
|
567
|
+
value: editSuggestion,
|
|
568
|
+
disabled: suggestionIsLoading,
|
|
569
|
+
onChange: (e) => setEditSuggestion(e.target.value),
|
|
570
|
+
className: "w-full text-base p-2 border border-gray-300 rounded-md resize-none bg-green-50",
|
|
571
|
+
style: { overflow: "auto", maxHeight: "10em" }
|
|
572
|
+
})
|
|
573
|
+
]
|
|
574
|
+
});
|
|
575
|
+
const SubmitComponent = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
|
|
576
|
+
className: "flex w-full gap-4 justify-start",
|
|
577
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Button, {
|
|
578
|
+
className: " bg-green-700 text-white",
|
|
579
|
+
onClick: () => {
|
|
580
|
+
performInsertion(editSuggestion);
|
|
581
|
+
},
|
|
582
|
+
children: [
|
|
583
|
+
"Insert ",
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("i", {
|
|
585
|
+
className: "material-icons",
|
|
586
|
+
children: "check"
|
|
587
|
+
})
|
|
588
|
+
]
|
|
589
|
+
})
|
|
590
|
+
});
|
|
591
|
+
const sourceSearchCandidate = adjustmentPrompt.split(" ").pop();
|
|
592
|
+
const sourceSearchWord = (sourceSearchCandidate == null ? void 0 : sourceSearchCandidate.startsWith("@")) ? sourceSearchCandidate.slice(1) : void 0;
|
|
593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", {
|
|
594
|
+
className: "w-full flex flex-col items-start relative gap-2",
|
|
595
|
+
children: [
|
|
596
|
+
AdjustmentPromptComponent,
|
|
597
|
+
filePointers.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IncludedFilesPreview, {
|
|
598
|
+
includedFiles: filePointers,
|
|
599
|
+
setIncludedFiles: setFilePointers
|
|
600
|
+
}),
|
|
601
|
+
sourceSearchWord !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SourceSearchBox, {
|
|
602
|
+
searchTerm: sourceSearchWord,
|
|
603
|
+
suggestedFiles,
|
|
604
|
+
onSelectedFile: (filePointer) => {
|
|
605
|
+
var _a;
|
|
606
|
+
setAdjustmentPrompt(
|
|
607
|
+
adjustmentPrompt.replace(new RegExp(`@${sourceSearchWord}$`), "")
|
|
608
|
+
);
|
|
609
|
+
setFilePointers((prev) => [...prev, filePointer]);
|
|
610
|
+
(_a = adjustmentTextAreaRef.current) == null ? void 0 : _a.focus();
|
|
611
|
+
}
|
|
612
|
+
}),
|
|
613
|
+
generatingSuggestion ? SuggestionComponent : null,
|
|
614
|
+
generatingSuggestion ? SubmitComponent : null
|
|
615
|
+
]
|
|
616
|
+
});
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
// src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
|
|
620
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
621
|
+
var HoveringInsertionPromptBox = (props) => {
|
|
622
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
623
|
+
className: "flex flex-col justify-center items-center space-y-4 rounded-md border shadow-lg p-4 border-gray- bg-white",
|
|
624
|
+
style: { width: "35rem" },
|
|
625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(HoveringInsertionPromptBoxCore, {
|
|
626
|
+
state: {
|
|
627
|
+
editorState: props.editorState
|
|
628
|
+
},
|
|
629
|
+
insertionOrEditingFunction: props.apiConfig.insertionOrEditingFunction,
|
|
630
|
+
performInsertion: props.performInsertion,
|
|
631
|
+
contextCategories: props.contextCategories
|
|
632
|
+
})
|
|
633
|
+
});
|
|
634
|
+
};
|
|
635
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
636
|
+
0 && (module.exports = {
|
|
637
|
+
HoveringInsertionPromptBox
|
|
638
|
+
});
|
|
639
|
+
//# sourceMappingURL=hovering-insertion-prompt-box.js.map
|