@fluentui-copilot/react-chat-input-plugins 0.0.0-nightly-20251002-0405-17b34fb7.1 → 0.0.0-nightly-20251010-0406-7df7c6d1.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/CHANGELOG.json +3 -3
- package/CHANGELOG.md +4 -4
- package/package.json +9 -9
- package/dist/index.d.ts +0 -284
- package/lib/BasicFunctionality.js +0 -1
- package/lib/BasicFunctionality.js.map +0 -1
- package/lib/ChatInputEntity.js +0 -2
- package/lib/ChatInputEntity.js.map +0 -1
- package/lib/ChatInputToken.js +0 -1
- package/lib/ChatInputToken.js.map +0 -1
- package/lib/GhostText.js +0 -3
- package/lib/GhostText.js.map +0 -1
- package/lib/ImperativeControl.js +0 -1
- package/lib/ImperativeControl.js.map +0 -1
- package/lib/PasteUnfurling.js +0 -1
- package/lib/PasteUnfurling.js.map +0 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.js +0 -11
- package/lib/components/ChatInputEntity/ChatInputEntity.js.map +0 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js +0 -4
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js.map +0 -1
- package/lib/components/ChatInputEntity/index.js +0 -4
- package/lib/components/ChatInputEntity/index.js.map +0 -1
- package/lib/components/ChatInputEntity/renderChatInputEntity.js +0 -13
- package/lib/components/ChatInputEntity/renderChatInputEntity.js.map +0 -1
- package/lib/components/ChatInputEntity/useChatInputEntity.js +0 -51
- package/lib/components/ChatInputEntity/useChatInputEntity.js.map +0 -1
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.js +0 -47
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.js.map +0 -1
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +0 -43
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +0 -1
- package/lib/components/ChatInputToken/ChatInputToken.js +0 -11
- package/lib/components/ChatInputToken/ChatInputToken.js.map +0 -1
- package/lib/components/ChatInputToken/ChatInputToken.node.js +0 -59
- package/lib/components/ChatInputToken/ChatInputToken.node.js.map +0 -1
- package/lib/components/ChatInputToken/ChatInputToken.types.js +0 -3
- package/lib/components/ChatInputToken/ChatInputToken.types.js.map +0 -1
- package/lib/components/ChatInputToken/index.js +0 -5
- package/lib/components/ChatInputToken/index.js.map +0 -1
- package/lib/components/ChatInputToken/renderChatInputToken.js +0 -8
- package/lib/components/ChatInputToken/renderChatInputToken.js.map +0 -1
- package/lib/components/ChatInputToken/useChatInputToken.js +0 -23
- package/lib/components/ChatInputToken/useChatInputToken.js.map +0 -1
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js +0 -20
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +0 -1
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +0 -25
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +0 -1
- package/lib/components/GhostText/GhostText.js +0 -11
- package/lib/components/GhostText/GhostText.js.map +0 -1
- package/lib/components/GhostText/GhostText.types.js +0 -4
- package/lib/components/GhostText/GhostText.types.js.map +0 -1
- package/lib/components/GhostText/index.js +0 -4
- package/lib/components/GhostText/index.js.map +0 -1
- package/lib/components/GhostText/renderGhostText.js +0 -13
- package/lib/components/GhostText/renderGhostText.js.map +0 -1
- package/lib/components/GhostText/useGhostText.js +0 -49
- package/lib/components/GhostText/useGhostText.js.map +0 -1
- package/lib/components/GhostText/useGhostTextStyles.styles.js +0 -60
- package/lib/components/GhostText/useGhostTextStyles.styles.js.map +0 -1
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js +0 -35
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js.map +0 -1
- package/lib/index.js +0 -6
- package/lib/index.js.map +0 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +0 -58
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +0 -1
- package/lib/plugins/BasicFunctionality/index.js +0 -1
- package/lib/plugins/BasicFunctionality/index.js.map +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +0 -78
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js.map +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js +0 -42
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +0 -1
- package/lib/plugins/ChatInputEntity/index.js +0 -2
- package/lib/plugins/ChatInputEntity/index.js.map +0 -1
- package/lib/plugins/GhostText/GhostText.js +0 -50
- package/lib/plugins/GhostText/GhostText.js.map +0 -1
- package/lib/plugins/GhostText/GhostText.node.js +0 -66
- package/lib/plugins/GhostText/GhostText.node.js.map +0 -1
- package/lib/plugins/GhostText/index.js +0 -2
- package/lib/plugins/GhostText/index.js.map +0 -1
- package/lib/plugins/ImperativeControl/ImperativeControl.js +0 -10
- package/lib/plugins/ImperativeControl/ImperativeControl.js.map +0 -1
- package/lib/plugins/ImperativeControl/index.js +0 -1
- package/lib/plugins/ImperativeControl/index.js.map +0 -1
- package/lib/plugins/ManualGhostText/ManualGhostText.js +0 -14
- package/lib/plugins/ManualGhostText/ManualGhostText.js.map +0 -1
- package/lib/plugins/ManualGhostText/index.js +0 -1
- package/lib/plugins/ManualGhostText/index.js.map +0 -1
- package/lib/plugins/PasteUnfurling/PasteUnfurling.js +0 -19
- package/lib/plugins/PasteUnfurling/PasteUnfurling.js.map +0 -1
- package/lib/plugins/PasteUnfurling/index.js +0 -1
- package/lib/plugins/PasteUnfurling/index.js.map +0 -1
- package/lib-commonjs/BasicFunctionality.js +0 -11
- package/lib-commonjs/BasicFunctionality.js.map +0 -1
- package/lib-commonjs/ChatInputEntity.js +0 -41
- package/lib-commonjs/ChatInputEntity.js.map +0 -1
- package/lib-commonjs/ChatInputToken.js +0 -37
- package/lib-commonjs/ChatInputToken.js.map +0 -1
- package/lib-commonjs/GhostText.js +0 -45
- package/lib-commonjs/GhostText.js.map +0 -1
- package/lib-commonjs/ImperativeControl.js +0 -11
- package/lib-commonjs/ImperativeControl.js.map +0 -1
- package/lib-commonjs/PasteUnfurling.js +0 -11
- package/lib-commonjs/PasteUnfurling.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +0 -21
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +0 -8
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/index.js +0 -31
- package/lib-commonjs/components/ChatInputEntity/index.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js +0 -21
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js +0 -52
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.js +0 -72
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +0 -59
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +0 -21
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +0 -81
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +0 -6
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/index.js +0 -41
- package/lib-commonjs/components/ChatInputToken/index.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js +0 -16
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js +0 -24
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.js +0 -33
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +0 -41
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/GhostText/GhostText.js +0 -21
- package/lib-commonjs/components/GhostText/GhostText.js.map +0 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js +0 -8
- package/lib-commonjs/components/GhostText/GhostText.types.js.map +0 -1
- package/lib-commonjs/components/GhostText/index.js +0 -31
- package/lib-commonjs/components/GhostText/index.js.map +0 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js +0 -21
- package/lib-commonjs/components/GhostText/renderGhostText.js.map +0 -1
- package/lib-commonjs/components/GhostText/useGhostText.js +0 -51
- package/lib-commonjs/components/GhostText/useGhostText.js.map +0 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.js +0 -98
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.js.map +0 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js +0 -51
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/index.js +0 -108
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +0 -69
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +0 -1
- package/lib-commonjs/plugins/BasicFunctionality/index.js +0 -11
- package/lib-commonjs/plugins/BasicFunctionality/index.js.map +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +0 -100
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js +0 -53
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +0 -4
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/index.js +0 -26
- package/lib-commonjs/plugins/ChatInputEntity/index.js.map +0 -1
- package/lib-commonjs/plugins/GhostText/GhostText.js +0 -60
- package/lib-commonjs/plugins/GhostText/GhostText.js.map +0 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js +0 -88
- package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +0 -1
- package/lib-commonjs/plugins/GhostText/index.js +0 -26
- package/lib-commonjs/plugins/GhostText/index.js.map +0 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js +0 -21
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +0 -1
- package/lib-commonjs/plugins/ImperativeControl/index.js +0 -11
- package/lib-commonjs/plugins/ImperativeControl/index.js.map +0 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js +0 -25
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +0 -1
- package/lib-commonjs/plugins/ManualGhostText/index.js +0 -11
- package/lib-commonjs/plugins/ManualGhostText/index.js.map +0 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js +0 -30
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js.map +0 -1
- package/lib-commonjs/plugins/PasteUnfurling/index.js +0 -11
- package/lib-commonjs/plugins/PasteUnfurling/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntity.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nimport type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\n\nexport type SerializedChatInputEntityNode<T> = Spread<\n { pluginId: string; text: string; data?: T; entityProps?: ChatInputEntityProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputEntityNode<T> extends DecoratorNode<JSXElement | null> {\n __pluginId: string;\n __text: string;\n __entityProps?: ChatInputEntityProps;\n __data?: T;\n\n static getType(): string {\n return 'entity';\n }\n static clone<T>(node: ChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n\n static importJSON<T>(serializedNode: SerializedChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return $createChatInputEntityNode(\n serializedNode.pluginId,\n serializedNode.text,\n serializedNode.data,\n serializedNode.entityProps,\n );\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputEntityNode<T> {\n return {\n pluginId: this.__pluginId,\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n type: ChatInputEntityNode.getType(),\n version: 1,\n };\n }\n\n constructor(pluginId: string, text: string, data?: T, entityProps?: ChatInputEntityProps, key?: NodeKey) {\n super(key);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n\n createDOM(): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSXElement | null {\n if (this.__entityProps?.children) {\n return <ChatInputEntity {...this.__entityProps} />;\n }\n return <ChatInputEntity {...this.__entityProps}>{this.__text}</ChatInputEntity>;\n }\n\n getEntityData(): ChatInputEntityData<T, ChatInputEntityProps> {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n };\n }\n\n updateEntityData(data: ChatInputEntityData<T, ChatInputEntityProps>) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n}\n\nexport function $createChatInputEntityNode<T>(\n pluginId: string,\n text: string,\n data?: T,\n entityProps?: ChatInputEntityProps,\n key?: NodeKey,\n): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\n\nexport function $isChatInputEntityNode<T>(node: LexicalNode | null | undefined): node is ChatInputEntityNode<T> {\n return node instanceof ChatInputEntityNode;\n}\n"],"names":["$createChatInputEntityNode","$isChatInputEntityNode","ChatInputEntityNode","DecoratorNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","_this___entityProps","children","React","ChatInputEntity","getEntityData","updateEntityData","writable","getWritable","constructor","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAyGgBA,0BAAAA;eAAAA;;IAUAC,sBAAAA;eAAAA;;IA9FHC,mBAAAA;eAAAA;;;;;iEArBU;4BAEO;iCAWE;AAQzB,MAAMA,4BAA+BC,yBAAAA;IAM1C,OAAOC,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAASC,IAA4B,EAA0B;QACpE,OAAO,IAAIJ,oBAAoBI,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,WAAcC,cAAgD,EAA0B;QAC7F,OAAOb,2BACLa,eAAeC,QAAQ,EACvBD,eAAeE,IAAI,EACnBF,eAAeG,IAAI,EACnBH,eAAeI,WAAW;IAE9B;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACZ,MAAM;IACpB;IAEAa,aAA+C;QAC7C,OAAO;YACLP,UAAU,IAAI,CAACP,UAAU;YACzBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,aAAa,IAAI,CAACP,aAAa;YAC/BY,MAAMpB,oBAAoBE,OAAO;YACjCmB,SAAS;QACX;IACF;IAUAC,YAAyB;QACvB,iDAAiD;QACjD,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAqB;YACpEC;QAAJ,IAAA,AAAIA,CAAAA,sBAAA,IAAI,CAACrB,aAAa,AAAbA,MAAa,QAAlBqB,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAoBC,QAAQ,EAAE;YAChC,OAAA,WAAA,GAAOC,OAAAP,aAAA,CAACQ,gCAAAA,EAAoB,IAAI,CAACxB,aAAa;QAChD;QACA,OAAA,WAAA,GAAOuB,OAAAP,aAAA,CAACQ,gCAAAA,EAAoB,IAAI,CAACxB,aAAa,EAAG,IAAI,CAACF,MAAM;IAC9D;IAEA2B,gBAA8D;QAC5D,OAAO;YACLpB,MAAM,IAAI,CAACP,MAAM;YACjBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,aAAa,IAAI,CAACP,aAAa;QACjC;IACF;IAEA0B,iBAAiBpB,IAAkD,EAAE;QACnE,MAAMqB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS7B,MAAM,GAAGQ,KAAKD,IAAI;QAC3BsB,SAAS5B,MAAM,GAAGO,KAAKA,IAAI;QAC3BqB,SAAS3B,aAAa,GAAGM,KAAKC,WAAW;IAC3C;IArCAsB,YAAYzB,QAAgB,EAAEC,IAAY,EAAEC,IAAQ,EAAEC,WAAkC,EAAEuB,GAAa,CAAE;QACvG,KAAK,CAACA;QA5CRjC,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,cAAAA,KAAAA;QACAC,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;QACAE,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,iBAAAA,KAAAA;QACAD,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;QA0CE,IAAI,CAACF,UAAU,GAAGO;QAClB,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,aAAa,GAAGO;IACvB;AAgCF;AAEO,SAASjB,2BACdc,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCuB,GAAa;IAEb,OAAO,IAAItC,oBAAoBY,UAAUC,MAAMC,MAAMC,aAAauB;AACpE;AAEO,SAASvC,uBAA0BK,IAAoC;IAC5E,OAAOA,gBAAgBJ;AACzB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "ChatInputEntityPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return ChatInputEntityPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
13
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
-
const _ChatInputEntitynode = require("./ChatInputEntity.node");
|
|
15
|
-
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
16
|
-
const ChatInputEntityPlugin = (props)=>{
|
|
17
|
-
const { id, controlRef, onChatInputEntityAdded, onChatInputEntityDeleted, skipInitialization } = props;
|
|
18
|
-
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
19
|
-
const chatInputEntityPluginBase = _react.useRef(null);
|
|
20
|
-
_react.useEffect(()=>{
|
|
21
|
-
chatInputEntityPluginBase.current = new _chatinputplugins.ChatInputEntityPluginBase(editor, id, _ChatInputEntitynode.ChatInputEntityNode, _ChatInputEntitynode.$createChatInputEntityNode, _ChatInputEntitynode.$isChatInputEntityNode, onChatInputEntityAdded, onChatInputEntityDeleted);
|
|
22
|
-
return ()=>{
|
|
23
|
-
var _chatInputEntityPluginBase_current;
|
|
24
|
-
return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.cleanup();
|
|
25
|
-
};
|
|
26
|
-
}, [
|
|
27
|
-
editor,
|
|
28
|
-
id,
|
|
29
|
-
onChatInputEntityAdded,
|
|
30
|
-
onChatInputEntityDeleted,
|
|
31
|
-
skipInitialization
|
|
32
|
-
]);
|
|
33
|
-
_react.useImperativeHandle(controlRef, ()=>({
|
|
34
|
-
insertChatInputEntity (props) {
|
|
35
|
-
var _chatInputEntityPluginBase_current;
|
|
36
|
-
return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.insertChatInputEntity(props);
|
|
37
|
-
},
|
|
38
|
-
getActiveEntities () {
|
|
39
|
-
var _chatInputEntityPluginBase_current;
|
|
40
|
-
var _chatInputEntityPluginBase_current_getActiveEntities;
|
|
41
|
-
return (_chatInputEntityPluginBase_current_getActiveEntities = (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.getActiveEntities()) !== null && _chatInputEntityPluginBase_current_getActiveEntities !== void 0 ? _chatInputEntityPluginBase_current_getActiveEntities : [];
|
|
42
|
-
},
|
|
43
|
-
removeChatInputEntity (keyOrPredicate) {
|
|
44
|
-
var _chatInputEntityPluginBase_current;
|
|
45
|
-
(_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.removeChatInputEntity(keyOrPredicate);
|
|
46
|
-
},
|
|
47
|
-
updateChatInputEntityProps (keyOrPredicate, props) {
|
|
48
|
-
var _chatInputEntityPluginBase_current;
|
|
49
|
-
(_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.updateChatInputEntityProps(keyOrPredicate, props);
|
|
50
|
-
}
|
|
51
|
-
}), []);
|
|
52
|
-
return null;
|
|
53
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntityPlugin.tsx"],"sourcesContent":["import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport * as React from 'react';\nimport { $createChatInputEntityNode, $isChatInputEntityNode, ChatInputEntityNode } from './ChatInputEntity.node';\nimport type { ChatInputEntityPluginRef } from './ChatInputEntityPlugin.types';\nimport type { ChatInputEntityPluginProps } from '@fluentui-copilot/chat-input-plugins';\nimport { ChatInputEntityPluginBase } from '@fluentui-copilot/chat-input-plugins';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\n\nexport const ChatInputEntityPlugin = <ExtraDataType,>(\n props: ChatInputEntityPluginProps<ExtraDataType, ChatInputEntityProps> & {\n controlRef: React.Ref<ChatInputEntityPluginRef<ExtraDataType>>;\n },\n) => {\n const { id, controlRef, onChatInputEntityAdded, onChatInputEntityDeleted, skipInitialization } = props;\n const [editor] = useLexicalComposerContext();\n\n const chatInputEntityPluginBase = React.useRef<ChatInputEntityPluginBase<\n ExtraDataType,\n ChatInputEntityProps,\n ChatInputEntityNode<ExtraDataType>\n > | null>(null);\n\n React.useEffect(() => {\n chatInputEntityPluginBase.current = new ChatInputEntityPluginBase<\n ExtraDataType,\n ChatInputEntityProps,\n ChatInputEntityNode<ExtraDataType>\n >(\n editor,\n id,\n ChatInputEntityNode,\n $createChatInputEntityNode,\n $isChatInputEntityNode,\n onChatInputEntityAdded,\n onChatInputEntityDeleted,\n );\n\n return () => chatInputEntityPluginBase.current?.cleanup();\n }, [editor, id, onChatInputEntityAdded, onChatInputEntityDeleted, skipInitialization]);\n\n React.useImperativeHandle(\n controlRef,\n () => ({\n insertChatInputEntity(props) {\n return chatInputEntityPluginBase.current?.insertChatInputEntity(props);\n },\n\n getActiveEntities() {\n return chatInputEntityPluginBase.current?.getActiveEntities() ?? [];\n },\n\n removeChatInputEntity(keyOrPredicate) {\n chatInputEntityPluginBase.current?.removeChatInputEntity(keyOrPredicate);\n },\n\n updateChatInputEntityProps(keyOrPredicate, props) {\n chatInputEntityPluginBase.current?.updateChatInputEntityProps(keyOrPredicate, props);\n },\n }),\n [],\n );\n return null;\n};\n"],"names":["ChatInputEntityPlugin","props","id","controlRef","onChatInputEntityAdded","onChatInputEntityDeleted","skipInitialization","editor","useLexicalComposerContext","chatInputEntityPluginBase","React","useRef","useEffect","current","ChatInputEntityPluginBase","ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","cleanup","useImperativeHandle","insertChatInputEntity","getActiveEntities","removeChatInputEntity","keyOrPredicate","updateChatInputEntityProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iCAR6B;iEACnB;qCACiE;kCAG9C;AAGnC,MAAMA,wBAAwB,CACnCC;IAIA,MAAM,EAAEC,EAAE,EAAEC,UAAU,EAAEC,sBAAsB,EAAEC,wBAAwB,EAAEC,kBAAkB,EAAE,GAAGL;IACjG,MAAM,CAACM,OAAO,GAAGC,IAAAA,0CAAAA;IAEjB,MAAMC,4BAA4BC,OAAMC,MAAM,CAIpC;IAEVD,OAAME,SAAS,CAAC;QACdH,0BAA0BI,OAAO,GAAG,IAAIC,2CAAAA,CAKtCP,QACAL,IACAa,wCAAAA,EACAC,+CAAAA,EACAC,2CAAAA,EACAb,wBACAC;QAGF,OAAO;gBAAMI;mBAAAA,CAAAA,qCAAAA,0BAA0BI,OAAO,AAAPA,MAAO,QAAjCJ,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCS,OAAO;;IACzD,GAAG;QAACX;QAAQL;QAAIE;QAAwBC;QAA0BC;KAAmB;IAErFI,OAAMS,mBAAmB,CACvBhB,YACA,IAAO,CAAA;YACLiB,uBAAsBnB,KAAK;oBAClBQ;gBAAP,OAAA,AAAOA,CAAAA,qCAAAA,0BAA0BI,OAAO,AAAPA,MAAO,QAAjCJ,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCW,qBAAqB,CAACnB;YAClE;YAEAoB;oBACSZ;oBAAAA;gBAAP,OAAOA,CAAAA,uDAAAA,CAAAA,qCAAAA,0BAA0BI,OAAO,AAAPA,MAAO,QAAjCJ,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCY,iBAAiB,EAAA,MAAA,QAApDZ,yDAAAA,KAAAA,IAAAA,uDAA0D,EAAE;YACrE;YAEAa,uBAAsBC,cAAc;oBAClCd;gBAAAA,CAAAA,qCAAAA,0BAA0BI,OAAO,AAAPA,MAAO,QAAjCJ,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCa,qBAAqB,CAACC;YAC3D;YAEAC,4BAA2BD,cAAc,EAAEtB,KAAK;oBAC9CQ;gBAAAA,CAAAA,qCAAAA,0BAA0BI,OAAO,AAAPA,MAAO,QAAjCJ,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAmCe,0BAA0B,CAACD,gBAAgBtB;YAChF;QACF,CAAA,GACA,EAAE;IAEJ,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ChatInputEntityPlugin.types.ts"],"sourcesContent":["import type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\n\nexport type ChatInputEntityPluginRef<ExtraDataType = undefined> = {\n // Inserts a new entity and returns its key, to be used by removeChatInputEntity or updateChatInputEntityProps\n insertChatInputEntity: (props: ChatInputEntityData<ExtraDataType, ChatInputEntityProps>) => string | undefined;\n // Removes an entity by its key, or removes all entities that match a predicate function\n removeChatInputEntity: (\n keyOrPredicate: string | ((entity: ChatInputEntityData<ExtraDataType, ChatInputEntityProps>, i: number) => boolean),\n ) => void;\n // Updates an entity by its key, or removes all entities that match a predicate function\n updateChatInputEntityProps: (\n keyOrPredicate: string | ((entity: ChatInputEntityData<ExtraDataType, ChatInputEntityProps>, i: number) => boolean),\n props:\n | ChatInputEntityData<ExtraDataType, ChatInputEntityProps>\n | ((\n oldProps: ChatInputEntityData<ExtraDataType, ChatInputEntityProps>,\n ) => ChatInputEntityData<ExtraDataType, ChatInputEntityProps>),\n ) => void;\n getActiveEntities: () => ChatInputEntityData<ExtraDataType, ChatInputEntityProps>[];\n};\n"],"names":[],"rangeMappings":"","mappings":""}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
$createChatInputEntityNode: function() {
|
|
13
|
-
return _ChatInputEntitynode.$createChatInputEntityNode;
|
|
14
|
-
},
|
|
15
|
-
$isChatInputEntityNode: function() {
|
|
16
|
-
return _ChatInputEntitynode.$isChatInputEntityNode;
|
|
17
|
-
},
|
|
18
|
-
ChatInputEntityNode: function() {
|
|
19
|
-
return _ChatInputEntitynode.ChatInputEntityNode;
|
|
20
|
-
},
|
|
21
|
-
ChatInputEntityPlugin: function() {
|
|
22
|
-
return _ChatInputEntityPlugin.ChatInputEntityPlugin;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const _ChatInputEntitynode = require("./ChatInputEntity.node");
|
|
26
|
-
const _ChatInputEntityPlugin = require("./ChatInputEntityPlugin");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { SerializedChatInputEntityNode } from './ChatInputEntity.node';\nexport { $createChatInputEntityNode, $isChatInputEntityNode, ChatInputEntityNode } from './ChatInputEntity.node';\nexport { ChatInputEntityPlugin } from './ChatInputEntityPlugin';\nexport type { ChatInputEntityPluginRef } from './ChatInputEntityPlugin.types';\n"],"names":["$createChatInputEntityNode","$isChatInputEntityNode","ChatInputEntityNode","ChatInputEntityPlugin"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,0BAA0B;eAA1BA,+CAA0B;;IAAEC,sBAAsB;eAAtBA,2CAAsB;;IAAEC,mBAAmB;eAAnBA,wCAAmB;;IACvEC,qBAAqB;eAArBA,4CAAqB;;;qCAD0D;uCAClD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "GhostTextPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return GhostTextPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
14
|
-
const _GhostText = require("../../GhostText");
|
|
15
|
-
const _GhostTextnode = require("./GhostText.node");
|
|
16
|
-
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
17
|
-
function GhostTextPlugin(props) {
|
|
18
|
-
'use no memo';
|
|
19
|
-
const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;
|
|
20
|
-
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
21
|
-
const [ghostTextBase, setGhostTextBase] = _react.useState(null);
|
|
22
|
-
_react.useEffect(()=>{
|
|
23
|
-
setGhostTextBase(new _chatinputplugins.GhostTextPluginBase(editor, id, $getGhostText, _GhostTextnode.GhostTextNode, _GhostText.$createGhostTextNode, ghostTextProps, exposeText, allowCompletion));
|
|
24
|
-
return ()=>{
|
|
25
|
-
setGhostTextBase((prev)=>{
|
|
26
|
-
prev === null || prev === void 0 ? void 0 : prev.cleanup();
|
|
27
|
-
return null;
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
|
-
[
|
|
32
|
-
editor,
|
|
33
|
-
id
|
|
34
|
-
]);
|
|
35
|
-
_react.useEffect(()=>{
|
|
36
|
-
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setAllowCompletion(allowCompletion);
|
|
37
|
-
}, [
|
|
38
|
-
allowCompletion,
|
|
39
|
-
ghostTextBase
|
|
40
|
-
]);
|
|
41
|
-
_react.useEffect(()=>{
|
|
42
|
-
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setComponentProps(ghostTextProps);
|
|
43
|
-
}, [
|
|
44
|
-
ghostTextBase,
|
|
45
|
-
ghostTextProps
|
|
46
|
-
]);
|
|
47
|
-
_react.useEffect(()=>{
|
|
48
|
-
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setExposeText(exposeText);
|
|
49
|
-
}, [
|
|
50
|
-
exposeText,
|
|
51
|
-
ghostTextBase
|
|
52
|
-
]);
|
|
53
|
-
_react.useEffect(()=>{
|
|
54
|
-
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setGetGhostText($getGhostText);
|
|
55
|
-
}, [
|
|
56
|
-
$getGhostText,
|
|
57
|
-
ghostTextBase
|
|
58
|
-
]);
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-components';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport type { LexicalEditor, EditorState } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../GhostText';\nimport { $createGhostTextNode } from '../../GhostText';\nimport { GhostTextNode } from './GhostText.node';\nimport { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type GhostTextPluginProps = {\n id: string;\n $getGhostText: (\n editor: LexicalEditor,\n editorState: EditorState,\n prevEditorState: EditorState,\n ) => Promise<string | undefined>;\n ghostTextProps?: GhostTextProps;\n // Whether or not the ghost text should count as text inside the input for submitting and character count\n exposeText?: boolean;\n allowCompletion?: boolean;\n};\n\nexport function GhostTextPlugin(props: GhostTextPluginProps): JSXElement | null {\n 'use no memo';\n\n const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;\n const [editor] = useLexicalComposerContext();\n\n const [ghostTextBase, setGhostTextBase] = React.useState<GhostTextPluginBase<GhostTextProps> | null>(null);\n\n React.useEffect(\n () => {\n setGhostTextBase(\n new GhostTextPluginBase(\n editor,\n id,\n $getGhostText,\n GhostTextNode,\n $createGhostTextNode,\n ghostTextProps,\n exposeText,\n allowCompletion,\n ),\n );\n\n return () => {\n setGhostTextBase(prev => {\n prev?.cleanup();\n return null;\n });\n };\n },\n // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, id],\n );\n\n React.useEffect(() => {\n ghostTextBase?.setAllowCompletion(allowCompletion);\n }, [allowCompletion, ghostTextBase]);\n\n React.useEffect(() => {\n ghostTextBase?.setComponentProps(ghostTextProps);\n }, [ghostTextBase, ghostTextProps]);\n\n React.useEffect(() => {\n ghostTextBase?.setExposeText(exposeText);\n }, [exposeText, ghostTextBase]);\n\n React.useEffect(() => {\n ghostTextBase?.setGetGhostText($getGhostText);\n }, [$getGhostText, ghostTextBase]);\n\n return null;\n}\n"],"names":["GhostTextPlugin","props","$getGhostText","id","ghostTextProps","exposeText","allowCompletion","editor","useLexicalComposerContext","ghostTextBase","setGhostTextBase","React","useState","useEffect","GhostTextPluginBase","GhostTextNode","$createGhostTextNode","prev","cleanup","setAllowCompletion","setComponentProps","setExposeText","setGetGhostText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBgBA;;;eAAAA;;;;iEAtBO;iCAEmB;2BAGL;+BACP;kCACM;AAe7B,SAASA,gBAAgBC,KAA2B;IACzD;IAEA,MAAM,EAAEC,aAAa,EAAEC,EAAE,EAAEC,cAAc,EAAEC,UAAU,EAAEC,eAAe,EAAE,GAAGL;IAC3E,MAAM,CAACM,OAAO,GAAGC,IAAAA,0CAAAA;IAEjB,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,OAAMC,QAAQ,CAA6C;IAErGD,OAAME,SAAS,CACb;QACEH,iBACE,IAAII,qCAAAA,CACFP,QACAJ,IACAD,eACAa,4BAAAA,EACAC,+BAAAA,EACAZ,gBACAC,YACAC;QAIJ,OAAO;YACLI,iBAAiBO,CAAAA;gBACfA,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAMC,OAAO;gBACb,OAAO;YACT;QACF;IACF,GAEA,uDAAuD;IACvD;QAACX;QAAQJ;KAAG;IAGdQ,OAAME,SAAS,CAAC;QACdJ,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeU,kBAAkB,CAACb;IACpC,GAAG;QAACA;QAAiBG;KAAc;IAEnCE,OAAME,SAAS,CAAC;QACdJ,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeW,iBAAiB,CAAChB;IACnC,GAAG;QAACK;QAAeL;KAAe;IAElCO,OAAME,SAAS,CAAC;QACdJ,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAeY,aAAa,CAAChB;IAC/B,GAAG;QAACA;QAAYI;KAAc;IAE9BE,OAAME,SAAS,CAAC;QACdJ,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAea,eAAe,CAACpB;IACjC,GAAG;QAACA;QAAeO;KAAc;IAEjC,OAAO;AACT"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
$createGhostTextNode: function() {
|
|
13
|
-
return $createGhostTextNode;
|
|
14
|
-
},
|
|
15
|
-
$isGhostTextNode: function() {
|
|
16
|
-
return $isGhostTextNode;
|
|
17
|
-
},
|
|
18
|
-
GhostTextNode: function() {
|
|
19
|
-
return GhostTextNode;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
23
|
-
const _define_property = require("@swc/helpers/_/_define_property");
|
|
24
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
25
|
-
const _texteditor = require("@fluentui-copilot/text-editor");
|
|
26
|
-
const _GhostText = require("../../components/GhostText/GhostText");
|
|
27
|
-
class GhostTextNode extends _texteditor.DecoratorNode {
|
|
28
|
-
static clone(node) {
|
|
29
|
-
return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);
|
|
30
|
-
}
|
|
31
|
-
static getType() {
|
|
32
|
-
return 'ghosttext';
|
|
33
|
-
}
|
|
34
|
-
static importJSON(serializedNode) {
|
|
35
|
-
const node = $createGhostTextNode(serializedNode.id, serializedNode.content, serializedNode.exposeText, serializedNode.componentProps);
|
|
36
|
-
return node;
|
|
37
|
-
}
|
|
38
|
-
exportJSON() {
|
|
39
|
-
return {
|
|
40
|
-
type: 'ghosttext',
|
|
41
|
-
id: this.__id,
|
|
42
|
-
content: this.__content,
|
|
43
|
-
componentProps: this.__componentProps,
|
|
44
|
-
exposeText: this.__exposeText,
|
|
45
|
-
version: 1
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
isInline() {
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
isIsolated() {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
getTextContent() {
|
|
55
|
-
return this.__exposeText ? this.__content : '';
|
|
56
|
-
}
|
|
57
|
-
updateDOM(prevNode, dom, config) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
createDOM(config) {
|
|
61
|
-
// eslint-disable-next-line no-restricted-globals
|
|
62
|
-
return document.createElement('span');
|
|
63
|
-
}
|
|
64
|
-
decorate() {
|
|
65
|
-
return /*#__PURE__*/ _react.createElement(_GhostText.GhostText, {
|
|
66
|
-
nodeKey: this.getKey(),
|
|
67
|
-
...this.__componentProps
|
|
68
|
-
}, this.__content);
|
|
69
|
-
}
|
|
70
|
-
constructor(id, content, exposeText, componentProps, key){
|
|
71
|
-
super(key);
|
|
72
|
-
(0, _define_property._)(this, "__content", void 0);
|
|
73
|
-
(0, _define_property._)(this, "__id", void 0);
|
|
74
|
-
(0, _define_property._)(this, "__allowCommitting", void 0);
|
|
75
|
-
(0, _define_property._)(this, "__componentProps", void 0);
|
|
76
|
-
(0, _define_property._)(this, "__exposeText", void 0);
|
|
77
|
-
this.__id = id;
|
|
78
|
-
this.__content = content;
|
|
79
|
-
this.__exposeText = exposeText;
|
|
80
|
-
this.__componentProps = componentProps;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function $createGhostTextNode(id, content, exposeText, componentProps) {
|
|
84
|
-
return new GhostTextNode(id, content, exposeText, componentProps);
|
|
85
|
-
}
|
|
86
|
-
function $isGhostTextNode(node) {
|
|
87
|
-
return node instanceof GhostTextNode;
|
|
88
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.node.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-components';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../components/GhostText/GhostText.types';\nimport { GhostText } from '../../components/GhostText/GhostText';\n\nexport type SerializedGhostTextNode = Spread<\n {\n content: string;\n id: string;\n componentProps?: GhostTextProps;\n exposeText?: boolean;\n },\n SerializedLexicalNode\n>;\n\nexport class GhostTextNode extends DecoratorNode<JSXElement | null> {\n __content: string;\n __id: string;\n __allowCommitting?: boolean;\n __componentProps?: GhostTextProps;\n __exposeText?: boolean;\n\n static clone(node: GhostTextNode): GhostTextNode {\n return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);\n }\n\n static getType(): 'ghosttext' {\n return 'ghosttext';\n }\n\n static importJSON(serializedNode: SerializedGhostTextNode): GhostTextNode {\n const node = $createGhostTextNode(\n serializedNode.id,\n serializedNode.content,\n serializedNode.exposeText,\n serializedNode.componentProps,\n );\n return node;\n }\n\n exportJSON(): SerializedGhostTextNode {\n return {\n type: 'ghosttext',\n id: this.__id,\n content: this.__content,\n componentProps: this.__componentProps,\n exposeText: this.__exposeText,\n version: 1,\n };\n }\n\n constructor(id: string, content: string, exposeText?: boolean, componentProps?: GhostTextProps, key?: NodeKey) {\n super(key);\n this.__id = id;\n this.__content = content;\n this.__exposeText = exposeText;\n this.__componentProps = componentProps;\n }\n\n isInline() {\n return true;\n }\n\n isIsolated() {\n return true;\n }\n\n getTextContent(): string {\n return this.__exposeText ? this.__content : '';\n }\n\n updateDOM(prevNode: unknown, dom: HTMLElement, config: EditorConfig): boolean {\n return false;\n }\n\n createDOM(config: EditorConfig): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n decorate(): JSXElement | null {\n return (\n <GhostText nodeKey={this.getKey()} {...this.__componentProps}>\n {this.__content}\n </GhostText>\n );\n }\n}\n\nexport function $createGhostTextNode(\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: GhostTextProps,\n): GhostTextNode {\n return new GhostTextNode(id, content, exposeText, componentProps);\n}\n\nexport function $isGhostTextNode(node: LexicalNode | null | undefined): node is GhostTextNode {\n return node instanceof GhostTextNode;\n}\n"],"names":["$createGhostTextNode","$isGhostTextNode","GhostTextNode","DecoratorNode","clone","node","__id","__content","__exposeText","__componentProps","__key","getType","importJSON","serializedNode","id","content","exposeText","componentProps","exportJSON","type","version","isInline","isIsolated","getTextContent","updateDOM","prevNode","dom","config","createDOM","document","createElement","decorate","React","GhostText","nodeKey","getKey","constructor","key","__allowCommitting"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA4FgBA,oBAAAA;eAAAA;;IASAC,gBAAAA;eAAAA;;IAnFHC,aAAAA;eAAAA;;;;;iEAlBU;4BAGO;2BAGJ;AAYnB,MAAMA,sBAAsBC,yBAAAA;IAOjC,OAAOC,MAAMC,IAAmB,EAAiB;QAC/C,OAAO,IAAIH,cAAcG,KAAKC,IAAI,EAAED,KAAKE,SAAS,EAAEF,KAAKG,YAAY,EAAEH,KAAKI,gBAAgB,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,UAAuB;QAC5B,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAuC,EAAiB;QACxE,MAAMR,OAAOL,qBACXa,eAAeC,EAAE,EACjBD,eAAeE,OAAO,EACtBF,eAAeG,UAAU,EACzBH,eAAeI,cAAc;QAE/B,OAAOZ;IACT;IAEAa,aAAsC;QACpC,OAAO;YACLC,MAAM;YACNL,IAAI,IAAI,CAACR,IAAI;YACbS,SAAS,IAAI,CAACR,SAAS;YACvBU,gBAAgB,IAAI,CAACR,gBAAgB;YACrCO,YAAY,IAAI,CAACR,YAAY;YAC7BY,SAAS;QACX;IACF;IAUAC,WAAW;QACT,OAAO;IACT;IAEAC,aAAa;QACX,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACf,YAAY,GAAG,IAAI,CAACD,SAAS,GAAG;IAC9C;IAEAiB,UAAUC,QAAiB,EAAEC,GAAgB,EAAEC,MAAoB,EAAW;QAC5E,OAAO;IACT;IAEAC,UAAUD,MAAoB,EAAe;QAC3C,iDAAiD;QACjD,OAAOE,SAASC,aAAa,CAAC;IAChC;IAEAC,WAA8B;QAC5B,OAAA,WAAA,GACEC,OAAAF,aAAA,CAACG,oBAAAA,EAAAA;YAAUC,SAAS,IAAI,CAACC,MAAM;YAAK,GAAG,IAAI,CAAC1B,gBAAgB;WACzD,IAAI,CAACF,SAAS;IAGrB;IAnCA6B,YAAYtB,EAAU,EAAEC,OAAe,EAAEC,UAAoB,EAAEC,cAA+B,EAAEoB,GAAa,CAAE;QAC7G,KAAK,CAACA;QApCR9B,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,aAAAA,KAAAA;QACAD,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,QAAAA,KAAAA;QACAgC,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,qBAAAA,KAAAA;QACA7B,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,oBAAAA,KAAAA;QACAD,IAAAA,kBAAAA,EAAAA,IAAAA,EAAAA,gBAAAA,KAAAA;QAiCE,IAAI,CAACF,IAAI,GAAGQ;QACZ,IAAI,CAACP,SAAS,GAAGQ;QACjB,IAAI,CAACP,YAAY,GAAGQ;QACpB,IAAI,CAACP,gBAAgB,GAAGQ;IAC1B;AA8BF;AAEO,SAASjB,qBACdc,EAAU,EACVC,OAAe,EACfC,UAAoB,EACpBC,cAA+B;IAE/B,OAAO,IAAIf,cAAcY,IAAIC,SAASC,YAAYC;AACpD;AAEO,SAAShB,iBAAiBI,IAAoC;IACnE,OAAOA,gBAAgBH;AACzB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
$createGhostTextNode: function() {
|
|
13
|
-
return _GhostTextnode.$createGhostTextNode;
|
|
14
|
-
},
|
|
15
|
-
$isGhostTextNode: function() {
|
|
16
|
-
return _GhostTextnode.$isGhostTextNode;
|
|
17
|
-
},
|
|
18
|
-
GhostTextNode: function() {
|
|
19
|
-
return _GhostTextnode.GhostTextNode;
|
|
20
|
-
},
|
|
21
|
-
GhostTextPlugin: function() {
|
|
22
|
-
return _GhostText.GhostTextPlugin;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const _GhostText = require("./GhostText");
|
|
26
|
-
const _GhostTextnode = require("./GhostText.node");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { GhostTextPluginProps } from './GhostText';\nexport { GhostTextPlugin } from './GhostText';\nexport type { SerializedGhostTextNode } from './GhostText.node';\nexport { $createGhostTextNode, $isGhostTextNode, GhostTextNode } from './GhostText.node';\n"],"names":["$createGhostTextNode","$isGhostTextNode","GhostTextNode","GhostTextPlugin"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGSA,oBAAoB;eAApBA,mCAAoB;;IAAEC,gBAAgB;eAAhBA,+BAAgB;;IAAEC,aAAa;eAAbA,4BAAa;;IAFrDC,eAAe;eAAfA,0BAAe;;;2BAAQ;+BAEsC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "ImperativeControlPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return ImperativeControlPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
14
|
-
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
15
|
-
const ImperativeControlPlugin = /*#__PURE__*/ _react.forwardRef((_props, ref)=>{
|
|
16
|
-
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
17
|
-
_react.useImperativeHandle(ref, ()=>new _chatinputplugins.ImperativeControlBase(editor), [
|
|
18
|
-
editor
|
|
19
|
-
]);
|
|
20
|
-
return null;
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ImperativeControl.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { IImperativeControlBase } from '@fluentui-copilot/chat-input-plugins';\nimport { ImperativeControlBase } from '@fluentui-copilot/chat-input-plugins';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\n\nexport type ImperativeControlPluginRef = IImperativeControlBase;\nexport type ImperativeControlPluginProps = {};\n\nexport const ImperativeControlPlugin = React.forwardRef<ImperativeControlPluginRef, ImperativeControlPluginProps>(\n (_props, ref) => {\n const [editor] = useLexicalComposerContext();\n\n React.useImperativeHandle(ref, () => new ImperativeControlBase(editor), [editor]);\n\n return null;\n },\n);\n"],"names":["ImperativeControlPlugin","React","forwardRef","_props","ref","editor","useLexicalComposerContext","useImperativeHandle","ImperativeControlBase"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;kCAEe;iCACI;AAKnC,MAAMA,0BAAAA,WAAAA,GAA0BC,OAAMC,UAAU,CACrD,CAACC,QAAQC;IACP,MAAM,CAACC,OAAO,GAAGC,IAAAA,0CAAAA;IAEjBL,OAAMM,mBAAmB,CAACH,KAAK,IAAM,IAAII,uCAAAA,CAAsBH,SAAS;QAACA;KAAO;IAEhF,OAAO;AACT"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "ImperativeControlPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _ImperativeControl.ImperativeControlPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _ImperativeControl = require("./ImperativeControl");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { ImperativeControlPluginProps, ImperativeControlPluginRef } from './ImperativeControl';\nexport { ImperativeControlPlugin } from './ImperativeControl';\n"],"names":["ImperativeControlPlugin"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BACSA;;;eAAAA,0CAAuB;;;mCAAQ"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "ManualGhostTextPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return ManualGhostTextPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
14
|
-
const _GhostText = require("../../GhostText");
|
|
15
|
-
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
16
|
-
const ManualGhostTextPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
-
const { id } = props;
|
|
18
|
-
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
19
|
-
_react.useImperativeHandle(ref, ()=>new _chatinputplugins.ManualGhostTextBase(editor, id, _GhostText.$isGhostTextNode, _GhostText.$createGhostTextNode), [
|
|
20
|
-
editor,
|
|
21
|
-
id
|
|
22
|
-
]);
|
|
23
|
-
return null;
|
|
24
|
-
});
|
|
25
|
-
ManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["ManualGhostText.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport type { GhostTextProps } from '../../GhostText';\nimport { $createGhostTextNode, $isGhostTextNode } from '../../GhostText';\nimport type { IManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';\nimport { ManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type ManualGhostTextProps = {\n id: string;\n};\n\nexport type ManualGhostTextRef = IManualGhostTextBase<GhostTextProps>;\n\nexport const ManualGhostTextPlugin = React.forwardRef<ManualGhostTextRef, ManualGhostTextProps>((props, ref) => {\n const { id } = props;\n const [editor] = useLexicalComposerContext();\n\n React.useImperativeHandle<ManualGhostTextRef, ManualGhostTextRef>(\n ref,\n () => new ManualGhostTextBase(editor, id, $isGhostTextNode, $createGhostTextNode),\n [editor, id],\n );\n\n return null;\n});\n\nManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';\n"],"names":["ManualGhostTextPlugin","React","forwardRef","props","ref","id","editor","useLexicalComposerContext","useImperativeHandle","ManualGhostTextBase","$isGhostTextNode","$createGhostTextNode","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;iCACmB;2BAEa;kCAEnB;AAQ7B,MAAMA,sCAAwBC,OAAMC,UAAU,CAA2C,CAACC,OAAOC;IACtG,MAAM,EAAEC,EAAE,EAAE,GAAGF;IACf,MAAM,CAACG,OAAO,GAAGC,IAAAA,0CAAAA;IAEjBN,OAAMO,mBAAmB,CACvBJ,KACA,IAAM,IAAIK,qCAAAA,CAAoBH,QAAQD,IAAIK,2BAAAA,EAAkBC,+BAAAA,GAC5D;QAACL;QAAQD;KAAG;IAGd,OAAO;AACT;AAEAL,sBAAsBY,WAAW,GAAG"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "ManualGhostTextPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _ManualGhostText.ManualGhostTextPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _ManualGhostText = require("./ManualGhostText");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { ManualGhostTextProps, ManualGhostTextRef } from './ManualGhostText';\nexport { ManualGhostTextPlugin } from './ManualGhostText';\n"],"names":["ManualGhostTextPlugin"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BACSA;;;eAAAA,sCAAqB;;;iCAAQ"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "PasteUnfurlingPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return PasteUnfurlingPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
-
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
14
|
-
const _ChatInputEntity = require("../../ChatInputEntity");
|
|
15
|
-
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
16
|
-
const PasteUnfurlingPlugin = (props)=>{
|
|
17
|
-
const { $createEntityNode = _ChatInputEntity.$createChatInputEntityNode, ...rest } = props;
|
|
18
|
-
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
19
|
-
_react.useEffect(()=>{
|
|
20
|
-
return (0, _chatinputplugins.registerPasteUnfurlingPlugin)(editor, {
|
|
21
|
-
...rest,
|
|
22
|
-
$createEntityNode
|
|
23
|
-
});
|
|
24
|
-
}, [
|
|
25
|
-
$createEntityNode,
|
|
26
|
-
editor,
|
|
27
|
-
rest
|
|
28
|
-
]);
|
|
29
|
-
return null;
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["PasteUnfurling.ts"],"sourcesContent":["import * as React from 'react';\nimport { registerPasteUnfurlingPlugin, type PasteUnfurlingPluginBaseProps } from '@fluentui-copilot/chat-input-plugins';\nimport { $createChatInputEntityNode, type ChatInputEntityProps } from '../../ChatInputEntity';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\n\nexport type PasteUnfurlingPluginProps<ExtraDataType> = Omit<\n PasteUnfurlingPluginBaseProps<ExtraDataType, ChatInputEntityProps>,\n '$createEntityNode'\n> &\n Pick<Partial<PasteUnfurlingPluginBaseProps<ExtraDataType, ChatInputEntityProps>>, '$createEntityNode'>;\n\nexport const PasteUnfurlingPlugin = <ExtraDataType>(props: PasteUnfurlingPluginProps<ExtraDataType>) => {\n const { $createEntityNode = $createChatInputEntityNode, ...rest } = props;\n\n const [editor] = useLexicalComposerContext();\n\n React.useEffect(() => {\n return registerPasteUnfurlingPlugin(editor, { ...rest, $createEntityNode });\n }, [$createEntityNode, editor, rest]);\n\n return null;\n};\n"],"names":["PasteUnfurlingPlugin","props","$createEntityNode","$createChatInputEntityNode","rest","editor","useLexicalComposerContext","React","useEffect","registerPasteUnfurlingPlugin"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;kCAC0D;iCACX;iCAC5B;AAQnC,MAAMA,uBAAuB,CAAgBC;IAClD,MAAM,EAAEC,oBAAoBC,2CAA0B,EAAE,GAAGC,MAAM,GAAGH;IAEpE,MAAM,CAACI,OAAO,GAAGC,IAAAA,0CAAAA;IAEjBC,OAAMC,SAAS,CAAC;QACd,OAAOC,IAAAA,8CAAAA,EAA6BJ,QAAQ;YAAE,GAAGD,IAAI;YAAEF;QAAkB;IAC3E,GAAG;QAACA;QAAmBG;QAAQD;KAAK;IAEpC,OAAO;AACT"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "PasteUnfurlingPlugin", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _PasteUnfurling.PasteUnfurlingPlugin;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _PasteUnfurling = require("./PasteUnfurling");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PasteUnfurlingPluginProps } from './PasteUnfurling';\nexport { PasteUnfurlingPlugin } from './PasteUnfurling';\n"],"names":["PasteUnfurlingPlugin"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BACSA;;;eAAAA,oCAAoB;;;gCAAQ"}
|