@fluentui-copilot/react-chat-input-plugins 0.4.9 → 0.4.10-hotfix.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +39 -1
- package/CHANGELOG.md +20 -2
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +47 -0
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +29 -0
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js +39 -0
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +4 -2
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +59 -0
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +41 -0
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js +51 -0
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +4 -2
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/package.json +6 -10
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,45 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 19 Sep 2025 15:10:19 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.4.10-hotfix.2",
|
|
7
|
+
"version": "0.4.10-hotfix.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "hochelmartin@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
13
|
+
"commit": "3e4ebe676646c4c4346dbbab83511f963ffefd85",
|
|
14
|
+
"comment": "release: prepare hotfix 0.26.2-hotfix.2"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 19 May 2025 18:04:27 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.4.10",
|
|
22
|
+
"version": "0.4.10",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "owcampbe@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
28
|
+
"commit": "6eff905d8e52b7bdf959ed3d85815dfdb0b30366",
|
|
29
|
+
"comment": "fix: Only attempt to insert defaultValue once."
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"none": [
|
|
33
|
+
{
|
|
34
|
+
"author": "hochelmartin@gmail.com",
|
|
35
|
+
"package": "@fluentui-copilot/react-chat-input-plugins",
|
|
36
|
+
"commit": "442954951d0eca92de20ecb0ff0fa9492431b62d",
|
|
37
|
+
"comment": "fix: exclude story files from production build"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"date": "Sat, 03 May 2025 01:27:44 GMT",
|
|
6
44
|
"tag": "@fluentui-copilot/react-chat-input-plugins_v0.4.9",
|
|
7
45
|
"version": "0.4.9",
|
|
8
46
|
"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 Fri, 19 Sep 2025 15:10:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.4.10-hotfix.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.4.10-hotfix.2)
|
|
8
|
+
|
|
9
|
+
Fri, 19 Sep 2025 15:10:19 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.4.10..@fluentui-copilot/react-chat-input-plugins_v0.4.10-hotfix.2)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- release: prepare hotfix 0.26.2-hotfix.2 ([PR #3284](https://github.com/microsoft/fluentai/pull/3284) by hochelmartin@gmail.com)
|
|
15
|
+
|
|
16
|
+
## [0.4.10](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.4.10)
|
|
17
|
+
|
|
18
|
+
Mon, 19 May 2025 18:04:27 GMT
|
|
19
|
+
[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)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix: Only attempt to insert defaultValue once. ([PR #2996](https://github.com/microsoft/fluentai/pull/2996) by owcampbe@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [0.4.9](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.4.9)
|
|
8
26
|
|
|
9
|
-
Sat, 03 May 2025 01:
|
|
27
|
+
Sat, 03 May 2025 01:27:44 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.4.8..@fluentui-copilot/react-chat-input-plugins_v0.4.9)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { makeStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const chatInputEntityClassNames = {
|
|
4
|
+
root: 'fai-ChatInputEntity',
|
|
5
|
+
sensitivity: 'fai-ChatInputEntity__sensitivity',
|
|
6
|
+
text: 'fai-ChatInputEntity__text'
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the root slot
|
|
10
|
+
*/
|
|
11
|
+
const useStyles = makeStyles({
|
|
12
|
+
root: {},
|
|
13
|
+
text: {
|
|
14
|
+
color: tokens.colorBrandForeground1
|
|
15
|
+
},
|
|
16
|
+
href: {
|
|
17
|
+
color: tokens.colorBrandForegroundLink,
|
|
18
|
+
':hover': {
|
|
19
|
+
textDecorationLine: 'underline',
|
|
20
|
+
color: tokens.colorBrandForegroundLinkHover
|
|
21
|
+
},
|
|
22
|
+
':active': {
|
|
23
|
+
textDecorationLine: 'underline',
|
|
24
|
+
color: tokens.colorBrandForegroundLinkPressed
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
sensitivity: {
|
|
28
|
+
paddingLeft: tokens.spacingHorizontalXXS
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Apply styling to the ChatInputEntity slots based on the state
|
|
33
|
+
*/
|
|
34
|
+
export const useChatInputEntityStyles_unstable = state => {
|
|
35
|
+
'use no memo';
|
|
36
|
+
|
|
37
|
+
const styles = useStyles();
|
|
38
|
+
state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);
|
|
39
|
+
if (state.text) {
|
|
40
|
+
state.text.className = mergeClasses(chatInputEntityClassNames.text, styles.text, state.text.as === 'a' && styles.href, state.text.className);
|
|
41
|
+
}
|
|
42
|
+
if (state.sensitivity) {
|
|
43
|
+
state.sensitivity.className = mergeClasses(chatInputEntityClassNames.sensitivity, styles.sensitivity, state.sensitivity.className);
|
|
44
|
+
}
|
|
45
|
+
return state;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=useChatInputEntityStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputEntityStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { ChatInputEntitySlots, ChatInputEntityState } from './ChatInputEntity.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputEntityClassNames: SlotClassNames<ChatInputEntitySlots> = {\n root: 'fai-ChatInputEntity',\n sensitivity: 'fai-ChatInputEntity__sensitivity',\n text: 'fai-ChatInputEntity__text',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {},\n\n text: {\n color: tokens.colorBrandForeground1,\n },\n\n href: {\n color: tokens.colorBrandForegroundLink,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n sensitivity: {\n paddingLeft: tokens.spacingHorizontalXXS,\n },\n});\n\n/**\n * Apply styling to the ChatInputEntity slots based on the state\n */\nexport const useChatInputEntityStyles_unstable = (state: ChatInputEntityState): ChatInputEntityState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);\n\n if (state.text) {\n state.text.className = mergeClasses(\n chatInputEntityClassNames.text,\n styles.text,\n state.text.as === 'a' && styles.href,\n state.text.className,\n );\n }\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n chatInputEntityClassNames.sensitivity,\n styles.sensitivity,\n state.sensitivity.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","chatInputEntityClassNames","root","sensitivity","text","useStyles","color","colorBrandForeground1","href","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","useChatInputEntityStyles_unstable","state","styles","className","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AACtE,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,aAAa;IACbC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BI,MAAM,CAAC;IAEPE,MAAM;QACJE,OAAON,OAAOO,qBAAqB;IACrC;IAEAC,MAAM;QACJF,OAAON,OAAOS,wBAAwB;QAEtC,UAAU;YACRC,oBAAoB;YACpBJ,OAAON,OAAOW,6BAA6B;QAC7C;QAEA,WAAW;YACTD,oBAAoB;YACpBJ,OAAON,OAAOY,+BAA+B;QAC/C;IACF;IACAT,aAAa;QACXU,aAAab,OAAOc,oBAAoB;IAC1C;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD;IAEA,MAAMC,SAASZ;IAEfW,MAAMd,IAAI,CAACgB,SAAS,GAAGnB,aAAaE,0BAA0BC,IAAI,EAAEe,OAAOf,IAAI,EAAEc,MAAMd,IAAI,CAACgB,SAAS;IAErG,IAAIF,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACc,SAAS,GAAGnB,aACrBE,0BAA0BG,IAAI,EAC9Ba,OAAOb,IAAI,EACXY,MAAMZ,IAAI,CAACe,EAAE,KAAK,OAAOF,OAAOT,IAAI,EACpCQ,MAAMZ,IAAI,CAACc,SAAS;IAExB;IAEA,IAAIF,MAAMb,WAAW,EAAE;QACrBa,MAAMb,WAAW,CAACe,SAAS,GAAGnB,aAC5BE,0BAA0BE,WAAW,EACrCc,OAAOd,WAAW,EAClBa,MAAMb,WAAW,CAACe,SAAS;IAE/B;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { makeResetStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const chatInputTokenClassNames = {
|
|
4
|
+
root: 'fai-ChatInputToken'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Styles for the root slot
|
|
8
|
+
*/
|
|
9
|
+
const useBaseClassName = makeResetStyles({
|
|
10
|
+
...typographyStyles.caption1,
|
|
11
|
+
lineHeight: `calc(${tokens.lineHeightBase200} + (2 * ${tokens.spacingVerticalXXS}) + (2 * ${tokens.strokeWidthThin}))`,
|
|
12
|
+
backgroundColor: tokens.colorNeutralBackground3,
|
|
13
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,
|
|
14
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
15
|
+
boxDecorationBreak: 'clone',
|
|
16
|
+
color: tokens.colorNeutralForeground2,
|
|
17
|
+
padding: `${tokens.spacingVerticalXXS} 0`
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Apply styling to the ChatInputToken slots based on the state
|
|
21
|
+
*/
|
|
22
|
+
export const useChatInputTokenStyles_unstable = state => {
|
|
23
|
+
'use no memo';
|
|
24
|
+
|
|
25
|
+
const baseClassName = useBaseClassName();
|
|
26
|
+
state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);
|
|
27
|
+
return state;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useChatInputTokenStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } 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","typographyStyles","tokens","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,EAAEC,gBAAgB,QAAQ,6BAA6B;AAC7F,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBN,gBAAgB;IACvC,GAAGE,iBAAiBK,QAAQ;IAC5BC,YAAY,CAAC,KAAK,EAAEL,OAAOM,iBAAiB,CAAC,QAAQ,EAAEN,OAAOO,kBAAkB,CAAC,SAAS,EAAEP,OAAOQ,eAAe,CAAC,EAAE,CAAC;IACtHC,iBAAiBT,OAAOU,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEX,OAAOQ,eAAe,CAAC,OAAO,EAAER,OAAOY,sBAAsB,CAAC,CAAC;IAC1EC,cAAcb,OAAOc,kBAAkB;IACvCC,oBAAoB;IACpBC,OAAOhB,OAAOiB,uBAAuB;IACrCC,SAAS,CAAC,EAAElB,OAAOO,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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const ghostTextClassNames = {
|
|
4
|
+
root: 'fai-GhostText',
|
|
5
|
+
indicator: 'fai-GhostText__indicator'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Styles for the root slot
|
|
9
|
+
*/
|
|
10
|
+
const useStyles = makeStyles({
|
|
11
|
+
root: {
|
|
12
|
+
color: tokens.colorNeutralForeground4,
|
|
13
|
+
whiteSpace: 'pre-wrap',
|
|
14
|
+
gap: tokens.spacingHorizontalXS
|
|
15
|
+
},
|
|
16
|
+
indicator: {
|
|
17
|
+
...typographyStyles.caption2Strong,
|
|
18
|
+
color: tokens.colorNeutralForeground3,
|
|
19
|
+
backgroundColor: tokens.colorNeutralBackground5,
|
|
20
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,
|
|
21
|
+
borderRadius: tokens.borderRadiusSmall,
|
|
22
|
+
marginLeft: tokens.spacingHorizontalXS,
|
|
23
|
+
merginRight: tokens.spacingHorizontalXS
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Apply styling to the GhostText slots based on the state
|
|
28
|
+
*/
|
|
29
|
+
export const useGhostTextStyles_unstable = state => {
|
|
30
|
+
'use no memo';
|
|
31
|
+
|
|
32
|
+
const styles = useStyles();
|
|
33
|
+
state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);
|
|
34
|
+
if (state.indicator) {
|
|
35
|
+
state.indicator.className = mergeClasses(ghostTextClassNames.indicator, styles.indicator, state.indicator.className);
|
|
36
|
+
}
|
|
37
|
+
return state;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useGhostTextStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","typographyStyles","tokens","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,EAAEC,gBAAgB,QAAQ,6BAA6B;AACxF,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BK,MAAM;QACJG,OAAOL,OAAOM,uBAAuB;QACrCC,YAAY;QACZC,KAAKR,OAAOS,mBAAmB;IACjC;IAEAN,WAAW;QACT,GAAGJ,iBAAiBW,cAAc;QAClCL,OAAOL,OAAOW,uBAAuB;QACrCC,iBAAiBZ,OAAOa,uBAAuB;QAC/CC,SAAS,CAAC,EAAEd,OAAOe,mBAAmB,CAAC,CAAC,EAAEf,OAAOgB,uBAAuB,CAAC,CAAC;QAC1EC,cAAcjB,OAAOkB,iBAAiB;QACtCC,YAAYnB,OAAOS,mBAAmB;QACtCW,aAAapB,OAAOS,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"}
|
|
@@ -30,8 +30,10 @@ export const BasicFunctionalityPlugin = React.forwardRef((props, ref) => {
|
|
|
30
30
|
const setDefaultValue = React.useRef(false);
|
|
31
31
|
// useIsomorphicLayoutEffect is used to avoid flickering on first render
|
|
32
32
|
useIsomorphicLayoutEffect(() => {
|
|
33
|
-
if (
|
|
34
|
-
|
|
33
|
+
if (basicFunctionalityImpl && !setDefaultValue.current) {
|
|
34
|
+
if (defaultValue) {
|
|
35
|
+
basicFunctionalityImpl.insertDefaultValue(defaultValue);
|
|
36
|
+
}
|
|
35
37
|
setDefaultValue.current = true;
|
|
36
38
|
}
|
|
37
39
|
}, [basicFunctionalityImpl, defaultValue, editor]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (basicFunctionalityImpl && !setDefaultValue.current) {\n if (defaultValue) {\n basicFunctionalityImpl.insertDefaultValue(defaultValue);\n }\n setDefaultValue.current = true;\n }\n }, [basicFunctionalityImpl, defaultValue, editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["React","useLexicalComposerContext","useIsomorphicLayoutEffect","BasicFunctionalityBase","BasicFunctionalityPlugin","forwardRef","props","ref","defaultValue","trimWhitespace","onCountChanged","onContentChange","onPaste","isSentinelNodeEnabled","editor","basicFunctionalityImpl","setBasicFunctionalityImpl","useState","prev","cleanup","useImperativeHandle","setIsDisabled","isDisabled","setDefaultValue","useRef","current","insertDefaultValue","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;AAgB9E,OAAO,MAAMC,2BAA2BJ,MAAMK,UAAU,CACtD,CAACC,OAAOC;IACN,MAAM,EAAEC,YAAY,EAAEC,cAAc,EAAEC,cAAc,EAAEC,eAAe,EAAEC,OAAO,EAAEC,qBAAqB,EAAE,GAAGP;IAE1G,MAAM,CAACQ,OAAO,GAAGb;IAEjB,MAAM,CAACc,wBAAwBC,0BAA0B,GAAGhB,MAAMiB,QAAQ,CAAiC;IAE3Gf,0BAA0B;QACxBc,0BAA0B,IAAIb,uBAAuBW,QAAQD;QAE7D,OAAO;YACLG,0BAA0BE,CAAAA;gBACxBA,iBAAAA,2BAAAA,KAAMC,OAAO;gBACb,OAAO;YACT;QACF;IACF,GAAG;QAACL;QAAQD;KAAsB;IAElCb,MAAMoB,mBAAmB,CACvBb,KACA,IAAO,CAAA;YACLc,eAAcC,UAAmB;gBAC/BP,mCAAAA,6CAAAA,uBAAwBM,aAAa,CAACC;YACxC;QACF,CAAA,GACA;QAACP;KAAuB;IAG1B,MAAMQ,kBAAkBvB,MAAMwB,MAAM,CAAC;IACrC,wEAAwE;IACxEtB,0BAA0B;QACxB,IAAIa,0BAA0B,CAACQ,gBAAgBE,OAAO,EAAE;YACtD,IAAIjB,cAAc;gBAChBO,uBAAuBW,kBAAkB,CAAClB;YAC5C;YACAe,gBAAgBE,OAAO,GAAG;QAC5B;IACF,GAAG;QAACV;QAAwBP;QAAcM;KAAO;IAEjDd,MAAM2B,SAAS,CAAC;QACdZ,mCAAAA,6CAAAA,uBAAwBa,wBAAwB,CAACjB,iBAAiBD;QAClE,OAAO,IAAMK,mCAAAA,6CAAAA,uBAAwBc,0BAA0B;IACjE,GAAG;QAACd;QAAwBD;QAAQH;QAAiBD;KAAe;IAEpEV,MAAM2B,SAAS,CAAC;QACd,IAAIf,SAAS;YACXG,mCAAAA,6CAAAA,uBAAwBe,qBAAqB,CAAClB;QAChD;QACA,OAAO,IAAMG,mCAAAA,6CAAAA,uBAAwBgB,uBAAuB;IAC9D,GAAG;QAAChB;QAAwBD;QAAQF;KAAQ;IAE5CZ,MAAM2B,SAAS,CAAC;QACd,IAAIlB,gBAAgB;YAClBM,mCAAAA,6CAAAA,uBAAwBiB,sBAAsB;QAChD;QACA,OAAO,IAAMjB,mCAAAA,6CAAAA,uBAAwBkB,wBAAwB;IAC/D,GAAG;QAAClB;QAAwBD;QAAQL;KAAe;IAEnD,OAAO;AACT,GACA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
chatInputEntityClassNames: function() {
|
|
13
|
+
return chatInputEntityClassNames;
|
|
14
|
+
},
|
|
15
|
+
useChatInputEntityStyles_unstable: function() {
|
|
16
|
+
return useChatInputEntityStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const chatInputEntityClassNames = {
|
|
22
|
+
root: 'fai-ChatInputEntity',
|
|
23
|
+
sensitivity: 'fai-ChatInputEntity__sensitivity',
|
|
24
|
+
text: 'fai-ChatInputEntity__text'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Styles for the root slot
|
|
28
|
+
*/ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
29
|
+
root: {},
|
|
30
|
+
text: {
|
|
31
|
+
color: _tokens.tokens.colorBrandForeground1
|
|
32
|
+
},
|
|
33
|
+
href: {
|
|
34
|
+
color: _tokens.tokens.colorBrandForegroundLink,
|
|
35
|
+
':hover': {
|
|
36
|
+
textDecorationLine: 'underline',
|
|
37
|
+
color: _tokens.tokens.colorBrandForegroundLinkHover
|
|
38
|
+
},
|
|
39
|
+
':active': {
|
|
40
|
+
textDecorationLine: 'underline',
|
|
41
|
+
color: _tokens.tokens.colorBrandForegroundLinkPressed
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
sensitivity: {
|
|
45
|
+
paddingLeft: _tokens.tokens.spacingHorizontalXXS
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const useChatInputEntityStyles_unstable = (state)=>{
|
|
49
|
+
'use no memo';
|
|
50
|
+
const styles = useStyles();
|
|
51
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.root, styles.root, state.root.className);
|
|
52
|
+
if (state.text) {
|
|
53
|
+
state.text.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.text, styles.text, state.text.as === 'a' && styles.href, state.text.className);
|
|
54
|
+
}
|
|
55
|
+
if (state.sensitivity) {
|
|
56
|
+
state.sensitivity.className = (0, _reactcomponents.mergeClasses)(chatInputEntityClassNames.sensitivity, styles.sensitivity, state.sensitivity.className);
|
|
57
|
+
}
|
|
58
|
+
return state;
|
|
59
|
+
}; //# sourceMappingURL=useChatInputEntityStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputEntityStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { ChatInputEntitySlots, ChatInputEntityState } from './ChatInputEntity.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputEntityClassNames: SlotClassNames<ChatInputEntitySlots> = {\n root: 'fai-ChatInputEntity',\n sensitivity: 'fai-ChatInputEntity__sensitivity',\n text: 'fai-ChatInputEntity__text',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {},\n\n text: {\n color: tokens.colorBrandForeground1,\n },\n\n href: {\n color: tokens.colorBrandForegroundLink,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n sensitivity: {\n paddingLeft: tokens.spacingHorizontalXXS,\n },\n});\n\n/**\n * Apply styling to the ChatInputEntity slots based on the state\n */\nexport const useChatInputEntityStyles_unstable = (state: ChatInputEntityState): ChatInputEntityState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);\n\n if (state.text) {\n state.text.className = mergeClasses(\n chatInputEntityClassNames.text,\n styles.text,\n state.text.as === 'a' && styles.href,\n state.text.className,\n );\n }\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n chatInputEntityClassNames.sensitivity,\n styles.sensitivity,\n state.sensitivity.className,\n );\n }\n\n return state;\n};\n"],"names":["chatInputEntityClassNames","styles","useStyles","root","sensitivity","text","makeStyles","color","tokens","colorBrandForeground1","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","state","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,yBAAAA;eAAAA;;IAwCLC,iCAASC;eAATD;;;iCA7CiC;wBAClB;AAIhB,MAAMD,4BAAkE;UAC7EG;iBACAC;UACAC;AACF;AAEA;;CAEC,SAECF,YAAOG,IAAAA,2BAAA,EAAA;UAEPD,CAAAA;UACEE;QACFA,OAAAC,cAAA,CAAAC,qBAAA;;UAGEF;eAEAC,cAAA,CAAUE,wBAAA;kBACRC;gCACcC;mBAChBJ,cAAA,CAAAI,6BAAA;;mBAGED;gCACcE;mBAChBL,cAAA,CAAAK,+BAAA;QACF;;iBAEEC;QACFA,aAAAN,cAAA,CAAAO,oBAAA;IACF;AAEA;AAME,MAAMd,oCAASC,CAAAA;;UAKbc,SAAMX;UAMRF,IAAA,CAAAc,SAAA,GAAAC,IAAAA,6BAAA,EAAAlB,0BAAAG,IAAA,EAAAF,OAAAE,IAAA,EAAAa,MAAAb,IAAA,CAAAc,SAAA;QAEAD,MAAIA,IAAMZ,EAAAA;cACRY,IAAMZ,CAAAA,SAAAA,GAAYa,IAAAA,6BAAYC,EAAAA,0BAC5BlB,IAAAA,EAAAA,OAA0BI,IAAAA,EAAAA,MAC1BH,IAAAA,CAAAA,EAAOG,KAAAA,OACPY,OAAMZ,IAAAA,EAAAA,MAAYa,IAAAA,CAAAA,SAAS;;QAI/BD,MAAOA,WAAAA,EAAAA;QACPA,MAAAZ,WAAA,CAAAa,SAAA,GAAAC,IAAAA,6BAAA,EAAAlB,0BAAAI,WAAA,EAAAH,OAAAG,WAAA,EAAAY,MAAAZ,WAAA,CAAAa,SAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
chatInputTokenClassNames: function() {
|
|
13
|
+
return chatInputTokenClassNames;
|
|
14
|
+
},
|
|
15
|
+
useChatInputTokenStyles_unstable: function() {
|
|
16
|
+
return useChatInputTokenStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const chatInputTokenClassNames = {
|
|
22
|
+
root: 'fai-ChatInputToken'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the root slot
|
|
26
|
+
*/ const useBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
27
|
+
..._reactcomponents.typographyStyles.caption1,
|
|
28
|
+
lineHeight: `calc(${_tokens.tokens.lineHeightBase200} + (2 * ${_tokens.tokens.spacingVerticalXXS}) + (2 * ${_tokens.tokens.strokeWidthThin}))`,
|
|
29
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground3,
|
|
30
|
+
border: `${_tokens.tokens.strokeWidthThin} solid ${_tokens.tokens.colorTransparentStroke}`,
|
|
31
|
+
borderRadius: _tokens.tokens.borderRadiusMedium,
|
|
32
|
+
boxDecorationBreak: 'clone',
|
|
33
|
+
color: _tokens.tokens.colorNeutralForeground2,
|
|
34
|
+
padding: `${_tokens.tokens.spacingVerticalXXS} 0`
|
|
35
|
+
});
|
|
36
|
+
const useChatInputTokenStyles_unstable = (state)=>{
|
|
37
|
+
'use no memo';
|
|
38
|
+
const baseClassName = useBaseClassName();
|
|
39
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(chatInputTokenClassNames.root, baseClassName, state.root.className);
|
|
40
|
+
return state;
|
|
41
|
+
}; //# sourceMappingURL=useChatInputTokenStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } 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","baseClassName","useBaseClassName","root","caption1","lineHeight","tokens","backgroundColor","colorNeutralBackground3","spacingVerticalXXS","strokeWidthThin","borderRadius","borderRadiusMedium","colorTransparentStroke","boxDecorationBreak","colorNeutralForeground2","padding"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IAwBLC,gCAAgBC;eAAhBD;;;iCA7BwD;wBACzC;AAIhB,MAAMD,2BAAgE;UAC3EG;AACF;AAEA;;CAEC,SAECD,mBAAoBE,IAAAA,gCAAQ,EAAA;OAC5BC,iCAAa,CAAKD,QAAEE;gBACpBC,CAAAA,KAAAA,EAAiBD,cAAOE,CAAAA,iBAAAA,CAAAA,QAAuB,EAAAF,cAAA,CAAAG,kBAAA,CAAA,SAAA,EAAAH,cAAA,CAAAI,eAAA,CAAA,EAAA,CAAA;qBACpCJ,cAAOI,CAAAA,uBAAyBJ;YAC3CK,CAAAA,EAAAA,cAAcL,CAAAA,eAAOM,CAAAA,OAAkB,EAAAN,cAAA,CAAAO,sBAAA,CAAA,CAAA;kBACvCC,cAAAA,CAAAA,kBAAoB;wBACNC;WACdC,cAAU,CAAEV,uBAAOG;IACrBO,SAAA,CAAA,EAAAV,cAAA,CAAAG,kBAAA,CAAA,EAAA,CAAA;AAEA;AAME,MAAMR,mCAAgBC,CAAAA;;IAItB,MAAAD,gBAAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
ghostTextClassNames: function() {
|
|
13
|
+
return ghostTextClassNames;
|
|
14
|
+
},
|
|
15
|
+
useGhostTextStyles_unstable: function() {
|
|
16
|
+
return useGhostTextStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const ghostTextClassNames = {
|
|
22
|
+
root: 'fai-GhostText',
|
|
23
|
+
indicator: 'fai-GhostText__indicator'
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Styles for the root slot
|
|
27
|
+
*/ const useStyles = (0, _reactcomponents.makeStyles)({
|
|
28
|
+
root: {
|
|
29
|
+
color: _tokens.tokens.colorNeutralForeground4,
|
|
30
|
+
whiteSpace: 'pre-wrap',
|
|
31
|
+
gap: _tokens.tokens.spacingHorizontalXS
|
|
32
|
+
},
|
|
33
|
+
indicator: {
|
|
34
|
+
..._reactcomponents.typographyStyles.caption2Strong,
|
|
35
|
+
color: _tokens.tokens.colorNeutralForeground3,
|
|
36
|
+
backgroundColor: _tokens.tokens.colorNeutralBackground5,
|
|
37
|
+
padding: `${_tokens.tokens.spacingVerticalNone} ${_tokens.tokens.spacingHorizontalSNudge}`,
|
|
38
|
+
borderRadius: _tokens.tokens.borderRadiusSmall,
|
|
39
|
+
marginLeft: _tokens.tokens.spacingHorizontalXS,
|
|
40
|
+
merginRight: _tokens.tokens.spacingHorizontalXS
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const useGhostTextStyles_unstable = (state)=>{
|
|
44
|
+
'use no memo';
|
|
45
|
+
const styles = useStyles();
|
|
46
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(ghostTextClassNames.root, styles.root, state.root.className);
|
|
47
|
+
if (state.indicator) {
|
|
48
|
+
state.indicator.className = (0, _reactcomponents.mergeClasses)(ghostTextClassNames.indicator, styles.indicator, state.indicator.className);
|
|
49
|
+
}
|
|
50
|
+
return state;
|
|
51
|
+
}; //# sourceMappingURL=useGhostTextStyles.styles.raw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["ghostTextClassNames","styles","useStyles","root","indicator","makeStyles","color","whiteSpace","tokens","gap","spacingHorizontalXS","typographyStyles","colorNeutralForeground3","backgroundColor","colorNeutralBackground5","spacingVerticalNone","borderRadius","borderRadiusSmall","spacingHorizontalSNudge","marginLeft","merginRight","state","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,mBAAAA;eAAAA;;IAgCLC,2BAASC;eAATD;;;iCArCmD;wBACpC;AAIhB,MAAMD,sBAAsD;UACjEG;eACAC;AACF;AAEA;;CAEC,SAECD,YAAME,IAAAA,2BAAA,EAAA;UACJC;eACAC,cAAAA,CAAAA,uBAAY;oBACPC;QACPC,KAAAD,cAAA,CAAAE,mBAAA;;eAGKC;4CACWC,CAAAA,cAAAA;eACdC,cAAAA,CAAAA,uBAAwBC;yBACZN,cAAOO,CAAAA,uBAAuBP;iBAC1CQ,CAAAA,EAAAA,cAAcR,CAAAA,mBAAOS,CAAAA,CAAAA,EAAiBT,cAAA,CAAAU,uBAAA,CAAA,CAAA;sBACtCC,cAAYX,CAAAA,iBAAOE;oBACnBU,cAAaZ,CAAAA,mBAAOE;QACtBU,aAAAZ,cAAA,CAAAE,mBAAA;IACF;AAEA;AAME,MAAMT,8BAASC,CAAAA;;UAIbmB,SAAMjB;UAKRD,IAAA,CAAAmB,SAAA,GAAAC,IAAAA,6BAAA,EAAAvB,oBAAAG,IAAA,EAAAF,OAAAE,IAAA,EAAAkB,MAAAlB,IAAA,CAAAmB,SAAA;QAEAD,MAAOA,SAAAA,EAAAA;QACPA,MAAAjB,SAAA,CAAAkB,SAAA,GAAAC,IAAAA,6BAAA,EAAAvB,oBAAAI,SAAA,EAAAH,OAAAG,SAAA,EAAAiB,MAAAjB,SAAA,CAAAkB,SAAA"}
|
|
@@ -39,8 +39,10 @@ const BasicFunctionalityPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
39
39
|
const setDefaultValue = _react.useRef(false);
|
|
40
40
|
// useIsomorphicLayoutEffect is used to avoid flickering on first render
|
|
41
41
|
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
42
|
-
if (
|
|
43
|
-
|
|
42
|
+
if (basicFunctionalityImpl && !setDefaultValue.current) {
|
|
43
|
+
if (defaultValue) {
|
|
44
|
+
basicFunctionalityImpl.insertDefaultValue(defaultValue);
|
|
45
|
+
}
|
|
44
46
|
setDefaultValue.current = true;
|
|
45
47
|
}
|
|
46
48
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (basicFunctionalityImpl && !setDefaultValue.current) {\n if (defaultValue) {\n basicFunctionalityImpl.insertDefaultValue(defaultValue);\n }\n setDefaultValue.current = true;\n }\n }, [basicFunctionalityImpl, defaultValue, editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["BasicFunctionalityPlugin","React","forwardRef","props","ref","defaultValue","editor","trimWhitespace","basicFunctionalityImpl","useIsomorphicLayoutEffect","setBasicFunctionalityImpl","useLexicalComposerContext","useState","BasicFunctionalityBase","isSentinelNodeEnabled","prev","cleanup","useImperativeHandle","setIsDisabled","isDisabled","useRef","insertDefaultValue","current","setDefaultValue","activateContentCallbacks","onContentChange","onCountChanged","useEffect","deactivateContentCallbacks","onPaste","activateTrimWhitespace","deactivateTrimWhitespace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAoBaA;;;eAAAA;;;;iEApBU;iCACmB;iCACA;kCAEH;AAgBhC,MAAMA,yCAA2BC,OAAMC,UAAU,CACtD,CAACC,OAAOC;UACN,EAEAC,YAAOC,EAEPC,cAAOC,EAEPC,cAAAA,iBACEC,SAEA,uBACEA;kBAEE,GAAAC,IAAAA,0CAAO;mCACTD,0BAAA,GAAAT,OAAAW,QAAA,CAAA;kDACF,EAAA;QACFF,0BAAG,IAAAG,wCAAA,CAAAP,QAAAQ;eAACR;sCAAQQ,CAAAA;gBAAsBC,SAAA,QAAAA,SAAA,KAAA,IAAA,KAAA,IAAAA,KAAAC,OAAA;gBAElCf,OAAMgB;;;;;QAKFH;KAAA;WACFG,mBACA,CAAAb,KAAA,IAAA,CAAA;2BAACI,UAAAA;gBAAuBA,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAU,aAAA,CAAAC;YAG1B;YACA;QAAAX;KAAA;UACAC,kBAAAA,OAA0BW,MAAA,CAAA;4EACgC;kDAClDf,EAAAA;sCACFG,CAAAA,gBAAuBa,OAAmBhB,EAAAA;8BAC5C;uCACgBiB,kBAAU,CAAAjB;;YAE9BkB,gBAAGD,OAAA,GAAA;;;;QAAyBjB;QAAAA;KAAAA;WAAcC,SAAAA,CAAAA;mCAAO,QAAAE,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAgB,wBAAA,CAAAC,iBAAAC;QAEjDzB,OAAM0B,IAAAA,2BAAU,QAAAnB,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAoB,0BAAA;;;QACdpB;QAAAA;QAAAA;KAAAA;WACAmB,SAAO,CAAA;QACT,IAAGE,SAAA;uCAACrB,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,qBAAAA,CAAAA;;eAAgCiB,IAAAA,2BAAAA,QAAAA,2BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,uBAAAA,uBAAAA;;;QAAiBC;QAAAA;KAAAA;WAAeC,SAAA,CAAA;QAEpE1B,IAAAA,gBAAgB;uCACD,QAAAO,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAsB,sBAAA;;eAEb,IAAAtB,2BAAA,QAAAA,2BAAA,KAAA,IAAA,KAAA,IAAAA,uBAAAuB,wBAAA;;;QACavB;QAAAA;KAAAA;WACZ;kDAAyBF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-chat-input-plugins",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10-hotfix.2",
|
|
4
4
|
"description": "A Fluent AI package for React-based ChatInput plugins.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/chat-input-plugins": "
|
|
16
|
-
"@fluentui-copilot/react-text-editor": "
|
|
17
|
-
"@fluentui-copilot/text-editor": "
|
|
18
|
-
"@fluentui-copilot/tokens": "
|
|
15
|
+
"@fluentui-copilot/chat-input-plugins": "0.4.2-hotfix.3",
|
|
16
|
+
"@fluentui-copilot/react-text-editor": "0.4.1-hotfix.3",
|
|
17
|
+
"@fluentui-copilot/text-editor": "0.3.1-hotfix.3",
|
|
18
|
+
"@fluentui-copilot/tokens": "0.3.11-hotfix.2",
|
|
19
19
|
"@swc/helpers": "^0.5.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -27,11 +27,7 @@
|
|
|
27
27
|
"react": ">=16.14.0 <19.0.0",
|
|
28
28
|
"react-dom": ">=16.14.0 <19.0.0"
|
|
29
29
|
},
|
|
30
|
-
"beachball": {
|
|
31
|
-
"disallowedChangeTypes": [
|
|
32
|
-
"major"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
30
|
+
"beachball": {},
|
|
35
31
|
"exports": {
|
|
36
32
|
".": {
|
|
37
33
|
"types": "./dist/index.d.ts",
|