@fluentui-copilot/react-editor-input 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251014-0405-d8d3e89c.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.
Files changed (76) hide show
  1. package/CHANGELOG.json +36 -3
  2. package/CHANGELOG.md +16 -4
  3. package/dist/index.d.ts +165 -0
  4. package/lib/AnimatedPlaceholder.js +1 -0
  5. package/lib/AnimatedPlaceholder.js.map +1 -0
  6. package/lib/EditorInput.js +1 -0
  7. package/lib/EditorInput.js.map +1 -0
  8. package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.js +10 -0
  9. package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.js.map +1 -0
  10. package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js +3 -0
  11. package/lib/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js.map +1 -0
  12. package/lib/components/AnimatedPlaceholder/index.js +4 -0
  13. package/lib/components/AnimatedPlaceholder/index.js.map +1 -0
  14. package/lib/components/AnimatedPlaceholder/placeholderMotion.js +46 -0
  15. package/lib/components/AnimatedPlaceholder/placeholderMotion.js.map +1 -0
  16. package/lib/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js +12 -0
  17. package/lib/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -0
  18. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholder.js +54 -0
  19. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholder.js.map +1 -0
  20. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js +23 -0
  21. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js.map +1 -0
  22. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js +21 -0
  23. package/lib/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js.map +1 -0
  24. package/lib/components/EditorInput/EditorInput.js +11 -0
  25. package/lib/components/EditorInput/EditorInput.js.map +1 -0
  26. package/lib/components/EditorInput/EditorInput.types.js +3 -0
  27. package/lib/components/EditorInput/EditorInput.types.js.map +1 -0
  28. package/lib/components/EditorInput/index.js +4 -0
  29. package/lib/components/EditorInput/index.js.map +1 -0
  30. package/lib/components/EditorInput/renderEditorInput.js +35 -0
  31. package/lib/components/EditorInput/renderEditorInput.js.map +1 -0
  32. package/lib/components/EditorInput/useEditorInput.js +159 -0
  33. package/lib/components/EditorInput/useEditorInput.js.map +1 -0
  34. package/lib/components/EditorInput/useEditorInputStyles.styles.js +65 -0
  35. package/lib/components/EditorInput/useEditorInputStyles.styles.js.map +1 -0
  36. package/lib/components/EditorInput/useEditorInputStyles.styles.raw.js +61 -0
  37. package/lib/components/EditorInput/useEditorInputStyles.styles.raw.js.map +1 -0
  38. package/lib/index.js +2 -0
  39. package/lib/index.js.map +1 -0
  40. package/lib-commonjs/AnimatedPlaceholder.js +28 -0
  41. package/lib-commonjs/AnimatedPlaceholder.js.map +1 -0
  42. package/lib-commonjs/EditorInput.js +37 -0
  43. package/lib-commonjs/EditorInput.js.map +1 -0
  44. package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.js +21 -0
  45. package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.js.map +1 -0
  46. package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js +6 -0
  47. package/lib-commonjs/components/AnimatedPlaceholder/AnimatedPlaceholder.types.js.map +1 -0
  48. package/lib-commonjs/components/AnimatedPlaceholder/index.js +31 -0
  49. package/lib-commonjs/components/AnimatedPlaceholder/index.js.map +1 -0
  50. package/lib-commonjs/components/AnimatedPlaceholder/placeholderMotion.js +56 -0
  51. package/lib-commonjs/components/AnimatedPlaceholder/placeholderMotion.js.map +1 -0
  52. package/lib-commonjs/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js +20 -0
  53. package/lib-commonjs/components/AnimatedPlaceholder/renderAnimatedPlaceholder.js.map +1 -0
  54. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholder.js +57 -0
  55. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholder.js.map +1 -0
  56. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js +37 -0
  57. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.js.map +1 -0
  58. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js +37 -0
  59. package/lib-commonjs/components/AnimatedPlaceholder/useAnimatedPlaceholderStyles.styles.raw.js.map +1 -0
  60. package/lib-commonjs/components/EditorInput/EditorInput.js +21 -0
  61. package/lib-commonjs/components/EditorInput/EditorInput.js.map +1 -0
  62. package/lib-commonjs/components/EditorInput/EditorInput.types.js +6 -0
  63. package/lib-commonjs/components/EditorInput/EditorInput.types.js.map +1 -0
  64. package/lib-commonjs/components/EditorInput/index.js +40 -0
  65. package/lib-commonjs/components/EditorInput/index.js.map +1 -0
  66. package/lib-commonjs/components/EditorInput/renderEditorInput.js +43 -0
  67. package/lib-commonjs/components/EditorInput/renderEditorInput.js.map +1 -0
  68. package/lib-commonjs/components/EditorInput/useEditorInput.js +159 -0
  69. package/lib-commonjs/components/EditorInput/useEditorInput.js.map +1 -0
  70. package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.js +99 -0
  71. package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.js.map +1 -0
  72. package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.raw.js +86 -0
  73. package/lib-commonjs/components/EditorInput/useEditorInputStyles.styles.raw.js.map +1 -0
  74. package/lib-commonjs/index.js +44 -0
  75. package/lib-commonjs/index.js.map +1 -0
  76. package/package.json +5 -5
