@fluentui-copilot/react-chat-input-plugins 0.4.10-hotfix.1 → 0.4.10-hotfix.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +4 -4
- package/CHANGELOG.md +5 -5
- package/lib/BasicFunctionality.js +1 -0
- package/lib/ChatInputEntity.js +1 -0
- package/lib/ChatInputToken.js +1 -0
- package/lib/GhostText.js +1 -0
- package/lib/ImperativeControl.js +1 -0
- package/lib/PasteUnfurling.js +1 -0
- package/lib/components/ChatInputEntity/ChatInputEntity.js +5 -4
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js +3 -2
- package/lib/components/ChatInputEntity/index.js +1 -0
- package/lib/components/ChatInputEntity/renderChatInputEntity.js +8 -9
- package/lib/components/ChatInputEntity/useChatInputEntity.js +44 -40
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +35 -31
- package/lib/components/ChatInputToken/ChatInputToken.js +5 -4
- package/lib/components/ChatInputToken/ChatInputToken.node.js +50 -49
- package/lib/components/ChatInputToken/ChatInputToken.types.js +2 -1
- package/lib/components/ChatInputToken/index.js +1 -0
- package/lib/components/ChatInputToken/renderChatInputToken.js +6 -4
- package/lib/components/ChatInputToken/useChatInputToken.js +14 -12
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +19 -15
- package/lib/components/GhostText/GhostText.js +5 -4
- package/lib/components/GhostText/GhostText.types.js +3 -2
- package/lib/components/GhostText/index.js +1 -0
- package/lib/components/GhostText/renderGhostText.js +8 -9
- package/lib/components/GhostText/useGhostText.js +39 -36
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js +29 -25
- package/lib/index.js +1 -0
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +53 -67
- package/lib/plugins/BasicFunctionality/index.js +1 -0
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +68 -67
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js +38 -37
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +2 -1
- package/lib/plugins/ChatInputEntity/index.js +1 -0
- package/lib/plugins/GhostText/GhostText.js +37 -43
- package/lib/plugins/GhostText/GhostText.node.js +57 -56
- package/lib/plugins/GhostText/index.js +1 -0
- package/lib/plugins/ImperativeControl/ImperativeControl.js +5 -6
- package/lib/plugins/ImperativeControl/index.js +1 -0
- package/lib/plugins/ManualGhostText/ManualGhostText.js +8 -8
- package/lib/plugins/ManualGhostText/index.js +1 -0
- package/lib/plugins/PasteUnfurling/PasteUnfurling.js +14 -14
- package/lib/plugins/PasteUnfurling/index.js +1 -0
- package/lib-commonjs/BasicFunctionality.js +1 -0
- package/lib-commonjs/ChatInputEntity.js +1 -0
- package/lib-commonjs/ChatInputToken.js +1 -0
- package/lib-commonjs/GhostText.js +1 -0
- package/lib-commonjs/ImperativeControl.js +1 -0
- package/lib-commonjs/PasteUnfurling.js +1 -0
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +1 -0
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/index.js +1 -0
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +1 -0
- package/lib-commonjs/components/ChatInputToken/index.js +1 -0
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.js +1 -1
- package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js +1 -0
- package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -1
- package/lib-commonjs/components/GhostText/index.js +1 -0
- package/lib-commonjs/components/GhostText/renderGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/index.js +1 -0
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +1 -0
- package/lib-commonjs/plugins/ChatInputEntity/index.js +1 -0
- package/lib-commonjs/plugins/GhostText/GhostText.js +3 -2
- package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/index.js +1 -0
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js +1 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
- package/lib-commonjs/plugins/ImperativeControl/index.js +1 -0
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js +1 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
- package/lib-commonjs/plugins/ManualGhostText/index.js +1 -0
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js.map +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/index.js +1 -0
- package/package.json +5 -5
|
@@ -48,4 +48,4 @@ const useGhostTextStyles_unstable = (state)=>{
|
|
|
48
48
|
state.indicator.className = (0, _reactcomponents.mergeClasses)(ghostTextClassNames.indicator, styles.indicator, state.indicator.className);
|
|
49
49
|
}
|
|
50
50
|
return state;
|
|
51
|
-
};
|
|
51
|
+
}; //# sourceMappingURL=useGhostTextStyles.styles.raw.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["ghostTextClassNames","
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["ghostTextClassNames","styles","useStyles","root","indicator","makeStyles","color","whiteSpace","tokens","gap","spacingHorizontalXS","typographyStyles","colorNeutralForeground3","backgroundColor","colorNeutralBackground5","spacingVerticalNone","borderRadius","borderRadiusSmall","spacingHorizontalSNudge","marginLeft","merginRight","state","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,mBAAAA;eAAAA;;IAgCLC,2BAASC;eAATD;;;iCArCmD;wBACpC;AAIhB,MAAMD,sBAAsD;UACjEG;eACAC;AACF;AAEA;;CAEC,SAECD,YAAME,IAAAA,2BAAA,EAAA;UACJC;eACAC,cAAAA,CAAAA,uBAAY;oBACPC;QACPC,KAAAD,cAAA,CAAAE,mBAAA;;eAGKC;4CACWC,CAAAA,cAAAA;eACdC,cAAAA,CAAAA,uBAAwBC;yBACZN,cAAOO,CAAAA,uBAAuBP;iBAC1CQ,CAAAA,EAAAA,cAAcR,CAAAA,mBAAOS,CAAAA,CAAAA,EAAiBT,cAAA,CAAAU,uBAAA,CAAA,CAAA;sBACtCC,cAAYX,CAAAA,iBAAOE;oBACnBU,cAAaZ,CAAAA,mBAAOE;QACtBU,aAAAZ,cAAA,CAAAE,mBAAA;IACF;AAEA;AAME,MAAMT,8BAASC,CAAAA;;UAIbmB,SAAMjB;UAKRD,IAAA,CAAAmB,SAAA,GAAAC,IAAAA,6BAAA,EAAAvB,oBAAAG,IAAA,EAAAF,OAAAE,IAAA,EAAAkB,MAAAlB,IAAA,CAAAmB,SAAA;QAEAD,MAAOA,SAAAA,EAAAA;QACPA,MAAAjB,SAAA,CAAAkB,SAAA,GAAAC,IAAAA,6BAAA,EAAAvB,oBAAAI,SAAA,EAAAH,OAAAG,SAAA,EAAAiB,MAAAjB,SAAA,CAAAkB,SAAA"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -106,3 +106,4 @@ const _ChatInputToken = require("./ChatInputToken");
|
|
|
106
106
|
const _BasicFunctionality = require("./BasicFunctionality");
|
|
107
107
|
const _ImperativeControl = require("./ImperativeControl");
|
|
108
108
|
const _PasteUnfurling = require("./PasteUnfurling");
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (basicFunctionalityImpl && !setDefaultValue.current) {\n if (defaultValue) {\n basicFunctionalityImpl.insertDefaultValue(defaultValue);\n }\n setDefaultValue.current = true;\n }\n }, [basicFunctionalityImpl, defaultValue, editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","defaultValue","
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (basicFunctionalityImpl && !setDefaultValue.current) {\n if (defaultValue) {\n basicFunctionalityImpl.insertDefaultValue(defaultValue);\n }\n setDefaultValue.current = true;\n }\n }, [basicFunctionalityImpl, defaultValue, editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","defaultValue","editor","trimWhitespace","basicFunctionalityImpl","useIsomorphicLayoutEffect","setBasicFunctionalityImpl","useLexicalComposerContext","useState","BasicFunctionalityBase","isSentinelNodeEnabled","prev","cleanup","useImperativeHandle","setIsDisabled","isDisabled","useRef","insertDefaultValue","current","setDefaultValue","activateContentCallbacks","onContentChange","onCountChanged","useEffect","deactivateContentCallbacks","onPaste","activateTrimWhitespace","deactivateTrimWhitespace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAoBaA;;;eAAAA;;;;iEApBU;iCACmB;iCACA;kCAEH;AAgBhC,MAAMA,yCAA2BC,OAAMC,UAAU,CACtD,CAACC,OAAOC;UACN,EAEAC,YAAOC,EAEPC,cAAOC,EAEPC,cAAAA,iBACEC,SAEA,uBACEA;kBAEE,GAAAC,IAAAA,0CAAO;mCACTD,0BAAA,GAAAT,OAAAW,QAAA,CAAA;kDACF,EAAA;QACFF,0BAAG,IAAAG,wCAAA,CAAAP,QAAAQ;eAACR;sCAAQQ,CAAAA;gBAAsBC,SAAA,QAAAA,SAAA,KAAA,IAAA,KAAA,IAAAA,KAAAC,OAAA;gBAElCf,OAAMgB;;;;;QAKFH;KAAA;WACFG,mBACA,CAAAb,KAAA,IAAA,CAAA;2BAACI,UAAAA;gBAAuBA,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAU,aAAA,CAAAC;YAG1B;YACA;QAAAX;KAAA;UACAC,kBAAAA,OAA0BW,MAAA,CAAA;4EACgC;kDAClDf,EAAAA;sCACFG,CAAAA,gBAAuBa,OAAmBhB,EAAAA;8BAC5C;uCACgBiB,kBAAU,CAAAjB;;YAE9BkB,gBAAGD,OAAA,GAAA;;;;QAAyBjB;QAAAA;KAAAA;WAAcC,SAAAA,CAAAA;mCAAO,QAAAE,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAgB,wBAAA,CAAAC,iBAAAC;QAEjDzB,OAAM0B,IAAAA,2BAAU,QAAAnB,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAoB,0BAAA;;;QACdpB;QAAAA;QAAAA;KAAAA;WACAmB,SAAO,CAAA;QACT,IAAGE,SAAA;uCAACrB,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,qBAAAA,CAAAA;;eAAgCiB,IAAAA,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,uBAAAA;;;QAAiBC;QAAAA;KAAAA;WAAeC,SAAA,CAAA;QAEpE1B,IAAAA,gBAAgB;uCACD,QAAAO,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAsB,sBAAA;;eAEb,IAAAtB,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAuB,wBAAA;;;QACavB;QAAAA;KAAAA;WACZ;kDAAyBF"}
|
|
@@ -1 +1 @@
|
|
|
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 { 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<JSX.Element | 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): JSX.Element | 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":";;;;;;;;;;;IAwGgBA,0BAAAA;eAAAA;;IAUAC,sBAAAA;eAAAA;;IA9FHC,mBAAAA;eAAAA;;;;;iEApBU;4BAEO;iCAUE;AAQzB,MAAMA,4BAA+BC,yBAAAA;
|
|
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 { 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<JSX.Element | 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): JSX.Element | 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":";;;;;;;;;;;IAwGgBA,0BAAAA;eAAAA;;IAUAC,sBAAAA;eAAAA;;IA9FHC,mBAAAA;eAAAA;;;;;iEApBU;4BAEO;iCAUE;AAQzB,MAAMA,4BAA+BC,yBAAAA;WAM1CC,UAAOA;eACL;;WAEFC,MAAOA,IAASC,EAA4B;eAC1C,IAAOJ,oBAAIA,KAAoBI,UAAKC,EAAAA,KAAYD,MAAKE,EAAAA,KAAQF,MAAKG,EAAAA,KAAQH,aAAKI,EAAAA,KAAeJ,KAAKK;;WAGrGC,WAAOA,cAAcC,EAAgD;eACnEb,2BAAOA,eACLa,QAAeC,EAAAA,eACfD,IAAeE,EAAAA,eACfF,IAAeG,EAAAA,eACfH,WAAeI;;iBAInBC;eACE;;eAEFC;eACE;;qBAGFC;eACE,IAAO,CAAAZ,MAAKA;;iBAGda;eACE;sBACEP,IAAAA,CAAAA,UAAeP;kBACfQ,IAAAA,CAAAA,MAAWP;kBACXQ,IAAAA,CAAAA,MAAWP;yBACXQ,IAAAA,CAAAA,aAAkBP;kBAClBY,oBAAMpB,OAAoBE;qBAC1BmB;;;gBAYJC;yDACE;eACAC,SAAOA,aAASC,CAAAA;;gBAGlBC;eACE;;aAGFC,OAASC,EAAsBC,MAAEA,EAAoB;;YACnD,AAAAC,CAAAA,sBAAI,IAAA,CAAArB,aAAKA,MAAa,QAAAqB,wBAAlB,KAAA,IAAA,KAAA,IAAAA,oBAAAC,QAAoBA,EAAAA;mBACtB,WAAA,GAAAC,OAAAP,aAAO,CAAAQ,gCAACA,EAAAA,IAAAA,CAAAA,aAAyBxB;;eAEnC,WAAA,GAAAuB,OAAOP,aAAA,CAAAQ,gCAACA,EAAAA,IAAAA,CAAoBxB,aAAKA,EAAAA,IAAa,CAAGF,MAAKA;;oBAGxD2B;eACE;kBACEpB,IAAAA,CAAAA,MAAWP;kBACXQ,IAAAA,CAAAA,MAAWP;yBACXQ,IAAAA,CAAAA,aAAkBP;;;qBAItB0B,IAAiBpB,EAAkD;cACjEqB,WAAMA,IAAW,CAAAC,WAAKA;iBACtBD,MAAS7B,GAAAA,KAASQ,IAAKD;iBACvBsB,MAAS5B,GAAAA,KAASO,IAAKA;iBACvBqB,aAAS3B,GAAAA,KAAgBM,WAAKC;;gBApChCsB,QAAYzB,EAAgBC,IAAEA,EAAYC,IAAEA,EAAQC,WAAEA,EAAkCuB,GAAEA,CAAa;aACrG,CAAAA;8BA5CFjC,EAAAA,IAAAA,EAAAA,cAAAA,KAAAA;8BACAC,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;8BACAE,EAAAA,IAAAA,EAAAA,iBAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;YA0CE,CAAAF,UAAKA,GAAAA;YACL,CAAAC,MAAKA,GAAAA;YACL,CAAAC,MAAKA,GAAAA;YACL,CAAAC,aAAKA,GAAAA;;AAiCT;AAEO,SAASV,2BACdc,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCuB,GAAa;WAEb,IAAOtC,oBAAIA,UAAoBY,MAAUC,MAAMC,aAAMC;AACvD;AAEO,SAAShB,uBAA0BK,IAAoC;WAC5EA,gBAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
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","chatInputEntityPluginBase","React","useEffect","editor","onChatInputEntityAdded","onChatInputEntityDeleted","skipInitialization","useImperativeHandle","insertChatInputEntity","current","_chatInputEntityPluginBase_current","getActiveEntities","_chatInputEntityPluginBase_current_getActiveEntities","removeChatInputEntity","keyOrPredicate","updateChatInputEntityProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iCAR6B;iEACnB;qCACiE;kCAG9C;AAGnC,MAAMA,wBAAwBC,CAAAA;UAKnC,EACAC,EAAA,EAEAC,UAAMC,EAMNC,sBAAgB,0BACdD,oBAcO;mEAAMA;;WACZE,SAAA,CAAA;kCAACC,OAAAA,GAAAA,IAAAA,2CAAAA,CAAAA,QAAAA,IAAAA,wCAAAA,EAAAA,+CAAAA,EAAAA,2CAAAA,EAAAA,wBAAAA;eAAQL;gBAAIM;mBAAwBC,CAAAA,qCAAAA,0BAAAA,OAAAA,MAAAA,QAAAA,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,OAAAA;;OAA6C;QAAAF;QAAAL;QAAAM;QAAAC;QAAAC;KAAA;WAErFL,mBAAMM,CAAAA,YACJR,IACO,CAAA;mCACLS,KAAAA;;6DACSR,0BAAAA,OAAAA,MAA0BS,QAAOC,uCAAjCV,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,qBAAmCQ,CAAAA;;;;;+EAInCR,CAAAA,qCAAAA,0BAAAA,OAAAA,MAA0BS,QAAOC,uCAAjCV,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,iBAAmCW,EAAAA,MAAAA,QAAiBC,yDAApDZ,KAAAA,IAAAA,uDAAAA,EAAAA;;mCAGTa,cAAsBC;;sDACpBd,0BAAAA,OAAAA,MAA0BS,QAAOC,uCAAjCV,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,qBAAmCa,CAAAA;;wCAGrCE,cAA2BD,EAAAA,KAAAA;;sDACzBd,0BAAAA,OAAAA,MAA0BS,QAAOC,uCAAjCV,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,0BAAmCe,CAAAA,gBAA2BD;;cAElE;WAGF;AACF"}
|
|
@@ -27,7 +27,8 @@ function GhostTextPlugin(props) {
|
|
|
27
27
|
return null;
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
}, //
|
|
30
|
+
}, // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
32
|
[
|
|
32
33
|
editor,
|
|
33
34
|
id
|
|
@@ -57,4 +58,4 @@ function GhostTextPlugin(props) {
|
|
|
57
58
|
ghostTextBase
|
|
58
59
|
]);
|
|
59
60
|
return null;
|
|
60
|
-
}
|
|
61
|
+
} //# sourceMappingURL=GhostText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\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): JSX.Element | 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","
|
|
1
|
+
{"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\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): JSX.Element | 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","ghostTextBase","React","setGhostTextBase","useLexicalComposerContext","useState","useEffect","GhostTextPluginBase","editor","id","GhostTextNode","$createGhostTextNode","ghostTextProps","exposeText","allowCompletion","prev","setAllowCompletion","setExposeText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAqBgBA;;;eAAAA;;;;iEArBO;iCACmB;2BAGL;+BACP;kCACM;AAe7B,SAASA,gBAAgBC,KAA2B;;UAIzD,EAEAC,aAAOC,EAEPC,EAAAA,gBAEIC,YAaA,iBACEA;kBAEE,GAAAC,IAAAA,0CAAO;0BACTD,iBAAA,GAAAD,OAAAG,QAAA,CAAA;WACFC,SAAA,CAAA;QACFH,iBACA,IAAAI,qCAAA,CAAAC,QAAAC,IAAAT,eAAAU,4BAAA,EAAAC,+BAAA,EAAAC,gBAAAC,YAAwHC;QACxH,OAAA;YACAX,iBAAAY,CAAAA;gBAACP,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAAA,OAAAA;gBAAQC,OAAAA;YAAG;QAGdP;+HAEG;2DAACY;;;QAAiBb;KAAAA;WAAcK,SAAA,CAAA;QAEnCJ,kBAAgB,QAAAD,kBAAA,KAAA,IAAA,KAAA,IAAAA,cAAAe,kBAAA,CAAAF;;;QACdb;KAAAA;WACCK,SAAA,CAAA;0BAACL,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAAA,iBAAAA,CAAAA;;;QAAeW;KAAAA;WAAeN,SAAA,CAAA;QAElCJ,kBAAgB,QAAAD,kBAAA,KAAA,IAAA,KAAA,IAAAA,cAAAgB,aAAA,CAAAJ;;;QACdZ;KAAAA;WACCK,SAAA,CAAA;0BAACO,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAAA,eAAAA,CAAAA;;;QAAYZ;KAAAA;WAAc;uCAG5BA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["GhostText.node.tsx"],"sourcesContent":["import * as React from 'react';\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<JSX.Element | 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(): JSX.Element | 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":";;;;;;;;;;;IA2FgBA,oBAAAA;eAAAA;;IASAC,gBAAAA;eAAAA;;IAnFHC,aAAAA;eAAAA;;;;;iEAjBU;4BAEO;2BAGJ;AAYnB,MAAMA,sBAAsBC,yBAAAA;
|
|
1
|
+
{"version":3,"sources":["GhostText.node.tsx"],"sourcesContent":["import * as React from 'react';\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<JSX.Element | 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(): JSX.Element | 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":";;;;;;;;;;;IA2FgBA,oBAAAA;eAAAA;;IASAC,gBAAAA;eAAAA;;IAnFHC,aAAAA;eAAAA;;;;;iEAjBU;4BAEO;2BAGJ;AAYnB,MAAMA,sBAAsBC,yBAAAA;WAOjCC,MAAOA,IAAMC,EAAmB;eAC9B,IAAOH,cAAIA,KAAcG,IAAKC,EAAAA,KAAMD,SAAKE,EAAAA,KAAWF,YAAKG,EAAAA,KAAcH,gBAAKI,EAAAA,KAAkBJ,KAAKK;;WAGrGC,UAAOA;eACL;;WAGFC,WAAOA,cAAWC,EAAuC;cACvDR,OAAMA,qBAAOL,eACXa,EAAAA,EAAeC,eACfD,OAAeE,EAAAA,eACfF,UAAeG,EAAAA,eACfH,cAAeI;eAEjBZ;;iBAGFa;eACE;kBACEC;oBACAL,CAAAA,IAAI;qBACJC,IAAAA,CAAAA,SAAcR;4BACdU,IAAAA,CAAAA,gBAAqBR;wBACrBO,IAAAA,CAAAA,YAAiBR;qBACjBY;;;eAYJC;eACE;;iBAGFC;eACE;;qBAGFC;eACE,IAAO,CAAAf,YAAKA,GAAAA,IAAe,CAAAD,SAAKA,GAAAA;;cAGlCiB,QAAUC,EAAiBC,GAAEA,EAAgBC,MAAEA,EAAoB;eACjE;;cAGFC,MAAUD,EAAoB;yDAC5B;eACAE,SAAOA,aAASC,CAAAA;;eAGlBC;eACE,WAAA,GAAAC,OACEF,aAAA,CAAAG,oBAACA,EAAAA;qBAAUC,IAAAA,CAAAA,MAAcC;mBAAW,CAAA1B,gBAAQA;eACzC,CAAAF,SAAKA;;gBAhCZ6B,EAAYtB,EAAUC,OAAEA,EAAeC,UAAEA,EAAoBC,cAAEA,EAA+BoB,GAAEA,CAAa;aAC3G,CAAAA;8BApCF9B,EAAAA,IAAAA,EAAAA,aAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,QAAAA,KAAAA;8BACAgC,EAAAA,IAAAA,EAAAA,qBAAAA,KAAAA;8BACA7B,EAAAA,IAAAA,EAAAA,oBAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,gBAAAA,KAAAA;YAiCE,CAAAF,IAAKA,GAAAA;YACL,CAAAC,SAAKA,GAAAA;YACL,CAAAC,YAAKA,GAAAA;YACL,CAAAC,gBAAKA,GAAAA;;AA+BT;AAEO,SAAST,qBACdc,EAAU,EACVC,OAAe,EACfC,UAAoB,EACpBC,cAA+B;WAE/B,IAAOf,cAAIA,IAAcY,SAAIC,YAASC;AACxC;AAEO,SAASf,iBAAiBI,IAAoC;WACnEA,gBAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
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","editor","useLexicalComposerContext","useImperativeHandle","ref","ImperativeControlBase"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;kCAEe;iCACI;AAKnC,MAAMA,0BAAAA,WAAAA,GAAAA,OAA0BC,UAAMC,CAAU,CACrDC,QAACA;UACC,CAAAC,OAAOA,GAAOC,IAAAA,0CAAGA;WAEjBJ,mBAAMK,CAAAA,KAAoBC,IAAW,IAAIC,uCAAAA,CAAsBJ,SAAS;QAAAA;KAAA;WAACA;iDAElE"}
|
|
@@ -22,4 +22,4 @@ const ManualGhostTextPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
22
22
|
]);
|
|
23
23
|
return null;
|
|
24
24
|
});
|
|
25
|
-
ManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';
|
|
25
|
+
ManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin'; //# sourceMappingURL=ManualGhostText.js.map
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
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","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;iCACmB;2BAEa;kCAEnB;AAQ7B,MAAMA,sCAAwBC,OAAMC,UAAU,CAA2C,CAACC,OAAOC;UACtG,EACAC,EAAA,KAEAJ;UAGGK,CAAAA,OAAAA,GAAAA,IAAAA,0CAAAA;WAAQD,mBAAAA,CAAAA,KAAAA,IAAAA,IAAAA,qCAAAA,CAAAA,QAAAA,IAAAA,2BAAAA,EAAAA,+BAAAA,GAAAA;QAAAA;QAAAA;KAAAA;WAAG;;AAIhBL,sBAAGO,WAAA,GAAA,yBAEHP,2CAAoC"}
|
|
@@ -1 +1 @@
|
|
|
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","
|
|
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","useLexicalComposerContext","React","rest","registerPasteUnfurlingPlugin","editor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;kCAC0D;iCACX;iCAC5B;AAQnC,MAAMA,uBAAuBC,CAAAA;UAClC,EAEAC,oBAAiBC,2CAAAA,EAEjBC,GAAAA;kBACmDC,GAAIF,IAAAA,0CAAA;oBAAED,CAAAA;eAAkBI,IAAAA,8CAAA,EAAAC,QAAA;YAC3E,GAAGF,IAAA;;;;;QAA4BA;QAAAA;KAAAA;WAAK;GAGtC,0CAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
|
-
"version": "0.4.10-hotfix.
|
|
3
|
+
"version": "0.4.10-hotfix.2",
|
|
4
4
|
"description": "A Fluent AI package for React-based ChatInput plugins.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/chat-input-plugins": "0.4.2-hotfix.
|
|
16
|
-
"@fluentui-copilot/react-text-editor": "0.4.1-hotfix.
|
|
17
|
-
"@fluentui-copilot/text-editor": "0.3.1-hotfix.
|
|
18
|
-
"@fluentui-copilot/tokens": "0.3.11-hotfix.
|
|
15
|
+
"@fluentui-copilot/chat-input-plugins": "0.4.2-hotfix.3",
|
|
16
|
+
"@fluentui-copilot/react-text-editor": "0.4.1-hotfix.3",
|
|
17
|
+
"@fluentui-copilot/text-editor": "0.3.1-hotfix.3",
|
|
18
|
+
"@fluentui-copilot/tokens": "0.3.11-hotfix.2",
|
|
19
19
|
"@swc/helpers": "^0.5.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|