@fluentui-copilot/react-chat-input-plugins 0.0.3 → 0.0.4

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.
Files changed (94) hide show
  1. package/CHANGELOG.json +28 -1
  2. package/CHANGELOG.md +13 -2
  3. package/dist/index.d.ts +1 -0
  4. package/lib/BasicFunctionality.js.map +1 -1
  5. package/lib/ChatInputEntity.js.map +1 -1
  6. package/lib/ChatInputToken.js.map +1 -1
  7. package/lib/GhostText.js.map +1 -1
  8. package/lib/ImperativeControl.js.map +1 -1
  9. package/lib/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
  10. package/lib/components/ChatInputEntity/ChatInputEntity.types.js +3 -1
  11. package/lib/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
  12. package/lib/components/ChatInputEntity/index.js.map +1 -1
  13. package/lib/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
  14. package/lib/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
  15. package/lib/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -1
  16. package/lib/components/ChatInputToken/ChatInputToken.js.map +1 -1
  17. package/lib/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
  18. package/lib/components/ChatInputToken/ChatInputToken.types.js +3 -1
  19. package/lib/components/ChatInputToken/ChatInputToken.types.js.map +1 -1
  20. package/lib/components/ChatInputToken/index.js.map +1 -1
  21. package/lib/components/ChatInputToken/renderChatInputToken.js.map +1 -1
  22. package/lib/components/ChatInputToken/useChatInputToken.js.map +1 -1
  23. package/lib/components/ChatInputToken/useChatInputTokenStyles.js +1 -1
  24. package/lib/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -1
  25. package/lib/components/GhostText/GhostText.js.map +1 -1
  26. package/lib/components/GhostText/GhostText.types.js +3 -1
  27. package/lib/components/GhostText/GhostText.types.js.map +1 -1
  28. package/lib/components/GhostText/index.js.map +1 -1
  29. package/lib/components/GhostText/renderGhostText.js.map +1 -1
  30. package/lib/components/GhostText/useGhostText.js.map +1 -1
  31. package/lib/components/GhostText/useGhostTextStyles.js.map +1 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/plugins/BasicFunctionality/BasicFunctionality.js +12 -1
  34. package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
  35. package/lib/plugins/BasicFunctionality/index.js.map +1 -1
  36. package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
  37. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
  38. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -1
  39. package/lib/plugins/ChatInputEntity/index.js.map +1 -1
  40. package/lib/plugins/GhostText/GhostText.js.map +1 -1
  41. package/lib/plugins/GhostText/GhostText.node.js.map +1 -1
  42. package/lib/plugins/GhostText/index.js.map +1 -1
  43. package/lib/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
  44. package/lib/plugins/ImperativeControl/index.js.map +1 -1
  45. package/lib/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
  46. package/lib/plugins/ManualGhostText/index.js.map +1 -1
  47. package/lib-commonjs/BasicFunctionality.js.map +1 -1
  48. package/lib-commonjs/ChatInputEntity.js.map +1 -1
  49. package/lib-commonjs/ChatInputToken.js.map +1 -1
  50. package/lib-commonjs/GhostText.js.map +1 -1
  51. package/lib-commonjs/ImperativeControl.js.map +1 -1
  52. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
  53. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +3 -1
  54. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
  55. package/lib-commonjs/components/ChatInputEntity/index.js.map +1 -1
  56. package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
  57. package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
  58. package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -1
  59. package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
  60. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +3 -3
  61. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
  62. package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +3 -1
  63. package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js.map +1 -1
  64. package/lib-commonjs/components/ChatInputToken/index.js.map +1 -1
  65. package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -1
  66. package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -1
  67. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js +4 -4
  68. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -1
  69. package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
  70. package/lib-commonjs/components/GhostText/GhostText.types.js +3 -1
  71. package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -1
  72. package/lib-commonjs/components/GhostText/index.js.map +1 -1
  73. package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -1
  74. package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -1
  75. package/lib-commonjs/components/GhostText/useGhostTextStyles.js.map +1 -1
  76. package/lib-commonjs/index.js +46 -46
  77. package/lib-commonjs/index.js.map +1 -1
  78. package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +14 -1
  79. package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
  80. package/lib-commonjs/plugins/BasicFunctionality/index.js.map +1 -1
  81. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +3 -3
  82. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
  83. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
  84. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -1
  85. package/lib-commonjs/plugins/ChatInputEntity/index.js.map +1 -1
  86. package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
  87. package/lib-commonjs/plugins/GhostText/GhostText.node.js +3 -3
  88. package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
  89. package/lib-commonjs/plugins/GhostText/index.js.map +1 -1
  90. package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
  91. package/lib-commonjs/plugins/ImperativeControl/index.js.map +1 -1
  92. package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
  93. package/lib-commonjs/plugins/ManualGhostText/index.js.map +1 -1
  94. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["BasicFunctionality.js"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nexport const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {\n const {\n defaultValue,\n trimWhitespace,\n onCountChanged,\n onContentChange\n } = props;\n const [editor] = useLexicalComposerContext();\n const basicFunctionalityImpl = React.useRef(null);\n useIsomorphicLayoutEffect(() => {\n basicFunctionalityImpl.current = new BasicFunctionalityBase(editor);\n return () => {\n var _basicFunctionalityImpl_current;\n return (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.cleanup();\n };\n }, [editor]);\n React.useImperativeHandle(ref, () => ({\n setIsDisabled(isDisabled) {\n var _basicFunctionalityImpl_current;\n (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.setIsDisabled(isDisabled);\n }\n }));\n // useIsomporphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (defaultValue) {\n var _basicFunctionalityImpl_current;\n (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.insertDefaultValue(defaultValue);\n }\n }, [editor]);\n React.useEffect(() => {\n var _basicFunctionalityImpl_current;\n (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.activateContentCallbacks(onContentChange, onCountChanged);\n return () => {\n var _basicFunctionalityImpl_current;\n return (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.deactivateContentCallbacks();\n };\n }, [editor, onContentChange, onCountChanged]);\n React.useEffect(() => {\n if (trimWhitespace) {\n var _basicFunctionalityImpl_current;\n (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.activateTrimWhitespace();\n }\n return () => {\n var _basicFunctionalityImpl_current;\n return (_basicFunctionalityImpl_current = basicFunctionalityImpl.current) === null || _basicFunctionalityImpl_current === void 0 ? void 0 : _basicFunctionalityImpl_current.deactivateTrimWhitespace();\n };\n }, [editor, trimWhitespace]);\n return null;\n});\n//# sourceMappingURL=BasicFunctionality.js.map"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","defaultValue","trimWhitespace","onCountChanged","onContentChange","editor","useLexicalComposerContext","basicFunctionalityImpl","useRef","useIsomorphicLayoutEffect","current","BasicFunctionalityBase","_basicFunctionalityImpl_current","cleanup","useImperativeHandle","setIsDisabled","isDisabled","insertDefaultValue","useEffect","activateContentCallbacks","deactivateContentCallbacks","activateTrimWhitespace","deactivateTrimWhitespace"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;iCACmB;iCACA;kCACH;AAChC,MAAMA,yCAA2BC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC/D,MAAM,EACJC,YAAY,EACZC,cAAc,EACdC,cAAc,EACdC,eAA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AkCL,uBAAuBG,OAAO,AAAD,MAAO,QAAQE,oCAAoC,KAAK,IAAI,KAAK,IAAIA,gCAAgCS,sBAAsB;QAC7L;QACA,OAAO;YACL,IAAIT;YACJ,OAAO,AAACA,CAAAA,kCAAkCL,uBAAuBG,OAAO,AAAD,MAAO,QAAQE,oCAAoC,KAAK,IAAI,KAAK,IAAIA,gCAAgCU,wBAAwB;QACtM;IACF,GAAG;QAACjB;QAAQH;KAAe;IAC3B,OAAO;AACT,IACA,8CAA8C"}
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};\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 } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const basicFunctionalityImpl = React.useRef<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n basicFunctionalityImpl.current = new BasicFunctionalityBase(editor);\n\n return () => basicFunctionalityImpl.current?.cleanup();\n }, [editor]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(ref, () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl.current?.setIsDisabled(isDisabled);\n },\n }));\n\n // useIsomporphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (defaultValue) {\n basicFunctionalityImpl.current?.insertDefaultValue(defaultValue);\n }\n }, [editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl.current?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl.current?.deactivateContentCallbacks();\n }, [editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl.current?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl.current?.deactivatePasteCallback();\n }, [editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl.current?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl.current?.deactivateTrimWhitespace();\n }, [editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","defaultValue","editor","trimWhitespace","basicFunctionalityImpl","useIsomorphicLayoutEffect","useImperativeHandle","setIsDisabled","current","_basicFunctionalityImpl_current","cleanup","isDisabled","insertDefaultValue","deactivateContentCallbacks","onContentChange","onCountChanged","onPaste","useEffect","activatePasteCallback","deactivatePasteCallback"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBaA;;;eAAAA;;;;iEAnBU;iCACmB;iCACA;kCAEH;AAehC,MAAMA,yCAA2BC,OAAMC,UAAU,CACtD,CAACC,OAAOC;UACN,EAEAC,YAAOC,EAEPC,cAAMC,EAENC,cAAAA,iBACED,SAEA;mEAAaA;;kDACZ,EAAA;+BAACF,OAAAA,GAAAA,IAAAA,wCAAAA,CAAAA;eAAO;YAEXL,IAAMS;mBACJC,CAAAA,kCAAiCH,uBAAAI,OAAA,MAAA,QAAAC,oCAAA,KAAA,IAAA,KAAA,IAAAA,gCAAAC,OAAA;;;;;8BAEjC,CAAAV,KAA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uBAAc;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './BasicFunctionality';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -9,14 +9,14 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- ChatInputEntityNode: function() {
13
- return ChatInputEntityNode;
14
- },
15
12
  $createChatInputEntityNode: function() {
16
13
  return $createChatInputEntityNode;
17
14
  },
