@uipath/apollo-wind 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/components/ui/index.cjs +96 -86
  2. package/dist/components/ui/index.d.ts +1 -0
  3. package/dist/components/ui/index.js +1 -0
  4. package/dist/components/ui/prompt-editor/components/EditorToolbar.cjs +156 -0
  5. package/dist/components/ui/prompt-editor/components/EditorToolbar.d.ts +9 -0
  6. package/dist/components/ui/prompt-editor/components/EditorToolbar.js +122 -0
  7. package/dist/components/ui/prompt-editor/components/MarkdownPreview.cjs +205 -0
  8. package/dist/components/ui/prompt-editor/components/MarkdownPreview.d.ts +14 -0
  9. package/dist/components/ui/prompt-editor/components/MarkdownPreview.js +161 -0
  10. package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.cjs +194 -0
  11. package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.d.ts +28 -0
  12. package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.js +160 -0
  13. package/dist/components/ui/prompt-editor/components/TokenPill.cjs +119 -0
  14. package/dist/components/ui/prompt-editor/components/TokenPill.d.ts +15 -0
  15. package/dist/components/ui/prompt-editor/components/TokenPill.js +85 -0
  16. package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.cjs +138 -0
  17. package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.d.ts +13 -0
  18. package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.js +104 -0
  19. package/dist/components/ui/prompt-editor/components/token-icon-markup.cjs +138 -0
  20. package/dist/components/ui/prompt-editor/components/token-icon-markup.d.ts +16 -0
  21. package/dist/components/ui/prompt-editor/components/token-icon-markup.js +104 -0
  22. package/dist/components/ui/prompt-editor/index.cjs +40 -0
  23. package/dist/components/ui/prompt-editor/index.d.ts +4 -0
  24. package/dist/components/ui/prompt-editor/index.js +3 -0
  25. package/dist/components/ui/prompt-editor/nodes/InputTokenNode.cjs +145 -0
  26. package/dist/components/ui/prompt-editor/nodes/InputTokenNode.d.ts +30 -0
  27. package/dist/components/ui/prompt-editor/nodes/InputTokenNode.js +105 -0
  28. package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.cjs +145 -0
  29. package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.d.ts +30 -0
  30. package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.js +105 -0
  31. package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.cjs +145 -0
  32. package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.d.ts +30 -0
  33. package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.js +105 -0
  34. package/dist/components/ui/prompt-editor/nodes/StateTokenNode.cjs +145 -0
  35. package/dist/components/ui/prompt-editor/nodes/StateTokenNode.d.ts +30 -0
  36. package/dist/components/ui/prompt-editor/nodes/StateTokenNode.js +105 -0
  37. package/dist/components/ui/prompt-editor/nodes/index.cjs +72 -0
  38. package/dist/components/ui/prompt-editor/nodes/index.d.ts +8 -0
  39. package/dist/components/ui/prompt-editor/nodes/index.js +5 -0
  40. package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.cjs +242 -0
  41. package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.d.ts +15 -0
  42. package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.js +208 -0
  43. package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.cjs +164 -0
  44. package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.d.ts +1 -0
  45. package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.js +130 -0
  46. package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.cjs +50 -0
  47. package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.d.ts +4 -0
  48. package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.js +16 -0
  49. package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.cjs +108 -0
  50. package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.d.ts +3 -0
  51. package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.js +74 -0
  52. package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.cjs +313 -0
  53. package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.d.ts +7 -0
  54. package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.js +276 -0
  55. package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.cjs +186 -0
  56. package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.d.ts +7 -0
  57. package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.js +152 -0
  58. package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.cjs +132 -0
  59. package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.d.ts +7 -0
  60. package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.js +98 -0
  61. package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.cjs +85 -0
  62. package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.d.ts +4 -0
  63. package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.js +51 -0
  64. package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.cjs +98 -0
  65. package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.d.ts +8 -0
  66. package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.js +64 -0
  67. package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.cjs +137 -0
  68. package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.d.ts +19 -0
  69. package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.js +100 -0
  70. package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.cjs +49 -0
  71. package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.d.ts +8 -0
  72. package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.js +12 -0
  73. package/dist/components/ui/prompt-editor/prompt-editor.cjs +402 -0
  74. package/dist/components/ui/prompt-editor/prompt-editor.d.ts +35 -0
  75. package/dist/components/ui/prompt-editor/prompt-editor.js +368 -0
  76. package/dist/components/ui/prompt-editor/types.cjs +74 -0
  77. package/dist/components/ui/prompt-editor/types.d.ts +58 -0
  78. package/dist/components/ui/prompt-editor/types.js +31 -0
  79. package/dist/components/ui/prompt-editor/utils/autocomplete-segments.cjs +60 -0
  80. package/dist/components/ui/prompt-editor/utils/autocomplete-segments.d.ts +29 -0
  81. package/dist/components/ui/prompt-editor/utils/autocomplete-segments.js +20 -0
  82. package/dist/components/ui/prompt-editor/utils/comparison.cjs +39 -0
  83. package/dist/components/ui/prompt-editor/utils/comparison.d.ts +3 -0
  84. package/dist/components/ui/prompt-editor/utils/comparison.js +5 -0
  85. package/dist/components/ui/prompt-editor/utils/index.cjs +68 -0
  86. package/dist/components/ui/prompt-editor/utils/index.d.ts +3 -0
  87. package/dist/components/ui/prompt-editor/utils/index.js +4 -0
  88. package/dist/components/ui/prompt-editor/utils/insert-token.cjs +103 -0
  89. package/dist/components/ui/prompt-editor/utils/insert-token.d.ts +12 -0
  90. package/dist/components/ui/prompt-editor/utils/insert-token.js +66 -0
  91. package/dist/components/ui/prompt-editor/utils/serialization.cjs +255 -0
  92. package/dist/components/ui/prompt-editor/utils/serialization.d.ts +16 -0
  93. package/dist/components/ui/prompt-editor/utils/serialization.js +200 -0
  94. package/dist/index.cjs +7 -0
  95. package/dist/index.d.ts +2 -0
  96. package/dist/index.js +2 -1
  97. package/dist/styles.css +42 -0
  98. package/dist/tailwind.utilities.css +1 -1
  99. package/package.json +7 -1
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ isInputTokenNode: ()=>isInputTokenNode,
28
+ createInputTokenNode: ()=>createInputTokenNode,
29
+ InputTokenNode: ()=>InputTokenNode
30
+ });
31
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
+ const external_lexical_namespaceObject = require("lexical");
33
+ const TokenPillWithTooltip_cjs_namespaceObject = require("../components/TokenPillWithTooltip.cjs");
34
+ class InputTokenNode extends external_lexical_namespaceObject.DecoratorNode {
35
+ __value;
36
+ __diffType;
37
+ __isInvalid;
38
+ static getType() {
39
+ return 'input-token';
40
+ }
41
+ static clone(node) {
42
+ const cloned = new InputTokenNode(node.__value, node.__key, node.__diffType);
43
+ cloned.__isInvalid = node.__isInvalid;
44
+ return cloned;
45
+ }
46
+ constructor(value, key, diffType){
47
+ super(key);
48
+ this.__value = value;
49
+ this.__diffType = diffType;
50
+ }
51
+ getValue() {
52
+ return this.__value;
53
+ }
54
+ setValue(value) {
55
+ const self = this.getWritable();
56
+ self.__value = value;
57
+ return self;
58
+ }
59
+ getIsInvalid() {
60
+ return this.__isInvalid ?? false;
61
+ }
62
+ setIsInvalid(isInvalid) {
63
+ const self = this.getWritable();
64
+ self.__isInvalid = isInvalid;
65
+ return self;
66
+ }
67
+ createDOM() {
68
+ const span = document.createElement('span');
69
+ span.style.display = 'inline';
70
+ return span;
71
+ }
72
+ updateDOM() {
73
+ return false;
74
+ }
75
+ exportDOM() {
76
+ const element = document.createElement('span');
77
+ element.dataset.lexicalInputToken = 'true';
78
+ element.dataset.value = this.__value;
79
+ element.textContent = this.__value;
80
+ return {
81
+ element
82
+ };
83
+ }
84
+ static importDOM() {
85
+ return {
86
+ span: (domNode)=>{
87
+ if (!('lexicalInputToken' in domNode.dataset)) return null;
88
+ return {
89
+ conversion: (element)=>({
90
+ node: new InputTokenNode(element.dataset.value ?? '')
91
+ }),
92
+ priority: 1
93
+ };
94
+ }
95
+ };
96
+ }
97
+ static importJSON(serializedNode) {
98
+ return new InputTokenNode(serializedNode.value);
99
+ }
100
+ exportJSON() {
101
+ return {
102
+ type: 'input-token',
103
+ value: this.__value,
104
+ version: 1
105
+ };
106
+ }
107
+ getTextContent() {
108
+ return this.__value;
109
+ }
110
+ isInline() {
111
+ return true;
112
+ }
113
+ isKeyboardSelectable() {
114
+ return true;
115
+ }
116
+ decorate(editor) {
117
+ const readonly = !editor.isEditable();
118
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TokenPillWithTooltip_cjs_namespaceObject.TokenPillWithTooltip, {
119
+ value: this.__value,
120
+ tokenType: "input",
121
+ nodeKey: this.getKey(),
122
+ diffType: this.__diffType,
123
+ readonly: readonly,
124
+ isInvalid: this.__isInvalid,
125
+ onRemove: ()=>{
126
+ if (!readonly) editor.update(()=>{
127
+ this.remove();
128
+ });
129
+ }
130
+ });
131
+ }
132
+ }
133
+ const createInputTokenNode = (value, diffType)=>(0, external_lexical_namespaceObject.$applyNodeReplacement)(new InputTokenNode(value, void 0, diffType));
134
+ const isInputTokenNode = (node)=>node instanceof InputTokenNode;
135
+ exports.InputTokenNode = __webpack_exports__.InputTokenNode;
136
+ exports.createInputTokenNode = __webpack_exports__.createInputTokenNode;
137
+ exports.isInputTokenNode = __webpack_exports__.isInputTokenNode;
138
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
139
+ "InputTokenNode",
140
+ "createInputTokenNode",
141
+ "isInputTokenNode"
142
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
143
+ Object.defineProperty(exports, '__esModule', {
144
+ value: true
145
+ });
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from 'react';
2
+ import { DecoratorNode, type DOMConversionMap, type DOMExportOutput, type LexicalEditor, type LexicalNode, type NodeKey, type SerializedLexicalNode, type Spread } from 'lexical';
3
+ import type { PromptEditorDiffType } from '../types';
4
+ export type SerializedInputTokenNode = Spread<{
5
+ value: string;
6
+ }, SerializedLexicalNode>;
7
+ export declare class InputTokenNode extends DecoratorNode<ReactNode> {
8
+ __value: string;
9
+ __diffType?: PromptEditorDiffType;
10
+ __isInvalid?: boolean;
11
+ static getType(): string;
12
+ static clone(node: InputTokenNode): InputTokenNode;
13
+ constructor(value: string, key?: NodeKey, diffType?: PromptEditorDiffType);
14
+ getValue(): string;
15
+ setValue(value: string): this;
16
+ getIsInvalid(): boolean;
17
+ setIsInvalid(isInvalid: boolean): this;
18
+ createDOM(): HTMLElement;
19
+ updateDOM(): false;
20
+ exportDOM(): DOMExportOutput;
21
+ static importDOM(): DOMConversionMap | null;
22
+ static importJSON(serializedNode: SerializedInputTokenNode): InputTokenNode;
23
+ exportJSON(): SerializedInputTokenNode;
24
+ getTextContent(): string;
25
+ isInline(): boolean;
26
+ isKeyboardSelectable(): boolean;
27
+ decorate(editor: LexicalEditor): ReactNode;
28
+ }
29
+ export declare const createInputTokenNode: (value: string, diffType?: PromptEditorDiffType) => InputTokenNode;
30
+ export declare const isInputTokenNode: (node: LexicalNode | null | undefined) => node is InputTokenNode;
@@ -0,0 +1,105 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { $applyNodeReplacement, DecoratorNode } from "lexical";
3
+ import { TokenPillWithTooltip } from "../components/TokenPillWithTooltip.js";
4
+ class InputTokenNode extends DecoratorNode {
5
+ __value;
6
+ __diffType;
7
+ __isInvalid;
8
+ static getType() {
9
+ return 'input-token';
10
+ }
11
+ static clone(node) {
12
+ const cloned = new InputTokenNode(node.__value, node.__key, node.__diffType);
13
+ cloned.__isInvalid = node.__isInvalid;
14
+ return cloned;
15
+ }
16
+ constructor(value, key, diffType){
17
+ super(key);
18
+ this.__value = value;
19
+ this.__diffType = diffType;
20
+ }
21
+ getValue() {
22
+ return this.__value;
23
+ }
24
+ setValue(value) {
25
+ const self = this.getWritable();
26
+ self.__value = value;
27
+ return self;
28
+ }
29
+ getIsInvalid() {
30
+ return this.__isInvalid ?? false;
31
+ }
32
+ setIsInvalid(isInvalid) {
33
+ const self = this.getWritable();
34
+ self.__isInvalid = isInvalid;
35
+ return self;
36
+ }
37
+ createDOM() {
38
+ const span = document.createElement('span');
39
+ span.style.display = 'inline';
40
+ return span;
41
+ }
42
+ updateDOM() {
43
+ return false;
44
+ }
45
+ exportDOM() {
46
+ const element = document.createElement('span');
47
+ element.dataset.lexicalInputToken = 'true';
48
+ element.dataset.value = this.__value;
49
+ element.textContent = this.__value;
50
+ return {
51
+ element
52
+ };
53
+ }
54
+ static importDOM() {
55
+ return {
56
+ span: (domNode)=>{
57
+ if (!('lexicalInputToken' in domNode.dataset)) return null;
58
+ return {
59
+ conversion: (element)=>({
60
+ node: new InputTokenNode(element.dataset.value ?? '')
61
+ }),
62
+ priority: 1
63
+ };
64
+ }
65
+ };
66
+ }
67
+ static importJSON(serializedNode) {
68
+ return new InputTokenNode(serializedNode.value);
69
+ }
70
+ exportJSON() {
71
+ return {
72
+ type: 'input-token',
73
+ value: this.__value,
74
+ version: 1
75
+ };
76
+ }
77
+ getTextContent() {
78
+ return this.__value;
79
+ }
80
+ isInline() {
81
+ return true;
82
+ }
83
+ isKeyboardSelectable() {
84
+ return true;
85
+ }
86
+ decorate(editor) {
87
+ const readonly = !editor.isEditable();
88
+ return /*#__PURE__*/ jsx(TokenPillWithTooltip, {
89
+ value: this.__value,
90
+ tokenType: "input",
91
+ nodeKey: this.getKey(),
92
+ diffType: this.__diffType,
93
+ readonly: readonly,
94
+ isInvalid: this.__isInvalid,
95
+ onRemove: ()=>{
96
+ if (!readonly) editor.update(()=>{
97
+ this.remove();
98
+ });
99
+ }
100
+ });
101
+ }
102
+ }
103
+ const createInputTokenNode = (value, diffType)=>$applyNodeReplacement(new InputTokenNode(value, void 0, diffType));
104
+ const isInputTokenNode = (node)=>node instanceof InputTokenNode;
105
+ export { InputTokenNode, createInputTokenNode, isInputTokenNode };
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ isOutputTokenNode: ()=>isOutputTokenNode,
28
+ OutputTokenNode: ()=>OutputTokenNode,
29
+ createOutputTokenNode: ()=>createOutputTokenNode
30
+ });
31
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
+ const external_lexical_namespaceObject = require("lexical");
33
+ const TokenPillWithTooltip_cjs_namespaceObject = require("../components/TokenPillWithTooltip.cjs");
34
+ class OutputTokenNode extends external_lexical_namespaceObject.DecoratorNode {
35
+ __value;
36
+ __diffType;
37
+ __isInvalid;
38
+ static getType() {
39
+ return 'output-token';
40
+ }
41
+ static clone(node) {
42
+ const cloned = new OutputTokenNode(node.__value, node.__key, node.__diffType);
43
+ cloned.__isInvalid = node.__isInvalid;
44
+ return cloned;
45
+ }
46
+ constructor(value, key, diffType){
47
+ super(key);
48
+ this.__value = value;
49
+ this.__diffType = diffType;
50
+ }
51
+ getValue() {
52
+ return this.__value;
53
+ }
54
+ setValue(value) {
55
+ const self = this.getWritable();
56
+ self.__value = value;
57
+ return self;
58
+ }
59
+ getIsInvalid() {
60
+ return this.__isInvalid ?? false;
61
+ }
62
+ setIsInvalid(isInvalid) {
63
+ const self = this.getWritable();
64
+ self.__isInvalid = isInvalid;
65
+ return self;
66
+ }
67
+ createDOM() {
68
+ const span = document.createElement('span');
69
+ span.style.display = 'inline';
70
+ return span;
71
+ }
72
+ updateDOM() {
73
+ return false;
74
+ }
75
+ exportDOM() {
76
+ const element = document.createElement('span');
77
+ element.dataset.lexicalOutputToken = 'true';
78
+ element.dataset.value = this.__value;
79
+ element.textContent = this.__value;
80
+ return {
81
+ element
82
+ };
83
+ }
84
+ static importDOM() {
85
+ return {
86
+ span: (domNode)=>{
87
+ if (!('lexicalOutputToken' in domNode.dataset)) return null;
88
+ return {
89
+ conversion: (element)=>({
90
+ node: new OutputTokenNode(element.dataset.value ?? '')
91
+ }),
92
+ priority: 1
93
+ };
94
+ }
95
+ };
96
+ }
97
+ static importJSON(serializedNode) {
98
+ return new OutputTokenNode(serializedNode.value);
99
+ }
100
+ exportJSON() {
101
+ return {
102
+ type: 'output-token',
103
+ value: this.__value,
104
+ version: 1
105
+ };
106
+ }
107
+ getTextContent() {
108
+ return this.__value;
109
+ }
110
+ isInline() {
111
+ return true;
112
+ }
113
+ isKeyboardSelectable() {
114
+ return true;
115
+ }
116
+ decorate(editor) {
117
+ const readonly = !editor.isEditable();
118
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TokenPillWithTooltip_cjs_namespaceObject.TokenPillWithTooltip, {
119
+ value: this.__value,
120
+ tokenType: "output",
121
+ nodeKey: this.getKey(),
122
+ diffType: this.__diffType,
123
+ readonly: readonly,
124
+ isInvalid: this.__isInvalid,
125
+ onRemove: ()=>{
126
+ if (!readonly) editor.update(()=>{
127
+ this.remove();
128
+ });
129
+ }
130
+ });
131
+ }
132
+ }
133
+ const createOutputTokenNode = (value, diffType)=>(0, external_lexical_namespaceObject.$applyNodeReplacement)(new OutputTokenNode(value, void 0, diffType));
134
+ const isOutputTokenNode = (node)=>node instanceof OutputTokenNode;
135
+ exports.OutputTokenNode = __webpack_exports__.OutputTokenNode;
136
+ exports.createOutputTokenNode = __webpack_exports__.createOutputTokenNode;
137
+ exports.isOutputTokenNode = __webpack_exports__.isOutputTokenNode;
138
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
139
+ "OutputTokenNode",
140
+ "createOutputTokenNode",
141
+ "isOutputTokenNode"
142
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
143
+ Object.defineProperty(exports, '__esModule', {
144
+ value: true
145
+ });
@@ -0,0 +1,30 @@
1
+ import type { ReactNode } from 'react';
2
+ import { DecoratorNode, type DOMConversionMap, type DOMExportOutput, type LexicalEditor, type LexicalNode, type NodeKey, type SerializedLexicalNode, type Spread } from 'lexical';
3
+ import type { PromptEditorDiffType } from '../types';
4
+ export type SerializedOutputTokenNode = Spread<{
5
+ value: string;
6
+ }, SerializedLexicalNode>;
7
+ export declare class OutputTokenNode extends DecoratorNode<ReactNode> {
8
+ __value: string;
9
+ __diffType?: PromptEditorDiffType;
10
+ __isInvalid?: boolean;
11
+ static getType(): string;
12
+ static clone(node: OutputTokenNode): OutputTokenNode;
13
+ constructor(value: string, key?: NodeKey, diffType?: PromptEditorDiffType);
14
+ getValue(): string;
15
+ setValue(value: string): this;
16
+ getIsInvalid(): boolean;
17
+ setIsInvalid(isInvalid: boolean): this;
18
+ createDOM(): HTMLElement;
19
+ updateDOM(): false;
20
+ exportDOM(): DOMExportOutput;
21
+ static importDOM(): DOMConversionMap | null;
22
+ static importJSON(serializedNode: SerializedOutputTokenNode): OutputTokenNode;
23
+ exportJSON(): SerializedOutputTokenNode;
24
+ getTextContent(): string;
25
+ isInline(): boolean;
26
+ isKeyboardSelectable(): boolean;
27
+ decorate(editor: LexicalEditor): ReactNode;
28
+ }
29
+ export declare const createOutputTokenNode: (value: string, diffType?: PromptEditorDiffType) => OutputTokenNode;
30
+ export declare const isOutputTokenNode: (node: LexicalNode | null | undefined) => node is OutputTokenNode;
@@ -0,0 +1,105 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { $applyNodeReplacement, DecoratorNode } from "lexical";
3
+ import { TokenPillWithTooltip } from "../components/TokenPillWithTooltip.js";
4
+ class OutputTokenNode extends DecoratorNode {
5
+ __value;
6
+ __diffType;
7
+ __isInvalid;
8
+ static getType() {
9
+ return 'output-token';
10
+ }
11
+ static clone(node) {
12
+ const cloned = new OutputTokenNode(node.__value, node.__key, node.__diffType);
13
+ cloned.__isInvalid = node.__isInvalid;
14
+ return cloned;
15
+ }
16
+ constructor(value, key, diffType){
17
+ super(key);
18
+ this.__value = value;
19
+ this.__diffType = diffType;
20
+ }
21
+ getValue() {
22
+ return this.__value;
23
+ }
24
+ setValue(value) {
25
+ const self = this.getWritable();
26
+ self.__value = value;
27
+ return self;
28
+ }
29
+ getIsInvalid() {
30
+ return this.__isInvalid ?? false;
31
+ }
32
+ setIsInvalid(isInvalid) {
33
+ const self = this.getWritable();
34
+ self.__isInvalid = isInvalid;
35
+ return self;
36
+ }
37
+ createDOM() {
38
+ const span = document.createElement('span');
39
+ span.style.display = 'inline';
40
+ return span;
41
+ }
42
+ updateDOM() {
43
+ return false;
44
+ }
45
+ exportDOM() {
46
+ const element = document.createElement('span');
47
+ element.dataset.lexicalOutputToken = 'true';
48
+ element.dataset.value = this.__value;
49
+ element.textContent = this.__value;
50
+ return {
51
+ element
52
+ };
53
+ }
54
+ static importDOM() {
55
+ return {
56
+ span: (domNode)=>{
57
+ if (!('lexicalOutputToken' in domNode.dataset)) return null;
58
+ return {
59
+ conversion: (element)=>({
60
+ node: new OutputTokenNode(element.dataset.value ?? '')
61
+ }),
62
+ priority: 1
63
+ };
64
+ }
65
+ };
66
+ }
67
+ static importJSON(serializedNode) {
68
+ return new OutputTokenNode(serializedNode.value);
69
+ }
70
+ exportJSON() {
71
+ return {
72
+ type: 'output-token',
73
+ value: this.__value,
74
+ version: 1
75
+ };
76
+ }
77
+ getTextContent() {
78
+ return this.__value;
79
+ }
80
+ isInline() {
81
+ return true;
82
+ }
83
+ isKeyboardSelectable() {
84
+ return true;
85
+ }
86
+ decorate(editor) {
87
+ const readonly = !editor.isEditable();
88
+ return /*#__PURE__*/ jsx(TokenPillWithTooltip, {
89
+ value: this.__value,
90
+ tokenType: "output",
91
+ nodeKey: this.getKey(),
92
+ diffType: this.__diffType,
93
+ readonly: readonly,
94
+ isInvalid: this.__isInvalid,
95
+ onRemove: ()=>{
96
+ if (!readonly) editor.update(()=>{
97
+ this.remove();
98
+ });
99
+ }
100
+ });
101
+ }
102
+ }
103
+ const createOutputTokenNode = (value, diffType)=>$applyNodeReplacement(new OutputTokenNode(value, void 0, diffType));
104
+ const isOutputTokenNode = (node)=>node instanceof OutputTokenNode;
105
+ export { OutputTokenNode, createOutputTokenNode, isOutputTokenNode };