@fluentui-copilot/react-chat-input-plugins 0.0.7 → 0.0.9

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 (80) hide show
  1. package/CHANGELOG.json +62 -0
  2. package/CHANGELOG.md +23 -1
  3. package/dist/index.d.ts +23 -0
  4. package/lib/PasteUnfurling.js +2 -0
  5. package/lib/PasteUnfurling.js.map +1 -0
  6. package/lib/components/ChatInputEntity/ChatInputEntity.js +1 -1
  7. package/lib/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
  8. package/lib/components/ChatInputEntity/index.js +1 -1
  9. package/lib/components/ChatInputEntity/index.js.map +1 -1
  10. package/lib/components/ChatInputEntity/{useChatInputEntityStyles.js → useChatInputEntityStyles.styles.js} +3 -1
  11. package/lib/components/ChatInputEntity/useChatInputEntityStyles.styles.js.map +1 -0
  12. package/lib/components/ChatInputToken/ChatInputToken.js +1 -1
  13. package/lib/components/ChatInputToken/ChatInputToken.js.map +1 -1
  14. package/lib/components/ChatInputToken/ChatInputToken.node.js +1 -0
  15. package/lib/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
  16. package/lib/components/ChatInputToken/index.js +1 -1
  17. package/lib/components/ChatInputToken/index.js.map +1 -1
  18. package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js +19 -0
  19. package/lib/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +1 -0
  20. package/lib/components/GhostText/GhostText.js +1 -1
  21. package/lib/components/GhostText/GhostText.js.map +1 -1
  22. package/lib/components/GhostText/index.js +1 -1
  23. package/lib/components/GhostText/index.js.map +1 -1
  24. package/lib/components/GhostText/{useGhostTextStyles.js → useGhostTextStyles.styles.js} +3 -1
  25. package/lib/components/GhostText/useGhostTextStyles.styles.js.map +1 -0
  26. package/lib/index.js +1 -0
  27. package/lib/index.js.map +1 -1
  28. package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +1 -0
  29. package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
  30. package/lib/plugins/GhostText/GhostText.js +2 -0
  31. package/lib/plugins/GhostText/GhostText.js.map +1 -1
  32. package/lib/plugins/GhostText/GhostText.node.js +1 -0
  33. package/lib/plugins/GhostText/GhostText.node.js.map +1 -1
  34. package/lib/plugins/PasteUnfurling/PasteUnfurling.js +11 -0
  35. package/lib/plugins/PasteUnfurling/PasteUnfurling.js.map +1 -0
  36. package/lib/plugins/PasteUnfurling/index.js +2 -0
  37. package/lib/plugins/PasteUnfurling/index.js.map +1 -0
  38. package/lib-commonjs/PasteUnfurling.js +7 -0
  39. package/lib-commonjs/PasteUnfurling.js.map +1 -0
  40. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +2 -2
  41. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -1
  42. package/lib-commonjs/components/ChatInputEntity/index.js +1 -1
  43. package/lib-commonjs/components/ChatInputEntity/index.js.map +1 -1
  44. package/lib-commonjs/components/ChatInputEntity/{useChatInputEntityStyles.js → useChatInputEntityStyles.styles.js} +2 -1
  45. package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.styles.js.map +1 -0
  46. package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +2 -2
  47. package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -1
  48. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +1 -0
  49. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -1
  50. package/lib-commonjs/components/ChatInputToken/index.js +1 -1
  51. package/lib-commonjs/components/ChatInputToken/index.js.map +1 -1
  52. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.js +34 -0
  53. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.styles.js.map +1 -0
  54. package/lib-commonjs/components/GhostText/GhostText.js +2 -2
  55. package/lib-commonjs/components/GhostText/GhostText.js.map +1 -1
  56. package/lib-commonjs/components/GhostText/index.js +1 -1
  57. package/lib-commonjs/components/GhostText/index.js.map +1 -1
  58. package/lib-commonjs/components/GhostText/{useGhostTextStyles.js → useGhostTextStyles.styles.js} +2 -1
  59. package/lib-commonjs/components/GhostText/useGhostTextStyles.styles.js.map +1 -0
  60. package/lib-commonjs/index.js +4 -0
  61. package/lib-commonjs/index.js.map +1 -1
  62. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +1 -0
  63. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -1
  64. package/lib-commonjs/plugins/GhostText/GhostText.js +1 -0
  65. package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -1
  66. package/lib-commonjs/plugins/GhostText/GhostText.node.js +1 -0
  67. package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -1
  68. package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js +24 -0
  69. package/lib-commonjs/plugins/PasteUnfurling/PasteUnfurling.js.map +1 -0
  70. package/lib-commonjs/plugins/PasteUnfurling/index.js +7 -0
  71. package/lib-commonjs/plugins/PasteUnfurling/index.js.map +1 -0
  72. package/package.json +7 -7
  73. package/lib/components/ChatInputEntity/useChatInputEntityStyles.js.map +0 -1
  74. package/lib/components/ChatInputToken/useChatInputTokenStyles.js +0 -17
  75. package/lib/components/ChatInputToken/useChatInputTokenStyles.js.map +0 -1
  76. package/lib/components/GhostText/useGhostTextStyles.js.map +0 -1
  77. package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.js.map +0 -1
  78. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js +0 -33
  79. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js.map +0 -1
  80. package/lib-commonjs/components/GhostText/useGhostTextStyles.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -1,6 +1,68 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-chat-input-plugins",