18
15
  $isChatInputEntityNode: function() {
19
16
  return $isChatInputEntityNode;
17
+ },
18
+ ChatInputEntityNode: function() {
19
+ return ChatInputEntityNode;
20
20
  }
21
21
  });
22
22
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputEntity.node.js"],"sourcesContent":["import { _ as _define_property } from \"@swc/helpers/_/_define_property\";\nimport * as React from 'react';\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nexport class ChatInputEntityNode extends DecoratorNode {\n static getType() {\n return 'entity';\n }\n static clone(node) {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n static importJSON(serializedNode) {\n return $createChatInputEntityNode(serializedNode.pluginId, serializedNode.text, serializedNode.data, serializedNode.entityProps);\n }\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n getTextContent() {\n return this.__text;\n }\n exportJSON() {\n return {\n ...super.exportJSON(),\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 createDOM() {\n return document.createElement('span');\n }\n updateDOM() {\n return false;\n }\n decorate(_editor, config) {\n var _this___entityProps;\n if ((_this___entityProps = this.__entityProps) === null || _this___entityProps === void 0 ? void 0 : _this___entityProps.children) {\n return /*#__PURE__*/React.createElement(ChatInputEntity, this.__entityProps);\n }\n return /*#__PURE__*/React.createElement(ChatInputEntity, this.__entityProps, this.__text);\n }\n getEntityData() {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps\n };\n }\n updateEntityData(data) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n constructor(pluginId, text, data, entityProps, key) {\n super(key);\n _define_property(this, \"__pluginId\", void 0);\n _define_property(this, \"__text\", void 0);\n _define_property(this, \"__entityProps\", void 0);\n _define_property(this, \"__data\", void 0);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n}\nexport function $createChatInputEntityNode(pluginId, text, data, entityProps, key) {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\nexport function $isChatInputEntityNode(node) {\n return node instanceof ChatInputEntityNode;\n}\n//# sourceMappingURL=ChatInputEntity.node.js.map"],"names":["ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","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","_define_property"],"mappings":";;;;;;;;;;;IAIaA,mBAAmB;eAAnBA;;IAoEGC,0BAA0B;eAA1BA;;IAGAC,sBAAsB;eAAtBA;;;;iCA3EsB;iEACf;4BACO;iCACE;AACzB,MAAMF,4BAA4BG,yBAAa;IACpD,OAAOC,UAAU;QACf,OAAO;IACT;IACA,OAAOC,MAAMC,IAAI,EAAE;QACjB,OAAO,IAAIN,oBAAoBM,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IACA,OAAOC,WAAWC,cAAc,EAAE;QAChC,OAAOZ,2BAA2BY,eAAeC,QAAQ,EAAED,eAAe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C,IAAI,EAAEC,WAAW,EAAEuB,GAAG,CAAE;QAClD,KAAK,CAACA;QACNC,IAAAA,kBAAgB,EAAC,IAAI,EAAE,cAAc,KAAK;QAC1CA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,UAAU,KAAK;QACtCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,iBAAiB,KAAK;QAC7CA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,UAAU,KAAK;QACtC,IAAI,CAAClC,UAAU,GAAGO;QAClB,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,aAAa,GAAGO;IACvB;AACF;AACO,SAAShB,2BAA2Ba,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,WAAW,EAAEuB,GAAG;IAC/E,OAAO,IAAIxC,oBAAoBc,UAAUC,MAAMC,MAAMC,aAAauB;AACpE;AACO,SAAStC,uBAAuBI,IAAI;IACzC,OAAOA,gBAAgBN;AACzB,EACA,gDAAgD"}
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 ...super.exportJSON(),\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 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;oBACE,CAAGA,YAAMA;sBACTP,IAAAA,CAAAA,UAAeP;kBACfQ,IAAAA,CAAAA,MAAWP;kBACXQ,IAAAA,CAAAA,MAAWP;yBACXQ,IAAAA,CAAAA,aAAkBP;kBAClBY,oBAAMpB,OAAoBE;qBAC1BmB;;;gBAYJC;eACEC,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;;gBAnChCsB,QAAYzB,EAAgBC,IAAEA,EAAYC,IAAEA,EAAQC,WAAEA,EAAkCuB,GAAEA,CAAa;aACrG,CAAAA;8BA7CFjC,EAAAA,IAAAA,EAAAA,cAAAA,KAAAA;8BACAC,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;8BACAE,EAAAA,IAAAA,EAAAA,iBAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,UAAAA,KAAAA;YA2CE,CAAAF,UAAKA,GAAAA;YACL,CAAAC,MAAKA,GAAAA;YACL,CAAAC,MAAKA,GAAAA;YACL,CAAAC,aAAKA,GAAAA;;AAgCT;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.js"],"sourcesContent":["import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport * as React from 'react';\nimport { $createChatInputEntityNode, $isChatInputEntityNode, ChatInputEntityNode } from './ChatInputEntity.node';\nimport { ChatInputEntityPluginBase } from '@fluentui-copilot/chat-input-plugins';\nexport const ChatInputEntityPlugin = props => {\n const {\n id,\n controlRef,\n onChatInputEntityAdded,\n onChatInputEntityDeleted\n } = props;\n const [editor] = useLexicalComposerContext();\n const chatInputEntityPluginBase = React.useRef(null);\n React.useEffect(() => {\n chatInputEntityPluginBase.current = new ChatInputEntityPluginBase(editor, id, ChatInputEntityNode, $createChatInputEntityNode, $isChatInputEntityNode, onChatInputEntityAdded, onChatInputEntityDeleted);\n return () => {\n var _chatInputEntityPluginBase_current;\n return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.cleanup();\n };\n }, [editor, id, onChatInputEntityAdded, onChatInputEntityDeleted]);\n React.useImperativeHandle(controlRef, () => ({\n insertChatInputEntity(props) {\n var _chatInputEntityPluginBase_current;\n return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.insertChatInputEntity(props);\n },\n getActiveEntities() {\n var _chatInputEntityPluginBase_current;\n var _chatInputEntityPluginBase_current_getActiveEntities;\n 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 : [];\n },\n removeChatInputEntity(keyOrPredicate) {\n var _chatInputEntityPluginBase_current;\n (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.removeChatInputEntity(keyOrPredicate);\n },\n updateChatInputEntityProps(keyOrPredicate, props) {\n var _chatInputEntityPluginBase_current;\n (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.updateChatInputEntityProps(keyOrPredicate, props);\n }\n }), []);\n return null;\n};\n//# sourceMappingURL=ChatInputEntityPlugin.js.map"],"names":["ChatInputEntityPlugin","props","id","controlRef","onChatInputEntityAdded","onChatInputEntityDeleted","editor","useLexicalComposerContext","chatInputEntityPluginBase","React","useRef","useEffect","current","ChatInputEntityPluginBase","ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","_chatInputEntityPluginBase_current","cleanup","useImperativeHandle","insertChatInputEntity","getActiveEntities","_chatInputEntityPluginBase_current_getActiveEntities","removeChatInputEntity","keyOrPredicate","updateChatInputEntityProps"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iCAJ6B;iEACnB;qCACiE;kCAC9C;AACnC,MAAMA,wBAAwBC,CAAAA;IACnC,MAAM,EACJC,EAAE,EACFC,UAAU,EACVC,sBAAsB,EACtBC,wBAAwB,EACzB,GAAGJ;IACJ,MAAM,CAACK,OAAO,GAAGC,IAAAA,0CAAyB;IAC1C,MAAMC,4BAA4BC,OAAMC,MAAM,CAAC;IAC/CD,OAAME,SAAS,CAAC;QACdH,0BAA0BI,OAAO,GAAG,IAAIC,2CAAyB,CAACP,QAAQJ,IAAIY,wCAAmB,EAAEC,+CAA0B,EAAEC,2CAAsB,EAAEZ,wBAAwBC;QAC/K,OAAO;YACL,IAAIY;YACJ,OAAO,AAACA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCC,OAAO;QACjM;IACF,GAAG;QAACZ;QAAQJ;QAAIE;QAAwBC;KAAyB;IACjEI,OAAMU,mBAAmB,CAAChB,YAAY,IAAO,CAAA;YAC3CiB,uBAAsBnB,KAAK;gBACzB,IAAIgB;gBACJ,OAAO,AAACA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCG,qBAAqB,CAACnB;YAChN;YACAoB;gBACE,IAAIJ;gBACJ,IAAIK;gBACJ,OAAO,AAACA,CAAAA,uDAAuD,AAACL,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCI,iBAAiB,EAAC,MAAO,QAAQC,yDAAyD,KAAK,IAAIA,uDAAuD,EAAE;YAC9Y;YACAC,uBAAsBC,cAAc;gBAClC,IAAIP;gBACHA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCM,qBAAqB,CAACC;YACzM;YACAC,4BAA2BD,cAAc,EAAEvB,KAAK;gBAC9C,IAAIgB;gBACHA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCQ,0BAA0B,CAACD,gBAAgBvB;YAC9N;QACF,CAAA,GAAI,EAAE;IACN,OAAO;AACT,GACA,iDAAiD"}
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 } = 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]);\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","current","ChatInputEntityPluginBase","editor","ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","onChatInputEntityAdded","onChatInputEntityDeleted","useImperativeHandle","insertChatInputEntity","_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;kBAcaA,GAAAA,IAAAA,0CAAAA;sCAAAA,OAAAA,MAAAA,CAAAA;;QACfA,0BAAGE,OAAA,GAAA,IAAAC,2CAAA,CAAAC,QAAAN,IAAAO,wCAAA,EAAAC,+CAAA,EAAAC,2CAAA,EAAAC,wBAAAC;eAACL;gBAAQN;mBAAIU,CAAAA,qCAAAA,0BAAAA,OAAAA,MAAAA,QAAAA,uCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,OAAAA;;OAAiD;QAAAJ;QAAAN;QAAAU;QAAAC;KAAA;WAEjER,mBAAMS,CAAAA,YACJX,IACO,CAAA;mCACLY,KAAAA;;6DACSX,0BAAAA,OAAAA,MAA0BE,QAAOU,uCAAjCZ,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,qBAAmCW,CAAAA;;;;;+EAInCX,CAAAA,qCAAAA,0BAAAA,OAAAA,MAA0BE,QAAOU,uCAAjCZ,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,iBAAmCa,EAAAA,MAAAA,QAAiBC,yDAApDd,KAAAA,IAAAA,uDAAAA,EAAAA;;mCAGTe,cAAsBC;;sDACpBhB,0BAAAA,OAAAA,MAA0BE,QAAOU,uCAAjCZ,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,qBAAmCe,CAAAA;;wCAGrCE,cAA2BD,EAAAA,KAAAA;;sDACzBhB,0BAAAA,OAAAA,MAA0BE,QAAOU,uCAAjCZ,KAAAA,IAAAA,KAAAA,IAAAA,mCAAAA,0BAAmCiB,CAAAA,gBAA2BD;;cAElE;WAGF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputEntityPlugin.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=ChatInputEntityPlugin.types.js.map"],"names":[],"mappings":";;;;CACA,uDAAuD"}
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 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ChatInputEntity.node';\nexport * from './ChatInputEntityPlugin';\nexport * from './ChatInputEntityPlugin.types';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity.node';\nexport * from './ChatInputEntityPlugin';\nexport * from './ChatInputEntityPlugin.types';\n"],"names":[],"rangeMappings":";;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["GhostText.js"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { $createGhostTextNode } from '../../GhostText';\nimport { GhostTextNode } from './GhostText.node';\nimport { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';\nexport function GhostTextPlugin(props) {\n const {\n $getGhostText,\n id,\n ghostTextProps,\n exposeText,\n allowCompletion\n } = props;\n const [editor] = useLexicalComposerContext();\n const ghostTextBase = React.useRef(null);\n React.useEffect(() => {\n ghostTextBase.current = new GhostTextPluginBase(editor, id, $getGhostText, GhostTextNode, $createGhostTextNode, ghostTextProps, exposeText, allowCompletion);\n return () => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.cleanup();\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 React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setAllowCompletion(allowCompletion);\n }, [allowCompletion]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setComponentProps(ghostTextProps);\n }, [ghostTextProps]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setExposeText(exposeText);\n }, [exposeText]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setGetGhostText($getGhostText);\n }, [$getGhostText]);\n return null;\n}\n//# sourceMappingURL=GhostText.js.map"],"names":["GhostTextPlugin","props","$getGhostText","id","ghostTextProps","exposeText","allowCompletion","editor","useLexicalComposerContext","ghostTextBase","React","useRef","useEffect","current","GhostTextPluginBase","GhostTextNode","$createGhostTextNode","_ghostTextBase_current","cleanup","setAllowCompletion","setComponentProps","setExposeText","setGetGhostText"],"mappings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K,IAAI,KAAK,IAAIA,uBAAuBK,eAAe,CAACpB;IACnJ,GAAG;QAACA;KAAc;IAClB,OAAO;AACT,EACA,qCAAqC"}
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 const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;\n const [editor] = useLexicalComposerContext();\n\n const ghostTextBase = React.useRef<GhostTextPluginBase<GhostTextProps> | null>(null);\n\n React.useEffect(\n () => {\n ghostTextBase.current = new GhostTextPluginBase(\n editor,\n id,\n $getGhostText,\n GhostTextNode,\n $createGhostTextNode,\n ghostTextProps,\n exposeText,\n allowCompletion,\n );\n\n return () => {\n ghostTextBase.current?.cleanup();\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.current?.setAllowCompletion(allowCompletion);\n }, [allowCompletion]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setComponentProps(ghostTextProps);\n }, [ghostTextProps]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setExposeText(exposeText);\n }, [exposeText]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setGetGhostText($getGhostText);\n }, [$getGhostText]);\n\n return null;\n}\n"],"names":["GhostTextPlugin","props","$getGhostText","editor","id","React","useEffect","ghostTextBase","useRef","current","GhostTextPluginBase","GhostTextNode","$createGhostTextNode","ghostTextProps","exposeText","allowCompletion","_ghostTextBase_current","setAllowCompletion","setExposeText","setGetGhostText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAqBgBA;;;eAAAA;;;;iEArBO;iCACmB;2BAGL;+BACP;kCACM;AAe7B,SAASA,gBAAgBC,KAA2B;UACzD,EACAC,aAAOC,EAEPC,EAAA,EAEAC,cAAMC,YAEFC,iBAWO;kBACLA,GAAAA,IAAAA,0CAAAA;UACFA,gBAAAF,OAAAG,MAAA,CAAA;WAEFF,SAAA,CAAA;QACAC,cAAAE,OAAA,GAAA,IAAAC,qCAAA,CAAAP,QAAuDC,IAAAF,eAAAS,4BAAA,EAAAC,+BAAA,EAAAC,gBAAAC,YAAAC;QACvD,OAAA;gBAACZ;sCAAQC,cAAAA,OAAAA,MAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,OAAAA;;+HAITG;2DAAqB;;;QACpBH;KAAA;WAACW,SAAAA,CAAAA;YAAgBC;QAEpBX,CAAAA,yBAAgBE,cAAAE,OAAA,MAAA,QAAAO,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAC,kBAAA,CAAAF;;;KACdR;oBAAAA,CAAAA;QACF,IAAGS;kCAACH,cAAAA,OAAAA,MAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,iBAAAA,CAAAA;OAAe;QAAAA;KAAA;WAEnBR,SAAMC,CAAAA;;kCACJC,cAAAA,OAAcE,MAAO,QAAAO,2BAArBT,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,aAAuBW,CAAAA;OACzB;QAAAJ;KAAG;WAACA,SAAAA,CAAAA;YAAWE;QAEfX,CAAAA,yBAAgBE,cAAAE,OAAA,MAAA,QAAAO,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAG,eAAA,CAAAjB;;;KACdK;WAAAA;uCACEL"}
@@ -9,14 +9,14 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- GhostTextNode: function() {
13
- return GhostTextNode;
14
- },
15
12
  $createGhostTextNode: function() {
16
13
  return $createGhostTextNode;
17
14
  },
