@babsey/code-graph 0.8.7 → 0.9.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/dist/code-graph.js +7 -7
- package/dist/code-graph.umd.cjs +1 -1
- package/dist/code.d.ts +57 -0
- package/dist/codeEditor.d.ts +28 -0
- package/dist/codeEngine/codeEngine.d.ts +16 -0
- package/dist/codeEngine/index.d.ts +3 -0
- package/dist/codeEngine/register.d.ts +11 -0
- package/dist/codeEngine/runEngine.command.d.ts +8 -0
- package/dist/codeGraph/codeGraph.d.ts +122 -0
- package/dist/codeGraph/codeGraphNode.d.ts +12 -0
- package/dist/codeGraph/codeGraphTemplate.d.ts +16 -0
- package/dist/codeGraph/index.d.ts +4 -0
- package/dist/codeGraph/switchCodeGraph.d.ts +8 -0
- package/dist/codeNode/codeNode.d.ts +138 -0
- package/dist/codeNode/defineCodeNode.d.ts +17 -0
- package/dist/codeNode/dynamicCodeNode.d.ts +34 -0
- package/dist/codeNode/index.d.ts +3 -0
- package/dist/codeNodeInterfaces/baseNumericInterface.d.ts +23 -0
- package/dist/codeNodeInterfaces/baseStringInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/checkbox/checkboxInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/codeNode/CodeNodeInterface.vue.d.ts +7 -0
- package/dist/codeNodeInterfaces/codeNode/codeNodeInterface.d.ts +21 -0
- package/dist/codeNodeInterfaces/codeNode/index.d.ts +2 -0
- package/dist/codeNodeInterfaces/codeNodeInput/codeNodeInputInterface.d.ts +6 -0
- package/dist/codeNodeInterfaces/codeNodeOutput/codeNodeOutputInterface.d.ts +9 -0
- package/dist/codeNodeInterfaces/createInterface.d.ts +12 -0
- package/dist/codeNodeInterfaces/index.d.ts +13 -0
- package/dist/codeNodeInterfaces/integer/integerInterface.d.ts +6 -0
- package/dist/codeNodeInterfaces/listInput/listInputInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/number/numberInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/select/selectInterface.d.ts +12 -0
- package/dist/codeNodeInterfaces/slider/sliderInterface.d.ts +9 -0
- package/dist/codeNodeInterfaces/textInput/TextInputInterface.vue.d.ts +26 -0
- package/dist/codeNodeInterfaces/textInput/textInputInterface.d.ts +7 -0
- package/dist/codeNodeInterfaces/textareaInput/textareaInputInterface.d.ts +5 -0
- package/dist/codeNodeInterfaces/tupleInput/tupleInputInterface.d.ts +5 -0
- package/dist/components/CodeGraphEditor.vue.d.ts +19 -0
- package/dist/components/dev/CodeGraphInfo.vue.d.ts +7 -0
- package/dist/components/editor/CodeEditor.vue.d.ts +19 -0
- package/dist/components/editor/CopyToClipboard.vue.d.ts +7 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/nav/NavBar.vue.d.ts +29 -0
- package/dist/components/nav/NavItem.vue.d.ts +17 -0
- package/dist/components/node/CodeGraphNode.vue.d.ts +39 -0
- package/dist/components/nodeInterface/CodeGraphNodeInterface.vue.d.ts +19 -0
- package/dist/components/nodePalette/CodeNodePalette.vue.d.ts +3 -0
- package/dist/components/sidebar/CodeGraphSidebar.vue.d.ts +15 -0
- package/dist/components/sidebar/SidebarCheckbox.vue.d.ts +13 -0
- package/dist/components.d.ts +2 -0
- package/dist/icons/Check.vue.d.ts +3 -0
- package/dist/icons/CodeVariable.vue.d.ts +3 -0
- package/dist/icons/Copy.vue.d.ts +3 -0
- package/dist/icons/DotsVertical.vue.d.ts +3 -0
- package/dist/icons/Download.vue.d.ts +3 -0
- package/dist/icons/LayoutSidebarLeftCollapse.vue.d.ts +3 -0
- package/dist/icons/LayoutSidebarLeftExpand.vue.d.ts +3 -0
- package/dist/icons/LayoutSidebarRight.vue.d.ts +3 -0
- package/dist/icons/LayoutSidebarRightCollapse.vue.d.ts +3 -0
- package/dist/icons/LayoutSidebarRightExpand.vue.d.ts +3 -0
- package/dist/icons/LockCode.vue.d.ts +3 -0
- package/dist/icons/PlayerPlay.vue.d.ts +3 -0
- package/dist/icons/Plus.vue.d.ts +3 -0
- package/dist/icons/Restore.vue.d.ts +3 -0
- package/dist/icons/Schema.vue.d.ts +3 -0
- package/dist/icons/SchemaOff.vue.d.ts +3 -0
- package/dist/icons/TransitionBottom.vue.d.ts +3 -0
- package/dist/icons/Upload.vue.d.ts +3 -0
- package/dist/icons/X.vue.d.ts +3 -0
- package/dist/icons/index.d.ts +19 -0
- package/dist/index.d.ts +14 -0
- package/dist/interfaceTypes/default.d.ts +10 -0
- package/dist/interfaceTypes/index.d.ts +1 -0
- package/dist/settings.d.ts +15 -0
- package/dist/subgraph/createSubgraph.command.d.ts +6 -0
- package/dist/subgraph/graphInterface.d.ts +68 -0
- package/dist/subgraph/index.d.ts +3 -0
- package/dist/subgraph/subgraphInterfaceNodes.d.ts +27 -0
- package/dist/utils/download.d.ts +2 -0
- package/dist/utils/object.d.ts +7 -0
- package/dist/viewModel.d.ts +46 -0
- package/package.json +4 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GraphTemplate, IGraphNode, INodeState } from '@baklavajs/core';
|
|
2
|
+
import { AbstractCodeNode } from '../codeNode';
|
|
3
|
+
import { CodeGraph, ICodeGraphState } from './codeGraph';
|
|
4
|
+
import { CodeGraphTemplate } from './codeGraphTemplate';
|
|
5
|
+
export interface IGraphCodeNodeState extends INodeState<unknown, unknown> {
|
|
6
|
+
graphState: ICodeGraphState;
|
|
7
|
+
}
|
|
8
|
+
export interface IGraphCodeNode extends IGraphNode {
|
|
9
|
+
template: CodeGraphTemplate;
|
|
10
|
+
subgraph: CodeGraph | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare function createCodeGraphNodeType(template: GraphTemplate): new () => AbstractCodeNode & IGraphNode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GraphTemplate, IGraphTemplateState } from '@baklavajs/core';
|
|
2
|
+
import { CodeEditor } from '../codeEditor';
|
|
3
|
+
import { CodeGraph, ICodeGraphState } from './codeGraph';
|
|
4
|
+
type Optional<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
|
5
|
+
export declare class CodeGraphTemplate extends GraphTemplate implements ICodeGraphState {
|
|
6
|
+
/** Create a new GraphTemplate from the nodes and connections inside the graph instance */
|
|
7
|
+
static fromGraph(graph: CodeGraph, editor: CodeEditor): CodeGraphTemplate;
|
|
8
|
+
constructor(state: Optional<IGraphTemplateState, "id" | "name">, editor: CodeEditor);
|
|
9
|
+
get shortId(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Create a new graph instance from this template
|
|
12
|
+
* or load the state into the provided graph instance.
|
|
13
|
+
*/
|
|
14
|
+
createGraph(graph?: CodeGraph): CodeGraph;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { CodeEditor } from '../codeEditor';
|
|
3
|
+
import { CodeGraph } from './codeGraph';
|
|
4
|
+
import { CodeGraphTemplate } from './codeGraphTemplate';
|
|
5
|
+
export type SwitchCodeGraph = (newGraph: CodeGraph | CodeGraphTemplate) => void;
|
|
6
|
+
export declare function useSwitchCodeGraph(editor: Ref<CodeEditor>, displayedGraph: Ref<CodeGraph>): {
|
|
7
|
+
switchGraph: SwitchCodeGraph;
|
|
8
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { AbstractNode, NodeInterface, CalculateFunction, CalculateFunctionReturnType, INodeState, NodeInterfaceDefinition } from '@baklavajs/core';
|
|
2
|
+
import { UnwrapRef } from 'vue';
|
|
3
|
+
import { Code } from '../code';
|
|
4
|
+
import { CodeNodeInputInterface, CodeNodeInterface, CodeNodeOutputInterface } from '../codeNodeInterfaces';
|
|
5
|
+
import { CodeGraph } from '../codeGraph';
|
|
6
|
+
export interface IAbstractCodeNodeState {
|
|
7
|
+
codeTemplate: string;
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
integrated: boolean;
|
|
10
|
+
lockCode: boolean;
|
|
11
|
+
modules: string[];
|
|
12
|
+
position?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
props?: unknown | null;
|
|
17
|
+
script: string;
|
|
18
|
+
variableName: string;
|
|
19
|
+
}
|
|
20
|
+
export declare abstract class AbstractCodeNode extends AbstractNode {
|
|
21
|
+
private _variableName;
|
|
22
|
+
codeTemplate: () => string;
|
|
23
|
+
readonly isCodeNode = true;
|
|
24
|
+
mask: unknown;
|
|
25
|
+
name: string;
|
|
26
|
+
state: UnwrapRef<IAbstractCodeNodeState>;
|
|
27
|
+
inputs: Record<string, CodeNodeInterface<unknown>>;
|
|
28
|
+
outputs: Record<string, CodeNodeInterface<unknown>>;
|
|
29
|
+
constructor();
|
|
30
|
+
get code(): Code | null;
|
|
31
|
+
get codeNodeInputs(): Record<string, CodeNodeInputInterface>;
|
|
32
|
+
get codeNodeOutputs(): Record<string, CodeNodeOutputInterface>;
|
|
33
|
+
get graph(): CodeGraph;
|
|
34
|
+
get hasConnectedOutputNodes(): boolean;
|
|
35
|
+
get idx(): number;
|
|
36
|
+
get idxByType(): number;
|
|
37
|
+
get idxByVariableNames(): number;
|
|
38
|
+
get isSelected(): boolean;
|
|
39
|
+
get lockCode(): boolean;
|
|
40
|
+
set lockCode(value: boolean);
|
|
41
|
+
get optionalInputs(): Record<string, CodeNodeInputInterface>;
|
|
42
|
+
get requiredInputs(): Record<string, CodeNodeInputInterface>;
|
|
43
|
+
get script(): string;
|
|
44
|
+
set script(value: string);
|
|
45
|
+
get shortId(): string;
|
|
46
|
+
get subgraph(): CodeGraph | undefined;
|
|
47
|
+
get variableName(): string;
|
|
48
|
+
set variableName(value: string);
|
|
49
|
+
abstract afterGraphLoaded(): void;
|
|
50
|
+
abstract afterLoaded(): void;
|
|
51
|
+
abstract onConnected(): void;
|
|
52
|
+
abstract onGraphUpdate(): void;
|
|
53
|
+
abstract onUnconnected(): void;
|
|
54
|
+
abstract update(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Get connected node to the node interface.
|
|
57
|
+
* @param nodeInterface string
|
|
58
|
+
* @returns code node instance or null
|
|
59
|
+
*/
|
|
60
|
+
getConnectedNodeByInterface(nodeInterface: string, type?: "inputs" | "outputs"): AbstractCodeNode | null;
|
|
61
|
+
/**
|
|
62
|
+
* Get connected nodes to the node.
|
|
63
|
+
* @param type inputs or outputs
|
|
64
|
+
* @returns code node instances
|
|
65
|
+
*/
|
|
66
|
+
getConnectedNodes(type?: "inputs" | "outputs"): AbstractCodeNode[];
|
|
67
|
+
/**
|
|
68
|
+
* Get connected nodes to the node interface.
|
|
69
|
+
* @param nodeInterface string
|
|
70
|
+
* @returns code node instances
|
|
71
|
+
*/
|
|
72
|
+
getConnectedNodesByInterface(nodeInterface: string, type?: "inputs" | "outputs"): AbstractCodeNode[];
|
|
73
|
+
/**
|
|
74
|
+
* Remove this node from the graph.
|
|
75
|
+
*/
|
|
76
|
+
remove(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Render code of this node.
|
|
79
|
+
*/
|
|
80
|
+
renderCode(data: {
|
|
81
|
+
inputs: Record<string, unknown>;
|
|
82
|
+
}): string;
|
|
83
|
+
/**
|
|
84
|
+
* Update code templates.
|
|
85
|
+
*/
|
|
86
|
+
updateCodeTemplate(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Update modules.
|
|
89
|
+
* @param modules a list of modules
|
|
90
|
+
*/
|
|
91
|
+
updateModules(modules?: string[]): void;
|
|
92
|
+
/**
|
|
93
|
+
* Update output names.
|
|
94
|
+
*/
|
|
95
|
+
updateOutputNames(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Update output values.
|
|
98
|
+
* @param output return data of calculate function
|
|
99
|
+
*/
|
|
100
|
+
updateOutputValues(outputs: CalculateFunctionReturnType<unknown>): void;
|
|
101
|
+
/**
|
|
102
|
+
* Update state props.
|
|
103
|
+
* @param props
|
|
104
|
+
*/
|
|
105
|
+
updateProps(props: unknown): void;
|
|
106
|
+
/**
|
|
107
|
+
* Update input values
|
|
108
|
+
* @param inputs input values
|
|
109
|
+
*/
|
|
110
|
+
updateInputValues(inputs: Record<string, unknown>): void;
|
|
111
|
+
}
|
|
112
|
+
export interface ICodeNodeState<I, O> extends INodeState<I, O>, IAbstractCodeNodeState {
|
|
113
|
+
}
|
|
114
|
+
export type NodeInterfaceFactory<T> = () => NodeInterface<T>;
|
|
115
|
+
export type InterfaceFactory<T> = {
|
|
116
|
+
[K in keyof T]: NodeInterfaceFactory<T[K]>;
|
|
117
|
+
};
|
|
118
|
+
export declare abstract class CodeNode<I, O> extends AbstractCodeNode {
|
|
119
|
+
abstract inputs: NodeInterfaceDefinition<I>;
|
|
120
|
+
abstract outputs: NodeInterfaceDefinition<O>;
|
|
121
|
+
/**
|
|
122
|
+
* The default implementation does nothing.
|
|
123
|
+
* Overwrite this method to do calculation.
|
|
124
|
+
* @param inputs Values of all input interfaces
|
|
125
|
+
* @param globalValues Set of values passed to every node by the engine plugin
|
|
126
|
+
* @return Values for output interfaces
|
|
127
|
+
*/
|
|
128
|
+
calculate?: CalculateFunction<I, O>;
|
|
129
|
+
executeFactory<V, T extends InterfaceFactory<V>>(type: "input" | "output", factory?: T): void;
|
|
130
|
+
load(state: ICodeNodeState<I, O>): void;
|
|
131
|
+
}
|
|
132
|
+
export type AbstractCodeNodeConstructor = new () => AbstractCodeNode;
|
|
133
|
+
/**
|
|
134
|
+
* Format inputs for mustache templates.
|
|
135
|
+
* @param intfs code node input interfaces
|
|
136
|
+
* @returns a list of string
|
|
137
|
+
*/
|
|
138
|
+
export declare const formatInputs: (intfs: Record<string, CodeNodeInputInterface>, withKeywords?: boolean) => string[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { INodeDefinition, Node } from '@baklavajs/core';
|
|
2
|
+
import { CodeNode, AbstractCodeNode } from './codeNode';
|
|
3
|
+
export type NodeConstructor<I, O> = new () => Node<I, O>;
|
|
4
|
+
export type NodeInstanceOf<T> = T extends new () => Node<infer A, infer B> ? Node<A, B> : never;
|
|
5
|
+
export interface ICodeNodeDefinition<I, O> extends INodeDefinition<I, O> {
|
|
6
|
+
afterGraphLoaded?: () => void;
|
|
7
|
+
afterLoaded?: () => void;
|
|
8
|
+
codeTemplate?: (node?: AbstractCodeNode) => string;
|
|
9
|
+
modules?: string[];
|
|
10
|
+
name?: string;
|
|
11
|
+
onConnected?: () => void;
|
|
12
|
+
onGraphUpdate?: () => void;
|
|
13
|
+
onUnconnected?: () => void;
|
|
14
|
+
update?: (node?: AbstractCodeNode) => void;
|
|
15
|
+
variableName?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function defineCodeNode<I, O>(definition: ICodeNodeDefinition<I, O>): new () => CodeNode<I, O>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IDynamicNodeDefinition, NodeInterface, NodeInterfaceDefinition } from '@baklavajs/core';
|
|
2
|
+
import { CodeNode, AbstractCodeNode, ICodeNodeState } from './codeNode';
|
|
3
|
+
type Dynamic<T> = T & Record<string, unknown>;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Abstract base class for every dynamic node
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class DynamicCodeNode<I, O> extends CodeNode<Dynamic<I>, Dynamic<O>> {
|
|
9
|
+
abstract inputs: NodeInterfaceDefinition<Dynamic<I>>;
|
|
10
|
+
abstract outputs: NodeInterfaceDefinition<Dynamic<O>>;
|
|
11
|
+
abstract load(state: ICodeNodeState<Dynamic<I>, Dynamic<O>>): void;
|
|
12
|
+
abstract save(): ICodeNodeState<Dynamic<I>, Dynamic<O>>;
|
|
13
|
+
}
|
|
14
|
+
export type DynamicNodeDefinition = Record<string, (() => NodeInterface<unknown>) | undefined>;
|
|
15
|
+
export interface DynamicNodeUpdateResult {
|
|
16
|
+
inputs?: DynamicNodeDefinition;
|
|
17
|
+
outputs?: DynamicNodeDefinition;
|
|
18
|
+
forceUpdateInputs?: string[];
|
|
19
|
+
forceUpdateOutputs?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface IDynamicCodeNodeDefinition<I, O> extends IDynamicNodeDefinition<I, O> {
|
|
22
|
+
afterGraphLoaded?: () => void;
|
|
23
|
+
afterLoaded?: () => void;
|
|
24
|
+
codeTemplate?: (node?: AbstractCodeNode) => string;
|
|
25
|
+
name?: string;
|
|
26
|
+
modules?: string[];
|
|
27
|
+
onConnected?: () => void;
|
|
28
|
+
onGraphUpdate?: () => void;
|
|
29
|
+
onUnconnected?: () => void;
|
|
30
|
+
update?: (node?: AbstractCodeNode) => void;
|
|
31
|
+
variableName?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function defineDynamicCodeNode<I, O>(definition: IDynamicCodeNodeDefinition<I, O>): new () => DynamicCodeNode<I, O>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { NodeInterface } from '@baklavajs/core';
|
|
3
|
+
import { CodeNodeInputInterface } from './codeNodeInput/codeNodeInputInterface';
|
|
4
|
+
export interface IValidator {
|
|
5
|
+
validate: (v: number) => boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class BaseNumericInterface extends CodeNodeInputInterface<number> implements IValidator {
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
constructor(name: string, value: number, min?: number, max?: number);
|
|
11
|
+
validate(v: number): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const useBaseNumericInterface: (intf: Ref<NodeInterface<number>>, precision?: number) => {
|
|
14
|
+
editMode: Ref<boolean, boolean>;
|
|
15
|
+
invalid: Ref<boolean, boolean>;
|
|
16
|
+
tempValue: Ref<string, string>;
|
|
17
|
+
inputEl: Ref<HTMLInputElement | null, HTMLInputElement | null>;
|
|
18
|
+
stringRepresentation: import('vue').ComputedRef<string>;
|
|
19
|
+
validate: (v: number) => boolean;
|
|
20
|
+
setValue: (newValue: number) => void;
|
|
21
|
+
enterEditMode: () => Promise<void>;
|
|
22
|
+
leaveEditMode: () => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CodeNodeInterface } from './codeNodeInterface';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
intf: CodeNodeInterface;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NodeInterface, INodeInterfaceState } from '@baklavajs/core';
|
|
2
|
+
import { UnwrapRef } from 'vue';
|
|
3
|
+
import { default as CodeNodeInterfaceComponent } from './CodeNodeInterface.vue';
|
|
4
|
+
import { Code } from '../../code';
|
|
5
|
+
export interface ICodeNodeInterfaceRefState {
|
|
6
|
+
optional: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class CodeNodeInterface<T = unknown> extends NodeInterface<T> {
|
|
9
|
+
isCodeNode: boolean;
|
|
10
|
+
code: Code | undefined;
|
|
11
|
+
state: UnwrapRef<ICodeNodeInterfaceRefState>;
|
|
12
|
+
type: string | null;
|
|
13
|
+
constructor(name: string, value: T);
|
|
14
|
+
get optional(): boolean;
|
|
15
|
+
get shortId(): string;
|
|
16
|
+
getValue: () => string;
|
|
17
|
+
load(state: INodeInterfaceState<T>): void;
|
|
18
|
+
save(): INodeInterfaceState<T>;
|
|
19
|
+
setOptional(value: boolean): this;
|
|
20
|
+
}
|
|
21
|
+
export { CodeNodeInterfaceComponent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AbstractCodeNode } from '../../codeNode';
|
|
2
|
+
import { CodeNodeInterface } from '../codeNode';
|
|
3
|
+
export declare class CodeNodeOutputInterface extends CodeNodeInterface<string> {
|
|
4
|
+
isCodeNodeOutput: boolean;
|
|
5
|
+
suffix: string;
|
|
6
|
+
constructor(name?: string, value?: string);
|
|
7
|
+
get codeValue(): string;
|
|
8
|
+
get node(): AbstractCodeNode | undefined;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CodeNodeInputInterface } from '.';
|
|
2
|
+
export interface IInterfaceProps {
|
|
3
|
+
forceUpdate?: boolean;
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
items?: string[];
|
|
7
|
+
max?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
name?: string;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}
|
|
12
|
+
export declare const createInterface: (name: string, interfaceProps: IInterfaceProps) => CodeNodeInputInterface;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './createInterface';
|
|
2
|
+
export * from './checkbox/checkboxInterface';
|
|
3
|
+
export * from './codeNode/codeNodeInterface';
|
|
4
|
+
export * from './codeNodeInput/codeNodeInputInterface';
|
|
5
|
+
export * from './codeNodeOutput/codeNodeOutputInterface';
|
|
6
|
+
export * from './integer/integerInterface';
|
|
7
|
+
export * from './listInput/listInputInterface';
|
|
8
|
+
export * from './number/numberInterface';
|
|
9
|
+
export * from './select/selectInterface';
|
|
10
|
+
export * from './slider/sliderInterface';
|
|
11
|
+
export * from './textInput/textInputInterface';
|
|
12
|
+
export * from './textareaInput/textareaInputInterface';
|
|
13
|
+
export * from './tupleInput/tupleInputInterface';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentOptions } from 'vue';
|
|
2
|
+
import { BaseStringInterface } from '../baseStringInterface';
|
|
3
|
+
export interface IAdvancedSelectInterfaceItem<V> {
|
|
4
|
+
text: string;
|
|
5
|
+
value: V;
|
|
6
|
+
}
|
|
7
|
+
export type SelectInterfaceItem<V> = string | IAdvancedSelectInterfaceItem<V>;
|
|
8
|
+
export declare class SelectInterface<V = string> extends BaseStringInterface {
|
|
9
|
+
component: ComponentOptions;
|
|
10
|
+
items: SelectInterfaceItem<V>[];
|
|
11
|
+
constructor(name: string, value: V, items: SelectInterfaceItem<V>[]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentOptions } from 'vue';
|
|
2
|
+
import { BaseNumericInterface } from '../baseNumericInterface';
|
|
3
|
+
export declare class SliderInterface extends BaseNumericInterface {
|
|
4
|
+
component: ComponentOptions;
|
|
5
|
+
min: number;
|
|
6
|
+
max: number;
|
|
7
|
+
constructor(name: string, value: number, min: number, max: number);
|
|
8
|
+
getValue: () => string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { TextInputInterface } from './textInputInterface';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
intf: {
|
|
6
|
+
type: () => TextInputInterface;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>, {
|
|
14
|
+
v: import('vue').WritableComputedRef<string, string>;
|
|
15
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
16
|
+
intf: {
|
|
17
|
+
type: () => TextInputInterface;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
modelValue: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentOptions } from 'vue';
|
|
2
|
+
import { default as TextInputInterfaceComponent } from './TextInputInterface.vue';
|
|
3
|
+
import { BaseStringInterface } from '../baseStringInterface';
|
|
4
|
+
export declare class TextInputInterface extends BaseStringInterface {
|
|
5
|
+
component: ComponentOptions;
|
|
6
|
+
}
|
|
7
|
+
export { TextInputInterfaceComponent };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICodeGraphViewModel } from '../viewModel';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
viewModel: ICodeGraphViewModel;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_30: {
|
|
6
|
+
node: import('baklavajs').AbstractNode;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
sidebarCodeEditor?: (props: typeof __VLS_30) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICodeGraphViewModel } from '../../viewModel';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
viewModel: ICodeGraphViewModel;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
locked: boolean;
|
|
4
|
+
extensions?: Extension[];
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
modelValue: string;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string) => any;
|
|
12
|
+
} & {
|
|
13
|
+
"update:locked": (v: boolean) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:locked"?: ((v: boolean) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
text: StringConstructor;
|
|
3
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
4
|
+
text: StringConstructor;
|
|
5
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { default as CodeEditor } from './editor/CodeEditor.vue';
|
|
2
|
+
export { default as CodeGraphEditor } from './CodeGraphEditor.vue';
|
|
3
|
+
export { default as CodeGraphInfo } from './dev/CodeGraphInfo.vue';
|
|
4
|
+
export { default as CodeGraphNode } from './node/CodeGraphNode.vue';
|
|
5
|
+
export { default as CodeGraphNodeInterface } from './nodeInterface/CodeGraphNodeInterface.vue';
|
|
6
|
+
export { default as CodeGraphSidebar } from './sidebar/CodeGraphSidebar.vue';
|
|
7
|
+
export { default as CodeNodePalette } from './nodePalette/CodeNodePalette.vue';
|
|
8
|
+
export { default as CopyToClipboard } from './editor/CopyToClipboard.vue';
|
|
9
|
+
export { default as NavBar } from './nav/NavBar.vue';
|
|
10
|
+
export { default as NavItem } from './nav/NavItem.vue';
|
|
11
|
+
export { default as SidebarCheckbox } from './sidebar/SidebarCheckbox.vue';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IEditorState } from 'baklavajs';
|
|
2
|
+
import { ICodeGraphViewModel } from '../../viewModel';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
viewModel: ICodeGraphViewModel;
|
|
5
|
+
editorStates: IEditorState[];
|
|
6
|
+
routes?: {
|
|
7
|
+
edit: string;
|
|
8
|
+
new: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {}, __VLS_15: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
prepend?: (props: typeof __VLS_1) => any;
|
|
14
|
+
} & {
|
|
15
|
+
append?: (props: typeof __VLS_15) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
|
+
"click:remove": (graphId: string) => any;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
+
"onClick:remove"?: ((graphId: string) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
prependIcon?: (props: typeof __VLS_8) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_10) => any;
|
|
6
|
+
} & {
|
|
7
|
+
appendIcon?: (props: typeof __VLS_12) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AbstractCodeNode } from '../../codeNode';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: AbstractCodeNode;
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
dragging?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_53: {
|
|
8
|
+
type: string;
|
|
9
|
+
node: AbstractCodeNode;
|
|
10
|
+
intf: import('../..').CodeNodeInterface<unknown>;
|
|
11
|
+
}, __VLS_60: {
|
|
12
|
+
node: AbstractCodeNode;
|
|
13
|
+
intf: import('../..').CodeNodeInterface<unknown>;
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
nodeInterface?: (props: typeof __VLS_53) => any;
|
|
18
|
+
} & {
|
|
19
|
+
nodeInterface?: (props: typeof __VLS_60) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
select: () => any;
|
|
23
|
+
update: () => any;
|
|
24
|
+
"start-drag": (ev: PointerEvent) => any;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
onSelect?: (() => any) | undefined;
|
|
27
|
+
onUpdate?: (() => any) | undefined;
|
|
28
|
+
"onStart-drag"?: ((ev: PointerEvent) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
selected: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NodeInterface } from '@baklavajs/core';
|
|
2
|
+
import { AbstractCodeNode } from '../../codeNode';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
node: AbstractCodeNode;
|
|
5
|
+
intf: NodeInterface;
|
|
6
|
+
};
|
|
7
|
+
declare var __VLS_1: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
default?: (props: typeof __VLS_1) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|