3
3
  "entries": [
4
+ {
5
+ "date": "Thu, 13 Jun 2024 21:00:14 GMT",
6
+ "tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.9",
7
+ "version": "0.0.9",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "estebanmu@microsoft.com",
12
+ "package": "@fluentui-copilot/react-chat-input-plugins",
13
+ "commit": "1c5c1ff08365635187ce50982a0c9cfcfdd3cc65",
14
+ "comment": "fix: Add second wave of exludes to tsconfig files to avoid type-check errors."
15
+ }
16
+ ],
17
+ "patch": [
18
+ {
19
+ "author": "owcampbe@microsoft.com",
20
+ "package": "@fluentui-copilot/react-chat-input-plugins",
21
+ "commit": "2a74bcd688f65f34bc8230487d70dfa310a353eb",
22
+ "comment": "feat: Add PasteUnfurling plugin."
23
+ },
24
+ {
25
+ "author": "owcampbe@microsoft.com",
26
+ "package": "@fluentui-copilot/react-chat-input-plugins",
27
+ "commit": "d6084ea0d096a16043ecd2dddac3c08a31ffdbcb",
28
+ "comment": "fix: Set lineheight on ChatInputToken."
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ {
34
+ "date": "Fri, 31 May 2024 18:42:53 GMT",
35
+ "tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.8",
36
+ "version": "0.0.8",
37
+ "comments": {
38
+ "patch": [
39
+ {
40
+ "author": "tristan.watanabe@gmail.com",
41
+ "package": "@fluentui-copilot/react-chat-input-plugins",
42
+ "commit": "6df44dbcd267772e1b62426d14abe54a0b35bb97",
43
+ "comment": "chore: useStyle hook files now properly contain .styles. within filename."
44
+ },
45
+ {
46
+ "author": "tristan.watanabe@gmail.com",
47
+ "package": "@fluentui-copilot/react-chat-input-plugins",
48
+ "commit": "7583464747aec7a8a79a8c79eaeff85d749025e4",
49
+ "comment": "chore: bump @fluentui dependencies to latest 9.52.0."
50
+ },
51
+ {
52
+ "author": "seanmonahan@microsoft.com",
53
+ "package": "@fluentui-copilot/react-chat-input-plugins",
54
+ "commit": "c4d67c24b1b0adf5eb06ae9a97e00c81ba4a2120",
55
+ "comment": "chore: update eslint config to disallow direct global access"
56
+ },
57
+ {
58
+ "author": "seanmonahan@microsoft.com",
59
+ "package": "@fluentui-copilot/react-chat-input-plugins",
60
+ "commit": "c2e14c44cafafbdc10f52b9855384748a7524a63",
61
+ "comment": "chore: add eslint-plugin-react-compiler"
62
+ }
63
+ ]
64
+ }
65
+ },
4
66
  {
5
67
  "date": "Wed, 08 May 2024 22:10:20 GMT",
6
68
  "tag": "@fluentui-copilot/react-chat-input-plugins_v0.0.5",
package/CHANGELOG.md CHANGED
@@ -1,9 +1,31 @@
1
1
  # Change Log - @fluentui-copilot/react-chat-input-plugins
2
2
 
3
- This log was last generated on Wed, 08 May 2024 22:10:20 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 13 Jun 2024 21:00:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.0.9](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.9)
8
+
9
+ Thu, 13 Jun 2024 21:00:14 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.0.8..@fluentui-copilot/react-chat-input-plugins_v0.0.9)
11
+
12
+ ### Patches
13
+
14
+ - feat: Add PasteUnfurling plugin. ([PR #1696](https://github.com/microsoft/fluentai/pull/1696) by owcampbe@microsoft.com)
15
+ - fix: Set lineheight on ChatInputToken. ([PR #1709](https://github.com/microsoft/fluentai/pull/1709) by owcampbe@microsoft.com)
16
+
17
+ ## [0.0.8](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.8)
18
+
19
+ Fri, 31 May 2024 18:42:53 GMT
20
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-chat-input-plugins_v0.0.5..@fluentui-copilot/react-chat-input-plugins_v0.0.8)
21
+
22
+ ### Patches
23
+
24
+ - chore: useStyle hook files now properly contain .styles. within filename. ([PR #1671](https://github.com/microsoft/fluentai/pull/1671) by tristan.watanabe@gmail.com)
25
+ - chore: bump @fluentui dependencies to latest 9.52.0. ([PR #1657](https://github.com/microsoft/fluentai/pull/1657) by tristan.watanabe@gmail.com)
26
+ - chore: update eslint config to disallow direct global access ([PR #1670](https://github.com/microsoft/fluentai/pull/1670) by seanmonahan@microsoft.com)
27
+ - chore: add eslint-plugin-react-compiler ([PR #1642](https://github.com/microsoft/fluentai/pull/1642) by seanmonahan@microsoft.com)
28
+
7
29
  ## [0.0.5](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-chat-input-plugins_v0.0.5)
8
30
 
9
31
  Wed, 08 May 2024 22:10:20 GMT
package/dist/index.d.ts CHANGED
@@ -218,6 +218,14 @@ export declare type ManualGhostTextRef = {
218
218
  cancelGhostText: () => void;
219
219
  };
220
220
 
221
+ export declare const PasteUnfurlingPlugin: <ExtraDataType>(props: PasteUnfurlingPluginProps<ExtraDataType, ChatInputEntityProps>) => null;
222
+
223
+ declare type PasteUnfurlingPluginProps<ExtraDataType, NodePropsType> = {
224
+ entityPluginId: string;
225
+ transforms: TransformFunction<ExtraDataType, NodePropsType>[];
226
+ $createEntityNode: (pluginId: string, text: string, data?: ExtraDataType, entityProps?: NodePropsType, key?: NodeKey) => LexicalNode;
227
+ };
228
+
221
229
  /**
222
230
  * Render the final JSX of ChatInputEntity
223
231
  */
@@ -252,6 +260,21 @@ export declare type SerializedGhostTextNode = Spread<{
252
260
  exposeText?: boolean;
253
261
  }, SerializedLexicalNode>;
254
262
 
263
+ declare type TransformedPart<ExtraDataType, NodePropsType> = {
264
+ type: 'text';
265
+ value: string;
266
+ } | {
267
+ type: 'entity';
268
+ value: ChatInputEntityData<ExtraDataType, NodePropsType>;
269
+ };
270
+
271
+ declare type TransformFunction<ExtraDataType, NodePropsType> = (event: ClipboardEvent, editor: LexicalEditor) => TransformResult<ExtraDataType, NodePropsType>;
272
+
273
+ declare type TransformResult<ExtraDataType, NodePropsType> = {
274
+ handled: boolean;
275
+ transformedParts?: TransformedPart<ExtraDataType, NodePropsType>[];
276
+ };
277
+
255
278
  /**
256
279
  * Create the state required to render ChatInputEntity.
257
280
  *
@@ -0,0 +1,2 @@
1
+ export * from './plugins/PasteUnfurling/index';
2
+ //# sourceMappingURL=PasteUnfurling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PasteUnfurling.ts"],"sourcesContent":["export * from './plugins/PasteUnfurling/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,iCAAiC"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useChatInputEntity_unstable } from './useChatInputEntity';
3
3
  import { renderChatInputEntity_unstable } from './renderChatInputEntity';
4
- import { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles';
4
+ import { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles.styles';
5
5
  // ChatInputEntity component - TODO: add more docs
6
6
  export const ChatInputEntity = /*#__PURE__*/React.forwardRef((props, ref) => {
7
7
  const state = useChatInputEntity_unstable(props, ref);
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["React","useChatInputEntity_unstable","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","ChatInputEntity","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,6BAA6B;AAI/E,kDAAkD;AAClD,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
1
+ {"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles.styles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["React","useChatInputEntity_unstable","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","ChatInputEntity","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,8BAA8B,QAAQ,0BAA0B;AACzE,SAASC,iCAAiC,QAAQ,oCAAoC;AAItF,kDAAkD;AAClD,OAAO,MAAMC,gCAA6DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQP,4BAA4BK,OAAOC;IAEjDJ,kCAAkCK;IAClC,OAAON,+BAA+BM;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
@@ -2,5 +2,5 @@ export * from './ChatInputEntity';
2
2
  export * from './ChatInputEntity.types';
3
3
  export * from './renderChatInputEntity';
4
4
  export * from './useChatInputEntity';
5
- export * from './useChatInputEntityStyles';
5
+ export * from './useChatInputEntityStyles.styles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,6BAA6B"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,0BAA0B;AACxC,cAAc,0BAA0B;AACxC,cAAc,uBAAuB;AACrC,cAAc,oCAAoC"}
@@ -31,6 +31,8 @@ const useStyles = __styles({
31
31
  * Apply styling to the ChatInputEntity slots based on the state
32
32
  */
33
33
  export const useChatInputEntityStyles_unstable = state => {
34
+ 'use no memo';
35
+
34
36
  const styles = useStyles();
35
37
  state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);
36
38
  if (state.text) {
@@ -41,4 +43,4 @@ export const useChatInputEntityStyles_unstable = state => {
41
43
  }
42
44
  return state;
43
45
  };
44
- //# sourceMappingURL=useChatInputEntityStyles.js.map
46
+ //# sourceMappingURL=useChatInputEntityStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useChatInputEntityStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, tokens } from '@fluentui/react-components';\nimport type { ChatInputEntitySlots, ChatInputEntityState } from './ChatInputEntity.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputEntityClassNames: SlotClassNames<ChatInputEntitySlots> = {\n root: 'fai-ChatInputEntity',\n sensitivity: 'fai-ChatInputEntity__sensitivity',\n text: 'fai-ChatInputEntity__text',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {},\n\n text: {\n color: tokens.colorBrandForeground1,\n },\n\n href: {\n color: tokens.colorBrandForegroundLink,\n\n ':hover': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkHover,\n },\n\n ':active': {\n textDecorationLine: 'underline',\n color: tokens.colorBrandForegroundLinkPressed,\n },\n },\n sensitivity: {\n paddingLeft: tokens.spacingHorizontalXXS,\n },\n});\n\n/**\n * Apply styling to the ChatInputEntity slots based on the state\n */\nexport const useChatInputEntityStyles_unstable = (state: ChatInputEntityState): ChatInputEntityState => {\n 'use no memo';\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(chatInputEntityClassNames.root, styles.root, state.root.className);\n\n if (state.text) {\n state.text.className = mergeClasses(\n chatInputEntityClassNames.text,\n styles.text,\n state.text.as === 'a' && styles.href,\n state.text.className,\n );\n }\n\n if (state.sensitivity) {\n state.sensitivity.className = mergeClasses(\n chatInputEntityClassNames.sensitivity,\n styles.sensitivity,\n state.sensitivity.className,\n );\n }\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","chatInputEntityClassNames","root","sensitivity","text","useStyles","color","colorBrandForeground1","href","colorBrandForegroundLink","textDecorationLine","colorBrandForegroundLinkHover","colorBrandForegroundLinkPressed","paddingLeft","spacingHorizontalXXS","useChatInputEntityStyles_unstable","state","styles","className","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,MAAM,QAAQ,6BAA6B;AAI9E,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,aAAa;IACbC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYP,WAAW;IAC3BI,MAAM,CAAC;IAEPE,MAAM;QACJE,OAAON,OAAOO,qBAAqB;IACrC;IAEAC,MAAM;QACJF,OAAON,OAAOS,wBAAwB;QAEtC,UAAU;YACRC,oBAAoB;YACpBJ,OAAON,OAAOW,6BAA6B;QAC7C;QAEA,WAAW;YACTD,oBAAoB;YACpBJ,OAAON,OAAOY,+BAA+B;QAC/C;IACF;IACAT,aAAa;QACXU,aAAab,OAAOc,oBAAoB;IAC1C;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAACC;IAChD;IAEA,MAAMC,SAASZ;IAEfW,MAAMd,IAAI,CAACgB,SAAS,GAAGnB,aAAaE,0BAA0BC,IAAI,EAAEe,OAAOf,IAAI,EAAEc,MAAMd,IAAI,CAACgB,SAAS;IAErG,IAAIF,MAAMZ,IAAI,EAAE;QACdY,MAAMZ,IAAI,CAACc,SAAS,GAAGnB,aACrBE,0BAA0BG,IAAI,EAC9Ba,OAAOb,IAAI,EACXY,MAAMZ,IAAI,CAACe,EAAE,KAAK,OAAOF,OAAOT,IAAI,EACpCQ,MAAMZ,IAAI,CAACc,SAAS;IAExB;IAEA,IAAIF,MAAMb,WAAW,EAAE;QACrBa,MAAMb,WAAW,CAACe,SAAS,GAAGnB,aAC5BE,0BAA0BE,WAAW,EACrCc,OAAOd,WAAW,EAClBa,MAAMb,WAAW,CAACe,SAAS;IAE/B;IAEA,OAAOF;AACT,EAAE"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useChatInputToken_unstable } from './useChatInputToken';
3
3
  import { renderChatInputToken_unstable } from './renderChatInputToken';
4
- import { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles';
4
+ import { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles.styles';
5
5
  // ChatInputToken component
6
6
  export const ChatInputToken = /*#__PURE__*/React.forwardRef((props, ref) => {
7
7
  const state = useChatInputToken_unstable(props, ref);
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputToken.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputToken_unstable } from './useChatInputToken';\nimport { renderChatInputToken_unstable } from './renderChatInputToken';\nimport { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputToken component\nexport const ChatInputToken: ForwardRefComponent<ChatInputTokenProps> = React.forwardRef((props, ref) => {\n const state = useChatInputToken_unstable(props, ref);\n\n useChatInputTokenStyles_unstable(state);\n return renderChatInputToken_unstable(state);\n});\n\nChatInputToken.displayName = 'ChatInputToken';\n"],"names":["React","useChatInputToken_unstable","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","ChatInputToken","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,4BAA4B;AAI7E,2BAA2B;AAC3B,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
1
+ {"version":3,"sources":["ChatInputToken.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputToken_unstable } from './useChatInputToken';\nimport { renderChatInputToken_unstable } from './renderChatInputToken';\nimport { useChatInputTokenStyles_unstable } from './useChatInputTokenStyles.styles';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputToken component\nexport const ChatInputToken: ForwardRefComponent<ChatInputTokenProps> = React.forwardRef((props, ref) => {\n const state = useChatInputToken_unstable(props, ref);\n\n useChatInputTokenStyles_unstable(state);\n return renderChatInputToken_unstable(state);\n});\n\nChatInputToken.displayName = 'ChatInputToken';\n"],"names":["React","useChatInputToken_unstable","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","ChatInputToken","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,yBAAyB;AACvE,SAASC,gCAAgC,QAAQ,mCAAmC;AAIpF,2BAA2B;AAC3B,OAAO,MAAMC,+BAA2DJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQP,2BAA2BK,OAAOC;IAEhDJ,iCAAiCK;IACjC,OAAON,8BAA8BM;AACvC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
@@ -31,6 +31,7 @@ export class ChatInputTokenNode extends DecoratorNode {
31
31
  };
32
32
  }
33
33
  createDOM() {
34
+ // eslint-disable-next-line no-restricted-globals
34
35
  return document.createElement('span');
35
36
  }
36
37
  updateDOM() {
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputToken.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport { ChatInputToken } from './ChatInputToken';\n\nexport type SerializedChatInputTokenNode = Spread<\n { text: string; componentProps?: ChatInputTokenProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputTokenNode extends DecoratorNode<JSX.Element | null> {\n __text: string;\n __componentProps?: ChatInputTokenProps;\n\n static getType(): string {\n return 'token';\n }\n static clone(node: ChatInputTokenNode): ChatInputTokenNode {\n return new ChatInputTokenNode(node.__text, node.__componentProps, node.__key);\n }\n\n static importJSON(serializedNode: SerializedChatInputTokenNode): ChatInputTokenNode {\n return $createChatInputTokenNode(serializedNode.text, serializedNode.componentProps);\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputTokenNode {\n return {\n ...super.exportJSON(),\n text: this.__text,\n componentProps: this.__componentProps,\n type: ChatInputTokenNode.getType(),\n version: 1,\n };\n }\n\n constructor(text: string, componentProps?: ChatInputTokenProps, key?: NodeKey) {\n super(key);\n this.__text = text;\n this.__componentProps = componentProps;\n }\n\n createDOM(): HTMLElement {\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__componentProps?.children) {\n return <ChatInputToken {...this.__componentProps} />;\n }\n return <ChatInputToken {...this.__componentProps}>{this.__text}</ChatInputToken>;\n }\n}\n\nexport function $createChatInputTokenNode(\n text: string,\n componentProps?: ChatInputTokenProps,\n key?: NodeKey,\n): ChatInputTokenNode {\n return new ChatInputTokenNode(text, componentProps, key);\n}\n\nexport function $isChatInputTokenNode(node: LexicalNode | null | undefined): node is ChatInputTokenNode {\n return node instanceof ChatInputTokenNode;\n}\n"],"names":["React","DecoratorNode","ChatInputToken","ChatInputTokenNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","$createChatInputTokenNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","constructor","key","$isChatInputTokenNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,cAAc,QAAQ,mBAAmB;AAOlD,OAAO,MAAMC,2BAA2BF;IAItC,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIH,mBAAmBG,KAAKC,MAAM,EAAED,KAAKE,gBAAgB,EAAEF,KAAKG,KAAK;IAC9E;IAEA,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC,0BAA0BD,eAAeE,IAAI,EAAEF,eAAeG,cAAc;IACrF;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACV,MAAM;IACpB;IAEAW,aAA2C;QACzC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBL,MAAM,IAAI,CAACN,MAAM;YACjBO,gBAAgB,IAAI,CAACN,gBAAgB;YACrCW,MAAMhB,mBAAmBC,OAAO;YAChCgB,SAAS;QACX;IACF;IAQAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,yBAAA,IAAI,CAACnB,gBAAgB,cAArB,6CAAA,uBAAuBoB,QAAQ,EAAE;YACnC,qBAAO,oBAAC1B,gBAAmB,IAAI,CAACM,gBAAgB;QAClD;QACA,qBAAO,oBAACN,gBAAmB,IAAI,CAACM,gBAAgB,EAAG,IAAI,CAACD,MAAM;IAChE;IAnBAsB,YAAYhB,IAAY,EAAEC,cAAoC,EAAEgB,GAAa,CAAE;QAC7E,KAAK,CAACA;QApCRvB,uBAAAA,UAAAA,KAAAA;QACAC,uBAAAA,oBAAAA,KAAAA;QAoCE,IAAI,CAACD,MAAM,GAAGM;QACd,IAAI,CAACL,gBAAgB,GAAGM;IAC1B;AAgBF;AAEA,OAAO,SAASF,0BACdC,IAAY,EACZC,cAAoC,EACpCgB,GAAa;IAEb,OAAO,IAAI3B,mBAAmBU,MAAMC,gBAAgBgB;AACtD;AAEA,OAAO,SAASC,sBAAsBzB,IAAoC;IACxE,OAAOA,gBAAgBH;AACzB"}
1
+ {"version":3,"sources":["ChatInputToken.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputTokenProps } from './ChatInputToken.types';\nimport { ChatInputToken } from './ChatInputToken';\n\nexport type SerializedChatInputTokenNode = Spread<\n { text: string; componentProps?: ChatInputTokenProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputTokenNode extends DecoratorNode<JSX.Element | null> {\n __text: string;\n __componentProps?: ChatInputTokenProps;\n\n static getType(): string {\n return 'token';\n }\n static clone(node: ChatInputTokenNode): ChatInputTokenNode {\n return new ChatInputTokenNode(node.__text, node.__componentProps, node.__key);\n }\n\n static importJSON(serializedNode: SerializedChatInputTokenNode): ChatInputTokenNode {\n return $createChatInputTokenNode(serializedNode.text, serializedNode.componentProps);\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputTokenNode {\n return {\n ...super.exportJSON(),\n text: this.__text,\n componentProps: this.__componentProps,\n type: ChatInputTokenNode.getType(),\n version: 1,\n };\n }\n\n constructor(text: string, componentProps?: ChatInputTokenProps, key?: NodeKey) {\n super(key);\n this.__text = text;\n this.__componentProps = componentProps;\n }\n\n createDOM(): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__componentProps?.children) {\n return <ChatInputToken {...this.__componentProps} />;\n }\n return <ChatInputToken {...this.__componentProps}>{this.__text}</ChatInputToken>;\n }\n}\n\nexport function $createChatInputTokenNode(\n text: string,\n componentProps?: ChatInputTokenProps,\n key?: NodeKey,\n): ChatInputTokenNode {\n return new ChatInputTokenNode(text, componentProps, key);\n}\n\nexport function $isChatInputTokenNode(node: LexicalNode | null | undefined): node is ChatInputTokenNode {\n return node instanceof ChatInputTokenNode;\n}\n"],"names":["React","DecoratorNode","ChatInputToken","ChatInputTokenNode","getType","clone","node","__text","__componentProps","__key","importJSON","serializedNode","$createChatInputTokenNode","text","componentProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","constructor","key","$isChatInputTokenNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,cAAc,QAAQ,mBAAmB;AAOlD,OAAO,MAAMC,2BAA2BF;IAItC,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIH,mBAAmBG,KAAKC,MAAM,EAAED,KAAKE,gBAAgB,EAAEF,KAAKG,KAAK;IAC9E;IAEA,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC,0BAA0BD,eAAeE,IAAI,EAAEF,eAAeG,cAAc;IACrF;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACV,MAAM;IACpB;IAEAW,aAA2C;QACzC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBL,MAAM,IAAI,CAACN,MAAM;YACjBO,gBAAgB,IAAI,CAACN,gBAAgB;YACrCW,MAAMhB,mBAAmBC,OAAO;YAChCgB,SAAS;QACX;IACF;IAQAC,YAAyB;QACvB,iDAAiD;QACjD,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,yBAAA,IAAI,CAACnB,gBAAgB,cAArB,6CAAA,uBAAuBoB,QAAQ,EAAE;YACnC,qBAAO,oBAAC1B,gBAAmB,IAAI,CAACM,gBAAgB;QAClD;QACA,qBAAO,oBAACN,gBAAmB,IAAI,CAACM,gBAAgB,EAAG,IAAI,CAACD,MAAM;IAChE;IApBAsB,YAAYhB,IAAY,EAAEC,cAAoC,EAAEgB,GAAa,CAAE;QAC7E,KAAK,CAACA;QApCRvB,uBAAAA,UAAAA,KAAAA;QACAC,uBAAAA,oBAAAA,KAAAA;QAoCE,IAAI,CAACD,MAAM,GAAGM;QACd,IAAI,CAACL,gBAAgB,GAAGM;IAC1B;AAiBF;AAEA,OAAO,SAASF,0BACdC,IAAY,EACZC,cAAoC,EACpCgB,GAAa;IAEb,OAAO,IAAI3B,mBAAmBU,MAAMC,gBAAgBgB;AACtD;AAEA,OAAO,SAASC,sBAAsBzB,IAAoC;IACxE,OAAOA,gBAAgBH;AACzB"}
@@ -2,6 +2,6 @@ export * from './ChatInputToken';
2
2
  export * from './ChatInputToken.types';
3
3
  export * from './renderChatInputToken';
4
4
  export * from './useChatInputToken';
5
- export * from './useChatInputTokenStyles';
5
+ export * from './useChatInputTokenStyles.styles';
6
6
  export * from './ChatInputToken.node';
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputToken';\nexport * from './ChatInputToken.types';\nexport * from './renderChatInputToken';\nexport * from './useChatInputToken';\nexport * from './useChatInputTokenStyles';\nexport * from './ChatInputToken.node';\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,4BAA4B;AAC1C,cAAc,wBAAwB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputToken';\nexport * from './ChatInputToken.types';\nexport * from './renderChatInputToken';\nexport * from './useChatInputToken';\nexport * from './useChatInputTokenStyles.styles';\nexport * from './ChatInputToken.node';\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,yBAAyB;AACvC,cAAc,yBAAyB;AACvC,cAAc,sBAAsB;AACpC,cAAc,mCAAmC;AACjD,cAAc,wBAAwB"}
@@ -0,0 +1,19 @@
1
+ import { __resetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';
2
+ export const chatInputTokenClassNames = {
3
+ root: 'fai-ChatInputToken'
4
+ };
5
+ /**
6
+ * Styles for the root slot
7
+ */
8
+ const useBaseClassName = __resetStyles("rfuwgnq", "r1934wcn", [".rfuwgnq{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:calc(var(--lineHeightBase200) + (2 * var(--spacingVerticalXXS)) + (2 * var(--strokeWidthThin)));background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:var(--colorNeutralForeground2);padding-top:var(--spacingVerticalXXS);padding-right:0;padding-bottom:var(--spacingVerticalXXS);padding-left:0;}", ".r1934wcn{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:calc(var(--lineHeightBase200) + (2 * var(--spacingVerticalXXS)) + (2 * var(--strokeWidthThin)));background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:var(--colorNeutralForeground2);padding-top:var(--spacingVerticalXXS);padding-left:0;padding-bottom:var(--spacingVerticalXXS);padding-right:0;}"]);
9
+ /**
10
+ * Apply styling to the ChatInputToken slots based on the state
11
+ */
12
+ export const useChatInputTokenStyles_unstable = state => {
13
+ 'use no memo';
14
+
15
+ const baseClassName = useBaseClassName();
16
+ state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);
17
+ return state;
18
+ };
19
+ //# sourceMappingURL=useChatInputTokenStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useChatInputTokenStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ChatInputTokenSlots, ChatInputTokenState } from './ChatInputToken.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const chatInputTokenClassNames: SlotClassNames<ChatInputTokenSlots> = {\n root: 'fai-ChatInputToken',\n};\n\n/**\n * Styles for the root slot\n */\nconst useBaseClassName = makeResetStyles({\n ...typographyStyles.caption1,\n lineHeight: `calc(${tokens.lineHeightBase200} + (2 * ${tokens.spacingVerticalXXS}) + (2 * ${tokens.strokeWidthThin}))`,\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusMedium,\n boxDecorationBreak: 'clone',\n color: tokens.colorNeutralForeground2,\n ...shorthands.padding(tokens.spacingVerticalXXS, 0),\n});\n\n/**\n * Apply styling to the ChatInputToken slots based on the state\n */\nexport const useChatInputTokenStyles_unstable = (state: ChatInputTokenState): ChatInputTokenState => {\n 'use no memo';\n\n const baseClassName = useBaseClassName();\n state.root.className = mergeClasses(chatInputTokenClassNames.root, baseClassName, state.root.className);\n\n return state;\n};\n"],"names":["makeResetStyles","mergeClasses","shorthands","tokens","typographyStyles","chatInputTokenClassNames","root","useBaseClassName","caption1","lineHeight","lineHeightBase200","spacingVerticalXXS","strokeWidthThin","backgroundColor","colorNeutralBackground3","border","colorTransparentStroke","borderRadius","borderRadiusMedium","boxDecorationBreak","color","colorNeutralForeground2","padding","useChatInputTokenStyles_unstable","state","baseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,mBAAmBP,gBAAgB;IACvC,GAAGI,iBAAiBI,QAAQ;IAC5BC,YAAY,CAAC,KAAK,EAAEN,OAAOO,iBAAiB,CAAC,QAAQ,EAAEP,OAAOQ,kBAAkB,CAAC,SAAS,EAAER,OAAOS,eAAe,CAAC,EAAE,CAAC;IACtHC,iBAAiBV,OAAOW,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEZ,OAAOS,eAAe,CAAC,OAAO,EAAET,OAAOa,sBAAsB,CAAC,CAAC;IAC1EC,cAAcd,OAAOe,kBAAkB;IACvCC,oBAAoB;IACpBC,OAAOjB,OAAOkB,uBAAuB;IACrC,GAAGnB,WAAWoB,OAAO,CAACnB,OAAOQ,kBAAkB,EAAE,EAAE;AACrD;AAEA;;CAEC,GACD,OAAO,MAAMY,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,gBAAgBlB;IACtBiB,MAAMlB,IAAI,CAACoB,SAAS,GAAGzB,aAAaI,yBAAyBC,IAAI,EAAEmB,eAAeD,MAAMlB,IAAI,CAACoB,SAAS;IAEtG,OAAOF;AACT,EAAE"}
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useGhostText_unstable } from './useGhostText';
3
3
  import { renderGhostText_unstable } from './renderGhostText';
4
- import { useGhostTextStyles_unstable } from './useGhostTextStyles';
4
+ import { useGhostTextStyles_unstable } from './useGhostTextStyles.styles';
5
5
  // GhostText component - TODO: add more docs
6
6
  export const GhostText = /*#__PURE__*/React.forwardRef((props, ref) => {
7
7
  const state = useGhostText_unstable(props, ref);
@@ -1 +1 @@
1
- {"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGhostText_unstable } from './useGhostText';\nimport { renderGhostText_unstable } from './renderGhostText';\nimport { useGhostTextStyles_unstable } from './useGhostTextStyles';\nimport type { GhostTextProps } from './GhostText.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// GhostText component - TODO: add more docs\nexport const GhostText: ForwardRefComponent<GhostTextProps> = React.forwardRef((props, ref) => {\n const state = useGhostText_unstable(props, ref);\n\n useGhostTextStyles_unstable(state);\n return renderGhostText_unstable(state);\n});\n\nGhostText.displayName = 'GhostText';\n"],"names":["React","useGhostText_unstable","renderGhostText_unstable","useGhostTextStyles_unstable","GhostText","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,uBAAuB;AAInE,4CAA4C;AAC5C,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
1
+ {"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useGhostText_unstable } from './useGhostText';\nimport { renderGhostText_unstable } from './renderGhostText';\nimport { useGhostTextStyles_unstable } from './useGhostTextStyles.styles';\nimport type { GhostTextProps } from './GhostText.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// GhostText component - TODO: add more docs\nexport const GhostText: ForwardRefComponent<GhostTextProps> = React.forwardRef((props, ref) => {\n const state = useGhostText_unstable(props, ref);\n\n useGhostTextStyles_unstable(state);\n return renderGhostText_unstable(state);\n});\n\nGhostText.displayName = 'GhostText';\n"],"names":["React","useGhostText_unstable","renderGhostText_unstable","useGhostTextStyles_unstable","GhostText","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,8BAA8B;AAI1E,4CAA4C;AAC5C,OAAO,MAAMC,0BAAiDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACrF,MAAMC,QAAQP,sBAAsBK,OAAOC;IAE3CJ,4BAA4BK;IAC5B,OAAON,yBAAyBM;AAClC,GAAG;AAEHJ,UAAUK,WAAW,GAAG"}
@@ -2,5 +2,5 @@ export * from './GhostText';
2
2
  export * from './GhostText.types';
3
3
  export * from './renderGhostText';
4
4
  export * from './useGhostText';
5
- export * from './useGhostTextStyles';
5
+ export * from './useGhostTextStyles.styles';
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.types';\nexport * from './renderGhostText';\nexport * from './useGhostText';\nexport * from './useGhostTextStyles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.types';\nexport * from './renderGhostText';\nexport * from './useGhostText';\nexport * from './useGhostTextStyles.styles';\n"],"names":[],"rangeMappings":";;;;","mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB;AAClC,cAAc,oBAAoB;AAClC,cAAc,iBAAiB;AAC/B,cAAc,8BAA8B"}
@@ -38,6 +38,8 @@ const useStyles = __styles({
38
38
  * Apply styling to the GhostText slots based on the state
39
39
  */
40
40
  export const useGhostTextStyles_unstable = state => {
41
+ 'use no memo';
42
+
41
43
  const styles = useStyles();
42
44
  state.root.className = mergeClasses(ghostTextClassNames.root, styles.root, state.root.className);
43
45
  if (state.indicator) {
@@ -45,4 +47,4 @@ export const useGhostTextStyles_unstable = state => {
45
47
  }
46
48
  return state;
47
49
  };
48
- //# sourceMappingURL=useGhostTextStyles.js.map
50
+ //# sourceMappingURL=useGhostTextStyles.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useGhostTextStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\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.colorNeutralForeground3,\n whiteSpace: 'pre-wrap',\n ...shorthands.gap(tokens.spacingHorizontalXS),\n },\n\n indicator: {\n ...typographyStyles.caption2Strong,\n color: tokens.colorNeutralForeground3,\n backgroundColor: tokens.colorNeutralBackground5,\n ...shorthands.padding(tokens.spacingVerticalNone, tokens.spacingHorizontalSNudge),\n ...shorthands.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","shorthands","tokens","typographyStyles","ghostTextClassNames","root","indicator","useStyles","color","colorNeutralForeground3","whiteSpace","gap","spacingHorizontalXS","caption2Strong","backgroundColor","colorNeutralBackground5","padding","spacingVerticalNone","spacingHorizontalSNudge","borderRadius","borderRadiusSmall","marginLeft","merginRight","useGhostTextStyles_unstable","state","styles","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,UAAU,EAAEC,YAAY,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAI5G,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,WAAW;AACb,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYR,WAAW;IAC3BM,MAAM;QACJG,OAAON,OAAOO,uBAAuB;QACrCC,YAAY;QACZ,GAAGT,WAAWU,GAAG,CAACT,OAAOU,mBAAmB,CAAC;IAC/C;IAEAN,WAAW;QACT,GAAGH,iBAAiBU,cAAc;QAClCL,OAAON,OAAOO,uBAAuB;QACrCK,iBAAiBZ,OAAOa,uBAAuB;QAC/C,GAAGd,WAAWe,OAAO,CAACd,OAAOe,mBAAmB,EAAEf,OAAOgB,uBAAuB,CAAC;QACjF,GAAGjB,WAAWkB,YAAY,CAACjB,OAAOkB,iBAAiB,CAAC;QACpDC,YAAYnB,OAAOU,mBAAmB;QACtCU,aAAapB,OAAOU,mBAAmB;IACzC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMW,8BAA8B,CAACC;IAC1C;IAEA,MAAMC,SAASlB;IACfiB,MAAMnB,IAAI,CAACqB,SAAS,GAAG1B,aAAaI,oBAAoBC,IAAI,EAAEoB,OAAOpB,IAAI,EAAEmB,MAAMnB,IAAI,CAACqB,SAAS;IAE/F,IAAIF,MAAMlB,SAAS,EAAE;QACnBkB,MAAMlB,SAAS,CAACoB,SAAS,GAAG1B,aAC1BI,oBAAoBE,SAAS,EAC7BmB,OAAOnB,SAAS,EAChBkB,MAAMlB,SAAS,CAACoB,SAAS;IAE7B;IAEA,OAAOF;AACT,EAAE"}
package/lib/index.js CHANGED
@@ -3,4 +3,5 @@ export { GhostText, ghostTextClassNames, renderGhostText_unstable, useGhostTextS
3
3
  export { ChatInputToken, ChatInputTokenNode, chatInputTokenClassNames, renderChatInputToken_unstable, useChatInputTokenStyles_unstable, useChatInputToken_unstable, $createChatInputTokenNode, $isChatInputTokenNode } from './ChatInputToken';
4
4
  export { BasicFunctionalityPlugin } from './BasicFunctionality';
5
5
  export { ImperativeControlPlugin } from './ImperativeControl';
6
+ export { PasteUnfurlingPlugin } from './PasteUnfurling';
6
7
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export type {\n ChatInputEntityProps,\n ChatInputEntitySlots,\n ChatInputEntityState,\n ChatInputEntityPluginRef,\n SerializedChatInputEntityNode,\n} from './ChatInputEntity';\nexport {\n ChatInputEntity,\n chatInputEntityClassNames,\n renderChatInputEntity_unstable,\n useChatInputEntityStyles_unstable,\n useChatInputEntity_unstable,\n ChatInputEntityNode,\n ChatInputEntityPlugin,\n $isChatInputEntityNode,\n $createChatInputEntityNode,\n} from './ChatInputEntity';\n\nexport type {\n GhostTextProps,\n GhostTextSlots,\n GhostTextState,\n GhostTextPluginProps,\n SerializedGhostTextNode,\n ManualGhostTextRef,\n ManualGhostTextProps,\n} from './GhostText';\nexport {\n GhostText,\n ghostTextClassNames,\n renderGhostText_unstable,\n useGhostTextStyles_unstable,\n useGhostText_unstable,\n GhostTextNode,\n GhostTextPlugin,\n $isGhostTextNode,\n $createGhostTextNode,\n ManualGhostTextPlugin,\n} from './GhostText';\n\nexport type {\n ChatInputTokenProps,\n ChatInputTokenSlots,\n ChatInputTokenState,\n SerializedChatInputTokenNode,\n} from './ChatInputToken';\nexport {\n ChatInputToken,\n ChatInputTokenNode,\n chatInputTokenClassNames,\n renderChatInputToken_unstable,\n useChatInputTokenStyles_unstable,\n useChatInputToken_unstable,\n $createChatInputTokenNode,\n $isChatInputTokenNode,\n} from './ChatInputToken';\n\nexport type { BasicFunctionalityPluginProps, BasicFunctionalityPluginRef } from './BasicFunctionality';\nexport { BasicFunctionalityPlugin } from './BasicFunctionality';\n\nexport type { ImperativeControlPluginProps, ImperativeControlPluginRef } from './ImperativeControl';\nexport { ImperativeControlPlugin } from './ImperativeControl';\n"],"names":["ChatInputEntity","chatInputEntityClassNames","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","useChatInputEntity_unstable","ChatInputEntityNode","ChatInputEntityPlugin","$isChatInputEntityNode","$createChatInputEntityNode","GhostText","ghostTextClassNames","renderGhostText_unstable","useGhostTextStyles_unstable","useGhostText_unstable","GhostTextNode","GhostTextPlugin","$isGhostTextNode","$createGhostTextNode","ManualGhostTextPlugin","ChatInputToken","ChatInputTokenNode","chatInputTokenClassNames","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","useChatInputToken_unstable","$createChatInputTokenNode","$isChatInputTokenNode","BasicFunctionalityPlugin","ImperativeControlPlugin"],"rangeMappings":";;;;","mappings":"AAOA,SACEA,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,EAC3BC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,0BAA0B,QACrB,oBAAoB;AAW3B,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAQrB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,mBAAmB;AAG1B,SAASC,wBAAwB,QAAQ,uBAAuB;AAGhE,SAASC,uBAAuB,QAAQ,sBAAsB"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export type {\n ChatInputEntityProps,\n ChatInputEntitySlots,\n ChatInputEntityState,\n ChatInputEntityPluginRef,\n SerializedChatInputEntityNode,\n} from './ChatInputEntity';\nexport {\n ChatInputEntity,\n chatInputEntityClassNames,\n renderChatInputEntity_unstable,\n useChatInputEntityStyles_unstable,\n useChatInputEntity_unstable,\n ChatInputEntityNode,\n ChatInputEntityPlugin,\n $isChatInputEntityNode,\n $createChatInputEntityNode,\n} from './ChatInputEntity';\n\nexport type {\n GhostTextProps,\n GhostTextSlots,\n GhostTextState,\n GhostTextPluginProps,\n SerializedGhostTextNode,\n ManualGhostTextRef,\n ManualGhostTextProps,\n} from './GhostText';\nexport {\n GhostText,\n ghostTextClassNames,\n renderGhostText_unstable,\n useGhostTextStyles_unstable,\n useGhostText_unstable,\n GhostTextNode,\n GhostTextPlugin,\n $isGhostTextNode,\n $createGhostTextNode,\n ManualGhostTextPlugin,\n} from './GhostText';\n\nexport type {\n ChatInputTokenProps,\n ChatInputTokenSlots,\n ChatInputTokenState,\n SerializedChatInputTokenNode,\n} from './ChatInputToken';\nexport {\n ChatInputToken,\n ChatInputTokenNode,\n chatInputTokenClassNames,\n renderChatInputToken_unstable,\n useChatInputTokenStyles_unstable,\n useChatInputToken_unstable,\n $createChatInputTokenNode,\n $isChatInputTokenNode,\n} from './ChatInputToken';\n\nexport type { BasicFunctionalityPluginProps, BasicFunctionalityPluginRef } from './BasicFunctionality';\nexport { BasicFunctionalityPlugin } from './BasicFunctionality';\n\nexport type { ImperativeControlPluginProps, ImperativeControlPluginRef } from './ImperativeControl';\nexport { ImperativeControlPlugin } from './ImperativeControl';\n\nexport { PasteUnfurlingPlugin } from './PasteUnfurling';\n"],"names":["ChatInputEntity","chatInputEntityClassNames","renderChatInputEntity_unstable","useChatInputEntityStyles_unstable","useChatInputEntity_unstable","ChatInputEntityNode","ChatInputEntityPlugin","$isChatInputEntityNode","$createChatInputEntityNode","GhostText","ghostTextClassNames","renderGhostText_unstable","useGhostTextStyles_unstable","useGhostText_unstable","GhostTextNode","GhostTextPlugin","$isGhostTextNode","$createGhostTextNode","ManualGhostTextPlugin","ChatInputToken","ChatInputTokenNode","chatInputTokenClassNames","renderChatInputToken_unstable","useChatInputTokenStyles_unstable","useChatInputToken_unstable","$createChatInputTokenNode","$isChatInputTokenNode","BasicFunctionalityPlugin","ImperativeControlPlugin","PasteUnfurlingPlugin"],"rangeMappings":";;;;;","mappings":"AAOA,SACEA,eAAe,EACfC,yBAAyB,EACzBC,8BAA8B,EAC9BC,iCAAiC,EACjCC,2BAA2B,EAC3BC,mBAAmB,EACnBC,qBAAqB,EACrBC,sBAAsB,EACtBC,0BAA0B,QACrB,oBAAoB;AAW3B,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,EACrBC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,oBAAoB,EACpBC,qBAAqB,QAChB,cAAc;AAQrB,SACEC,cAAc,EACdC,kBAAkB,EAClBC,wBAAwB,EACxBC,6BAA6B,EAC7BC,gCAAgC,EAChCC,0BAA0B,EAC1BC,yBAAyB,EACzBC,qBAAqB,QAChB,mBAAmB;AAG1B,SAASC,wBAAwB,QAAQ,uBAAuB;AAGhE,SAASC,uBAAuB,QAAQ,sBAAsB;AAE9D,SAASC,oBAAoB,QAAQ,mBAAmB"}
@@ -33,6 +33,7 @@ export class ChatInputEntityNode extends DecoratorNode {
33
33
  };
34
34
  }
35
35
  createDOM() {
36
+ // eslint-disable-next-line no-restricted-globals
36
37
  return document.createElement('span');
37
38
  }
38
39
  updateDOM() {
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputEntity.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nimport type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\n\nexport type SerializedChatInputEntityNode<T> = Spread<\n { pluginId: string; text: string; data?: T; entityProps?: ChatInputEntityProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputEntityNode<T> extends DecoratorNode<JSX.Element | null> {\n __pluginId: string;\n __text: string;\n __entityProps?: ChatInputEntityProps;\n __data?: T;\n\n static getType(): string {\n return 'entity';\n }\n static clone<T>(node: ChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n\n static importJSON<T>(serializedNode: SerializedChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return $createChatInputEntityNode(\n serializedNode.pluginId,\n serializedNode.text,\n serializedNode.data,\n serializedNode.entityProps,\n );\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputEntityNode<T> {\n return {\n ...super.exportJSON(),\n pluginId: this.__pluginId,\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n type: ChatInputEntityNode.getType(),\n version: 1,\n };\n }\n\n constructor(pluginId: string, text: string, data?: T, entityProps?: ChatInputEntityProps, key?: NodeKey) {\n super(key);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n\n createDOM(): HTMLElement {\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__entityProps?.children) {\n return <ChatInputEntity {...this.__entityProps} />;\n }\n return <ChatInputEntity {...this.__entityProps}>{this.__text}</ChatInputEntity>;\n }\n\n getEntityData(): ChatInputEntityData<T, ChatInputEntityProps> {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n };\n }\n\n updateEntityData(data: ChatInputEntityData<T, ChatInputEntityProps>) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n}\n\nexport function $createChatInputEntityNode<T>(\n pluginId: string,\n text: string,\n data?: T,\n entityProps?: ChatInputEntityProps,\n key?: NodeKey,\n): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\n\nexport function $isChatInputEntityNode<T>(node: LexicalNode | null | undefined): node is ChatInputEntityNode<T> {\n return node instanceof ChatInputEntityNode;\n}\n"],"names":["React","DecoratorNode","ChatInputEntity","ChatInputEntityNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","$createChatInputEntityNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","getEntityData","updateEntityData","writable","getWritable","constructor","key","$isChatInputEntityNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,eAAe,QAAQ,wBAAwB;AAQxD,OAAO,MAAMC,4BAA+BF;IAM1C,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAASC,IAA4B,EAA0B;QACpE,OAAO,IAAIH,oBAAoBG,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,WAAcC,cAAgD,EAA0B;QAC7F,OAAOC,2BACLD,eAAeE,QAAQ,EACvBF,eAAeG,IAAI,EACnBH,eAAeI,IAAI,EACnBJ,eAAeK,WAAW;IAE9B;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACb,MAAM;IACpB;IAEAc,aAA+C;QAC7C,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBP,UAAU,IAAI,CAACR,UAAU;YACzBS,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;YAC/Ba,MAAMpB,oBAAoBC,OAAO;YACjCoB,SAAS;QACX;IACF;IAUAC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,sBAAA,IAAI,CAACrB,aAAa,cAAlB,0CAAA,oBAAoBsB,QAAQ,EAAE;YAChC,qBAAO,oBAAC9B,iBAAoB,IAAI,CAACQ,aAAa;QAChD;QACA,qBAAO,oBAACR,iBAAoB,IAAI,CAACQ,aAAa,EAAG,IAAI,CAACF,MAAM;IAC9D;IAEAyB,gBAA8D;QAC5D,OAAO;YACLjB,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;QACjC;IACF;IAEAwB,iBAAiBjB,IAAkD,EAAE;QACnE,MAAMkB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS3B,MAAM,GAAGS,KAAKD,IAAI;QAC3BmB,SAAS1B,MAAM,GAAGQ,KAAKA,IAAI;QAC3BkB,SAASzB,aAAa,GAAGO,KAAKC,WAAW;IAC3C;IApCAmB,YAAYtB,QAAgB,EAAEC,IAAY,EAAEC,IAAQ,EAAEC,WAAkC,EAAEoB,GAAa,CAAE;QACvG,KAAK,CAACA;QA7CR/B,uBAAAA,cAAAA,KAAAA;QACAC,uBAAAA,UAAAA,KAAAA;QACAE,uBAAAA,iBAAAA,KAAAA;QACAD,uBAAAA,UAAAA,KAAAA;QA2CE,IAAI,CAACF,UAAU,GAAGQ;QAClB,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,aAAa,GAAGQ;IACvB;AA+BF;AAEA,OAAO,SAASJ,2BACdC,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCoB,GAAa;IAEb,OAAO,IAAInC,oBAAoBY,UAAUC,MAAMC,MAAMC,aAAaoB;AACpE;AAEA,OAAO,SAASC,uBAA0BjC,IAAoC;IAC5E,OAAOA,gBAAgBH;AACzB"}
1
+ {"version":3,"sources":["ChatInputEntity.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type {\n EditorConfig,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n SerializedLexicalNode,\n Spread,\n} from '@fluentui-copilot/text-editor';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nimport type { ChatInputEntityData } from '@fluentui-copilot/chat-input-plugins';\n\nexport type SerializedChatInputEntityNode<T> = Spread<\n { pluginId: string; text: string; data?: T; entityProps?: ChatInputEntityProps },\n SerializedLexicalNode\n>;\n\nexport class ChatInputEntityNode<T> extends DecoratorNode<JSX.Element | null> {\n __pluginId: string;\n __text: string;\n __entityProps?: ChatInputEntityProps;\n __data?: T;\n\n static getType(): string {\n return 'entity';\n }\n static clone<T>(node: ChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n\n static importJSON<T>(serializedNode: SerializedChatInputEntityNode<T>): ChatInputEntityNode<T> {\n return $createChatInputEntityNode(\n serializedNode.pluginId,\n serializedNode.text,\n serializedNode.data,\n serializedNode.entityProps,\n );\n }\n\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n\n getTextContent(): string {\n return this.__text;\n }\n\n exportJSON(): SerializedChatInputEntityNode<T> {\n return {\n ...super.exportJSON(),\n pluginId: this.__pluginId,\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n type: ChatInputEntityNode.getType(),\n version: 1,\n };\n }\n\n constructor(pluginId: string, text: string, data?: T, entityProps?: ChatInputEntityProps, key?: NodeKey) {\n super(key);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n\n createDOM(): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n updateDOM() {\n return false;\n }\n\n decorate(_editor: LexicalEditor, config: EditorConfig): JSX.Element | null {\n if (this.__entityProps?.children) {\n return <ChatInputEntity {...this.__entityProps} />;\n }\n return <ChatInputEntity {...this.__entityProps}>{this.__text}</ChatInputEntity>;\n }\n\n getEntityData(): ChatInputEntityData<T, ChatInputEntityProps> {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps,\n };\n }\n\n updateEntityData(data: ChatInputEntityData<T, ChatInputEntityProps>) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n}\n\nexport function $createChatInputEntityNode<T>(\n pluginId: string,\n text: string,\n data?: T,\n entityProps?: ChatInputEntityProps,\n key?: NodeKey,\n): ChatInputEntityNode<T> {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\n\nexport function $isChatInputEntityNode<T>(node: LexicalNode | null | undefined): node is ChatInputEntityNode<T> {\n return node instanceof ChatInputEntityNode;\n}\n"],"names":["React","DecoratorNode","ChatInputEntity","ChatInputEntityNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","$createChatInputEntityNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","children","getEntityData","updateEntityData","writable","getWritable","constructor","key","$isChatInputEntityNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAU9D,SAASC,eAAe,QAAQ,wBAAwB;AAQxD,OAAO,MAAMC,4BAA+BF;IAM1C,OAAOG,UAAkB;QACvB,OAAO;IACT;IACA,OAAOC,MAASC,IAA4B,EAA0B;QACpE,OAAO,IAAIH,oBAAoBG,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,WAAcC,cAAgD,EAA0B;QAC7F,OAAOC,2BACLD,eAAeE,QAAQ,EACvBF,eAAeG,IAAI,EACnBH,eAAeI,IAAI,EACnBJ,eAAeK,WAAW;IAE9B;IAEAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAACb,MAAM;IACpB;IAEAc,aAA+C;QAC7C,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBP,UAAU,IAAI,CAACR,UAAU;YACzBS,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;YAC/Ba,MAAMpB,oBAAoBC,OAAO;YACjCoB,SAAS;QACX;IACF;IAUAC,YAAyB;QACvB,iDAAiD;QACjD,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEAC,YAAY;QACV,OAAO;IACT;IAEAC,SAASC,OAAsB,EAAEC,MAAoB,EAAsB;YACrE;QAAJ,KAAI,sBAAA,IAAI,CAACrB,aAAa,cAAlB,0CAAA,oBAAoBsB,QAAQ,EAAE;YAChC,qBAAO,oBAAC9B,iBAAoB,IAAI,CAACQ,aAAa;QAChD;QACA,qBAAO,oBAACR,iBAAoB,IAAI,CAACQ,aAAa,EAAG,IAAI,CAACF,MAAM;IAC9D;IAEAyB,gBAA8D;QAC5D,OAAO;YACLjB,MAAM,IAAI,CAACR,MAAM;YACjBS,MAAM,IAAI,CAACR,MAAM;YACjBS,aAAa,IAAI,CAACR,aAAa;QACjC;IACF;IAEAwB,iBAAiBjB,IAAkD,EAAE;QACnE,MAAMkB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS3B,MAAM,GAAGS,KAAKD,IAAI;QAC3BmB,SAAS1B,MAAM,GAAGQ,KAAKA,IAAI;QAC3BkB,SAASzB,aAAa,GAAGO,KAAKC,WAAW;IAC3C;IArCAmB,YAAYtB,QAAgB,EAAEC,IAAY,EAAEC,IAAQ,EAAEC,WAAkC,EAAEoB,GAAa,CAAE;QACvG,KAAK,CAACA;QA7CR/B,uBAAAA,cAAAA,KAAAA;QACAC,uBAAAA,UAAAA,KAAAA;QACAE,uBAAAA,iBAAAA,KAAAA;QACAD,uBAAAA,UAAAA,KAAAA;QA2CE,IAAI,CAACF,UAAU,GAAGQ;QAClB,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,MAAM,GAAGQ;QACd,IAAI,CAACP,aAAa,GAAGQ;IACvB;AAgCF;AAEA,OAAO,SAASJ,2BACdC,QAAgB,EAChBC,IAAY,EACZC,IAAQ,EACRC,WAAkC,EAClCoB,GAAa;IAEb,OAAO,IAAInC,oBAAoBY,UAAUC,MAAMC,MAAMC,aAAaoB;AACpE;AAEA,OAAO,SAASC,uBAA0BjC,IAAoC;IAC5E,OAAOA,gBAAgBH;AACzB"}
@@ -4,6 +4,8 @@ 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
+ 'use no memo';
8
+
7
9
  const {
8
10
  $getGhostText,
9
11
  id,
@@ -1 +1 @@
1
- {"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport type { LexicalEditor, EditorState } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../GhostText';\nimport { $createGhostTextNode } from '../../GhostText';\nimport { GhostTextNode } from './GhostText.node';\nimport { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type GhostTextPluginProps = {\n id: string;\n $getGhostText: (\n editor: LexicalEditor,\n editorState: EditorState,\n prevEditorState: EditorState,\n ) => Promise<string | undefined>;\n ghostTextProps?: GhostTextProps;\n // Whether or not the ghost text should count as text inside the input for submitting and character count\n exposeText?: boolean;\n allowCompletion?: boolean;\n};\n\nexport function GhostTextPlugin(props: GhostTextPluginProps): JSX.Element | null {\n const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;\n const [editor] = useLexicalComposerContext();\n\n const ghostTextBase = React.useRef<GhostTextPluginBase<GhostTextProps> | null>(null);\n\n React.useEffect(\n () => {\n ghostTextBase.current = new GhostTextPluginBase(\n editor,\n id,\n $getGhostText,\n GhostTextNode,\n $createGhostTextNode,\n ghostTextProps,\n exposeText,\n allowCompletion,\n );\n\n return () => {\n ghostTextBase.current?.cleanup();\n };\n },\n // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, id],\n );\n\n React.useEffect(() => {\n ghostTextBase.current?.setAllowCompletion(allowCompletion);\n }, [allowCompletion]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setComponentProps(ghostTextProps);\n }, [ghostTextProps]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setExposeText(exposeText);\n }, [exposeText]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setGetGhostText($getGhostText);\n }, [$getGhostText]);\n\n return null;\n}\n"],"names":["React","useLexicalComposerContext","$createGhostTextNode","GhostTextNode","GhostTextPluginBase","GhostTextPlugin","props","$getGhostText","id","ghostTextProps","exposeText","allowCompletion","editor","ghostTextBase","useRef","useEffect","current","cleanup","setAllowCompletion","setComponentProps","setExposeText","setGetGhostText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAGhF,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,mBAAmB,QAAQ,uCAAuC;AAe3E,OAAO,SAASC,gBAAgBC,KAA2B;IACzD,MAAM,EAAEC,aAAa,EAAEC,EAAE,EAAEC,cAAc,EAAEC,UAAU,EAAEC,eAAe,EAAE,GAAGL;IAC3E,MAAM,CAACM,OAAO,GAAGX;IAEjB,MAAMY,gBAAgBb,MAAMc,MAAM,CAA6C;IAE/Ed,MAAMe,SAAS,CACb;QACEF,cAAcG,OAAO,GAAG,IAAIZ,oBAC1BQ,QACAJ,IACAD,eACAJ,eACAD,sBACAO,gBACAC,YACAC;QAGF,OAAO;gBACLE;aAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBI,OAAO;QAChC;IACF,GACA,wHAAwH;IACxH,uDAAuD;IACvD;QAACL;QAAQJ;KAAG;IAGdR,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBK,kBAAkB,CAACP;IAC5C,GAAG;QAACA;KAAgB;IAEpBX,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBM,iBAAiB,CAACV;IAC3C,GAAG;QAACA;KAAe;IAEnBT,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBO,aAAa,CAACV;IACvC,GAAG;QAACA;KAAW;IAEfV,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBQ,eAAe,CAACd;IACzC,GAAG;QAACA;KAAc;IAElB,OAAO;AACT"}
1
+ {"version":3,"sources":["GhostText.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport type { LexicalEditor, EditorState } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../GhostText';\nimport { $createGhostTextNode } from '../../GhostText';\nimport { GhostTextNode } from './GhostText.node';\nimport { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';\n\nexport type GhostTextPluginProps = {\n id: string;\n $getGhostText: (\n editor: LexicalEditor,\n editorState: EditorState,\n prevEditorState: EditorState,\n ) => Promise<string | undefined>;\n ghostTextProps?: GhostTextProps;\n // Whether or not the ghost text should count as text inside the input for submitting and character count\n exposeText?: boolean;\n allowCompletion?: boolean;\n};\n\nexport function GhostTextPlugin(props: GhostTextPluginProps): JSX.Element | null {\n 'use no memo';\n\n const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;\n const [editor] = useLexicalComposerContext();\n\n const ghostTextBase = React.useRef<GhostTextPluginBase<GhostTextProps> | null>(null);\n\n React.useEffect(\n () => {\n ghostTextBase.current = new GhostTextPluginBase(\n editor,\n id,\n $getGhostText,\n GhostTextNode,\n $createGhostTextNode,\n ghostTextProps,\n exposeText,\n allowCompletion,\n );\n\n return () => {\n ghostTextBase.current?.cleanup();\n };\n },\n // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [editor, id],\n );\n\n React.useEffect(() => {\n ghostTextBase.current?.setAllowCompletion(allowCompletion);\n }, [allowCompletion]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setComponentProps(ghostTextProps);\n }, [ghostTextProps]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setExposeText(exposeText);\n }, [exposeText]);\n\n React.useEffect(() => {\n ghostTextBase.current?.setGetGhostText($getGhostText);\n }, [$getGhostText]);\n\n return null;\n}\n"],"names":["React","useLexicalComposerContext","$createGhostTextNode","GhostTextNode","GhostTextPluginBase","GhostTextPlugin","props","$getGhostText","id","ghostTextProps","exposeText","allowCompletion","editor","ghostTextBase","useRef","useEffect","current","cleanup","setAllowCompletion","setComponentProps","setExposeText","setGetGhostText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,sCAAsC;AAGhF,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,aAAa,QAAQ,mBAAmB;AACjD,SAASC,mBAAmB,QAAQ,uCAAuC;AAe3E,OAAO,SAASC,gBAAgBC,KAA2B;IACzD;IAEA,MAAM,EAAEC,aAAa,EAAEC,EAAE,EAAEC,cAAc,EAAEC,UAAU,EAAEC,eAAe,EAAE,GAAGL;IAC3E,MAAM,CAACM,OAAO,GAAGX;IAEjB,MAAMY,gBAAgBb,MAAMc,MAAM,CAA6C;IAE/Ed,MAAMe,SAAS,CACb;QACEF,cAAcG,OAAO,GAAG,IAAIZ,oBAC1BQ,QACAJ,IACAD,eACAJ,eACAD,sBACAO,gBACAC,YACAC;QAGF,OAAO;gBACLE;aAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBI,OAAO;QAChC;IACF,GACA,wHAAwH;IACxH,uDAAuD;IACvD;QAACL;QAAQJ;KAAG;IAGdR,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBK,kBAAkB,CAACP;IAC5C,GAAG;QAACA;KAAgB;IAEpBX,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBM,iBAAiB,CAACV;IAC3C,GAAG;QAACA;KAAe;IAEnBT,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBO,aAAa,CAACV;IACvC,GAAG;QAACA;KAAW;IAEfV,MAAMe,SAAS,CAAC;YACdF;SAAAA,yBAAAA,cAAcG,OAAO,cAArBH,6CAAAA,uBAAuBQ,eAAe,CAACd;IACzC,GAAG;QAACA;KAAc;IAElB,OAAO;AACT"}
@@ -37,6 +37,7 @@ export class GhostTextNode extends DecoratorNode {
37
37
  return false;
38
38
  }
39
39
  createDOM(config) {
40
+ // eslint-disable-next-line no-restricted-globals
40
41
  return document.createElement('span');
41
42
  }
42
43
  decorate() {
@@ -1 +1 @@
1
- {"version":3,"sources":["GhostText.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../components/GhostText/GhostText.types';\nimport { GhostText } from '../../components/GhostText/GhostText';\n\nexport type SerializedGhostTextNode = Spread<\n {\n content: string;\n id: string;\n componentProps?: GhostTextProps;\n exposeText?: boolean;\n },\n SerializedLexicalNode\n>;\n\nexport class GhostTextNode extends DecoratorNode<JSX.Element | null> {\n __content: string;\n __id: string;\n __allowCommitting?: boolean;\n __componentProps?: GhostTextProps;\n __exposeText?: boolean;\n\n static clone(node: GhostTextNode): GhostTextNode {\n return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);\n }\n\n static getType(): 'ghosttext' {\n return 'ghosttext';\n }\n\n static importJSON(serializedNode: SerializedGhostTextNode): GhostTextNode {\n const node = $createGhostTextNode(\n serializedNode.id,\n serializedNode.content,\n serializedNode.exposeText,\n serializedNode.componentProps,\n );\n return node;\n }\n\n exportJSON(): SerializedGhostTextNode {\n return {\n ...super.exportJSON(),\n type: 'ghosttext',\n id: this.__id,\n content: this.__content,\n componentProps: this.__componentProps,\n exposeText: this.__exposeText,\n version: 1,\n };\n }\n\n constructor(id: string, content: string, exposeText?: boolean, componentProps?: GhostTextProps, key?: NodeKey) {\n super(key);\n this.__id = id;\n this.__content = content;\n this.__exposeText = exposeText;\n this.__componentProps = componentProps;\n }\n\n isInline() {\n return true;\n }\n\n isIsolated() {\n return true;\n }\n\n getTextContent(): string {\n return this.__exposeText ? this.__content : '';\n }\n\n updateDOM(prevNode: unknown, dom: HTMLElement, config: EditorConfig): boolean {\n return false;\n }\n\n createDOM(config: EditorConfig): HTMLElement {\n return document.createElement('span');\n }\n\n decorate(): JSX.Element | null {\n return (\n <GhostText nodeKey={this.getKey()} {...this.__componentProps}>\n {this.__content}\n </GhostText>\n );\n }\n}\n\nexport function $createGhostTextNode(\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: GhostTextProps,\n): GhostTextNode {\n return new GhostTextNode(id, content, exposeText, componentProps);\n}\n\nexport function $isGhostTextNode(node: LexicalNode | null | undefined): node is GhostTextNode {\n return node instanceof GhostTextNode;\n}\n"],"names":["React","DecoratorNode","GhostText","GhostTextNode","clone","node","__id","__content","__exposeText","__componentProps","__key","getType","importJSON","serializedNode","$createGhostTextNode","id","content","exposeText","componentProps","exportJSON","type","version","isInline","isIsolated","getTextContent","updateDOM","prevNode","dom","config","createDOM","document","createElement","decorate","nodeKey","getKey","constructor","key","__allowCommitting","$isGhostTextNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAG9D,SAASC,SAAS,QAAQ,uCAAuC;AAYjE,OAAO,MAAMC,sBAAsBF;IAOjC,OAAOG,MAAMC,IAAmB,EAAiB;QAC/C,OAAO,IAAIF,cAAcE,KAAKC,IAAI,EAAED,KAAKE,SAAS,EAAEF,KAAKG,YAAY,EAAEH,KAAKI,gBAAgB,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,UAAuB;QAC5B,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAuC,EAAiB;QACxE,MAAMR,OAAOS,qBACXD,eAAeE,EAAE,EACjBF,eAAeG,OAAO,EACtBH,eAAeI,UAAU,EACzBJ,eAAeK,cAAc;QAE/B,OAAOb;IACT;IAEAc,aAAsC;QACpC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNL,IAAI,IAAI,CAACT,IAAI;YACbU,SAAS,IAAI,CAACT,SAAS;YACvBW,gBAAgB,IAAI,CAACT,gBAAgB;YACrCQ,YAAY,IAAI,CAACT,YAAY;YAC7Ba,SAAS;QACX;IACF;IAUAC,WAAW;QACT,OAAO;IACT;IAEAC,aAAa;QACX,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAAChB,YAAY,GAAG,IAAI,CAACD,SAAS,GAAG;IAC9C;IAEAkB,UAAUC,QAAiB,EAAEC,GAAgB,EAAEC,MAAoB,EAAW;QAC5E,OAAO;IACT;IAEAC,UAAUD,MAAoB,EAAe;QAC3C,OAAOE,SAASC,aAAa,CAAC;IAChC;IAEAC,WAA+B;QAC7B,qBACE,oBAAC9B;YAAU+B,SAAS,IAAI,CAACC,MAAM;YAAK,GAAG,IAAI,CAACzB,gBAAgB;WACzD,IAAI,CAACF,SAAS;IAGrB;IAlCA4B,YAAYpB,EAAU,EAAEC,OAAe,EAAEC,UAAoB,EAAEC,cAA+B,EAAEkB,GAAa,CAAE;QAC7G,KAAK,CAACA;QArCR7B,uBAAAA,aAAAA,KAAAA;QACAD,uBAAAA,QAAAA,KAAAA;QACA+B,uBAAAA,qBAAAA,KAAAA;QACA5B,uBAAAA,oBAAAA,KAAAA;QACAD,uBAAAA,gBAAAA,KAAAA;QAkCE,IAAI,CAACF,IAAI,GAAGS;QACZ,IAAI,CAACR,SAAS,GAAGS;QACjB,IAAI,CAACR,YAAY,GAAGS;QACpB,IAAI,CAACR,gBAAgB,GAAGS;IAC1B;AA6BF;AAEA,OAAO,SAASJ,qBACdC,EAAU,EACVC,OAAe,EACfC,UAAoB,EACpBC,cAA+B;IAE/B,OAAO,IAAIf,cAAcY,IAAIC,SAASC,YAAYC;AACpD;AAEA,OAAO,SAASoB,iBAAiBjC,IAAoC;IACnE,OAAOA,gBAAgBF;AACzB"}
1
+ {"version":3,"sources":["GhostText.node.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from '@fluentui-copilot/text-editor';\nimport type { GhostTextProps } from '../../components/GhostText/GhostText.types';\nimport { GhostText } from '../../components/GhostText/GhostText';\n\nexport type SerializedGhostTextNode = Spread<\n {\n content: string;\n id: string;\n componentProps?: GhostTextProps;\n exposeText?: boolean;\n },\n SerializedLexicalNode\n>;\n\nexport class GhostTextNode extends DecoratorNode<JSX.Element | null> {\n __content: string;\n __id: string;\n __allowCommitting?: boolean;\n __componentProps?: GhostTextProps;\n __exposeText?: boolean;\n\n static clone(node: GhostTextNode): GhostTextNode {\n return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);\n }\n\n static getType(): 'ghosttext' {\n return 'ghosttext';\n }\n\n static importJSON(serializedNode: SerializedGhostTextNode): GhostTextNode {\n const node = $createGhostTextNode(\n serializedNode.id,\n serializedNode.content,\n serializedNode.exposeText,\n serializedNode.componentProps,\n );\n return node;\n }\n\n exportJSON(): SerializedGhostTextNode {\n return {\n ...super.exportJSON(),\n type: 'ghosttext',\n id: this.__id,\n content: this.__content,\n componentProps: this.__componentProps,\n exposeText: this.__exposeText,\n version: 1,\n };\n }\n\n constructor(id: string, content: string, exposeText?: boolean, componentProps?: GhostTextProps, key?: NodeKey) {\n super(key);\n this.__id = id;\n this.__content = content;\n this.__exposeText = exposeText;\n this.__componentProps = componentProps;\n }\n\n isInline() {\n return true;\n }\n\n isIsolated() {\n return true;\n }\n\n getTextContent(): string {\n return this.__exposeText ? this.__content : '';\n }\n\n updateDOM(prevNode: unknown, dom: HTMLElement, config: EditorConfig): boolean {\n return false;\n }\n\n createDOM(config: EditorConfig): HTMLElement {\n // eslint-disable-next-line no-restricted-globals\n return document.createElement('span');\n }\n\n decorate(): JSX.Element | null {\n return (\n <GhostText nodeKey={this.getKey()} {...this.__componentProps}>\n {this.__content}\n </GhostText>\n );\n }\n}\n\nexport function $createGhostTextNode(\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: GhostTextProps,\n): GhostTextNode {\n return new GhostTextNode(id, content, exposeText, componentProps);\n}\n\nexport function $isGhostTextNode(node: LexicalNode | null | undefined): node is GhostTextNode {\n return node instanceof GhostTextNode;\n}\n"],"names":["React","DecoratorNode","GhostText","GhostTextNode","clone","node","__id","__content","__exposeText","__componentProps","__key","getType","importJSON","serializedNode","$createGhostTextNode","id","content","exposeText","componentProps","exportJSON","type","version","isInline","isIsolated","getTextContent","updateDOM","prevNode","dom","config","createDOM","document","createElement","decorate","nodeKey","getKey","constructor","key","__allowCommitting","$isGhostTextNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,aAAa,QAAQ,gCAAgC;AAG9D,SAASC,SAAS,QAAQ,uCAAuC;AAYjE,OAAO,MAAMC,sBAAsBF;IAOjC,OAAOG,MAAMC,IAAmB,EAAiB;QAC/C,OAAO,IAAIF,cAAcE,KAAKC,IAAI,EAAED,KAAKE,SAAS,EAAEF,KAAKG,YAAY,EAAEH,KAAKI,gBAAgB,EAAEJ,KAAKK,KAAK;IAC1G;IAEA,OAAOC,UAAuB;QAC5B,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAuC,EAAiB;QACxE,MAAMR,OAAOS,qBACXD,eAAeE,EAAE,EACjBF,eAAeG,OAAO,EACtBH,eAAeI,UAAU,EACzBJ,eAAeK,cAAc;QAE/B,OAAOb;IACT;IAEAc,aAAsC;QACpC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNL,IAAI,IAAI,CAACT,IAAI;YACbU,SAAS,IAAI,CAACT,SAAS;YACvBW,gBAAgB,IAAI,CAACT,gBAAgB;YACrCQ,YAAY,IAAI,CAACT,YAAY;YAC7Ba,SAAS;QACX;IACF;IAUAC,WAAW;QACT,OAAO;IACT;IAEAC,aAAa;QACX,OAAO;IACT;IAEAC,iBAAyB;QACvB,OAAO,IAAI,CAAChB,YAAY,GAAG,IAAI,CAACD,SAAS,GAAG;IAC9C;IAEAkB,UAAUC,QAAiB,EAAEC,GAAgB,EAAEC,MAAoB,EAAW;QAC5E,OAAO;IACT;IAEAC,UAAUD,MAAoB,EAAe;QAC3C,iDAAiD;QACjD,OAAOE,SAASC,aAAa,CAAC;IAChC;IAEAC,WAA+B;QAC7B,qBACE,oBAAC9B;YAAU+B,SAAS,IAAI,CAACC,MAAM;YAAK,GAAG,IAAI,CAACzB,gBAAgB;WACzD,IAAI,CAACF,SAAS;IAGrB;IAnCA4B,YAAYpB,EAAU,EAAEC,OAAe,EAAEC,UAAoB,EAAEC,cAA+B,EAAEkB,GAAa,CAAE;QAC7G,KAAK,CAACA;QArCR7B,uBAAAA,aAAAA,KAAAA;QACAD,uBAAAA,QAAAA,KAAAA;QACA+B,uBAAAA,qBAAAA,KAAAA;QACA5B,uBAAAA,oBAAAA,KAAAA;QACAD,uBAAAA,gBAAAA,KAAAA;QAkCE,IAAI,CAACF,IAAI,GAAGS;QACZ,IAAI,CAACR,SAAS,GAAGS;QACjB,IAAI,CAACR,YAAY,GAAGS;QACpB,IAAI,CAACR,gBAAgB,GAAGS;IAC1B;AA8BF;AAEA,OAAO,SAASJ,qBACdC,EAAU,EACVC,OAAe,EACfC,UAAoB,EACpBC,cAA+B;IAE/B,OAAO,IAAIf,cAAcY,IAAIC,SAASC,YAAYC;AACpD;AAEA,OAAO,SAASoB,iBAAiBjC,IAAoC;IACnE,OAAOA,gBAAgBF;AACzB"}
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { registerPasteUnfurlingPlugin } from '@fluentui-copilot/chat-input-plugins';
3
+ import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';
4
+ export const PasteUnfurlingPlugin = props => {
5
+ const [editor] = useLexicalComposerContext();
6
+ React.useEffect(() => {
7
+ return registerPasteUnfurlingPlugin(editor, props);
8
+ }, [editor, props]);
9
+ return null;
10
+ };
11
+ //# sourceMappingURL=PasteUnfurling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PasteUnfurling.ts"],"sourcesContent":["import * as React from 'react';\nimport { registerPasteUnfurlingPlugin, type PasteUnfurlingPluginProps } from '@fluentui-copilot/chat-input-plugins';\nimport type { ChatInputEntityProps } from '../../ChatInputEntity';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nexport const PasteUnfurlingPlugin = <ExtraDataType>(\n props: PasteUnfurlingPluginProps<ExtraDataType, ChatInputEntityProps>,\n) => {\n const [editor] = useLexicalComposerContext();\n\n React.useEffect(() => {\n return registerPasteUnfurlingPlugin(editor, props);\n }, [editor, props]);\n\n return null;\n};\n"],"names":["React","registerPasteUnfurlingPlugin","useLexicalComposerContext","PasteUnfurlingPlugin","props","editor","useEffect"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,4BAA4B,QAAwC,uCAAuC;AAEpH,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF,OAAO,MAAMC,uBAAuB,CAClCC;IAEA,MAAM,CAACC,OAAO,GAAGH;IAEjBF,MAAMM,SAAS,CAAC;QACd,OAAOL,6BAA6BI,QAAQD;IAC9C,GAAG;QAACC;QAAQD;KAAM;IAElB,OAAO;AACT,EAAE"}
@@ -0,0 +1,2 @@
1
+ export * from './PasteUnfurling';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './PasteUnfurling';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,mBAAmB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./plugins/PasteUnfurling/index"), exports);
7
+ //# sourceMappingURL=PasteUnfurling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["PasteUnfurling.ts"],"sourcesContent":["export * from './plugins/PasteUnfurling/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -12,10 +12,10 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
13
  const _useChatInputEntity = require("./useChatInputEntity");
14
14
  const _renderChatInputEntity = require("./renderChatInputEntity");
15
- const _useChatInputEntityStyles = require("./useChatInputEntityStyles");
15
+ const _useChatInputEntityStylesstyles = require("./useChatInputEntityStyles.styles");
16
16
  const ChatInputEntity = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
17
  const state = (0, _useChatInputEntity.useChatInputEntity_unstable)(props, ref);
18
- (0, _useChatInputEntityStyles.useChatInputEntityStyles_unstable)(state);
18
+ (0, _useChatInputEntityStylesstyles.useChatInputEntityStyles_unstable)(state);
19
19
  return (0, _renderChatInputEntity.renderChatInputEntity_unstable)(state);
20
20
  });
21
21
  ChatInputEntity.displayName = 'ChatInputEntity'; //# sourceMappingURL=ChatInputEntity.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["ChatInputEntity","React","forwardRef","props","state","useChatInputEntity_unstable","useChatInputEntityStyles_unstable","renderChatInputEntity_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;oCACqB;uCACG;0CACG;AAK3C,MAAMA,kBAAAA,WAAAA,GAAAA,OAA6DC,UAAMC,CAAU,CAACC,OAACA;UAC1FC,QAAMA,IAAAA,+CAAQC,EAAAA,OAA4BF;mEAE1CG,EAAAA;WACAC,IAAAA,qDAAOA,EAAAA;AACT;AAEAP,gBAAgBQ,WAAW,GAAG"}
1
+ {"version":3,"sources":["ChatInputEntity.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useChatInputEntity_unstable } from './useChatInputEntity';\nimport { renderChatInputEntity_unstable } from './renderChatInputEntity';\nimport { useChatInputEntityStyles_unstable } from './useChatInputEntityStyles.styles';\nimport type { ChatInputEntityProps } from './ChatInputEntity.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\n\n// ChatInputEntity component - TODO: add more docs\nexport const ChatInputEntity: ForwardRefComponent<ChatInputEntityProps> = React.forwardRef((props, ref) => {\n const state = useChatInputEntity_unstable(props, ref);\n\n useChatInputEntityStyles_unstable(state);\n return renderChatInputEntity_unstable(state);\n});\n\nChatInputEntity.displayName = 'ChatInputEntity';\n"],"names":["ChatInputEntity","React","forwardRef","props","state","useChatInputEntity_unstable","useChatInputEntityStyles_unstable","renderChatInputEntity_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;oCACqB;uCACG;gDACG;AAK3C,MAAMA,kBAAAA,WAAAA,GAAAA,OAA6DC,UAAMC,CAAU,CAACC,OAACA;UAC1FC,QAAMA,IAAAA,+CAAQC,EAAAA,OAA4BF;yEAE1CG,EAAAA;WACAC,IAAAA,qDAAOA,EAAAA;AACT;AAEAP,gBAAgBQ,WAAW,GAAG"}
@@ -7,5 +7,5 @@ _export_star._(require("./ChatInputEntity"), exports);
7
7
  _export_star._(require("./ChatInputEntity.types"), exports);
8
8
  _export_star._(require("./renderChatInputEntity"), exports);
9
9
  _export_star._(require("./useChatInputEntity"), exports);
10
- _export_star._(require("./useChatInputEntityStyles"), exports);
10
+ _export_star._(require("./useChatInputEntityStyles.styles"), exports);
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ChatInputEntity';\nexport * from './ChatInputEntity.types';\nexport * from './renderChatInputEntity';\nexport * from './useChatInputEntity';\nexport * from './useChatInputEntityStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}