18
15
  $isGhostTextNode: function() {
19
16
  return $isGhostTextNode;
17
+ },
18
+ GhostTextNode: function() {
19
+ return GhostTextNode;
20
20
  }
21
21
  });
22
22
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
@@ -1 +1 @@
1
- {"version":3,"sources":["GhostText.node.js"],"sourcesContent":["import { _ as _define_property } from \"@swc/helpers/_/_define_property\";\nimport * as React from 'react';\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport { GhostText } from '../../components/GhostText/GhostText';\nexport class GhostTextNode extends DecoratorNode {\n static clone(node) {\n return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);\n }\n static getType() {\n return 'ghosttext';\n }\n static importJSON(serializedNode) {\n const node = $createGhostTextNode(serializedNode.id, serializedNode.content, serializedNode.exposeText, serializedNode.componentProps);\n return node;\n }\n exportJSON() {\n return {\n ...super.exportJSON(),\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 isInline() {\n return true;\n }\n isIsolated() {\n return true;\n }\n getTextContent() {\n return this.__exposeText ? this.__content : '';\n }\n updateDOM(prevNode, dom, config) {\n return false;\n }\n createDOM(config) {\n return document.createElement('span');\n }\n decorate() {\n return /*#__PURE__*/React.createElement(GhostText, this.__componentProps, this.__content);\n }\n constructor(id, content, exposeText, componentProps, key) {\n super(key);\n _define_property(this, \"__content\", void 0);\n _define_property(this, \"__id\", void 0);\n _define_property(this, \"__allowCommitting\", void 0);\n _define_property(this, \"__componentProps\", void 0);\n _define_property(this, \"__exposeText\", void 0);\n this.__id = id;\n this.__content = content;\n this.__exposeText = exposeText;\n this.__componentProps = componentProps;\n }\n}\nexport function $createGhostTextNode(id, content, exposeText, componentProps) {\n return new GhostTextNode(id, content, exposeText, componentProps);\n}\nexport function $isGhostTextNode(node) {\n return node instanceof GhostTextNode;\n}\n//# sourceMappingURL=GhostText.node.js.map"],"names":["GhostTextNode","$createGhostTextNode","$isGhostTextNode","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","constructor","key","_define_property"],"mappings":";;;;;;;;;;;IAIaA,aAAa;eAAbA;;IAqDGC,oBAAoB;eAApBA;;IAGAC,gBAAgB;eAAhBA;;;;iCA5DsB;iEACf;4BACO;2BACJ;AACnB,MAAMF,sBAAsBG,yBAAa;IAC9C,OAAOC,MAAMC,IAAI,EAAE;QACjB,OAAO,IAAIL,cAAcK,KAAKC,IAAI,EAAED,KAAKE,SAAS,EAAEF,KAAKG,YAAY,EAAEH,KAAKI,gBAAgB,EAAEJ,KAAKK,KAAK;IAC1G;IACA,OAAOC,UAAU;QACf,OAAO;IACT;IACA,OAAOC,WAAWC,cAAc,EAAE;QAChC,MAAMR,OAAOJ,qBAAqBY,eAAeC,EAAE,EAAED,eAAeE,OAAO,EAAEF,eAAeG,UAAU,EAAEH,eAAeI,cAAc;QACrI,OAAOZ;IACT;IACAa,aAAa;QACX,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,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;IACAC,WAAW;QACT,OAAO;IACT;IACAC,aAAa;QACX,OAAO;IACT;IACAC,iBAAiB;QACf,OAAO,IAAI,CAACf,YAAY,GAAG,IAAI,CAACD,SAAS,GAAG;IAC9C;IACAiB,UAAUC,QAAQ,EAAEC,GAAG,EAAEC,MAAM,EAAE;QAC/B,OAAO;IACT;IACAC,UAAUD,MAAM,EAAE;QAChB,OAAOE,SAASC,aAAa,CAAC;IAChC;IACAC,WAAW;QACT,OAAO,WAAW,GAAEC,OAAMF,aAAa,CAACG,oBAAS,EAAE,IAAI,CAACxB,gBAAgB,EAAE,IAAI,CAACF,SAAS;IAC1F;IACA2B,YAAYpB,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,cAAc,EAAEkB,GAAG,CAAE;QACxD,KAAK,CAACA;QACNC,IAAAA,kBAAgB,EAAC,IAAI,EAAE,aAAa,KAAK;QACzCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,QAAQ,KAAK;QACpCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,qBAAqB,KAAK;QACjDA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,oBAAoB,KAAK;QAChDA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,gBAAgB,KAAK;QAC5C,IAAI,CAAC9B,IAAI,GAAGQ;QACZ,IAAI,CAACP,SAAS,GAAGQ;QACjB,IAAI,CAACP,YAAY,GAAGQ;QACpB,IAAI,CAACP,gBAAgB,GAAGQ;IAC1B;AACF;AACO,SAAShB,qBAAqBa,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,cAAc;IAC1E,OAAO,IAAIjB,cAAcc,IAAIC,SAASC,YAAYC;AACpD;AACO,SAASf,iBAAiBG,IAAI;IACnC,OAAOA,gBAAgBL;AACzB,EACA,0CAA0C"}
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 ...super.exportJSON(),\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 return document.createElement('span');\n }\n\n decorate(): JSX.Element | null {\n return <GhostText {...this.__componentProps}>{this.__content}</GhostText>;\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","constructor","key","__allowCommitting"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAuFgBA,oBAAAA;eAAAA;;IASAC,gBAAAA;eAAAA;;IA/EHC,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;oBACE,CAAGA,YAAMA;kBACTC;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;eAC5BE,SAAOA,aAASC,CAAAA;;eAGlBC;eACE,WAAA,GAAAC,OAAOF,aAAA,CAAAG,oBAACA,EAAAA,IAAAA,CAAcxB,gBAAKA,EAAAA,IAAgB,CAAGF,SAAKA;;gBA7BrD2B,EAAYpB,EAAUC,OAAEA,EAAeC,UAAEA,EAAoBC,cAAEA,EAA+BkB,GAAEA,CAAa;aAC3G,CAAAA;8BArCF5B,EAAAA,IAAAA,EAAAA,aAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,QAAAA,KAAAA;8BACA8B,EAAAA,IAAAA,EAAAA,qBAAAA,KAAAA;8BACA3B,EAAAA,IAAAA,EAAAA,oBAAAA,KAAAA;8BACAD,EAAAA,IAAAA,EAAAA,gBAAAA,KAAAA;YAkCE,CAAAF,IAAKA,GAAAA;YACL,CAAAC,SAAKA,GAAAA;YACL,CAAAC,YAAKA,GAAAA;YACL,CAAAC,gBAAKA,GAAAA;;AA0BT;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":["index.js"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.node';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.node';\n"],"names":[],"rangeMappings":";;;;;;","mappings":";;;;;uBAAc;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ImperativeControl.js"],"sourcesContent":["import * as React from 'react';\nimport { ImperativeControlBase } from '@fluentui-copilot/chat-input-plugins';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nexport const ImperativeControlPlugin = /*#__PURE__*/React.forwardRef((_props, ref) => {\n const [editor] = useLexicalComposerContext();\n React.useImperativeHandle(ref, () => new ImperativeControlBase(editor), [editor]);\n return null;\n});\n//# sourceMappingURL=ImperativeControl.js.map"],"names":["ImperativeControlPlugin","React","forwardRef","_props","ref","editor","useLexicalComposerContext","useImperativeHandle","ImperativeControlBase"],"mappings":";;;;+BAGaA;;;eAAAA;;;;iEAHU;kCACe;iCACI;AACnC,MAAMA,0BAA0B,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,QAAQC;IAC5E,MAAM,CAACC,OAAO,GAAGC,IAAAA,0CAAyB;IAC1CL,OAAMM,mBAAmB,CAACH,KAAK,IAAM,IAAII,uCAAqB,CAACH,SAAS;QAACA;KAAO;IAChF,OAAO;AACT,IACA,6CAA6C"}
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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ImperativeControl';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ImperativeControl';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ManualGhostText.js"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { $createGhostTextNode, $isGhostTextNode } from '../../GhostText';\nimport { ManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';\nexport const ManualGhostTextPlugin = React.forwardRef((props, ref) => {\n const {\n id\n } = props;\n const [editor] = useLexicalComposerContext();\n React.useImperativeHandle(ref, () => new ManualGhostTextBase(editor, id, $isGhostTextNode, $createGhostTextNode), [editor, id]);\n return null;\n});\nManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';\n//# sourceMappingURL=ManualGhostText.js.map"],"names":["ManualGhostTextPlugin","React","forwardRef","props","ref","id","editor","useLexicalComposerContext","useImperativeHandle","ManualGhostTextBase","$isGhostTextNode","$createGhostTextNode","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;iCACmB;2BACa;kCACnB;AAC7B,MAAMA,sCAAwBC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC5D,MAAM,EACJC,EAAE,EACH,GAAGF;IACJ,MAAM,CAACG,OAAO,GAAGC,IAAAA,0CAAyB;IAC1CN,OAAMO,mBAAmB,CAACJ,KAAK,IAAM,IAAIK,qCAAmB,CAACH,QAAQD,IAAIK,2BAAgB,EAAEC,+BAAoB,GAAG;QAACL;QAAQD;KAAG;IAC9H,OAAO;AACT;AACAL,sBAAsBY,WAAW,GAAG,yBACpC,2CAA2C"}
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 { ManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type ManualGhostTextProps = {\n id: string;\n};\n\nexport type ManualGhostTextRef = {\n getGhostText: () => string | undefined;\n setGhostText: (text: string, exposeText?: boolean, ghostTextProps?: GhostTextProps) => void;\n commitGhostText: (finalText: string) => void;\n cancelGhostText: () => void;\n};\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":";;;;+BAiBaA;;;eAAAA;;;;iEAjBU;iCACmB;2BAEa;kCACnB;AAa7B,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":["index.js"],"sourcesContent":["export * from './ManualGhostText';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,iCAAiC"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ManualGhostText';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-chat-input-plugins",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
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,15 +12,15 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/chat-input-plugins": "^0.0.3",
16
- "@fluentui-copilot/react-text-editor": "^0.1.4",
17
- "@fluentui-copilot/text-editor": "^0.0.2",
15
+ "@fluentui-copilot/chat-input-plugins": "^0.0.4",
16
+ "@fluentui-copilot/react-text-editor": "^0.1.5",
17
+ "@fluentui-copilot/text-editor": "^0.0.3",
18
18
  "@swc/helpers": "^0.5.1"
19
19
  },
20
20
  "peerDependencies": {
21
- "@fluentui/react-components": ">=9.37.3 <10.0.0",
22
- "@fluentui/react-jsx-runtime": ">=9.0.18 <10.0.0",
23
- "@fluentui/react-utilities": ">=9.15.1 <10.0.0",
21
+ "@fluentui/react-components": ">=9.49.0 <10.0.0",
22
+ "@fluentui/react-jsx-runtime": ">=9.0.36 <10.0.0",
23
+ "@fluentui/react-utilities": ">=9.18.7 <10.0.0",
24
24
  "@types/react": ">=16.14.0 <19.0.0",
25
25
  "@types/react-dom": ">=16.9.8 <19.0.0",
26
26
  "react": ">=16.14.0 <19.0.0",