@fluentui-copilot/chat-input-plugins 0.0.0-nightly-20241018-0406-6daa9be4.1 → 0.0.0-nightly-20241023-0410-2bdb166c.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui-copilot/chat-input-plugins",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 18 Oct 2024 04:13:58 GMT",
6
- "tag": "@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241018-0406-6daa9be4.1",
7
- "version": "0.0.0-nightly-20241018-0406-6daa9be4.1",
5
+ "date": "Wed, 23 Oct 2024 04:17:42 GMT",
6
+ "tag": "@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241023-0410-2bdb166c.1",
7
+ "version": "0.0.0-nightly-20241023-0410-2bdb166c.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -16,8 +16,8 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui-copilot/chat-input-plugins",
19
- "comment": "Bump @fluentui-copilot/text-editor to v0.0.0-nightly-20241018-0406-6daa9be4.1",
20
- "commit": "e6e2f63feb2c7cce5e4888f2dcf7833435c80b29"
19
+ "comment": "Bump @fluentui-copilot/text-editor to v0.0.0-nightly-20241023-0410-2bdb166c.1",
20
+ "commit": "2c749811bdfcb2ebd379ace27fa722dbb4e7a1e9"
21
21
  }
22
22
  ]
23
23
  }
package/CHANGELOG.md CHANGED
@@ -1,18 +1,18 @@
1
1
  # Change Log - @fluentui-copilot/chat-input-plugins
2
2
 
3
- This log was last generated on Fri, 18 Oct 2024 04:13:58 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 23 Oct 2024 04:17:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20241018-0406-6daa9be4.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241018-0406-6daa9be4.1)
7
+ ## [0.0.0-nightly-20241023-0410-2bdb166c.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241023-0410-2bdb166c.1)
8
8
 
