@fluentui-copilot/react-chat-input-plugins 0.4.9 → 0.4.10-hotfix.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +39 -1
- package/CHANGELOG.md +20 -2
- package/lib/BasicFunctionality.js +0 -1
- package/lib/ChatInputEntity.js +0 -1
- package/lib/ChatInputToken.js +0 -1
- package/lib/GhostText.js +0 -1
- package/lib/ImperativeControl.js +0 -1
- package/lib/PasteUnfurling.js +0 -1
- package/lib/components/ChatInputEntity/ChatInputEntity.js +4 -5
- package/lib/components/ChatInputEntity/ChatInputEntity.types.js +2 -3
- package/lib/components/ChatInputEntity/index.js +0 -1
- package/lib/components/ChatInputEntity/renderChatInputEntity.js +9 -8
- package/lib/components/ChatInputEntity/useChatInputEntity.js +40 -44
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +43 -0
- package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib/components/ChatInputToken/ChatInputToken.js +4 -5
- package/lib/components/ChatInputToken/ChatInputToken.node.js +49 -50
- package/lib/components/ChatInputToken/ChatInputToken.types.js +1 -2
- package/lib/components/ChatInputToken/index.js +0 -1
- package/lib/components/ChatInputToken/renderChatInputToken.js +4 -6
- package/lib/components/ChatInputToken/useChatInputToken.js +12 -14
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +25 -0
- package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib/components/GhostText/GhostText.js +4 -5
- package/lib/components/GhostText/GhostText.types.js +2 -3
- package/lib/components/GhostText/index.js +0 -1
- package/lib/components/GhostText/renderGhostText.js +9 -8
- package/lib/components/GhostText/useGhostText.js +36 -39
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js +35 -0
- package/lib/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib/index.js +0 -1
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js +67 -51
- package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib/plugins/BasicFunctionality/index.js +0 -1
- package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +67 -68
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js +37 -38
- package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +1 -2
- package/lib/plugins/ChatInputEntity/index.js +0 -1
- package/lib/plugins/GhostText/GhostText.js +43 -37
- package/lib/plugins/GhostText/GhostText.node.js +56 -57
- package/lib/plugins/GhostText/index.js +0 -1
- package/lib/plugins/ImperativeControl/ImperativeControl.js +6 -5
- package/lib/plugins/ImperativeControl/index.js +0 -1
- package/lib/plugins/ManualGhostText/ManualGhostText.js +8 -8
- package/lib/plugins/ManualGhostText/index.js +0 -1
- package/lib/plugins/PasteUnfurling/PasteUnfurling.js +14 -14
- package/lib/plugins/PasteUnfurling/index.js +0 -1
- package/lib-commonjs/BasicFunctionality.js +0 -1
- package/lib-commonjs/ChatInputEntity.js +0 -1
- package/lib-commonjs/ChatInputToken.js +0 -1
- package/lib-commonjs/GhostText.js +0 -1
- package/lib-commonjs/ImperativeControl.js +0 -1
- package/lib-commonjs/PasteUnfurling.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/index.js +0 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -1
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js +59 -0
- package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +0 -1
- package/lib-commonjs/components/ChatInputToken/index.js +0 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -1
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js +41 -0
- package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/GhostText/GhostText.js +1 -1
- package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js +0 -1
- package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -1
- package/lib-commonjs/components/GhostText/index.js +0 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js +1 -1
- package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -1
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js +51 -0
- package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/index.js +0 -1
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +5 -3
- package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -1
- package/lib-commonjs/plugins/BasicFunctionality/index.js +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -1
- package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +0 -1
- package/lib-commonjs/plugins/ChatInputEntity/index.js +0 -1
- package/lib-commonjs/plugins/GhostText/GhostText.js +2 -3
- package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js +1 -1
- package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
- package/lib-commonjs/plugins/GhostText/index.js +0 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js +1 -1
- package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -1
- package/lib-commonjs/plugins/ImperativeControl/index.js +0 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js +1 -1
- package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -1
- package/lib-commonjs/plugins/ManualGhostText/index.js +0 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js.map +1 -1
- package/lib-commonjs/plugins/PasteUnfurling/index.js +0 -1
- package/package.json +6 -10
|
@@ -10,43 +10,40 @@ import { $getNodeByKey, useLexicalComposerContext } from '@fluentui-copilot/reac
|
|
|
10
10
|
*
|
|
11
11
|
* @param props - props from this instance of GhostText
|
|
12
12
|
* @param ref - reference to root HTMLElement of GhostText
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
return state;
|
|
13
|
+
*/ export const useGhostText_unstable = (props, ref)=>{
|
|
14
|
+
const { nodeKey, onClick, ...rest } = props;
|
|
15
|
+
const [editor] = useLexicalComposerContext();
|
|
16
|
+
const handleClick = React.useCallback((_ev)=>{
|
|
17
|
+
if (!nodeKey) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
editor.update(()=>{
|
|
21
|
+
var _node_getPreviousSibling;
|
|
22
|
+
const node = $getNodeByKey(nodeKey);
|
|
23
|
+
node === null || node === void 0 ? void 0 : (_node_getPreviousSibling = node.getPreviousSibling()) === null || _node_getPreviousSibling === void 0 ? void 0 : _node_getPreviousSibling.selectEnd();
|
|
24
|
+
}, {
|
|
25
|
+
tag: 'historic'
|
|
26
|
+
});
|
|
27
|
+
}, [
|
|
28
|
+
editor,
|
|
29
|
+
nodeKey
|
|
30
|
+
]);
|
|
31
|
+
const mergedOnClick = mergeCallbacks(handleClick, onClick);
|
|
32
|
+
const state = {
|
|
33
|
+
components: {
|
|
34
|
+
root: 'span',
|
|
35
|
+
indicator: 'span'
|
|
36
|
+
},
|
|
37
|
+
root: slot.always(getIntrinsicElementProps('span', {
|
|
38
|
+
ref,
|
|
39
|
+
onClick: mergedOnClick,
|
|
40
|
+
...rest
|
|
41
|
+
}), {
|
|
42
|
+
elementType: 'span'
|
|
43
|
+
}),
|
|
44
|
+
indicator: slot.optional(props.indicator, {
|
|
45
|
+
elementType: 'span'
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
return state;
|
|
51
49
|
};
|
|
52
|
-
//# sourceMappingURL=useGhostText.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const ghostTextClassNames = {
|
|
4
|
+
root: 'fai-GhostText',
|
|
5
|
+
indicator: 'fai-GhostText__indicator'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Styles for the root slot
|
|
9
|
+
*/ const useStyles = makeStyles({
|
|
10
|
+
root: {
|
|
11
|
+
color: tokens.colorNeutralForeground4,
|
|
12
|
+
whiteSpace: 'pre-wrap',
|
|
13
|
+
gap: tokens.spacingHorizontalXS
|
|
14
|
+
},
|
|
15
|
+
indicator: {
|
|
16
|
+
...typographyStyles.caption2Strong,
|
|
17
|
+
color: tokens.colorNeutralForeground3,
|
|
18
|
+
backgroundColor: tokens.colorNeutralBackground5,
|
|
19
|
+
padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,
|
|
20
|
+
borderRadius: tokens.borderRadiusSmall,
|
|
21
|
+
marginLeft: tokens.spacingHorizontalXS,
|
|
22
|
+
merginRight: tokens.spacingHorizontalXS
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Apply styling to the GhostText slots based on the state
|
|
27
|
+
*/ export const useGhostTextStyles_unstable = (state)=>{
|
|
28
|
+
'use no memo';
|
|
29
|
+
const styles = useStyles();
|
|
30
|
+
state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);
|
|
31
|
+
if (state.indicator) {
|
|
32
|
+
state.indicator.className = mergeClasses(ghostTextClassNames.indicator, styles.indicator, state.indicator.className);
|
|
33
|
+
}
|
|
34
|
+
return state;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { GhostTextSlots, GhostTextState } from './GhostText.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const ghostTextClassNames: SlotClassNames<GhostTextSlots> = {\n root: 'fai-GhostText',\n indicator: 'fai-GhostText__indicator',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n color: tokens.colorNeutralForeground4,\n whiteSpace: 'pre-wrap',\n gap: tokens.spacingHorizontalXS,\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n padding: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalSNudge}`,\n borderRadius: tokens.borderRadiusSmall,\n marginLeft: tokens.spacingHorizontalXS,\n merginRight: tokens.spacingHorizontalXS,\n },\n});\n\n/**\n * Apply styling to the GhostText slots based on the state\n */\nexport const useGhostTextStyles_unstable = (state: GhostTextState): GhostTextState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);\n\n if (state.indicator) {\n state.indicator.className = mergeClasses(\n ghostTextClassNames.indicator,\n styles.indicator,\n state.indicator.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","typographyStyles","tokens","ghostTextClassNames","root","indicator","useStyles","color","colorNeutralForeground4","whiteSpace","gap","spacingHorizontalXS","caption2Strong","colorNeutralForeground3","backgroundColor","colorNeutralBackground5","padding","spacingVerticalNone","spacingHorizontalSNudge","borderRadius","borderRadiusSmall","marginLeft","merginRight","useGhostTextStyles_unstable","state","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,gBAAgB,QAAQ,6BAA6B;AACxF,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BK,MAAM;QACJG,OAAOL,OAAOM,uBAAuB;QACrCC,YAAY;QACZC,KAAKR,OAAOS,mBAAmB;IACjC;IAEAN,WAAW;QACT,GAAGJ,iBAAiBW,cAAc;QAClCL,OAAOL,OAAOW,uBAAuB;QACrCC,iBAAiBZ,OAAOa,uBAAuB;QAC/CC,SAAS,CAAC,EAAEd,OAAOe,mBAAmB,CAAC,CAAC,EAAEf,OAAOgB,uBAAuB,CAAC,CAAC;QAC1EC,cAAcjB,OAAOkB,iBAAiB;QACtCC,YAAYnB,OAAOS,mBAAmB;QACtCW,aAAapB,OAAOS,mBAAmB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMY,8BAA8B,CAACC;IAC1C;IAEA,MAAMC,SAASnB;IACfkB,MAAMpB,IAAI,CAACsB,SAAS,GAAG1B,aAAaG,oBAAoBC,IAAI,EAAEqB,OAAOrB,IAAI,EAAEoB,MAAMpB,IAAI,CAACsB,SAAS;IAE/F,IAAIF,MAAMnB,SAAS,EAAE;QACnBmB,MAAMnB,SAAS,CAACqB,SAAS,GAAG1B,aAC1BG,oBAAoBE,SAAS,EAC7BoB,OAAOpB,SAAS,EAChBmB,MAAMnB,SAAS,CAACqB,SAAS;IAE7B;IAEA,OAAOF;AACT,EAAE"}
|
package/lib/index.js
CHANGED
|
@@ -4,4 +4,3 @@ export { ChatInputToken, ChatInputTokenNode, chatInputTokenClassNames, renderCha
|
|
|
4
4
|
export { BasicFunctionalityPlugin } from './BasicFunctionality';
|
|
5
5
|
export { ImperativeControlPlugin } from './ImperativeControl';
|
|
6
6
|
export { PasteUnfurlingPlugin } from './PasteUnfurling';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -2,55 +2,71 @@ import * as React from 'react';
|
|
|
2
2
|
import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
3
3
|
import { useIsomorphicLayoutEffect } from '@fluentui/react-components';
|
|
4
4
|
import { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';
|
|
5
|
-
export const BasicFunctionalityPlugin = React.forwardRef((props, ref)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
5
|
+
export const BasicFunctionalityPlugin = React.forwardRef((props, ref)=>{
|
|
6
|
+
const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;
|
|
7
|
+
const [editor] = useLexicalComposerContext();
|
|
8
|
+
const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState(null);
|
|
9
|
+
useIsomorphicLayoutEffect(()=>{
|
|
10
|
+
setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));
|
|
11
|
+
return ()=>{
|
|
12
|
+
setBasicFunctionalityImpl((prev)=>{
|
|
13
|
+
prev === null || prev === void 0 ? void 0 : prev.cleanup();
|
|
14
|
+
return null;
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
}, [
|
|
18
|
+
editor,
|
|
19
|
+
isSentinelNodeEnabled
|
|
20
|
+
]);
|
|
21
|
+
React.useImperativeHandle(ref, ()=>({
|
|
22
|
+
setIsDisabled (isDisabled) {
|
|
23
|
+
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.setIsDisabled(isDisabled);
|
|
24
|
+
}
|
|
25
|
+
}), [
|
|
26
|
+
basicFunctionalityImpl
|
|
27
|
+
]);
|
|
28
|
+
const setDefaultValue = React.useRef(false);
|
|
29
|
+
// useIsomorphicLayoutEffect is used to avoid flickering on first render
|
|
30
|
+
useIsomorphicLayoutEffect(()=>{
|
|
31
|
+
if (basicFunctionalityImpl && !setDefaultValue.current) {
|
|
32
|
+
if (defaultValue) {
|
|
33
|
+
basicFunctionalityImpl.insertDefaultValue(defaultValue);
|
|
34
|
+
}
|
|
35
|
+
setDefaultValue.current = true;
|
|
36
|
+
}
|
|
37
|
+
}, [
|
|
38
|
+
basicFunctionalityImpl,
|
|
39
|
+
defaultValue,
|
|
40
|
+
editor
|
|
41
|
+
]);
|
|
42
|
+
React.useEffect(()=>{
|
|
43
|
+
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.activateContentCallbacks(onContentChange, onCountChanged);
|
|
44
|
+
return ()=>basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.deactivateContentCallbacks();
|
|
45
|
+
}, [
|
|
46
|
+
basicFunctionalityImpl,
|
|
47
|
+
editor,
|
|
48
|
+
onContentChange,
|
|
49
|
+
onCountChanged
|
|
50
|
+
]);
|
|
51
|
+
React.useEffect(()=>{
|
|
52
|
+
if (onPaste) {
|
|
53
|
+
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.activatePasteCallback(onPaste);
|
|
54
|
+
}
|
|
55
|
+
return ()=>basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.deactivatePasteCallback();
|
|
56
|
+
}, [
|
|
57
|
+
basicFunctionalityImpl,
|
|
58
|
+
editor,
|
|
59
|
+
onPaste
|
|
60
|
+
]);
|
|
61
|
+
React.useEffect(()=>{
|
|
62
|
+
if (trimWhitespace) {
|
|
63
|
+
basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.activateTrimWhitespace();
|
|
64
|
+
}
|
|
65
|
+
return ()=>basicFunctionalityImpl === null || basicFunctionalityImpl === void 0 ? void 0 : basicFunctionalityImpl.deactivateTrimWhitespace();
|
|
66
|
+
}, [
|
|
67
|
+
basicFunctionalityImpl,
|
|
68
|
+
editor,
|
|
69
|
+
trimWhitespace
|
|
70
|
+
]);
|
|
71
|
+
return null;
|
|
55
72
|
});
|
|
56
|
-
//# sourceMappingURL=BasicFunctionality.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (
|
|
1
|
+
{"version":3,"sources":["BasicFunctionality.ts"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport type { IBasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\nimport { BasicFunctionalityBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type BasicFunctionalityPluginProps = {\n defaultValue?: string;\n // Whether or not to clear the input when only whitespace is remaining\n trimWhitespace?: boolean;\n onCountChanged?: (count: number) => void;\n onContentChange?: (value: string) => void;\n onPaste?: (event: ClipboardEvent) => void;\n isSentinelNodeEnabled?: boolean;\n};\n\nexport type BasicFunctionalityPluginRef = {\n setIsDisabled: (isDisabled: boolean) => void;\n};\n\nexport const BasicFunctionalityPlugin = React.forwardRef<BasicFunctionalityPluginRef, BasicFunctionalityPluginProps>(\n (props, ref) => {\n const { defaultValue, trimWhitespace, onCountChanged, onContentChange, onPaste, isSentinelNodeEnabled } = props;\n\n const [editor] = useLexicalComposerContext();\n\n const [basicFunctionalityImpl, setBasicFunctionalityImpl] = React.useState<IBasicFunctionalityBase | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n setBasicFunctionalityImpl(new BasicFunctionalityBase(editor, isSentinelNodeEnabled));\n\n return () => {\n setBasicFunctionalityImpl(prev => {\n prev?.cleanup();\n return null;\n });\n };\n }, [editor, isSentinelNodeEnabled]);\n\n React.useImperativeHandle<BasicFunctionalityPluginRef, BasicFunctionalityPluginRef>(\n ref,\n () => ({\n setIsDisabled(isDisabled: boolean) {\n basicFunctionalityImpl?.setIsDisabled(isDisabled);\n },\n }),\n [basicFunctionalityImpl],\n );\n\n const setDefaultValue = React.useRef(false);\n // useIsomorphicLayoutEffect is used to avoid flickering on first render\n useIsomorphicLayoutEffect(() => {\n if (basicFunctionalityImpl && !setDefaultValue.current) {\n if (defaultValue) {\n basicFunctionalityImpl.insertDefaultValue(defaultValue);\n }\n setDefaultValue.current = true;\n }\n }, [basicFunctionalityImpl, defaultValue, editor]);\n\n React.useEffect(() => {\n basicFunctionalityImpl?.activateContentCallbacks(onContentChange, onCountChanged);\n return () => basicFunctionalityImpl?.deactivateContentCallbacks();\n }, [basicFunctionalityImpl, editor, onContentChange, onCountChanged]);\n\n React.useEffect(() => {\n if (onPaste) {\n basicFunctionalityImpl?.activatePasteCallback(onPaste);\n }\n return () => basicFunctionalityImpl?.deactivatePasteCallback();\n }, [basicFunctionalityImpl, editor, onPaste]);\n\n React.useEffect(() => {\n if (trimWhitespace) {\n basicFunctionalityImpl?.activateTrimWhitespace();\n }\n return () => basicFunctionalityImpl?.deactivateTrimWhitespace();\n }, [basicFunctionalityImpl, editor, trimWhitespace]);\n\n return null;\n },\n);\n"],"names":["React","useLexicalComposerContext","useIsomorphicLayoutEffect","BasicFunctionalityBase","BasicFunctionalityPlugin","forwardRef","props","ref","defaultValue","trimWhitespace","onCountChanged","onContentChange","onPaste","isSentinelNodeEnabled","editor","basicFunctionalityImpl","setBasicFunctionalityImpl","useState","prev","cleanup","useImperativeHandle","setIsDisabled","isDisabled","setDefaultValue","useRef","current","insertDefaultValue","useEffect","activateContentCallbacks","deactivateContentCallbacks","activatePasteCallback","deactivatePasteCallback","activateTrimWhitespace","deactivateTrimWhitespace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,SAASC,yBAAyB,QAAQ,6BAA6B;AAEvE,SAASC,sBAAsB,QAAQ,uCAAuC;AAgB9E,OAAO,MAAMC,2BAA2BJ,MAAMK,UAAU,CACtD,CAACC,OAAOC;IACN,MAAM,EAAEC,YAAY,EAAEC,cAAc,EAAEC,cAAc,EAAEC,eAAe,EAAEC,OAAO,EAAEC,qBAAqB,EAAE,GAAGP;IAE1G,MAAM,CAACQ,OAAO,GAAGb;IAEjB,MAAM,CAACc,wBAAwBC,0BAA0B,GAAGhB,MAAMiB,QAAQ,CAAiC;IAE3Gf,0BAA0B;QACxBc,0BAA0B,IAAIb,uBAAuBW,QAAQD;QAE7D,OAAO;YACLG,0BAA0BE,CAAAA;gBACxBA,iBAAAA,2BAAAA,KAAMC,OAAO;gBACb,OAAO;YACT;QACF;IACF,GAAG;QAACL;QAAQD;KAAsB;IAElCb,MAAMoB,mBAAmB,CACvBb,KACA,IAAO,CAAA;YACLc,eAAcC,UAAmB;gBAC/BP,mCAAAA,6CAAAA,uBAAwBM,aAAa,CAACC;YACxC;QACF,CAAA,GACA;QAACP;KAAuB;IAG1B,MAAMQ,kBAAkBvB,MAAMwB,MAAM,CAAC;IACrC,wEAAwE;IACxEtB,0BAA0B;QACxB,IAAIa,0BAA0B,CAACQ,gBAAgBE,OAAO,EAAE;YACtD,IAAIjB,cAAc;gBAChBO,uBAAuBW,kBAAkB,CAAClB;YAC5C;YACAe,gBAAgBE,OAAO,GAAG;QAC5B;IACF,GAAG;QAACV;QAAwBP;QAAcM;KAAO;IAEjDd,MAAM2B,SAAS,CAAC;QACdZ,mCAAAA,6CAAAA,uBAAwBa,wBAAwB,CAACjB,iBAAiBD;QAClE,OAAO,IAAMK,mCAAAA,6CAAAA,uBAAwBc,0BAA0B;IACjE,GAAG;QAACd;QAAwBD;QAAQH;QAAiBD;KAAe;IAEpEV,MAAM2B,SAAS,CAAC;QACd,IAAIf,SAAS;YACXG,mCAAAA,6CAAAA,uBAAwBe,qBAAqB,CAAClB;QAChD;QACA,OAAO,IAAMG,mCAAAA,6CAAAA,uBAAwBgB,uBAAuB;IAC9D,GAAG;QAAChB;QAAwBD;QAAQF;KAAQ;IAE5CZ,MAAM2B,SAAS,CAAC;QACd,IAAIlB,gBAAgB;YAClBM,mCAAAA,6CAAAA,uBAAwBiB,sBAAsB;QAChD;QACA,OAAO,IAAMjB,mCAAAA,6CAAAA,uBAAwBkB,wBAAwB;IAC/D,GAAG;QAAClB;QAAwBD;QAAQL;KAAe;IAEnD,OAAO;AACT,GACA"}
|
|
@@ -3,77 +3,76 @@ import * as React from 'react';
|
|
|
3
3
|
import { DecoratorNode } from '@fluentui-copilot/text-editor';
|
|
4
4
|
import { ChatInputEntity } from '../../ChatInputEntity';
|
|
5
5
|
export class ChatInputEntityNode extends DecoratorNode {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
6
|
+
static getType() {
|
|
7
|
+
return 'entity';
|
|
8
|
+
}
|
|
9
|
+
static clone(node) {
|
|
10
|
+
return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);
|
|
11
|
+
}
|
|
12
|
+
static importJSON(serializedNode) {
|
|
13
|
+
return $createChatInputEntityNode(serializedNode.pluginId, serializedNode.text, serializedNode.data, serializedNode.entityProps);
|
|
14
|
+
}
|
|
15
|
+
isIsolated() {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
isInline() {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
getTextContent() {
|
|
22
|
+
return this.__text;
|
|
23
|
+
}
|
|
24
|
+
exportJSON() {
|
|
25
|
+
return {
|
|
26
|
+
pluginId: this.__pluginId,
|
|
27
|
+
text: this.__text,
|
|
28
|
+
data: this.__data,
|
|
29
|
+
entityProps: this.__entityProps,
|
|
30
|
+
type: ChatInputEntityNode.getType(),
|
|
31
|
+
version: 1
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
createDOM() {
|
|
35
|
+
// eslint-disable-next-line no-restricted-globals
|
|
36
|
+
return document.createElement('span');
|
|
37
|
+
}
|
|
38
|
+
updateDOM() {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
decorate(_editor, config) {
|
|
42
|
+
var _this___entityProps;
|
|
43
|
+
if ((_this___entityProps = this.__entityProps) === null || _this___entityProps === void 0 ? void 0 : _this___entityProps.children) {
|
|
44
|
+
return /*#__PURE__*/ React.createElement(ChatInputEntity, this.__entityProps);
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/ React.createElement(ChatInputEntity, this.__entityProps, this.__text);
|
|
47
|
+
}
|
|
48
|
+
getEntityData() {
|
|
49
|
+
return {
|
|
50
|
+
text: this.__text,
|
|
51
|
+
data: this.__data,
|
|
52
|
+
entityProps: this.__entityProps
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
updateEntityData(data) {
|
|
56
|
+
const writable = this.getWritable();
|
|
57
|
+
writable.__text = data.text;
|
|
58
|
+
writable.__data = data.data;
|
|
59
|
+
writable.__entityProps = data.entityProps;
|
|
60
|
+
}
|
|
61
|
+
constructor(pluginId, text, data, entityProps, key){
|
|
62
|
+
super(key);
|
|
63
|
+
_define_property(this, "__pluginId", void 0);
|
|
64
|
+
_define_property(this, "__text", void 0);
|
|
65
|
+
_define_property(this, "__entityProps", void 0);
|
|
66
|
+
_define_property(this, "__data", void 0);
|
|
67
|
+
this.__pluginId = pluginId;
|
|
68
|
+
this.__text = text;
|
|
69
|
+
this.__data = data;
|
|
70
|
+
this.__entityProps = entityProps;
|
|
45
71
|
}
|
|
46
|
-
return /*#__PURE__*/React.createElement(ChatInputEntity, this.__entityProps, this.__text);
|
|
47
|
-
}
|
|
48
|
-
getEntityData() {
|
|
49
|
-
return {
|
|
50
|
-
text: this.__text,
|
|
51
|
-
data: this.__data,
|
|
52
|
-
entityProps: this.__entityProps
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
updateEntityData(data) {
|
|
56
|
-
const writable = this.getWritable();
|
|
57
|
-
writable.__text = data.text;
|
|
58
|
-
writable.__data = data.data;
|
|
59
|
-
writable.__entityProps = data.entityProps;
|
|
60
|
-
}
|
|
61
|
-
constructor(pluginId, text, data, entityProps, key) {
|
|
62
|
-
super(key);
|
|
63
|
-
_define_property(this, "__pluginId", void 0);
|
|
64
|
-
_define_property(this, "__text", void 0);
|
|
65
|
-
_define_property(this, "__entityProps", void 0);
|
|
66
|
-
_define_property(this, "__data", void 0);
|
|
67
|
-
this.__pluginId = pluginId;
|
|
68
|
-
this.__text = text;
|
|
69
|
-
this.__data = data;
|
|
70
|
-
this.__entityProps = entityProps;
|
|
71
|
-
}
|
|
72
72
|
}
|
|
73
73
|
export function $createChatInputEntityNode(pluginId, text, data, entityProps, key) {
|
|
74
|
-
|
|
74
|
+
return new ChatInputEntityNode(pluginId, text, data, entityProps, key);
|
|
75
75
|
}
|
|
76
76
|
export function $isChatInputEntityNode(node) {
|
|
77
|
-
|
|
77
|
+
return node instanceof ChatInputEntityNode;
|
|
78
78
|
}
|
|
79
|
-
//# sourceMappingURL=ChatInputEntity.node.js.map
|
|
@@ -2,42 +2,41 @@ import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { $createChatInputEntityNode, $isChatInputEntityNode, ChatInputEntityNode } from './ChatInputEntity.node';
|
|
4
4
|
import { ChatInputEntityPluginBase } from '@fluentui-copilot/chat-input-plugins';
|
|
5
|
-
export const ChatInputEntityPlugin = props
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
5
|
+
export const ChatInputEntityPlugin = (props)=>{
|
|
6
|
+
const { id, controlRef, onChatInputEntityAdded, onChatInputEntityDeleted, skipInitialization } = props;
|
|
7
|
+
const [editor] = useLexicalComposerContext();
|
|
8
|
+
const chatInputEntityPluginBase = React.useRef(null);
|
|
9
|
+
React.useEffect(()=>{
|
|
10
|
+
chatInputEntityPluginBase.current = new ChatInputEntityPluginBase(editor, id, ChatInputEntityNode, $createChatInputEntityNode, $isChatInputEntityNode, onChatInputEntityAdded, onChatInputEntityDeleted);
|
|
11
|
+
return ()=>{
|
|
12
|
+
var _chatInputEntityPluginBase_current;
|
|
13
|
+
return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.cleanup();
|
|
14
|
+
};
|
|
15
|
+
}, [
|
|
16
|
+
editor,
|
|
17
|
+
id,
|
|
18
|
+
onChatInputEntityAdded,
|
|
19
|
+
onChatInputEntityDeleted,
|
|
20
|
+
skipInitialization
|
|
21
|
+
]);
|
|
22
|
+
React.useImperativeHandle(controlRef, ()=>({
|
|
23
|
+
insertChatInputEntity (props) {
|
|
24
|
+
var _chatInputEntityPluginBase_current;
|
|
25
|
+
return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.insertChatInputEntity(props);
|
|
26
|
+
},
|
|
27
|
+
getActiveEntities () {
|
|
28
|
+
var _chatInputEntityPluginBase_current;
|
|
29
|
+
var _chatInputEntityPluginBase_current_getActiveEntities;
|
|
30
|
+
return (_chatInputEntityPluginBase_current_getActiveEntities = (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.getActiveEntities()) !== null && _chatInputEntityPluginBase_current_getActiveEntities !== void 0 ? _chatInputEntityPluginBase_current_getActiveEntities : [];
|
|
31
|
+
},
|
|
32
|
+
removeChatInputEntity (keyOrPredicate) {
|
|
33
|
+
var _chatInputEntityPluginBase_current;
|
|
34
|
+
(_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.removeChatInputEntity(keyOrPredicate);
|
|
35
|
+
},
|
|
36
|
+
updateChatInputEntityProps (keyOrPredicate, props) {
|
|
37
|
+
var _chatInputEntityPluginBase_current;
|
|
38
|
+
(_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.updateChatInputEntityProps(keyOrPredicate, props);
|
|
39
|
+
}
|
|
40
|
+
}), []);
|
|
41
|
+
return null;
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=ChatInputEntityPlugin.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=ChatInputEntityPlugin.types.js.map
|
|
1
|
+
export { };
|
|
@@ -4,41 +4,47 @@ import { $createGhostTextNode } from '../../GhostText';
|
|
|
4
4
|
import { GhostTextNode } from './GhostText.node';
|
|
5
5
|
import { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';
|
|
6
6
|
export function GhostTextPlugin(props) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
7
|
+
'use no memo';
|
|
8
|
+
const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;
|
|
9
|
+
const [editor] = useLexicalComposerContext();
|
|
10
|
+
const [ghostTextBase, setGhostTextBase] = React.useState(null);
|
|
11
|
+
React.useEffect(()=>{
|
|
12
|
+
setGhostTextBase(new GhostTextPluginBase(editor, id, $getGhostText, GhostTextNode, $createGhostTextNode, ghostTextProps, exposeText, allowCompletion));
|
|
13
|
+
return ()=>{
|
|
14
|
+
setGhostTextBase((prev)=>{
|
|
15
|
+
prev === null || prev === void 0 ? void 0 : prev.cleanup();
|
|
16
|
+
return null;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}, // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting
|
|
20
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
+
[
|
|
22
|
+
editor,
|
|
23
|
+
id
|
|
24
|
+
]);
|
|
25
|
+
React.useEffect(()=>{
|
|
26
|
+
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setAllowCompletion(allowCompletion);
|
|
27
|
+
}, [
|
|
28
|
+
allowCompletion,
|
|
29
|
+
ghostTextBase
|
|
30
|
+
]);
|
|
31
|
+
React.useEffect(()=>{
|
|
32
|
+
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setComponentProps(ghostTextProps);
|
|
33
|
+
}, [
|
|
34
|
+
ghostTextBase,
|
|
35
|
+
ghostTextProps
|
|
36
|
+
]);
|
|
37
|
+
React.useEffect(()=>{
|
|
38
|
+
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setExposeText(exposeText);
|
|
39
|
+
}, [
|
|
40
|
+
exposeText,
|
|
41
|
+
ghostTextBase
|
|
42
|
+
]);
|
|
43
|
+
React.useEffect(()=>{
|
|
44
|
+
ghostTextBase === null || ghostTextBase === void 0 ? void 0 : ghostTextBase.setGetGhostText($getGhostText);
|
|
45
|
+
}, [
|
|
46
|
+
$getGhostText,
|
|
47
|
+
ghostTextBase
|
|
48
|
+
]);
|
|
49
|
+
return null;
|
|
43
50
|
}
|
|
44
|
-
//# sourceMappingURL=GhostText.js.map
|