@fluentui-copilot/react-editor-input 0.5.4 → 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 +30 -0
- package/CHANGELOG.md +19 -1
- package/dist/index.d.ts +47 -0
- package/lib/AnimatedPlaceholder.js +1 -0
- package/lib/AnimatedPlaceholder.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.js +10 -0
- package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js +3 -0
- package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/index.js +4 -0
- package/lib/components/AnimatedPlaceholder/index.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/placeholderMotion.js +46 -0
- package/lib/components/AnimatedPlaceholder/placeholderMotion.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js +12 -0
- package/lib/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholder.js +54 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholder.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js +23 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js.map +1 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js +21 -0
- package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js.map +1 -0
- package/lib/components/EditorInput/useEditorInput.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-commonjs/AnimatedPlaceholder.js +28 -0
- package/lib-commonjs/AnimatedPlaceholder.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.js +21 -0
- package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js +6 -0
- package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/index.js +31 -0
- package/lib-commonjs/components/AnimatedPlaceholder/index.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/placeholderMotion.js +56 -0
- package/lib-commonjs/components/AnimatedPlaceholder/placeholderMotion.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js +20 -0
- package/lib-commonjs/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholder.js +57 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholder.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js +37 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js +37 -0
- package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/EditorInput/useEditorInput.js.map +1 -1
- package/lib-commonjs/index.js +16 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-editor-input",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
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",
|
|
21
|
+
"tag": "@fluentui-copilot/react-editor-input_v0.5.5",
|
|
22
|
+
"version": "0.5.5",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "jiangemma@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-editor-input",
|
|
28
|
+
"commit": "3bb39358e1657bb8aaf054a8a6047d5567067b2e",
|
|
29
|
+
"comment": "feat: Implement new AnimatedPlaceholder component"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
4
34
|
{
|
|
5
35
|
"date": "Thu, 17 Jul 2025 17:49:26 GMT",
|
|
6
36
|
"tag": "@fluentui-copilot/react-editor-input_v0.5.3",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-editor-input
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
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
|
+
|
|
16
|
+
## [0.5.5](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-editor-input_v0.5.5)
|
|
17
|
+
|
|
18
|
+
Fri, 05 Sep 2025 00:07:29 GMT
|
|
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)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- feat: Implement new AnimatedPlaceholder component ([PR #3317](https://github.com/microsoft/fluentai/pull/3317) by jiangemma@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [0.5.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-editor-input_v0.5.3)
|
|
8
26
|
|
|
9
27
|
Thu, 17 Jul 2025 17:49:26 GMT
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,36 @@ import type { ForwardRefComponent } from '@fluentui/react-components';
|
|
|
6
6
|
import type { InitialConfigType } from '@fluentui-copilot/react-text-editor';
|
|
7
7
|
import type { LexicalEditor } from '@fluentui-copilot/react-text-editor';
|
|
8
8
|
import type { LexicalPlainTextPlugin } from '@fluentui-copilot/react-text-editor';
|
|
9
|
+
import type { PresenceMotionSlotProps } from '@fluentui/react-motion';
|
|
9
10
|
import * as React_2 from 'react';
|
|
10
11
|
import type { Slot } from '@fluentui/react-components';
|
|
11
12
|
import type { SlotClassNames } from '@fluentui/react-components';
|
|
12
13
|
|
|
14
|
+
export declare const AnimatedPlaceholder: ForwardRefComponent<AnimatedPlaceholderProps>;
|
|
15
|
+
|
|
16
|
+
export declare const animatedPlaceholderClassNames: SlotClassNames<Omit<AnimatedPlaceholderSlots, 'motion'>>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* AnimatedPlaceholder Props
|
|
20
|
+
*/
|
|
21
|
+
export declare type AnimatedPlaceholderProps = ComponentProps<Partial<AnimatedPlaceholderSlots>> & {
|
|
22
|
+
/**
|
|
23
|
+
* The placeholder value to animate.
|
|
24
|
+
*/
|
|
25
|
+
placeholderValue: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare type AnimatedPlaceholderSlots = {
|
|
29
|
+
root: NonNullable<Slot<'div'>>;
|
|
30
|
+
motion: NonNullable<Slot<PresenceMotionSlotProps>>;
|
|
31
|
+
placeholder: NonNullable<Slot<'div'>>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* State used in rendering AnimatedPlaceholder
|
|
36
|
+
*/
|
|
37
|
+
export declare type AnimatedPlaceholderState = ComponentState<AnimatedPlaceholderSlots>;
|
|
38
|
+
|
|
13
39
|
export declare const EditorInput: ForwardRefComponent<EditorInputProps>;
|
|
14
40
|
|
|
15
41
|
export declare const editorInputClassNames: SlotClassNames<EditorInputSlots>;
|
|
@@ -93,11 +119,32 @@ export declare type EditorInputValueData = {
|
|
|
93
119
|
value: string;
|
|
94
120
|
};
|
|
95
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Render the final JSX of AnimatedPlaceholder
|
|
124
|
+
*/
|
|
125
|
+
export declare const renderAnimatedPlaceholder_unstable: (state: AnimatedPlaceholderState) => JSX.Element;
|
|
126
|
+
|
|
96
127
|
/**
|
|
97
128
|
* Render the final JSX of EditorInput
|
|
98
129
|
*/
|
|
99
130
|
export declare const renderEditorInput_unstable: (state: EditorInputState) => JSX.Element;
|
|
100
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Create the state required to render AnimatedPlaceholder.
|
|
134
|
+
*
|
|
135
|
+
* The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,
|
|
136
|
+
* before being passed to renderAnimatedPlaceholder_unstable.
|
|
137
|
+
*
|
|
138
|
+
* @param props - props from this instance of AnimatedPlaceholder
|
|
139
|
+
* @param ref - reference to root HTMLElement of AnimatedPlaceholder
|
|
140
|
+
*/
|
|
141
|
+
export declare const useAnimatedPlaceholder_unstable: (props: AnimatedPlaceholderProps, ref: React_2.Ref<HTMLDivElement>) => AnimatedPlaceholderState;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Apply styling to the AnimatedPlaceholder slots based on the state
|
|
145
|
+
*/
|
|
146
|
+
export declare const useAnimatedPlaceholderStyles_unstable: (state: AnimatedPlaceholderState) => AnimatedPlaceholderState;
|
|
147
|
+
|
|
101
148
|
/**
|
|
102
149
|
* Create the state required to render EditorInput.
|
|
103
150
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AnimatedPlaceholder, renderAnimatedPlaceholder_unstable, useAnimatedPlaceholder_unstable, animatedPlaceholderClassNames, useAnimatedPlaceholderStyles_unstable } from './components/AnimatedPlaceholder/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.ts"],"sourcesContent":["export {\n AnimatedPlaceholder,\n renderAnimatedPlaceholder_unstable,\n useAnimatedPlaceholder_unstable,\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './components/AnimatedPlaceholder/index';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './components/AnimatedPlaceholder/index';\n"],"names":["AnimatedPlaceholder","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholder_unstable","animatedPlaceholderClassNames","useAnimatedPlaceholderStyles_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,mBAAmB,EACnBC,kCAAkC,EAClCC,+BAA+B,EAC/BC,6BAA6B,EAC7BC,qCAAqC,QAChC,yCAAyC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';
|
|
3
|
+
import { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';
|
|
4
|
+
import { useAnimatedPlaceholderStyles_unstable } from './useAnimatedPlaceholderStyles.styles';
|
|
5
|
+
export const AnimatedPlaceholder = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
6
|
+
const state = useAnimatedPlaceholder_unstable(props, ref);
|
|
7
|
+
useAnimatedPlaceholderStyles_unstable(state);
|
|
8
|
+
return renderAnimatedPlaceholder_unstable(state);
|
|
9
|
+
});
|
|
10
|
+
AnimatedPlaceholder.displayName = 'AnimatedPlaceholder';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';\nimport { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';\nimport { useAnimatedPlaceholderStyles_unstable } from './useAnimatedPlaceholderStyles.styles';\nimport type { AnimatedPlaceholderProps } from './AnimatedPlaceholder.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const AnimatedPlaceholder: ForwardRefComponent<AnimatedPlaceholderProps> = React.forwardRef((props, ref) => {\n const state = useAnimatedPlaceholder_unstable(props, ref);\n\n useAnimatedPlaceholderStyles_unstable(state);\n return renderAnimatedPlaceholder_unstable(state);\n});\n\nAnimatedPlaceholder.displayName = 'AnimatedPlaceholder';\n"],"names":["React","useAnimatedPlaceholder_unstable","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholderStyles_unstable","AnimatedPlaceholder","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,+BAA+B,QAAQ,2BAA2B;AAC3E,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,qCAAqC,QAAQ,wCAAwC;AAI9F,OAAO,MAAMC,oCAAqEJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACzG,MAAMC,QAAQP,gCAAgCK,OAAOC;IAErDJ,sCAAsCK;IACtC,OAAON,mCAAmCM;AAC5C,GAAG;AAEHJ,oBAAoBK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\n\nexport type AnimatedPlaceholderSlots = {\n root: NonNullable<Slot<'div'>>;\n motion: NonNullable<Slot<PresenceMotionSlotProps>>;\n placeholder: NonNullable<Slot<'div'>>;\n};\n\n/**\n * AnimatedPlaceholder Props\n */\nexport type AnimatedPlaceholderProps = ComponentProps<Partial<AnimatedPlaceholderSlots>> & {\n /**\n * The placeholder value to animate.\n */\n placeholderValue: string;\n};\n\n/**\n * State used in rendering AnimatedPlaceholder\n */\nexport type AnimatedPlaceholderState = ComponentState<AnimatedPlaceholderSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC,GACD,WAAgF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AnimatedPlaceholder } from './AnimatedPlaceholder';
|
|
2
|
+
export { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';
|
|
3
|
+
export { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';
|
|
4
|
+
export { animatedPlaceholderClassNames, useAnimatedPlaceholderStyles_unstable } from './useAnimatedPlaceholderStyles.styles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AnimatedPlaceholder } from './AnimatedPlaceholder';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './AnimatedPlaceholder.types';\nexport { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';\nexport { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';\nexport {\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './useAnimatedPlaceholderStyles.styles';\n"],"names":["AnimatedPlaceholder","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholder_unstable","animatedPlaceholderClassNames","useAnimatedPlaceholderStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,mBAAmB,QAAQ,wBAAwB;AAM5D,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,+BAA+B,QAAQ,2BAA2B;AAC3E,SACEC,6BAA6B,EAC7BC,qCAAqC,QAChC,wCAAwC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createPresenceComponent, motionTokens } from '@fluentui/react-motion';
|
|
2
|
+
const placeholderMotion = ()=>{
|
|
3
|
+
const enterKeyframes = [
|
|
4
|
+
{
|
|
5
|
+
keyframes: [
|
|
6
|
+
{
|
|
7
|
+
opacity: 0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
opacity: 1
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
duration: motionTokens.durationFaster,
|
|
14
|
+
easing: motionTokens.curveLinear
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
keyframes: [
|
|
18
|
+
{
|
|
19
|
+
transform: 'translateY(10px)'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
transform: 'translateY(0)'
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
duration: motionTokens.durationNormal,
|
|
26
|
+
easing: motionTokens.curveDecelerateMid
|
|
27
|
+
}
|
|
28
|
+
];
|
|
29
|
+
const exitKeyframes = {
|
|
30
|
+
keyframes: [
|
|
31
|
+
{
|
|
32
|
+
opacity: 1
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
opacity: 0
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
duration: motionTokens.durationFaster,
|
|
39
|
+
easing: motionTokens.curveLinear
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
enter: enterKeyframes,
|
|
43
|
+
exit: exitKeyframes
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export const PlaceholderMotion = createPresenceComponent(placeholderMotion);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["placeholderMotion.ts"],"sourcesContent":["import { type PresenceMotionFn, createPresenceComponent, motionTokens } from '@fluentui/react-motion';\n\nconst placeholderMotion: PresenceMotionFn = () => {\n const enterKeyframes = [\n {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n duration: motionTokens.durationFaster,\n easing: motionTokens.curveLinear,\n },\n {\n keyframes: [{ transform: 'translateY(10px)' }, { transform: 'translateY(0)' }],\n duration: motionTokens.durationNormal,\n easing: motionTokens.curveDecelerateMid,\n },\n ];\n const exitKeyframes = {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n duration: motionTokens.durationFaster,\n easing: motionTokens.curveLinear,\n };\n\n return {\n enter: enterKeyframes,\n exit: exitKeyframes,\n };\n};\n\nexport const PlaceholderMotion: ReturnType<typeof createPresenceComponent<{}>> =\n createPresenceComponent(placeholderMotion);\n"],"names":["createPresenceComponent","motionTokens","placeholderMotion","enterKeyframes","keyframes","opacity","duration","durationFaster","easing","curveLinear","transform","durationNormal","curveDecelerateMid","exitKeyframes","enter","exit","PlaceholderMotion"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAAgCA,uBAAuB,EAAEC,YAAY,QAAQ,yBAAyB;AAEtG,MAAMC,oBAAsC;IAC1C,MAAMC,iBAAiB;QACrB;YACEC,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;YAC3CC,UAAUL,aAAaM,cAAc;YACrCC,QAAQP,aAAaQ,WAAW;QAClC;QACA;YACEL,WAAW;gBAAC;oBAAEM,WAAW;gBAAmB;gBAAG;oBAAEA,WAAW;gBAAgB;aAAE;YAC9EJ,UAAUL,aAAaU,cAAc;YACrCH,QAAQP,aAAaW,kBAAkB;QACzC;KACD;IACD,MAAMC,gBAAgB;QACpBT,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;QAC3CC,UAAUL,aAAaM,cAAc;QACrCC,QAAQP,aAAaQ,WAAW;IAClC;IAEA,OAAO;QACLK,OAAOX;QACPY,MAAMF;IACR;AACF;AAEA,OAAO,MAAMG,oBACXhB,wBAAwBE,mBAAmB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of AnimatedPlaceholder
|
|
5
|
+
*/ export const renderAnimatedPlaceholder_unstable = (state)=>{
|
|
6
|
+
assertSlots(state);
|
|
7
|
+
return /*#__PURE__*/ _jsx(state.root, {
|
|
8
|
+
children: /*#__PURE__*/ _jsx(state.motion, {
|
|
9
|
+
children: /*#__PURE__*/ _jsx(state.placeholder, {})
|
|
10
|
+
})
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAnimatedPlaceholder.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderState, AnimatedPlaceholderSlots } from './AnimatedPlaceholder.types';\n\n/**\n * Render the final JSX of AnimatedPlaceholder\n */\nexport const renderAnimatedPlaceholder_unstable = (state: AnimatedPlaceholderState) => {\n assertSlots<AnimatedPlaceholderSlots>(state);\n\n return (\n <state.root>\n <state.motion>\n <state.placeholder />\n </state.motion>\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAnimatedPlaceholder_unstable","state","root","motion","placeholder"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,6BAA6B;AAGzD;;CAEC,GACD,OAAO,MAAMC,qCAAqC,CAACC;IACjDF,YAAsCE;IAEtC,qBACE,KAACA,MAAMC,IAAI;kBACT,cAAA,KAACD,MAAME,MAAM;sBACX,cAAA,KAACF,MAAMG,WAAW;;;AAI1B,EAAE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getIntrinsicElementProps, slot } from '@fluentui/react-components';
|
|
3
|
+
import { PlaceholderMotion } from './placeholderMotion';
|
|
4
|
+
import { presenceMotionSlot } from '@fluentui/react-motion';
|
|
5
|
+
/**
|
|
6
|
+
* Create the state required to render AnimatedPlaceholder.
|
|
7
|
+
*
|
|
8
|
+
* The returned state can be modified with hooks such as useAnimatedPlaceholderStyles_unstable,
|
|
9
|
+
* before being passed to renderAnimatedPlaceholder_unstable.
|
|
10
|
+
*
|
|
11
|
+
* @param props - props from this instance of AnimatedPlaceholder
|
|
12
|
+
* @param ref - reference to root HTMLElement of AnimatedPlaceholder
|
|
13
|
+
*/ export const useAnimatedPlaceholder_unstable = (props, ref)=>{
|
|
14
|
+
const { placeholderValue } = props;
|
|
15
|
+
const [placeholder, setPlaceholder] = React.useState(placeholderValue);
|
|
16
|
+
const [visible, setVisible] = React.useState(true);
|
|
17
|
+
React.useEffect(()=>{
|
|
18
|
+
if (placeholderValue !== placeholder) {
|
|
19
|
+
setVisible(false);
|
|
20
|
+
}
|
|
21
|
+
}, [
|
|
22
|
+
placeholder,
|
|
23
|
+
placeholderValue
|
|
24
|
+
]);
|
|
25
|
+
const onMotionFinish = ()=>{
|
|
26
|
+
setPlaceholder(placeholderValue);
|
|
27
|
+
setVisible(true);
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
components: {
|
|
31
|
+
root: 'div',
|
|
32
|
+
motion: PlaceholderMotion,
|
|
33
|
+
placeholder: 'div'
|
|
34
|
+
},
|
|
35
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
36
|
+
ref,
|
|
37
|
+
...props
|
|
38
|
+
}), {
|
|
39
|
+
elementType: 'div'
|
|
40
|
+
}),
|
|
41
|
+
motion: presenceMotionSlot(props.motion, {
|
|
42
|
+
elementType: PlaceholderMotion,
|
|
43
|
+
defaultProps: {
|
|
44
|
+
visible: visible,
|
|
45
|
+
onMotionFinish: onMotionFinish
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
placeholder: slot.always(getIntrinsicElementProps('div', {
|
|
49
|
+
children: placeholder
|
|
50
|
+
}), {
|
|
51
|
+
elementType: 'div'
|
|
52
|
+
})
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +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 { 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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __resetStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
export const animatedPlaceholderClassNames = {
|
|
3
|
+
root: 'fai-AnimatedPlaceholder',
|
|
4
|
+
placeholder: 'fai-AnimatedPlaceholder__placeholder'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Styles for the root slot
|
|
8
|
+
*/
|
|
9
|
+
const useRootClassNames = __resetStyles("r7ukxtn", null, [".r7ukxtn{overflow:clip;}"]);
|
|
10
|
+
/**
|
|
11
|
+
* Apply styling to the AnimatedPlaceholder slots based on the state
|
|
12
|
+
*/
|
|
13
|
+
export const useAnimatedPlaceholderStyles_unstable = state => {
|
|
14
|
+
'use no memo';
|
|
15
|
+
|
|
16
|
+
const rootClassNames = useRootClassNames();
|
|
17
|
+
state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);
|
|
18
|
+
if (state.placeholder) {
|
|
19
|
+
state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);
|
|
20
|
+
}
|
|
21
|
+
return state;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useAnimatedPlaceholderStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAnimatedPlaceholderStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderSlots, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const animatedPlaceholderClassNames: SlotClassNames<Omit<AnimatedPlaceholderSlots, 'motion'>> = {\n root: 'fai-AnimatedPlaceholder',\n placeholder: 'fai-AnimatedPlaceholder__placeholder',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassNames = makeResetStyles({\n overflow: 'clip',\n});\n\n/**\n * Apply styling to the AnimatedPlaceholder slots based on the state\n */\nexport const useAnimatedPlaceholderStyles_unstable = (state: AnimatedPlaceholderState): AnimatedPlaceholderState => {\n 'use no memo';\n\n const rootClassNames = useRootClassNames();\n state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);\n\n if (state.placeholder) {\n state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","animatedPlaceholderClassNames","root","placeholder","useRootClassNames","overflow","useAnimatedPlaceholderStyles_unstable","state","rootClassNames","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,6BAA6B;AAI3E,OAAO,MAAMC,gCAA0F;IACrGC,MAAM;IACNC,aAAa;AACf,EAAE;AAEF;;CAEC,GACD,MAAMC,oBAAoBL,gBAAgB;IACxCM,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CAACC;IACpD;IAEA,MAAMC,iBAAiBJ;IACvBG,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,8BAA8BC,IAAI,EAAEM,gBAAgBD,MAAML,IAAI,CAACO,SAAS;IAE5G,IAAIF,MAAMJ,WAAW,EAAE;QACrBI,MAAMJ,WAAW,CAACM,SAAS,GAAGT,aAAaC,8BAA8BE,WAAW,EAAEI,MAAMJ,WAAW,CAACM,SAAS;IACnH;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeResetStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
export const animatedPlaceholderClassNames = {
|
|
3
|
+
root: 'fai-AnimatedPlaceholder',
|
|
4
|
+
placeholder: 'fai-AnimatedPlaceholder__placeholder'
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Styles for the root slot
|
|
8
|
+
*/ const useRootClassNames = makeResetStyles({
|
|
9
|
+
overflow: 'clip'
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Apply styling to the AnimatedPlaceholder slots based on the state
|
|
13
|
+
*/ export const useAnimatedPlaceholderStyles_unstable = (state)=>{
|
|
14
|
+
'use no memo';
|
|
15
|
+
const rootClassNames = useRootClassNames();
|
|
16
|
+
state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);
|
|
17
|
+
if (state.placeholder) {
|
|
18
|
+
state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);
|
|
19
|
+
}
|
|
20
|
+
return state;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAnimatedPlaceholderStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderSlots, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const animatedPlaceholderClassNames: SlotClassNames<Omit<AnimatedPlaceholderSlots, 'motion'>> = {\n root: 'fai-AnimatedPlaceholder',\n placeholder: 'fai-AnimatedPlaceholder__placeholder',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassNames = makeResetStyles({\n overflow: 'clip',\n});\n\n/**\n * Apply styling to the AnimatedPlaceholder slots based on the state\n */\nexport const useAnimatedPlaceholderStyles_unstable = (state: AnimatedPlaceholderState): AnimatedPlaceholderState => {\n 'use no memo';\n\n const rootClassNames = useRootClassNames();\n state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);\n\n if (state.placeholder) {\n state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","animatedPlaceholderClassNames","root","placeholder","useRootClassNames","overflow","useAnimatedPlaceholderStyles_unstable","state","rootClassNames","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,QAAQ,6BAA6B;AAI3E,OAAO,MAAMC,gCAA0F;IACrGC,MAAM;IACNC,aAAa;AACf,EAAE;AAEF;;CAEC,GACD,MAAMC,oBAAoBL,gBAAgB;IACxCM,UAAU;AACZ;AAEA;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CAACC;IACpD;IAEA,MAAMC,iBAAiBJ;IACvBG,MAAML,IAAI,CAACO,SAAS,GAAGT,aAAaC,8BAA8BC,IAAI,EAAEM,gBAAgBD,MAAML,IAAI,CAACO,SAAS;IAE5G,IAAIF,MAAMJ,WAAW,EAAE;QACrBI,MAAMJ,WAAW,CAACM,SAAS,GAAGT,aAAaC,8BAA8BE,WAAW,EAAEI,MAAMJ,WAAW,CAACM,SAAS;IACnH;IAEA,OAAOF;AACT,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,sCAAsC;AAC/D,SAASC,sBAAsB,EAAEC,aAAa,QAAQ,sCAAsC;AAC5F,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,4BAA4B;AAEjF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EACJC,QAAQ,EACRC,OAAO,EACPC,iBAAiB,KAAK,EACtBC,aAAaV,sBAAsB,EACnCW,UAAU,IAAI,EACdC,WAAWC,aAAa,EACxBC,WAAW,EACXC,wBAAwB,IA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,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,sBAAsB,EAAEC,aAAa,QAAQ,sCAAsC;AAC5F,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,4BAA4B;AAEjF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EACJC,QAAQ,EACRC,OAAO,EACPC,iBAAiB,KAAK,EACtBC,aAAaV,sBAAsB,EACnCW,UAAU,IAAI,EACdC,WAAWC,aAAa,EACxBC,WAAW,EACXC,wBAAwB,IAAI,EAC7B,GAAGV;IAC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,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"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { EditorInput, editorInputClassNames, renderEditorInput_unstable, useEditorInputStyles_unstable, useEditorInput_unstable } from './EditorInput';
|
|
2
|
+
export { AnimatedPlaceholder, renderAnimatedPlaceholder_unstable, useAnimatedPlaceholder_unstable, animatedPlaceholderClassNames, useAnimatedPlaceholderStyles_unstable } from './AnimatedPlaceholder';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { EditorInputProps, EditorInputSlots, EditorInputState, EditorInputValueData } from './EditorInput';\nexport {\n EditorInput,\n editorInputClassNames,\n renderEditorInput_unstable,\n useEditorInputStyles_unstable,\n useEditorInput_unstable,\n} from './EditorInput';\n"],"names":["EditorInput","editorInputClassNames","renderEditorInput_unstable","useEditorInputStyles_unstable","useEditorInput_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB"}
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { EditorInputProps, EditorInputSlots, EditorInputState, EditorInputValueData } from './EditorInput';\nexport {\n EditorInput,\n editorInputClassNames,\n renderEditorInput_unstable,\n useEditorInputStyles_unstable,\n useEditorInput_unstable,\n} from './EditorInput';\n\nexport {\n AnimatedPlaceholder,\n renderAnimatedPlaceholder_unstable,\n useAnimatedPlaceholder_unstable,\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './AnimatedPlaceholder';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './AnimatedPlaceholder';\n"],"names":["EditorInput","editorInputClassNames","renderEditorInput_unstable","useEditorInputStyles_unstable","useEditorInput_unstable","AnimatedPlaceholder","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholder_unstable","animatedPlaceholderClassNames","useAnimatedPlaceholderStyles_unstable"],"rangeMappings":";","mappings":"AACA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,gBAAgB;AAEvB,SACEC,mBAAmB,EACnBC,kCAAkC,EAClCC,+BAA+B,EAC/BC,6BAA6B,EAC7BC,qCAAqC,QAChC,wBAAwB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
AnimatedPlaceholder: function() {
|
|
13
|
+
return _index.AnimatedPlaceholder;
|
|
14
|
+
},
|
|
15
|
+
animatedPlaceholderClassNames: function() {
|
|
16
|
+
return _index.animatedPlaceholderClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAnimatedPlaceholder_unstable: function() {
|
|
19
|
+
return _index.renderAnimatedPlaceholder_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAnimatedPlaceholderStyles_unstable: function() {
|
|
22
|
+
return _index.useAnimatedPlaceholderStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAnimatedPlaceholder_unstable: function() {
|
|
25
|
+
return _index.useAnimatedPlaceholder_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _index = require("./components/AnimatedPlaceholder/index");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.ts"],"sourcesContent":["export {\n AnimatedPlaceholder,\n renderAnimatedPlaceholder_unstable,\n useAnimatedPlaceholder_unstable,\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './components/AnimatedPlaceholder/index';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './components/AnimatedPlaceholder/index';\n"],"names":["AnimatedPlaceholder","animatedPlaceholderClassNames","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholderStyles_unstable","useAnimatedPlaceholder_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,mBAAmB;eAAnBA,0BAAmB;;IAGnBC,6BAA6B;eAA7BA,oCAA6B;;IAF7BC,kCAAkC;eAAlCA,yCAAkC;;IAGlCC,qCAAqC;eAArCA,4CAAqC;;IAFrCC,+BAA+B;eAA/BA,sCAA+B;;;uBAG1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AnimatedPlaceholder", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AnimatedPlaceholder;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAnimatedPlaceholder = require("./useAnimatedPlaceholder");
|
|
14
|
+
const _renderAnimatedPlaceholder = require("./renderAnimatedPlaceholder");
|
|
15
|
+
const _useAnimatedPlaceholderStylesstyles = require("./useAnimatedPlaceholderStyles.styles");
|
|
16
|
+
const AnimatedPlaceholder = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
17
|
+
const state = (0, _useAnimatedPlaceholder.useAnimatedPlaceholder_unstable)(props, ref);
|
|
18
|
+
(0, _useAnimatedPlaceholderStylesstyles.useAnimatedPlaceholderStyles_unstable)(state);
|
|
19
|
+
return (0, _renderAnimatedPlaceholder.renderAnimatedPlaceholder_unstable)(state);
|
|
20
|
+
});
|
|
21
|
+
AnimatedPlaceholder.displayName = 'AnimatedPlaceholder';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';\nimport { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';\nimport { useAnimatedPlaceholderStyles_unstable } from './useAnimatedPlaceholderStyles.styles';\nimport type { AnimatedPlaceholderProps } from './AnimatedPlaceholder.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\nexport const AnimatedPlaceholder: ForwardRefComponent<AnimatedPlaceholderProps> = React.forwardRef((props, ref) => {\n const state = useAnimatedPlaceholder_unstable(props, ref);\n\n useAnimatedPlaceholderStyles_unstable(state);\n return renderAnimatedPlaceholder_unstable(state);\n});\n\nAnimatedPlaceholder.displayName = 'AnimatedPlaceholder';\n"],"names":["AnimatedPlaceholder","React","forwardRef","props","ref","state","useAnimatedPlaceholder_unstable","useAnimatedPlaceholderStyles_unstable","renderAnimatedPlaceholder_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;;iEAPU;wCACyB;2CACG;oDACG;AAI/C,MAAMA,sBAAAA,WAAAA,GAAqEC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACzG,MAAMC,QAAQC,IAAAA,uDAAAA,EAAgCH,OAAOC;IAErDG,IAAAA,yEAAAA,EAAsCF;IACtC,OAAOG,IAAAA,6DAAAA,EAAmCH;AAC5C;AAEAL,oBAAoBS,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AnimatedPlaceholder.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { PresenceMotionSlotProps } from '@fluentui/react-motion';\n\nexport type AnimatedPlaceholderSlots = {\n root: NonNullable<Slot<'div'>>;\n motion: NonNullable<Slot<PresenceMotionSlotProps>>;\n placeholder: NonNullable<Slot<'div'>>;\n};\n\n/**\n * AnimatedPlaceholder Props\n */\nexport type AnimatedPlaceholderProps = ComponentProps<Partial<AnimatedPlaceholderSlots>> & {\n /**\n * The placeholder value to animate.\n */\n placeholderValue: string;\n};\n\n/**\n * State used in rendering AnimatedPlaceholder\n */\nexport type AnimatedPlaceholderState = ComponentState<AnimatedPlaceholderSlots>;\n"],"names":[],"rangeMappings":";;","mappings":"AAmBA;;CAEC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
AnimatedPlaceholder: function() {
|
|
13
|
+
return _AnimatedPlaceholder.AnimatedPlaceholder;
|
|
14
|
+
},
|
|
15
|
+
animatedPlaceholderClassNames: function() {
|
|
16
|
+
return _useAnimatedPlaceholderStylesstyles.animatedPlaceholderClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAnimatedPlaceholder_unstable: function() {
|
|
19
|
+
return _renderAnimatedPlaceholder.renderAnimatedPlaceholder_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAnimatedPlaceholderStyles_unstable: function() {
|
|
22
|
+
return _useAnimatedPlaceholderStylesstyles.useAnimatedPlaceholderStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAnimatedPlaceholder_unstable: function() {
|
|
25
|
+
return _useAnimatedPlaceholder.useAnimatedPlaceholder_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _AnimatedPlaceholder = require("./AnimatedPlaceholder");
|
|
29
|
+
const _renderAnimatedPlaceholder = require("./renderAnimatedPlaceholder");
|
|
30
|
+
const _useAnimatedPlaceholder = require("./useAnimatedPlaceholder");
|
|
31
|
+
const _useAnimatedPlaceholderStylesstyles = require("./useAnimatedPlaceholderStyles.styles");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AnimatedPlaceholder } from './AnimatedPlaceholder';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './AnimatedPlaceholder.types';\nexport { renderAnimatedPlaceholder_unstable } from './renderAnimatedPlaceholder';\nexport { useAnimatedPlaceholder_unstable } from './useAnimatedPlaceholder';\nexport {\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './useAnimatedPlaceholderStyles.styles';\n"],"names":["AnimatedPlaceholder","animatedPlaceholderClassNames","renderAnimatedPlaceholder_unstable","useAnimatedPlaceholderStyles_unstable","useAnimatedPlaceholder_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,mBAAmB;eAAnBA,wCAAmB;;IAS1BC,6BAA6B;eAA7BA,iEAA6B;;IAHtBC,kCAAkC;eAAlCA,6DAAkC;;IAIzCC,qCAAqC;eAArCA,yEAAqC;;IAH9BC,+BAA+B;eAA/BA,uDAA+B;;;qCAPJ;2CAMe;wCACH;oDAIzC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PlaceholderMotion", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PlaceholderMotion;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactmotion = require("@fluentui/react-motion");
|
|
12
|
+
const placeholderMotion = ()=>{
|
|
13
|
+
const enterKeyframes = [
|
|
14
|
+
{
|
|
15
|
+
keyframes: [
|
|
16
|
+
{
|
|
17
|
+
opacity: 0
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
opacity: 1
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
duration: _reactmotion.motionTokens.durationFaster,
|
|
24
|
+
easing: _reactmotion.motionTokens.curveLinear
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
keyframes: [
|
|
28
|
+
{
|
|
29
|
+
transform: 'translateY(10px)'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
transform: 'translateY(0)'
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
duration: _reactmotion.motionTokens.durationNormal,
|
|
36
|
+
easing: _reactmotion.motionTokens.curveDecelerateMid
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const exitKeyframes = {
|
|
40
|
+
keyframes: [
|
|
41
|
+
{
|
|
42
|
+
opacity: 1
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
opacity: 0
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
duration: _reactmotion.motionTokens.durationFaster,
|
|
49
|
+
easing: _reactmotion.motionTokens.curveLinear
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
enter: enterKeyframes,
|
|
53
|
+
exit: exitKeyframes
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const PlaceholderMotion = (0, _reactmotion.createPresenceComponent)(placeholderMotion);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["placeholderMotion.ts"],"sourcesContent":["import { type PresenceMotionFn, createPresenceComponent, motionTokens } from '@fluentui/react-motion';\n\nconst placeholderMotion: PresenceMotionFn = () => {\n const enterKeyframes = [\n {\n keyframes: [{ opacity: 0 }, { opacity: 1 }],\n duration: motionTokens.durationFaster,\n easing: motionTokens.curveLinear,\n },\n {\n keyframes: [{ transform: 'translateY(10px)' }, { transform: 'translateY(0)' }],\n duration: motionTokens.durationNormal,\n easing: motionTokens.curveDecelerateMid,\n },\n ];\n const exitKeyframes = {\n keyframes: [{ opacity: 1 }, { opacity: 0 }],\n duration: motionTokens.durationFaster,\n easing: motionTokens.curveLinear,\n };\n\n return {\n enter: enterKeyframes,\n exit: exitKeyframes,\n };\n};\n\nexport const PlaceholderMotion: ReturnType<typeof createPresenceComponent<{}>> =\n createPresenceComponent(placeholderMotion);\n"],"names":["PlaceholderMotion","placeholderMotion","enterKeyframes","keyframes","opacity","duration","motionTokens","durationFaster","easing","curveLinear","transform","durationNormal","curveDecelerateMid","exitKeyframes","enter","exit","createPresenceComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA2BaA;;;eAAAA;;;6BA3BgE;AAE7E,MAAMC,oBAAsC;IAC1C,MAAMC,iBAAiB;QACrB;YACEC,WAAW;gBAAC;oBAAEC,SAAS;gBAAE;gBAAG;oBAAEA,SAAS;gBAAE;aAAE;YAC3CC,UAAUC,yBAAAA,CAAaC,cAAc;YACrCC,QAAQF,yBAAAA,CAAaG,WAAW;QAClC;QACA;YACEN,WAAW;gBAAC;oBAAEO,WAAW;gBAAmB;gBAAG;oBAAEA,WAAW;gBAAgB;aAAE;YAC9EL,UAAUC,yBAAAA,CAAaK,cAAc;YACrCH,QAAQF,yBAAAA,CAAaM,kBAAkB;QACzC;KACD;IACD,MAAMC,gBAAgB;QACpBV,WAAW;YAAC;gBAAEC,SAAS;YAAE;YAAG;gBAAEA,SAAS;YAAE;SAAE;QAC3CC,UAAUC,yBAAAA,CAAaC,cAAc;QACrCC,QAAQF,yBAAAA,CAAaG,WAAW;IAClC;IAEA,OAAO;QACLK,OAAOZ;QACPa,MAAMF;IACR;AACF;AAEO,MAAMb,oBACXgB,IAAAA,oCAAAA,EAAwBf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAnimatedPlaceholder_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAnimatedPlaceholder_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderAnimatedPlaceholder_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {
|
|
16
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.motion, {
|
|
17
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.placeholder, {})
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAnimatedPlaceholder.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderState, AnimatedPlaceholderSlots } from './AnimatedPlaceholder.types';\n\n/**\n * Render the final JSX of AnimatedPlaceholder\n */\nexport const renderAnimatedPlaceholder_unstable = (state: AnimatedPlaceholderState) => {\n assertSlots<AnimatedPlaceholderSlots>(state);\n\n return (\n <state.root>\n <state.motion>\n <state.placeholder />\n </state.motion>\n </state.root>\n );\n};\n"],"names":["renderAnimatedPlaceholder_unstable","state","assertSlots","_jsx","root","motion","placeholder"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;iCAE4B;AAMrB,MAAMA,qCAAqC,CAACC;IACjDC,IAAAA,4BAAAA,EAAsCD;IAEtC,OAAA,WAAA,GACEE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA;kBACT,WAAA,GAAAD,IAAAA,eAAA,EAACF,MAAMI,MAAM,EAAA;sBACX,WAAA,GAAAF,IAAAA,eAAA,EAACF,MAAMK,WAAW,EAAA,CAAA;;;AAI1B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAnimatedPlaceholder_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAnimatedPlaceholder_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _placeholderMotion = require("./placeholderMotion");
|
|
15
|
+
const _reactmotion = require("@fluentui/react-motion");
|
|
16
|
+
const useAnimatedPlaceholder_unstable = (props, ref)=>{
|
|
17
|
+
const { placeholderValue } = props;
|
|
18
|
+
const [placeholder, setPlaceholder] = _react.useState(placeholderValue);
|
|
19
|
+
const [visible, setVisible] = _react.useState(true);
|
|
20
|
+
_react.useEffect(()=>{
|
|
21
|
+
if (placeholderValue !== placeholder) {
|
|
22
|
+
setVisible(false);
|
|
23
|
+
}
|
|
24
|
+
}, [
|
|
25
|
+
placeholder,
|
|
26
|
+
placeholderValue
|
|
27
|
+
]);
|
|
28
|
+
const onMotionFinish = ()=>{
|
|
29
|
+
setPlaceholder(placeholderValue);
|
|
30
|
+
setVisible(true);
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
components: {
|
|
34
|
+
root: 'div',
|
|
35
|
+
motion: _placeholderMotion.PlaceholderMotion,
|
|
36
|
+
placeholder: 'div'
|
|
37
|
+
},
|
|
38
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
39
|
+
ref,
|
|
40
|
+
...props
|
|
41
|
+
}), {
|
|
42
|
+
elementType: 'div'
|
|
43
|
+
}),
|
|
44
|
+
motion: (0, _reactmotion.presenceMotionSlot)(props.motion, {
|
|
45
|
+
elementType: _placeholderMotion.PlaceholderMotion,
|
|
46
|
+
defaultProps: {
|
|
47
|
+
visible: visible,
|
|
48
|
+
onMotionFinish: onMotionFinish
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
placeholder: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
52
|
+
children: placeholder
|
|
53
|
+
}), {
|
|
54
|
+
elementType: 'div'
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +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 { 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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
animatedPlaceholderClassNames: function() {
|
|
13
|
+
return animatedPlaceholderClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAnimatedPlaceholderStyles_unstable: function() {
|
|
16
|
+
return useAnimatedPlaceholderStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const animatedPlaceholderClassNames = {
|
|
21
|
+
root: 'fai-AnimatedPlaceholder',
|
|
22
|
+
placeholder: 'fai-AnimatedPlaceholder__placeholder'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the root slot
|
|
26
|
+
*/ const useRootClassNames = (0, _reactcomponents.__resetStyles)("r7ukxtn", null, [
|
|
27
|
+
".r7ukxtn{overflow:clip;}"
|
|
28
|
+
]);
|
|
29
|
+
const useAnimatedPlaceholderStyles_unstable = (state)=>{
|
|
30
|
+
'use no memo';
|
|
31
|
+
const rootClassNames = useRootClassNames();
|
|
32
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);
|
|
33
|
+
if (state.placeholder) {
|
|
34
|
+
state.placeholder.className = (0, _reactcomponents.mergeClasses)(animatedPlaceholderClassNames.placeholder, state.placeholder.className);
|
|
35
|
+
}
|
|
36
|
+
return state;
|
|
37
|
+
}; //# sourceMappingURL=useAnimatedPlaceholderStyles.styles.js.map
|
package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAnimatedPlaceholderStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderSlots, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const animatedPlaceholderClassNames: SlotClassNames<Omit<AnimatedPlaceholderSlots, 'motion'>> = {\n root: 'fai-AnimatedPlaceholder',\n placeholder: 'fai-AnimatedPlaceholder__placeholder',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassNames = makeResetStyles({\n overflow: 'clip',\n});\n\n/**\n * Apply styling to the AnimatedPlaceholder slots based on the state\n */\nexport const useAnimatedPlaceholderStyles_unstable = (state: AnimatedPlaceholderState): AnimatedPlaceholderState => {\n 'use no memo';\n\n const rootClassNames = useRootClassNames();\n state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);\n\n if (state.placeholder) {\n state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);\n }\n\n return state;\n};\n"],"names":["animatedPlaceholderClassNames","useAnimatedPlaceholderStyles_unstable","root","placeholder","overflow","__resetStyles","state","useRootClassNames","mergeClasses","rootClassNames","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,6BAAAA;eAAAA;;IAeNC,qCAAMA;eAANA;;;iCAnB+B;AAI/B,MAAMD,gCAA0F;UACrGE;iBACAC;AACF;AAEA;;CAEC,SAECC,oBAAUC,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;AAMZ,MAAOJ,wCAAMA,CAAAA;;UAIXK,iBAAoBC;UAEhBD,IAAAA,CAAAA,SAAMH,GAAWK,IAAAA,6BAAE,EAAAR,8BAAAE,IAAA,EAAAO,gBAAAH,MAAAJ,IAAA,CAAAQ,SAAA;cACrBJ,WAAMH,EAAW;QACnBG,MAAAH,WAAA,CAAAO,SAAA,GAAAF,IAAAA,6BAAA,EAAAR,8BAAAG,WAAA,EAAAG,MAAAH,WAAA,CAAAO,SAAA;;IAGA,OAAAJ"}
|
package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
animatedPlaceholderClassNames: function() {
|
|
13
|
+
return animatedPlaceholderClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAnimatedPlaceholderStyles_unstable: function() {
|
|
16
|
+
return useAnimatedPlaceholderStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const animatedPlaceholderClassNames = {
|
|
21
|
+
root: 'fai-AnimatedPlaceholder',
|
|
22
|
+
placeholder: 'fai-AnimatedPlaceholder__placeholder'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the root slot
|
|
26
|
+
*/ const useRootClassNames = (0, _reactcomponents.makeResetStyles)({
|
|
27
|
+
overflow: 'clip'
|
|
28
|
+
});
|
|
29
|
+
const useAnimatedPlaceholderStyles_unstable = (state)=>{
|
|
30
|
+
'use no memo';
|
|
31
|
+
const rootClassNames = useRootClassNames();
|
|
32
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);
|
|
33
|
+
if (state.placeholder) {
|
|
34
|
+
state.placeholder.className = (0, _reactcomponents.mergeClasses)(animatedPlaceholderClassNames.placeholder, state.placeholder.className);
|
|
35
|
+
}
|
|
36
|
+
return state;
|
|
37
|
+
};
|
package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAnimatedPlaceholderStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses } from '@fluentui/react-components';\nimport type { AnimatedPlaceholderSlots, AnimatedPlaceholderState } from './AnimatedPlaceholder.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const animatedPlaceholderClassNames: SlotClassNames<Omit<AnimatedPlaceholderSlots, 'motion'>> = {\n root: 'fai-AnimatedPlaceholder',\n placeholder: 'fai-AnimatedPlaceholder__placeholder',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassNames = makeResetStyles({\n overflow: 'clip',\n});\n\n/**\n * Apply styling to the AnimatedPlaceholder slots based on the state\n */\nexport const useAnimatedPlaceholderStyles_unstable = (state: AnimatedPlaceholderState): AnimatedPlaceholderState => {\n 'use no memo';\n\n const rootClassNames = useRootClassNames();\n state.root.className = mergeClasses(animatedPlaceholderClassNames.root, rootClassNames, state.root.className);\n\n if (state.placeholder) {\n state.placeholder.className = mergeClasses(animatedPlaceholderClassNames.placeholder, state.placeholder.className);\n }\n\n return state;\n};\n"],"names":["animatedPlaceholderClassNames","useAnimatedPlaceholderStyles_unstable","root","placeholder","useRootClassNames","makeResetStyles","overflow","state","rootClassNames","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,6BAAAA;eAAAA;;IAeAC,qCAAAA;eAAAA;;;iCAnBiC;AAIvC,MAAMD,gCAA0F;IACrGE,MAAM;IACNC,aAAa;AACf;AAEA;;CAEC,GACD,MAAMC,oBAAoBC,IAAAA,gCAAAA,EAAgB;IACxCC,UAAU;AACZ;AAKO,MAAML,wCAAwC,CAACM;IACpD;IAEA,MAAMC,iBAAiBJ;IACvBG,MAAML,IAAI,CAACO,SAAS,GAAGC,IAAAA,6BAAAA,EAAaV,8BAA8BE,IAAI,EAAEM,gBAAgBD,MAAML,IAAI,CAACO,SAAS;IAE5G,IAAIF,MAAMJ,WAAW,EAAE;QACrBI,MAAMJ,WAAW,CAACM,SAAS,GAAGC,IAAAA,6BAAAA,EAAaV,8BAA8BG,WAAW,EAAEI,MAAMJ,WAAW,CAACM,SAAS;IACnH;IAEA,OAAOF;AACT"}
|
|
@@ -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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A,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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jE,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/lib-commonjs/index.js
CHANGED
|
@@ -9,15 +9,30 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
AnimatedPlaceholder: function() {
|
|
13
|
+
return _AnimatedPlaceholder.AnimatedPlaceholder;
|
|
14
|
+
},
|
|
12
15
|
EditorInput: function() {
|
|
13
16
|
return _EditorInput.EditorInput;
|
|
14
17
|
},
|
|
18
|
+
animatedPlaceholderClassNames: function() {
|
|
19
|
+
return _AnimatedPlaceholder.animatedPlaceholderClassNames;
|
|
20
|
+
},
|
|
15
21
|
editorInputClassNames: function() {
|
|
16
22
|
return _EditorInput.editorInputClassNames;
|
|
17
23
|
},
|
|
24
|
+
renderAnimatedPlaceholder_unstable: function() {
|
|
25
|
+
return _AnimatedPlaceholder.renderAnimatedPlaceholder_unstable;
|
|
26
|
+
},
|
|
18
27
|
renderEditorInput_unstable: function() {
|
|
19
28
|
return _EditorInput.renderEditorInput_unstable;
|
|
20
29
|
},
|
|
30
|
+
useAnimatedPlaceholderStyles_unstable: function() {
|
|
31
|
+
return _AnimatedPlaceholder.useAnimatedPlaceholderStyles_unstable;
|
|
32
|
+
},
|
|
33
|
+
useAnimatedPlaceholder_unstable: function() {
|
|
34
|
+
return _AnimatedPlaceholder.useAnimatedPlaceholder_unstable;
|
|
35
|
+
},
|
|
21
36
|
useEditorInputStyles_unstable: function() {
|
|
22
37
|
return _EditorInput.useEditorInputStyles_unstable;
|
|
23
38
|
},
|
|
@@ -26,3 +41,4 @@ _export(exports, {
|
|
|
26
41
|
}
|
|
27
42
|
});
|
|
28
43
|
const _EditorInput = require("./EditorInput");
|
|
44
|
+
const _AnimatedPlaceholder = require("./AnimatedPlaceholder");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { EditorInputProps, EditorInputSlots, EditorInputState, EditorInputValueData } from './EditorInput';\nexport {\n EditorInput,\n editorInputClassNames,\n renderEditorInput_unstable,\n useEditorInputStyles_unstable,\n useEditorInput_unstable,\n} from './EditorInput';\n"],"names":["EditorInput","editorInputClassNames","renderEditorInput_unstable","useEditorInputStyles_unstable","useEditorInput_unstable"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { EditorInputProps, EditorInputSlots, EditorInputState, EditorInputValueData } from './EditorInput';\nexport {\n EditorInput,\n editorInputClassNames,\n renderEditorInput_unstable,\n useEditorInputStyles_unstable,\n useEditorInput_unstable,\n} from './EditorInput';\n\nexport {\n AnimatedPlaceholder,\n renderAnimatedPlaceholder_unstable,\n useAnimatedPlaceholder_unstable,\n animatedPlaceholderClassNames,\n useAnimatedPlaceholderStyles_unstable,\n} from './AnimatedPlaceholder';\nexport type {\n AnimatedPlaceholderProps,\n AnimatedPlaceholderSlots,\n AnimatedPlaceholderState,\n} from './AnimatedPlaceholder';\n"],"names":["AnimatedPlaceholder","EditorInput","animatedPlaceholderClassNames","editorInputClassNames","renderAnimatedPlaceholder_unstable","renderEditorInput_unstable","useAnimatedPlaceholderStyles_unstable","useAnimatedPlaceholder_unstable","useEditorInputStyles_unstable","useEditorInput_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAUEA,mBAAmB;eAAnBA,wCAAmB;;IARnBC,WAAW;eAAXA,wBAAW;;IAWXC,6BAA6B;eAA7BA,kDAA6B;;IAV7BC,qBAAqB;eAArBA,kCAAqB;;IAQrBC,kCAAkC;eAAlCA,uDAAkC;;IAPlCC,0BAA0B;eAA1BA,uCAA0B;;IAU1BC,qCAAqC;eAArCA,0DAAqC;;IAFrCC,+BAA+B;eAA/BA,oDAA+B;;IAP/BC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;;6BAClB;qCAQA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-editor-input",
|
|
3
|
-
"version": "0.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,14 +13,15 @@
|
|
|
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.
|
|
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.
|
|
18
|
+
"@fluentui-copilot/tokens": "^0.3.14",
|
|
19
19
|
"@swc/helpers": "^0.5.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@fluentui/react-components": ">=9.66.0 <10.0.0",
|
|
23
23
|
"@fluentui/react-jsx-runtime": ">=9.1.1 <10.0.0",
|
|
24
|
+
"@fluentui/react-motion": ">=9.8.1 <10.0.0",
|
|
24
25
|
"@fluentui/react-utilities": ">=9.21.1 <10.0.0",
|
|
25
26
|
"@types/react": ">=16.14.0 <19.0.0",
|
|
26
27
|
"@types/react-dom": ">=16.9.8 <19.0.0",
|