@fluentui-copilot/react-editor-input 0.5.5 → 0.5.6

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 CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@fluentui-copilot/react-editor-input",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 05 Sep 2025 00:07:07 GMT",
5
+ "date": "Mon, 29 Sep 2025 20:25:10 GMT",
6
+ "tag": "@fluentui-copilot/react-editor-input_v0.5.6",
7
+ "version": "0.5.6",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "tristan.watanabe@gmail.com",
12
+ "package": "@fluentui-copilot/react-editor-input",
13
+ "commit": "eb866bbd84d778637cb17f869920ae47a3eeec50",
14
+ "comment": "fix: type issues after React 18 upgrade."
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 05 Sep 2025 00:07:29 GMT",
6
21
  "tag": "@fluentui-copilot/react-editor-input_v0.5.5",
7
22
  "version": "0.5.5",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui-copilot/react-editor-input
2
2
 
3
- This log was last generated on Fri, 05 Sep 2025 00:07:07 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 29 Sep 2025 20:25:10 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.5.6](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-editor-input_v0.5.6)
8
+
9
+ Mon, 29 Sep 2025 20:25:10 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-editor-input_v0.5.5..@fluentui-copilot/react-editor-input_v0.5.6)
11
+
12
+ ### Patches
13
+
14
+ - fix: type issues after React 18 upgrade. ([PR #3341](https://github.com/microsoft/fluentai/pull/3341) by tristan.watanabe@gmail.com)
15
+
7
16
  ## [0.5.5](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-editor-input_v0.5.5)
8
17
 
9
- Fri, 05 Sep 2025 00:07:07 GMT
18
+ Fri, 05 Sep 2025 00:07:29 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-editor-input_v0.5.3..@fluentui-copilot/react-editor-input_v0.5.5)
11
20
 
12
21
  ### Patches
@@ -1 +1 @@
1
- {"version":3,"sources":["useAnimatedPlaceholder.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderProps, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport { PlaceholderMotion } from './placeholderMotion';\nimport { type PresenceMotionSlotProps, presenceMotionSlot } from '@fluentui/react-motion';\n\n/**\n * Create the state required to render AnimatedPlaceholder.\n *\n * The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,\n * before being passed to renderAnimatedPlaceholder_unstable.\n *\n * @param props - props from this instance of AnimatedPlaceholder\n * @param ref - reference to root HTMLElement of AnimatedPlaceholder\n */\nexport const useAnimatedPlaceholder_unstable = (\n props: AnimatedPlaceholderProps,\n ref: React.Ref<HTMLDivElement>,\n): AnimatedPlaceholderState => {\n const { placeholderValue } = props;\n\n const [placeholder, setPlaceholder] = React.useState(placeholderValue);\n const [visible, setVisible] = React.useState(true);\n\n React.useEffect(() => {\n if (placeholderValue !== placeholder) {\n setVisible(false);\n }\n }, [placeholder, placeholderValue]);\n\n const onMotionFinish = () => {\n setPlaceholder(placeholderValue);\n setVisible(true);\n };\n\n return {\n components: {\n root: 'div',\n motion: PlaceholderMotion as React.FC<PresenceMotionSlotProps>,\n placeholder: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n motion: presenceMotionSlot<{}>(props.motion, {\n elementType: PlaceholderMotion,\n defaultProps: {\n visible: visible,\n onMotionFinish: onMotionFinish,\n },\n }),\n placeholder: slot.always(\n getIntrinsicElementProps('div', {\n children: placeholder,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","PlaceholderMotion","presenceMotionSlot","useAnimatedPlaceholder_unstable","props","ref","placeholderValue","placeholder","setPlaceholder","useState","visible","setVisible","useEffect","onMotionFinish","components","root","motion","always","elementType","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAE5E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAAuCC,kBAAkB,QAAQ,yBAAyB;AAE1F;;;;;;;;CAQC,GACD,OAAO,MAAMC,kCAAkC,CAC7CC,OACAC;IAEA,MAAM,EAAEC,gBAAgB,EAAE,GAAGF;IAE7B,MAAM,CAACG,aAAaC,eAAe,GAAGV,MAAMW,QAAQ,CAACH;IACrD,MAAM,CAACI,SAASC,WAAW,GAAGb,MAAMW,QAAQ,CAAC;IAE7CX,MAAMc,SAAS,CAAC;QACd,IAAIN,qBAAqBC,aAAa;YACpCI,WAAW;QACb;IACF,GAAG;QAACJ;QAAaD;KAAiB;IAElC,MAAMO,iBAAiB;QACrBL,eAAeF;QACfK,WAAW;IACb;IAEA,OAAO;QACLG,YAAY;YACVC,MAAM;YACNC,QAAQf;YACRM,aAAa;QACf;QACAQ,MAAMf,KAAKiB,MAAM,CACflB,yBAAyB,OAAO;YAC9BM;YACA,GAAGD,KAAK;QACV,IACA;YAAEc,aAAa;QAAM;QAEvBF,QAAQd,mBAAuBE,MAAMY,MAAM,EAAE;YAC3CE,aAAajB;YACbkB,cAAc;gBACZT,SAASA;gBACTG,gBAAgBA;YAClB;QACF;QACAN,aAAaP,KAAKiB,MAAM,CACtBlB,yBAAyB,OAAO;YAC9BqB,UAAUb;QACZ,IACA;YAAEW,aAAa;QAAM;IAEzB;AACF,EAAE"}
1
+ {"version":3,"sources":["useAnimatedPlaceholder.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderProps, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport { PlaceholderMotion } from './placeholderMotion';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\n\n/**\n * Create the state required to render AnimatedPlaceholder.\n *\n * The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,\n * before being passed to renderAnimatedPlaceholder_unstable.\n *\n * @param props - props from this instance of AnimatedPlaceholder\n * @param ref - reference to root HTMLElement of AnimatedPlaceholder\n */\nexport const useAnimatedPlaceholder_unstable = (\n props: AnimatedPlaceholderProps,\n ref: React.Ref<HTMLDivElement>,\n): AnimatedPlaceholderState => {\n const { placeholderValue } = props;\n\n const [placeholder, setPlaceholder] = React.useState(placeholderValue);\n const [visible, setVisible] = React.useState(true);\n\n React.useEffect(() => {\n if (placeholderValue !== placeholder) {\n setVisible(false);\n }\n }, [placeholder, placeholderValue]);\n\n const onMotionFinish = () => {\n setPlaceholder(placeholderValue);\n setVisible(true);\n };\n\n return {\n components: {\n root: 'div',\n motion: PlaceholderMotion,\n placeholder: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n motion: presenceMotionSlot<{}>(props.motion, {\n elementType: PlaceholderMotion,\n defaultProps: {\n visible: visible,\n onMotionFinish: onMotionFinish,\n },\n }),\n placeholder: slot.always(\n getIntrinsicElementProps('div', {\n children: placeholder,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","getIntrinsicElementProps","slot","PlaceholderMotion","presenceMotionSlot","useAnimatedPlaceholder_unstable","props","ref","placeholderValue","placeholder","setPlaceholder","useState","visible","setVisible","useEffect","onMotionFinish","components","root","motion","always","elementType","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,IAAI,QAAQ,6BAA6B;AAE5E,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,kBAAkB,QAAQ,yBAAyB;AAE5D;;;;;;;;CAQC,GACD,OAAO,MAAMC,kCAAkC,CAC7CC,OACAC;IAEA,MAAM,EAAEC,gBAAgB,EAAE,GAAGF;IAE7B,MAAM,CAACG,aAAaC,eAAe,GAAGV,MAAMW,QAAQ,CAACH;IACrD,MAAM,CAACI,SAASC,WAAW,GAAGb,MAAMW,QAAQ,CAAC;IAE7CX,MAAMc,SAAS,CAAC;QACd,IAAIN,qBAAqBC,aAAa;YACpCI,WAAW;QACb;IACF,GAAG;QAACJ;QAAaD;KAAiB;IAElC,MAAMO,iBAAiB;QACrBL,eAAeF;QACfK,WAAW;IACb;IAEA,OAAO;QACLG,YAAY;YACVC,MAAM;YACNC,QAAQf;YACRM,aAAa;QACf;QACAQ,MAAMf,KAAKiB,MAAM,CACflB,yBAAyB,OAAO;YAC9BM;YACA,GAAGD,KAAK;QACV,IACA;YAAEc,aAAa;QAAM;QAEvBF,QAAQd,mBAAuBE,MAAMY,MAAM,EAAE;YAC3CE,aAAajB;YACbkB,cAAc;gBACZT,SAASA;gBACTG,gBAAgBA;YAClB;QACF;QACAN,aAAaP,KAAKiB,MAAM,CACtBlB,yBAAyB,OAAO;YAC9BqB,UAAUb;QACZ,IACA;YAAEW,aAAa;QAAM;IAEzB;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useEditorInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n slot,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { EditorInputProps, EditorInputState } from './EditorInput.types';\nimport { SentinelNode, SENTINEL_VALUE } from '@fluentui-copilot/chat-input-plugins';\nimport type { LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $createTextNode, $insertNodes } from '@fluentui-copilot/react-text-editor';\nimport { $getRoot } from '@fluentui-copilot/react-text-editor';\nimport { LexicalPlainTextPlugin, mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { mergeCallbacks, useControllableState } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render EditorInput.\n *\n * The returned state can be modified with hooks such as useEditorInputStyles_unstable,\n * before being passed to renderEditorInput_unstable.\n *\n * @param props - props from this instance of EditorInput\n * @param ref - reference to root HTMLElement of EditorInput\n */\nexport const useEditorInput_unstable = (props: EditorInputProps, ref: React.Ref<HTMLSpanElement>): EditorInputState => {\n const {\n onChange,\n onPaste,\n trimWhiteSpace = false,\n textPlugin = LexicalPlainTextPlugin,\n history = true,\n editorRef: userEditorRef,\n customTheme,\n isSentinelNodeEnabled = true,\n } = props;\n const { root, primary } = getPartitionedNativeProps({\n primarySlotTagName: 'span',\n props,\n excludedPropNames: ['onChange', 'onPaste', 'defaultValue'],\n });\n\n const editorRef = useMergedRefs(React.useRef<LexicalEditor>(null), userEditorRef);\n // The disabled state can also be changed by lexical (e.g. by a custom plugin) so\n // we use `useControllableState` to coordinate\n const [disabled, setDisabled] = useControllableState({\n state: props.disabled,\n initialState: false,\n });\n\n const customNodes = props.customNodes ? [...props.customNodes, SentinelNode] : [SentinelNode];\n\n const spanRef = React.useCallback(\n span => {\n // Register the `input` span with lexical\n editorRef.current?.setRootElement(span);\n },\n [editorRef],\n );\n\n // Update lexical when disabled changes\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n editorRef.current?.setEditable(!disabled);\n }\n }, [disabled]);\n\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n return mergeRegister(\n editorRef.current.registerEditableListener(isEditable => {\n setDisabled(!isEditable);\n }),\n editorRef.current?.registerRootListener(root => {\n if (!root) {\n return;\n }\n\n // Remove lexical's inline style so we can apply our own\n // Lexical needs the whitespace style to be either `pre` or `pre-wrap` to work correctly\n root.style.whiteSpace = '';\n }),\n );\n }\n }, [editorRef]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange?.({}, { value: newValue });\n },\n [onChange],\n );\n\n const defaultValueFunction = useDefaultValueFunction(props);\n\n const placeholderValue = slot.optional(props.placeholderValue, { elementType: 'span' });\n const placeholderId = useId('chat-input-placeholder', placeholderValue?.id);\n if (placeholderValue) {\n placeholderValue.id = placeholderId;\n }\n\n return {\n components: {\n root: 'span',\n input: 'span',\n placeholderValue: 'span',\n },\n root: slot.always(props.root, { defaultProps: { ...root }, elementType: 'span' }),\n input: slot.always(props.input, {\n defaultProps: {\n ref: useMergedRefs(ref, spanRef),\n role: 'textbox',\n contentEditable: !disabled,\n 'aria-readonly': disabled ? true : undefined,\n disabled,\n suppressContentEditableWarning: true,\n tabIndex: disabled ? undefined : 0,\n ...primary,\n 'aria-describedby': primary['aria-describedby']\n ? `${primary['aria-describedby']} ${placeholderId}`\n : placeholderId,\n },\n elementType: 'span',\n }),\n placeholderValue,\n lexicalInitialConfig: {\n namespace: 'fai-EditorInput',\n onError: console.error,\n nodes: customNodes,\n editorState: defaultValueFunction,\n theme: customTheme,\n },\n editorRef,\n disabled,\n textPlugin,\n onPaste,\n handleOnChange,\n trimWhiteSpace,\n history,\n isSentinelNodeEnabled,\n };\n};\n\nfunction useDefaultValueFunction(props: EditorInputProps) {\n const { targetDocument } = useFluent();\n const requestAnimationFrame = targetDocument?.defaultView?.requestAnimationFrame;\n\n const [defaultValueFunction] = React.useState(() => {\n const { defaultValue, onDefaultValueSet } = props;\n if (defaultValue === undefined) {\n return undefined;\n }\n\n const insertDefaultValueFunction =\n typeof defaultValue === 'function'\n ? defaultValue\n : () => {\n $insertNodes([$createTextNode(defaultValue)]);\n };\n\n // After the defaultValue function has run, read back the result and give\n // it to the onDefaultValueSet callback.\n const readDefaultValueFunction = onDefaultValueSet\n ? () => {\n const text = $getRoot().getTextContent().replace(SENTINEL_VALUE, '');\n\n // This runs while rendering `LexicalComposer` so delay calling back into the parent\n // until after finished rendering `LexicalComposer`\n requestAnimationFrame?.(() => {\n onDefaultValueSet?.(text);\n });\n }\n : undefined;\n\n return mergeCallbacks(insertDefaultValueFunction, readDefaultValueFunction);\n });\n\n return defaultValueFunction;\n}\n"],"names":["React","getPartitionedNativeProps","slot","useFluent","useId","useIsomorphicLayoutEffect","useMergedRefs","SentinelNode","SENTINEL_VALUE","$createTextNode","$insertNodes","$getRoot","LexicalPlainTextPlugin","mergeRegister","mergeCallbacks","useControllableState","useEditorInput_unstable","props","ref","onChange","onPaste","trimWhiteSpace","textPlugin","history","editorRef","userEditorRef","customTheme","isSentinelNodeEnabled","root","primary","primarySlotTagName","excludedPropNames","useRef","disabled","setDisabled","state","initialState","customNodes","spanRef","useCallback","span","current","setRootElement","setEditable","registerEditableListener","isEditable","registerRootListener","style","whiteSpace","handleOnChange","newValue","value","defaultValueFunction","useDefaultValueFunction","placeholderValue","optional","elementType","placeholderId","id","components","input","always","defaultProps","role","contentEditable","undefined","suppressContentEditableWarning","tabIndex","lexicalInitialConfig","namespace","onError","console","error","nodes","editorState","theme","targetDocument","requestAnimationFrame","defaultView","useState","defaultValue","onDefaultValueSet","insertDefaultValueFunction","readDefaultValueFunction","text","getTextContent","replace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,yBAAyB,EACzBC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,yBAAyB,EACzBC,aAAa,QACR,6BAA6B;AAEpC,SAASC,YAAY,EAAEC,cAAc,QAAQ,uCAAuC;AAEpF,SAASC,eAAe,EAAEC,YAAY,QAAQ,sCAAsC;AACpF,SAASC,QAAQ,QAAQ,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a;QACf;QACAF;QACAc,sBAAsB;YACpBC,WAAW;YACXC,SAASC,QAAQC,KAAK;YACtBC,OAAOpC;YACPqC,aAAatB;YACbuB,OAAOjD;QACT;QACAF;QACAS;QACAX;QACAF;QACA6B;QACA5B;QACAE;QACAI;IACF;AACF,EAAE;AAEF,SAAS0B,wBAAwBpC,KAAuB;QAExB2D;IAD9B,MAAM,EAAEA,cAAc,EAAE,GAAGzE;IAC3B,MAAM0E,wBAAwBD,2BAAAA,sCAAAA,8BAAAA,eAAgBE,WAAW,cAA3BF,kDAAAA,4BAA6BC,qBAAqB;IAEhF,MAAM,CAACzB,qBAAqB,GAAGpD,MAAM+E,QAAQ,CAAC;QAC5C,MAAM,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAGhE;QAC5C,IAAI+D,iBAAiBf,WAAW;YAC9B,OAAOA;QACT;QAEA,MAAMiB,6BACJ,OAAOF,iBAAiB,aACpBA,eACA;YACEtE,aAAa;gBAACD,gBAAgBuE;aAAc;QAC9C;QAEN,yEAAyE;QACzE,wCAAwC;QACxC,MAAMG,2BAA2BF,oBAC7B;YACE,MAAMG,OAAOzE,WAAW0E,cAAc,GAAGC,OAAO,CAAC9E,gBAAgB;YAEjE,oFAAoF;YACpF,mDAAmD;YACnDqE,kCAAAA,4CAAAA,sBAAwB;gBACtBI,8BAAAA,wCAAAA,kBAAoBG;YACtB;QACF,IACAnB;QAEJ,OAAOnD,eAAeoE,4BAA4BC;IACpD;IAEA,OAAO/B;AACT"}
1
+ {"version":3,"sources":["useEditorInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n slot,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { EditorInputProps, EditorInputState } from './EditorInput.types';\nimport { SentinelNode, SENTINEL_VALUE } from '@fluentui-copilot/chat-input-plugins';\nimport type { LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $createTextNode, $insertNodes } from '@fluentui-copilot/react-text-editor';\nimport { $getRoot } from '@fluentui-copilot/react-text-editor';\nimport { LexicalPlainTextPlugin, mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { mergeCallbacks, useControllableState } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render EditorInput.\n *\n * The returned state can be modified with hooks such as useEditorInputStyles_unstable,\n * before being passed to renderEditorInput_unstable.\n *\n * @param props - props from this instance of EditorInput\n * @param ref - reference to root HTMLElement of EditorInput\n */\nexport const useEditorInput_unstable = (props: EditorInputProps, ref: React.Ref<HTMLSpanElement>): EditorInputState => {\n const {\n onChange,\n onPaste,\n trimWhiteSpace = false,\n textPlugin = LexicalPlainTextPlugin,\n history = true,\n editorRef: userEditorRef,\n customTheme,\n isSentinelNodeEnabled = true,\n } = props;\n const { root, primary } = getPartitionedNativeProps({\n primarySlotTagName: 'span',\n props,\n excludedPropNames: ['onChange', 'onPaste', 'defaultValue'],\n });\n\n const editorRef = useMergedRefs(React.useRef<LexicalEditor>(null), userEditorRef);\n // The disabled state can also be changed by lexical (e.g. by a custom plugin) so\n // we use `useControllableState` to coordinate\n const [disabled, setDisabled] = useControllableState({\n state: props.disabled,\n initialState: false,\n });\n\n const customNodes = props.customNodes ? [...props.customNodes, SentinelNode] : [SentinelNode];\n\n const spanRef = React.useCallback(\n (span: HTMLSpanElement | null) => {\n // Register the `input` span with lexical\n editorRef.current?.setRootElement(span);\n },\n [editorRef],\n );\n\n // Update lexical when disabled changes\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n editorRef.current?.setEditable(!disabled);\n }\n }, [disabled]);\n\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n return mergeRegister(\n editorRef.current.registerEditableListener(isEditable => {\n setDisabled(!isEditable);\n }),\n editorRef.current?.registerRootListener(root => {\n if (!root) {\n return;\n }\n\n // Remove lexical's inline style so we can apply our own\n // Lexical needs the whitespace style to be either `pre` or `pre-wrap` to work correctly\n root.style.whiteSpace = '';\n }),\n );\n }\n }, [editorRef]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange?.({}, { value: newValue });\n },\n [onChange],\n );\n\n const defaultValueFunction = useDefaultValueFunction(props);\n\n const placeholderValue = slot.optional(props.placeholderValue, { elementType: 'span' });\n const placeholderId = useId('chat-input-placeholder', placeholderValue?.id);\n if (placeholderValue) {\n placeholderValue.id = placeholderId;\n }\n\n return {\n components: {\n root: 'span',\n input: 'span',\n placeholderValue: 'span',\n },\n root: slot.always(props.root, { defaultProps: { ...root }, elementType: 'span' }),\n input: slot.always(props.input, {\n defaultProps: {\n ref: useMergedRefs(ref, spanRef),\n role: 'textbox',\n contentEditable: !disabled,\n 'aria-readonly': disabled ? true : undefined,\n disabled,\n suppressContentEditableWarning: true,\n tabIndex: disabled ? undefined : 0,\n ...primary,\n 'aria-describedby': primary['aria-describedby']\n ? `${primary['aria-describedby']} ${placeholderId}`\n : placeholderId,\n },\n elementType: 'span',\n }),\n placeholderValue,\n lexicalInitialConfig: {\n namespace: 'fai-EditorInput',\n onError: console.error,\n nodes: customNodes,\n editorState: defaultValueFunction,\n theme: customTheme,\n },\n editorRef,\n disabled,\n textPlugin,\n onPaste,\n handleOnChange,\n trimWhiteSpace,\n history,\n isSentinelNodeEnabled,\n };\n};\n\nfunction useDefaultValueFunction(props: EditorInputProps) {\n const { targetDocument } = useFluent();\n const requestAnimationFrame = targetDocument?.defaultView?.requestAnimationFrame;\n\n const [defaultValueFunction] = React.useState(() => {\n const { defaultValue, onDefaultValueSet } = props;\n if (defaultValue === undefined) {\n return undefined;\n }\n\n const insertDefaultValueFunction =\n typeof defaultValue === 'function'\n ? defaultValue\n : () => {\n $insertNodes([$createTextNode(defaultValue)]);\n };\n\n // After the defaultValue function has run, read back the result and give\n // it to the onDefaultValueSet callback.\n const readDefaultValueFunction = onDefaultValueSet\n ? () => {\n const text = $getRoot().getTextContent().replace(SENTINEL_VALUE, '');\n\n // This runs while rendering `LexicalComposer` so delay calling back into the parent\n // until after finished rendering `LexicalComposer`\n requestAnimationFrame?.(() => {\n onDefaultValueSet?.(text);\n });\n }\n : undefined;\n\n return mergeCallbacks(insertDefaultValueFunction, readDefaultValueFunction);\n });\n\n return defaultValueFunction;\n}\n"],"names":["React","getPartitionedNativeProps","slot","useFluent","useId","useIsomorphicLayoutEffect","useMergedRefs","SentinelNode","SENTINEL_VALUE","$createTextNode","$insertNodes","$getRoot","LexicalPlainTextPlugin","mergeRegister","mergeCallbacks","useControllableState","useEditorInput_unstable","props","ref","onChange","onPaste","trimWhiteSpace","textPlugin","history","editorRef","userEditorRef","customTheme","isSentinelNodeEnabled","root","primary","primarySlotTagName","excludedPropNames","useRef","disabled","setDisabled","state","initialState","customNodes","spanRef","useCallback","span","current","setRootElement","setEditable","registerEditableListener","isEditable","registerRootListener","style","whiteSpace","handleOnChange","newValue","value","defaultValueFunction","useDefaultValueFunction","placeholderValue","optional","elementType","placeholderId","id","components","input","always","defaultProps","role","contentEditable","undefined","suppressContentEditableWarning","tabIndex","lexicalInitialConfig","namespace","onError","console","error","nodes","editorState","theme","targetDocument","requestAnimationFrame","defaultView","useState","defaultValue","onDefaultValueSet","insertDefaultValueFunction","readDefaultValueFunction","text","getTextContent","replace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,yBAAyB,EACzBC,IAAI,EACJC,SAAS,EACTC,KAAK,EACLC,yBAAyB,EACzBC,aAAa,QACR,6BAA6B;AAEpC,SAASC,YAAY,EAAEC,cAAc,QAAQ,uCAAuC;AAEpF,SAASC,eAAe,EAAEC,YAAY,QAAQ,sCAAsC;AACpF,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,SAASC,sBAAs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pBC,WAAW;YACXC,SAASC,QAAQC,KAAK;YACtBC,OAAOpC;YACPqC,aAAatB;YACbuB,OAAOjD;QACT;QACAF;QACAS;QACAX;QACAF;QACA6B;QACA5B;QACAE;QACAI;IACF;AACF,EAAE;AAEF,SAAS0B,wBAAwBpC,KAAuB;QAExB2D;IAD9B,MAAM,EAAEA,cAAc,EAAE,GAAGzE;IAC3B,MAAM0E,wBAAwBD,2BAAAA,sCAAAA,8BAAAA,eAAgBE,WAAW,cAA3BF,kDAAAA,4BAA6BC,qBAAqB;IAEhF,MAAM,CAACzB,qBAAqB,GAAGpD,MAAM+E,QAAQ,CAAC;QAC5C,MAAM,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAGhE;QAC5C,IAAI+D,iBAAiBf,WAAW;YAC9B,OAAOA;QACT;QAEA,MAAMiB,6BACJ,OAAOF,iBAAiB,aACpBA,eACA;YACEtE,aAAa;gBAACD,gBAAgBuE;aAAc;QAC9C;QAEN,yEAAyE;QACzE,wCAAwC;QACxC,MAAMG,2BAA2BF,oBAC7B;YACE,MAAMG,OAAOzE,WAAW0E,cAAc,GAAGC,OAAO,CAAC9E,gBAAgB;YAEjE,oFAAoF;YACpF,mDAAmD;YACnDqE,kCAAAA,4CAAAA,sBAAwB;gBACtBI,8BAAAA,wCAAAA,kBAAoBG;YACtB;QACF,IACAnB;QAEJ,OAAOnD,eAAeoE,4BAA4BC;IACpD;IAEA,OAAO/B;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useAnimatedPlaceholder.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderProps, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport { PlaceholderMotion } from './placeholderMotion';\nimport { type PresenceMotionSlotProps, presenceMotionSlot } from '@fluentui/react-motion';\n\n/**\n * Create the state required to render AnimatedPlaceholder.\n *\n * The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,\n * before being passed to renderAnimatedPlaceholder_unstable.\n *\n * @param props - props from this instance of AnimatedPlaceholder\n * @param ref - reference to root HTMLElement of AnimatedPlaceholder\n */\nexport const useAnimatedPlaceholder_unstable = (\n props: AnimatedPlaceholderProps,\n ref: React.Ref<HTMLDivElement>,\n): AnimatedPlaceholderState => {\n const { placeholderValue } = props;\n\n const [placeholder, setPlaceholder] = React.useState(placeholderValue);\n const [visible, setVisible] = React.useState(true);\n\n React.useEffect(() => {\n if (placeholderValue !== placeholder) {\n setVisible(false);\n }\n }, [placeholder, placeholderValue]);\n\n const onMotionFinish = () => {\n setPlaceholder(placeholderValue);\n setVisible(true);\n };\n\n return {\n components: {\n root: 'div',\n motion: PlaceholderMotion as React.FC<PresenceMotionSlotProps>,\n placeholder: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n motion: presenceMotionSlot<{}>(props.motion, {\n elementType: PlaceholderMotion,\n defaultProps: {\n visible: visible,\n onMotionFinish: onMotionFinish,\n },\n }),\n placeholder: slot.always(\n getIntrinsicElementProps('div', {\n children: placeholder,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["useAnimatedPlaceholder_unstable","props","ref","placeholderValue","placeholder","setPlaceholder","React","useState","visible","setVisible","useEffect","onMotionFinish","components","root","motion","PlaceholderMotion","slot","always","getIntrinsicElementProps","elementType","presenceMotionSlot","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;iCACwB;mCAEb;6BAC+B;AAW1D,MAAMA,kCAAkC,CAC7CC,OACAC;IAEA,MAAM,EAAEC,gBAAgB,EAAE,GAAGF;IAE7B,MAAM,CAACG,aAAaC,eAAe,GAAGC,OAAMC,QAAQ,CAACJ;IACrD,MAAM,CAACK,SAASC,WAAW,GAAGH,OAAMC,QAAQ,CAAC;IAE7CD,OAAMI,SAAS,CAAC;QACd,IAAIP,qBAAqBC,aAAa;YACpCK,WAAW;QACb;IACF,GAAG;QAACL;QAAaD;KAAiB;IAElC,MAAMQ,iBAAiB;QACrBN,eAAeF;QACfM,WAAW;IACb;IAEA,OAAO;QACLG,YAAY;YACVC,MAAM;YACNC,QAAQC,oCAAAA;YACRX,aAAa;QACf;QACAS,MAAMG,qBAAAA,CAAKC,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,OAAO;YAC9BhB;YACA,GAAGD,KAAK;QACV,IACA;YAAEkB,aAAa;QAAM;QAEvBL,QAAQM,IAAAA,+BAAAA,EAAuBnB,MAAMa,MAAM,EAAE;YAC3CK,aAAaJ,oCAAAA;YACbM,cAAc;gBACZb,SAASA;gBACTG,gBAAgBA;YAClB;QACF;QACAP,aAAaY,qBAAAA,CAAKC,MAAM,CACtBC,IAAAA,yCAAAA,EAAyB,OAAO;YAC9BI,UAAUlB;QACZ,IACA;YAAEe,aAAa;QAAM;IAEzB;AACF"}
1
+ {"version":3,"sources":["useAnimatedPlaceholder.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderProps, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport { PlaceholderMotion } from './placeholderMotion';\nimport { presenceMotionSlot } from '@fluentui/react-motion';\n\n/**\n * Create the state required to render AnimatedPlaceholder.\n *\n * The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,\n * before being passed to renderAnimatedPlaceholder_unstable.\n *\n * @param props - props from this instance of AnimatedPlaceholder\n * @param ref - reference to root HTMLElement of AnimatedPlaceholder\n */\nexport const useAnimatedPlaceholder_unstable = (\n props: AnimatedPlaceholderProps,\n ref: React.Ref<HTMLDivElement>,\n): AnimatedPlaceholderState => {\n const { placeholderValue } = props;\n\n const [placeholder, setPlaceholder] = React.useState(placeholderValue);\n const [visible, setVisible] = React.useState(true);\n\n React.useEffect(() => {\n if (placeholderValue !== placeholder) {\n setVisible(false);\n }\n }, [placeholder, placeholderValue]);\n\n const onMotionFinish = () => {\n setPlaceholder(placeholderValue);\n setVisible(true);\n };\n\n return {\n components: {\n root: 'div',\n motion: PlaceholderMotion,\n placeholder: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n }),\n { elementType: 'div' },\n ),\n motion: presenceMotionSlot<{}>(props.motion, {\n elementType: PlaceholderMotion,\n defaultProps: {\n visible: visible,\n onMotionFinish: onMotionFinish,\n },\n }),\n placeholder: slot.always(\n getIntrinsicElementProps('div', {\n children: placeholder,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["useAnimatedPlaceholder_unstable","props","ref","placeholderValue","placeholder","setPlaceholder","React","useState","visible","setVisible","useEffect","onMotionFinish","components","root","motion","PlaceholderMotion","slot","always","getIntrinsicElementProps","elementType","presenceMotionSlot","defaultProps","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAeaA;;;eAAAA;;;;iEAfU;iCACwB;mCAEb;6BACC;AAW5B,MAAMA,kCAAkC,CAC7CC,OACAC;IAEA,MAAM,EAAEC,gBAAgB,EAAE,GAAGF;IAE7B,MAAM,CAACG,aAAaC,eAAe,GAAGC,OAAMC,QAAQ,CAACJ;IACrD,MAAM,CAACK,SAASC,WAAW,GAAGH,OAAMC,QAAQ,CAAC;IAE7CD,OAAMI,SAAS,CAAC;QACd,IAAIP,qBAAqBC,aAAa;YACpCK,WAAW;QACb;IACF,GAAG;QAACL;QAAaD;KAAiB;IAElC,MAAMQ,iBAAiB;QACrBN,eAAeF;QACfM,WAAW;IACb;IAEA,OAAO;QACLG,YAAY;YACVC,MAAM;YACNC,QAAQC,oCAAAA;YACRX,aAAa;QACf;QACAS,MAAMG,qBAAAA,CAAKC,MAAM,CACfC,IAAAA,yCAAAA,EAAyB,OAAO;YAC9BhB;YACA,GAAGD,KAAK;QACV,IACA;YAAEkB,aAAa;QAAM;QAEvBL,QAAQM,IAAAA,+BAAAA,EAAuBnB,MAAMa,MAAM,EAAE;YAC3CK,aAAaJ,oCAAAA;YACbM,cAAc;gBACZb,SAASA;gBACTG,gBAAgBA;YAClB;QACF;QACAP,aAAaY,qBAAAA,CAAKC,MAAM,CACtBC,IAAAA,yCAAAA,EAAyB,OAAO;YAC9BI,UAAUlB;QACZ,IACA;YAAEe,aAAa;QAAM;IAEzB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useEditorInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n slot,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { EditorInputProps, EditorInputState } from './EditorInput.types';\nimport { SentinelNode, SENTINEL_VALUE } from '@fluentui-copilot/chat-input-plugins';\nimport type { LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $createTextNode, $insertNodes } from '@fluentui-copilot/react-text-editor';\nimport { $getRoot } from '@fluentui-copilot/react-text-editor';\nimport { LexicalPlainTextPlugin, mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { mergeCallbacks, useControllableState } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render EditorInput.\n *\n * The returned state can be modified with hooks such as useEditorInputStyles_unstable,\n * before being passed to renderEditorInput_unstable.\n *\n * @param props - props from this instance of EditorInput\n * @param ref - reference to root HTMLElement of EditorInput\n */\nexport const useEditorInput_unstable = (props: EditorInputProps, ref: React.Ref<HTMLSpanElement>): EditorInputState => {\n const {\n onChange,\n onPaste,\n trimWhiteSpace = false,\n textPlugin = LexicalPlainTextPlugin,\n history = true,\n editorRef: userEditorRef,\n customTheme,\n isSentinelNodeEnabled = true,\n } = props;\n const { root, primary } = getPartitionedNativeProps({\n primarySlotTagName: 'span',\n props,\n excludedPropNames: ['onChange', 'onPaste', 'defaultValue'],\n });\n\n const editorRef = useMergedRefs(React.useRef<LexicalEditor>(null), userEditorRef);\n // The disabled state can also be changed by lexical (e.g. by a custom plugin) so\n // we use `useControllableState` to coordinate\n const [disabled, setDisabled] = useControllableState({\n state: props.disabled,\n initialState: false,\n });\n\n const customNodes = props.customNodes ? [...props.customNodes, SentinelNode] : [SentinelNode];\n\n const spanRef = React.useCallback(\n span => {\n // Register the `input` span with lexical\n editorRef.current?.setRootElement(span);\n },\n [editorRef],\n );\n\n // Update lexical when disabled changes\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n editorRef.current?.setEditable(!disabled);\n }\n }, [disabled]);\n\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n return mergeRegister(\n editorRef.current.registerEditableListener(isEditable => {\n setDisabled(!isEditable);\n }),\n editorRef.current?.registerRootListener(root => {\n if (!root) {\n return;\n }\n\n // Remove lexical's inline style so we can apply our own\n // Lexical needs the whitespace style to be either `pre` or `pre-wrap` to work correctly\n root.style.whiteSpace = '';\n }),\n );\n }\n }, [editorRef]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange?.({}, { value: newValue });\n },\n [onChange],\n );\n\n const defaultValueFunction = useDefaultValueFunction(props);\n\n const placeholderValue = slot.optional(props.placeholderValue, { elementType: 'span' });\n const placeholderId = useId('chat-input-placeholder', placeholderValue?.id);\n if (placeholderValue) {\n placeholderValue.id = placeholderId;\n }\n\n return {\n components: {\n root: 'span',\n input: 'span',\n placeholderValue: 'span',\n },\n root: slot.always(props.root, { defaultProps: { ...root }, elementType: 'span' }),\n input: slot.always(props.input, {\n defaultProps: {\n ref: useMergedRefs(ref, spanRef),\n role: 'textbox',\n contentEditable: !disabled,\n 'aria-readonly': disabled ? true : undefined,\n disabled,\n suppressContentEditableWarning: true,\n tabIndex: disabled ? undefined : 0,\n ...primary,\n 'aria-describedby': primary['aria-describedby']\n ? `${primary['aria-describedby']} ${placeholderId}`\n : placeholderId,\n },\n elementType: 'span',\n }),\n placeholderValue,\n lexicalInitialConfig: {\n namespace: 'fai-EditorInput',\n onError: console.error,\n nodes: customNodes,\n editorState: defaultValueFunction,\n theme: customTheme,\n },\n editorRef,\n disabled,\n textPlugin,\n onPaste,\n handleOnChange,\n trimWhiteSpace,\n history,\n isSentinelNodeEnabled,\n };\n};\n\nfunction useDefaultValueFunction(props: EditorInputProps) {\n const { targetDocument } = useFluent();\n const requestAnimationFrame = targetDocument?.defaultView?.requestAnimationFrame;\n\n const [defaultValueFunction] = React.useState(() => {\n const { defaultValue, onDefaultValueSet } = props;\n if (defaultValue === undefined) {\n return undefined;\n }\n\n const insertDefaultValueFunction =\n typeof defaultValue === 'function'\n ? defaultValue\n : () => {\n $insertNodes([$createTextNode(defaultValue)]);\n };\n\n // After the defaultValue function has run, read back the result and give\n // it to the onDefaultValueSet callback.\n const readDefaultValueFunction = onDefaultValueSet\n ? () => {\n const text = $getRoot().getTextContent().replace(SENTINEL_VALUE, '');\n\n // This runs while rendering `LexicalComposer` so delay calling back into the parent\n // until after finished rendering `LexicalComposer`\n requestAnimationFrame?.(() => {\n onDefaultValueSet?.(text);\n });\n }\n : undefined;\n\n return mergeCallbacks(insertDefaultValueFunction, readDefaultValueFunction);\n });\n\n return defaultValueFunction;\n}\n"],"names":["useEditorInput_unstable","props","ref","onChange","onPaste","trimWhiteSpace","textPlugin","LexicalPlainTextPlugin","history","editorRef","userEditorRef","customTheme","isSentinelNodeEnabled","root","primary","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","useMergedRefs","React","useRef","disabled","setDisabled","useControllableState","state","initialState","customNodes","SentinelNode","spanRef","useCallback","span","current","setRootElement","useIsomorphicLayoutEffect","setEditable","mergeRegister","registerEditableListener","isEditable","registerRootListener","style","whiteSpace","handleOnChange","newValue","value","defaultValueFunction","useDefaultValueFunction","placeholderValue","slot","optional","elementType","placeholderId","useId","id","components","input","always","defaultProps","role","contentEditable","undefined","suppressContentEditableWarning","tabIndex","lexicalInitialConfig","namespace","onError","console","error","nodes","editorState","theme","targetDocument","useFluent","requestAnimationFrame","defaultView","useState","defaultValue","onDefaultValueSet","insertDefaultValueFunction","$insertNodes","$createTextNode","readDefaultValueFunction","text","$getRoot","getTextContent","replace","SENTINEL_VALUE","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BaA;;;eAAAA;;;;iEA1BU;iCAQhB;kCAEsC;iCAEC;gCAGO;AAW9C,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EACJC,QAAQ,EACRC,OAAO,EACPC,iBAAiB,KAAK,EACtBC,aAAaC,uCAAsB,EACnCC,UAAU,IAAI,EACdC,WAAWC,aAAa,EACxBC,WAAW,EACXC,wBAAwB,IAAI,EAC7B,GAAGX;IACJ,MAAM,EAAEY,IAAI,EAAEC,OAAO,EAAE,GAAGC,IAAAA,0CAAAA,EAA0B;QAClDC,oBAAoB;QACpBf;QACAgB,mBAAmB;YAAC;YAAY;YAAW;SAAe;IAC5D;IAEA,MAAMR,YAAYS,IAAAA,8BAAAA,EAAcC,OAAMC,MAAM,CAAgB,OAAOV;IACnE,iFAAiF;IACjF,8CAA8C;IAC9C,MAAM,CAACW,UAAUC,YAAY,GAAGC,IAAAA,oCAAAA,EAAqB;QACnDC,OAAOvB,MAAMoB,QAAQ;QACrBI,cAAc;IAChB;IAEA,MAAMC,cAAczB,MAAMyB,WAAW,GAAG;WAAIzB,MAAMyB,WAAW;QAAEC,8BAAAA;KAAa,GAAG;QAACA,8BAAAA;KAAa;IAE7F,MAAMC,UAAUT,OAAMU,WAAW,CAC/BC,CAAAA;YAEErB;QAAAA,CAAAA,qBAAAA,UAAUsB,OAAO,AAAPA,MAAO,QAAjBtB,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAAmBu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;QACT;QAEA,MAAMkB,6BACJ,OAAOF,iBAAiB,aACpBA,eACA;YACEG,IAAAA,6BAAAA,EAAa;gBAACC,IAAAA,gCAAAA,EAAgBJ;aAAc;QAC9C;QAEN,yEAAyE;QACzE,wCAAwC;QACxC,MAAMK,2BAA2BJ,oBAC7B;YACE,MAAMK,OAAOC,IAAAA,yBAAAA,IAAWC,cAAc,GAAGC,OAAO,CAACC,gCAAAA,EAAgB;YAEjE,oFAAoF;YACpF,mDAAmD;YACnDb,0BAAAA,QAAAA,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAwB;gBACtBI,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBK;YACtB;QACF,IACAtB;QAEJ,OAAO2B,IAAAA,8BAAAA,EAAeT,4BAA4BG;IACpD;IAEA,OAAOpC;AACT"}
1
+ {"version":3,"sources":["useEditorInput.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n getPartitionedNativeProps,\n slot,\n useFluent,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport type { EditorInputProps, EditorInputState } from './EditorInput.types';\nimport { SentinelNode, SENTINEL_VALUE } from '@fluentui-copilot/chat-input-plugins';\nimport type { LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $createTextNode, $insertNodes } from '@fluentui-copilot/react-text-editor';\nimport { $getRoot } from '@fluentui-copilot/react-text-editor';\nimport { LexicalPlainTextPlugin, mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { mergeCallbacks, useControllableState } from '@fluentui/react-utilities';\n\n/**\n * Create the state required to render EditorInput.\n *\n * The returned state can be modified with hooks such as useEditorInputStyles_unstable,\n * before being passed to renderEditorInput_unstable.\n *\n * @param props - props from this instance of EditorInput\n * @param ref - reference to root HTMLElement of EditorInput\n */\nexport const useEditorInput_unstable = (props: EditorInputProps, ref: React.Ref<HTMLSpanElement>): EditorInputState => {\n const {\n onChange,\n onPaste,\n trimWhiteSpace = false,\n textPlugin = LexicalPlainTextPlugin,\n history = true,\n editorRef: userEditorRef,\n customTheme,\n isSentinelNodeEnabled = true,\n } = props;\n const { root, primary } = getPartitionedNativeProps({\n primarySlotTagName: 'span',\n props,\n excludedPropNames: ['onChange', 'onPaste', 'defaultValue'],\n });\n\n const editorRef = useMergedRefs(React.useRef<LexicalEditor>(null), userEditorRef);\n // The disabled state can also be changed by lexical (e.g. by a custom plugin) so\n // we use `useControllableState` to coordinate\n const [disabled, setDisabled] = useControllableState({\n state: props.disabled,\n initialState: false,\n });\n\n const customNodes = props.customNodes ? [...props.customNodes, SentinelNode] : [SentinelNode];\n\n const spanRef = React.useCallback(\n (span: HTMLSpanElement | null) => {\n // Register the `input` span with lexical\n editorRef.current?.setRootElement(span);\n },\n [editorRef],\n );\n\n // Update lexical when disabled changes\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n editorRef.current?.setEditable(!disabled);\n }\n }, [disabled]);\n\n useIsomorphicLayoutEffect(() => {\n if (editorRef.current) {\n return mergeRegister(\n editorRef.current.registerEditableListener(isEditable => {\n setDisabled(!isEditable);\n }),\n editorRef.current?.registerRootListener(root => {\n if (!root) {\n return;\n }\n\n // Remove lexical's inline style so we can apply our own\n // Lexical needs the whitespace style to be either `pre` or `pre-wrap` to work correctly\n root.style.whiteSpace = '';\n }),\n );\n }\n }, [editorRef]);\n\n const handleOnChange = React.useCallback(\n (newValue: string) => {\n onChange?.({}, { value: newValue });\n },\n [onChange],\n );\n\n const defaultValueFunction = useDefaultValueFunction(props);\n\n const placeholderValue = slot.optional(props.placeholderValue, { elementType: 'span' });\n const placeholderId = useId('chat-input-placeholder', placeholderValue?.id);\n if (placeholderValue) {\n placeholderValue.id = placeholderId;\n }\n\n return {\n components: {\n root: 'span',\n input: 'span',\n placeholderValue: 'span',\n },\n root: slot.always(props.root, { defaultProps: { ...root }, elementType: 'span' }),\n input: slot.always(props.input, {\n defaultProps: {\n ref: useMergedRefs(ref, spanRef),\n role: 'textbox',\n contentEditable: !disabled,\n 'aria-readonly': disabled ? true : undefined,\n disabled,\n suppressContentEditableWarning: true,\n tabIndex: disabled ? undefined : 0,\n ...primary,\n 'aria-describedby': primary['aria-describedby']\n ? `${primary['aria-describedby']} ${placeholderId}`\n : placeholderId,\n },\n elementType: 'span',\n }),\n placeholderValue,\n lexicalInitialConfig: {\n namespace: 'fai-EditorInput',\n onError: console.error,\n nodes: customNodes,\n editorState: defaultValueFunction,\n theme: customTheme,\n },\n editorRef,\n disabled,\n textPlugin,\n onPaste,\n handleOnChange,\n trimWhiteSpace,\n history,\n isSentinelNodeEnabled,\n };\n};\n\nfunction useDefaultValueFunction(props: EditorInputProps) {\n const { targetDocument } = useFluent();\n const requestAnimationFrame = targetDocument?.defaultView?.requestAnimationFrame;\n\n const [defaultValueFunction] = React.useState(() => {\n const { defaultValue, onDefaultValueSet } = props;\n if (defaultValue === undefined) {\n return undefined;\n }\n\n const insertDefaultValueFunction =\n typeof defaultValue === 'function'\n ? defaultValue\n : () => {\n $insertNodes([$createTextNode(defaultValue)]);\n };\n\n // After the defaultValue function has run, read back the result and give\n // it to the onDefaultValueSet callback.\n const readDefaultValueFunction = onDefaultValueSet\n ? () => {\n const text = $getRoot().getTextContent().replace(SENTINEL_VALUE, '');\n\n // This runs while rendering `LexicalComposer` so delay calling back into the parent\n // until after finished rendering `LexicalComposer`\n requestAnimationFrame?.(() => {\n onDefaultValueSet?.(text);\n });\n }\n : undefined;\n\n return mergeCallbacks(insertDefaultValueFunction, readDefaultValueFunction);\n });\n\n return defaultValueFunction;\n}\n"],"names":["useEditorInput_unstable","props","ref","onChange","onPaste","trimWhiteSpace","textPlugin","LexicalPlainTextPlugin","history","editorRef","userEditorRef","customTheme","isSentinelNodeEnabled","root","primary","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","useMergedRefs","React","useRef","disabled","setDisabled","useControllableState","state","initialState","customNodes","SentinelNode","spanRef","useCallback","span","current","setRootElement","useIsomorphicLayoutEffect","setEditable","mergeRegister","registerEditableListener","isEditable","registerRootListener","style","whiteSpace","handleOnChange","newValue","value","defaultValueFunction","useDefaultValueFunction","placeholderValue","slot","optional","elementType","placeholderId","useId","id","components","input","always","defaultProps","role","contentEditable","undefined","suppressContentEditableWarning","tabIndex","lexicalInitialConfig","namespace","onError","console","error","nodes","editorState","theme","targetDocument","useFluent","requestAnimationFrame","defaultView","useState","defaultValue","onDefaultValueSet","insertDefaultValueFunction","$insertNodes","$createTextNode","readDefaultValueFunction","text","$getRoot","getTextContent","replace","SENTINEL_VALUE","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BaA;;;eAAAA;;;;iEA1BU;iCAQhB;kCAEsC;iCAEC;gCAGO;AAW9C,MAAMA,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EACJC,QAAQ,EACRC,OAAO,EACPC,iBAAiB,KAAK,EACtBC,aAAaC,uCAAsB,EACnCC,UAAU,IAAI,EACdC,WAAWC,aAAa,EACxBC,WAAW,EACXC,wBAAwB,IAAI,EAC7B,GAAGX;IACJ,MAAM,EAAEY,IAAI,EAAEC,OAAO,EAAE,GAAGC,IAAAA,0CAAAA,EAA0B;QAClDC,oBAAoB;QACpBf;QACAgB,mBAAmB;YAAC;YAAY;YAAW;SAAe;IAC5D;IAEA,MAAMR,YAAYS,IAAAA,8BAAAA,EAAcC,OAAMC,MAAM,CAAgB,OAAOV;IACnE,iFAAiF;IACjF,8CAA8C;IAC9C,MAAM,CAACW,UAAUC,YAAY,GAAGC,IAAAA,oCAAAA,EAAqB;QACnDC,OAAOvB,MAAMoB,QAAQ;QACrBI,cAAc;IAChB;IAEA,MAAMC,cAAczB,MAAMyB,WAAW,GAA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A,MAAW,QAA3BH,gCAAAA,KAAAA,IAAAA,KAAAA,IAAAA,4BAA6BE,qBAAqB;IAEhF,MAAM,CAAC5B,qBAAqB,GAAGzB,OAAMuD,QAAQ,CAAC;QAC5C,MAAM,EAAEC,YAAY,EAAEC,iBAAiB,EAAE,GAAG3E;QAC5C,IAAI0E,iBAAiBhB,WAAW;YAC9B,OAAOA;QACT;QAEA,MAAMkB,6BACJ,OAAOF,iBAAiB,aACpBA,eACA;YACEG,IAAAA,6BAAAA,EAAa;gBAACC,IAAAA,gCAAAA,EAAgBJ;aAAc;QAC9C;QAEN,yEAAyE;QACzE,wCAAwC;QACxC,MAAMK,2BAA2BJ,oBAC7B;YACE,MAAMK,OAAOC,IAAAA,yBAAAA,IAAWC,cAAc,GAAGC,OAAO,CAACC,gCAAAA,EAAgB;YAEjE,oFAAoF;YACpF,mDAAmD;YACnDb,0BAAAA,QAAAA,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAwB;gBACtBI,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBK;YACtB;QACF,IACAtB;QAEJ,OAAO2B,IAAAA,8BAAAA,EAAeT,4BAA4BG;IACpD;IAEA,OAAOpC;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-editor-input",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "a base rich editor input.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -13,9 +13,9 @@
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
15
  "@fluentui-copilot/chat-input-plugins": "^0.5.1",
16
- "@fluentui-copilot/react-chat-input-plugins": "^0.5.4",
16
+ "@fluentui-copilot/react-chat-input-plugins": "^0.5.5",
17
17
  "@fluentui-copilot/react-text-editor": "^0.4.2",
18
- "@fluentui-copilot/tokens": "^0.3.13",
18
+ "@fluentui-copilot/tokens": "^0.3.14",
19
19
  "@swc/helpers": "^0.5.1"
20
20
  },
21
21
  "peerDependencies": {