@fluentui-copilot/react-chat-input-plugins 0.0.0-nightly-20240410-0405-8d7a6b79.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 (158) hide show
  1. package/CHANGELOG.json +38 -0
  2. package/CHANGELOG.md +16 -0
  3. package/LICENSE +23 -0
  4. package/README.md +5 -0
  5. package/dist/index.d.ts +295 -0
  6. package/lib/BasicFunctionality.js +2 -0
  7. package/lib/BasicFunctionality.js.map +1 -0
  8. package/lib/ChatInputEntity.js +3 -0
  9. package/lib/ChatInputEntity.js.map +1 -0
  10. package/lib/ChatInputToken.js +2 -0
  11. package/lib/ChatInputToken.js.map +1 -0
  12. package/lib/GhostText.js +4 -0
  13. package/lib/GhostText.js.map +1 -0
  14. package/lib/ImperativeControl.js +2 -0
  15. package/lib/ImperativeControl.js.map +1 -0
  16. package/lib/components/ChatInputEntity/ChatInputEntity.js +12 -0
  17. package/lib/components/ChatInputEntity/ChatInputEntity.js.map +1 -0
  18. package/lib/components/ChatInputEntity/ChatInputEntity.types.js +3 -0
  19. package/lib/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -0
  20. package/lib/components/ChatInputEntity/index.js +6 -0
  21. package/lib/components/ChatInputEntity/index.js.map +1 -0
  22. package/lib/components/ChatInputEntity/renderChatInputEntity.js +12 -0
  23. package/lib/components/ChatInputEntity/renderChatInputEntity.js.map +1 -0
  24. package/lib/components/ChatInputEntity/useChatInputEntity.js +55 -0
  25. package/lib/components/ChatInputEntity/useChatInputEntity.js.map +1 -0
  26. package/lib/components/ChatInputEntity/useChatInputEntityStyles.js +44 -0
  27. package/lib/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -0
  28. package/lib/components/ChatInputToken/ChatInputToken.js +12 -0
  29. package/lib/components/ChatInputToken/ChatInputToken.js.map +1 -0
  30. package/lib/components/ChatInputToken/ChatInputToken.node.js +60 -0
  31. package/lib/components/ChatInputToken/ChatInputToken.node.js.map +1 -0
  32. package/lib/components/ChatInputToken/ChatInputToken.types.js +2 -0
  33. package/lib/components/ChatInputToken/ChatInputToken.types.js.map +1 -0
  34. package/lib/components/ChatInputToken/index.js +7 -0
  35. package/lib/components/ChatInputToken/index.js.map +1 -0
  36. package/lib/components/ChatInputToken/renderChatInputToken.js +10 -0
  37. package/lib/components/ChatInputToken/renderChatInputToken.js.map +1 -0
  38. package/lib/components/ChatInputToken/useChatInputToken.js +25 -0
  39. package/lib/components/ChatInputToken/useChatInputToken.js.map +1 -0
  40. package/lib/components/ChatInputToken/useChatInputTokenStyles.js +17 -0
  41. package/lib/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -0
  42. package/lib/components/GhostText/GhostText.js +12 -0
  43. package/lib/components/GhostText/GhostText.js.map +1 -0
  44. package/lib/components/GhostText/GhostText.types.js +3 -0
  45. package/lib/components/GhostText/GhostText.types.js.map +1 -0
  46. package/lib/components/GhostText/index.js +6 -0
  47. package/lib/components/GhostText/index.js.map +1 -0
  48. package/lib/components/GhostText/renderGhostText.js +12 -0
  49. package/lib/components/GhostText/renderGhostText.js.map +1 -0
  50. package/lib/components/GhostText/useGhostText.js +29 -0
  51. package/lib/components/GhostText/useGhostText.js.map +1 -0
  52. package/lib/components/GhostText/useGhostTextStyles.js +48 -0
  53. package/lib/components/GhostText/useGhostTextStyles.js.map +1 -0
  54. package/lib/index.js +6 -0
  55. package/lib/index.js.map +1 -0
  56. package/lib/plugins/BasicFunctionality/BasicFunctionality.js +54 -0
  57. package/lib/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -0
  58. package/lib/plugins/BasicFunctionality/index.js +2 -0
  59. package/lib/plugins/BasicFunctionality/index.js.map +1 -0
  60. package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js +79 -0
  61. package/lib/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -0
  62. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js +42 -0
  63. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -0
  64. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +2 -0
  65. package/lib/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -0
  66. package/lib/plugins/ChatInputEntity/index.js +4 -0
  67. package/lib/plugins/ChatInputEntity/index.js.map +1 -0
  68. package/lib/plugins/GhostText/GhostText.js +44 -0
  69. package/lib/plugins/GhostText/GhostText.js.map +1 -0
  70. package/lib/plugins/GhostText/GhostText.node.js +61 -0
  71. package/lib/plugins/GhostText/GhostText.node.js.map +1 -0
  72. package/lib/plugins/GhostText/index.js +3 -0
  73. package/lib/plugins/GhostText/index.js.map +1 -0
  74. package/lib/plugins/ImperativeControl/ImperativeControl.js +9 -0
  75. package/lib/plugins/ImperativeControl/ImperativeControl.js.map +1 -0
  76. package/lib/plugins/ImperativeControl/index.js +2 -0
  77. package/lib/plugins/ImperativeControl/index.js.map +1 -0
  78. package/lib/plugins/ManualGhostText/ManualGhostText.js +14 -0
  79. package/lib/plugins/ManualGhostText/ManualGhostText.js.map +1 -0
  80. package/lib/plugins/ManualGhostText/index.js +2 -0
  81. package/lib/plugins/ManualGhostText/index.js.map +1 -0
  82. package/lib-commonjs/BasicFunctionality.js +7 -0
  83. package/lib-commonjs/BasicFunctionality.js.map +1 -0
  84. package/lib-commonjs/ChatInputEntity.js +8 -0
  85. package/lib-commonjs/ChatInputEntity.js.map +1 -0
  86. package/lib-commonjs/ChatInputToken.js +7 -0
  87. package/lib-commonjs/ChatInputToken.js.map +1 -0
  88. package/lib-commonjs/GhostText.js +9 -0
  89. package/lib-commonjs/GhostText.js.map +1 -0
  90. package/lib-commonjs/ImperativeControl.js +7 -0
  91. package/lib-commonjs/ImperativeControl.js.map +1 -0
  92. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js +21 -0
  93. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.js.map +1 -0
  94. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js +7 -0
  95. package/lib-commonjs/components/ChatInputEntity/ChatInputEntity.types.js.map +1 -0
  96. package/lib-commonjs/components/ChatInputEntity/index.js +11 -0
  97. package/lib-commonjs/components/ChatInputEntity/index.js.map +1 -0
  98. package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js +21 -0
  99. package/lib-commonjs/components/ChatInputEntity/renderChatInputEntity.js.map +1 -0
  100. package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js +52 -0
  101. package/lib-commonjs/components/ChatInputEntity/useChatInputEntity.js.map +1 -0
  102. package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.js +71 -0
  103. package/lib-commonjs/components/ChatInputEntity/useChatInputEntityStyles.js.map +1 -0
  104. package/lib-commonjs/components/ChatInputToken/ChatInputToken.js +21 -0
  105. package/lib-commonjs/components/ChatInputToken/ChatInputToken.js.map +1 -0
  106. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js +81 -0
  107. package/lib-commonjs/components/ChatInputToken/ChatInputToken.node.js.map +1 -0
  108. package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js +5 -0
  109. package/lib-commonjs/components/ChatInputToken/ChatInputToken.types.js.map +1 -0
  110. package/lib-commonjs/components/ChatInputToken/index.js +12 -0
  111. package/lib-commonjs/components/ChatInputToken/index.js.map +1 -0
  112. package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js +16 -0
  113. package/lib-commonjs/components/ChatInputToken/renderChatInputToken.js.map +1 -0
  114. package/lib-commonjs/components/ChatInputToken/useChatInputToken.js +24 -0
  115. package/lib-commonjs/components/ChatInputToken/useChatInputToken.js.map +1 -0
  116. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js +34 -0
  117. package/lib-commonjs/components/ChatInputToken/useChatInputTokenStyles.js.map +1 -0
  118. package/lib-commonjs/components/GhostText/GhostText.js +21 -0
  119. package/lib-commonjs/components/GhostText/GhostText.js.map +1 -0
  120. package/lib-commonjs/components/GhostText/GhostText.types.js +7 -0
  121. package/lib-commonjs/components/GhostText/GhostText.types.js.map +1 -0
  122. package/lib-commonjs/components/GhostText/index.js +11 -0
  123. package/lib-commonjs/components/GhostText/index.js.map +1 -0
  124. package/lib-commonjs/components/GhostText/renderGhostText.js +21 -0
  125. package/lib-commonjs/components/GhostText/renderGhostText.js.map +1 -0
  126. package/lib-commonjs/components/GhostText/useGhostText.js +28 -0
  127. package/lib-commonjs/components/GhostText/useGhostText.js.map +1 -0
  128. package/lib-commonjs/components/GhostText/useGhostTextStyles.js +103 -0
  129. package/lib-commonjs/components/GhostText/useGhostTextStyles.js.map +1 -0
  130. package/lib-commonjs/index.js +102 -0
  131. package/lib-commonjs/index.js.map +1 -0
  132. package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js +70 -0
  133. package/lib-commonjs/plugins/BasicFunctionality/BasicFunctionality.js.map +1 -0
  134. package/lib-commonjs/plugins/BasicFunctionality/index.js +7 -0
  135. package/lib-commonjs/plugins/BasicFunctionality/index.js.map +1 -0
  136. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js +100 -0
  137. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntity.node.js.map +1 -0
  138. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js +52 -0
  139. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.js.map +1 -0
  140. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js +5 -0
  141. package/lib-commonjs/plugins/ChatInputEntity/ChatInputEntityPlugin.types.js.map +1 -0
  142. package/lib-commonjs/plugins/ChatInputEntity/index.js +9 -0
  143. package/lib-commonjs/plugins/ChatInputEntity/index.js.map +1 -0
  144. package/lib-commonjs/plugins/GhostText/GhostText.js +58 -0
  145. package/lib-commonjs/plugins/GhostText/GhostText.js.map +1 -0
  146. package/lib-commonjs/plugins/GhostText/GhostText.node.js +82 -0
  147. package/lib-commonjs/plugins/GhostText/GhostText.node.js.map +1 -0
  148. package/lib-commonjs/plugins/GhostText/index.js +8 -0
  149. package/lib-commonjs/plugins/GhostText/index.js.map +1 -0
  150. package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js +21 -0
  151. package/lib-commonjs/plugins/ImperativeControl/ImperativeControl.js.map +1 -0
  152. package/lib-commonjs/plugins/ImperativeControl/index.js +7 -0
  153. package/lib-commonjs/plugins/ImperativeControl/index.js.map +1 -0
  154. package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js +25 -0
  155. package/lib-commonjs/plugins/ManualGhostText/ManualGhostText.js.map +1 -0
  156. package/lib-commonjs/plugins/ManualGhostText/index.js +7 -0
  157. package/lib-commonjs/plugins/ManualGhostText/index.js.map +1 -0
  158. package/package.json +39 -0
