@operato/flow 9.0.0-beta.56 β 9.0.0-beta.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/src/api/tasks.d.ts +0 -7
- package/dist/src/api/tasks.js +0 -2517
- package/dist/src/api/tasks.js.map +0 -1
- package/dist/src/base/anchor-instance.d.ts +0 -30
- package/dist/src/base/anchor-instance.js +0 -82
- package/dist/src/base/anchor-instance.js.map +0 -1
- package/dist/src/base/flow-edge-instance.d.ts +0 -31
- package/dist/src/base/flow-edge-instance.js +0 -170
- package/dist/src/base/flow-edge-instance.js.map +0 -1
- package/dist/src/base/flow-node-abstract.d.ts +0 -49
- package/dist/src/base/flow-node-abstract.js +0 -199
- package/dist/src/base/flow-node-abstract.js.map +0 -1
- package/dist/src/components/flow-debug-panel.d.ts +0 -22
- package/dist/src/components/flow-debug-panel.js +0 -156
- package/dist/src/components/flow-debug-panel.js.map +0 -1
- package/dist/src/components/flow-executor.d.ts +0 -29
- package/dist/src/components/flow-executor.js +0 -88
- package/dist/src/components/flow-executor.js.map +0 -1
- package/dist/src/components/flow-options-builder.d.ts +0 -18
- package/dist/src/components/flow-options-builder.js +0 -145
- package/dist/src/components/flow-options-builder.js.map +0 -1
- package/dist/src/components/flow-properties-panel.d.ts +0 -22
- package/dist/src/components/flow-properties-panel.js +0 -232
- package/dist/src/components/flow-properties-panel.js.map +0 -1
- package/dist/src/components/flow-side-panel.d.ts +0 -9
- package/dist/src/components/flow-side-panel.js +0 -83
- package/dist/src/components/flow-side-panel.js.map +0 -1
- package/dist/src/components/flow-sidebar.d.ts +0 -7
- package/dist/src/components/flow-sidebar.js +0 -84
- package/dist/src/components/flow-sidebar.js.map +0 -1
- package/dist/src/components/flow-toolbar.d.ts +0 -15
- package/dist/src/components/flow-toolbar.js +0 -161
- package/dist/src/components/flow-toolbar.js.map +0 -1
- package/dist/src/components/property-editor.d.ts +0 -34
- package/dist/src/components/property-editor.js +0 -76
- package/dist/src/components/property-editor.js.map +0 -1
- package/dist/src/components/property-panel/data-mapper-popup.d.ts +0 -11
- package/dist/src/components/property-panel/data-mapper-popup.js +0 -86
- package/dist/src/components/property-panel/data-mapper-popup.js.map +0 -1
- package/dist/src/components/property-panel/task-selection-popup.d.ts +0 -10
- package/dist/src/components/property-panel/task-selection-popup.js +0 -106
- package/dist/src/components/property-panel/task-selection-popup.js.map +0 -1
- package/dist/src/context/flow-context.d.ts +0 -21
- package/dist/src/context/flow-context.js +0 -3
- package/dist/src/context/flow-context.js.map +0 -1
- package/dist/src/context/flow-debug-context.d.ts +0 -16
- package/dist/src/context/flow-debug-context.js +0 -3
- package/dist/src/context/flow-debug-context.js.map +0 -1
- package/dist/src/context/flow-edit-context.d.ts +0 -11
- package/dist/src/context/flow-edit-context.js +0 -3
- package/dist/src/context/flow-edit-context.js.map +0 -1
- package/dist/src/handlers/dnd-event-handler.d.ts +0 -9
- package/dist/src/handlers/dnd-event-handler.js +0 -41
- package/dist/src/handlers/dnd-event-handler.js.map +0 -1
- package/dist/src/handlers/flow-event-handler.d.ts +0 -20
- package/dist/src/handlers/flow-event-handler.js +0 -75
- package/dist/src/handlers/flow-event-handler.js.map +0 -1
- package/dist/src/handlers/keydown-event-handler.d.ts +0 -6
- package/dist/src/handlers/keydown-event-handler.js +0 -24
- package/dist/src/handlers/keydown-event-handler.js.map +0 -1
- package/dist/src/handlers/pointer-event-handler.d.ts +0 -9
- package/dist/src/handlers/pointer-event-handler.js +0 -118
- package/dist/src/handlers/pointer-event-handler.js.map +0 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/nodes/decision.d.ts +0 -16
- package/dist/src/nodes/decision.js +0 -43
- package/dist/src/nodes/decision.js.map +0 -1
- package/dist/src/nodes/end-event.d.ts +0 -14
- package/dist/src/nodes/end-event.js +0 -47
- package/dist/src/nodes/end-event.js.map +0 -1
- package/dist/src/nodes/index.d.ts +0 -5
- package/dist/src/nodes/index.js +0 -19
- package/dist/src/nodes/index.js.map +0 -1
- package/dist/src/nodes/intermediate-event.d.ts +0 -14
- package/dist/src/nodes/intermediate-event.js +0 -52
- package/dist/src/nodes/intermediate-event.js.map +0 -1
- package/dist/src/nodes/iterator.d.ts +0 -12
- package/dist/src/nodes/iterator.js +0 -29
- package/dist/src/nodes/iterator.js.map +0 -1
- package/dist/src/nodes/select.d.ts +0 -17
- package/dist/src/nodes/select.js +0 -71
- package/dist/src/nodes/select.js.map +0 -1
- package/dist/src/nodes/start-event.d.ts +0 -15
- package/dist/src/nodes/start-event.js +0 -46
- package/dist/src/nodes/start-event.js.map +0 -1
- package/dist/src/nodes/subflow.d.ts +0 -12
- package/dist/src/nodes/subflow.js +0 -30
- package/dist/src/nodes/subflow.js.map +0 -1
- package/dist/src/nodes/task.d.ts +0 -17
- package/dist/src/nodes/task.js +0 -60
- package/dist/src/nodes/task.js.map +0 -1
- package/dist/src/ox-flow-editor.d.ts +0 -94
- package/dist/src/ox-flow-editor.js +0 -426
- package/dist/src/ox-flow-editor.js.map +0 -1
- package/dist/src/ox-flow-monitor.d.ts +0 -24
- package/dist/src/ox-flow-monitor.js +0 -117
- package/dist/src/ox-flow-monitor.js.map +0 -1
- package/dist/src/property-editors/ox-input-anchors.d.ts +0 -12
- package/dist/src/property-editors/ox-input-anchors.js +0 -163
- package/dist/src/property-editors/ox-input-anchors.js.map +0 -1
- package/dist/src/property-editors/ox-property-editor-anchors.d.ts +0 -6
- package/dist/src/property-editors/ox-property-editor-anchors.js +0 -25
- package/dist/src/property-editors/ox-property-editor-anchors.js.map +0 -1
- package/dist/src/types.d.ts +0 -97
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils/generate-mapping-scheme.d.ts +0 -6
- package/dist/src/utils/generate-mapping-scheme.js +0 -50
- package/dist/src/utils/generate-mapping-scheme.js.map +0 -1
- package/dist/stories/ox-flow-editor.stories.d.ts +0 -24
- package/dist/stories/ox-flow-editor.stories.js +0 -249
- package/dist/stories/ox-flow-editor.stories.js.map +0 -1
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright Β© HatioLab Inc. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import { __decorate } from "tslib";
|
|
5
|
-
import './property-editor.js'; /* for registering property editors */
|
|
6
|
-
import { html, LitElement } from 'lit';
|
|
7
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
8
|
-
import { OxPropertyEditor } from '@operato/property-editor';
|
|
9
|
-
/**
|
|
10
|
-
λͺ¨λ μλν°λ€μ change μ΄λ²€νΈλ₯Ό μ§μν΄μΌ νλ€. λν, λͺ¨λ μλν°λ€μ valueμμ±μ κ°μ κ°μ ΈμΌ νλ€.
|
|
11
|
-
|
|
12
|
-
Example:
|
|
13
|
-
|
|
14
|
-
<options-builder value="{{value}}">
|
|
15
|
-
<label>Center X</label>
|
|
16
|
-
<input type="number" .value="${value.cx}">
|
|
17
|
-
<label>Width</label>
|
|
18
|
-
<input type="number" .value="${value.width}">
|
|
19
|
-
</options-builder>
|
|
20
|
-
*/
|
|
21
|
-
const DEFAULT_VALUE = {
|
|
22
|
-
legend: '',
|
|
23
|
-
// number: 0, // should be undefined
|
|
24
|
-
angle: 0,
|
|
25
|
-
string: '',
|
|
26
|
-
password: '',
|
|
27
|
-
textarea: '',
|
|
28
|
-
checkbox: false,
|
|
29
|
-
select: '',
|
|
30
|
-
color: '#000000',
|
|
31
|
-
'solidcolor-stops': null,
|
|
32
|
-
'gradientcolor-stops': null,
|
|
33
|
-
'gltf-selector': '',
|
|
34
|
-
'image-selector': '',
|
|
35
|
-
multiplecolor: null,
|
|
36
|
-
editortable: null,
|
|
37
|
-
imageselector: '',
|
|
38
|
-
options: null,
|
|
39
|
-
date: null
|
|
40
|
-
};
|
|
41
|
-
function convertValue(type, value) {
|
|
42
|
-
var converted = String(value).trim() == '' ? undefined : value;
|
|
43
|
-
switch (type) {
|
|
44
|
-
case 'number':
|
|
45
|
-
case 'angle':
|
|
46
|
-
converted = parseFloat(value);
|
|
47
|
-
converted = isNaN(converted) ? undefined : converted;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
return converted;
|
|
51
|
-
}
|
|
52
|
-
let FlowOptionsBuilder = class FlowOptionsBuilder extends LitElement {
|
|
53
|
-
constructor() {
|
|
54
|
-
super(...arguments);
|
|
55
|
-
this.value = {};
|
|
56
|
-
}
|
|
57
|
-
render() {
|
|
58
|
-
return html `<slot></slot>`;
|
|
59
|
-
}
|
|
60
|
-
firstUpdated() {
|
|
61
|
-
this.addEventListener('change', this.onValueChanged.bind(this));
|
|
62
|
-
}
|
|
63
|
-
updated(changes) {
|
|
64
|
-
changes.has('props') && this.onPropsChanged(this.props || []);
|
|
65
|
-
changes.has('value') && this.setValues();
|
|
66
|
-
}
|
|
67
|
-
onPropsChanged(props) {
|
|
68
|
-
const specs = this.props || [];
|
|
69
|
-
this.textContent = '';
|
|
70
|
-
specs.forEach((spec) => {
|
|
71
|
-
const { label, type, placeholder, name, observe, property, editor, quantifier, defaultValue, disabled, styles } = spec;
|
|
72
|
-
const elementType = OxPropertyEditor.getEditor(type);
|
|
73
|
-
if (!elementType) {
|
|
74
|
-
console.warn('Property Editor not defined', type);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const element = document.createElement(elementType);
|
|
78
|
-
element.label = label;
|
|
79
|
-
element.type = type;
|
|
80
|
-
element.placeholder = placeholder;
|
|
81
|
-
element.name = name;
|
|
82
|
-
element.setAttribute('name', name);
|
|
83
|
-
if (observe) {
|
|
84
|
-
element.observeHandler = observe;
|
|
85
|
-
}
|
|
86
|
-
element.property = property;
|
|
87
|
-
element.editor = editor;
|
|
88
|
-
element.quantifier = quantifier;
|
|
89
|
-
element.defaultValue = defaultValue;
|
|
90
|
-
element.setAttribute('property-editor', 'true');
|
|
91
|
-
element.disabled = disabled;
|
|
92
|
-
if (styles) {
|
|
93
|
-
Object.keys(styles).forEach((key) => {
|
|
94
|
-
element.style[key] = styles[key];
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
this.appendChild(element);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
setValues() {
|
|
101
|
-
this.value &&
|
|
102
|
-
Array.from(this.querySelectorAll('[name]')).forEach((prop) => {
|
|
103
|
-
let name = prop.getAttribute('name');
|
|
104
|
-
if (!name) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
var convertedValue = convertValue(prop.type, this.value[name]);
|
|
108
|
-
if (convertedValue === undefined) {
|
|
109
|
-
convertedValue = DEFAULT_VALUE[prop.type];
|
|
110
|
-
}
|
|
111
|
-
prop.value = convertedValue;
|
|
112
|
-
prop.observe.call(prop, prop.value);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
onValueChanged(e) {
|
|
116
|
-
e.stopPropagation();
|
|
117
|
-
var target = e.target;
|
|
118
|
-
const prop = target.closest('[property-editor]');
|
|
119
|
-
var name = prop.getAttribute('name');
|
|
120
|
-
if (!name) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
this.value[name] = prop.value;
|
|
124
|
-
prop.observe(prop.value);
|
|
125
|
-
this.setValues();
|
|
126
|
-
this.dispatchEvent(new CustomEvent('property-change', {
|
|
127
|
-
bubbles: true,
|
|
128
|
-
composed: true,
|
|
129
|
-
detail: {
|
|
130
|
-
[name]: prop.value
|
|
131
|
-
}
|
|
132
|
-
}));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
__decorate([
|
|
136
|
-
property({ type: Object })
|
|
137
|
-
], FlowOptionsBuilder.prototype, "value", void 0);
|
|
138
|
-
__decorate([
|
|
139
|
-
property({ type: Array })
|
|
140
|
-
], FlowOptionsBuilder.prototype, "props", void 0);
|
|
141
|
-
FlowOptionsBuilder = __decorate([
|
|
142
|
-
customElement('flow-options-builder')
|
|
143
|
-
], FlowOptionsBuilder);
|
|
144
|
-
export { FlowOptionsBuilder };
|
|
145
|
-
//# sourceMappingURL=flow-options-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-options-builder.js","sourceRoot":"","sources":["../../../src/components/flow-options-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,sBAAsB,CAAA,CAAC,sCAAsC;AAEpE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAa,gBAAgB,EAAgB,MAAM,0BAA0B,CAAA;AAEpF;;;;;;;;;;;EAWE;AAEF,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,oCAAoC;IACpC,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,SAAS;IAChB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;CACX,CAAA;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,KAAU;IAC5C,IAAI,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO;YACV,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CA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C,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAAuB;AAFtC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAoG9B","sourcesContent":["/**\n * @license Copyright Β© HatioLab Inc. All rights reserved.\n */\n\nimport './property-editor.js' /* for registering property editors */\n\nimport { html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { CSSStyles, OxPropertyEditor, PropertySpec } from '@operato/property-editor'\n\n/**\nλͺ¨λ μλν°λ€μ change μ΄λ²€νΈλ₯Ό μ§μν΄μΌ νλ€. λν, λͺ¨λ μλν°λ€μ valueμμ±μ κ°μ κ°μ ΈμΌ νλ€.\n\nExample:\n\n <options-builder value=\"{{value}}\">\n <label>Center X</label>\n <input type=\"number\" .value=\"${value.cx}\">\n <label>Width</label>\n <input type=\"number\" .value=\"${value.width}\">\n </options-builder>\n*/\n\nconst DEFAULT_VALUE = {\n legend: '',\n // number: 0, // should be undefined\n angle: 0,\n string: '',\n password: '',\n textarea: '',\n checkbox: false,\n select: '',\n color: '#000000',\n 'solidcolor-stops': null,\n 'gradientcolor-stops': null,\n 'gltf-selector': '',\n 'image-selector': '',\n multiplecolor: null,\n editortable: null,\n imageselector: '',\n options: null,\n date: null\n}\n\nfunction convertValue(type: string, value: any) {\n var converted = String(value).trim() == '' ? undefined : value\n switch (type) {\n case 'number':\n case 'angle':\n converted = parseFloat(value)\n converted = isNaN(converted) ? undefined : converted\n break\n }\n\n return converted\n}\n\n@customElement('flow-options-builder')\nexport class FlowOptionsBuilder extends LitElement {\n @property({ type: Object }) value: { [name: string]: any } = {}\n @property({ type: Array }) props?: PropertySpec[]\n\n render() {\n return html`<slot></slot>`\n }\n\n firstUpdated() {\n this.addEventListener('change', this.onValueChanged.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('props') && this.onPropsChanged(this.props || [])\n changes.has('value') && this.setValues()\n }\n\n private onPropsChanged(props: PropertySpec[]) {\n const specs = this.props || []\n\n this.textContent = ''\n specs.forEach((spec: PropertySpec) => {\n const { label, type, placeholder, name, observe, property, editor, quantifier, defaultValue, disabled, styles } =\n spec\n\n const elementType = OxPropertyEditor.getEditor(type)\n if (!elementType) {\n console.warn('Property Editor not defined', type)\n return\n }\n const element = document.createElement(elementType) as OxPropertyEditor\n\n element.label = label\n element.type = type\n element.placeholder = placeholder\n element.name = name\n element.setAttribute('name', name)\n\n if (observe) {\n element.observeHandler = observe\n }\n element.property = property\n element.editor = editor\n element.quantifier = quantifier\n element.defaultValue = defaultValue\n element.setAttribute('property-editor', 'true')\n element.disabled = disabled\n\n if (styles) {\n Object.keys(styles).forEach((key: string) => {\n element.style[key as keyof CSSStyles] = styles[key as keyof CSSStyles]\n })\n }\n\n this.appendChild(element)\n })\n }\n\n private setValues() {\n this.value &&\n Array.from(this.querySelectorAll('[name]')).forEach((prop: { [name: string]: any }) => {\n let name = prop.getAttribute('name')\n if (!name) {\n return\n }\n var convertedValue = convertValue(prop.type, this.value[name])\n if (convertedValue === undefined) {\n convertedValue = (DEFAULT_VALUE as any)[prop.type]\n }\n prop.value = convertedValue\n prop.observe.call(prop, prop.value)\n })\n }\n\n private onValueChanged(e: Event) {\n e.stopPropagation()\n var target = e.target as Element\n\n const prop = target.closest('[property-editor]') as OxPropertyEditor\n\n var name = prop.getAttribute('name')\n if (!name) {\n return\n }\n\n this.value[name] = prop.value\n\n prop.observe(prop.value)\n this.setValues()\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: {\n [name]: prop.value\n }\n })\n )\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import './flow-options-builder.js';
|
|
2
|
-
import '../property-editors/ox-input-anchors.js';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
import { FlowNode } from '../types.js';
|
|
5
|
-
import './property-panel/task-selection-popup.js';
|
|
6
|
-
import './property-panel/data-mapper-popup.js';
|
|
7
|
-
export declare class FlowPropertiesPanel extends LitElement {
|
|
8
|
-
static styles: import("lit").CSSResult;
|
|
9
|
-
private flowContext?;
|
|
10
|
-
private flowEditContext?;
|
|
11
|
-
selectedNode: FlowNode | null;
|
|
12
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
-
connectedCallback(): void;
|
|
14
|
-
/** π νμ
μ΄κΈ° */
|
|
15
|
-
private openTaskSelectionPopup;
|
|
16
|
-
private openDataMapperPopup;
|
|
17
|
-
private updateTaskSubyype;
|
|
18
|
-
private updateDataMapping;
|
|
19
|
-
private updateLabel;
|
|
20
|
-
private updateOptions;
|
|
21
|
-
private updateAnchorsOption;
|
|
22
|
-
}
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import './flow-options-builder.js';
|
|
3
|
-
import '../property-editors/ox-input-anchors.js';
|
|
4
|
-
import { LitElement, html, css, nothing } from 'lit';
|
|
5
|
-
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
-
import { consume } from '@lit/context';
|
|
7
|
-
import { OxPopup } from '@operato/popup';
|
|
8
|
-
import { flowContext } from '../context/flow-context.js';
|
|
9
|
-
import { flowEditContext } from '../context/flow-edit-context.js';
|
|
10
|
-
import './property-panel/task-selection-popup.js';
|
|
11
|
-
import './property-panel/data-mapper-popup.js';
|
|
12
|
-
let FlowPropertiesPanel = class FlowPropertiesPanel extends LitElement {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.selectedNode = null;
|
|
16
|
-
}
|
|
17
|
-
render() {
|
|
18
|
-
var _a;
|
|
19
|
-
const entity = (_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected;
|
|
20
|
-
if (!entity) {
|
|
21
|
-
return html `<p>Select a node or a edge to edit properties.</p>`;
|
|
22
|
-
}
|
|
23
|
-
const { type, label = '', options = {}, optionsSpec } = entity;
|
|
24
|
-
return html `
|
|
25
|
-
<h3>${type}</h3>
|
|
26
|
-
|
|
27
|
-
<div class="field">
|
|
28
|
-
<label>Label</label>
|
|
29
|
-
<input type="text" .value=${label} @change=${this.updateLabel} />
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<!-- νμ€ν¬ λ
Έλμ κ²½μ°, νμ€ν¬ μ ν -->
|
|
33
|
-
${(entity === null || entity === void 0 ? void 0 : entity.type) === 'task'
|
|
34
|
-
? html `
|
|
35
|
-
<div class="field">
|
|
36
|
-
<label>Task Type</label>
|
|
37
|
-
<div class="task-selector" @click=${this.openTaskSelectionPopup}>
|
|
38
|
-
${entity.subtype ? entity.subtype : 'Select a Task'}
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
${entity.subtype
|
|
43
|
-
? html `
|
|
44
|
-
<flow-options-builder
|
|
45
|
-
.value=${options}
|
|
46
|
-
.props=${this.flowContext.getTaskType(entity.subtype).parameterSpec}
|
|
47
|
-
@property-change=${this.updateOptions}
|
|
48
|
-
>
|
|
49
|
-
</flow-options-builder>
|
|
50
|
-
`
|
|
51
|
-
: nothing}
|
|
52
|
-
`
|
|
53
|
-
: html `
|
|
54
|
-
<flow-options-builder .value=${options} .props=${optionsSpec} @property-change=${this.updateOptions}>
|
|
55
|
-
</flow-options-builder>
|
|
56
|
-
`}
|
|
57
|
-
${(entity === null || entity === void 0 ? void 0 : entity.type) === 'edge'
|
|
58
|
-
? html `
|
|
59
|
-
<label>Data Mapper</label>
|
|
60
|
-
<div class="data-mapper" @click=${this.openDataMapperPopup}>
|
|
61
|
-
${entity.subtype ? entity.subtype : 'Map Data'}
|
|
62
|
-
</div>
|
|
63
|
-
`
|
|
64
|
-
: html `
|
|
65
|
-
<label>Anchors Option</label>
|
|
66
|
-
<ox-input-anchors
|
|
67
|
-
class="anchors-option"
|
|
68
|
-
.value=${entity.anchorModels}
|
|
69
|
-
@change=${this.updateAnchorsOption}
|
|
70
|
-
></ox-input-anchors>
|
|
71
|
-
`}
|
|
72
|
-
`;
|
|
73
|
-
}
|
|
74
|
-
connectedCallback() {
|
|
75
|
-
super.connectedCallback();
|
|
76
|
-
this.addEventListener('keydown', (e) => {
|
|
77
|
-
e.stopPropagation();
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
/** π νμ
μ΄κΈ° */
|
|
81
|
-
openTaskSelectionPopup() {
|
|
82
|
-
const popup = OxPopup.open({
|
|
83
|
-
template: html `
|
|
84
|
-
<task-selection-popup
|
|
85
|
-
@task-selected=${(e) => {
|
|
86
|
-
const { name } = e.detail;
|
|
87
|
-
this.updateTaskSubyype(name);
|
|
88
|
-
popup.close();
|
|
89
|
-
}}
|
|
90
|
-
></task-selection-popup>
|
|
91
|
-
`,
|
|
92
|
-
style: 'width: 80vw; height: 80vh;',
|
|
93
|
-
preventCloseOnBlur: true,
|
|
94
|
-
backdrop: true
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
openDataMapperPopup() {
|
|
98
|
-
var _a;
|
|
99
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const entity = this.flowContext.selected;
|
|
103
|
-
const popup = OxPopup.open({
|
|
104
|
-
template: html `
|
|
105
|
-
<data-mapper-popup
|
|
106
|
-
.nodes=${this.flowContext.nodes}
|
|
107
|
-
.edge=${entity}
|
|
108
|
-
@change=${(e) => {
|
|
109
|
-
e.stopPropagation();
|
|
110
|
-
this.updateDataMapping(e.detail);
|
|
111
|
-
popup.close();
|
|
112
|
-
}}
|
|
113
|
-
></data-mapper-popup>
|
|
114
|
-
`,
|
|
115
|
-
style: 'width: 80vw; height: 80vh;',
|
|
116
|
-
preventCloseOnBlur: true,
|
|
117
|
-
backdrop: true
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
updateTaskSubyype(subtype) {
|
|
121
|
-
var _a;
|
|
122
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const entity = this.flowContext.selected;
|
|
126
|
-
const model = { subtype };
|
|
127
|
-
if (!entity.label || entity.label == entity.subtype) {
|
|
128
|
-
model.label = subtype;
|
|
129
|
-
}
|
|
130
|
-
this.flowEditContext.updateEntity(entity, model);
|
|
131
|
-
this.requestUpdate();
|
|
132
|
-
}
|
|
133
|
-
updateDataMapping(dataMappings) {
|
|
134
|
-
var _a;
|
|
135
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const entity = this.flowContext.selected;
|
|
139
|
-
const model = { dataMappings };
|
|
140
|
-
this.flowEditContext.updateEntity(entity, model);
|
|
141
|
-
this.requestUpdate();
|
|
142
|
-
}
|
|
143
|
-
updateLabel(e) {
|
|
144
|
-
var _a;
|
|
145
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
const entity = this.flowContext.selected;
|
|
149
|
-
const label = e.target.value;
|
|
150
|
-
this.flowEditContext.updateEntity(entity, { label });
|
|
151
|
-
}
|
|
152
|
-
updateOptions(e) {
|
|
153
|
-
var _a;
|
|
154
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const changes = e.detail;
|
|
158
|
-
const entity = this.flowContext.selected;
|
|
159
|
-
this.flowEditContext.updateOptions(entity, changes);
|
|
160
|
-
}
|
|
161
|
-
updateAnchorsOption(e) {
|
|
162
|
-
var _a;
|
|
163
|
-
if (!((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.selected)) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
const anchors = e.detail;
|
|
167
|
-
const anchorsOption = anchors.map(({ id, angle }) => {
|
|
168
|
-
return { id, angle };
|
|
169
|
-
});
|
|
170
|
-
const entity = this.flowContext.selected;
|
|
171
|
-
this.flowEditContext.updateEntity(entity, { anchorsOption });
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
FlowPropertiesPanel.styles = css `
|
|
175
|
-
:host {
|
|
176
|
-
display: flex;
|
|
177
|
-
flex-direction: column;
|
|
178
|
-
padding: 10px;
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
overflow-y: auto;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.field {
|
|
184
|
-
display: flex;
|
|
185
|
-
flex-direction: column;
|
|
186
|
-
margin-bottom: 12px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
label {
|
|
190
|
-
font-weight: bold;
|
|
191
|
-
margin-bottom: 4px;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
select,
|
|
195
|
-
input,
|
|
196
|
-
textarea {
|
|
197
|
-
padding: 6px;
|
|
198
|
-
font-size: 14px;
|
|
199
|
-
border: 1px solid #ccc;
|
|
200
|
-
border-radius: 4px;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.task-selector,
|
|
204
|
-
.data-mapper {
|
|
205
|
-
cursor: pointer;
|
|
206
|
-
background-color: #f8f9fa;
|
|
207
|
-
padding: 8px;
|
|
208
|
-
border: 1px solid #ccc;
|
|
209
|
-
border-radius: 4px;
|
|
210
|
-
text-align: center;
|
|
211
|
-
font-weight: bold;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.task-selector:hover,
|
|
215
|
-
.data-mapper:hover {
|
|
216
|
-
background-color: #e2e6ea;
|
|
217
|
-
}
|
|
218
|
-
`;
|
|
219
|
-
__decorate([
|
|
220
|
-
consume({ context: flowContext, subscribe: true })
|
|
221
|
-
], FlowPropertiesPanel.prototype, "flowContext", void 0);
|
|
222
|
-
__decorate([
|
|
223
|
-
consume({ context: flowEditContext, subscribe: true })
|
|
224
|
-
], FlowPropertiesPanel.prototype, "flowEditContext", void 0);
|
|
225
|
-
__decorate([
|
|
226
|
-
property({ type: Object })
|
|
227
|
-
], FlowPropertiesPanel.prototype, "selectedNode", void 0);
|
|
228
|
-
FlowPropertiesPanel = __decorate([
|
|
229
|
-
customElement('flow-properties-panel')
|
|
230
|
-
], FlowPropertiesPanel);
|
|
231
|
-
export { FlowPropertiesPanel };
|
|
232
|
-
//# sourceMappingURL=flow-properties-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-properties-panel.js","sourceRoot":"","sources":["../../../src/components/flow-properties-panel.ts"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAA;AAClC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAS,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAmB,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAE,eAAe,EAAuB,MAAM,iCAAiC,CAAA;AAGtF,OAAO,0CAA0C,CAAA;AACjD,OAAO,uCAAuC,CAAA;AAIvC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAA5C;;QAqDuB,iBAAY,GAAoB,IAAI,CAAA;IAiLlE,CAAC;IA/KC,MAAM;;QACJ,MAAM,MAAM,GAAG,MAAA,IAAI,CAAC,WAAW,0CAAE,QAAQ,CAAA;QAEzC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA,oDAAoD,CAAA;QACjE,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,EAAE,EAAE,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QAE9D,OAAO,IAAI,CAAA;YACH,IAAI;;;;oCAIoB,KAAK,YAAY,IAAI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,MAAA,IAAI,CAAC,WAAW,0CAAE,QAAQ,CAAA,EAAE,CAAC;YAChC,OAAM;QACR,CAAC;QAED,MAAM,OAAO,GAAI,CAAiB,CAAC,MAAkB,CAAA;QACrD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YAClD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAA;QACtB,CAAC,CAAC,CAAA;QACF,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAA;QAExC,IAAI,CAAC,eAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,aAAa,EAA8B,CAAC,CAAA;IAC3F,CAAC;;AApOM,0BAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4ClB,AA5CY,CA4CZ;AAGO;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;wDACd;AAG7B;IADP,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;4DACV;AAEjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yDAAqC;AArDrD,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAsO/B","sourcesContent":["import './flow-options-builder.js'\nimport '../property-editors/ox-input-anchors.js'\n\nimport { LitElement, html, css, nothing } from 'lit'\nimport { customElement, state, property } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { OxPopup } from '@operato/popup'\nimport { flowContext, FlowContextType } from '../context/flow-context.js'\nimport { flowEditContext, FlowEditContextType } from '../context/flow-edit-context.js'\nimport { Anchor, FlowEdge, FlowEdgeModel, FlowEntityModel, FlowNode, TaskType } from '../types.js'\n\nimport './property-panel/task-selection-popup.js'\nimport './property-panel/data-mapper-popup.js'\nimport { Mapping } from '@operato/data-mapper'\n\n@customElement('flow-properties-panel')\nexport class FlowPropertiesPanel extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n padding: 10px;\n box-sizing: border-box;\n overflow-y: auto;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n margin-bottom: 12px;\n }\n\n label {\n font-weight: bold;\n margin-bottom: 4px;\n }\n\n select,\n input,\n textarea {\n padding: 6px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 4px;\n }\n\n .task-selector,\n .data-mapper {\n cursor: pointer;\n background-color: #f8f9fa;\n padding: 8px;\n border: 1px solid #ccc;\n border-radius: 4px;\n text-align: center;\n font-weight: bold;\n }\n\n .task-selector:hover,\n .data-mapper:hover {\n background-color: #e2e6ea;\n }\n `\n\n @consume({ context: flowContext, subscribe: true })\n private flowContext?: FlowContextType\n\n @consume({ context: flowEditContext, subscribe: true })\n private flowEditContext?: FlowEditContextType\n\n @property({ type: Object }) selectedNode: FlowNode | null = null\n\n render() {\n const entity = this.flowContext?.selected\n\n if (!entity) {\n return html`<p>Select a node or a edge to edit properties.</p>`\n }\n\n const { type, label = '', options = {}, optionsSpec } = entity\n\n return html`\n <h3>${type}</h3>\n\n <div class=\"field\">\n <label>Label</label>\n <input type=\"text\" .value=${label} @change=${this.updateLabel} />\n </div>\n\n <!-- νμ€ν¬ λ
Έλμ κ²½μ°, νμ€ν¬ μ ν -->\n ${entity?.type === 'task'\n ? html`\n <div class=\"field\">\n <label>Task Type</label>\n <div class=\"task-selector\" @click=${this.openTaskSelectionPopup}>\n ${entity.subtype ? entity.subtype : 'Select a Task'}\n </div>\n </div>\n\n ${entity.subtype\n ? html`\n <flow-options-builder\n .value=${options}\n .props=${this.flowContext!.getTaskType(entity.subtype).parameterSpec}\n @property-change=${this.updateOptions}\n >\n </flow-options-builder>\n `\n : nothing}\n `\n : html`\n <flow-options-builder .value=${options} .props=${optionsSpec} @property-change=${this.updateOptions}>\n </flow-options-builder>\n `}\n ${entity?.type === 'edge'\n ? html`\n <label>Data Mapper</label>\n <div class=\"data-mapper\" @click=${this.openDataMapperPopup}>\n ${entity.subtype ? entity.subtype : 'Map Data'}\n </div>\n `\n : html`\n <label>Anchors Option</label>\n <ox-input-anchors\n class=\"anchors-option\"\n .value=${(entity as FlowNode).anchorModels!}\n @change=${this.updateAnchorsOption}\n ></ox-input-anchors>\n `}\n `\n }\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.addEventListener('keydown', (e: KeyboardEvent) => {\n e.stopPropagation()\n })\n }\n\n /** π νμ
μ΄κΈ° */\n private openTaskSelectionPopup() {\n const popup = OxPopup.open({\n template: html`\n <task-selection-popup\n @task-selected=${(e: CustomEvent) => {\n const { name } = e.detail as TaskType\n this.updateTaskSubyype(name)\n popup.close()\n }}\n ></task-selection-popup>\n `,\n style: 'width: 80vw; height: 80vh;',\n preventCloseOnBlur: true,\n backdrop: true\n })\n }\n\n private openDataMapperPopup() {\n if (!this.flowContext?.selected) {\n return\n }\n\n const entity = this.flowContext.selected\n\n const popup = OxPopup.open({\n template: html`\n <data-mapper-popup\n .nodes=${this.flowContext.nodes}\n .edge=${entity as FlowEdge}\n @change=${(e: CustomEvent) => {\n e.stopPropagation()\n this.updateDataMapping(e.detail)\n popup.close()\n }}\n ></data-mapper-popup>\n `,\n style: 'width: 80vw; height: 80vh;',\n preventCloseOnBlur: true,\n backdrop: true\n })\n }\n\n private updateTaskSubyype(subtype: string) {\n if (!this.flowContext?.selected) {\n return\n }\n\n const entity = this.flowContext.selected\n\n const model: Partial<FlowEntityModel> = { subtype }\n if (!entity.label || entity.label == entity.subtype) {\n model.label = subtype\n }\n\n this.flowEditContext!.updateEntity(entity, model)\n this.requestUpdate()\n }\n\n private updateDataMapping(dataMappings: Mapping[]) {\n if (!this.flowContext?.selected) {\n return\n }\n\n const entity = this.flowContext.selected\n\n const model: Partial<FlowEdgeModel> = { dataMappings }\n\n this.flowEditContext!.updateEntity(entity, model)\n this.requestUpdate()\n }\n\n private updateLabel(e: Event) {\n if (!this.flowContext?.selected) {\n return\n }\n\n const entity = this.flowContext.selected\n const label = (e.target as HTMLInputElement).value\n\n this.flowEditContext!.updateEntity(entity, { label })\n }\n\n private updateOptions(e: Event) {\n if (!this.flowContext?.selected) {\n return\n }\n\n const changes = (e as CustomEvent).detail\n const entity = this.flowContext.selected\n\n this.flowEditContext!.updateOptions(entity, changes)\n }\n\n private updateAnchorsOption(e: Event) {\n if (!this.flowContext?.selected) {\n return\n }\n\n const anchors = (e as CustomEvent).detail as Anchor[]\n const anchorsOption = anchors.map(({ id, angle }) => {\n return { id, angle }\n })\n const entity = this.flowContext.selected\n\n this.flowEditContext!.updateEntity(entity, { anchorsOption } as Partial<FlowEntityModel>)\n }\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import './flow-debug-panel.js';
|
|
2
|
-
import './flow-properties-panel.js';
|
|
3
|
-
import { LitElement } from 'lit';
|
|
4
|
-
export declare class FlowSidePanel extends LitElement {
|
|
5
|
-
static styles: import("lit").CSSResult;
|
|
6
|
-
private activeTab;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
private setActiveTab;
|
|
9
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import './flow-debug-panel.js';
|
|
3
|
-
import './flow-properties-panel.js';
|
|
4
|
-
import { LitElement, html, css } from 'lit';
|
|
5
|
-
import { customElement, state } from 'lit/decorators.js';
|
|
6
|
-
let FlowSidePanel = class FlowSidePanel extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.activeTab = 'properties';
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return html `
|
|
13
|
-
<!-- πΉ ν UI -->
|
|
14
|
-
<div class="tab-bar">
|
|
15
|
-
<div
|
|
16
|
-
class="tab ${this.activeTab === 'properties' ? 'active' : ''}"
|
|
17
|
-
@click=${() => this.setActiveTab('properties')}
|
|
18
|
-
>
|
|
19
|
-
Properties
|
|
20
|
-
</div>
|
|
21
|
-
<div class="tab ${this.activeTab === 'debug' ? 'active' : ''}" @click=${() => this.setActiveTab('debug')}>
|
|
22
|
-
Debug
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<!-- πΉ μ νλ νμ λ°λΌ ν¨λ λ λλ§ -->
|
|
27
|
-
<div class="panel-container">
|
|
28
|
-
${this.activeTab === 'properties' ? html `<flow-properties-panel></flow-properties-panel>` : ''}
|
|
29
|
-
${this.activeTab === 'debug' ? html `<flow-debug-panel></flow-debug-panel>` : ''}
|
|
30
|
-
</div>
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
setActiveTab(tab) {
|
|
34
|
-
this.activeTab = tab;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
FlowSidePanel.styles = css `
|
|
38
|
-
:host {
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
width: 380px;
|
|
42
|
-
height: 100%;
|
|
43
|
-
border-left: 1px solid #ccc;
|
|
44
|
-
background-color: #fafafa;
|
|
45
|
-
box-sizing: border-box;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.tab-bar {
|
|
49
|
-
display: flex;
|
|
50
|
-
border-bottom: 1px solid #ccc;
|
|
51
|
-
background-color: #e0e0e0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.tab {
|
|
55
|
-
flex: 1;
|
|
56
|
-
padding: 10px;
|
|
57
|
-
text-align: center;
|
|
58
|
-
cursor: pointer;
|
|
59
|
-
font-weight: bold;
|
|
60
|
-
border-bottom: 3px solid transparent;
|
|
61
|
-
transition:
|
|
62
|
-
background 0.2s ease,
|
|
63
|
-
border-bottom 0.2s ease;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.tab.active {
|
|
67
|
-
background-color: #fff;
|
|
68
|
-
border-bottom: 3px solid #007acc;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.panel-container {
|
|
72
|
-
flex: 1;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
__decorate([
|
|
77
|
-
state()
|
|
78
|
-
], FlowSidePanel.prototype, "activeTab", void 0);
|
|
79
|
-
FlowSidePanel = __decorate([
|
|
80
|
-
customElement('flow-side-panel')
|
|
81
|
-
], FlowSidePanel);
|
|
82
|
-
export { FlowSidePanel };
|
|
83
|
-
//# sourceMappingURL=flow-side-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-side-panel.js","sourceRoot":"","sources":["../../../src/components/flow-side-panel.ts"],"names":[],"mappings":";AAAA,OAAO,uBAAuB,CAAA;AAC9B,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGjD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAyCY,cAAS,GAA2B,YAAY,CAAA;IA4BnE,CAAC;IA1BC,MAAM;QACJ,OAAO,IAAI,CAAA;;;;uBAIQ,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;mBACnD,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;;;;0BAI9B,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;;;;;;;UAOtG,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAA,iDAAiD,CAAC,CAAC,CAAC,EAAE;UAC5F,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA,uCAAuC,CAAC,CAAC,CAAC,EAAE;;KAElF,CAAA;IACH,CAAC;IAEO,YAAY,CAAC,GAA2B;QAC9C,IAAI,CAAC,SAAS,GAAG,GAAG,CAAA;IACtB,CAAC;;AAnEM,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsClB,AAtCY,CAsCZ;AAEgB;IAAhB,KAAK,EAAE;gDAAyD;AAzCtD,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAqEzB","sourcesContent":["import './flow-debug-panel.js'\nimport './flow-properties-panel.js'\n\nimport { LitElement, html, css } from 'lit'\nimport { customElement, state } from 'lit/decorators.js'\n\n@customElement('flow-side-panel')\nexport class FlowSidePanel extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n width: 380px;\n height: 100%;\n border-left: 1px solid #ccc;\n background-color: #fafafa;\n box-sizing: border-box;\n }\n\n .tab-bar {\n display: flex;\n border-bottom: 1px solid #ccc;\n background-color: #e0e0e0;\n }\n\n .tab {\n flex: 1;\n padding: 10px;\n text-align: center;\n cursor: pointer;\n font-weight: bold;\n border-bottom: 3px solid transparent;\n transition:\n background 0.2s ease,\n border-bottom 0.2s ease;\n }\n\n .tab.active {\n background-color: #fff;\n border-bottom: 3px solid #007acc;\n }\n\n .panel-container {\n flex: 1;\n overflow: hidden;\n }\n `\n\n @state() private activeTab: 'properties' | 'debug' = 'properties'\n\n render() {\n return html`\n <!-- πΉ ν UI -->\n <div class=\"tab-bar\">\n <div\n class=\"tab ${this.activeTab === 'properties' ? 'active' : ''}\"\n @click=${() => this.setActiveTab('properties')}\n >\n Properties\n </div>\n <div class=\"tab ${this.activeTab === 'debug' ? 'active' : ''}\" @click=${() => this.setActiveTab('debug')}>\n Debug\n </div>\n </div>\n\n <!-- πΉ μ νλ νμ λ°λΌ ν¨λ λ λλ§ -->\n <div class=\"panel-container\">\n ${this.activeTab === 'properties' ? html`<flow-properties-panel></flow-properties-panel>` : ''}\n ${this.activeTab === 'debug' ? html`<flow-debug-panel></flow-debug-panel>` : ''}\n </div>\n `\n }\n\n private setActiveTab(tab: 'properties' | 'debug') {\n this.activeTab = tab\n }\n}\n"]}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { LitElement, html, css } from 'lit';
|
|
3
|
-
import { customElement } from 'lit/decorators.js';
|
|
4
|
-
import { consume } from '@lit/context';
|
|
5
|
-
import { flowContext } from '../context/flow-context.js';
|
|
6
|
-
let FlowSidebar = class FlowSidebar extends LitElement {
|
|
7
|
-
render() {
|
|
8
|
-
var _a;
|
|
9
|
-
const nodeImplementations = Object.entries(((_a = this.flowContext) === null || _a === void 0 ? void 0 : _a.availableNodeTypes) || {}).map(([key, clazz]) => {
|
|
10
|
-
return {
|
|
11
|
-
id: key,
|
|
12
|
-
node: new clazz({ size: { w: 40, h: 30 } })
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
return html `
|
|
16
|
-
<div content>
|
|
17
|
-
${(nodeImplementations || []).map(({ id, node }) => html `
|
|
18
|
-
<div
|
|
19
|
-
class="node-item"
|
|
20
|
-
draggable="true"
|
|
21
|
-
@dragstart=${(e) => this.onDragStart(e, { label: node.label, id })}
|
|
22
|
-
>
|
|
23
|
-
<svg width="40" height="48">
|
|
24
|
-
<g transform="translate(20, 15)" stroke="black" fill="transparent">
|
|
25
|
-
${node.renderNode()}
|
|
26
|
-
<text class="node-label" x="0" y="30" font-size="12" text-anchor="middle" fill="black">
|
|
27
|
-
${node.type}
|
|
28
|
-
</text>
|
|
29
|
-
</g>
|
|
30
|
-
</svg>
|
|
31
|
-
</div>
|
|
32
|
-
`)}
|
|
33
|
-
</div>
|
|
34
|
-
`;
|
|
35
|
-
}
|
|
36
|
-
onDragStart(e, nodeType) {
|
|
37
|
-
if (e.dataTransfer) {
|
|
38
|
-
e.dataTransfer.setData('application/node-type', JSON.stringify(nodeType));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
FlowSidebar.styles = css `
|
|
43
|
-
:host {
|
|
44
|
-
display: flex;
|
|
45
|
-
flex-direction: column;
|
|
46
|
-
background-color: #f0f0f0;
|
|
47
|
-
border: 1px solid #ccc;
|
|
48
|
-
padding: 8px;
|
|
49
|
-
box-sizing: border-box;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
label {
|
|
53
|
-
font-size: 16px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
div[content] {
|
|
57
|
-
flex: 1;
|
|
58
|
-
display: flex;
|
|
59
|
-
flex-direction: column;
|
|
60
|
-
gap: 10px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.node-item {
|
|
64
|
-
display: flex;
|
|
65
|
-
background-color: transparent;
|
|
66
|
-
cursor: grab;
|
|
67
|
-
user-select: none;
|
|
68
|
-
text-align: center;
|
|
69
|
-
transition: background-color 0.2s ease;
|
|
70
|
-
padding: 4px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.node-item:hover {
|
|
74
|
-
background-color: #0000006c;
|
|
75
|
-
}
|
|
76
|
-
`;
|
|
77
|
-
__decorate([
|
|
78
|
-
consume({ context: flowContext })
|
|
79
|
-
], FlowSidebar.prototype, "flowContext", void 0);
|
|
80
|
-
FlowSidebar = __decorate([
|
|
81
|
-
customElement('flow-sidebar')
|
|
82
|
-
], FlowSidebar);
|
|
83
|
-
export { FlowSidebar };
|
|
84
|
-
//# sourceMappingURL=flow-sidebar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flow-sidebar.js","sourceRoot":"","sources":["../../../src/components/flow-sidebar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAY,MAAM,mBA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B,AAlCY,CAkCZ;AAE0C;IAA1C,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;gDAAsC;AArC7D,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA4EvB","sourcesContent":["import { LitElement, html, css } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { consume } from '@lit/context'\nimport { flowContext, FlowContextType } from '../context/flow-context.js'\n\n@customElement('flow-sidebar')\nexport class FlowSidebar extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: #f0f0f0;\n border: 1px solid #ccc;\n padding: 8px;\n box-sizing: border-box;\n }\n\n label {\n font-size: 16px;\n }\n\n div[content] {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .node-item {\n display: flex;\n background-color: transparent;\n cursor: grab;\n user-select: none;\n text-align: center;\n transition: background-color 0.2s ease;\n padding: 4px;\n }\n\n .node-item:hover {\n background-color: #0000006c;\n }\n `\n\n @consume({ context: flowContext }) private flowContext?: FlowContextType\n\n render() {\n const nodeImplementations = Object.entries(this.flowContext?.availableNodeTypes || {}).map(([key, clazz]) => {\n return {\n id: key,\n node: new clazz({ size: { w: 40, h: 30 } })\n }\n })\n\n return html`\n <div content>\n ${(nodeImplementations || []).map(\n ({ id, node }) => html`\n <div\n class=\"node-item\"\n draggable=\"true\"\n @dragstart=${(e: DragEvent) => this.onDragStart(e, { label: node.label, id })}\n >\n <svg width=\"40\" height=\"48\">\n <g transform=\"translate(20, 15)\" stroke=\"black\" fill=\"transparent\">\n ${node.renderNode()}\n <text class=\"node-label\" x=\"0\" y=\"30\" font-size=\"12\" text-anchor=\"middle\" fill=\"black\">\n ${node.type}\n </text>\n </g>\n </svg>\n </div>\n `\n )}\n </div>\n `\n }\n\n private onDragStart(e: DragEvent, nodeType: { label?: string; id: string }) {\n if (e.dataTransfer) {\n e.dataTransfer.setData('application/node-type', JSON.stringify(nodeType))\n }\n }\n}\n"]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class FlowToolbar extends LitElement {
|
|
3
|
-
static styles: import("lit").CSSResult;
|
|
4
|
-
private flowContext?;
|
|
5
|
-
private flowDebugContext?;
|
|
6
|
-
private flowEditContext?;
|
|
7
|
-
private currentMode;
|
|
8
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
-
/** λͺ¨λ μ ν */
|
|
10
|
-
private toggleMode;
|
|
11
|
-
/** λΈλ μ΄ν¬ν¬μΈνΈ μ€μ / ν΄μ */
|
|
12
|
-
private toggleBreakpoint;
|
|
13
|
-
/** νμ¬ μ νλ λ
Έλκ° λΈλ μ΄ν¬ν¬μΈνΈμΈμ§ μ¬λΆ */
|
|
14
|
-
private get hasBreakpoint();
|
|
15
|
-
}
|