@@ -0,0 +1,86 @@
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
+ editorInputClassNames: function() {
13
+ return editorInputClassNames;
14
+ },
15
+ useEditorInputStyles_unstable: function() {
16
+ return useEditorInputStyles_unstable;
17
+ },
18
+ useInputClassName: function() {
19
+ return useInputClassName;
20
+ },
21
+ useLexicalStyles: function() {
22
+ return useLexicalStyles;
23
+ },
24
+ usePlaceholderClassName: function() {
25
+ return usePlaceholderClassName;
26
+ }
27
+ });
28
+ const _reactcomponents = require("@fluentui/react-components");
29
+ const _tokens = require("@fluentui-copilot/tokens");
30
+ const editorInputClassNames = {
31
+ root: 'fai-EditorInput',
32
+ input: 'fai-EditorInput__input',
33
+ placeholderValue: 'fai-EditorInput__placeholderValue'
34
+ };
35
+ /**
36
+ * Styles for the root slot
37
+ */ const useRootClassName = (0, _reactcomponents.makeResetStyles)({
38
+ display: 'inline-grid',
39
+ whiteSpace: 'pre-wrap'
40
+ });
41
+ const useLexicalStyles = (0, _reactcomponents.makeStyles)({
42
+ paragraph: {
43
+ margin: 0,
44
+ textAlign: 'start'
45
+ }
46
+ });
47
+ const usePlaceholderClassName = (0, _reactcomponents.makeResetStyles)({
48
+ zIndex: 0,
49
+ gridArea: '1 / 1 / 1 / 1',
50
+ color: _tokens.tokens.colorNeutralForeground4,
51
+ ..._tokens.typographyStyles.body1,
52
+ '@media (forced-colors: active)': {
53
+ color: 'GrayText'
54
+ }
55
+ });
56
+ const useInputClassName = (0, _reactcomponents.makeResetStyles)({
57
+ gridArea: '1 / 1 / 1 / 1',
58
+ zIndex: 1,
59
+ width: '100%'
60
+ });
61
+ const useStyles = (0, _reactcomponents.makeStyles)({
62
+ placeholderDisabled: {
63
+ color: _tokens.tokens.colorNeutralForegroundDisabled
64
+ }
65
+ });
66
+ const useEditorInputStyles_unstable = (state)=>{
67
+ 'use no memo';
68
+ const { disabled } = state;
69
+ const placeholderClassName = usePlaceholderClassName();
70
+ const rootClassName = useRootClassName();
71
+ const inputClassName = useInputClassName();
72
+ const styles = useStyles();
73
+ state.root.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.root, rootClassName, state.root.className);
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
+ if (state.placeholderValue) {
83
+ state.placeholderValue.className = (0, _reactcomponents.mergeClasses)(editorInputClassNames.placeholderValue, placeholderClassName, disabled && styles.placeholderDisabled, state.placeholderValue.className);
84
+ }
85
+ return state;
86
+ };
@@ -0,0 +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 state.lexicalInitialConfig = {\n ...state.lexicalInitialConfig,\n theme: { ...useLexicalStyles(), ...state.lexicalInitialConfig.theme },\n };\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","lexicalInitialConfig","theme"],"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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;IAEA,OAAON;AACT"}
@@ -0,0 +1,44 @@
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
+ EditorInput: function() {
16
+ return _EditorInput.EditorInput;
17
+ },
18
+ animatedPlaceholderClassNames: function() {
19
+ return _AnimatedPlaceholder.animatedPlaceholderClassNames;
20
+ },
21
+ editorInputClassNames: function() {
22
+ return _EditorInput.editorInputClassNames;
23
+ },
24
+ renderAnimatedPlaceholder_unstable: function() {
25
+ return _AnimatedPlaceholder.renderAnimatedPlaceholder_unstable;
26
+ },
27
+ renderEditorInput_unstable: function() {
28
+ return _EditorInput.renderEditorInput_unstable;
29
+ },
30
+ useAnimatedPlaceholderStyles_unstable: function() {
31
+ return _AnimatedPlaceholder.useAnimatedPlaceholderStyles_unstable;
32
+ },
33
+ useAnimatedPlaceholder_unstable: function() {
34
+ return _AnimatedPlaceholder.useAnimatedPlaceholder_unstable;
35
+ },
36
+ useEditorInputStyles_unstable: function() {
37
+ return _EditorInput.useEditorInputStyles_unstable;
38
+ },
39
+ useEditorInput_unstable: function() {
40
+ return _EditorInput.useEditorInput_unstable;
41
+ }
42
+ });
43
+ const _EditorInput = require("./EditorInput");
44
+ const _AnimatedPlaceholder = require("./AnimatedPlaceholder");
@@ -0,0 +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\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.0.0-nightly-20251010-0406-7df7c6d1.1",
3
+ "version": "0.0.0-nightly-20251014-0405-d8d3e89c.1",
4
4
  "description": "a base rich editor input.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,10 +12,10 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/chat-input-plugins": "0.0.0-nightly-20251010-0406-7df7c6d1.1",
16
- "@fluentui-copilot/react-chat-input-plugins": "0.0.0-nightly-20251010-0406-7df7c6d1.1",
17
- "@fluentui-copilot/react-text-editor": "0.0.0-nightly-20251010-0406-7df7c6d1.1",
18
- "@fluentui-copilot/tokens": "0.0.0-nightly-20251010-0406-7df7c6d1.1",
15
+ "@fluentui-copilot/chat-input-plugins": "0.0.0-nightly-20251014-0405-d8d3e89c.1",
16
+ "@fluentui-copilot/react-chat-input-plugins": "0.0.0-nightly-20251014-0405-d8d3e89c.1",
17
+ "@fluentui-copilot/react-text-editor": "0.0.0-nightly-20251014-0405-d8d3e89c.1",
18
+ "@fluentui-copilot/tokens": "0.0.0-nightly-20251014-0405-d8d3e89c.1",
19
19
  "@swc/helpers": "^0.5.1"
20
20
  },
21
21
  "peerDependencies": {