@fluentui-copilot/react-chat-input-plugins 0.4.10 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -2
- package/dist/index.d.ts +0 -1
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js +2 -2
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +1 -1
- package/lib/components/GhostText/useGhostTextStyles.styles.js +5 -5
- package/lib/components/GhostText/useGhostTextStyles.styles.js.map +1 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +0 -11
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.js +4 -4
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +1 -15
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 12 Jun 2025 17:49:27 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.5.1",
|
|
7
|
+
"version": "0.5.1",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
13
|
+
"commit": "53a6e5419e6170dea520ebec933d347ce0bedb60",
|
|
14
|
+
"comment": "chore: Update typographyStyles import to use @fluentui-copilot/tokens instead of @fluentui/react-components"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Wed, 28 May 2025 23:41:44 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.5.0",
|
|
22
|
+
"version": "0.5.0",
|
|
23
|
+
"comments": {
|
|
24
|
+
"minor": [
|
|
25
|
+
{
|
|
26
|
+
"author": "owcampbe@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
28
|
+
"commit": "914b30d1dd5b9e19a2a156578894a7b8163f9caf",
|
|
29
|
+
"comment": "feat: Remove defaultValue handling from BasicFunctionalityPlugin."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Mon, 19 May 2025 18:04:27 GMT",
|
|
6
36
|
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.4.10",
|
|
7
37
|
"version": "0.4.10",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-chat-input-plugins
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 12 Jun 2025 17:49:27 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.5.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.5.1)
|
|
8
|
+
|
|
9
|
+
Thu, 12 Jun 2025 17:49:27 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.5.0..@fluentui-copilot/react-chat-input-plugins_v0.5.1)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- chore: Update typographyStyles import to use @fluentui-copilot/tokens instead of @fluentui/react-components ([PR #3125](https://github.com/microsoft/fluentai/pull/3125) by Humberto.Morimoto@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [0.5.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.5.0)
|
|
17
|
+
|
|
18
|
+
Wed, 28 May 2025 23:41:44 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.4.10..@fluentui-copilot/react-chat-input-plugins_v0.5.0)
|
|
20
|
+
|
|
21
|
+
### Minor changes
|
|
22
|
+
|
|
23
|
+
- feat: Remove defaultValue handling from BasicFunctionalityPlugin. ([PR #3032](https://github.com/microsoft/fluentai/pull/3032) by owcampbe@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [0.4.10](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.4.10)
|
|
8
26
|
|
|
9
|
-
Mon, 19 May 2025 18:
|
|
27
|
+
Mon, 19 May 2025 18:04:27 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.4.9..@fluentui-copilot/react-chat-input-plugins_v0.4.10)
|
|
11
29
|
|
|
12
30
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,6 @@ export declare function $isGhostTextNode(node: LexicalNode | null | undefined):
|
|
|
33
33
|
export declare const BasicFunctionalityPlugin: React_2.ForwardRefExoticComponent<BasicFunctionalityPluginProps & React_2.RefAttributes<BasicFunctionalityPluginRef>>;
|
|
34
34
|
|
|
35
35
|
export declare type BasicFunctionalityPluginProps = {
|
|
36
|
-
defaultValue?: string;
|
|
37
36
|
trimWhitespace?: boolean;
|
|
38
37
|
onCountChanged?: (count: number) => void;
|
|
39
38
|
onContentChange?: (value: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __resetStyles, mergeClasses
|
|
2
|
-
import { tokens } from '@fluentui-copilot/tokens';
|
|
1
|
+
import { __resetStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
|
|
3
3
|
export const chatInputTokenClassNames = {
|
|
4
4
|
root: 'fai-ChatInputToken'
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { ChatInputTokenSlots, ChatInputTokenState } from './ChatInputToken.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputTokenClassNames: SlotClassNames<ChatInputTokenSlots> = {\n root: 'fai-ChatInputToken',\n};\n\n/**\n * Styles for the root slot\n */\nconst useBaseClassName = makeResetStyles({\n ...typographyStyles.caption1,\n lineHeight: `calc(${tokens.lineHeightBase200} + (2 * ${tokens.spacingVerticalXXS}) + (2 * ${tokens.strokeWidthThin}))`,\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusMedium,\n boxDecorationBreak: 'clone',\n color: tokens.colorNeutralForeground2,\n padding: `${tokens.spacingVerticalXXS} 0`,\n});\n\n/**\n * Apply styling to the ChatInputToken slots based on the state\n */\nexport const useChatInputTokenStyles_unstable = (state: ChatInputTokenState): ChatInputTokenState => {\n 'use no memo';\n\n const baseClassName = useBaseClassName();\n state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","tokens","typographyStyles","chatInputTokenClassNames","root","useBaseClassName","caption1","lineHeight","lineHeightBase200","spacingVerticalXXS","strokeWidthThin","backgroundColor","colorNeutralBackground3","border","colorTransparentStroke","borderRadius","borderRadiusMedium","boxDecorationBreak","color","colorNeutralForeground2","padding","useChatInputTokenStyles_unstable","state","baseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,6BAA6B;AAC3E,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AAIpE,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBN,gBAAgB;IACvC,GAAGG,iBAAiBI,QAAQ;IAC5BC,YAAY,CAAC,KAAK,EAAEN,OAAOO,iBAAiB,CAAC,QAAQ,EAAEP,OAAOQ,kBAAkB,CAAC,SAAS,EAAER,OAAOS,eAAe,CAAC,EAAE,CAAC;IACtHC,iBAAiBV,OAAOW,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEZ,OAAOS,eAAe,CAAC,OAAO,EAAET,OAAOa,sBAAsB,CAAC,CAAC;IAC1EC,cAAcd,OAAOe,kBAAkB;IACvCC,oBAAoB;IACpBC,OAAOjB,OAAOkB,uBAAuB;IACrCC,SAAS,CAAC,EAAEnB,OAAOQ,kBAAkB,CAAC,EAAE,CAAC;AAC3C;AAEA;;CAEC,GACD,OAAO,MAAMY,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,gBAAgBlB;IACtBiB,MAAMlB,IAAI,CAACoB,SAAS,GAAGxB,aAAaG,yBAAyBC,IAAI,EAAEmB,eAAeD,MAAMlB,IAAI,CAACoB,SAAS;IAEtG,OAAOF;AACT,EAAE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __styles, mergeClasses
|
|
2
|
-
import { tokens } from '@fluentui-copilot/tokens';
|
|
1
|
+
import { __styles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui-copilot/tokens';
|
|
3
3
|
export const ghostTextClassNames = {
|
|
4
4
|
root: 'fai-GhostText',
|
|
5
5
|
indicator: 'fai-GhostText__indicator'
|
|
@@ -18,8 +18,8 @@ const useStyles = __styles({
|
|
|
18
18
|
indicator: {
|
|
19
19
|
Bahqtrf: "fk6fouc",
|
|
20
20
|
Be2twd7: "f13mqy1h",
|
|
21
|
-
Bhrd7zp: "
|
|
22
|
-
Bg96gwp: "
|
|
21
|
+
Bhrd7zp: "flh3ekv",
|
|
22
|
+
Bg96gwp: "fwrc4pm",
|
|
23
23
|
sj55zd: "f11d4kpn",
|
|
24
24
|
De3pzq: "f3vzo32",
|
|
25
25
|
Byoj8tv: 0,
|
|
@@ -38,7 +38,7 @@ const useStyles = __styles({
|
|
|
38
38
|
}, {
|
|
39
39
|
d: [".fxc4j92{color:var(--colorNeutralForeground4);}", ".fibxuh5{white-space:pre-wrap;}", [".fkln5zr{gap:var(--spacingHorizontalXS);}", {
|
|
40
40
|
p: -1
|
|
41
|
-
}], ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".
|
|
41
|
+
}], ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f13mqy1h{font-size:var(--fontSizeBase100);}", ".flh3ekv{font-weight:var(--fontWeightBold);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f3vzo32{background-color:var(--colorNeutralBackground5);}", [".f1vo1c1k{padding:var(--spacingVerticalNone) var(--spacingHorizontalSNudge);}", {
|
|
42
42
|
p: -1
|
|
43
43
|
}], [".fq9zq91{border-radius:var(--borderRadiusSmall);}", {
|
|
44
44
|
p: -1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","ghostTextClassNames","root","indicator","useStyles","color","colorNeutralForeground4","whiteSpace","gap","spacingHorizontalXS","caption2Strong","colorNeutralForeground3","backgroundColor","colorNeutralBackground5","padding","spacingVerticalNone","spacingHorizontalSNudge","borderRadius","borderRadiusSmall","marginLeft","merginRight","useGhostTextStyles_unstable","state","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AACtE,SAASC,MAAM,EAAEC,gBAAgB,QAAQ,2BAA2B;AAIpE,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BK,MAAM;QACJG,OAAON,OAAOO,uBAAuB;QACrCC,YAAY;QACZC,KAAKT,OAAOU,mBAAmB;IACjC;IAEAN,WAAW;QACT,GAAGH,iBAAiBU,cAAc;QAClCL,OAAON,OAAOY,uBAAuB;QACrCC,iBAAiBb,OAAOc,uBAAuB;QAC/CC,SAAS,CAAC,EAAEf,OAAOgB,mBAAmB,CAAC,CAAC,EAAEhB,OAAOiB,uBAAuB,CAAC,CAAC;QAC1EC,cAAclB,OAAOmB,iBAAiB;QACtCC,YAAYpB,OAAOU,mBAAmB;QACtCW,aAAarB,OAAOU,mBAAmB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMY,8BAA8B,CAACC;IAC1C;IAEA,MAAMC,SAASnB;IACfkB,MAAMpB,IAAI,CAACsB,SAAS,GAAG1B,aAAaG,oBAAoBC,IAAI,EAAEqB,OAAOrB,IAAI,EAAEoB,MAAMpB,IAAI,CAACsB,SAAS;IAE/F,IAAIF,MAAMnB,SAAS,EAAE;QACnBmB,MAAMnB,SAAS,CAACqB,SAAS,GAAG1B,aAC1BG,oBAAoBE,SAAS,EAC7BoB,OAAOpB,SAAS,EAChBmB,MAAMnB,SAAS,CAACqB,SAAS;IAE7B;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -4,7 +4,6 @@ import { useIsomorphicLayoutEffect } from '@fluentui/react-components';
|
|
|
4
4
|
import { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';
|
|
5
5
|
export const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {
|
|
6
6
|
const {
|
|
7
|
-
defaultValue,
|
|
8
7
|
trimWhitespace,
|
|
9
8
|
onCountChanged,
|
|
10
9
|
onContentChange,
|
|
@@ -27,16 +26,6 @@ export const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {
|
|
|
27
26
|
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.setIsDisabled(isDisabled);
|
|
28
27
|
}
|
|
29
28
|
}), [basicFunctionalityImpl]);
|
|
30
|
-
const setDefaultValue = React.useRef(false);
|
|
31
|
-
// useIsomorphicLayoutEffect is used to avoid flickering on first render
|
|
32
|
-
useIsomorphicLayoutEffect(() => {
|
|
33
|
-
if (basicFunctionalityImpl && !setDefaultValue.current) {
|
|
34
|
-
if (defaultValue) {
|
|
35
|
-
basicFunctionalityImpl.insertDefaultValue(defaultValue);
|
|
36
|
-
}
|
|
37
|
-
setDefaultValue.current = true;
|
|
38
|
-
}
|
|
39
|
-
}, [basicFunctionalityImpl, defaultValue, editor]);
|
|
40
29
|
React.useEffect(() => {
|
|
41
30
|
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.activateContentCallbacks(onContentChange, onCountChanged);
|
|
42
31
|
return () => basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.deactivateContentCallbacks();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n
|
|
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 // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["React","useLexicalComposerContext","useIsomorphicLayoutEffect","BasicFunctionalityBase","BasicFunctionalityPlugin","forwardRef","props","ref","trimWhitespace","onCountChanged","onContentChange","onPaste","isSentinelNodeEnabled","editor","basicFunctionalityImpl","setBasicFunctionalityImpl","useState","prev","cleanup","useImperativeHandle","setIsDisabled","isDisabled","useEffect","activateContentCallbacks","deactivateContentCallbacks","activatePasteCallback","deactivatePasteCallback","activateTrimWhitespace","deactivateTrimWhitespace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,SAASC,sBAAsB,QAAQ,uCAAuC;AAe9E,OAAO,MAAMC,2BAA2BJ,MAAMK,UAAU,CACtD,CAACC,OAAOC;IACN,MAAM,EAAEC,cAAc,EAAEC,cAAc,EAAEC,eAAe,EAAEC,OAAO,EAAEC,qBAAqB,EAAE,GAAGN;IAE5F,MAAM,CAACO,OAAO,GAAGZ;IAEjB,MAAM,CAACa,wBAAwBC,0BAA0B,GAAGf,MAAMgB,QAAQ,CAAiC;IAE3Gd,0BAA0B;QACxBa,0BAA0B,IAAIZ,uBAAuBU,QAAQD;QAE7D,OAAO;YACLG,0BAA0BE,CAAAA;gBACxBA,iBAAAA,2BAAAA,KAAMC,OAAO;gBACb,OAAO;YACT;QACF;IACF,GAAG;QAACL;QAAQD;KAAsB;IAElCZ,MAAMmB,mBAAmB,CACvBZ,KACA,IAAO,CAAA;YACLa,eAAcC,UAAmB;gBAC/BP,mCAAAA,6CAAAA,uBAAwBM,aAAa,CAACC;YACxC;QACF,CAAA,GACA;QAACP;KAAuB;IAG1Bd,MAAMsB,SAAS,CAAC;QACdR,mCAAAA,6CAAAA,uBAAwBS,wBAAwB,CAACb,iBAAiBD;QAClE,OAAO,IAAMK,mCAAAA,6CAAAA,uBAAwBU,0BAA0B;IACjE,GAAG;QAACV;QAAwBD;QAAQH;QAAiBD;KAAe;IAEpET,MAAMsB,SAAS,CAAC;QACd,IAAIX,SAAS;YACXG,mCAAAA,6CAAAA,uBAAwBW,qBAAqB,CAACd;QAChD;QACA,OAAO,IAAMG,mCAAAA,6CAAAA,uBAAwBY,uBAAuB;IAC9D,GAAG;QAACZ;QAAwBD;QAAQF;KAAQ;IAE5CX,MAAMsB,SAAS,CAAC;QACd,IAAId,gBAAgB;YAClBM,mCAAAA,6CAAAA,uBAAwBa,sBAAsB;QAChD;QACA,OAAO,IAAMb,mCAAAA,6CAAAA,uBAAwBc,wBAAwB;IAC/D,GAAG;QAACd;QAAwBD;QAAQL;KAAe;IAEnD,OAAO;AACT,GACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { ChatInputTokenSlots, ChatInputTokenState } from './ChatInputToken.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputTokenClassNames: SlotClassNames<ChatInputTokenSlots> = {\n root: 'fai-ChatInputToken',\n};\n\n/**\n * Styles for the root slot\n */\nconst useBaseClassName = makeResetStyles({\n ...typographyStyles.caption1,\n lineHeight: `calc(${tokens.lineHeightBase200} + (2 * ${tokens.spacingVerticalXXS}) + (2 * ${tokens.strokeWidthThin}))`,\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusMedium,\n boxDecorationBreak: 'clone',\n color: tokens.colorNeutralForeground2,\n padding: `${tokens.spacingVerticalXXS} 0`,\n});\n\n/**\n * Apply styling to the ChatInputToken slots based on the state\n */\nexport const useChatInputTokenStyles_unstable = (state: ChatInputTokenState): ChatInputTokenState => {\n 'use no memo';\n\n const baseClassName = useBaseClassName();\n state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);\n\n return state;\n};\n"],"names":["chatInputTokenClassNames","borderRadius","root","useBaseClassName","caption1","state","padding","spacingVerticalXXS","className","mergeClasses","baseClassName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IAYXC,gCAAuC;eAAvCA;;;iCAjBoC;AAK/B,MAAMD,2BAAgE;UAC3EE;AACF;AAEA;;CAEC,SAECC,mBAAoBC,IAAAA,8BAAQ,EAAA,YAAA,MAAA;IAAA;CAAA;AAI5BH,MAAAA,mCAAuCI,CAAAA;;UAGvCC,gBAAmBC;IACrBF,MAAAH,IAAA,CAAAM,SAAA,GAAAC,IAAAA,6BAAA,EAAAT,yBAAAE,IAAA,EAAAQ,eAAAL,MAAAH,IAAA,CAAAM,SAAA;IAEA,OAAAH;6DAGiDA"}
|
|
@@ -34,8 +34,8 @@ const ghostTextClassNames = {
|
|
|
34
34
|
indicator: {
|
|
35
35
|
Bahqtrf: "fk6fouc",
|
|
36
36
|
Be2twd7: "f13mqy1h",
|
|
37
|
-
Bhrd7zp: "
|
|
38
|
-
Bg96gwp: "
|
|
37
|
+
Bhrd7zp: "flh3ekv",
|
|
38
|
+
Bg96gwp: "fwrc4pm",
|
|
39
39
|
sj55zd: "f11d4kpn",
|
|
40
40
|
De3pzq: "f3vzo32",
|
|
41
41
|
Byoj8tv: 0,
|
|
@@ -66,8 +66,8 @@ const ghostTextClassNames = {
|
|
|
66
66
|
],
|
|
67
67
|
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
68
68
|
".f13mqy1h{font-size:var(--fontSizeBase100);}",
|
|
69
|
-
".
|
|
70
|
-
".
|
|
69
|
+
".flh3ekv{font-weight:var(--fontWeightBold);}",
|
|
70
|
+
".fwrc4pm{line-height:var(--lineHeightBase200);}",
|
|
71
71
|
".f11d4kpn{color:var(--colorNeutralForeground3);}",
|
|
72
72
|
".f3vzo32{background-color:var(--colorNeutralBackground5);}",
|
|
73
73
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["ghostTextClassNames","root","indicator","__styles","color","whiteSpace","gap","i8kkvl","typographyStyles","backgroundColor","padding","borderRadius","marginLeft","merginRight","sj55zd","De3pzq","Byoj8tv","z189sj","z8tnut","B0ocmuz","styles","state","Bbmb7ep","B7oj6ja","Dimara","Frg6f3"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,mBAAAA;eAAAA;;;;;;iCALoB;AAK1B,MAAMA,sBAAsD;UACjEC;eACAC;AACF;AAEA;;CAEC,SAECD,YAAME,IAAAA,yBAAA,EAAA;UACJC;gBACAC;gBACAC;QACFC,QAAA;QAEAL,SAAAA;gBACKM;;eAEHC;iBACAC;iBACAC;iBACAC;iBACAC;QACFC,QAAA;QACFC,QAAA;QAEAC,SAAA;;QAGAC,QAAO;QACLC,QAAA;QAEAC,SAAMC;QACNC,SAAMpB;QAENqB,SAAID;iBACFA;QAKFE,SAAA;QAEAC,QAAOH;QACPI,QAAA;YAAA;YAAA;SAAA"}
|
|
@@ -14,7 +14,7 @@ const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
|
14
14
|
const _reactcomponents = require("@fluentui/react-components");
|
|
15
15
|
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
16
16
|
const BasicFunctionalityPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
-
const {
|
|
17
|
+
const { trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;
|
|
18
18
|
const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
|
|
19
19
|
const [basicFunctionalityImpl, setBasicFunctionalityImpl] = _react.useState(null);
|
|
20
20
|
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
@@ -36,20 +36,6 @@ const BasicFunctionalityPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
36
36
|
}), [
|
|
37
37
|
basicFunctionalityImpl
|
|
38
38
|
]);
|
|
39
|
-
const setDefaultValue = _react.useRef(false);
|
|
40
|
-
// useIsomorphicLayoutEffect is used to avoid flickering on first render
|
|
41
|
-
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
42
|
-
if (basicFunctionalityImpl && !setDefaultValue.current) {
|
|
43
|
-
if (defaultValue) {
|
|
44
|
-
basicFunctionalityImpl.insertDefaultValue(defaultValue);
|
|
45
|
-
}
|
|
46
|
-
setDefaultValue.current = true;
|
|
47
|
-
}
|
|
48
|
-
}, [
|
|
49
|
-
basicFunctionalityImpl,
|
|
50
|
-
defaultValue,
|
|
51
|
-
editor
|
|
52
|
-
]);
|
|
53
39
|
_react.useEffect(()=>{
|
|
54
40
|
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.activateContentCallbacks(onContentChange, onCountChanged);
|
|
55
41
|
return ()=>basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.deactivateContentCallbacks();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n
|
|
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 // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","trimWhitespace","onCountChanged","basicFunctionalityImpl","useIsomorphicLayoutEffect","setBasicFunctionalityImpl","prev","useState","BasicFunctionalityBase","editor","isSentinelNodeEnabled","isDisabled","deactivateContentCallbacks","onContentChange","useEffect","deactivatePasteCallback","onPaste"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBaA;;;eAAAA;;;;iEAnBU;iCACmB;iCACA;kCAEH;AAehC,MAAMA,yCAA2BC,OAAMC,UAAU,CACtD,CAACC,OAAOC;UACN,EAEAC,cAAc,EAEdC,cAAOC,EAEPC,eAAAA,SACEC,uBAEO;kBAEHC,GAAAA,IAAAA,0CAAAA;mCACOD,0BAAA,GAAAR,OAAAU,QAAA,CAAA;kDACT,EAAA;kCACF,IAAAC,wCAAA,CAAAC,QAAAC;QACF,OAAG;sCAACD,CAAAA;gBAAQC,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAAA,OAAAA;gBAAsB,OAAA;YAElCb;;;;;KAIMM;8BACF,CAAAH,KAAA,IAAA,CAAA;2BAEFW,UAAA;2CAACR,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,aAAAA,CAAAA;;YAGHN;QAAAA;KAAgB;WACdM,SAAAA,CAAAA;mCACaA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,wBAAwBS,CAAAA,iBAA0BV;QACjE,OAAG,IAAAC,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAS,0BAAA;;;QAACT;QAAAA;QAAAA;KAAAA;WAAwBM,SAAAA,CAAAA;YAAQI,SAAAA;uCAAiBX,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,qBAAAA,CAAAA;;QAErDL,OAAMiB,IAAAA,2BAAU,QAAAX,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAY,uBAAA;;;QACDN;QAAAO;KAAA;oBACXb,CAAAA;YACFF,gBAAA;uCACaE,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,sBAAwBY;QACvC;eAAIZ,IAAAA,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,wBAAAA;;;QAAwBM;QAAAA;KAAAA;WAAQO;kDAEpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
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,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/chat-input-plugins": "^0.
|
|
15
|
+
"@fluentui-copilot/chat-input-plugins": "^0.5.0",
|
|
16
16
|
"@fluentui-copilot/react-text-editor": "^0.4.1",
|
|
17
17
|
"@fluentui-copilot/text-editor": "^0.3.1",
|
|
18
18
|
"@fluentui-copilot/tokens": "^0.3.11",
|