@uipath/apollo-wind 2.22.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.
- package/dist/components/forms/metadata-form.cjs +2 -2
- package/dist/components/forms/metadata-form.js +2 -2
- package/dist/components/ui/index.cjs +92 -82
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/prompt-editor/components/EditorToolbar.cjs +156 -0
- package/dist/components/ui/prompt-editor/components/EditorToolbar.d.ts +9 -0
- package/dist/components/ui/prompt-editor/components/EditorToolbar.js +122 -0
- package/dist/components/ui/prompt-editor/components/MarkdownPreview.cjs +205 -0
- package/dist/components/ui/prompt-editor/components/MarkdownPreview.d.ts +14 -0
- package/dist/components/ui/prompt-editor/components/MarkdownPreview.js +161 -0
- package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.cjs +194 -0
- package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.d.ts +28 -0
- package/dist/components/ui/prompt-editor/components/PromptEditorAutocompleteMenu.js +160 -0
- package/dist/components/ui/prompt-editor/components/TokenPill.cjs +119 -0
- package/dist/components/ui/prompt-editor/components/TokenPill.d.ts +15 -0
- package/dist/components/ui/prompt-editor/components/TokenPill.js +85 -0
- package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.cjs +138 -0
- package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.d.ts +13 -0
- package/dist/components/ui/prompt-editor/components/TokenPillWithTooltip.js +104 -0
- package/dist/components/ui/prompt-editor/components/token-icon-markup.cjs +138 -0
- package/dist/components/ui/prompt-editor/components/token-icon-markup.d.ts +16 -0
- package/dist/components/ui/prompt-editor/components/token-icon-markup.js +104 -0
- package/dist/components/ui/prompt-editor/index.cjs +40 -0
- package/dist/components/ui/prompt-editor/index.d.ts +4 -0
- package/dist/components/ui/prompt-editor/index.js +3 -0
- package/dist/components/ui/prompt-editor/nodes/InputTokenNode.cjs +145 -0
- package/dist/components/ui/prompt-editor/nodes/InputTokenNode.d.ts +30 -0
- package/dist/components/ui/prompt-editor/nodes/InputTokenNode.js +105 -0
- package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.cjs +145 -0
- package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.d.ts +30 -0
- package/dist/components/ui/prompt-editor/nodes/OutputTokenNode.js +105 -0
- package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.cjs +145 -0
- package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.d.ts +30 -0
- package/dist/components/ui/prompt-editor/nodes/ResourceTokenNode.js +105 -0
- package/dist/components/ui/prompt-editor/nodes/StateTokenNode.cjs +145 -0
- package/dist/components/ui/prompt-editor/nodes/StateTokenNode.d.ts +30 -0
- package/dist/components/ui/prompt-editor/nodes/StateTokenNode.js +105 -0
- package/dist/components/ui/prompt-editor/nodes/index.cjs +72 -0
- package/dist/components/ui/prompt-editor/nodes/index.d.ts +8 -0
- package/dist/components/ui/prompt-editor/nodes/index.js +5 -0
- package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.cjs +242 -0
- package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.d.ts +15 -0
- package/dist/components/ui/prompt-editor/plugins/AutocompletePlugin.js +208 -0
- package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.cjs +164 -0
- package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.d.ts +1 -0
- package/dist/components/ui/prompt-editor/plugins/CopyPastePlugin.js +130 -0
- package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.cjs +50 -0
- package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.d.ts +4 -0
- package/dist/components/ui/prompt-editor/plugins/EditorRefPlugin.js +16 -0
- package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.cjs +108 -0
- package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.d.ts +3 -0
- package/dist/components/ui/prompt-editor/plugins/MultilinePlugin.js +74 -0
- package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.cjs +313 -0
- package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.d.ts +7 -0
- package/dist/components/ui/prompt-editor/plugins/NodeSelectionFixPlugin.js +276 -0
- package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.cjs +186 -0
- package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.d.ts +7 -0
- package/dist/components/ui/prompt-editor/plugins/RenameTokensPlugin.js +152 -0
- package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.cjs +132 -0
- package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.d.ts +7 -0
- package/dist/components/ui/prompt-editor/plugins/ToolbarActionsPlugin.js +98 -0
- package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.cjs +85 -0
- package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.d.ts +4 -0
- package/dist/components/ui/prompt-editor/plugins/ValidateTokensPlugin.js +51 -0
- package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.cjs +98 -0
- package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.d.ts +8 -0
- package/dist/components/ui/prompt-editor/plugins/ValueSyncPlugin.js +64 -0
- package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.cjs +137 -0
- package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.d.ts +19 -0
- package/dist/components/ui/prompt-editor/plugins/VariableDropPlugin.js +100 -0
- package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.cjs +49 -0
- package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.d.ts +8 -0
- package/dist/components/ui/prompt-editor/plugins/shared/token-nodes.js +12 -0
- package/dist/components/ui/prompt-editor/prompt-editor.cjs +402 -0
- package/dist/components/ui/prompt-editor/prompt-editor.d.ts +35 -0
- package/dist/components/ui/prompt-editor/prompt-editor.js +368 -0
- package/dist/components/ui/prompt-editor/types.cjs +74 -0
- package/dist/components/ui/prompt-editor/types.d.ts +58 -0
- package/dist/components/ui/prompt-editor/types.js +31 -0
- package/dist/components/ui/prompt-editor/utils/autocomplete-segments.cjs +60 -0
- package/dist/components/ui/prompt-editor/utils/autocomplete-segments.d.ts +29 -0
- package/dist/components/ui/prompt-editor/utils/autocomplete-segments.js +20 -0
- package/dist/components/ui/prompt-editor/utils/comparison.cjs +39 -0
- package/dist/components/ui/prompt-editor/utils/comparison.d.ts +3 -0
- package/dist/components/ui/prompt-editor/utils/comparison.js +5 -0
- package/dist/components/ui/prompt-editor/utils/index.cjs +68 -0
- package/dist/components/ui/prompt-editor/utils/index.d.ts +3 -0
- package/dist/components/ui/prompt-editor/utils/index.js +4 -0
- package/dist/components/ui/prompt-editor/utils/insert-token.cjs +103 -0
- package/dist/components/ui/prompt-editor/utils/insert-token.d.ts +12 -0
- package/dist/components/ui/prompt-editor/utils/insert-token.js +66 -0
- package/dist/components/ui/prompt-editor/utils/serialization.cjs +255 -0
- package/dist/components/ui/prompt-editor/utils/serialization.d.ts +16 -0
- package/dist/components/ui/prompt-editor/utils/serialization.js +200 -0
- package/dist/editor-themes/monaco.cjs +2 -2
- package/dist/editor-themes/monaco.js +2 -2
- package/dist/index.cjs +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/dist/styles.css +44 -16
- package/dist/tailwind.utilities.css +1 -1
- 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
|
+
isResourceTokenNode: ()=>isResourceTokenNode,
|
|
28
|
+
ResourceTokenNode: ()=>ResourceTokenNode,
|
|
29
|
+
createResourceTokenNode: ()=>createResourceTokenNode
|
|
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 ResourceTokenNode extends external_lexical_namespaceObject.DecoratorNode {
|
|
35
|
+
__value;
|
|
36
|
+
__diffType;
|
|
37
|
+
__isInvalid;
|
|
38
|
+
static getType() {
|
|
39
|
+
return 'resource-token';
|
|
40
|
+
}
|
|
41
|
+
static clone(node) {
|
|
42
|
+
const cloned = new ResourceTokenNode(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.lexicalResourceToken = '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 (!('lexicalResourceToken' in domNode.dataset)) return null;
|
|
88
|
+
return {
|
|
89
|
+
conversion: (element)=>({
|
|
90
|
+
node: new ResourceTokenNode(element.dataset.value ?? '')
|
|
91
|
+
}),
|
|
92
|
+
priority: 1
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static importJSON(serializedNode) {
|
|
98
|
+
return new ResourceTokenNode(serializedNode.value);
|
|
99
|
+
}
|
|
100
|
+
exportJSON() {
|
|
101
|
+
return {
|
|
102
|
+
type: 'resource-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: "resource",
|
|
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 createResourceTokenNode = (value, diffType)=>(0, external_lexical_namespaceObject.$applyNodeReplacement)(new ResourceTokenNode(value, void 0, diffType));
|
|
134
|
+
const isResourceTokenNode = (node)=>node instanceof ResourceTokenNode;
|
|
135
|
+
exports.ResourceTokenNode = __webpack_exports__.ResourceTokenNode;
|
|
136
|
+
exports.createResourceTokenNode = __webpack_exports__.createResourceTokenNode;
|
|
137
|
+
exports.isResourceTokenNode = __webpack_exports__.isResourceTokenNode;
|
|
138
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
139
|
+
"ResourceTokenNode",
|
|
140
|
+
"createResourceTokenNode",
|
|
141
|
+
"isResourceTokenNode"
|
|
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 SerializedResourceTokenNode = Spread<{
|
|
5
|
+
value: string;
|
|
6
|
+
}, SerializedLexicalNode>;
|
|
7
|
+
export declare class ResourceTokenNode extends DecoratorNode<ReactNode> {
|
|
8
|
+
__value: string;
|
|
9
|
+
__diffType?: PromptEditorDiffType;
|
|
10
|
+
__isInvalid?: boolean;
|
|
11
|
+
static getType(): string;
|
|
12
|
+
static clone(node: ResourceTokenNode): ResourceTokenNode;
|
|
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: SerializedResourceTokenNode): ResourceTokenNode;
|
|
23
|
+
exportJSON(): SerializedResourceTokenNode;
|
|
24
|
+
getTextContent(): string;
|
|
25
|
+
isInline(): boolean;
|
|
26
|
+
isKeyboardSelectable(): boolean;
|
|
27
|
+
decorate(editor: LexicalEditor): ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const createResourceTokenNode: (value: string, diffType?: PromptEditorDiffType) => ResourceTokenNode;
|
|
30
|
+
export declare const isResourceTokenNode: (node: LexicalNode | null | undefined) => node is ResourceTokenNode;
|
|
@@ -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 ResourceTokenNode extends DecoratorNode {
|
|
5
|
+
__value;
|
|
6
|
+
__diffType;
|
|
7
|
+
__isInvalid;
|
|
8
|
+
static getType() {
|
|
9
|
+
return 'resource-token';
|
|
10
|
+
}
|
|
11
|
+
static clone(node) {
|
|
12
|
+
const cloned = new ResourceTokenNode(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.lexicalResourceToken = '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 (!('lexicalResourceToken' in domNode.dataset)) return null;
|
|
58
|
+
return {
|
|
59
|
+
conversion: (element)=>({
|
|
60
|
+
node: new ResourceTokenNode(element.dataset.value ?? '')
|
|
61
|
+
}),
|
|
62
|
+
priority: 1
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static importJSON(serializedNode) {
|
|
68
|
+
return new ResourceTokenNode(serializedNode.value);
|
|
69
|
+
}
|
|
70
|
+
exportJSON() {
|
|
71
|
+
return {
|
|
72
|
+
type: 'resource-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: "resource",
|
|
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 createResourceTokenNode = (value, diffType)=>$applyNodeReplacement(new ResourceTokenNode(value, void 0, diffType));
|
|
104
|
+
const isResourceTokenNode = (node)=>node instanceof ResourceTokenNode;
|
|
105
|
+
export { ResourceTokenNode, createResourceTokenNode, isResourceTokenNode };
|
|
@@ -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
|
+
createStateTokenNode: ()=>createStateTokenNode,
|
|
28
|
+
StateTokenNode: ()=>StateTokenNode,
|
|
29
|
+
isStateTokenNode: ()=>isStateTokenNode
|
|
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 StateTokenNode extends external_lexical_namespaceObject.DecoratorNode {
|
|
35
|
+
__value;
|
|
36
|
+
__diffType;
|
|
37
|
+
__isInvalid;
|
|
38
|
+
static getType() {
|
|
39
|
+
return 'state-token';
|
|
40
|
+
}
|
|
41
|
+
static clone(node) {
|
|
42
|
+
const cloned = new StateTokenNode(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.lexicalStateToken = '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 (!('lexicalStateToken' in domNode.dataset)) return null;
|
|
88
|
+
return {
|
|
89
|
+
conversion: (element)=>({
|
|
90
|
+
node: new StateTokenNode(element.dataset.value ?? '')
|
|
91
|
+
}),
|
|
92
|
+
priority: 1
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
static importJSON(serializedNode) {
|
|
98
|
+
return new StateTokenNode(serializedNode.value);
|
|
99
|
+
}
|
|
100
|
+
exportJSON() {
|
|
101
|
+
return {
|
|
102
|
+
type: 'state-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: "state",
|
|
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 createStateTokenNode = (value, diffType)=>(0, external_lexical_namespaceObject.$applyNodeReplacement)(new StateTokenNode(value, void 0, diffType));
|
|
134
|
+
const isStateTokenNode = (node)=>node instanceof StateTokenNode;
|
|
135
|
+
exports.StateTokenNode = __webpack_exports__.StateTokenNode;
|
|
136
|
+
exports.createStateTokenNode = __webpack_exports__.createStateTokenNode;
|
|
137
|
+
exports.isStateTokenNode = __webpack_exports__.isStateTokenNode;
|
|
138
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
139
|
+
"StateTokenNode",
|
|
140
|
+
"createStateTokenNode",
|
|
141
|
+
"isStateTokenNode"
|
|
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 SerializedStateTokenNode = Spread<{
|
|
5
|
+
value: string;
|
|
6
|
+
}, SerializedLexicalNode>;
|
|
7
|
+
export declare class StateTokenNode extends DecoratorNode<ReactNode> {
|
|
8
|
+
__value: string;
|
|
9
|
+
__diffType?: PromptEditorDiffType;
|
|
10
|
+
__isInvalid?: boolean;
|
|
11
|
+
static getType(): string;
|
|
12
|
+
static clone(node: StateTokenNode): StateTokenNode;
|
|
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: SerializedStateTokenNode): StateTokenNode;
|
|
23
|
+
exportJSON(): SerializedStateTokenNode;
|
|
24
|
+
getTextContent(): string;
|
|
25
|
+
isInline(): boolean;
|
|
26
|
+
isKeyboardSelectable(): boolean;
|
|
27
|
+
decorate(editor: LexicalEditor): ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare const createStateTokenNode: (value: string, diffType?: PromptEditorDiffType) => StateTokenNode;
|
|
30
|
+
export declare const isStateTokenNode: (node: LexicalNode | null | undefined) => node is StateTokenNode;
|
|
@@ -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 StateTokenNode extends DecoratorNode {
|
|
5
|
+
__value;
|
|
6
|
+
__diffType;
|
|
7
|
+
__isInvalid;
|
|
8
|
+
static getType() {
|
|
9
|
+
return 'state-token';
|
|
10
|
+
}
|
|
11
|
+
static clone(node) {
|
|
12
|
+
const cloned = new StateTokenNode(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.lexicalStateToken = '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 (!('lexicalStateToken' in domNode.dataset)) return null;
|
|
58
|
+
return {
|
|
59
|
+
conversion: (element)=>({
|
|
60
|
+
node: new StateTokenNode(element.dataset.value ?? '')
|
|
61
|
+
}),
|
|
62
|
+
priority: 1
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static importJSON(serializedNode) {
|
|
68
|
+
return new StateTokenNode(serializedNode.value);
|
|
69
|
+
}
|
|
70
|
+
exportJSON() {
|
|
71
|
+
return {
|
|
72
|
+
type: 'state-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: "state",
|
|
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 createStateTokenNode = (value, diffType)=>$applyNodeReplacement(new StateTokenNode(value, void 0, diffType));
|
|
104
|
+
const isStateTokenNode = (node)=>node instanceof StateTokenNode;
|
|
105
|
+
export { StateTokenNode, createStateTokenNode, isStateTokenNode };
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
createOutputTokenNode: ()=>external_OutputTokenNode_cjs_namespaceObject.createOutputTokenNode,
|
|
28
|
+
InputTokenNode: ()=>external_InputTokenNode_cjs_namespaceObject.InputTokenNode,
|
|
29
|
+
isResourceTokenNode: ()=>external_ResourceTokenNode_cjs_namespaceObject.isResourceTokenNode,
|
|
30
|
+
StateTokenNode: ()=>external_StateTokenNode_cjs_namespaceObject.StateTokenNode,
|
|
31
|
+
createResourceTokenNode: ()=>external_ResourceTokenNode_cjs_namespaceObject.createResourceTokenNode,
|
|
32
|
+
isStateTokenNode: ()=>external_StateTokenNode_cjs_namespaceObject.isStateTokenNode,
|
|
33
|
+
createStateTokenNode: ()=>external_StateTokenNode_cjs_namespaceObject.createStateTokenNode,
|
|
34
|
+
ResourceTokenNode: ()=>external_ResourceTokenNode_cjs_namespaceObject.ResourceTokenNode,
|
|
35
|
+
isOutputTokenNode: ()=>external_OutputTokenNode_cjs_namespaceObject.isOutputTokenNode,
|
|
36
|
+
isInputTokenNode: ()=>external_InputTokenNode_cjs_namespaceObject.isInputTokenNode,
|
|
37
|
+
createInputTokenNode: ()=>external_InputTokenNode_cjs_namespaceObject.createInputTokenNode,
|
|
38
|
+
OutputTokenNode: ()=>external_OutputTokenNode_cjs_namespaceObject.OutputTokenNode
|
|
39
|
+
});
|
|
40
|
+
const external_InputTokenNode_cjs_namespaceObject = require("./InputTokenNode.cjs");
|
|
41
|
+
const external_OutputTokenNode_cjs_namespaceObject = require("./OutputTokenNode.cjs");
|
|
42
|
+
const external_StateTokenNode_cjs_namespaceObject = require("./StateTokenNode.cjs");
|
|
43
|
+
const external_ResourceTokenNode_cjs_namespaceObject = require("./ResourceTokenNode.cjs");
|
|
44
|
+
exports.InputTokenNode = __webpack_exports__.InputTokenNode;
|
|
45
|
+
exports.OutputTokenNode = __webpack_exports__.OutputTokenNode;
|
|
46
|
+
exports.ResourceTokenNode = __webpack_exports__.ResourceTokenNode;
|
|
47
|
+
exports.StateTokenNode = __webpack_exports__.StateTokenNode;
|
|
48
|
+
exports.createInputTokenNode = __webpack_exports__.createInputTokenNode;
|
|
49
|
+
exports.createOutputTokenNode = __webpack_exports__.createOutputTokenNode;
|
|
50
|
+
exports.createResourceTokenNode = __webpack_exports__.createResourceTokenNode;
|
|
51
|
+
exports.createStateTokenNode = __webpack_exports__.createStateTokenNode;
|
|
52
|
+
exports.isInputTokenNode = __webpack_exports__.isInputTokenNode;
|
|
53
|
+
exports.isOutputTokenNode = __webpack_exports__.isOutputTokenNode;
|
|
54
|
+
exports.isResourceTokenNode = __webpack_exports__.isResourceTokenNode;
|
|
55
|
+
exports.isStateTokenNode = __webpack_exports__.isStateTokenNode;
|
|
56
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
57
|
+
"InputTokenNode",
|
|
58
|
+
"OutputTokenNode",
|
|
59
|
+
"ResourceTokenNode",
|
|
60
|
+
"StateTokenNode",
|
|
61
|
+
"createInputTokenNode",
|
|
62
|
+
"createOutputTokenNode",
|
|
63
|
+
"createResourceTokenNode",
|
|
64
|
+
"createStateTokenNode",
|
|
65
|
+
"isInputTokenNode",
|
|
66
|
+
"isOutputTokenNode",
|
|
67
|
+
"isResourceTokenNode",
|
|
68
|
+
"isStateTokenNode"
|
|
69
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createInputTokenNode, InputTokenNode, isInputTokenNode } from './InputTokenNode';
|
|
2
|
+
export type { SerializedInputTokenNode } from './InputTokenNode';
|
|
3
|
+
export { createOutputTokenNode, isOutputTokenNode, OutputTokenNode } from './OutputTokenNode';
|
|
4
|
+
export type { SerializedOutputTokenNode } from './OutputTokenNode';
|
|
5
|
+
export { createStateTokenNode, isStateTokenNode, StateTokenNode } from './StateTokenNode';
|
|
6
|
+
export type { SerializedStateTokenNode } from './StateTokenNode';
|
|
7
|
+
export { createResourceTokenNode, isResourceTokenNode, ResourceTokenNode, } from './ResourceTokenNode';
|
|
8
|
+
export type { SerializedResourceTokenNode } from './ResourceTokenNode';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InputTokenNode, createInputTokenNode, isInputTokenNode } from "./InputTokenNode.js";
|
|
2
|
+
import { OutputTokenNode, createOutputTokenNode, isOutputTokenNode } from "./OutputTokenNode.js";
|
|
3
|
+
import { StateTokenNode, createStateTokenNode, isStateTokenNode } from "./StateTokenNode.js";
|
|
4
|
+
import { ResourceTokenNode, createResourceTokenNode, isResourceTokenNode } from "./ResourceTokenNode.js";
|
|
5
|
+
export { InputTokenNode, OutputTokenNode, ResourceTokenNode, StateTokenNode, createInputTokenNode, createOutputTokenNode, createResourceTokenNode, createStateTokenNode, isInputTokenNode, isOutputTokenNode, isResourceTokenNode, isStateTokenNode };
|