@@ -0,0 +1,100 @@
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
+ ChatInputEntityNode: function() {
13
+ return ChatInputEntityNode;
14
+ },
15
+ $createChatInputEntityNode: function() {
16
+ return $createChatInputEntityNode;
17
+ },
18
+ $isChatInputEntityNode: function() {
19
+ return $isChatInputEntityNode;
20
+ }
21
+ });
22
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
23
+ const _define_property = require("@swc/helpers/_/_define_property");
24
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
25
+ const _texteditor = require("@fluentui-copilot/text-editor");
26
+ const _ChatInputEntity = require("../../ChatInputEntity");
27
+ class ChatInputEntityNode extends _texteditor.DecoratorNode {
28
+ static getType() {
29
+ return 'entity';
30
+ }
31
+ static clone(node) {
32
+ return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);
33
+ }
34
+ static importJSON(serializedNode) {
35
+ return $createChatInputEntityNode(serializedNode.pluginId, serializedNode.text, serializedNode.data, serializedNode.entityProps);
36
+ }
37
+ isIsolated() {
38
+ return true;
39
+ }
40
+ isInline() {
41
+ return true;
42
+ }
43
+ getTextContent() {
44
+ return this.__text;
45
+ }
46
+ exportJSON() {
47
+ return {
48
+ ...super.exportJSON(),
49
+ pluginId: this.__pluginId,
50
+ text: this.__text,
51
+ data: this.__data,
52
+ entityProps: this.__entityProps,
53
+ type: ChatInputEntityNode.getType(),
54
+ version: 1
55
+ };
56
+ }
57
+ createDOM() {
58
+ return document.createElement('span');
59
+ }
60
+ updateDOM() {
61
+ return false;
62
+ }
63
+ decorate(_editor, config) {
64
+ var _this___entityProps;
65
+ if ((_this___entityProps = this.__entityProps) === null || _this___entityProps === void 0 ? void 0 : _this___entityProps.children) {
66
+ return /*#__PURE__*/ _react.createElement(_ChatInputEntity.ChatInputEntity, this.__entityProps);
67
+ }
68
+ return /*#__PURE__*/ _react.createElement(_ChatInputEntity.ChatInputEntity, this.__entityProps, this.__text);
69
+ }
70
+ getEntityData() {
71
+ return {
72
+ text: this.__text,
73
+ data: this.__data,
74
+ entityProps: this.__entityProps
75
+ };
76
+ }
77
+ updateEntityData(data) {
78
+ const writable = this.getWritable();
79
+ writable.__text = data.text;
80
+ writable.__data = data.data;
81
+ writable.__entityProps = data.entityProps;
82
+ }
83
+ constructor(pluginId, text, data, entityProps, key){
84
+ super(key);
85
+ (0, _define_property._)(this, "__pluginId", void 0);
86
+ (0, _define_property._)(this, "__text", void 0);
87
+ (0, _define_property._)(this, "__entityProps", void 0);
88
+ (0, _define_property._)(this, "__data", void 0);
89
+ this.__pluginId = pluginId;
90
+ this.__text = text;
91
+ this.__data = data;
92
+ this.__entityProps = entityProps;
93
+ }
94
+ }
95
+ function $createChatInputEntityNode(pluginId, text, data, entityProps, key) {
96
+ return new ChatInputEntityNode(pluginId, text, data, entityProps, key);
97
+ }
98
+ function $isChatInputEntityNode(node) {
99
+ return node instanceof ChatInputEntityNode;
100
+ } //# sourceMappingURL=ChatInputEntity.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ChatInputEntity.node.js"],"sourcesContent":["import { _ as _define_property } from \"@swc/helpers/_/_define_property\";\nimport * as React from 'react';\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport { ChatInputEntity } from '../../ChatInputEntity';\nexport class ChatInputEntityNode extends DecoratorNode {\n static getType() {\n return 'entity';\n }\n static clone(node) {\n return new ChatInputEntityNode(node.__pluginId, node.__text, node.__data, node.__entityProps, node.__key);\n }\n static importJSON(serializedNode) {\n return $createChatInputEntityNode(serializedNode.pluginId, serializedNode.text, serializedNode.data, serializedNode.entityProps);\n }\n isIsolated() {\n return true;\n }\n isInline() {\n return true;\n }\n getTextContent() {\n return this.__text;\n }\n exportJSON() {\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 createDOM() {\n return document.createElement('span');\n }\n updateDOM() {\n return false;\n }\n decorate(_editor, config) {\n var _this___entityProps;\n if ((_this___entityProps = this.__entityProps) === null || _this___entityProps === void 0 ? void 0 : _this___entityProps.children) {\n return /*#__PURE__*/React.createElement(ChatInputEntity, this.__entityProps);\n }\n return /*#__PURE__*/React.createElement(ChatInputEntity, this.__entityProps, this.__text);\n }\n getEntityData() {\n return {\n text: this.__text,\n data: this.__data,\n entityProps: this.__entityProps\n };\n }\n updateEntityData(data) {\n const writable = this.getWritable();\n writable.__text = data.text;\n writable.__data = data.data;\n writable.__entityProps = data.entityProps;\n }\n constructor(pluginId, text, data, entityProps, key) {\n super(key);\n _define_property(this, \"__pluginId\", void 0);\n _define_property(this, \"__text\", void 0);\n _define_property(this, \"__entityProps\", void 0);\n _define_property(this, \"__data\", void 0);\n this.__pluginId = pluginId;\n this.__text = text;\n this.__data = data;\n this.__entityProps = entityProps;\n }\n}\nexport function $createChatInputEntityNode(pluginId, text, data, entityProps, key) {\n return new ChatInputEntityNode(pluginId, text, data, entityProps, key);\n}\nexport function $isChatInputEntityNode(node) {\n return node instanceof ChatInputEntityNode;\n}\n//# sourceMappingURL=ChatInputEntity.node.js.map"],"names":["ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","DecoratorNode","getType","clone","node","__pluginId","__text","__data","__entityProps","__key","importJSON","serializedNode","pluginId","text","data","entityProps","isIsolated","isInline","getTextContent","exportJSON","type","version","createDOM","document","createElement","updateDOM","decorate","_editor","config","_this___entityProps","children","React","ChatInputEntity","getEntityData","updateEntityData","writable","getWritable","constructor","key","_define_property"],"mappings":";;;;;;;;;;;IAIaA,mBAAmB;eAAnBA;;IAoEGC,0BAA0B;eAA1BA;;IAGAC,sBAAsB;eAAtBA;;;;iCA3EsB;iEACf;4BACO;iCACE;AACzB,MAAMF,4BAA4BG,yBAAa;IACpD,OAAOC,UAAU;QACf,OAAO;IACT;IACA,OAAOC,MAAMC,IAAI,EAAE;QACjB,OAAO,IAAIN,oBAAoBM,KAAKC,UAAU,EAAED,KAAKE,MAAM,EAAEF,KAAKG,MAAM,EAAEH,KAAKI,aAAa,EAAEJ,KAAKK,KAAK;IAC1G;IACA,OAAOC,WAAWC,cAAc,EAAE;QAChC,OAAOZ,2BAA2BY,eAAeC,QAAQ,EAAED,eAAeE,IAAI,EAAEF,eAAeG,IAAI,EAAEH,eAAeI,WAAW;IACjI;IACAC,aAAa;QACX,OAAO;IACT;IACAC,WAAW;QACT,OAAO;IACT;IACAC,iBAAiB;QACf,OAAO,IAAI,CAACZ,MAAM;IACpB;IACAa,aAAa;QACX,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBP,UAAU,IAAI,CAACP,UAAU;YACzBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,aAAa,IAAI,CAACP,aAAa;YAC/BY,MAAMtB,oBAAoBI,OAAO;YACjCmB,SAAS;QACX;IACF;IACAC,YAAY;QACV,OAAOC,SAASC,aAAa,CAAC;IAChC;IACAC,YAAY;QACV,OAAO;IACT;IACAC,SAASC,OAAO,EAAEC,MAAM,EAAE;QACxB,IAAIC;QACJ,IAAI,AAACA,CAAAA,sBAAsB,IAAI,CAACrB,aAAa,AAAD,MAAO,QAAQqB,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBC,QAAQ,EAAE;YACjI,OAAO,WAAW,GAAEC,OAAMP,aAAa,CAACQ,gCAAe,EAAE,IAAI,CAACxB,aAAa;QAC7E;QACA,OAAO,WAAW,GAAEuB,OAAMP,aAAa,CAACQ,gCAAe,EAAE,IAAI,CAACxB,aAAa,EAAE,IAAI,CAACF,MAAM;IAC1F;IACA2B,gBAAgB;QACd,OAAO;YACLpB,MAAM,IAAI,CAACP,MAAM;YACjBQ,MAAM,IAAI,CAACP,MAAM;YACjBQ,aAAa,IAAI,CAACP,aAAa;QACjC;IACF;IACA0B,iBAAiBpB,IAAI,EAAE;QACrB,MAAMqB,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS7B,MAAM,GAAGQ,KAAKD,IAAI;QAC3BsB,SAAS5B,MAAM,GAAGO,KAAKA,IAAI;QAC3BqB,SAAS3B,aAAa,GAAGM,KAAKC,WAAW;IAC3C;IACAsB,YAAYzB,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,WAAW,EAAEuB,GAAG,CAAE;QAClD,KAAK,CAACA;QACNC,IAAAA,kBAAgB,EAAC,IAAI,EAAE,cAAc,KAAK;QAC1CA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,UAAU,KAAK;QACtCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,iBAAiB,KAAK;QAC7CA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,UAAU,KAAK;QACtC,IAAI,CAAClC,UAAU,GAAGO;QAClB,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,MAAM,GAAGO;QACd,IAAI,CAACN,aAAa,GAAGO;IACvB;AACF;AACO,SAAShB,2BAA2Ba,QAAQ,EAAEC,IAAI,EAAEC,IAAI,EAAEC,WAAW,EAAEuB,GAAG;IAC/E,OAAO,IAAIxC,oBAAoBc,UAAUC,MAAMC,MAAMC,aAAauB;AACpE;AACO,SAAStC,uBAAuBI,IAAI;IACzC,OAAOA,gBAAgBN;AACzB,EACA,gDAAgD"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ChatInputEntityPlugin", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ChatInputEntityPlugin;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
+ const _ChatInputEntitynode = require("./ChatInputEntity.node");
15
+ const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
16
+ const ChatInputEntityPlugin = (props)=>{
17
+ const { id, controlRef, onChatInputEntityAdded, onChatInputEntityDeleted } = props;
18
+ const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
19
+ const chatInputEntityPluginBase = _react.useRef(null);
20
+ _react.useEffect(()=>{
21
+ chatInputEntityPluginBase.current = new _chatinputplugins.ChatInputEntityPluginBase(editor, id, _ChatInputEntitynode.ChatInputEntityNode, _ChatInputEntitynode.$createChatInputEntityNode, _ChatInputEntitynode.$isChatInputEntityNode, onChatInputEntityAdded, onChatInputEntityDeleted);
22
+ return ()=>{
23
+ var _chatInputEntityPluginBase_current;
24
+ return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.cleanup();
25
+ };
26
+ }, [
27
+ editor,
28
+ id,
29
+ onChatInputEntityAdded,
30
+ onChatInputEntityDeleted
31
+ ]);
32
+ _react.useImperativeHandle(controlRef, ()=>({
33
+ insertChatInputEntity (props) {
34
+ var _chatInputEntityPluginBase_current;
35
+ return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.insertChatInputEntity(props);
36
+ },
37
+ getActiveEntities () {
38
+ var _chatInputEntityPluginBase_current;
39
+ var _chatInputEntityPluginBase_current_getActiveEntities;
40
+ return (_chatInputEntityPluginBase_current_getActiveEntities = (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.getActiveEntities()) !== null && _chatInputEntityPluginBase_current_getActiveEntities !== void 0 ? _chatInputEntityPluginBase_current_getActiveEntities : [];
41
+ },
42
+ removeChatInputEntity (keyOrPredicate) {
43
+ var _chatInputEntityPluginBase_current;
44
+ (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.removeChatInputEntity(keyOrPredicate);
45
+ },
46
+ updateChatInputEntityProps (keyOrPredicate, props) {
47
+ var _chatInputEntityPluginBase_current;
48
+ (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.updateChatInputEntityProps(keyOrPredicate, props);
49
+ }
50
+ }), []);
51
+ return null;
52
+ }; //# sourceMappingURL=ChatInputEntityPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ChatInputEntityPlugin.js"],"sourcesContent":["import { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport * as React from 'react';\nimport { $createChatInputEntityNode, $isChatInputEntityNode, ChatInputEntityNode } from './ChatInputEntity.node';\nimport { ChatInputEntityPluginBase } from '@fluentui-copilot/chat-input-plugins';\nexport const ChatInputEntityPlugin = props => {\n const {\n id,\n controlRef,\n onChatInputEntityAdded,\n onChatInputEntityDeleted\n } = props;\n const [editor] = useLexicalComposerContext();\n const chatInputEntityPluginBase = React.useRef(null);\n React.useEffect(() => {\n chatInputEntityPluginBase.current = new ChatInputEntityPluginBase(editor, id, ChatInputEntityNode, $createChatInputEntityNode, $isChatInputEntityNode, onChatInputEntityAdded, onChatInputEntityDeleted);\n return () => {\n var _chatInputEntityPluginBase_current;\n return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.cleanup();\n };\n }, [editor, id, onChatInputEntityAdded, onChatInputEntityDeleted]);\n React.useImperativeHandle(controlRef, () => ({\n insertChatInputEntity(props) {\n var _chatInputEntityPluginBase_current;\n return (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.insertChatInputEntity(props);\n },\n getActiveEntities() {\n var _chatInputEntityPluginBase_current;\n var _chatInputEntityPluginBase_current_getActiveEntities;\n return (_chatInputEntityPluginBase_current_getActiveEntities = (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.getActiveEntities()) !== null && _chatInputEntityPluginBase_current_getActiveEntities !== void 0 ? _chatInputEntityPluginBase_current_getActiveEntities : [];\n },\n removeChatInputEntity(keyOrPredicate) {\n var _chatInputEntityPluginBase_current;\n (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.removeChatInputEntity(keyOrPredicate);\n },\n updateChatInputEntityProps(keyOrPredicate, props) {\n var _chatInputEntityPluginBase_current;\n (_chatInputEntityPluginBase_current = chatInputEntityPluginBase.current) === null || _chatInputEntityPluginBase_current === void 0 ? void 0 : _chatInputEntityPluginBase_current.updateChatInputEntityProps(keyOrPredicate, props);\n }\n }), []);\n return null;\n};\n//# sourceMappingURL=ChatInputEntityPlugin.js.map"],"names":["ChatInputEntityPlugin","props","id","controlRef","onChatInputEntityAdded","onChatInputEntityDeleted","editor","useLexicalComposerContext","chatInputEntityPluginBase","React","useRef","useEffect","current","ChatInputEntityPluginBase","ChatInputEntityNode","$createChatInputEntityNode","$isChatInputEntityNode","_chatInputEntityPluginBase_current","cleanup","useImperativeHandle","insertChatInputEntity","getActiveEntities","_chatInputEntityPluginBase_current_getActiveEntities","removeChatInputEntity","keyOrPredicate","updateChatInputEntityProps"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iCAJ6B;iEACnB;qCACiE;kCAC9C;AACnC,MAAMA,wBAAwBC,CAAAA;IACnC,MAAM,EACJC,EAAE,EACFC,UAAU,EACVC,sBAAsB,EACtBC,wBAAwB,EACzB,GAAGJ;IACJ,MAAM,CAACK,OAAO,GAAGC,IAAAA,0CAAyB;IAC1C,MAAMC,4BAA4BC,OAAMC,MAAM,CAAC;IAC/CD,OAAME,SAAS,CAAC;QACdH,0BAA0BI,OAAO,GAAG,IAAIC,2CAAyB,CAACP,QAAQJ,IAAIY,wCAAmB,EAAEC,+CAA0B,EAAEC,2CAAsB,EAAEZ,wBAAwBC;QAC/K,OAAO;YACL,IAAIY;YACJ,OAAO,AAACA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCC,OAAO;QACjM;IACF,GAAG;QAACZ;QAAQJ;QAAIE;QAAwBC;KAAyB;IACjEI,OAAMU,mBAAmB,CAAChB,YAAY,IAAO,CAAA;YAC3CiB,uBAAsBnB,KAAK;gBACzB,IAAIgB;gBACJ,OAAO,AAACA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCG,qBAAqB,CAACnB;YAChN;YACAoB;gBACE,IAAIJ;gBACJ,IAAIK;gBACJ,OAAO,AAACA,CAAAA,uDAAuD,AAACL,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCI,iBAAiB,EAAC,MAAO,QAAQC,yDAAyD,KAAK,IAAIA,uDAAuD,EAAE;YAC9Y;YACAC,uBAAsBC,cAAc;gBAClC,IAAIP;gBACHA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCM,qBAAqB,CAACC;YACzM;YACAC,4BAA2BD,cAAc,EAAEvB,KAAK;gBAC9C,IAAIgB;gBACHA,CAAAA,qCAAqCT,0BAA0BI,OAAO,AAAD,MAAO,QAAQK,uCAAuC,KAAK,IAAI,KAAK,IAAIA,mCAAmCQ,0BAA0B,CAACD,gBAAgBvB;YAC9N;QACF,CAAA,GAAI,EAAE;IACN,OAAO;AACT,GACA,iDAAiD"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ //# sourceMappingURL=ChatInputEntityPlugin.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ChatInputEntityPlugin.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=ChatInputEntityPlugin.types.js.map"],"names":[],"mappings":";;;;CACA,uDAAuD"}
@@ -0,0 +1,9 @@
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("./ChatInputEntity.node"), exports);
7
+ _export_star._(require("./ChatInputEntityPlugin"), exports);
8
+ _export_star._(require("./ChatInputEntityPlugin.types"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ChatInputEntity.node';\nexport * from './ChatInputEntityPlugin';\nexport * from './ChatInputEntityPlugin.types';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;CACd,iCAAiC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "GhostTextPlugin", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return GhostTextPlugin;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
14
+ const _GhostText = require("../../GhostText");
15
+ const _GhostTextnode = require("./GhostText.node");
16
+ const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
17
+ function GhostTextPlugin(props) {
18
+ const { $getGhostText, id, ghostTextProps, exposeText, allowCompletion } = props;
19
+ const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
20
+ const ghostTextBase = _react.useRef(null);
21
+ _react.useEffect(()=>{
22
+ ghostTextBase.current = new _chatinputplugins.GhostTextPluginBase(editor, id, $getGhostText, _GhostTextnode.GhostTextNode, _GhostText.$createGhostTextNode, ghostTextProps, exposeText, allowCompletion);
23
+ return ()=>{
24
+ var _ghostTextBase_current;
25
+ (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.cleanup();
26
+ };
27
+ }, // We can update $getGhostText, $createGhostTextNode, ghostTextProps, exposeText, and allowCompletion without remounting
28
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
+ [
30
+ editor,
31
+ id
32
+ ]);
33
+ _react.useEffect(()=>{
34
+ var _ghostTextBase_current;
35
+ (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setAllowCompletion(allowCompletion);
36
+ }, [
37
+ allowCompletion
38
+ ]);
39
+ _react.useEffect(()=>{
40
+ var _ghostTextBase_current;
41
+ (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setComponentProps(ghostTextProps);
42
+ }, [
43
+ ghostTextProps
44
+ ]);
45
+ _react.useEffect(()=>{
46
+ var _ghostTextBase_current;
47
+ (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setExposeText(exposeText);
48
+ }, [
49
+ exposeText
50
+ ]);
51
+ _react.useEffect(()=>{
52
+ var _ghostTextBase_current;
53
+ (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setGetGhostText($getGhostText);
54
+ }, [
55
+ $getGhostText
56
+ ]);
57
+ return null;
58
+ } //# sourceMappingURL=GhostText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GhostText.js"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { $createGhostTextNode } from '../../GhostText';\nimport { GhostTextNode } from './GhostText.node';\nimport { GhostTextPluginBase } from '@fluentui-copilot/chat-input-plugins';\nexport function GhostTextPlugin(props) {\n const {\n $getGhostText,\n id,\n ghostTextProps,\n exposeText,\n allowCompletion\n } = props;\n const [editor] = useLexicalComposerContext();\n const ghostTextBase = React.useRef(null);\n React.useEffect(() => {\n ghostTextBase.current = new GhostTextPluginBase(editor, id, $getGhostText, GhostTextNode, $createGhostTextNode, ghostTextProps, exposeText, allowCompletion);\n return () => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _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 React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setAllowCompletion(allowCompletion);\n }, [allowCompletion]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setComponentProps(ghostTextProps);\n }, [ghostTextProps]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setExposeText(exposeText);\n }, [exposeText]);\n React.useEffect(() => {\n var _ghostTextBase_current;\n (_ghostTextBase_current = ghostTextBase.current) === null || _ghostTextBase_current === void 0 ? void 0 : _ghostTextBase_current.setGetGhostText($getGhostText);\n }, [$getGhostText]);\n return null;\n}\n//# sourceMappingURL=GhostText.js.map"],"names":["GhostTextPlugin","props","$getGhostText","id","ghostTextProps","exposeText","allowCompletion","editor","useLexicalComposerContext","ghostTextBase","React","useRef","useEffect","current","GhostTextPluginBase","GhostTextNode","$createGhostTextNode","_ghostTextBase_current","cleanup","setAllowCompletion","setComponentProps","setExposeText","setGetGhostText"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;iCACmB;2BACL;+BACP;kCACM;AAC7B,SAASA,gBAAgBC,KAAK;IACnC,MAAM,EACJC,aAAa,EACbC,EAAE,EACFC,cAAc,EACdC,UAAU,EACVC,eAAe,EAChB,GAAGL;IACJ,MAAM,CAACM,OAAO,GAAGC,IAAAA,0CAAyB;IAC1C,MAAMC,gBAAgBC,OAAMC,MAAM,CAAC;IACnCD,OAAME,SAAS,CAAC;QACdH,cAAcI,OAAO,GAAG,IAAIC,qCAAmB,CAACP,QAAQJ,IAAID,eAAea,4BAAa,EAAEC,+BAAoB,EAAEZ,gBAAgBC,YAAYC;QAC5I,OAAO;YACL,IAAIW;YACHA,CAAAA,yBAAyBR,cAAcI,OAAO,AAAD,MAAO,QAAQI,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBC,OAAO;QAC1I;IACF,GACA,wHAAwH;IACxH,uDAAuD;IACvD;QAACX;QAAQJ;KAAG;IACZO,OAAME,SAAS,CAAC;QACd,IAAIK;QACHA,CAAAA,yBAAyBR,cAAcI,OAAO,AAAD,MAAO,QAAQI,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBE,kBAAkB,CAACb;IACtJ,GAAG;QAACA;KAAgB;IACpBI,OAAME,SAAS,CAAC;QACd,IAAIK;QACHA,CAAAA,yBAAyBR,cAAcI,OAAO,AAAD,MAAO,QAAQI,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBG,iBAAiB,CAAChB;IACrJ,GAAG;QAACA;KAAe;IACnBM,OAAME,SAAS,CAAC;QACd,IAAIK;QACHA,CAAAA,yBAAyBR,cAAcI,OAAO,AAAD,MAAO,QAAQI,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBI,aAAa,CAAChB;IACjJ,GAAG;QAACA;KAAW;IACfK,OAAME,SAAS,CAAC;QACd,IAAIK;QACHA,CAAAA,yBAAyBR,cAAcI,OAAO,AAAD,MAAO,QAAQI,2BAA2B,KAAK,IAAI,KAAK,IAAIA,uBAAuBK,eAAe,CAACpB;IACnJ,GAAG;QAACA;KAAc;IAClB,OAAO;AACT,EACA,qCAAqC"}
@@ -0,0 +1,82 @@
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
+ GhostTextNode: function() {
13
+ return GhostTextNode;
14
+ },
15
+ $createGhostTextNode: function() {
16
+ return $createGhostTextNode;
17
+ },
18
+ $isGhostTextNode: function() {
19
+ return $isGhostTextNode;
20
+ }
21
+ });
22
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
23
+ const _define_property = require("@swc/helpers/_/_define_property");
24
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
25
+ const _texteditor = require("@fluentui-copilot/text-editor");
26
+ const _GhostText = require("../../components/GhostText/GhostText");
27
+ class GhostTextNode extends _texteditor.DecoratorNode {
28
+ static clone(node) {
29
+ return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);
30
+ }
31
+ static getType() {
32
+ return 'ghosttext';
33
+ }
34
+ static importJSON(serializedNode) {
35
+ const node = $createGhostTextNode(serializedNode.id, serializedNode.content, serializedNode.exposeText, serializedNode.componentProps);
36
+ return node;
37
+ }
38
+ exportJSON() {
39
+ return {
40
+ ...super.exportJSON(),
41
+ type: 'ghosttext',
42
+ id: this.__id,
43
+ content: this.__content,
44
+ componentProps: this.__componentProps,
45
+ exposeText: this.__exposeText,
46
+ version: 1
47
+ };
48
+ }
49
+ isInline() {
50
+ return true;
51
+ }
52
+ getTextContent() {
53
+ return this.__exposeText ? this.__content : '';
54
+ }
55
+ updateDOM(prevNode, dom, config) {
56
+ return false;
57
+ }
58
+ createDOM(config) {
59
+ return document.createElement('span');
60
+ }
61
+ decorate() {
62
+ return /*#__PURE__*/ _react.createElement(_GhostText.GhostText, this.__componentProps, this.__content);
63
+ }
64
+ constructor(id, content, exposeText, componentProps, key){
65
+ super(key);
66
+ (0, _define_property._)(this, "__content", void 0);
67
+ (0, _define_property._)(this, "__id", void 0);
68
+ (0, _define_property._)(this, "__allowCommitting", void 0);
69
+ (0, _define_property._)(this, "__componentProps", void 0);
70
+ (0, _define_property._)(this, "__exposeText", void 0);
71
+ this.__id = id;
72
+ this.__content = content;
73
+ this.__exposeText = exposeText;
74
+ this.__componentProps = componentProps;
75
+ }
76
+ }
77
+ function $createGhostTextNode(id, content, exposeText, componentProps) {
78
+ return new GhostTextNode(id, content, exposeText, componentProps);
79
+ }
80
+ function $isGhostTextNode(node) {
81
+ return node instanceof GhostTextNode;
82
+ } //# sourceMappingURL=GhostText.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["GhostText.node.js"],"sourcesContent":["import { _ as _define_property } from \"@swc/helpers/_/_define_property\";\nimport * as React from 'react';\nimport { DecoratorNode } from '@fluentui-copilot/text-editor';\nimport { GhostText } from '../../components/GhostText/GhostText';\nexport class GhostTextNode extends DecoratorNode {\n static clone(node) {\n return new GhostTextNode(node.__id, node.__content, node.__exposeText, node.__componentProps, node.__key);\n }\n static getType() {\n return 'ghosttext';\n }\n static importJSON(serializedNode) {\n const node = $createGhostTextNode(serializedNode.id, serializedNode.content, serializedNode.exposeText, serializedNode.componentProps);\n return node;\n }\n exportJSON() {\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 isInline() {\n return true;\n }\n getTextContent() {\n return this.__exposeText ? this.__content : '';\n }\n updateDOM(prevNode, dom, config) {\n return false;\n }\n createDOM(config) {\n return document.createElement('span');\n }\n decorate() {\n return /*#__PURE__*/React.createElement(GhostText, this.__componentProps, this.__content);\n }\n constructor(id, content, exposeText, componentProps, key) {\n super(key);\n _define_property(this, \"__content\", void 0);\n _define_property(this, \"__id\", void 0);\n _define_property(this, \"__allowCommitting\", void 0);\n _define_property(this, \"__componentProps\", void 0);\n _define_property(this, \"__exposeText\", void 0);\n this.__id = id;\n this.__content = content;\n this.__exposeText = exposeText;\n this.__componentProps = componentProps;\n }\n}\nexport function $createGhostTextNode(id, content, exposeText, componentProps) {\n return new GhostTextNode(id, content, exposeText, componentProps);\n}\nexport function $isGhostTextNode(node) {\n return node instanceof GhostTextNode;\n}\n//# sourceMappingURL=GhostText.node.js.map"],"names":["GhostTextNode","$createGhostTextNode","$isGhostTextNode","DecoratorNode","clone","node","__id","__content","__exposeText","__componentProps","__key","getType","importJSON","serializedNode","id","content","exposeText","componentProps","exportJSON","type","version","isInline","getTextContent","updateDOM","prevNode","dom","config","createDOM","document","createElement","decorate","React","GhostText","constructor","key","_define_property"],"mappings":";;;;;;;;;;;IAIaA,aAAa;eAAbA;;IAkDGC,oBAAoB;eAApBA;;IAGAC,gBAAgB;eAAhBA;;;;iCAzDsB;iEACf;4BACO;2BACJ;AACnB,MAAMF,sBAAsBG,yBAAa;IAC9C,OAAOC,MAAMC,IAAI,EAAE;QACjB,OAAO,IAAIL,cAAcK,KAAKC,IAAI,EAAED,KAAKE,SAAS,EAAEF,KAAKG,YAAY,EAAEH,KAAKI,gBAAgB,EAAEJ,KAAKK,KAAK;IAC1G;IACA,OAAOC,UAAU;QACf,OAAO;IACT;IACA,OAAOC,WAAWC,cAAc,EAAE;QAChC,MAAMR,OAAOJ,qBAAqBY,eAAeC,EAAE,EAAED,eAAeE,OAAO,EAAEF,eAAeG,UAAU,EAAEH,eAAeI,cAAc;QACrI,OAAOZ;IACT;IACAa,aAAa;QACX,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNL,IAAI,IAAI,CAACR,IAAI;YACbS,SAAS,IAAI,CAACR,SAAS;YACvBU,gBAAgB,IAAI,CAACR,gBAAgB;YACrCO,YAAY,IAAI,CAACR,YAAY;YAC7BY,SAAS;QACX;IACF;IACAC,WAAW;QACT,OAAO;IACT;IACAC,iBAAiB;QACf,OAAO,IAAI,CAACd,YAAY,GAAG,IAAI,CAACD,SAAS,GAAG;IAC9C;IACAgB,UAAUC,QAAQ,EAAEC,GAAG,EAAEC,MAAM,EAAE;QAC/B,OAAO;IACT;IACAC,UAAUD,MAAM,EAAE;QAChB,OAAOE,SAASC,aAAa,CAAC;IAChC;IACAC,WAAW;QACT,OAAO,WAAW,GAAEC,OAAMF,aAAa,CAACG,oBAAS,EAAE,IAAI,CAACvB,gBAAgB,EAAE,IAAI,CAACF,SAAS;IAC1F;IACA0B,YAAYnB,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,cAAc,EAAEiB,GAAG,CAAE;QACxD,KAAK,CAACA;QACNC,IAAAA,kBAAgB,EAAC,IAAI,EAAE,aAAa,KAAK;QACzCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,QAAQ,KAAK;QACpCA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,qBAAqB,KAAK;QACjDA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,oBAAoB,KAAK;QAChDA,IAAAA,kBAAgB,EAAC,IAAI,EAAE,gBAAgB,KAAK;QAC5C,IAAI,CAAC7B,IAAI,GAAGQ;QACZ,IAAI,CAACP,SAAS,GAAGQ;QACjB,IAAI,CAACP,YAAY,GAAGQ;QACpB,IAAI,CAACP,gBAAgB,GAAGQ;IAC1B;AACF;AACO,SAAShB,qBAAqBa,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,cAAc;IAC1E,OAAO,IAAIjB,cAAcc,IAAIC,SAASC,YAAYC;AACpD;AACO,SAASf,iBAAiBG,IAAI;IACnC,OAAOA,gBAAgBL;AACzB,EACA,0CAA0C"}
@@ -0,0 +1,8 @@
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("./GhostText"), exports);
7
+ _export_star._(require("./GhostText.node"), exports);
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './GhostText';\nexport * from './GhostText.node';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;uBACA;CACd,iCAAiC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ImperativeControlPlugin", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ImperativeControlPlugin;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
14
+ const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
15
+ const ImperativeControlPlugin = /*#__PURE__*/ _react.forwardRef((_props, ref)=>{
16
+ const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
17
+ _react.useImperativeHandle(ref, ()=>new _chatinputplugins.ImperativeControlBase(editor), [
18
+ editor
19
+ ]);
20
+ return null;
21
+ }); //# sourceMappingURL=ImperativeControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ImperativeControl.js"],"sourcesContent":["import * as React from 'react';\nimport { ImperativeControlBase } from '@fluentui-copilot/chat-input-plugins';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nexport const ImperativeControlPlugin = /*#__PURE__*/React.forwardRef((_props, ref) => {\n const [editor] = useLexicalComposerContext();\n React.useImperativeHandle(ref, () => new ImperativeControlBase(editor), [editor]);\n return null;\n});\n//# sourceMappingURL=ImperativeControl.js.map"],"names":["ImperativeControlPlugin","React","forwardRef","_props","ref","editor","useLexicalComposerContext","useImperativeHandle","ImperativeControlBase"],"mappings":";;;;+BAGaA;;;eAAAA;;;;iEAHU;kCACe;iCACI;AACnC,MAAMA,0BAA0B,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,QAAQC;IAC5E,MAAM,CAACC,OAAO,GAAGC,IAAAA,0CAAyB;IAC1CL,OAAMM,mBAAmB,CAACH,KAAK,IAAM,IAAII,uCAAqB,CAACH,SAAS;QAACA;KAAO;IAChF,OAAO;AACT,IACA,6CAA6C"}
@@ -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("./ImperativeControl"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ImperativeControl';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,iCAAiC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ManualGhostTextPlugin", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ManualGhostTextPlugin;
9
+ }
10
+ });
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reacttexteditor = require("@fluentui-copilot/react-text-editor");
14
+ const _GhostText = require("../../GhostText");
15
+ const _chatinputplugins = require("@fluentui-copilot/chat-input-plugins");
16
+ const ManualGhostTextPlugin = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
17
+ const { id } = props;
18
+ const [editor] = (0, _reacttexteditor.useLexicalComposerContext)();
19
+ _react.useImperativeHandle(ref, ()=>new _chatinputplugins.ManualGhostTextBase(editor, id, _GhostText.$isGhostTextNode, _GhostText.$createGhostTextNode), [
20
+ editor,
21
+ id
22
+ ]);
23
+ return null;
24
+ });
25
+ ManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin'; //# sourceMappingURL=ManualGhostText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["ManualGhostText.js"],"sourcesContent":["import * as React from 'react';\nimport { useLexicalComposerContext } from '@fluentui-copilot/react-text-editor';\nimport { $createGhostTextNode, $isGhostTextNode } from '../../GhostText';\nimport { ManualGhostTextBase } from '@fluentui-copilot/chat-input-plugins';\nexport const ManualGhostTextPlugin = React.forwardRef((props, ref) => {\n const {\n id\n } = props;\n const [editor] = useLexicalComposerContext();\n React.useImperativeHandle(ref, () => new ManualGhostTextBase(editor, id, $isGhostTextNode, $createGhostTextNode), [editor, id]);\n return null;\n});\nManualGhostTextPlugin.displayName = 'ManualGhostTextPlugin';\n//# sourceMappingURL=ManualGhostText.js.map"],"names":["ManualGhostTextPlugin","React","forwardRef","props","ref","id","editor","useLexicalComposerContext","useImperativeHandle","ManualGhostTextBase","$isGhostTextNode","$createGhostTextNode","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;iCACmB;2BACa;kCACnB;AAC7B,MAAMA,sCAAwBC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC5D,MAAM,EACJC,EAAE,EACH,GAAGF;IACJ,MAAM,CAACG,OAAO,GAAGC,IAAAA,0CAAyB;IAC1CN,OAAMO,mBAAmB,CAACJ,KAAK,IAAM,IAAIK,qCAAmB,CAACH,QAAQD,IAAIK,2BAAgB,EAAEC,+BAAoB,GAAG;QAACL;QAAQD;KAAG;IAC9H,OAAO;AACT;AACAL,sBAAsBY,WAAW,GAAG,yBACpC,2CAA2C"}
@@ -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("./ManualGhostText"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './ManualGhostText';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;uBAAc;CACd,iCAAiC"}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@fluentui-copilot/react-chat-input-plugins",
3
+ "version": "0.0.0-nightly-20240410-0405-8d7a6b79.1",
4
+ "description": "A Fluent AI package for React-based ChatInput plugins.",
5
+ "main": "lib-commonjs/index.js",
6
+ "module": "lib/index.js",
7
+ "typings": "./dist/index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/microsoft/fluentai"
12
+ },
13
+ "license": "MIT",
14
+ "dependencies": {
15
+ "@fluentui-copilot/chat-input-plugins": "0.0.0-nightly-20240410-0405-8d7a6b79.1",
16
+ "@fluentui-copilot/react-text-editor": "0.0.0-nightly-20240410-0405-8d7a6b79.1",
17
+ "@fluentui-copilot/text-editor": "0.0.0-nightly-20240410-0405-8d7a6b79.1",
18
+ "@swc/helpers": "^0.5.1"
19
+ },
20
+ "peerDependencies": {
21
+ "@fluentui/react-components": ">=9.37.3 <10.0.0",
22
+ "@fluentui/react-jsx-runtime": ">=9.0.18 <10.0.0",
23
+ "@fluentui/react-utilities": ">=9.15.1 <10.0.0",
24
+ "@types/react": ">=16.14.0 <19.0.0",
25
+ "@types/react-dom": ">=16.9.8 <19.0.0",
26
+ "react": ">=16.14.0 <19.0.0",
27
+ "react-dom": ">=16.14.0 <19.0.0"
28
+ },
29
+ "beachball": {},
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "node": "./lib-commonjs/index.js",
34
+ "import": "./lib/index.js",
35
+ "require": "./lib-commonjs/index.js"
36
+ },
37
+ "./package.json": "./package.json"
38
+ }
39
+ }