9
- Fri, 18 Oct 2024 04:13:58 GMT
10
- [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/chat-input-plugins_v0.3.0..@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241018-0406-6daa9be4.1)
9
+ Wed, 23 Oct 2024 04:17:42 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/chat-input-plugins_v0.3.0..@fluentui-copilot/chat-input-plugins_v0.0.0-nightly-20241023-0410-2bdb166c.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly ([commit](https://github.com/microsoft/fluentai/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui-copilot/text-editor to v0.0.0-nightly-20241018-0406-6daa9be4.1 ([commit](https://github.com/microsoft/fluentai/commit/e6e2f63feb2c7cce5e4888f2dcf7833435c80b29) by beachball)
15
+ - Bump @fluentui-copilot/text-editor to v0.0.0-nightly-20241023-0410-2bdb166c.1 ([commit](https://github.com/microsoft/fluentai/commit/2c749811bdfcb2ebd379ace27fa722dbb4e7a1e9) by beachball)
16
16
 
17
17
  ## [0.3.0](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/chat-input-plugins_v0.3.0)
18
18
 
package/dist/index.d.ts CHANGED
@@ -126,9 +126,9 @@ export declare interface IImperativeControlBase {
126
126
 
127
127
  export declare interface IManualGhostTextBase<ComponentPropsType> {
128
128
  getGhostText: () => string | undefined;
129
- setGhostText: (text: string, componentProps?: ComponentPropsType) => void;
130
- commitGhostText: (finalText: string) => void;
131
- cancelGhostText: () => void;
129
+ setGhostText: (text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean) => void;
130
+ commitGhostText: (finalText: string, discrete?: boolean) => void;
131
+ cancelGhostText: (discrete?: boolean) => void;
132
132
  }
133
133
 
134
134
  export declare class ImperativeControlBase implements IImperativeControlBase {
@@ -143,7 +143,7 @@ export declare class ImperativeControlBase implements IImperativeControlBase {
143
143
  scrollToBottom(): void;
144
144
  }
145
145
 
146
- export declare class ManualGhostTextBase<ComponentPropsType> {
146
+ export declare class ManualGhostTextBase<ComponentPropsType> implements IManualGhostTextBase<ComponentPropsType> {
147
147
  private __editor;
148
148
  private __nodeKey?;
149
149
  private __id;
@@ -151,9 +151,9 @@ export declare class ManualGhostTextBase<ComponentPropsType> {
151
151
  private __$createNode;
152
152
  constructor(editor: LexicalEditor, id: string, $isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>, $createNode: (id: string, content: string, exposeText?: boolean, componentProps?: ComponentPropsType) => IGhostTextNode<ComponentPropsType>);
153
153
  getGhostText(): string | undefined;
154
- setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType): void;
155
- commitGhostText(finalText: string): void;
156
- cancelGhostText(): void;
154
+ setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean): void;
155
+ commitGhostText(finalText: string, discrete?: boolean): void;
156
+ cancelGhostText(discrete?: boolean): void;
157
157
  }
158
158
 
159
159
  export declare type PasteUnfurlingPluginBaseProps<ExtraDataType, NodePropsType> = {
@@ -11,7 +11,7 @@ export class ManualGhostTextBase {
11
11
  }
12
12
  });
13
13
  }
14
- setGhostText(text, exposeText, componentProps) {
14
+ setGhostText(text, exposeText, componentProps, discrete) {
15
15
  this.__editor.update(() => {
16
16
  if (this.__nodeKey) {
17
17
  const node = $getNodeByKey(this.__nodeKey);
@@ -25,10 +25,11 @@ export class ManualGhostTextBase {
25
25
  $insertNodes([node]);
26
26
  node.selectStart();
27
27
  }, {
28
- tag: 'historic'
28
+ tag: 'historic',
29
+ discrete: discrete ? true : undefined
29
30
  });
30
31
  }
31
- commitGhostText(finalText) {
32
+ commitGhostText(finalText, discrete) {
32
33
  if (this.__nodeKey) {
33
34
  this.__editor.update(() => {
34
35
  if (this.__nodeKey) {
@@ -39,11 +40,13 @@ export class ManualGhostTextBase {
39
40
  textNode.selectEnd();
40
41
  }
41
42
  }
43
+ }, {
44
+ discrete: discrete ? true : undefined
42
45
  });
43
46
  this.__nodeKey = undefined;
44
47
  }
45
48
  }
46
- cancelGhostText() {
49
+ cancelGhostText(discrete) {
47
50
  if (this.__nodeKey) {
48
51
  this.__editor.update(() => {
49
52
  if (this.__nodeKey) {
@@ -53,7 +56,8 @@ export class ManualGhostTextBase {
53
56
  }
54
57
  }
55
58
  }, {
56
- tag: 'historic'
59
+ tag: 'historic',
60
+ discrete: discrete ? true : undefined
57
61
  });
58
62
  this.__nodeKey = undefined;
59
63
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["ManualGhostText.base.ts"],"sourcesContent":["import {\n $createTextNode,\n $getNodeByKey,\n $insertNodes,\n type LexicalEditor,\n type LexicalNode,\n} from '@fluentui-copilot/text-editor';\nimport type { IGhostTextNode } from '../GhostText';\n\nexport interface IManualGhostTextBase<ComponentPropsType> {\n getGhostText: () => string | undefined;\n setGhostText: (text: string, componentProps?: ComponentPropsType) => void;\n commitGhostText: (finalText: string) => void;\n cancelGhostText: () => void;\n}\n\nexport class ManualGhostTextBase<ComponentPropsType> {\n private __editor: LexicalEditor;\n private __nodeKey?: string;\n\n private __id: string;\n private __$isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>;\n private __$createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>;\n\n constructor(\n editor: LexicalEditor,\n id: string,\n $isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>,\n $createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>,\n ) {\n this.__editor = editor;\n this.__id = id;\n this.__$isNodeType = $isNodeType;\n this.__$createNode = $createNode;\n }\n\n getGhostText(): string | undefined {\n return this.__editor.getEditorState().read(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n return node.__content;\n }\n }\n });\n }\n\n setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType): void {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.getWritable().__content = text;\n return;\n }\n }\n\n const node = this.__$createNode(this.__id, text, exposeText, componentProps);\n this.__nodeKey = node.getKey();\n $insertNodes([node]);\n node.selectStart();\n },\n { tag: 'historic' },\n );\n }\n\n commitGhostText(finalText: string): void {\n if (this.__nodeKey) {\n this.__editor.update(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n const textNode = $createTextNode(finalText);\n node.replace(textNode);\n textNode.selectEnd();\n }\n }\n });\n this.__nodeKey = undefined;\n }\n }\n\n cancelGhostText(): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.remove();\n }\n }\n },\n { tag: 'historic' },\n );\n this.__nodeKey = undefined;\n }\n }\n}\n"],"names":["$createTextNode","$getNodeByKey","$insertNodes","ManualGhostTextBase","getGhostText","__editor","getEditorState","read","__nodeKey","node","__$isNodeType","__content","setGhostText","text","exposeText","componentProps","update","getWritable","__$createNode","__id","getKey","selectStart","tag","commitGhostText","finalText","textNode","replace","selectEnd","undefined","cancelGhostText","remove","constructor","editor","id","$isNodeType","$createNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SACEA,eAAe,EACfC,aAAa,EACbC,YAAY,QAGP,gCAAgC;AAUvC,OAAO,MAAMC;I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CAClB;gBACE,IAAI,IAAI,CAACR,SAAS,EAAE;oBAClB,MAAMC,OAAOR,cAAc,IAAI,CAACO,SAAS;oBACzC,IAAI,IAAI,CAACE,aAAa,CAACD,OAAO;wBAC5BA,KAAKqB,MAAM;oBACb;gBACF;YACF,GACA;gBAAER,KAAK;YAAW;YAEpB,IAAI,CAACd,SAAS,GAAGoB;QACnB;IACF;IA/EAG,YACEC,MAAqB,EACrBC,EAAU,EACVC,WAAqF,EACrFC,WAKuC,CACvC;QAtBF,uBAAQ9B,YAAR,KAAA;QACA,uBAAQG,aAAR,KAAA;QAEA,uBAAQW,QAAR,KAAA;QACA,uBAAQT,iBAAR,KAAA;QACA,uBAAQQ,iBAAR,KAAA;QAkBE,IAAI,CAACb,QAAQ,GAAG2B;QAChB,IAAI,CAACb,IAAI,GAAGc;QACZ,IAAI,CAACvB,aAAa,GAAGwB;QACrB,IAAI,CAAChB,aAAa,GAAGiB;IACvB;AAiEF"}
1
+ {"version":3,"sources":["ManualGhostText.base.ts"],"sourcesContent":["import {\n $createTextNode,\n $getNodeByKey,\n $insertNodes,\n type LexicalEditor,\n type LexicalNode,\n} from '@fluentui-copilot/text-editor';\nimport type { IGhostTextNode } from '../GhostText';\n\nexport interface IManualGhostTextBase<ComponentPropsType> {\n getGhostText: () => string | undefined;\n setGhostText: (text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean) => void;\n commitGhostText: (finalText: string, discrete?: boolean) => void;\n cancelGhostText: (discrete?: boolean) => void;\n}\n\nexport class ManualGhostTextBase<ComponentPropsType> implements IManualGhostTextBase<ComponentPropsType> {\n private __editor: LexicalEditor;\n private __nodeKey?: string;\n\n private __id: string;\n private __$isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>;\n private __$createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>;\n\n constructor(\n editor: LexicalEditor,\n id: string,\n $isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>,\n $createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>,\n ) {\n this.__editor = editor;\n this.__id = id;\n this.__$isNodeType = $isNodeType;\n this.__$createNode = $createNode;\n }\n\n getGhostText(): string | undefined {\n return this.__editor.getEditorState().read(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n return node.__content;\n }\n }\n });\n }\n\n setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean): void {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.getWritable().__content = text;\n return;\n }\n }\n\n const node = this.__$createNode(this.__id, text, exposeText, componentProps);\n this.__nodeKey = node.getKey();\n $insertNodes([node]);\n node.selectStart();\n },\n { tag: 'historic', discrete: discrete ? true : undefined },\n );\n }\n\n commitGhostText(finalText: string, discrete?: boolean): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n const textNode = $createTextNode(finalText);\n node.replace(textNode);\n textNode.selectEnd();\n }\n }\n },\n { discrete: discrete ? true : undefined },\n );\n this.__nodeKey = undefined;\n }\n }\n\n cancelGhostText(discrete?: boolean): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.remove();\n }\n }\n },\n { tag: 'historic', discrete: discrete ? true : undefined },\n );\n this.__nodeKey = undefined;\n }\n }\n}\n"],"names":["$createTextNode","$getNodeByKey","$insertNodes","ManualGhostTextBase","getGhostText","__editor","getEditorState","read","__nodeKey","node","__$isNodeType","__content","setGhostText","text","exposeText","componentProps","discrete","update","getWritable","__$createNode","__id","getKey","selectStart","tag","undefined","commitGhostText","finalText","textNode","replace","selectEnd","cancelGhostText","remove","constructor","editor","id","$isNodeType","$createNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAAA,SACEA,eAAe,EACfC,aAAa,EACbC,YAAY,QAGP,gCAAgC;AAUvC,OAAO,MAAMC;IA8BXC,eAAmC;QACjC,OAAO,IAAI,CAACC,QAAQ,CAACC,cAAc,GAAGC,IAAI,CAAC;YACzC,IAAI,IAAI,CAACC,SAAS,EAAE;gBAClB,MAAMC,OAAOR,cAAc,IAAI,CAACO,SAAS;gBACzC,IAAI,IAAI,CAACE,aAAa,CAACD,OAAO;oBAC5B,OAAOA,KAAKE,SAAS;gBACvB;YACF;QACF;IACF;IAEAC,aAAaC,IAAY,EAAEC,UAAoB,EAAEC,cAAmC,EAAEC,QAAkB,EAAQ;QAC9G,IAAI,CAACX,QAAQ,CAACY,MAAM,CAClB;YACE,IAAI,IAAI,CAACT,SAAS,EAAE;gBAClB,MAAMC,OAAOR,cAAc,IAAI,CAACO,SAAS;gBACzC,IAAI,IAAI,CAACE,aAAa,CAACD,OAAO;oBAC5BA,KAAKS,WAAW,GAAGP,SAAS,GAAGE;oBAC/B;gBACF;YACF;YAEA,MAAMJ,OAAO,IAAI,CAACU,aAAa,CAAC,IAAI,CAACC,IAAI,EAAEP,MAAMC,YAAYC;YAC7D,IAAI,CAACP,SAAS,GAAGC,KAAKY,MAAM;YAC5BnB,aAAa;gBAACO;aAAK;YACnBA,KAAKa,WAAW;QAClB,GACA;YAAEC,KAAK;YAAYP,UAAUA,WAAW,OAAOQ;QAAU;IAE7D;IAEAC,gBAAgBC,SAAiB,EAAEV,QAAkB,EAAQ;QAC3D,IAAI,IAAI,CAACR,SAAS,EAAE;YAClB,IAAI,CAACH,QAAQ,CAACY,MAAM,CAClB;gBACE,IAAI,IAAI,CAACT,SAAS,EAAE;oBAClB,MAAMC,OAAOR,cAAc,IAAI,CAACO,SAAS;oBACzC,IAAI,IAAI,CAACE,aAAa,CAACD,OAAO;wBAC5B,MAAMkB,WAAW3B,gBAAgB0B;wBACjCjB,KAAKmB,OAAO,CAACD;wBACbA,SAASE,SAAS;oBACpB;gBACF;YACF,GACA;gBAAEb,UAAUA,WAAW,OAAOQ;YAAU;YAE1C,IAAI,CAAChB,SAAS,GAAGgB;QACnB;IACF;IAEAM,gBAAgBd,QAAkB,EAAQ;QACxC,IAAI,IAAI,CAACR,SAAS,EAAE;YAClB,IAAI,CAACH,QAAQ,CAACY,MAAM,CAClB;gBACE,IAAI,IAAI,CAACT,SAAS,EAAE;oBAClB,MAAMC,OAAOR,cAAc,IAAI,CAACO,SAAS;oBACzC,IAAI,IAAI,CAACE,aAAa,CAACD,OAAO;wBAC5BA,KAAKsB,MAAM;oBACb;gBACF;YACF,GACA;gBAAER,KAAK;gBAAYP,UAAUA,WAAW,OAAOQ;YAAU;YAE3D,IAAI,CAAChB,SAAS,GAAGgB;QACnB;IACF;IAlFAQ,YACEC,MAAqB,EACrBC,EAAU,EACVC,WAAqF,EACrFC,WAKuC,CACvC;QAtBF,uBAAQ/B,YAAR,KAAA;QACA,uBAAQG,aAAR,KAAA;QAEA,uBAAQY,QAAR,KAAA;QACA,uBAAQV,iBAAR,KAAA;QACA,uBAAQS,iBAAR,KAAA;QAkBE,IAAI,CAACd,QAAQ,GAAG4B;QAChB,IAAI,CAACb,IAAI,GAAGc;QACZ,IAAI,CAACxB,aAAa,GAAGyB;QACrB,IAAI,CAAChB,aAAa,GAAGiB;IACvB;AAoEF"}
@@ -21,7 +21,7 @@ class ManualGhostTextBase {
21
21
  }
22
22
  });
23
23
  }
24
- setGhostText(text, exposeText, componentProps) {
24
+ setGhostText(text, exposeText, componentProps, discrete) {
25
25
  this.__editor.update(()=>{
26
26
  if (this.__nodeKey) {
27
27
  const node = (0, _texteditor.$getNodeByKey)(this.__nodeKey);
@@ -37,10 +37,11 @@ class ManualGhostTextBase {
37
37
  ]);
38
38
  node.selectStart();
39
39
  }, {
40
- tag: 'historic'
40
+ tag: 'historic',
41
+ discrete: discrete ? true : undefined
41
42
  });
42
43
  }
43
- commitGhostText(finalText) {
44
+ commitGhostText(finalText, discrete) {
44
45
  if (this.__nodeKey) {
45
46
  this.__editor.update(()=>{
46
47
  if (this.__nodeKey) {
@@ -51,11 +52,13 @@ class ManualGhostTextBase {
51
52
  textNode.selectEnd();
52
53
  }
53
54
  }
55
+ }, {
56
+ discrete: discrete ? true : undefined
54
57
  });
55
58
  this.__nodeKey = undefined;
56
59
  }
57
60
  }
58
- cancelGhostText() {
61
+ cancelGhostText(discrete) {
59
62
  if (this.__nodeKey) {
60
63
  this.__editor.update(()=>{
61
64
  if (this.__nodeKey) {
@@ -65,7 +68,8 @@ class ManualGhostTextBase {
65
68
  }
66
69
  }
67
70
  }, {
68
- tag: 'historic'
71
+ tag: 'historic',
72
+ discrete: discrete ? true : undefined
69
73
  });
70
74
  this.__nodeKey = undefined;
71
75
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["ManualGhostText.base.ts"],"sourcesContent":["import {\n $createTextNode,\n $getNodeByKey,\n $insertNodes,\n type LexicalEditor,\n type LexicalNode,\n} from '@fluentui-copilot/text-editor';\nimport type { IGhostTextNode } from '../GhostText';\n\nexport interface IManualGhostTextBase<ComponentPropsType> {\n getGhostText: () => string | undefined;\n setGhostText: (text: string, componentProps?: ComponentPropsType) => void;\n commitGhostText: (finalText: string) => void;\n cancelGhostText: () => void;\n}\n\nexport class ManualGhostTextBase<ComponentPropsType> {\n private __editor: LexicalEditor;\n private __nodeKey?: string;\n\n private __id: string;\n private __$isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>;\n private __$createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>;\n\n constructor(\n editor: LexicalEditor,\n id: string,\n $isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>,\n $createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>,\n ) {\n this.__editor = editor;\n this.__id = id;\n this.__$isNodeType = $isNodeType;\n this.__$createNode = $createNode;\n }\n\n getGhostText(): string | undefined {\n return this.__editor.getEditorState().read(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n return node.__content;\n }\n }\n });\n }\n\n setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType): void {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.getWritable().__content = text;\n return;\n }\n }\n\n const node = this.__$createNode(this.__id, text, exposeText, componentProps);\n this.__nodeKey = node.getKey();\n $insertNodes([node]);\n node.selectStart();\n },\n { tag: 'historic' },\n );\n }\n\n commitGhostText(finalText: string): void {\n if (this.__nodeKey) {\n this.__editor.update(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n const textNode = $createTextNode(finalText);\n node.replace(textNode);\n textNode.selectEnd();\n }\n }\n });\n this.__nodeKey = undefined;\n }\n }\n\n cancelGhostText(): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.remove();\n }\n }\n },\n { tag: 'historic' },\n );\n this.__nodeKey = undefined;\n }\n }\n}\n"],"names":["ManualGhostTextBase","getGhostText","__editor","getEditorState","read","__nodeKey","$getNodeByKey","__$isNodeType","__content","node","setGhostText","text","exposeText","componentProps","update","getWritable","__$createNode","__id","getKey","$insertNodes","finalText","commitGhostText","textNode","undefined","cancelGhostText","tag","editor","id","$isNodeType","$createNode","_define_property","constructor"],"rangeMappings":";;;;;;;;;;;;;;;;;;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;4BACE,CAAAE,aAASF,CAAAA,OAAW;mCAClB;;;;;;0BAMFoB,GAAKF;;;gBAGXG,MAAA,EAAAC,EAAA,EAAAC,WAAA,EAAAC,WAAA,CAAA;QACFC,IAAAA,kBAAA,EAAA,IAAA,EAAA,YAAA,KAAA;QA/EAC,IAAAA,kBACEL,EAAAA,IACAC,EAAU,aAC2E,KACrFE;8BAhBF,EAAA,IAAA,EAAA,QAAQ3B,KAAAA;8BACR,EAAA,IAAA,EAAA,iBAAA,KAAA;8BAEA,EAAA,IAAA,EAAA,iBAAA,KAAA;YACA,CAAAA,QAAA,GAAAwB;YACA,CAAAT,IAAA,GAAAU;YAkBE,CAAApB,aAAa,GAAGmB;YAChB,CAAAV,aAAYW,GAAAA;;kDAGd"}
1
+ {"version":3,"sources":["ManualGhostText.base.ts"],"sourcesContent":["import {\n $createTextNode,\n $getNodeByKey,\n $insertNodes,\n type LexicalEditor,\n type LexicalNode,\n} from '@fluentui-copilot/text-editor';\nimport type { IGhostTextNode } from '../GhostText';\n\nexport interface IManualGhostTextBase<ComponentPropsType> {\n getGhostText: () => string | undefined;\n setGhostText: (text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean) => void;\n commitGhostText: (finalText: string, discrete?: boolean) => void;\n cancelGhostText: (discrete?: boolean) => void;\n}\n\nexport class ManualGhostTextBase<ComponentPropsType> implements IManualGhostTextBase<ComponentPropsType> {\n private __editor: LexicalEditor;\n private __nodeKey?: string;\n\n private __id: string;\n private __$isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>;\n private __$createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>;\n\n constructor(\n editor: LexicalEditor,\n id: string,\n $isNodeType: (node: LexicalNode | null) => node is IGhostTextNode<ComponentPropsType>,\n $createNode: (\n id: string,\n content: string,\n exposeText?: boolean,\n componentProps?: ComponentPropsType,\n ) => IGhostTextNode<ComponentPropsType>,\n ) {\n this.__editor = editor;\n this.__id = id;\n this.__$isNodeType = $isNodeType;\n this.__$createNode = $createNode;\n }\n\n getGhostText(): string | undefined {\n return this.__editor.getEditorState().read(() => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n return node.__content;\n }\n }\n });\n }\n\n setGhostText(text: string, exposeText?: boolean, componentProps?: ComponentPropsType, discrete?: boolean): void {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.getWritable().__content = text;\n return;\n }\n }\n\n const node = this.__$createNode(this.__id, text, exposeText, componentProps);\n this.__nodeKey = node.getKey();\n $insertNodes([node]);\n node.selectStart();\n },\n { tag: 'historic', discrete: discrete ? true : undefined },\n );\n }\n\n commitGhostText(finalText: string, discrete?: boolean): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n const textNode = $createTextNode(finalText);\n node.replace(textNode);\n textNode.selectEnd();\n }\n }\n },\n { discrete: discrete ? true : undefined },\n );\n this.__nodeKey = undefined;\n }\n }\n\n cancelGhostText(discrete?: boolean): void {\n if (this.__nodeKey) {\n this.__editor.update(\n () => {\n if (this.__nodeKey) {\n const node = $getNodeByKey(this.__nodeKey);\n if (this.__$isNodeType(node)) {\n node.remove();\n }\n }\n },\n { tag: 'historic', discrete: discrete ? true : undefined },\n );\n this.__nodeKey = undefined;\n }\n }\n}\n"],"names":["ManualGhostTextBase","getGhostText","__editor","getEditorState","read","__nodeKey","$getNodeByKey","__$isNodeType","__content","node","setGhostText","text","exposeText","componentProps","discrete","update","getWritable","__$createNode","__id","getKey","$insertNodes","undefined","finalText","commitGhostText","textNode","cancelGhostText","editor","id","$isNodeType","$createNode","_define_property","constructor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAS,EAAE;0BACdI,OAACP,IAAAA,yBACH,EAAA,IAAA,CAAAG,SAAA;4BACE,CAAAE,aAASF,CAAAA,OAAW;mCAClB;;;;;0BAMJS,WAAA,OAAAO;;0BAAmBP,GAAAA;;;gBAGvBY,MAAA,EAAAC,EAAA,EAAAC,WAAA,EAAAC,WAAA,CAAA;QACFC,IAAAA,kBAAA,EAAA,IAAA,EAAA,YAAA,KAAA;QAlFAC,IAAAA,kBACEL,EAAAA,IACAC,EAAU,aAC2E,KACrFE;8BAhBF,EAAA,IAAA,EAAA,QAAQ3B,KAAAA;8BACR,EAAA,IAAA,EAAA,iBAAA,KAAA;8BAEA,EAAA,IAAA,EAAA,iBAAA,KAAA;YACA,CAAAA,QAAA,GAAAwB;YACA,CAAAR,IAAA,GAAAS;YAkBE,CAAApB,aAAa,GAAGmB;YAChB,CAAAT,aAAYU,GAAAA;;kDAGd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/chat-input-plugins",
3
- "version": "0.0.0-nightly-20241018-0406-6daa9be4.1",
3
+ "version": "0.0.0-nightly-20241023-0410-2bdb166c.1",
4
4
  "description": "A Fluent AI package for non-react specific chat input plugins.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/text-editor": "0.0.0-nightly-20241018-0406-6daa9be4.1",
15
+ "@fluentui-copilot/text-editor": "0.0.0-nightly-20241023-0410-2bdb166c.1",
16
16
  "@swc/helpers": "^0.5.1"
17
17
  },
18
18
  "beachball": {},