@operato/process 1.1.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/.storybook/main.js +3 -0
- package/.storybook/server.mjs +8 -0
- package/CHANGELOG.md +1824 -0
- package/LICENSE +21 -0
- package/README.md +95 -0
- package/demo/index-modeller.html +101 -0
- package/demo/index-viewer.html +101 -0
- package/demo/index.html +101 -0
- package/dist/src/data-storage/data-storage.d.ts +8 -0
- package/dist/src/data-storage/data-storage.js +28 -0
- package/dist/src/data-storage/data-storage.js.map +1 -0
- package/dist/src/graphql/data-subscription.d.ts +5 -0
- package/dist/src/graphql/data-subscription.js +24 -0
- package/dist/src/graphql/data-subscription.js.map +1 -0
- package/dist/src/graphql/favorite-process.d.ts +1 -0
- package/dist/src/graphql/favorite-process.js +23 -0
- package/dist/src/graphql/favorite-process.js.map +1 -0
- package/dist/src/graphql/index.d.ts +3 -0
- package/dist/src/graphql/index.js +4 -0
- package/dist/src/graphql/index.js.map +1 -0
- package/dist/src/graphql/process-group.d.ts +7 -0
- package/dist/src/graphql/process-group.js +125 -0
- package/dist/src/graphql/process-group.js.map +1 -0
- package/dist/src/graphql/process.d.ts +6 -0
- package/dist/src/graphql/process.js +130 -0
- package/dist/src/graphql/process.js.map +1 -0
- package/dist/src/graphql/scenario.d.ts +6 -0
- package/dist/src/graphql/scenario.js +69 -0
- package/dist/src/graphql/scenario.js.map +1 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-detail.d.ts +12 -0
- package/dist/src/modeller/component-toolbar/component-detail.js +58 -0
- package/dist/src/modeller/component-toolbar/component-detail.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-menu.d.ts +24 -0
- package/dist/src/modeller/component-toolbar/component-menu.js +190 -0
- package/dist/src/modeller/component-toolbar/component-menu.js.map +1 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.d.ts +28 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js +168 -0
- package/dist/src/modeller/component-toolbar/component-toolbar.js.map +1 -0
- package/dist/src/modeller/component-toolbar/mode-icons.d.ts +2 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js +86 -0
- package/dist/src/modeller/component-toolbar/mode-icons.js.map +1 -0
- package/dist/src/modeller/edit-toolbar-style.d.ts +4 -0
- package/dist/src/modeller/edit-toolbar-style.js +227 -0
- package/dist/src/modeller/edit-toolbar-style.js.map +1 -0
- package/dist/src/modeller/edit-toolbar.d.ts +61 -0
- package/dist/src/modeller/edit-toolbar.js +641 -0
- package/dist/src/modeller/edit-toolbar.js.map +1 -0
- package/dist/src/modeller/property-sidebar/abstract-property.d.ts +10 -0
- package/dist/src/modeller/property-sidebar/abstract-property.js +55 -0
- package/dist/src/modeller/property-sidebar/abstract-property.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.d.ts +4 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js +61 -0
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/effects.d.ts +20 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js +42 -0
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.d.ts +23 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +103 -0
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +1 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.js +21 -0
- package/dist/src/modeller/property-sidebar/effects/value-converter.js.map +1 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +29 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +318 -0
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.d.ts +4 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js +135 -0
- package/dist/src/modeller/property-sidebar/property-shared-style.js.map +1 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +43 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js +309 -0
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +1 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.d.ts +1 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js +94 -0
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js.map +1 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +28 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +321 -0
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +1 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.d.ts +16 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +132 -0
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js.map +1 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +25 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js +81 -0
- package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +1 -0
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +21 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js +559 -0
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +1 -0
- package/dist/src/modeller/scene-viewer/scene-handler.d.ts +11 -0
- package/dist/src/modeller/scene-viewer/scene-handler.js +32 -0
- package/dist/src/modeller/scene-viewer/scene-handler.js.map +1 -0
- package/dist/src/modeller/scene-viewer/scene-layer.d.ts +10 -0
- package/dist/src/modeller/scene-viewer/scene-layer.js +38 -0
- package/dist/src/modeller/scene-viewer/scene-layer.js.map +1 -0
- package/dist/src/modeller/scene-viewer/scene-property.d.ts +6 -0
- package/dist/src/modeller/scene-viewer/scene-property.js +15 -0
- package/dist/src/modeller/scene-viewer/scene-property.js.map +1 -0
- package/dist/src/modeller/scene-viewer/scene-viewer.d.ts +38 -0
- package/dist/src/modeller/scene-viewer/scene-viewer.js +243 -0
- package/dist/src/modeller/scene-viewer/scene-viewer.js.map +1 -0
- package/dist/src/ox-process-list.d.ts +2 -0
- package/dist/src/ox-process-list.js +427 -0
- package/dist/src/ox-process-list.js.map +1 -0
- package/dist/src/ox-process-modeller.d.ts +58 -0
- package/dist/src/ox-process-modeller.js +396 -0
- package/dist/src/ox-process-modeller.js.map +1 -0
- package/dist/src/ox-process-viewer.d.ts +51 -0
- package/dist/src/ox-process-viewer.js +512 -0
- package/dist/src/ox-process-viewer.js.map +1 -0
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stories/index.stories.d.ts +33 -0
- package/dist/stories/index.stories.js +33 -0
- package/dist/stories/index.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/icons/components/audio.png +0 -0
- package/icons/components/both-arrow.png +0 -0
- package/icons/components/color-image.png +0 -0
- package/icons/components/container.png +0 -0
- package/icons/components/dash.png +0 -0
- package/icons/components/donut.png +0 -0
- package/icons/components/ellipse.png +0 -0
- package/icons/components/forklift.png +0 -0
- package/icons/components/gif-image.png +0 -0
- package/icons/components/global-reference.png +0 -0
- package/icons/components/gray-image.png +0 -0
- package/icons/components/humidity-sensor.png +0 -0
- package/icons/components/info-window.png +0 -0
- package/icons/components/line.png +0 -0
- package/icons/components/local-reference.png +0 -0
- package/icons/components/no-image.png +0 -0
- package/icons/components/ortholine.png +0 -0
- package/icons/components/person.png +0 -0
- package/icons/components/polygon.png +0 -0
- package/icons/components/polyline.png +0 -0
- package/icons/components/popup.png +0 -0
- package/icons/components/rect.png +0 -0
- package/icons/components/single-arrow.png +0 -0
- package/icons/components/star.png +0 -0
- package/icons/components/streamline.png +0 -0
- package/icons/components/text.png +0 -0
- package/icons/components/triangle.png +0 -0
- package/icons/icon-collapse-active.png +0 -0
- package/icons/icon-collapse.png +0 -0
- package/icons/icon-fullscreen.png +0 -0
- package/icons/icon-htoolbar.png +0 -0
- package/icons/icon-properties-arrow-type.png +0 -0
- package/icons/icon-properties-gradient-direction.png +0 -0
- package/icons/icon-properties-label.png +0 -0
- package/icons/icon-properties-line-type.png +0 -0
- package/icons/icon-properties-padding.png +0 -0
- package/icons/icon-properties-ratio.png +0 -0
- package/icons/icon-properties-table.png +0 -0
- package/icons/icon-properties.png +0 -0
- package/icons/icon-shell-inspector.png +0 -0
- package/package.json +115 -0
- package/src/data-storage/data-storage.ts +47 -0
- package/src/graphql/data-subscription.ts +30 -0
- package/src/graphql/favorite-process.ts +25 -0
- package/src/graphql/index.ts +3 -0
- package/src/graphql/process-group.ts +138 -0
- package/src/graphql/process.ts +144 -0
- package/src/graphql/scenario.ts +79 -0
- package/src/index.ts +7 -0
- package/src/modeller/component-toolbar/component-detail.ts +58 -0
- package/src/modeller/component-toolbar/component-menu.ts +187 -0
- package/src/modeller/component-toolbar/component-toolbar.ts +173 -0
- package/src/modeller/component-toolbar/mode-icons.ts +86 -0
- package/src/modeller/edit-toolbar-style.ts +228 -0
- package/src/modeller/edit-toolbar.ts +641 -0
- package/src/modeller/property-sidebar/abstract-property.ts +69 -0
- package/src/modeller/property-sidebar/effects/effects-shared-style.ts +62 -0
- package/src/modeller/property-sidebar/effects/effects.ts +47 -0
- package/src/modeller/property-sidebar/effects/property-shadow.ts +114 -0
- package/src/modeller/property-sidebar/effects/value-converter.ts +23 -0
- package/src/modeller/property-sidebar/inspector/inspector.ts +361 -0
- package/src/modeller/property-sidebar/property-shared-style.ts +136 -0
- package/src/modeller/property-sidebar/property-sidebar.ts +308 -0
- package/src/modeller/property-sidebar/shapes/box-padding-editor-styles.ts +94 -0
- package/src/modeller/property-sidebar/shapes/shapes.ts +326 -0
- package/src/modeller/property-sidebar/specifics/specific-properties-builder.ts +144 -0
- package/src/modeller/property-sidebar/specifics/specifics.ts +77 -0
- package/src/modeller/property-sidebar/styles/styles.ts +577 -0
- package/src/modeller/scene-viewer/scene-handler.ts +39 -0
- package/src/modeller/scene-viewer/scene-layer.ts +41 -0
- package/src/modeller/scene-viewer/scene-property.ts +9 -0
- package/src/modeller/scene-viewer/scene-viewer.ts +249 -0
- package/src/ox-process-list.ts +459 -0
- package/src/ox-process-modeller.ts +396 -0
- package/src/ox-process-viewer.ts +555 -0
- package/src/types.ts +68 -0
- package/stories/index.stories.ts +52 -0
- package/tsconfig.json +23 -0
- package/web-dev-server.config.mjs +30 -0
- package/web-test-runner.config.mjs +29 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@operato/input/ox-input-search.js';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { property, state } from 'lit/decorators.js';
|
|
5
|
+
import Sortable from 'sortablejs';
|
|
6
|
+
export class SceneInspector extends LitElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.searchText = '';
|
|
10
|
+
this.show = false;
|
|
11
|
+
this.sortableConfig = {
|
|
12
|
+
group: 'inspector',
|
|
13
|
+
animation: 150,
|
|
14
|
+
draggable: '.component',
|
|
15
|
+
swapThreshold: 1,
|
|
16
|
+
onSort: this.onSort.bind(this)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
disconnectScene(scene) {
|
|
20
|
+
if (scene) {
|
|
21
|
+
scene.off('selected', undefined, this);
|
|
22
|
+
scene.off('execute', undefined, this);
|
|
23
|
+
scene.off('undo', undefined, this);
|
|
24
|
+
scene.off('redo', undefined, this);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
super.disconnectedCallback();
|
|
29
|
+
this.disconnectScene(this.scene);
|
|
30
|
+
delete this._extendedMap;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return html `
|
|
34
|
+
<ox-input-search
|
|
35
|
+
@change=${(e) => (this.searchText = e.target.value)}
|
|
36
|
+
></ox-input-search>
|
|
37
|
+
|
|
38
|
+
<div result>${!this.scene ? html `` : this.renderComponent(this.scene.root, 0)}</div>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
firstUpdated() {
|
|
42
|
+
dispatchEvent(new Event('resize'));
|
|
43
|
+
this.renderRoot.addEventListener('click', this._onclick.bind(this));
|
|
44
|
+
this.renderRoot.addEventListener('dblclick', this._ondblclick.bind(this));
|
|
45
|
+
}
|
|
46
|
+
refresh() {
|
|
47
|
+
var _a;
|
|
48
|
+
let selected = ((_a = this.scene) === null || _a === void 0 ? void 0 : _a.selected) || [];
|
|
49
|
+
selected.forEach(component => {
|
|
50
|
+
let parent = component.parent;
|
|
51
|
+
while (parent && !this.extendedMap.get(parent)) {
|
|
52
|
+
this.extendedMap.set(parent, true);
|
|
53
|
+
parent = parent.parent;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.requestUpdate();
|
|
57
|
+
}
|
|
58
|
+
updated(change) {
|
|
59
|
+
if (change.has('scene')) {
|
|
60
|
+
let oldScene = change.get('scene');
|
|
61
|
+
if (oldScene) {
|
|
62
|
+
this.disconnectScene(oldScene);
|
|
63
|
+
delete this._extendedMap;
|
|
64
|
+
}
|
|
65
|
+
if (this.scene && this.scene.root) {
|
|
66
|
+
this.scene.on('selected', this.refresh, this);
|
|
67
|
+
this.scene.on('execute', this.refresh, this);
|
|
68
|
+
this.scene.on('undo', this.refresh, this);
|
|
69
|
+
this.scene.on('redo', this.refresh, this);
|
|
70
|
+
this.refresh();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
this.updateComplete.then(() => {
|
|
74
|
+
this.renderRoot.querySelectorAll('[sortable]').forEach(sortable => {
|
|
75
|
+
new Sortable(sortable, this.sortableConfig);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
onSort(e) {
|
|
80
|
+
if (!this.scene)
|
|
81
|
+
return;
|
|
82
|
+
var component = e.item.component;
|
|
83
|
+
var to_container = e.to.component;
|
|
84
|
+
var to_index = e.newIndex - 1;
|
|
85
|
+
this.scene.move(component, to_container, to_index);
|
|
86
|
+
this.show = false;
|
|
87
|
+
this.updateComplete.then(() => {
|
|
88
|
+
this.show = true;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
_onclick(e) {
|
|
92
|
+
e.stopPropagation();
|
|
93
|
+
var targetElement = e.target;
|
|
94
|
+
var classList = targetElement.classList;
|
|
95
|
+
var component;
|
|
96
|
+
while (!component && targetElement) {
|
|
97
|
+
component = targetElement.component;
|
|
98
|
+
if (component)
|
|
99
|
+
break;
|
|
100
|
+
targetElement = targetElement.parentNode;
|
|
101
|
+
if (!targetElement || targetElement === this.renderRoot)
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (component) {
|
|
105
|
+
if (classList.contains('eye')) {
|
|
106
|
+
this.toggleHidden(component);
|
|
107
|
+
}
|
|
108
|
+
else if (classList.contains('extended') || classList.contains('collapsed')) {
|
|
109
|
+
this.toggleExtended(component);
|
|
110
|
+
}
|
|
111
|
+
this.selectComponent(component);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if (classList.contains('inspector')) {
|
|
115
|
+
this.show = !this.show;
|
|
116
|
+
this.style.height = this.show ? '100%' : '';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
this.requestUpdate();
|
|
120
|
+
}
|
|
121
|
+
_ondblclick(e) {
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
var targetElement = e.target;
|
|
124
|
+
var component;
|
|
125
|
+
while (!component && targetElement) {
|
|
126
|
+
component = targetElement.component;
|
|
127
|
+
if (component)
|
|
128
|
+
break;
|
|
129
|
+
targetElement = targetElement.parentNode;
|
|
130
|
+
if (!targetElement || targetElement === this.renderRoot)
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
if (component && component.isContainer()) {
|
|
134
|
+
this.toggleExtended(component);
|
|
135
|
+
}
|
|
136
|
+
this.requestUpdate();
|
|
137
|
+
}
|
|
138
|
+
get extendedMap() {
|
|
139
|
+
if (!this._extendedMap) {
|
|
140
|
+
this._extendedMap = new WeakMap();
|
|
141
|
+
}
|
|
142
|
+
return this._extendedMap;
|
|
143
|
+
}
|
|
144
|
+
getNodeHandleClass(component) {
|
|
145
|
+
if (component.isContainer() && component.components.length > 0) {
|
|
146
|
+
return !!this.extendedMap.get(component) ? 'extended' : 'collapsed';
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return 'collapsespace';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
isExtended(component) {
|
|
153
|
+
return !!this.extendedMap.get(component);
|
|
154
|
+
}
|
|
155
|
+
toggleExtended(component) {
|
|
156
|
+
var extended = this.isExtended(component);
|
|
157
|
+
if (extended) {
|
|
158
|
+
this.extendedMap.delete(component);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
this.extendedMap.set(component, !extended);
|
|
162
|
+
}
|
|
163
|
+
this.requestUpdate();
|
|
164
|
+
}
|
|
165
|
+
toggleHidden(component) {
|
|
166
|
+
component.set('hidden', !component.hidden);
|
|
167
|
+
this.requestUpdate();
|
|
168
|
+
}
|
|
169
|
+
selectComponent(component) {
|
|
170
|
+
this.scene.selected = [component];
|
|
171
|
+
this.requestUpdate();
|
|
172
|
+
}
|
|
173
|
+
shouldBeShown(component) {
|
|
174
|
+
const { type, name, id, tag } = component.state;
|
|
175
|
+
return !!(!this.searchText ||
|
|
176
|
+
`${type} ${name || ''} ${id || ''} ${tag || ''}`.search(this.searchText) > -1 ||
|
|
177
|
+
(component.components || []).find((child) => this.shouldBeShown(child)));
|
|
178
|
+
}
|
|
179
|
+
renderComponent(component, depth) {
|
|
180
|
+
var _a;
|
|
181
|
+
if (!component) {
|
|
182
|
+
return html ``;
|
|
183
|
+
}
|
|
184
|
+
if (!this.shouldBeShown(component)) {
|
|
185
|
+
return html ``;
|
|
186
|
+
}
|
|
187
|
+
const children = (component.isContainer() && component.components) || [];
|
|
188
|
+
const extended = this.isExtended(component) ? children.filter(child => this.shouldBeShown(child)) : [];
|
|
189
|
+
const { type, id, tag, class: clazz } = component.state;
|
|
190
|
+
const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '');
|
|
191
|
+
return html `
|
|
192
|
+
<div
|
|
193
|
+
class="component"
|
|
194
|
+
?selected=${(((_a = this.scene) === null || _a === void 0 ? void 0 : _a.selected) || []).indexOf(component) > -1}
|
|
195
|
+
.component=${component}
|
|
196
|
+
?sortable=${component.isContainer()}
|
|
197
|
+
>
|
|
198
|
+
<span>
|
|
199
|
+
${depth > 0
|
|
200
|
+
? html `
|
|
201
|
+
<mwc-icon class="eye">${component.get('hidden') ? 'visibility_off' : 'visibility'}</mwc-icon>
|
|
202
|
+
<pre>${' '.repeat(depth)}</pre>
|
|
203
|
+
`
|
|
204
|
+
: html ` <pre>${' '.repeat(depth + 2)}</pre> `}
|
|
205
|
+
|
|
206
|
+
<span class=${this.getNodeHandleClass(component)}> </span>
|
|
207
|
+
|
|
208
|
+
<span class="type">${depth == 0 ? 'ROOT' : type}</span> ${name
|
|
209
|
+
? html ` <span class="name">${name}</span> `
|
|
210
|
+
: html ``}
|
|
211
|
+
</span>
|
|
212
|
+
|
|
213
|
+
${extended.map(child => this.renderComponent(child, depth + 1))}
|
|
214
|
+
</div>
|
|
215
|
+
`;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
SceneInspector.styles = [
|
|
219
|
+
css `
|
|
220
|
+
:host {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
|
|
224
|
+
color: var(--scene-inspector-color);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
div[result] {
|
|
228
|
+
flex: 1;
|
|
229
|
+
|
|
230
|
+
display: flex;
|
|
231
|
+
flex-direction: column;
|
|
232
|
+
|
|
233
|
+
overflow-y: auto;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.component {
|
|
237
|
+
display: block;
|
|
238
|
+
overflow: hidden;
|
|
239
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.component[selected] {
|
|
244
|
+
background-color: var(--scene-inspector-selected-background-color);
|
|
245
|
+
border-top: var(--scene-inspector-selected-border);
|
|
246
|
+
border-bottom: var(--scene-inspector-selected-border);
|
|
247
|
+
}
|
|
248
|
+
[selected] .type {
|
|
249
|
+
font-weight: bold;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
span,
|
|
253
|
+
i {
|
|
254
|
+
display: inline-block;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
span.type {
|
|
258
|
+
text-overflow: ellipses;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
span.name {
|
|
262
|
+
background-color: var(--scene-inspector-name-background-color);
|
|
263
|
+
border-radius: var(--border-radius);
|
|
264
|
+
padding: 0 4px;
|
|
265
|
+
color: #fff;
|
|
266
|
+
font-size: 0.8em;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.eye {
|
|
270
|
+
margin: 0 0 0 5px;
|
|
271
|
+
vertical-align: middle;
|
|
272
|
+
opacity: 0.7;
|
|
273
|
+
font-size: 1.1em;
|
|
274
|
+
color: var(--scene-inspector-eye-icon-color);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.collapsed::before,
|
|
278
|
+
.extended::before,
|
|
279
|
+
.collapsespace::before {
|
|
280
|
+
background: var(--url-icon-shell-inspector) no-repeat;
|
|
281
|
+
width: 16px;
|
|
282
|
+
height: 18px;
|
|
283
|
+
display: inline-block;
|
|
284
|
+
content: '';
|
|
285
|
+
opacity: 0.6;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.collapsed::before {
|
|
289
|
+
background-position: 100% -195px;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.extended::before {
|
|
293
|
+
background-position: 100% -295px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.collapsespace::before {
|
|
297
|
+
background-position: 100% -395px;
|
|
298
|
+
opacity: 0.9;
|
|
299
|
+
width: 16px;
|
|
300
|
+
}
|
|
301
|
+
.collapsed,
|
|
302
|
+
.extended,
|
|
303
|
+
.collapsespace {
|
|
304
|
+
border-left: 1px dotted rgba(0, 0, 0, 0.1);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
pre {
|
|
308
|
+
display: inline;
|
|
309
|
+
}
|
|
310
|
+
`
|
|
311
|
+
];
|
|
312
|
+
__decorate([
|
|
313
|
+
property({ type: Object })
|
|
314
|
+
], SceneInspector.prototype, "scene", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
state()
|
|
317
|
+
], SceneInspector.prototype, "searchText", void 0);
|
|
318
|
+
//# sourceMappingURL=inspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspector.js","sourceRoot":"","sources":["../../../../../src/modeller/property-sidebar/inspector/inspector.ts"],"names":[],"mappings":";AAAA,OAAO,mCAAmC,CAAA;AAE1C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkC,MAAM,KAAK,CAAA;AAC3E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,QAAQ,MAAM,YAAY,CAAA;AAIjC,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAkGmB,eAAU,GAAW,EAAE,CAAA;QAGhC,SAAI,GAAY,KAAK,CAAA;QA2E7B,mBAAc,GAAqB;YACjC,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,YAAY;YACvB,aAAa,EAAE,CAAC;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;SAC/B,CAAA;IA0KH,CAAC;IAzPC,eAAe,CAAC,KA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QAEzF,OAAO,IAAI,CAAA;;;oBAGK,CAAC,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,QAAQ,KAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;qBACnD,SAAS;oBACV,SAAS,CAAC,WAAW,EAAE;;;YAG/B,KAAK,GAAG,CAAC;YACT,CAAC,CAAC,IAAI,CAAA;wCACsB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY;uBAC1E,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;eACzB;YACH,CAAC,CAAC,IAAI,CAAA,SAAS,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS;;wBAEjC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;;+BAE3B,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,IAAI;YAC5D,CAAC,CAAC,IAAI,CAAA,uBAAuB,IAAI,UAAU;YAC3C,CAAC,CAAC,IAAI,CAAA,EAAE;;;UAGV,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;;KAElE,CAAA;IACH,CAAC;;AA9VM,qBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2FF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAc;AAEhC;IAAR,KAAK,EAAE;kDAAgC","sourcesContent":["import '@operato/input/ox-input-search.js'\n\nimport { css, html, LitElement, PropertyValues, TemplateResult } from 'lit'\nimport { property, state } from 'lit/decorators.js'\nimport Sortable from 'sortablejs'\n\nimport { Component, Container, Scene } from '@hatiolab/things-scene'\n\nexport class SceneInspector extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n color: var(--scene-inspector-color);\n }\n\n div[result] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n\n overflow-y: auto;\n }\n\n .component {\n display: block;\n overflow: hidden;\n border-bottom: 1px solid rgba(0, 0, 0, 0.05);\n font-size: 14px;\n }\n\n .component[selected] {\n background-color: var(--scene-inspector-selected-background-color);\n border-top: var(--scene-inspector-selected-border);\n border-bottom: var(--scene-inspector-selected-border);\n }\n [selected] .type {\n font-weight: bold;\n }\n\n span,\n i {\n display: inline-block;\n }\n\n span.type {\n text-overflow: ellipses;\n }\n\n span.name {\n background-color: var(--scene-inspector-name-background-color);\n border-radius: var(--border-radius);\n padding: 0 4px;\n color: #fff;\n font-size: 0.8em;\n }\n\n .eye {\n margin: 0 0 0 5px;\n vertical-align: middle;\n opacity: 0.7;\n font-size: 1.1em;\n color: var(--scene-inspector-eye-icon-color);\n }\n\n .collapsed::before,\n .extended::before,\n .collapsespace::before {\n background: var(--url-icon-shell-inspector) no-repeat;\n width: 16px;\n height: 18px;\n display: inline-block;\n content: '';\n opacity: 0.6;\n }\n\n .collapsed::before {\n background-position: 100% -195px;\n }\n\n .extended::before {\n background-position: 100% -295px;\n }\n\n .collapsespace::before {\n background-position: 100% -395px;\n opacity: 0.9;\n width: 16px;\n }\n .collapsed,\n .extended,\n .collapsespace {\n border-left: 1px dotted rgba(0, 0, 0, 0.1);\n }\n\n pre {\n display: inline;\n }\n `\n ]\n\n @property({ type: Object }) scene?: Scene\n\n @state() private searchText: string = ''\n\n private _extendedMap: any\n private show: boolean = false\n\n disconnectScene(scene?: Scene) {\n if (scene) {\n scene.off('selected', undefined, this)\n scene.off('execute', undefined, this)\n scene.off('undo', undefined, this)\n scene.off('redo', undefined, this)\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this.disconnectScene(this.scene)\n delete this._extendedMap\n }\n\n render() {\n return html`\n <ox-input-search\n @change=${(e: Event) => (this.searchText = (e.target as HTMLInputElement).value)}\n ></ox-input-search>\n\n <div result>${!this.scene ? html`` : this.renderComponent(this.scene.root, 0)}</div>\n `\n }\n\n firstUpdated() {\n dispatchEvent(new Event('resize'))\n\n this.renderRoot.addEventListener('click', this._onclick.bind(this) as EventListener)\n this.renderRoot.addEventListener('dblclick', this._ondblclick.bind(this) as EventListener)\n }\n\n refresh() {\n let selected = this.scene?.selected || []\n\n selected.forEach(component => {\n let parent = component.parent\n while (parent && !this.extendedMap.get(parent)) {\n this.extendedMap.set(parent, true)\n parent = parent.parent\n }\n })\n\n this.requestUpdate()\n }\n\n updated(change: PropertyValues<this>) {\n if (change.has('scene')) {\n let oldScene = change.get('scene') as Scene\n\n if (oldScene) {\n this.disconnectScene(oldScene)\n delete this._extendedMap\n }\n\n if (this.scene && this.scene.root) {\n this.scene.on('selected', this.refresh, this)\n this.scene.on('execute', this.refresh, this)\n this.scene.on('undo', this.refresh, this)\n this.scene.on('redo', this.refresh, this)\n\n this.refresh()\n }\n }\n\n this.updateComplete.then(() => {\n this.renderRoot.querySelectorAll('[sortable]').forEach(sortable => {\n new Sortable(sortable as HTMLElement, this.sortableConfig)\n })\n })\n }\n\n sortableConfig: Sortable.Options = {\n group: 'inspector',\n animation: 150,\n draggable: '.component',\n swapThreshold: 1,\n onSort: this.onSort.bind(this)\n }\n\n onSort(e: Sortable.SortableEvent) {\n if (!this.scene) return\n\n var component = (e.item as HTMLElement & { component: Component }).component\n var to_container = (e.to as HTMLElement & { component: Component }).component as Container\n var to_index = e.newIndex! - 1\n\n this.scene.move(component, to_container, to_index)\n\n this.show = false\n this.updateComplete.then(() => {\n this.show = true\n })\n }\n\n _onclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var classList = targetElement.classList\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component) {\n if (classList.contains('eye')) {\n this.toggleHidden(component)\n } else if (classList.contains('extended') || classList.contains('collapsed')) {\n this.toggleExtended(component)\n }\n\n this.selectComponent(component)\n } else {\n if (classList.contains('inspector')) {\n this.show = !this.show\n this.style.height = this.show ? '100%' : ''\n }\n }\n\n this.requestUpdate()\n }\n\n _ondblclick(e: MouseEvent) {\n e.stopPropagation()\n\n var targetElement = e.target as HTMLElement & { component: Component }\n var component\n\n while (!component && targetElement) {\n component = targetElement.component\n\n if (component) break\n\n targetElement = targetElement.parentNode as HTMLElement & { component: Component }\n\n if (!targetElement || targetElement === this.renderRoot) break\n }\n\n if (component && component.isContainer()) {\n this.toggleExtended(component)\n }\n\n this.requestUpdate()\n }\n\n get extendedMap() {\n if (!this._extendedMap) {\n this._extendedMap = new WeakMap()\n }\n\n return this._extendedMap\n }\n\n getNodeHandleClass(component: Component) {\n if (component.isContainer() && (component as Container).components.length > 0) {\n return !!this.extendedMap.get(component) ? 'extended' : 'collapsed'\n } else {\n return 'collapsespace'\n }\n }\n\n isExtended(component: Component) {\n return !!this.extendedMap.get(component)\n }\n\n toggleExtended(component: Component) {\n var extended = this.isExtended(component)\n\n if (extended) {\n this.extendedMap.delete(component)\n } else {\n this.extendedMap.set(component, !extended)\n }\n\n this.requestUpdate()\n }\n\n toggleHidden(component: Component) {\n component.set('hidden', !component.hidden)\n\n this.requestUpdate()\n }\n\n selectComponent(component: Component) {\n this.scene!.selected = [component]\n\n this.requestUpdate()\n }\n\n shouldBeShown(component: Component): boolean {\n const { type, name, id, tag } = component.state\n\n return !!(\n !this.searchText ||\n `${type} ${name || ''} ${id || ''} ${tag || ''}`.search(this.searchText) > -1 ||\n ((component as Container).components || []).find((child: Component) => this.shouldBeShown(child))\n )\n }\n\n renderComponent(component: Component, depth: number): TemplateResult {\n if (!component) {\n return html``\n }\n\n if (!this.shouldBeShown(component)) {\n return html``\n }\n\n const children = (component.isContainer() && (component as Container).components) || []\n const extended = this.isExtended(component) ? children.filter(child => this.shouldBeShown(child)) : []\n const { type, id, tag, class: clazz } = component.state\n\n const name = (id ? `#${id}` : '') + (tag ? `@${tag}` : '') + (clazz ? `.(${clazz})` : '')\n\n return html`\n <div\n class=\"component\"\n ?selected=${(this.scene?.selected || []).indexOf(component) > -1}\n .component=${component}\n ?sortable=${component.isContainer()}\n >\n <span>\n ${depth > 0\n ? html`\n <mwc-icon class=\"eye\">${component.get('hidden') ? 'visibility_off' : 'visibility'}</mwc-icon>\n <pre>${' '.repeat(depth)}</pre>\n `\n : html` <pre>${' '.repeat(depth + 2)}</pre> `}\n\n <span class=${this.getNodeHandleClass(component)}> </span>\n\n <span class=\"type\">${depth == 0 ? 'ROOT' : type}</span> ${name\n ? html` <span class=\"name\">${name}</span> `\n : html``}\n </span>\n\n ${extended.map(child => this.renderComponent(child, depth + 1))}\n </div>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { css } from 'lit';
|
|
5
|
+
export const PropertySharedStyle = css `
|
|
6
|
+
fieldset {
|
|
7
|
+
border: none;
|
|
8
|
+
margin: 4px;
|
|
9
|
+
padding: 9px 4px 9px 4px;
|
|
10
|
+
border-bottom: var(--property-sidebar-fieldset-border);
|
|
11
|
+
color: var(--property-sidebar-fieldset-legend-color);
|
|
12
|
+
font: var(--property-sidebar-fieldset-label);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
fieldset legend {
|
|
16
|
+
padding: 5px 0 0 5px;
|
|
17
|
+
color: var(--property-sidebar-fieldset-legend-color);
|
|
18
|
+
font: var(--property-sidebar-fieldset-legend);
|
|
19
|
+
text-transform: capitalize;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
select,
|
|
23
|
+
input {
|
|
24
|
+
border: var(--property-sidebar-fieldset-border);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
ox-input-data {
|
|
28
|
+
height: 300px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* property grid */
|
|
32
|
+
.property-grid {
|
|
33
|
+
display: grid;
|
|
34
|
+
grid-template-columns: repeat(10, 1fr);
|
|
35
|
+
grid-gap: 5px;
|
|
36
|
+
grid-auto-rows: minmax(24px, auto);
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.property-grid > * {
|
|
41
|
+
width: 100%;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.property-grid > label {
|
|
46
|
+
grid-column: span 3;
|
|
47
|
+
text-align: right;
|
|
48
|
+
text-transform: capitalize;
|
|
49
|
+
line-height: 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.property-grid > input,
|
|
53
|
+
.property-grid > table,
|
|
54
|
+
.property-grid > select,
|
|
55
|
+
.property-grid > ox-input-angle,
|
|
56
|
+
.property-grid > ox-buttons-radio,
|
|
57
|
+
.property-grid > ox-input-color,
|
|
58
|
+
[custom-editor] {
|
|
59
|
+
grid-column: span 7;
|
|
60
|
+
align-self: stretch;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.property-grid > .checkbox-row {
|
|
64
|
+
grid-column: span 10;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.property-grid > .property-full-label {
|
|
68
|
+
grid-column: span 3;
|
|
69
|
+
text-align: right;
|
|
70
|
+
text-transform: capitalize;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.property-grid > .property-half-label {
|
|
74
|
+
grid-column: span 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.property-grid > .property-full-input {
|
|
78
|
+
grid-column: span 7;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.property-grid > .property-half-input {
|
|
82
|
+
grid-column: span 4;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* checkbox-row */
|
|
86
|
+
.checkbox-row {
|
|
87
|
+
display: grid;
|
|
88
|
+
grid-template-columns: repeat(10, 1fr);
|
|
89
|
+
grid-gap: 5px;
|
|
90
|
+
grid-auto-rows: minmax(24px, auto);
|
|
91
|
+
align-items: center;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.checkbox-row > input {
|
|
95
|
+
grid-column: 4 / 5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.checkbox-row > label {
|
|
99
|
+
grid-column: span 6;
|
|
100
|
+
text-align: left;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* image resources */
|
|
104
|
+
.icon-only-label {
|
|
105
|
+
grid-column: span 1;
|
|
106
|
+
|
|
107
|
+
background: var(--url-icon-properties-label) no-repeat;
|
|
108
|
+
float: left;
|
|
109
|
+
margin: 0;
|
|
110
|
+
align-self: stretch;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.icon-only-label.color {
|
|
114
|
+
background-position: 100% -500px;
|
|
115
|
+
}
|
|
116
|
+
.icon-only-label.font-size {
|
|
117
|
+
background-position: 100% -594px;
|
|
118
|
+
}
|
|
119
|
+
.icon-only-label.leading {
|
|
120
|
+
background-position: 100% -696px;
|
|
121
|
+
}
|
|
122
|
+
.icon-only-label.hscale {
|
|
123
|
+
background-position: 100% -296px;
|
|
124
|
+
}
|
|
125
|
+
.icon-only-label.vscale {
|
|
126
|
+
background-position: 100% -396px;
|
|
127
|
+
}
|
|
128
|
+
.icon-only-label.linewidth {
|
|
129
|
+
background-position: 100% -894px;
|
|
130
|
+
}
|
|
131
|
+
.icon-only-label.lineHeight {
|
|
132
|
+
background-position: 100% -995px;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
//# sourceMappingURL=property-shared-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-shared-style.js","sourceRoot":"","sources":["../../../../src/modeller/property-sidebar/property-shared-style.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAEzB,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiIrC,CAAA","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { css } from 'lit'\n\nexport const PropertySharedStyle = css`\n fieldset {\n border: none;\n margin: 4px;\n padding: 9px 4px 9px 4px;\n border-bottom: var(--property-sidebar-fieldset-border);\n color: var(--property-sidebar-fieldset-legend-color);\n font: var(--property-sidebar-fieldset-label);\n }\n\n fieldset legend {\n padding: 5px 0 0 5px;\n color: var(--property-sidebar-fieldset-legend-color);\n font: var(--property-sidebar-fieldset-legend);\n text-transform: capitalize;\n }\n\n select,\n input {\n border: var(--property-sidebar-fieldset-border);\n }\n\n ox-input-data {\n height: 300px;\n }\n\n /* property grid */\n .property-grid {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-gap: 5px;\n grid-auto-rows: minmax(24px, auto);\n align-items: center;\n }\n\n .property-grid > * {\n width: 100%;\n box-sizing: border-box;\n }\n\n .property-grid > label {\n grid-column: span 3;\n text-align: right;\n text-transform: capitalize;\n line-height: 2;\n }\n\n .property-grid > input,\n .property-grid > table,\n .property-grid > select,\n .property-grid > ox-input-angle,\n .property-grid > ox-buttons-radio,\n .property-grid > ox-input-color,\n [custom-editor] {\n grid-column: span 7;\n align-self: stretch;\n }\n\n .property-grid > .checkbox-row {\n grid-column: span 10;\n }\n\n .property-grid > .property-full-label {\n grid-column: span 3;\n text-align: right;\n text-transform: capitalize;\n }\n\n .property-grid > .property-half-label {\n grid-column: span 1;\n }\n\n .property-grid > .property-full-input {\n grid-column: span 7;\n }\n\n .property-grid > .property-half-input {\n grid-column: span 4;\n }\n\n /* checkbox-row */\n .checkbox-row {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n grid-gap: 5px;\n grid-auto-rows: minmax(24px, auto);\n align-items: center;\n }\n\n .checkbox-row > input {\n grid-column: 4 / 5;\n }\n\n .checkbox-row > label {\n grid-column: span 6;\n text-align: left;\n }\n\n /* image resources */\n .icon-only-label {\n grid-column: span 1;\n\n background: var(--url-icon-properties-label) no-repeat;\n float: left;\n margin: 0;\n align-self: stretch;\n }\n\n .icon-only-label.color {\n background-position: 100% -500px;\n }\n .icon-only-label.font-size {\n background-position: 100% -594px;\n }\n .icon-only-label.leading {\n background-position: 100% -696px;\n }\n .icon-only-label.hscale {\n background-position: 100% -296px;\n }\n .icon-only-label.vscale {\n background-position: 100% -396px;\n }\n .icon-only-label.linewidth {\n background-position: 100% -894px;\n }\n .icon-only-label.lineHeight {\n background-position: 100% -995px;\n }\n`\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/mwc-icon';
|
|
5
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
6
|
+
import { BOUNDS, Component, Model, Scene } from '@hatiolab/things-scene';
|
|
7
|
+
import { PropertyShapes } from './shapes/shapes.js';
|
|
8
|
+
import { PropertySpecific } from './specifics/specifics.js';
|
|
9
|
+
import { PropertyStyles } from './styles/styles.js';
|
|
10
|
+
import { SceneInspector } from './inspector/inspector';
|
|
11
|
+
declare const PropertySidebar_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types.js").ScopedElementsHost>;
|
|
12
|
+
export declare class PropertySidebar extends PropertySidebar_base {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
scene: Scene | null;
|
|
15
|
+
bounds: any;
|
|
16
|
+
model: Model | null;
|
|
17
|
+
selected: Component[];
|
|
18
|
+
specificProps: any;
|
|
19
|
+
tabName: string | null;
|
|
20
|
+
collapsed: boolean;
|
|
21
|
+
fonts: any[];
|
|
22
|
+
propertyEditor: any[];
|
|
23
|
+
propertyTarget: Component | null;
|
|
24
|
+
firstUpdated(): void;
|
|
25
|
+
updated(change: PropertyValues<this>): void;
|
|
26
|
+
static get scopedElements(): {
|
|
27
|
+
'process-property-shape': typeof PropertyShapes;
|
|
28
|
+
'process-property-style': typeof PropertyStyles;
|
|
29
|
+
'process-property-specific': typeof PropertySpecific;
|
|
30
|
+
'process-scene-inspector': typeof SceneInspector;
|
|
31
|
+
};
|
|
32
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
33
|
+
_onPropertyChanged(e: CustomEvent): void;
|
|
34
|
+
_onBoundsChanged(e: CustomEvent): void;
|
|
35
|
+
_onChangedByScene(): void;
|
|
36
|
+
_setPropertyTargetAsDefault(): void;
|
|
37
|
+
_onCollapsed(collapsed: boolean): void;
|
|
38
|
+
_onSceneChanged(): Promise<void>;
|
|
39
|
+
_onSelectedChanged(after: Component[]): Promise<void>;
|
|
40
|
+
_setPropertyTarget(newTarget: Component | null): void;
|
|
41
|
+
_setBounds(bounds: BOUNDS): void;
|
|
42
|
+
}
|
|
43
|
+
export {};
|