@fluentui-copilot/react-editor-input 0.5.6 → 0.6.0
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 +57 -1
- package/CHANGELOG.md +23 -2
- package/dist/index.d.ts +20 -5
- package/lib/EditorInput.js +1 -1
- package/lib/EditorInput.js.map +1 -1
- package/lib/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -1
- package/lib/components/EditorInput/EditorInput.js +3 -1
- package/lib/components/EditorInput/EditorInput.js.map +1 -1
- package/lib/components/EditorInput/EditorInput.types.js +1 -3
- package/lib/components/EditorInput/EditorInput.types.js.map +1 -1
- package/lib/components/EditorInput/index.js +1 -0
- package/lib/components/EditorInput/index.js.map +1 -1
- package/lib/components/EditorInput/renderEditorInput.js +10 -9
- package/lib/components/EditorInput/renderEditorInput.js.map +1 -1
- package/lib/components/EditorInput/useEditorInput.js +18 -63
- package/lib/components/EditorInput/useEditorInput.js.map +1 -1
- package/lib/components/EditorInput/useEditorInputContextValues.js +16 -0
- package/lib/components/EditorInput/useEditorInputContextValues.js.map +1 -0
- package/lib/components/EditorInput/useEditorInputStyles.styles.js +0 -7
- package/lib/components/EditorInput/useEditorInputStyles.styles.js.map +1 -1
- package/lib/components/EditorInput/useEditorInputStyles.styles.raw.js +0 -7
- package/lib/components/EditorInput/useEditorInputStyles.styles.raw.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utilities/useCanShowPlaceholder.js +18 -0
- package/lib/utilities/useCanShowPlaceholder.js.map +1 -0
- package/lib/utilities/useLexicalContentEditable.js +69 -0
- package/lib/utilities/useLexicalContentEditable.js.map +1 -0
- package/lib/utilities/useLexicalEditor.js +63 -0
- package/lib/utilities/useLexicalEditor.js.map +1 -0
- package/lib-commonjs/EditorInput.js +3 -0
- package/lib-commonjs/EditorInput.js.map +1 -1
- package/lib-commonjs/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -1
- package/lib-commonjs/components/EditorInput/EditorInput.js +3 -1
- package/lib-commonjs/components/EditorInput/EditorInput.js.map +1 -1
- package/lib-commonjs/components/EditorInput/EditorInput.types.js +1 -3
- package/lib-commonjs/components/EditorInput/EditorInput.types.js.map +1 -1
- package/lib-commonjs/components/EditorInput/index.js +4 -0
- package/lib-commonjs/components/EditorInput/index.js.map +1 -1
- package/lib-commonjs/components/EditorInput/renderEditorInput.js +9 -8
- package/lib-commonjs/components/EditorInput/renderEditorInput.js.map +1 -1
- package/lib-commonjs/components/EditorInput/useEditorInput.js +14 -58
- package/lib-commonjs/components/EditorInput/useEditorInput.js.map +1 -1
- package/lib-commonjs/components/EditorInput/useEditorInputContextValues.js +27 -0
- package/lib-commonjs/components/EditorInput/useEditorInputContextValues.js.map +1 -0
- package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.js +0 -7
- package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.js.map +1 -1
- package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.raw.js +0 -7
- package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/index.js +12 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/useCanShowPlaceholder.js +29 -0
- package/lib-commonjs/utilities/useCanShowPlaceholder.js.map +1 -0
- package/lib-commonjs/utilities/useLexicalContentEditable.js +80 -0
- package/lib-commonjs/utilities/useLexicalContentEditable.js.map +1 -0
- package/lib-commonjs/utilities/useLexicalEditor.js +72 -0
- package/lib-commonjs/utilities/useLexicalEditor.js.map +1 -0
- package/package.json +13 -13
|
@@ -85,13 +85,6 @@ const useEditorInputStyles_unstable = (state)=>{
|
|
|
85
85
|
const styles = useStyles();
|
|
86
86
|
state.root.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.root, rootClassName, state.root.className);
|
|
87
87
|
state.input.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.input, inputClassName, state.input.className);
|
|
88
|
-
state.lexicalInitialConfig = {
|
|
89
|
-
...state.lexicalInitialConfig,
|
|
90
|
-
theme: {
|
|
91
|
-
...useLexicalStyles(),
|
|
92
|
-
...state.lexicalInitialConfig.theme
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
88
|
if (state.placeholderValue) {
|
|
96
89
|
state.placeholderValue.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.placeholderValue, placeholderClassName, disabled && styles.placeholderDisabled, state.placeholderValue.className);
|
|
97
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useEditorInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport type { EditorInputSlots, EditorInputState } from './EditorInput.types';\n\nexport const editorInputClassNames: SlotClassNames<EditorInputSlots> = {\n root: 'fai-EditorInput',\n input: 'fai-EditorInput__input',\n placeholderValue: 'fai-EditorInput__placeholderValue',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n whiteSpace: 'pre-wrap',\n});\n\nexport const useLexicalStyles = makeStyles({\n paragraph: {\n margin: 0,\n textAlign: 'start',\n },\n});\n\nexport const usePlaceholderClassName = makeResetStyles({\n zIndex: 0,\n gridArea: '1 / 1 / 1 / 1',\n\n color: tokens.colorNeutralForeground4,\n ...typographyStyles.body1,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n});\n\nexport const useInputClassName = makeResetStyles({\n gridArea: '1 / 1 / 1 / 1',\n zIndex: 1,\n width: '100%',\n});\n\nconst useStyles = makeStyles({\n placeholderDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n});\n/**\n * Apply styling to the EditorInput slots based on the state\n */\nexport const useEditorInputStyles_unstable = (state: EditorInputState): EditorInputState => {\n 'use no memo';\n\n const { disabled } = state;\n const placeholderClassName = usePlaceholderClassName();\n const rootClassName = useRootClassName();\n const inputClassName = useInputClassName();\n const styles = useStyles();\n\n state.root.className = mergeClasses(editorInputClassNames.root, rootClassName, state.root.className);\n\n state.input.className = mergeClasses(editorInputClassNames.input, inputClassName, state.input.className);\n\n
|
|
1
|
+
{"version":3,"sources":["useEditorInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport type { EditorInputSlots, EditorInputState } from './EditorInput.types';\n\nexport const editorInputClassNames: SlotClassNames<EditorInputSlots> = {\n root: 'fai-EditorInput',\n input: 'fai-EditorInput__input',\n placeholderValue: 'fai-EditorInput__placeholderValue',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n whiteSpace: 'pre-wrap',\n});\n\nexport const useLexicalStyles = makeStyles({\n paragraph: {\n margin: 0,\n textAlign: 'start',\n },\n});\n\nexport const usePlaceholderClassName = makeResetStyles({\n zIndex: 0,\n gridArea: '1 / 1 / 1 / 1',\n\n color: tokens.colorNeutralForeground4,\n ...typographyStyles.body1,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n});\n\nexport const useInputClassName = makeResetStyles({\n gridArea: '1 / 1 / 1 / 1',\n zIndex: 1,\n width: '100%',\n});\n\nconst useStyles = makeStyles({\n placeholderDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n});\n/**\n * Apply styling to the EditorInput slots based on the state\n */\nexport const useEditorInputStyles_unstable = (state: EditorInputState): EditorInputState => {\n 'use no memo';\n\n const { disabled } = state;\n const placeholderClassName = usePlaceholderClassName();\n const rootClassName = useRootClassName();\n const inputClassName = useInputClassName();\n const styles = useStyles();\n\n state.root.className = mergeClasses(editorInputClassNames.root, rootClassName, state.root.className);\n\n state.input.className = mergeClasses(editorInputClassNames.input, inputClassName, state.input.className);\n\n if (state.placeholderValue) {\n state.placeholderValue.className = mergeClasses(\n editorInputClassNames.placeholderValue,\n placeholderClassName,\n disabled && styles.placeholderDisabled,\n state.placeholderValue.className,\n );\n }\n\n return state;\n};\n"],"names":["editorInputClassNames","useEditorInputStyles_unstable","gridArea","whiteSpace","color","root","input","placeholderValue","display","__resetStyles","__styles","paragraph","jrapky","margin","textAlign","B74szlk","fsow6f","s","zIndex","sj55zd","disabled","rootClassName","state","placeholderClassName","useStyles","useRootClassName","useInputClassName","className","mergeClasses","inputClassName","styles","placeholderDisabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,qBAAAA;eAAAA;;IA+CNC,6BAAMA;eAANA;;IAbLC,iBAAU;eAAVA;;IAvBAC,gBAAY;eAAZA;;IAkBEC,uBAAO;eAAPA;;;iCAlC8C;AAK3C,MAAMJ,wBAA0D;UACrEK;WACAC;sBACAC;AACF;AAEA;;CAEC,SAECC,mBAASC,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;AACTN,MAAAA,mBAAYO,IAAAA,yBAAA,EAAA;IACdC,WAAA;QAEAC,QAAO;QACLD,QAAAA;gBACEE;iBACAC;QACFC,SAAA;QACCC,QAAA;IAEH;;OAEEd;QAAAA;YAAAA;YAAU;gBAEVE,GAAAA,CAAAA;;SACA;QAAA;KAAyB;;MAGvBA,0BAAOK,IAAAA,8BAAA,EAAA,WAAA,MAAA;OACT;QAAA;KAAA;IACFQ,GAAG;QAAA;KAAA;AAEH;AACEf,MAAAA,oBAAUO,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MACVS,YAAQR,IAAAA,yBAAA,EAAA;yBACD;QACNS,QAAA;IAEH;;;;KAEgD;;AAMhD,MAAOlB,gCAAMA,CAAAA;;UAIX,EACAmB,QAAMC,KACNC;UACAC,uBAAeC;UAEfF,gBAAoBG;UAEpBH,iBAAqBI;UAEjBJ,SAAMf;UACRe,IAAAA,CAAAA,SAAMf,GAAAA,IAAAA,6BAAiBoB,EAAAA,sBACrB3B,IAAAA,EAAAA,eAAsBO,MAAAA,IAAAA,CAAAA,SACtBgB;UAIJjB,KAAA,CAAAqB,SAAA,GAAAC,IAAAA,6BAAA,EAAA5B,sBAAAM,KAAA,EAAAuB,gBAAAP,MAAAhB,KAAA,CAAAqB,SAAA;QAEAL,MAAOA,gBAAAA,EAAAA;QACPA,MAAAf,gBAAA,CAAAoB,SAAA,GAAAC,IAAAA,6BAAA,EAAA5B,sBAAAO,gBAAA,EAAAgB,sBAAAH,YAAAU,OAAAC,mBAAA,EAAAT,MAAAf,gBAAA,CAAAoB,SAAA"}
|
|
@@ -72,13 +72,6 @@ const useEditorInputStyles_unstable = (state)=>{
|
|
|
72
72
|
const styles = useStyles();
|
|
73
73
|
state.root.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.root, rootClassName, state.root.className);
|
|
74
74
|
state.input.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.input, inputClassName, state.input.className);
|
|
75
|
-
state.lexicalInitialConfig = {
|
|
76
|
-
...state.lexicalInitialConfig,
|
|
77
|
-
theme: {
|
|
78
|
-
...useLexicalStyles(),
|
|
79
|
-
...state.lexicalInitialConfig.theme
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
75
|
if (state.placeholderValue) {
|
|
83
76
|
state.placeholderValue.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.placeholderValue, placeholderClassName, disabled && styles.placeholderDisabled, state.placeholderValue.className);
|
|
84
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useEditorInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport type { EditorInputSlots, EditorInputState } from './EditorInput.types';\n\nexport const editorInputClassNames: SlotClassNames<EditorInputSlots> = {\n root: 'fai-EditorInput',\n input: 'fai-EditorInput__input',\n placeholderValue: 'fai-EditorInput__placeholderValue',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n whiteSpace: 'pre-wrap',\n});\n\nexport const useLexicalStyles = makeStyles({\n paragraph: {\n margin: 0,\n textAlign: 'start',\n },\n});\n\nexport const usePlaceholderClassName = makeResetStyles({\n zIndex: 0,\n gridArea: '1 / 1 / 1 / 1',\n\n color: tokens.colorNeutralForeground4,\n ...typographyStyles.body1,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n});\n\nexport const useInputClassName = makeResetStyles({\n gridArea: '1 / 1 / 1 / 1',\n zIndex: 1,\n width: '100%',\n});\n\nconst useStyles = makeStyles({\n placeholderDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n});\n/**\n * Apply styling to the EditorInput slots based on the state\n */\nexport const useEditorInputStyles_unstable = (state: EditorInputState): EditorInputState => {\n 'use no memo';\n\n const { disabled } = state;\n const placeholderClassName = usePlaceholderClassName();\n const rootClassName = useRootClassName();\n const inputClassName = useInputClassName();\n const styles = useStyles();\n\n state.root.className = mergeClasses(editorInputClassNames.root, rootClassName, state.root.className);\n\n state.input.className = mergeClasses(editorInputClassNames.input, inputClassName, state.input.className);\n\n
|
|
1
|
+
{"version":3,"sources":["useEditorInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens, typographyStyles } from '@fluentui-copilot/tokens';\nimport type { SlotClassNames } from '@fluentui/react-components';\nimport type { EditorInputSlots, EditorInputState } from './EditorInput.types';\n\nexport const editorInputClassNames: SlotClassNames<EditorInputSlots> = {\n root: 'fai-EditorInput',\n input: 'fai-EditorInput__input',\n placeholderValue: 'fai-EditorInput__placeholderValue',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootClassName = makeResetStyles({\n display: 'inline-grid',\n whiteSpace: 'pre-wrap',\n});\n\nexport const useLexicalStyles = makeStyles({\n paragraph: {\n margin: 0,\n textAlign: 'start',\n },\n});\n\nexport const usePlaceholderClassName = makeResetStyles({\n zIndex: 0,\n gridArea: '1 / 1 / 1 / 1',\n\n color: tokens.colorNeutralForeground4,\n ...typographyStyles.body1,\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n});\n\nexport const useInputClassName = makeResetStyles({\n gridArea: '1 / 1 / 1 / 1',\n zIndex: 1,\n width: '100%',\n});\n\nconst useStyles = makeStyles({\n placeholderDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n});\n/**\n * Apply styling to the EditorInput slots based on the state\n */\nexport const useEditorInputStyles_unstable = (state: EditorInputState): EditorInputState => {\n 'use no memo';\n\n const { disabled } = state;\n const placeholderClassName = usePlaceholderClassName();\n const rootClassName = useRootClassName();\n const inputClassName = useInputClassName();\n const styles = useStyles();\n\n state.root.className = mergeClasses(editorInputClassNames.root, rootClassName, state.root.className);\n\n state.input.className = mergeClasses(editorInputClassNames.input, inputClassName, state.input.className);\n\n if (state.placeholderValue) {\n state.placeholderValue.className = mergeClasses(\n editorInputClassNames.placeholderValue,\n placeholderClassName,\n disabled && styles.placeholderDisabled,\n state.placeholderValue.className,\n );\n }\n\n return state;\n};\n"],"names":["editorInputClassNames","useEditorInputStyles_unstable","useInputClassName","useLexicalStyles","usePlaceholderClassName","root","input","placeholderValue","useRootClassName","makeResetStyles","display","whiteSpace","makeStyles","paragraph","margin","textAlign","zIndex","gridArea","color","tokens","colorNeutralForeground4","typographyStyles","body1","width","useStyles","placeholderDisabled","colorNeutralForegroundDisabled","state","disabled","placeholderClassName","rootClassName","inputClassName","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,qBAAAA;eAAAA;;IA+CAC,6BAAAA;eAAAA;;IAdAC,iBAAAA;eAAAA;;IAnBAC,gBAAAA;eAAAA;;IAOAC,uBAAAA;eAAAA;;;iCA1B6C;wBACjB;AAIlC,MAAMJ,wBAA0D;IACrEK,MAAM;IACNC,OAAO;IACPC,kBAAkB;AACpB;AAEA;;CAEC,GACD,MAAMC,mBAAmBC,IAAAA,gCAAAA,EAAgB;IACvCC,SAAS;IACTC,YAAY;AACd;AAEO,MAAMR,mBAAmBS,IAAAA,2BAAAA,EAAW;IACzCC,WAAW;QACTC,QAAQ;QACRC,WAAW;IACb;AACF;AAEO,MAAMX,0BAA0BK,IAAAA,gCAAAA,EAAgB;IACrDO,QAAQ;IACRC,UAAU;IAEVC,OAAOC,cAAAA,CAAOC,uBAAuB;IACrC,GAAGC,wBAAAA,CAAiBC,KAAK;IAEzB,kCAAkC;QAChCJ,OAAO;IACT;AACF;AAEO,MAAMhB,oBAAoBO,IAAAA,gCAAAA,EAAgB;IAC/CQ,UAAU;IACVD,QAAQ;IACRO,OAAO;AACT;AAEA,MAAMC,YAAYZ,IAAAA,2BAAAA,EAAW;IAC3Ba,qBAAqB;QACnBP,OAAOC,cAAAA,CAAOO,8BAA8B;IAC9C;AACF;AAIO,MAAMzB,gCAAgC,CAAC0B;IAC5C;IAEA,MAAM,EAAEC,QAAQ,EAAE,GAAGD;IACrB,MAAME,uBAAuBzB;IAC7B,MAAM0B,gBAAgBtB;IACtB,MAAMuB,iBAAiB7B;IACvB,MAAM8B,SAASR;IAEfG,MAAMtB,IAAI,CAAC4B,SAAS,GAAGC,IAAAA,6BAAAA,EAAalC,sBAAsBK,IAAI,EAAEyB,eAAeH,MAAMtB,IAAI,CAAC4B,SAAS;IAEnGN,MAAMrB,KAAK,CAAC2B,SAAS,GAAGC,IAAAA,6BAAAA,EAAalC,sBAAsBM,KAAK,EAAEyB,gBAAgBJ,MAAMrB,KAAK,CAAC2B,SAAS;IAEvG,IAAIN,MAAMpB,gBAAgB,EAAE;QAC1BoB,MAAMpB,gBAAgB,CAAC0B,SAAS,GAAGC,IAAAA,6BAAAA,EACjClC,sBAAsBO,gBAAgB,EACtCsB,sBACAD,YAAYI,OAAOP,mBAAmB,EACtCE,MAAMpB,gBAAgB,CAAC0B,SAAS;IAEpC;IAEA,OAAON;AACT"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -33,11 +33,23 @@ _export(exports, {
|
|
|
33
33
|
useAnimatedPlaceholder_unstable: function() {
|
|
34
34
|
return _AnimatedPlaceholder.useAnimatedPlaceholder_unstable;
|
|
35
35
|
},
|
|
36
|
+
useEditorInputContextValues: function() {
|
|
37
|
+
return _EditorInput.useEditorInputContextValues;
|
|
38
|
+
},
|
|
36
39
|
useEditorInputStyles_unstable: function() {
|
|
37
40
|
return _EditorInput.useEditorInputStyles_unstable;
|
|
38
41
|
},
|
|
39
42
|
useEditorInput_unstable: function() {
|
|
40
43
|
return _EditorInput.useEditorInput_unstable;
|
|
44
|
+
},
|
|
45
|
+
useInputClassName: function() {
|
|
46
|
+
return _EditorInput.useInputClassName;
|
|
47
|
+
},
|
|
48
|
+
useLexicalStyles: function() {
|
|
49
|
+
return _EditorInput.useLexicalStyles;
|
|
50
|
+
},
|
|
51
|
+
usePlaceholderClassName: function() {
|
|
52
|
+
return _EditorInput.usePlaceholderClassName;
|
|
41
53
|
}
|
|
42
54
|
});
|
|
43
55
|
const _EditorInput = require("./EditorInput");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type {
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type {\n EditorInputContextValues,\n EditorInputProps,\n EditorInputSlots,\n EditorInputState,\n EditorInputValueData,\n} from './EditorInput';\nexport {\n EditorInput,\n editorInputClassNames,\n renderEditorInput_unstable,\n useEditorInputContextValues,\n useEditorInputStyles_unstable,\n useEditorInput_unstable,\n useInputClassName,\n useLexicalStyles,\n usePlaceholderClassName,\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","useEditorInputContextValues","useEditorInputStyles_unstable","useEditorInput_unstable","useInputClassName","useLexicalStyles","usePlaceholderClassName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAoBEA,mBAAmB;eAAnBA,wCAAmB;;IAZnBC,WAAW;eAAXA,wBAAW;;IAeXC,6BAA6B;eAA7BA,kDAA6B;;IAd7BC,qBAAqB;eAArBA,kCAAqB;;IAYrBC,kCAAkC;eAAlCA,uDAAkC;;IAXlCC,0BAA0B;eAA1BA,uCAA0B;;IAc1BC,qCAAqC;eAArCA,0DAAqC;;IAFrCC,+BAA+B;eAA/BA,oDAA+B;;IAX/BC,2BAA2B;eAA3BA,wCAA2B;;IAC3BC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IACvBC,iBAAiB;eAAjBA,8BAAiB;;IACjBC,gBAAgB;eAAhBA,6BAAgB;;IAChBC,uBAAuB;eAAvBA,oCAAuB;;;6BAClB;qCAQA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useCanShowPlaceholder", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useCanShowPlaceholder;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
14
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
15
|
+
function getCanShowPlaceholder(editor) {
|
|
16
|
+
return editor.getEditorState().read(()=>(0, _reacttexteditor.$canShowPlaceholder)(editor.isComposing()));
|
|
17
|
+
}
|
|
18
|
+
function useCanShowPlaceholder(editor) {
|
|
19
|
+
const [canShowPlaceholder, setCanShowPlaceholder] = _react.useState(()=>getCanShowPlaceholder(editor));
|
|
20
|
+
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
21
|
+
function updateCanShowPlaceholder() {
|
|
22
|
+
setCanShowPlaceholder(getCanShowPlaceholder(editor));
|
|
23
|
+
}
|
|
24
|
+
return (0, _reacttexteditor.mergeRegister)(editor.registerUpdateListener(updateCanShowPlaceholder), editor.registerEditableListener(updateCanShowPlaceholder));
|
|
25
|
+
}, [
|
|
26
|
+
editor
|
|
27
|
+
]);
|
|
28
|
+
return canShowPlaceholder;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useCanShowPlaceholder.ts"],"sourcesContent":["import * as React from 'react';\nimport type { LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $canShowPlaceholder, mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-components';\n\nfunction getCanShowPlaceholder(editor: LexicalEditor): boolean {\n return editor.getEditorState().read(() => $canShowPlaceholder(editor.isComposing()));\n}\n\nexport function useCanShowPlaceholder(editor: LexicalEditor): boolean {\n const [canShowPlaceholder, setCanShowPlaceholder] = React.useState(() => getCanShowPlaceholder(editor));\n\n useIsomorphicLayoutEffect(() => {\n function updateCanShowPlaceholder() {\n setCanShowPlaceholder(getCanShowPlaceholder(editor));\n }\n\n return mergeRegister(\n editor.registerUpdateListener(updateCanShowPlaceholder),\n editor.registerEditableListener(updateCanShowPlaceholder),\n );\n }, [editor]);\n\n return canShowPlaceholder;\n}\n"],"names":["useCanShowPlaceholder","getCanShowPlaceholder","editor","getEditorState","read","$canShowPlaceholder","isComposing","canShowPlaceholder","setCanShowPlaceholder","React","useState","useIsomorphicLayoutEffect","updateCanShowPlaceholder","mergeRegister","registerUpdateListener","registerEditableListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;;iEATO;iCAE4B;iCACT;AAE1C,SAASC,sBAAsBC,MAAqB;IAClD,OAAOA,OAAOC,cAAc,GAAGC,IAAI,CAAC,IAAMC,IAAAA,oCAAAA,EAAoBH,OAAOI,WAAW;AAClF;AAEO,SAASN,sBAAsBE,MAAqB;IACzD,MAAM,CAACK,oBAAoBC,sBAAsB,GAAGC,OAAMC,QAAQ,CAAC,IAAMT,sBAAsBC;IAE/FS,IAAAA,0CAAAA,EAA0B;QACxB,SAASC;YACPJ,sBAAsBP,sBAAsBC;QAC9C;QAEA,OAAOW,IAAAA,8BAAAA,EACLX,OAAOY,sBAAsB,CAACF,2BAC9BV,OAAOa,wBAAwB,CAACH;IAEpC,GAAG;QAACV;KAAO;IAEX,OAAOK;AACT"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useLexicalContentEditable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useLexicalContentEditable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
|
|
14
|
+
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
15
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
|
+
const _EditorInput = require("../EditorInput");
|
|
17
|
+
const _useLexicalEditor = require("./useLexicalEditor");
|
|
18
|
+
const _useCanShowPlaceholder = require("./useCanShowPlaceholder");
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
function useLexicalContentEditable(props) {
|
|
21
|
+
const { defaultValue, customTheme } = props;
|
|
22
|
+
const customNodes = props.customNodes ? [
|
|
23
|
+
...props.customNodes,
|
|
24
|
+
_chatinputplugins.SentinelNode
|
|
25
|
+
] : [
|
|
26
|
+
_chatinputplugins.SentinelNode
|
|
27
|
+
];
|
|
28
|
+
// The disabled state can also be changed by lexical (e.g. by a custom plugin) so
|
|
29
|
+
// we use `useControllableState` to coordinate
|
|
30
|
+
const [disabled, setDisabled] = (0, _reactutilities.useControllableState)({
|
|
31
|
+
state: props.disabled,
|
|
32
|
+
initialState: false
|
|
33
|
+
});
|
|
34
|
+
const lexicalStyles = (0, _EditorInput.useLexicalStyles)();
|
|
35
|
+
const paragraphClassName = (0, _reactcomponents.mergeClasses)(lexicalStyles.paragraph, customTheme === null || customTheme === void 0 ? void 0 : customTheme.paragraph);
|
|
36
|
+
const lexicalInitialConfig = {
|
|
37
|
+
namespace: 'fai-EditorInput',
|
|
38
|
+
onError: console.log,
|
|
39
|
+
nodes: customNodes,
|
|
40
|
+
editorState: defaultValue,
|
|
41
|
+
editable: !disabled,
|
|
42
|
+
theme: {
|
|
43
|
+
...customTheme,
|
|
44
|
+
paragraph: paragraphClassName.trim() === '' ? undefined : paragraphClassName
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const lexicalEditor = (0, _useLexicalEditor.useLexicalEditor)(lexicalInitialConfig);
|
|
48
|
+
const canShowPlaceholder = (0, _useCanShowPlaceholder.useCanShowPlaceholder)(lexicalEditor);
|
|
49
|
+
const spanRef = _react.useCallback((span)=>{
|
|
50
|
+
// Register the `input` span with lexical
|
|
51
|
+
lexicalEditor.setRootElement(span);
|
|
52
|
+
}, [
|
|
53
|
+
lexicalEditor
|
|
54
|
+
]);
|
|
55
|
+
// Update lexical when disabled changes
|
|
56
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
57
|
+
lexicalEditor.setEditable(!disabled);
|
|
58
|
+
}, [
|
|
59
|
+
lexicalEditor
|
|
60
|
+
]);
|
|
61
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
62
|
+
return (0, _reacttexteditor.mergeRegister)(lexicalEditor.registerEditableListener((isEditable)=>{
|
|
63
|
+
setDisabled(!isEditable);
|
|
64
|
+
}), lexicalEditor.registerRootListener((root)=>{
|
|
65
|
+
if (!root) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// Remove lexical's inline style so we can apply our own
|
|
69
|
+
// Lexical needs the whitespace style to be either `pre` or `pre-wrap` to work correctly
|
|
70
|
+
root.style.whiteSpace = '';
|
|
71
|
+
}));
|
|
72
|
+
}, []);
|
|
73
|
+
return {
|
|
74
|
+
canShowPlaceholder,
|
|
75
|
+
disabled,
|
|
76
|
+
spanRef,
|
|
77
|
+
lexicalEditor,
|
|
78
|
+
lexicalInitialConfig
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useLexicalContentEditable.ts"],"sourcesContent":["import * as React from 'react';\nimport { SentinelNode } from '@fluentui-copilot/chat-input-plugins';\nimport type { InitialConfigType, LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { mergeRegister } from '@fluentui-copilot/react-text-editor';\nimport { useControllableState, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport type { EditorInputProps } from '../EditorInput';\nimport { useLexicalStyles } from '../EditorInput';\nimport { useLexicalEditor } from './useLexicalEditor';\nimport { useCanShowPlaceholder } from './useCanShowPlaceholder';\nimport { mergeClasses } from '@fluentui/react-components';\n\nexport type UseLexicalContentEditableProps = Pick<EditorInputProps, 'customNodes' | 'disabled' | 'customTheme'> & {\n defaultValue?: () => void;\n};\nexport type UseLexicalContentEditableResult = {\n canShowPlaceholder: boolean;\n disabled: boolean;\n spanRef: React.Ref<HTMLSpanElement>;\n lexicalEditor: LexicalEditor;\n lexicalInitialConfig: InitialConfigType;\n};\n\nexport function useLexicalContentEditable(props: UseLexicalContentEditableProps): UseLexicalContentEditableResult {\n const { defaultValue, customTheme } = props;\n\n const customNodes = props.customNodes ? [...props.customNodes, SentinelNode] : [SentinelNode];\n\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 lexicalStyles = useLexicalStyles();\n const paragraphClassName = mergeClasses(lexicalStyles.paragraph, customTheme?.paragraph);\n\n const lexicalInitialConfig = {\n namespace: 'fai-EditorInput',\n onError: console.log,\n nodes: customNodes,\n editorState: defaultValue,\n editable: !disabled,\n theme: { ...customTheme, paragraph: paragraphClassName.trim() === '' ? undefined : paragraphClassName },\n };\n const lexicalEditor = useLexicalEditor(lexicalInitialConfig);\n\n const canShowPlaceholder = useCanShowPlaceholder(lexicalEditor);\n\n const spanRef = React.useCallback(\n (span: HTMLSpanElement | null) => {\n // Register the `input` span with lexical\n lexicalEditor.setRootElement(span);\n },\n [lexicalEditor],\n );\n\n // Update lexical when disabled changes\n useIsomorphicLayoutEffect(() => {\n lexicalEditor.setEditable(!disabled);\n }, [lexicalEditor]);\n\n useIsomorphicLayoutEffect(() => {\n return mergeRegister(\n lexicalEditor.registerEditableListener(isEditable => {\n setDisabled(!isEditable);\n }),\n lexicalEditor.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\n return { canShowPlaceholder, disabled, spanRef, lexicalEditor, lexicalInitialConfig };\n}\n"],"names":["useLexicalContentEditable","props","defaultValue","customTheme","customNodes","SentinelNode","disabled","setDisabled","useControllableState","state","initialState","lexicalStyles","useLexicalStyles","paragraphClassName","mergeClasses","paragraph","lexicalInitialConfig","namespace","onError","console","log","nodes","editorState","editable","theme","trim","undefined","lexicalEditor","useLexicalEditor","canShowPlaceholder","useCanShowPlaceholder","spanRef","React","useCallback","span","setRootElement","useIsomorphicLayoutEffect","setEditable","mergeRegister","registerEditableListener","isEditable","registerRootListener","root","style","whiteSpace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBgBA;;;eAAAA;;;;iEAtBO;kCACM;iCAEC;gCACkC;6BAE/B;kCACA;uCACK;iCACT;AAatB,SAASA,0BAA0BC,KAAqC;IAC7E,MAAM,EAAEC,YAAY,EAAEC,WAAW,EAAE,GAAGF;IAEtC,MAAMG,cAAcH,MAAMG,WAAW,GAAG;WAAIH,MAAMG,WAAW;QAAEC,8BAAAA;KAAa,GAAG;QAACA,8BAAAA;KAAa;IAE7F,iFAAiF;IACjF,8CAA8C;IAC9C,MAAM,CAACC,UAAUC,YAAY,GAAGC,IAAAA,oCAAAA,EAAqB;QACnDC,OAAOR,MAAMK,QAAQ;QACrBI,cAAc;IAChB;IAEA,MAAMC,gBAAgBC,IAAAA,6BAAAA;IACtB,MAAMC,qBAAqBC,IAAAA,6BAAAA,EAAaH,cAAcI,SAAS,EAAEZ,gBAAAA,QAAAA,gBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,YAAaY,SAAS;IAEvF,MAAMC,uBAAuB;QAC3BC,WAAW;QACXC,SAASC,QAAQC,GAAG;QACpBC,OAAOjB;QACPkB,aAAapB;QACbqB,UAAU,CAACjB;QACXkB,OAAO;YAAE,GAAGrB,WAAW;YAAEY,WAAWF,mBAAmBY,IAAI,OAAO,KAAKC,YAAYb;QAAmB;IACxG;IACA,MAAMc,gBAAgBC,IAAAA,kCAAAA,EAAiBZ;IAEvC,MAAMa,qBAAqBC,IAAAA,4CAAAA,EAAsBH;IAEjD,MAAMI,UAAUC,OAAMC,WAAW,CAC/B,CAACC;QACC,yCAAyC;QACzCP,cAAcQ,cAAc,CAACD;IAC/B,GACA;QAACP;KAAc;IAGjB,uCAAuC;IACvCS,IAAAA,yCAAAA,EAA0B;QACxBT,cAAcU,WAAW,CAAC,CAAC/B;IAC7B,GAAG;QAACqB;KAAc;IAElBS,IAAAA,yCAAAA,EAA0B;QACxB,OAAOE,IAAAA,8BAAAA,EACLX,cAAcY,wBAAwB,CAACC,CAAAA;YACrCjC,YAAY,CAACiC;QACf,IACAb,cAAcc,oBAAoB,CAACC,CAAAA;YACjC,IAAI,CAACA,MAAM;gBACT;YACF;YAEA,wDAAwD;YACxD,wFAAwF;YACxFA,KAAKC,KAAK,CAACC,UAAU,GAAG;QAC1B;IAEJ,GAAG,EAAE;IAEL,OAAO;QAAEf;QAAoBvB;QAAUyB;QAASJ;QAAeX;IAAqB;AACtF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useLexicalEditor", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useLexicalEditor;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
15
|
+
// Merge initial state with history
|
|
16
|
+
const UPDATE_OPTIONS = {
|
|
17
|
+
tag: 'history-merge'
|
|
18
|
+
};
|
|
19
|
+
function setInitialState(editor, initialState) {
|
|
20
|
+
if (initialState === null) {
|
|
21
|
+
return;
|
|
22
|
+
} else if (initialState === undefined) {
|
|
23
|
+
editor.update(()=>{
|
|
24
|
+
const root = (0, _reacttexteditor.$getRoot)();
|
|
25
|
+
if (root.isEmpty()) {
|
|
26
|
+
root.append((0, _reacttexteditor.$createParagraphNode)());
|
|
27
|
+
}
|
|
28
|
+
}, UPDATE_OPTIONS);
|
|
29
|
+
} else {
|
|
30
|
+
switch(typeof initialState){
|
|
31
|
+
case 'string':
|
|
32
|
+
{
|
|
33
|
+
const parsedState = editor.parseEditorState(initialState);
|
|
34
|
+
editor.setEditorState(parsedState, UPDATE_OPTIONS);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case 'object':
|
|
38
|
+
{
|
|
39
|
+
editor.setEditorState(initialState, UPDATE_OPTIONS);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case 'function':
|
|
43
|
+
{
|
|
44
|
+
editor.update(()=>{
|
|
45
|
+
if ((0, _reacttexteditor.$getRoot)().isEmpty()) {
|
|
46
|
+
initialState(editor);
|
|
47
|
+
}
|
|
48
|
+
}, UPDATE_OPTIONS);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function useLexicalEditor(initialConfig) {
|
|
54
|
+
const { theme, namespace, nodes, onError, editorState: initialEditorState, html, editable = true } = initialConfig;
|
|
55
|
+
const [lexicalEditor] = _react.useState(()=>{
|
|
56
|
+
const lexicalEditor = (0, _reacttexteditor.createEditor)({
|
|
57
|
+
editable,
|
|
58
|
+
html,
|
|
59
|
+
namespace,
|
|
60
|
+
nodes,
|
|
61
|
+
onError: (error)=>onError(error, lexicalEditor),
|
|
62
|
+
theme
|
|
63
|
+
});
|
|
64
|
+
setInitialState(lexicalEditor, initialEditorState);
|
|
65
|
+
return lexicalEditor;
|
|
66
|
+
});
|
|
67
|
+
(0, _reactutilities.useIsomorphicLayoutEffect)(()=>{
|
|
68
|
+
const isEditable = initialConfig.editable;
|
|
69
|
+
lexicalEditor.setEditable(isEditable !== undefined ? isEditable : true);
|
|
70
|
+
}, []);
|
|
71
|
+
return lexicalEditor;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useLexicalEditor.ts"],"sourcesContent":["import type { InitialConfigType, LexicalEditor } from '@fluentui-copilot/react-text-editor';\nimport { $createParagraphNode } from '@fluentui-copilot/react-text-editor';\nimport { $getRoot } from '@fluentui-copilot/react-text-editor';\nimport { createEditor } from '@fluentui-copilot/react-text-editor';\nimport { useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\n// Merge initial state with history\nconst UPDATE_OPTIONS = { tag: 'history-merge' };\n\nfunction setInitialState(editor: LexicalEditor, initialState: InitialConfigType['editorState']) {\n if (initialState === null) {\n return;\n } else if (initialState === undefined) {\n editor.update(() => {\n const root = $getRoot();\n if (root.isEmpty()) {\n root.append($createParagraphNode());\n }\n }, UPDATE_OPTIONS);\n } else {\n switch (typeof initialState) {\n case 'string': {\n const parsedState = editor.parseEditorState(initialState);\n editor.setEditorState(parsedState, UPDATE_OPTIONS);\n break;\n }\n case 'object': {\n editor.setEditorState(initialState, UPDATE_OPTIONS);\n break;\n }\n case 'function': {\n editor.update(() => {\n if ($getRoot().isEmpty()) {\n initialState(editor);\n }\n }, UPDATE_OPTIONS);\n }\n }\n }\n}\n\nexport function useLexicalEditor(initialConfig: InitialConfigType): LexicalEditor {\n const { theme, namespace, nodes, onError, editorState: initialEditorState, html, editable = true } = initialConfig;\n\n const [lexicalEditor] = React.useState(() => {\n const lexicalEditor = createEditor({\n editable,\n html,\n namespace,\n nodes,\n onError: error => onError(error, lexicalEditor),\n theme,\n });\n\n setInitialState(lexicalEditor, initialEditorState);\n\n return lexicalEditor;\n });\n\n useIsomorphicLayoutEffect(() => {\n const isEditable = initialConfig.editable;\n lexicalEditor.setEditable(isEditable !== undefined ? isEditable : true);\n }, []);\n\n return lexicalEditor;\n}\n"],"names":["useLexicalEditor","UPDATE_OPTIONS","tag","setInitialState","editor","initialState","undefined","update","root","$getRoot","isEmpty","append","$createParagraphNode","parsedState","parseEditorState","setEditorState","initialConfig","theme","namespace","nodes","onError","editorState","initialEditorState","html","editable","lexicalEditor","React","useState","createEditor","error","useIsomorphicLayoutEffect","isEditable","setEditable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0CgBA;;;eAAAA;;;;iCAzCqB;gCAGK;iEACnB;AAEvB,mCAAmC;AACnC,MAAMC,iBAAiB;IAAEC,KAAK;AAAgB;AAE9C,SAASC,gBAAgBC,MAAqB,EAAEC,YAA8C;IAC5F,IAAIA,iBAAiB,MAAM;QACzB;IACF,OAAO,IAAIA,iBAAiBC,WAAW;QACrCF,OAAOG,MAAM,CAAC;YACZ,MAAMC,OAAOC,IAAAA,yBAAAA;YACb,IAAID,KAAKE,OAAO,IAAI;gBAClBF,KAAKG,MAAM,CAACC,IAAAA,qCAAAA;YACd;QACF,GAAGX;IACL,OAAO;QACL,OAAQ,OAAOI;YACb,KAAK;gBAAU;oBACb,MAAMQ,cAAcT,OAAOU,gBAAgB,CAACT;oBAC5CD,OAAOW,cAAc,CAACF,aAAaZ;oBACnC;gBACF;YACA,KAAK;gBAAU;oBACbG,OAAOW,cAAc,CAACV,cAAcJ;oBACpC;gBACF;YACA,KAAK;gBAAY;oBACfG,OAAOG,MAAM,CAAC;wBACZ,IAAIE,IAAAA,yBAAAA,IAAWC,OAAO,IAAI;4BACxBL,aAAaD;wBACf;oBACF,GAAGH;gBACL;QACF;IACF;AACF;AAEO,SAASD,iBAAiBgB,aAAgC;IAC/D,MAAM,EAAEC,KAAK,EAAEC,SAAS,EAAEC,KAAK,EAAEC,OAAO,EAAEC,aAAaC,kBAAkB,EAAEC,IAAI,EAAEC,WAAW,IAAI,EAAE,GAAGR;IAErG,MAAM,CAACS,cAAc,GAAGC,OAAMC,QAAQ,CAAC;QACrC,MAAMF,gBAAgBG,IAAAA,6BAAAA,EAAa;YACjCJ;YACAD;YACAL;YACAC;YACAC,SAASS,CAAAA,QAAST,QAAQS,OAAOJ;YACjCR;QACF;QAEAd,gBAAgBsB,eAAeH;QAE/B,OAAOG;IACT;IAEAK,IAAAA,yCAAAA,EAA0B;QACxB,MAAMC,aAAaf,cAAcQ,QAAQ;QACzCC,cAAcO,WAAW,CAACD,eAAezB,YAAYyB,aAAa;IACpE,GAAG,EAAE;IAEL,OAAON;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-editor-input",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "a base rich editor input.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/chat-input-plugins": "^0.5.
|
|
16
|
-
"@fluentui-copilot/react-chat-input-plugins": "^0.5.
|
|
17
|
-
"@fluentui-copilot/react-text-editor": "^0.4.
|
|
18
|
-
"@fluentui-copilot/tokens": "^0.3.
|
|
15
|
+
"@fluentui-copilot/chat-input-plugins": "^0.5.3",
|
|
16
|
+
"@fluentui-copilot/react-chat-input-plugins": "^0.5.7",
|
|
17
|
+
"@fluentui-copilot/react-text-editor": "^0.4.3",
|
|
18
|
+
"@fluentui-copilot/tokens": "^0.3.15",
|
|
19
19
|
"@swc/helpers": "^0.5.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@fluentui/react-components": ">=9.
|
|
23
|
-
"@fluentui/react-jsx-runtime": ">=9.
|
|
24
|
-
"@fluentui/react-motion": ">=9.
|
|
25
|
-
"@fluentui/react-utilities": ">=9.
|
|
26
|
-
"@types/react": ">=16.14.0 <
|
|
27
|
-
"@types/react-dom": ">=16.9.8 <
|
|
28
|
-
"react": ">=16.14.0 <
|
|
29
|
-
"react-dom": ">=16.14.0 <
|
|
22
|
+
"@fluentui/react-components": ">=9.70.0 <10.0.0",
|
|
23
|
+
"@fluentui/react-jsx-runtime": ">=9.2.0 <10.0.0",
|
|
24
|
+
"@fluentui/react-motion": ">=9.10.4 <10.0.0",
|
|
25
|
+
"@fluentui/react-utilities": ">=9.24.1 <10.0.0",
|
|
26
|
+
"@types/react": ">=16.14.0 <20.0.0",
|
|
27
|
+
"@types/react-dom": ">=16.9.8 <20.0.0",
|
|
28
|
+
"react": ">=16.14.0 <20.0.0",
|
|
29
|
+
"react-dom": ">=16.14.0 <20.0.0"
|
|
30
30
|
},
|
|
31
31
|
"beachball": {
|
|
32
32
|
"disallowedChangeTypes": [
|