@copilotkit/react-textarea 0.18.0 → 0.19.0-alpha.1
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 +303 -189
- package/CHANGELOG.md +19 -0
- package/dist/chunk-2NURR2DX.mjs +47 -0
- package/dist/chunk-2NURR2DX.mjs.map +1 -0
- package/dist/chunk-3YJ63D5D.mjs +106 -0
- package/dist/chunk-3YJ63D5D.mjs.map +1 -0
- package/dist/chunk-4S5ZJH3I.mjs +18 -0
- package/dist/chunk-4S5ZJH3I.mjs.map +1 -0
- package/dist/chunk-55EGOC5T.mjs +87 -0
- package/dist/chunk-55EGOC5T.mjs.map +1 -0
- package/dist/{chunk-3A2CNIG5.mjs → chunk-5ARCOTW3.mjs} +8 -5
- package/dist/chunk-5ARCOTW3.mjs.map +1 -0
- package/dist/chunk-5EJ5XOGP.mjs +22 -0
- package/dist/chunk-5EJ5XOGP.mjs.map +1 -0
- package/dist/chunk-5FO6ISW4.mjs +3 -0
- package/dist/{chunk-5GGCWNTT.mjs → chunk-5SL5L4VS.mjs} +67 -29
- package/dist/chunk-5SL5L4VS.mjs.map +1 -0
- package/dist/{chunk-JWN2VEE3.mjs → chunk-A2RRLD23.mjs} +13 -12
- package/dist/chunk-A2RRLD23.mjs.map +1 -0
- package/dist/chunk-CDB7HFCY.mjs +65 -0
- package/dist/chunk-CDB7HFCY.mjs.map +1 -0
- package/dist/{chunk-MFJNLKRC.mjs → chunk-D7SEV5PR.mjs} +4 -3
- package/dist/chunk-D7SEV5PR.mjs.map +1 -0
- package/dist/chunk-HAFHLU4N.mjs +55 -0
- package/dist/chunk-HAFHLU4N.mjs.map +1 -0
- package/dist/chunk-ITZHK3YV.mjs +477 -0
- package/dist/chunk-ITZHK3YV.mjs.map +1 -0
- package/dist/{chunk-3UQM3NLM.mjs → chunk-IXJ2HCOA.mjs} +42 -7
- package/dist/chunk-IXJ2HCOA.mjs.map +1 -0
- package/dist/{chunk-UW3ITU2Y.mjs → chunk-JAFCXEPU.mjs} +1 -1
- package/dist/chunk-JAFCXEPU.mjs.map +1 -0
- package/dist/chunk-KDFCAQGV.mjs +44 -0
- package/dist/chunk-KDFCAQGV.mjs.map +1 -0
- package/dist/chunk-L7VVZH4Q.mjs +3 -0
- package/dist/chunk-ND5PXTAW.mjs +17 -0
- package/dist/chunk-ND5PXTAW.mjs.map +1 -0
- package/dist/chunk-O5OWT5GE.mjs +114 -0
- package/dist/chunk-O5OWT5GE.mjs.map +1 -0
- package/dist/chunk-OD7ZMOVE.mjs +45 -0
- package/dist/chunk-OD7ZMOVE.mjs.map +1 -0
- package/dist/chunk-OM5WQQOU.mjs +47 -0
- package/dist/chunk-OM5WQQOU.mjs.map +1 -0
- package/dist/chunk-QL2GYGG5.mjs +19 -0
- package/dist/chunk-QL2GYGG5.mjs.map +1 -0
- package/dist/chunk-RPDVSCLO.mjs +107 -0
- package/dist/chunk-RPDVSCLO.mjs.map +1 -0
- package/dist/{chunk-HZGSG7ST.mjs → chunk-UHD44NC5.mjs} +10 -5
- package/dist/chunk-UHD44NC5.mjs.map +1 -0
- package/dist/chunk-VBIJPE3H.mjs +108 -0
- package/dist/chunk-VBIJPE3H.mjs.map +1 -0
- package/dist/chunk-XDT7BF3V.mjs +81 -0
- package/dist/chunk-XDT7BF3V.mjs.map +1 -0
- package/dist/chunk-XHUMROEY.mjs +91 -0
- package/dist/chunk-XHUMROEY.mjs.map +1 -0
- package/dist/{chunk-LWVCQYWV.mjs → chunk-YQU7WG7T.mjs} +2 -2
- package/dist/chunk-YTOPHPSG.mjs +45 -0
- package/dist/chunk-YTOPHPSG.mjs.map +1 -0
- package/dist/chunk-YW3REYX6.mjs +23 -0
- package/dist/chunk-YW3REYX6.mjs.map +1 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.d.ts +3 -5
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +21 -7
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.d.ts +6 -0
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +5 -0
- package/dist/components/copilot-textarea/copilot-textarea.d.ts +13 -10
- package/dist/components/copilot-textarea/copilot-textarea.mjs +31 -12
- package/dist/components/hovering-toolbar/hovering-editor-provider.d.ts +13 -0
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +4 -0
- package/dist/components/hovering-toolbar/hovering-toolbar-components.d.ts +18 -0
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +4 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.d.ts +8 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +17 -0
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.d.ts +12 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +12 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.d.ts +3 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +13 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-pre-suggestion.d.ts +16 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-pre-suggestion.mjs +5 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-pre-suggestion.mjs.map +1 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-suggestion-appearing.d.ts +37 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-suggestion-appearing.mjs +10 -0
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/mode-suggestion-appearing.mjs.map +1 -0
- package/dist/components/index.d.ts +9 -4
- package/dist/components/index.mjs +31 -12
- package/dist/components/manual-ui/chip-with-icon.d.ts +10 -0
- package/dist/components/manual-ui/chip-with-icon.mjs +29 -0
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -0
- package/dist/components/source-search-box/source-search-box.d.ts +17 -0
- package/dist/components/source-search-box/source-search-box.mjs +10 -0
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -0
- package/dist/components/ui/button.d.ts +14 -0
- package/dist/components/ui/button.mjs +5 -0
- package/dist/components/ui/button.mjs.map +1 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.mjs +63 -0
- package/dist/components/ui/card.mjs.map +1 -0
- package/dist/components/ui/command.d.ts +48 -0
- package/dist/components/ui/command.mjs +6 -0
- package/dist/components/ui/command.mjs.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.mjs +5 -0
- package/dist/components/ui/dialog.mjs.map +1 -0
- package/dist/components/ui/label.d.ts +8 -0
- package/dist/components/ui/label.mjs +5 -0
- package/dist/components/ui/label.mjs.map +1 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.mjs +26 -0
- package/dist/components/ui/separator.mjs.map +1 -0
- package/dist/components/ui/textarea.d.ts +7 -0
- package/dist/components/ui/textarea.mjs +22 -0
- package/dist/components/ui/textarea.mjs.map +1 -0
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +2 -2
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.d.ts +2 -2
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +2 -2
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.d.ts +5 -7
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +2 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.d.ts +23 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +5 -0
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -0
- package/dist/hooks/misc/use-autosize-textarea.d.ts +5 -0
- package/dist/hooks/misc/use-autosize-textarea.mjs +4 -0
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -0
- package/dist/index.css +674 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.mjs +31 -12
- package/dist/lib/editor-to-text.mjs +1 -42
- package/dist/lib/editor-to-text.mjs.map +1 -1
- package/dist/lib/get-text-around-cursor.d.ts +10 -3
- package/dist/lib/get-text-around-cursor.mjs +1 -1
- package/dist/lib/retry.d.ts +3 -0
- package/dist/lib/retry.mjs +4 -0
- package/dist/lib/retry.mjs.map +1 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.d.ts +25 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +3 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.d.ts +20 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +10 -0
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -0
- package/dist/types/autosuggestions-config/editing-api-config.d.ts +17 -0
- package/dist/types/autosuggestions-config/editing-api-config.mjs +5 -0
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -0
- package/dist/types/autosuggestions-config/index.d.ts +10 -0
- package/dist/types/autosuggestions-config/index.mjs +11 -0
- package/dist/types/autosuggestions-config/index.mjs.map +1 -0
- package/dist/types/autosuggestions-config/insertions-api-config.d.ts +17 -0
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +5 -0
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -0
- package/dist/types/{standard-autosuggestions → autosuggestions-config/subtypes}/chatlike-api-endpoint.d.ts +7 -4
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +4 -0
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.d.ts +3 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +3 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -0
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.d.ts +17 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +5 -0
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -0
- package/dist/types/base/autosuggestions-bare-function.d.ts +16 -2
- package/dist/types/base/base-autosuggestions-config.d.ts +5 -1
- package/dist/types/base/base-autosuggestions-config.mjs +1 -1
- package/dist/types/base/base-copilot-textarea-props.d.ts +3 -1
- package/dist/types/base/editor-autocomplete-state.mjs +1 -1
- package/dist/types/base/index.mjs +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.mjs +7 -4
- package/package.json +19 -5
- package/src/components/base-copilot-textarea/base-copilot-textarea.tsx +64 -13
- package/src/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.tsx +61 -0
- package/src/components/copilot-textarea/copilot-textarea.tsx +29 -17
- package/src/components/hovering-toolbar/hovering-editor-provider.tsx +29 -0
- package/src/components/hovering-toolbar/hovering-toolbar-components.tsx +115 -0
- package/src/components/hovering-toolbar/hovering-toolbar.tsx +156 -0
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx +73 -0
- package/src/components/hovering-toolbar/text-insertion-prompt-box/index.ts +2 -0
- package/src/components/hovering-toolbar/text-insertion-prompt-box/mode-pre-suggestion.tsx +83 -0
- package/src/components/hovering-toolbar/text-insertion-prompt-box/mode-suggestion-appearing.tsx +410 -0
- package/src/components/manual-ui/chip-with-icon.tsx +28 -0
- package/src/components/source-search-box/source-search-box.tsx +133 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/card.tsx +86 -0
- package/src/components/ui/command.tsx +155 -0
- package/src/components/ui/dialog.tsx +123 -0
- package/src/components/ui/label.tsx +26 -0
- package/src/components/ui/separator.tsx +31 -0
- package/src/components/ui/textarea.tsx +24 -0
- package/src/hooks/base-copilot-textarea-implementation/use-autosuggestions.ts +10 -3
- package/src/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.tsx +29 -44
- package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +150 -0
- package/src/hooks/misc/use-autosize-textarea.tsx +21 -0
- package/src/lib/get-text-around-cursor.ts +71 -6
- package/src/lib/retry.tsx +23 -0
- package/src/styles.css +2 -0
- package/src/types/autosuggestions-config/autosuggestions-config-user-specified.tsx +27 -0
- package/src/types/autosuggestions-config/autosuggestions-config.tsx +43 -0
- package/src/types/autosuggestions-config/editing-api-config.tsx +102 -0
- package/src/types/autosuggestions-config/index.ts +11 -0
- package/src/types/autosuggestions-config/insertions-api-config.tsx +95 -0
- package/src/types/{standard-autosuggestions → autosuggestions-config/subtypes}/chatlike-api-endpoint.tsx +19 -7
- package/src/types/autosuggestions-config/subtypes/make-system-prompt.ts +4 -0
- package/src/types/{standard-autosuggestions/autosuggestions-config.tsx → autosuggestions-config/suggestions-api-config.tsx} +12 -23
- package/src/types/base/autosuggestions-bare-function.ts +24 -2
- package/src/types/base/base-autosuggestions-config.tsx +7 -2
- package/src/types/base/base-copilot-textarea-props.tsx +3 -1
- package/src/types/base/editor-autocomplete-state.ts +1 -0
- package/src/types/index.ts +1 -1
- package/tailwind.config.js +2 -0
- package/dist/chunk-3A2CNIG5.mjs.map +0 -1
- package/dist/chunk-3UQM3NLM.mjs.map +0 -1
- package/dist/chunk-5GGCWNTT.mjs.map +0 -1
- package/dist/chunk-BLRD23HM.mjs +0 -32
- package/dist/chunk-BLRD23HM.mjs.map +0 -1
- package/dist/chunk-BTAUKCBN.mjs +0 -60
- package/dist/chunk-BTAUKCBN.mjs.map +0 -1
- package/dist/chunk-HZGSG7ST.mjs.map +0 -1
- package/dist/chunk-JWN2VEE3.mjs.map +0 -1
- package/dist/chunk-MFJNLKRC.mjs.map +0 -1
- package/dist/chunk-SL4J5HMW.mjs +0 -3
- package/dist/chunk-UW3ITU2Y.mjs.map +0 -1
- package/dist/types/standard-autosuggestions/autosuggestions-config.d.ts +0 -19
- package/dist/types/standard-autosuggestions/autosuggestions-config.mjs +0 -6
- package/dist/types/standard-autosuggestions/chatlike-api-endpoint.mjs +0 -4
- package/dist/types/standard-autosuggestions/index.d.ts +0 -4
- package/dist/types/standard-autosuggestions/index.mjs +0 -8
- package/src/types/standard-autosuggestions/index.ts +0 -14
- /package/dist/{chunk-SL4J5HMW.mjs.map → chunk-5FO6ISW4.mjs.map} +0 -0
- /package/dist/{types/standard-autosuggestions/autosuggestions-config.mjs.map → chunk-L7VVZH4Q.mjs.map} +0 -0
- /package/dist/{chunk-LWVCQYWV.mjs.map → chunk-YQU7WG7T.mjs.map} +0 -0
- /package/dist/{types/standard-autosuggestions/chatlike-api-endpoint.mjs.map → components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map} +0 -0
- /package/dist/{types/standard-autosuggestions/index.mjs.map → components/hovering-toolbar/hovering-editor-provider.mjs.map} +0 -0
- /package/dist/{types/standard-autosuggestions/minimal-chat-gpt-message.mjs.map → components/hovering-toolbar/hovering-toolbar-components.mjs.map} +0 -0
- /package/dist/types/{standard-autosuggestions → autosuggestions-config/subtypes}/minimal-chat-gpt-message.d.ts +0 -0
- /package/dist/types/{standard-autosuggestions → autosuggestions-config/subtypes}/minimal-chat-gpt-message.mjs +0 -0
- /package/src/types/{standard-autosuggestions → autosuggestions-config/subtypes}/minimal-chat-gpt-message.tsx +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,12 @@ export { BaseAutosuggestionsConfig, defaultBaseAutosuggestionsConfig } from './b
|
|
|
2
2
|
export { AutosuggestionsBareFunction } from './base/autosuggestions-bare-function.js';
|
|
3
3
|
export { BaseCopilotTextareaProps } from './base/base-copilot-textarea-props.js';
|
|
4
4
|
export { HTMLCopilotTextAreaElement } from './html-copilot-textarea-element.js';
|
|
5
|
-
export { AutosuggestionsConfig,
|
|
6
|
-
export { MinimalChatGPTMessage } from './
|
|
7
|
-
export {
|
|
5
|
+
export { AutosuggestionsConfig, defaultAutosuggestionsConfig } from './autosuggestions-config/autosuggestions-config.js';
|
|
6
|
+
export { MinimalChatGPTMessage } from './autosuggestions-config/subtypes/minimal-chat-gpt-message.js';
|
|
7
|
+
export { MakeSystemPrompt } from './autosuggestions-config/subtypes/make-system-prompt.js';
|
|
8
|
+
export { ChatlikeApiEndpoint, ChatlikeApiEndpointImpl } from './autosuggestions-config/subtypes/chatlike-api-endpoint.js';
|
|
9
|
+
export { AutosuggestionsConfigUserSpecified, InsertionsApiConfigUserSpecified, SuggestionsApiConfigUserSpecified } from './autosuggestions-config/autosuggestions-config-user-specified.js';
|
|
8
10
|
import 'react';
|
|
11
|
+
import './autosuggestions-config/suggestions-api-config.js';
|
|
12
|
+
import './autosuggestions-config/insertions-api-config.js';
|
|
13
|
+
import './autosuggestions-config/editing-api-config.js';
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import '../chunk-DE5K76I2.mjs';
|
|
2
2
|
import '../chunk-WADHCMPK.mjs';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
export {
|
|
5
|
-
|
|
3
|
+
import '../chunk-5FO6ISW4.mjs';
|
|
4
|
+
export { defaultAutosuggestionsConfig } from '../chunk-QL2GYGG5.mjs';
|
|
5
|
+
import '../chunk-55EGOC5T.mjs';
|
|
6
|
+
import '../chunk-XDT7BF3V.mjs';
|
|
7
|
+
import '../chunk-A2RRLD23.mjs';
|
|
8
|
+
export { ChatlikeApiEndpoint } from '../chunk-5ARCOTW3.mjs';
|
|
6
9
|
import '../chunk-WJHSY5T6.mjs';
|
|
7
|
-
export { defaultBaseAutosuggestionsConfig } from '../chunk-
|
|
10
|
+
export { defaultBaseAutosuggestionsConfig } from '../chunk-D7SEV5PR.mjs';
|
|
8
11
|
import '../chunk-MRXNTQOX.mjs';
|
|
9
12
|
//# sourceMappingURL=out.js.map
|
|
10
13
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.19.0-alpha.1",
|
|
8
8
|
"sideEffects": [
|
|
9
9
|
"**/*.css"
|
|
10
10
|
],
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/jest": "^29.5.4",
|
|
23
|
+
"@types/lodash.merge": "^4.6.7",
|
|
23
24
|
"@types/react": "^18.2.5",
|
|
25
|
+
"@types/react-dom": "^18.2.4",
|
|
24
26
|
"@types/react-syntax-highlighter": "^15.5.7",
|
|
25
27
|
"eslint": "^7.32.0",
|
|
26
28
|
"jest": "^29.6.4",
|
|
@@ -31,13 +33,25 @@
|
|
|
31
33
|
"tsup": "^6.1.3",
|
|
32
34
|
"typescript": "^4.9.4",
|
|
33
35
|
"eslint-config-custom": "0.2.0",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
+
"tsconfig": "0.3.0",
|
|
37
|
+
"tailwind-config": "0.1.0"
|
|
36
38
|
},
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"
|
|
40
|
+
"@emotion/css": "^11.11.2",
|
|
41
|
+
"@emotion/react": "^11.11.1",
|
|
42
|
+
"@emotion/styled": "^11.11.0",
|
|
43
|
+
"@mui/material": "^5.14.11",
|
|
44
|
+
"@radix-ui/react-dialog": "^1.0.4",
|
|
45
|
+
"@radix-ui/react-label": "^2.0.2",
|
|
46
|
+
"@radix-ui/react-separator": "^1.0.3",
|
|
47
|
+
"@radix-ui/react-slot": "^1.0.2",
|
|
48
|
+
"ai": "^2.2.12",
|
|
39
49
|
"class-variance-authority": "^0.6.1",
|
|
40
50
|
"clsx": "^1.2.1",
|
|
51
|
+
"cmdk": "^0.2.0",
|
|
52
|
+
"lodash.merge": "^4.6.2",
|
|
53
|
+
"lucide-react": "^0.274.0",
|
|
54
|
+
"material-icons": "^1.13.10",
|
|
41
55
|
"nanoid": "^4.0.2",
|
|
42
56
|
"next": "^13.4.1",
|
|
43
57
|
"next-themes": "^0.2.1",
|
|
@@ -46,7 +60,7 @@
|
|
|
46
60
|
"slate-history": "^0.93.0",
|
|
47
61
|
"slate-react": "^0.98.1",
|
|
48
62
|
"tailwind-merge": "^1.13.2",
|
|
49
|
-
"@copilotkit/react-core": "0.
|
|
63
|
+
"@copilotkit/react-core": "0.8.0-alpha.1"
|
|
50
64
|
},
|
|
51
65
|
"scripts": {
|
|
52
66
|
"build": "tsup --treeshake",
|
|
@@ -7,22 +7,28 @@ import { useCopilotTextareaEditor } from "../../hooks/base-copilot-textarea-impl
|
|
|
7
7
|
import { usePopulateCopilotTextareaRef } from "../../hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref";
|
|
8
8
|
import {
|
|
9
9
|
getFullEditorTextWithNewlines,
|
|
10
|
-
|
|
10
|
+
getTextAroundCollapsedCursor,
|
|
11
11
|
} from "../../lib/get-text-around-cursor";
|
|
12
12
|
import { addAutocompletionsToEditor } from "../../lib/slatejs-edits/add-autocompletions";
|
|
13
13
|
import { clearAutocompletionsFromEditor } from "../../lib/slatejs-edits/clear-autocompletions";
|
|
14
14
|
import { replaceEditorText } from "../../lib/slatejs-edits/replace-text";
|
|
15
15
|
import {
|
|
16
|
-
AutosuggestionsBareFunction,
|
|
17
16
|
BaseAutosuggestionsConfig,
|
|
18
17
|
defaultBaseAutosuggestionsConfig,
|
|
19
18
|
} from "../../types/base";
|
|
20
19
|
import { AutosuggestionState } from "../../types/base/autosuggestion-state";
|
|
21
20
|
import { BaseCopilotTextareaProps } from "../../types/base/base-copilot-textarea-props";
|
|
22
21
|
import "./base-copilot-textarea.css";
|
|
22
|
+
import { HoveringToolbar } from "../hovering-toolbar/hovering-toolbar";
|
|
23
23
|
import { makeRenderElementFunction } from "./render-element";
|
|
24
24
|
import { makeRenderPlaceholderFunction } from "./render-placeholder";
|
|
25
25
|
import { useAddBrandingCss } from "./use-add-branding-css";
|
|
26
|
+
import {
|
|
27
|
+
HoveringEditorProvider,
|
|
28
|
+
useHoveringEditorContext,
|
|
29
|
+
} from "../hovering-toolbar/hovering-editor-provider";
|
|
30
|
+
import { EditorAutocompleteState } from "../../types/base/editor-autocomplete-state";
|
|
31
|
+
import { TrackerTextEditedSinceLastCursorMovement } from "./track-cursor-moved-since-last-text-change";
|
|
26
32
|
|
|
27
33
|
export interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
28
34
|
value: string;
|
|
@@ -30,21 +36,26 @@ export interface HTMLCopilotTextAreaElement extends HTMLElement {
|
|
|
30
36
|
blur: () => void;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
const BaseCopilotTextareaWithHoveringContext = React.forwardRef(
|
|
34
40
|
(
|
|
35
|
-
props: BaseCopilotTextareaProps
|
|
36
|
-
autosuggestionsFunction: AutosuggestionsBareFunction;
|
|
37
|
-
},
|
|
41
|
+
props: BaseCopilotTextareaProps,
|
|
38
42
|
ref: React.Ref<HTMLCopilotTextAreaElement>
|
|
39
43
|
): JSX.Element => {
|
|
40
44
|
const autosuggestionsConfig: BaseAutosuggestionsConfig = {
|
|
41
45
|
...defaultBaseAutosuggestionsConfig,
|
|
42
|
-
...props.
|
|
46
|
+
...props.baseAutosuggestionsConfig,
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
const valueOnInitialRender = useMemo(() => props.value ?? "", []);
|
|
46
50
|
const [lastKnownFullEditorText, setLastKnownFullEditorText] =
|
|
47
51
|
useState(valueOnInitialRender);
|
|
52
|
+
const [cursorMovedSinceLastTextChange, setCursorMovedSinceLastTextChange] =
|
|
53
|
+
useState(false);
|
|
54
|
+
|
|
55
|
+
// // When the editor text changes, we want to reset the `textEditedSinceLastCursorMovement` state.
|
|
56
|
+
// useEffect(() => {
|
|
57
|
+
// setCursorMovedSinceLastTextChange(false);
|
|
58
|
+
// }, [lastKnownFullEditorText]);
|
|
48
59
|
|
|
49
60
|
const initialValue: Descendant[] = useMemo(() => {
|
|
50
61
|
return [
|
|
@@ -57,6 +68,11 @@ export const BaseCopilotTextarea = React.forwardRef(
|
|
|
57
68
|
|
|
58
69
|
const editor = useCopilotTextareaEditor();
|
|
59
70
|
|
|
71
|
+
const {
|
|
72
|
+
isDisplayed: hoveringEditorIsDisplayed,
|
|
73
|
+
setIsDisplayed: setHoveringEditorIsDisplayed,
|
|
74
|
+
} = useHoveringEditorContext();
|
|
75
|
+
|
|
60
76
|
const insertText = useCallback(
|
|
61
77
|
(autosuggestion: AutosuggestionState) => {
|
|
62
78
|
Editor.insertText(editor, autosuggestion.text, {
|
|
@@ -73,10 +89,23 @@ export const BaseCopilotTextarea = React.forwardRef(
|
|
|
73
89
|
} = useAutosuggestions(
|
|
74
90
|
autosuggestionsConfig.debounceTime,
|
|
75
91
|
autosuggestionsConfig.acceptAutosuggestionKey,
|
|
76
|
-
|
|
92
|
+
autosuggestionsConfig.apiConfig.autosuggestionsFunction,
|
|
77
93
|
insertText,
|
|
78
94
|
autosuggestionsConfig.disableWhenEmpty,
|
|
79
|
-
autosuggestionsConfig.disabled
|
|
95
|
+
autosuggestionsConfig.disabled ||
|
|
96
|
+
hoveringEditorIsDisplayed || // disable autosuggestions when the hovering editor is displayed
|
|
97
|
+
(cursorMovedSinceLastTextChange &&
|
|
98
|
+
autosuggestionsConfig.temporarilyDisableWhenMovingCursorWithoutChangingText) // disable autosuggestions when the cursor has moved since the last text change
|
|
99
|
+
);
|
|
100
|
+
const onKeyDownHandlerForHoveringEditor = useCallback(
|
|
101
|
+
(event: React.KeyboardEvent<HTMLDivElement>) => {
|
|
102
|
+
// if command-k, toggle the hovering editor
|
|
103
|
+
if (event.key === "k" && event.metaKey) {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
setHoveringEditorIsDisplayed(!hoveringEditorIsDisplayed);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[hoveringEditorIsDisplayed, setHoveringEditorIsDisplayed]
|
|
80
109
|
);
|
|
81
110
|
|
|
82
111
|
// sync autosuggestions state with the editor
|
|
@@ -132,8 +161,7 @@ export const BaseCopilotTextarea = React.forwardRef(
|
|
|
132
161
|
placeholderStyle,
|
|
133
162
|
value,
|
|
134
163
|
onValueChange,
|
|
135
|
-
|
|
136
|
-
autosuggestionsFunction,
|
|
164
|
+
baseAutosuggestionsConfig: autosuggestionsConfigFromProps,
|
|
137
165
|
className,
|
|
138
166
|
onChange,
|
|
139
167
|
onKeyDown,
|
|
@@ -160,23 +188,33 @@ export const BaseCopilotTextarea = React.forwardRef(
|
|
|
160
188
|
editor={editor}
|
|
161
189
|
initialValue={initialValue}
|
|
162
190
|
onChange={(value) => {
|
|
163
|
-
const newEditorState =
|
|
191
|
+
const newEditorState = getTextAroundCollapsedCursor(editor);
|
|
164
192
|
|
|
165
193
|
const fullEditorText = newEditorState
|
|
166
194
|
? newEditorState.textBeforeCursor + newEditorState.textAfterCursor
|
|
167
195
|
: getFullEditorTextWithNewlines(editor); // we don't double-parse the editor. When `newEditorState` is null, we didn't parse the editor yet.
|
|
168
196
|
|
|
169
|
-
setLastKnownFullEditorText(
|
|
197
|
+
setLastKnownFullEditorText((prev) => {
|
|
198
|
+
if (prev !== fullEditorText) {
|
|
199
|
+
setCursorMovedSinceLastTextChange(false);
|
|
200
|
+
}
|
|
201
|
+
return fullEditorText;
|
|
202
|
+
});
|
|
170
203
|
onChangeHandlerForAutocomplete(newEditorState);
|
|
171
204
|
|
|
172
205
|
props.onValueChange?.(fullEditorText);
|
|
173
206
|
props.onChange?.(makeSemiFakeReactTextAreaEvent(fullEditorText));
|
|
174
207
|
}}
|
|
175
208
|
>
|
|
209
|
+
<TrackerTextEditedSinceLastCursorMovement
|
|
210
|
+
setCursorMovedSinceLastTextChange={setCursorMovedSinceLastTextChange}
|
|
211
|
+
/>
|
|
212
|
+
<HoveringToolbar apiConfig={autosuggestionsConfig.apiConfig} />
|
|
176
213
|
<Editable
|
|
177
214
|
renderElement={renderElementMemoized}
|
|
178
215
|
renderPlaceholder={renderPlaceholderMemoized}
|
|
179
216
|
onKeyDown={(event) => {
|
|
217
|
+
onKeyDownHandlerForHoveringEditor(event); // forward the event for internal use
|
|
180
218
|
onKeyDownHandlerForAutocomplete(event); // forward the event for internal use
|
|
181
219
|
props.onKeyDown?.(event); // forward the event for external use
|
|
182
220
|
}}
|
|
@@ -213,3 +251,16 @@ function makeSemiFakeReactTextAreaEvent(
|
|
|
213
251
|
},
|
|
214
252
|
} as React.ChangeEvent<HTMLTextAreaElement>;
|
|
215
253
|
}
|
|
254
|
+
|
|
255
|
+
export const BaseCopilotTextarea = React.forwardRef(
|
|
256
|
+
(
|
|
257
|
+
props: BaseCopilotTextareaProps,
|
|
258
|
+
ref: React.Ref<HTMLCopilotTextAreaElement>
|
|
259
|
+
): JSX.Element => {
|
|
260
|
+
return (
|
|
261
|
+
<HoveringEditorProvider>
|
|
262
|
+
<BaseCopilotTextareaWithHoveringContext {...props} ref={ref} />
|
|
263
|
+
</HoveringEditorProvider>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import { BaseSelection } from "slate";
|
|
3
|
+
import { useSlateSelector } from "slate-react";
|
|
4
|
+
import { Range } from "slate";
|
|
5
|
+
import { editorToText } from "../../lib/editor-to-text";
|
|
6
|
+
|
|
7
|
+
interface TrackerTextEditedSinceLastCursorMovementProps {
|
|
8
|
+
setCursorMovedSinceLastTextChange: (value: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export function TrackerTextEditedSinceLastCursorMovement(
|
|
11
|
+
props: TrackerTextEditedSinceLastCursorMovementProps
|
|
12
|
+
): JSX.Element {
|
|
13
|
+
const cursorState: RelevantEditorState = useSlateSelector((state) => ({
|
|
14
|
+
selection: state.selection,
|
|
15
|
+
text: editorToText(state),
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
const previousState = usePrevious(cursorState);
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!previousState) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (cursorChangedWithoutTextChanged(previousState, cursorState)) {
|
|
26
|
+
props.setCursorMovedSinceLastTextChange(true);
|
|
27
|
+
}
|
|
28
|
+
}, [props.setCursorMovedSinceLastTextChange, cursorState]);
|
|
29
|
+
|
|
30
|
+
return <></>;
|
|
31
|
+
}
|
|
32
|
+
type RelevantEditorState = {
|
|
33
|
+
selection: BaseSelection;
|
|
34
|
+
text: string;
|
|
35
|
+
};
|
|
36
|
+
const cursorChangedWithoutTextChanged = (
|
|
37
|
+
prev: RelevantEditorState,
|
|
38
|
+
next: RelevantEditorState
|
|
39
|
+
) => {
|
|
40
|
+
// Check if the selection has changed
|
|
41
|
+
const isSelectionChanged = !isSelectionEqual(prev.selection, next.selection);
|
|
42
|
+
|
|
43
|
+
// Check if the text content remains the same
|
|
44
|
+
const isTextSame = prev.text === next.text;
|
|
45
|
+
|
|
46
|
+
return isSelectionChanged && isTextSame;
|
|
47
|
+
};
|
|
48
|
+
const isSelectionEqual = (a: BaseSelection, b: BaseSelection) => {
|
|
49
|
+
if (!a && !b) return true;
|
|
50
|
+
if (!a || !b) return false;
|
|
51
|
+
return Range.equals(a, b);
|
|
52
|
+
};
|
|
53
|
+
function usePrevious<T>(value: T): T | undefined {
|
|
54
|
+
const ref = useRef<T>();
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
ref.current = value;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
return ref.current;
|
|
61
|
+
}
|
|
@@ -5,16 +5,18 @@ import { HTMLCopilotTextAreaElement } from "../../types";
|
|
|
5
5
|
import { BaseCopilotTextareaProps } from "../../types/base/base-copilot-textarea-props";
|
|
6
6
|
import {
|
|
7
7
|
AutosuggestionsConfig,
|
|
8
|
-
ChatlikeApiEndpoint,
|
|
9
8
|
defaultAutosuggestionsConfig,
|
|
10
|
-
} from "../../types/
|
|
9
|
+
} from "../../types/autosuggestions-config";
|
|
11
10
|
import { BaseCopilotTextarea } from "../base-copilot-textarea/base-copilot-textarea";
|
|
11
|
+
import { useMakeStandardInsertionOrEditingFunction } from "../../hooks/make-autosuggestions-function/use-make-standard-insertion-function";
|
|
12
|
+
import merge from "lodash.merge";
|
|
13
|
+
import { AutosuggestionsConfigUserSpecified } from "../../types/autosuggestions-config/autosuggestions-config-user-specified";
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// Like the base copilot textarea props,
|
|
16
|
+
// but with baseAutosuggestionsConfig replaced with autosuggestionsConfig.
|
|
17
|
+
export interface CopilotTextareaProps
|
|
18
|
+
extends Omit<BaseCopilotTextareaProps, "baseAutosuggestionsConfig"> {
|
|
19
|
+
autosuggestionsConfig: AutosuggestionsConfigUserSpecified;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export const CopilotTextarea = React.forwardRef(
|
|
@@ -22,27 +24,37 @@ export const CopilotTextarea = React.forwardRef(
|
|
|
22
24
|
props: CopilotTextareaProps,
|
|
23
25
|
ref: React.Ref<HTMLCopilotTextAreaElement>
|
|
24
26
|
): JSX.Element => {
|
|
25
|
-
const autosuggestionsConfig: AutosuggestionsConfig =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const autosuggestionsConfig: AutosuggestionsConfig = merge(
|
|
28
|
+
defaultAutosuggestionsConfig,
|
|
29
|
+
props.autosuggestionsConfig
|
|
30
|
+
);
|
|
29
31
|
|
|
30
32
|
const autosuggestionsFunction = useMakeStandardAutosuggestionFunction(
|
|
31
33
|
autosuggestionsConfig.textareaPurpose,
|
|
32
|
-
autosuggestionsConfig.apiEndpoint,
|
|
33
|
-
autosuggestionsConfig.makeSystemPrompt,
|
|
34
|
-
autosuggestionsConfig.fewShotMessages,
|
|
35
34
|
autosuggestionsConfig.externalContextCategories,
|
|
36
|
-
autosuggestionsConfig.
|
|
35
|
+
autosuggestionsConfig.chatApiConfigs.suggestionsApiConfig
|
|
37
36
|
);
|
|
38
37
|
|
|
38
|
+
const insertionOrEditingFunction =
|
|
39
|
+
useMakeStandardInsertionOrEditingFunction(
|
|
40
|
+
autosuggestionsConfig.textareaPurpose,
|
|
41
|
+
autosuggestionsConfig.externalContextCategories,
|
|
42
|
+
autosuggestionsConfig.chatApiConfigs.insertionApiConfig,
|
|
43
|
+
autosuggestionsConfig.chatApiConfigs.editingApiConfig
|
|
44
|
+
);
|
|
45
|
+
|
|
39
46
|
return (
|
|
40
47
|
<>
|
|
41
48
|
<BaseCopilotTextarea
|
|
42
49
|
ref={ref}
|
|
43
50
|
{...props}
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
baseAutosuggestionsConfig={{
|
|
52
|
+
...autosuggestionsConfig,
|
|
53
|
+
apiConfig: {
|
|
54
|
+
insertionOrEditingFunction: insertionOrEditingFunction,
|
|
55
|
+
autosuggestionsFunction: autosuggestionsFunction,
|
|
56
|
+
},
|
|
57
|
+
}}
|
|
46
58
|
/>
|
|
47
59
|
</>
|
|
48
60
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { createContext, useState, useContext, ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
interface HoveringEditorContextProps {
|
|
4
|
+
isDisplayed: boolean;
|
|
5
|
+
setIsDisplayed: (value: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const HoveringEditorContext = createContext<HoveringEditorContextProps>({
|
|
9
|
+
isDisplayed: false,
|
|
10
|
+
setIsDisplayed: () => {},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
interface HoveringEditorProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const HoveringEditorProvider = ({
|
|
18
|
+
children,
|
|
19
|
+
}: HoveringEditorProviderProps) => {
|
|
20
|
+
const [isDisplayed, setIsDisplayed] = useState(false);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<HoveringEditorContext.Provider value={{ isDisplayed, setIsDisplayed }}>
|
|
24
|
+
{children}
|
|
25
|
+
</HoveringEditorContext.Provider>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const useHoveringEditorContext = () => useContext(HoveringEditorContext);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { css, cx } from "@emotion/css";
|
|
2
|
+
import React, { PropsWithChildren, Ref } from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
|
|
5
|
+
interface BaseProps {
|
|
6
|
+
className: string;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Button = React.forwardRef(
|
|
11
|
+
(
|
|
12
|
+
{
|
|
13
|
+
className,
|
|
14
|
+
active,
|
|
15
|
+
reversed,
|
|
16
|
+
...props
|
|
17
|
+
}: PropsWithChildren<
|
|
18
|
+
{
|
|
19
|
+
active: boolean;
|
|
20
|
+
reversed: boolean;
|
|
21
|
+
} & BaseProps
|
|
22
|
+
>,
|
|
23
|
+
ref: Ref<HTMLSpanElement | null>
|
|
24
|
+
) => (
|
|
25
|
+
<span
|
|
26
|
+
{...props}
|
|
27
|
+
ref={ref as Ref<HTMLSpanElement>}
|
|
28
|
+
className={cx(
|
|
29
|
+
className,
|
|
30
|
+
css`
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
color: ${reversed
|
|
33
|
+
? active
|
|
34
|
+
? "white"
|
|
35
|
+
: "#aaa"
|
|
36
|
+
: active
|
|
37
|
+
? "black"
|
|
38
|
+
: "#ccc"};
|
|
39
|
+
`
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const Icon = React.forwardRef(
|
|
46
|
+
(
|
|
47
|
+
{ className, ...props }: PropsWithChildren<BaseProps>,
|
|
48
|
+
ref: Ref<HTMLSpanElement | null>
|
|
49
|
+
) => (
|
|
50
|
+
<span
|
|
51
|
+
{...props}
|
|
52
|
+
ref={ref as Ref<HTMLSpanElement>}
|
|
53
|
+
className={cx(
|
|
54
|
+
"material-icons",
|
|
55
|
+
className,
|
|
56
|
+
css`
|
|
57
|
+
font-size: 18px;
|
|
58
|
+
vertical-align: text-bottom;
|
|
59
|
+
`
|
|
60
|
+
)}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export const Menu = React.forwardRef(
|
|
66
|
+
(
|
|
67
|
+
{ className, ...props }: PropsWithChildren<BaseProps>,
|
|
68
|
+
ref: Ref<HTMLDivElement | null>
|
|
69
|
+
) => (
|
|
70
|
+
<div
|
|
71
|
+
{...props}
|
|
72
|
+
data-test-id="menu"
|
|
73
|
+
ref={ref as Ref<HTMLDivElement>}
|
|
74
|
+
className={cx(
|
|
75
|
+
className,
|
|
76
|
+
css`
|
|
77
|
+
& > * {
|
|
78
|
+
display: inline-block;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& > * + * {
|
|
82
|
+
margin-left: 15px;
|
|
83
|
+
}
|
|
84
|
+
`
|
|
85
|
+
)}
|
|
86
|
+
/>
|
|
87
|
+
)
|
|
88
|
+
);
|
|
89
|
+
export const Portal = ({ children }: { children: React.ReactNode }) => {
|
|
90
|
+
return typeof document === "object"
|
|
91
|
+
? ReactDOM.createPortal(children, document.body)
|
|
92
|
+
: null;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Toolbar = React.forwardRef(
|
|
96
|
+
(
|
|
97
|
+
{ className, ...props }: PropsWithChildren<BaseProps>,
|
|
98
|
+
ref?: Ref<HTMLDivElement>
|
|
99
|
+
) => (
|
|
100
|
+
<Menu
|
|
101
|
+
{...props}
|
|
102
|
+
ref={ref}
|
|
103
|
+
className={cx(
|
|
104
|
+
className,
|
|
105
|
+
css`
|
|
106
|
+
position: relative;
|
|
107
|
+
padding: 1px 18px 17px;
|
|
108
|
+
margin: 0 -20px;
|
|
109
|
+
border-bottom: 2px solid #eee;
|
|
110
|
+
margin-bottom: 20px;
|
|
111
|
+
`
|
|
112
|
+
)}
|
|
113
|
+
/>
|
|
114
|
+
)
|
|
115
|
+
);
|