@operato/board 9.0.0-beta.18 → 9.0.0-beta.20
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 +17 -0
- package/dist/src/ox-board-modeller.js +0 -8
- package/dist/src/ox-board-modeller.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/dist/src/modeller/property-sidebar/abstract-property.d.ts +0 -10
- package/dist/src/modeller/property-sidebar/abstract-property.js +0 -55
- package/dist/src/modeller/property-sidebar/abstract-property.js.map +0 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.d.ts +0 -58
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js +0 -443
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-mapper.js.map +0 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.d.ts +0 -6
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.js +0 -20
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-map.js.map +0 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.d.ts +0 -6
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.js +0 -20
- package/dist/src/modeller/property-sidebar/data-binding/data-binding-value-range.js.map +0 -1
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.d.ts +0 -44
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js +0 -458
- package/dist/src/modeller/property-sidebar/data-binding/data-binding.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.d.ts +0 -4
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js +0 -61
- package/dist/src/modeller/property-sidebar/effects/effects-shared-style.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/effects.d.ts +0 -24
- package/dist/src/modeller/property-sidebar/effects/effects.js +0 -64
- package/dist/src/modeller/property-sidebar/effects/effects.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-animation.d.ts +0 -23
- package/dist/src/modeller/property-sidebar/effects/property-animation.js +0 -138
- package/dist/src/modeller/property-sidebar/effects/property-animation.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-animations.d.ts +0 -22
- package/dist/src/modeller/property-sidebar/effects/property-animations.js +0 -89
- package/dist/src/modeller/property-sidebar/effects/property-animations.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.d.ts +0 -21
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js +0 -182
- package/dist/src/modeller/property-sidebar/effects/property-event-hover.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.d.ts +0 -36
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js +0 -244
- package/dist/src/modeller/property-sidebar/effects/property-event-tap.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-event.d.ts +0 -22
- package/dist/src/modeller/property-sidebar/effects/property-event.js +0 -64
- package/dist/src/modeller/property-sidebar/effects/property-event.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/property-shadow.d.ts +0 -23
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js +0 -103
- package/dist/src/modeller/property-sidebar/effects/property-shadow.js.map +0 -1
- package/dist/src/modeller/property-sidebar/effects/value-converter.d.ts +0 -1
- package/dist/src/modeller/property-sidebar/effects/value-converter.js +0 -21
- package/dist/src/modeller/property-sidebar/effects/value-converter.js.map +0 -1
- package/dist/src/modeller/property-sidebar/inspector/inspector.d.ts +0 -27
- package/dist/src/modeller/property-sidebar/inspector/inspector.js +0 -355
- package/dist/src/modeller/property-sidebar/inspector/inspector.js.map +0 -1
- package/dist/src/modeller/property-sidebar/property-shared-style.d.ts +0 -4
- package/dist/src/modeller/property-sidebar/property-shared-style.js +0 -146
- package/dist/src/modeller/property-sidebar/property-shared-style.js.map +0 -1
- package/dist/src/modeller/property-sidebar/property-sidebar.d.ts +0 -48
- package/dist/src/modeller/property-sidebar/property-sidebar.js +0 -342
- package/dist/src/modeller/property-sidebar/property-sidebar.js.map +0 -1
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.d.ts +0 -1
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js +0 -94
- package/dist/src/modeller/property-sidebar/shapes/box-padding-editor-styles.js.map +0 -1
- package/dist/src/modeller/property-sidebar/shapes/shapes.d.ts +0 -26
- package/dist/src/modeller/property-sidebar/shapes/shapes.js +0 -430
- package/dist/src/modeller/property-sidebar/shapes/shapes.js.map +0 -1
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.d.ts +0 -16
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js +0 -138
- package/dist/src/modeller/property-sidebar/specifics/specific-properties-builder.js.map +0 -1
- package/dist/src/modeller/property-sidebar/specifics/specifics.d.ts +0 -25
- package/dist/src/modeller/property-sidebar/specifics/specifics.js +0 -84
- package/dist/src/modeller/property-sidebar/specifics/specifics.js.map +0 -1
- package/dist/src/modeller/property-sidebar/styles/styles.d.ts +0 -21
- package/dist/src/modeller/property-sidebar/styles/styles.js +0 -562
- package/dist/src/modeller/property-sidebar/styles/styles.js.map +0 -1
- package/dist/stories/property-data-binding.stories.d.ts +0 -20
- package/dist/stories/property-data-binding.stories.js +0 -19
- package/dist/stories/property-data-binding.stories.js.map +0 -1
@@ -1,146 +0,0 @@
|
|
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, var(--md-sys-color-on-secondary-container));
|
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, var(--md-sys-color-on-secondary-container));
|
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(24, 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 8;
|
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 16;
|
60
|
-
align-self: stretch;
|
61
|
-
}
|
62
|
-
|
63
|
-
.property-grid > .checkbox-row {
|
64
|
-
grid-column: 1 / -1;
|
65
|
-
}
|
66
|
-
|
67
|
-
.property-grid > .property-full-label {
|
68
|
-
grid-column: span 8;
|
69
|
-
text-align: right;
|
70
|
-
text-transform: capitalize;
|
71
|
-
}
|
72
|
-
|
73
|
-
.property-grid > .property-full-input {
|
74
|
-
grid-column: span 16;
|
75
|
-
}
|
76
|
-
|
77
|
-
.property-grid > .property-half-label {
|
78
|
-
grid-column: span 3;
|
79
|
-
}
|
80
|
-
|
81
|
-
.property-grid > .property-half-input {
|
82
|
-
grid-column: span 9;
|
83
|
-
}
|
84
|
-
|
85
|
-
.property-grid > .property-onethird-label {
|
86
|
-
grid-column: span 3;
|
87
|
-
}
|
88
|
-
|
89
|
-
.property-grid > .property-onethird-input {
|
90
|
-
grid-column: span 5;
|
91
|
-
}
|
92
|
-
|
93
|
-
/* checkbox-row */
|
94
|
-
.checkbox-row {
|
95
|
-
display: grid;
|
96
|
-
grid-template-columns: repeat(24, 1fr);
|
97
|
-
grid-gap: 5px;
|
98
|
-
grid-auto-rows: minmax(24px, auto);
|
99
|
-
align-items: center;
|
100
|
-
}
|
101
|
-
|
102
|
-
.checkbox-row > input {
|
103
|
-
grid-column: 9 / 12;
|
104
|
-
}
|
105
|
-
|
106
|
-
.checkbox-row > label {
|
107
|
-
grid-column: 12 / -1;
|
108
|
-
text-align: left;
|
109
|
-
}
|
110
|
-
|
111
|
-
/* image resources */
|
112
|
-
.icon-only-label {
|
113
|
-
grid-column: span 3;
|
114
|
-
|
115
|
-
background: var(--url-icon-properties-label) no-repeat;
|
116
|
-
float: left;
|
117
|
-
margin: 0;
|
118
|
-
align-self: stretch;
|
119
|
-
}
|
120
|
-
|
121
|
-
.icon-only-label.color {
|
122
|
-
background-position: 100% -500px;
|
123
|
-
}
|
124
|
-
.icon-only-label.font-size {
|
125
|
-
background-position: 100% -594px;
|
126
|
-
}
|
127
|
-
.icon-only-label.leading {
|
128
|
-
background-position: 100% -696px;
|
129
|
-
}
|
130
|
-
.icon-only-label.hscale {
|
131
|
-
background-position: 100% -296px;
|
132
|
-
}
|
133
|
-
.icon-only-label.vscale {
|
134
|
-
background-position: 100% -396px;
|
135
|
-
}
|
136
|
-
.icon-only-label.linewidth {
|
137
|
-
background-position: 100% -894px;
|
138
|
-
}
|
139
|
-
.icon-only-label.lineHeight {
|
140
|
-
background-position: 100% -995px;
|
141
|
-
}
|
142
|
-
.icon-only-label.letterSpacing {
|
143
|
-
background-position: 100% -1595px;
|
144
|
-
}
|
145
|
-
`;
|
146
|
-
//# sourceMappingURL=property-shared-style.js.map
|
@@ -1 +0,0 @@
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4IrC,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, var(--md-sys-color-on-secondary-container));\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, var(--md-sys-color-on-secondary-container));\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(24, 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 8;\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 16;\n align-self: stretch;\n }\n\n .property-grid > .checkbox-row {\n grid-column: 1 / -1;\n }\n\n .property-grid > .property-full-label {\n grid-column: span 8;\n text-align: right;\n text-transform: capitalize;\n }\n\n .property-grid > .property-full-input {\n grid-column: span 16;\n }\n\n .property-grid > .property-half-label {\n grid-column: span 3;\n }\n\n .property-grid > .property-half-input {\n grid-column: span 9;\n }\n\n .property-grid > .property-onethird-label {\n grid-column: span 3;\n }\n\n .property-grid > .property-onethird-input {\n grid-column: span 5;\n }\n\n /* checkbox-row */\n .checkbox-row {\n display: grid;\n grid-template-columns: repeat(24, 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: 9 / 12;\n }\n\n .checkbox-row > label {\n grid-column: 12 / -1;\n text-align: left;\n }\n\n /* image resources */\n .icon-only-label {\n grid-column: span 3;\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 .icon-only-label.letterSpacing {\n background-position: 100% -1595px;\n }\n`\n"]}
|
@@ -1,48 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
|
-
*/
|
4
|
-
import '@material/web/icon/icon.js';
|
5
|
-
import { LitElement, PropertyValues } from 'lit';
|
6
|
-
import { Component, Model, Scene } from '@hatiolab/things-scene';
|
7
|
-
import { PropertyEffects } from '@operato/property-panel/effects.js';
|
8
|
-
import { SceneInspector } from '@operato/property-panel/inspector.js';
|
9
|
-
import { PropertyShapes } from '@operato/property-panel/shapes.js';
|
10
|
-
import { PropertySpecific } from '@operato/property-panel/specifics.js';
|
11
|
-
import { PropertyStyles } from '@operato/property-panel/styles.js';
|
12
|
-
import { PropertyDataBinding } from '@operato/property-panel/data-binding.js';
|
13
|
-
declare const PropertySidebar_base: typeof LitElement & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types.js").ScopedElementsHost>;
|
14
|
-
export declare class PropertySidebar extends PropertySidebar_base {
|
15
|
-
static styles: import("lit").CSSResult[];
|
16
|
-
scene: Scene | null;
|
17
|
-
bounds: any;
|
18
|
-
model: Model | null;
|
19
|
-
selected: Component[];
|
20
|
-
specificProps: any;
|
21
|
-
tabName: string | null;
|
22
|
-
collapsed: boolean;
|
23
|
-
fonts: any[];
|
24
|
-
propertyEditor: any[];
|
25
|
-
propertyTarget: Component | null;
|
26
|
-
firstUpdated(): void;
|
27
|
-
updated(change: PropertyValues<this>): void;
|
28
|
-
static get scopedElements(): {
|
29
|
-
'property-shape': typeof PropertyShapes;
|
30
|
-
'property-style': typeof PropertyStyles;
|
31
|
-
'property-effect': typeof PropertyEffects;
|
32
|
-
'property-specific': typeof PropertySpecific;
|
33
|
-
'property-data-binding': typeof PropertyDataBinding;
|
34
|
-
'scene-inspector': typeof SceneInspector;
|
35
|
-
};
|
36
|
-
render(): import("lit-html").TemplateResult<1>;
|
37
|
-
private onPropertyChanged;
|
38
|
-
private onBoundsChanged;
|
39
|
-
private onChangedByScene;
|
40
|
-
private setPropertyTargetAsDefault;
|
41
|
-
private onCollapsed;
|
42
|
-
private onSceneChanged;
|
43
|
-
private onSelectedChanged;
|
44
|
-
private setPropertyTarget;
|
45
|
-
private setBounds;
|
46
|
-
private isLine;
|
47
|
-
}
|
48
|
-
export {};
|
@@ -1,342 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright © HatioLab Inc. All rights reserved.
|
3
|
-
*/
|
4
|
-
import { __decorate } from "tslib";
|
5
|
-
import '@material/web/icon/icon.js';
|
6
|
-
import { css, html, LitElement } from 'lit';
|
7
|
-
import { property } from 'lit/decorators.js';
|
8
|
-
import deepClone from 'lodash-es/cloneDeep.js';
|
9
|
-
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
10
|
-
import { ScrollbarStyles } from '@operato/styles';
|
11
|
-
import { PropertyEffects } from '@operato/property-panel/effects.js';
|
12
|
-
import { SceneInspector } from '@operato/property-panel/inspector.js';
|
13
|
-
import { PropertyShapes } from '@operato/property-panel/shapes.js';
|
14
|
-
import { PropertySpecific } from '@operato/property-panel/specifics.js';
|
15
|
-
import { PropertyStyles } from '@operato/property-panel/styles.js';
|
16
|
-
import { PropertyDataBinding } from '@operato/property-panel/data-binding.js';
|
17
|
-
export class PropertySidebar extends ScopedElementsMixin(LitElement) {
|
18
|
-
constructor() {
|
19
|
-
super(...arguments);
|
20
|
-
this.scene = null;
|
21
|
-
this.bounds = {};
|
22
|
-
this.model = {};
|
23
|
-
this.selected = [];
|
24
|
-
this.tabName = 'shape';
|
25
|
-
this.collapsed = false;
|
26
|
-
this.fonts = [];
|
27
|
-
this.propertyEditor = [];
|
28
|
-
this.propertyTarget = null;
|
29
|
-
}
|
30
|
-
firstUpdated() {
|
31
|
-
this.renderRoot.addEventListener('property-change', this.onPropertyChanged.bind(this));
|
32
|
-
this.renderRoot.addEventListener('bounds-change', this.onBoundsChanged.bind(this));
|
33
|
-
}
|
34
|
-
updated(change) {
|
35
|
-
change.has('scene') && this.onSceneChanged();
|
36
|
-
change.has('selected') && this.onSelectedChanged(this.selected);
|
37
|
-
change.has('collapsed') && this.onCollapsed(this.collapsed);
|
38
|
-
}
|
39
|
-
static get scopedElements() {
|
40
|
-
return {
|
41
|
-
'property-shape': PropertyShapes,
|
42
|
-
'property-style': PropertyStyles,
|
43
|
-
'property-effect': PropertyEffects,
|
44
|
-
'property-specific': PropertySpecific,
|
45
|
-
'property-data-binding': PropertyDataBinding,
|
46
|
-
'scene-inspector': SceneInspector
|
47
|
-
};
|
48
|
-
}
|
49
|
-
render() {
|
50
|
-
var tabName = this.tabName ? this.tabName : 'shape';
|
51
|
-
return html `
|
52
|
-
<div
|
53
|
-
tab
|
54
|
-
@click=${(e) => {
|
55
|
-
this.tabName = e.target.getAttribute('name');
|
56
|
-
}}
|
57
|
-
>
|
58
|
-
<md-icon name="shape" ?selected=${tabName == 'shape'}>format_shapes</md-icon>
|
59
|
-
<md-icon name="style" ?selected=${tabName == 'style'}>palette</md-icon>
|
60
|
-
<md-icon name="effect" ?selected=${tabName == 'effect'}>movie_filter</md-icon>
|
61
|
-
<md-icon name="specific" ?selected=${tabName == 'specific'}>tune</md-icon>
|
62
|
-
<md-icon name="data-binding" ?selected=${tabName == 'data-binding'}>share</md-icon>
|
63
|
-
<md-icon name="inspector" ?selected=${tabName == 'inspector'}>visibility</md-icon>
|
64
|
-
</div>
|
65
|
-
|
66
|
-
<div content>
|
67
|
-
${html `
|
68
|
-
${{
|
69
|
-
shape: html `
|
70
|
-
<property-shape
|
71
|
-
.value=${this.model}
|
72
|
-
.bounds=${this.bounds}
|
73
|
-
.selected=${this.selected}
|
74
|
-
?active=${tabName == 'shape'}
|
75
|
-
?is-line=${this.isLine(this.selected)}
|
76
|
-
>
|
77
|
-
</property-shape>
|
78
|
-
`,
|
79
|
-
style: html `
|
80
|
-
<property-style
|
81
|
-
.value=${this.model}
|
82
|
-
.selected=${this.selected}
|
83
|
-
.fonts=${this.fonts}
|
84
|
-
?active=${tabName == 'style'}
|
85
|
-
>
|
86
|
-
</property-style>
|
87
|
-
`,
|
88
|
-
effect: html `
|
89
|
-
<property-effect .value=${this.model} .scene=${this.scene} ?active=${tabName == 'effect'}>
|
90
|
-
</property-effect>
|
91
|
-
`,
|
92
|
-
specific: html `
|
93
|
-
<property-specific
|
94
|
-
.value=${this.model}
|
95
|
-
.scene=${this.scene}
|
96
|
-
.selected=${this.selected}
|
97
|
-
.props=${this.specificProps}
|
98
|
-
.propertyEditor=${this.propertyEditor}
|
99
|
-
?active=${tabName == 'specific'}
|
100
|
-
>
|
101
|
-
</property-specific>
|
102
|
-
`,
|
103
|
-
'data-binding': html `
|
104
|
-
<property-data-binding .scene=${this.scene} .value=${this.model} ?active=${tabName == 'data-binding'}>
|
105
|
-
</property-data-binding>
|
106
|
-
`,
|
107
|
-
inspector: html `
|
108
|
-
<scene-inspector .scene=${this.scene} ?active=${tabName == 'inspector'}></scene-inspector>
|
109
|
-
`
|
110
|
-
}[this.tabName]}
|
111
|
-
`}
|
112
|
-
</div>
|
113
|
-
`;
|
114
|
-
}
|
115
|
-
onPropertyChanged(e) {
|
116
|
-
var detail = e.detail;
|
117
|
-
if (this.propertyTarget) {
|
118
|
-
/* 단일 컴포넌트의 경우에 적용 */
|
119
|
-
this.scene && this.scene.undoableChange(() => this.propertyTarget.set(detail));
|
120
|
-
}
|
121
|
-
else {
|
122
|
-
/* 여러 컴포넌트의 경우에 적용 */
|
123
|
-
this.scene && this.scene.undoableChange(() => this.selected.forEach(component => component.set(detail)));
|
124
|
-
}
|
125
|
-
}
|
126
|
-
onBoundsChanged(e) {
|
127
|
-
var detail = e.detail;
|
128
|
-
if (!this.scene) {
|
129
|
-
return;
|
130
|
-
}
|
131
|
-
if (this.propertyTarget) {
|
132
|
-
/* 단일 컴포넌트의 경우에 적용 */
|
133
|
-
this.scene.undoableChange(() => {
|
134
|
-
this.propertyTarget.bounds = {
|
135
|
-
...this.propertyTarget.bounds,
|
136
|
-
...detail
|
137
|
-
};
|
138
|
-
});
|
139
|
-
}
|
140
|
-
else {
|
141
|
-
/* 여러 컴포넌트의 경우에 적용 */
|
142
|
-
this.scene.undoableChange(() => {
|
143
|
-
this.selected.forEach(component => {
|
144
|
-
component.bounds = {
|
145
|
-
...component.bounds,
|
146
|
-
...detail
|
147
|
-
};
|
148
|
-
});
|
149
|
-
});
|
150
|
-
}
|
151
|
-
}
|
152
|
-
onChangedByScene() {
|
153
|
-
if (this.propertyTarget) {
|
154
|
-
this.model = {
|
155
|
-
...this.propertyTarget.model
|
156
|
-
};
|
157
|
-
this.setBounds(this.propertyTarget.bounds);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
setPropertyTargetAsDefault() {
|
161
|
-
if (!this.scene) {
|
162
|
-
this.setPropertyTarget(null);
|
163
|
-
this.specificProps = [];
|
164
|
-
this.model = null;
|
165
|
-
this.bounds = {};
|
166
|
-
}
|
167
|
-
else {
|
168
|
-
this.scene.select('model-layer');
|
169
|
-
}
|
170
|
-
}
|
171
|
-
onCollapsed(collapsed) {
|
172
|
-
!collapsed && (this.style.display = '');
|
173
|
-
this.animate(collapsed
|
174
|
-
? [
|
175
|
-
{ transform: 'translateX(0)', opacity: 1, easing: 'ease-in' },
|
176
|
-
{ transform: 'translateX(100%)', opacity: 1 }
|
177
|
-
]
|
178
|
-
: [
|
179
|
-
{ transform: 'translateX(100%)', opacity: 1 },
|
180
|
-
{ transform: 'translateX(0)', opacity: 1, easing: 'ease-out' }
|
181
|
-
], {
|
182
|
-
duration: 500
|
183
|
-
}).onfinish = () => {
|
184
|
-
collapsed && (this.style.display = 'none');
|
185
|
-
dispatchEvent(new Event('resize'));
|
186
|
-
};
|
187
|
-
}
|
188
|
-
async onSceneChanged() {
|
189
|
-
await this.updateComplete;
|
190
|
-
if (this.scene)
|
191
|
-
this.selected = this.scene.select('model-layer');
|
192
|
-
}
|
193
|
-
async onSelectedChanged(after) {
|
194
|
-
await this.updateComplete;
|
195
|
-
if (after.length == 1) {
|
196
|
-
this.setPropertyTarget(after[0]);
|
197
|
-
// 컴포넌트 특성 속성(specific properties)을 먼저 바꾸고, 모델을 바꾸어준다.
|
198
|
-
// 컴포넌트 속성에 따라 UI 컴포넌트가 준비되고, 이후에 모델값을 보여주도록 하기 위해서이다.
|
199
|
-
this.specificProps = deepClone(this.propertyTarget.nature.properties);
|
200
|
-
this.model = {
|
201
|
-
...this.propertyTarget.model
|
202
|
-
};
|
203
|
-
this.setBounds(this.propertyTarget.bounds);
|
204
|
-
}
|
205
|
-
else if (after.length == 0) {
|
206
|
-
// 선택이 안된 경우
|
207
|
-
this.setPropertyTargetAsDefault();
|
208
|
-
}
|
209
|
-
else {
|
210
|
-
// 다중 선택된 경우
|
211
|
-
var type = after[0].model.type;
|
212
|
-
for (let i = 1; i < after.length; i++) {
|
213
|
-
if (after[i].model.type != type) {
|
214
|
-
type = undefined;
|
215
|
-
break;
|
216
|
-
}
|
217
|
-
}
|
218
|
-
this.setPropertyTarget(null);
|
219
|
-
if (type)
|
220
|
-
this.specificProps = deepClone(after[0].nature.properties);
|
221
|
-
else
|
222
|
-
this.specificProps = null;
|
223
|
-
this.model = {
|
224
|
-
type: type,
|
225
|
-
alpha: 1
|
226
|
-
};
|
227
|
-
this.bounds = {};
|
228
|
-
}
|
229
|
-
}
|
230
|
-
setPropertyTarget(newTarget) {
|
231
|
-
var oldTarget = this.propertyTarget;
|
232
|
-
if (oldTarget) {
|
233
|
-
oldTarget.off('change', this.onChangedByScene, this);
|
234
|
-
}
|
235
|
-
if (newTarget) {
|
236
|
-
newTarget.on('change', this.onChangedByScene, this);
|
237
|
-
}
|
238
|
-
this.propertyTarget = newTarget;
|
239
|
-
}
|
240
|
-
setBounds(bounds) {
|
241
|
-
this.bounds = {
|
242
|
-
left: bounds.left,
|
243
|
-
top: bounds.top,
|
244
|
-
width: Math.round(bounds.width),
|
245
|
-
height: Math.round(bounds.height)
|
246
|
-
};
|
247
|
-
}
|
248
|
-
isLine(selected) {
|
249
|
-
var isLine = false;
|
250
|
-
for (var i = 0; i < selected.length; i++) {
|
251
|
-
var comp = selected[i];
|
252
|
-
if (!comp.isLine || !comp.isLine()) {
|
253
|
-
isLine = false;
|
254
|
-
return isLine;
|
255
|
-
}
|
256
|
-
isLine = true;
|
257
|
-
}
|
258
|
-
return isLine;
|
259
|
-
}
|
260
|
-
}
|
261
|
-
PropertySidebar.styles = [
|
262
|
-
ScrollbarStyles,
|
263
|
-
css `
|
264
|
-
:host {
|
265
|
-
border-left: 1px solid var(--md-sys-color-border, #ccc);
|
266
|
-
width: 270px;
|
267
|
-
display: flex;
|
268
|
-
flex-direction: column;
|
269
|
-
background-color: var(--property-sidebar-background-color, var(--md-sys-color-secondary-container));
|
270
|
-
color: var(--property-sidebar-color, var(--md-sys-color-on-secondary-container));
|
271
|
-
user-select: none;
|
272
|
-
|
273
|
-
--input-padding: var(--spacing-small);
|
274
|
-
--label-font: var(--property-sidebar-fieldset-label, roboto);
|
275
|
-
}
|
276
|
-
|
277
|
-
[tab] {
|
278
|
-
display: flex;
|
279
|
-
background-color: rgba(0, 0, 0, 0.08);
|
280
|
-
opacity: 0.85;
|
281
|
-
}
|
282
|
-
|
283
|
-
[tab] md-icon {
|
284
|
-
flex: 1;
|
285
|
-
|
286
|
-
display: flex;
|
287
|
-
align-items: center;
|
288
|
-
justify-content: center;
|
289
|
-
|
290
|
-
color: var(--property-sidebar-tab-icon-color);
|
291
|
-
height: 40px;
|
292
|
-
}
|
293
|
-
|
294
|
-
[tab] [selected] {
|
295
|
-
background-color: var(--property-sidebar-background-color, var(--md-sys-color-secondary-container));
|
296
|
-
border-left: 1px solid rgba(255, 255, 255, 0.5);
|
297
|
-
border-right: 1px solid rgba(0, 0, 0, 0.15);
|
298
|
-
opacity: 1;
|
299
|
-
}
|
300
|
-
|
301
|
-
[content] {
|
302
|
-
flex: 1;
|
303
|
-
|
304
|
-
overflow: hidden;
|
305
|
-
overflow-y: auto;
|
306
|
-
|
307
|
-
--md-icon-size: 22px;
|
308
|
-
}
|
309
|
-
|
310
|
-
[content] > :not([active]) {
|
311
|
-
display: none;
|
312
|
-
}
|
313
|
-
`
|
314
|
-
];
|
315
|
-
__decorate([
|
316
|
-
property({ type: Object })
|
317
|
-
], PropertySidebar.prototype, "scene", void 0);
|
318
|
-
__decorate([
|
319
|
-
property({ type: Object })
|
320
|
-
], PropertySidebar.prototype, "bounds", void 0);
|
321
|
-
__decorate([
|
322
|
-
property({ type: Object })
|
323
|
-
], PropertySidebar.prototype, "model", void 0);
|
324
|
-
__decorate([
|
325
|
-
property({ type: Array })
|
326
|
-
], PropertySidebar.prototype, "selected", void 0);
|
327
|
-
__decorate([
|
328
|
-
property({ type: Array })
|
329
|
-
], PropertySidebar.prototype, "specificProps", void 0);
|
330
|
-
__decorate([
|
331
|
-
property({ type: String })
|
332
|
-
], PropertySidebar.prototype, "tabName", void 0);
|
333
|
-
__decorate([
|
334
|
-
property({ type: Boolean })
|
335
|
-
], PropertySidebar.prototype, "collapsed", void 0);
|
336
|
-
__decorate([
|
337
|
-
property({ type: Array })
|
338
|
-
], PropertySidebar.prototype, "fonts", void 0);
|
339
|
-
__decorate([
|
340
|
-
property({ type: Array })
|
341
|
-
], PropertySidebar.prototype, "propertyEditor", void 0);
|
342
|
-
//# sourceMappingURL=property-sidebar.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"property-sidebar.js","sourceRoot":"","sources":["../../../../src/modeller/property-sidebar/property-sidebar.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AAEnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAiB,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAG9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAE7E,MAAM,OAAO,eAA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AAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACzC,IAAI,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;YAEtB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBACnC,MAAM,GAAG,KAAK,CAAA;gBACd,OAAO,MAAM,CAAA;YACf,CAAC;YAED,MAAM,GAAG,IAAI,CAAA;QACf,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;;AAlUM,sBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkDF;CACF,AArDY,CAqDZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAA2B;AAC1B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;+CAAiB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAyB;AACzB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;iDAA2B;AAC1B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;sDAAmB;AACjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAiC;AAC/B;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;kDAA2B;AAC5B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;8CAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;uDAA2B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/web/icon/icon.js'\n\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport deepClone from 'lodash-es/cloneDeep.js'\n\nimport { BOUNDS, Component, Model, Scene } from '@hatiolab/things-scene'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { ScrollbarStyles } from '@operato/styles'\n\nimport { PropertyEffects } from '@operato/property-panel/effects.js'\nimport { SceneInspector } from '@operato/property-panel/inspector.js'\nimport { PropertyShapes } from '@operato/property-panel/shapes.js'\nimport { PropertySpecific } from '@operato/property-panel/specifics.js'\nimport { PropertyStyles } from '@operato/property-panel/styles.js'\nimport { PropertyDataBinding } from '@operato/property-panel/data-binding.js'\n\nexport class PropertySidebar extends ScopedElementsMixin(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n border-left: 1px solid var(--md-sys-color-border, #ccc);\n width: 270px;\n display: flex;\n flex-direction: column;\n background-color: var(--property-sidebar-background-color, var(--md-sys-color-secondary-container));\n color: var(--property-sidebar-color, var(--md-sys-color-on-secondary-container));\n user-select: none;\n\n --input-padding: var(--spacing-small);\n --label-font: var(--property-sidebar-fieldset-label, roboto);\n }\n\n [tab] {\n display: flex;\n background-color: rgba(0, 0, 0, 0.08);\n opacity: 0.85;\n }\n\n [tab] md-icon {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--property-sidebar-tab-icon-color);\n height: 40px;\n }\n\n [tab] [selected] {\n background-color: var(--property-sidebar-background-color, var(--md-sys-color-secondary-container));\n border-left: 1px solid rgba(255, 255, 255, 0.5);\n border-right: 1px solid rgba(0, 0, 0, 0.15);\n opacity: 1;\n }\n\n [content] {\n flex: 1;\n\n overflow: hidden;\n overflow-y: auto;\n\n --md-icon-size: 22px;\n }\n\n [content] > :not([active]) {\n display: none;\n }\n `\n ]\n\n @property({ type: Object }) scene: Scene | null = null\n @property({ type: Object }) bounds: any = {}\n @property({ type: Object }) model: Model | null = {}\n @property({ type: Array }) selected: Component[] = []\n @property({ type: Array }) specificProps: any\n @property({ type: String }) tabName: string | null = 'shape'\n @property({ type: Boolean }) collapsed: boolean = false\n @property({ type: Array }) fonts: any[] = []\n @property({ type: Array }) propertyEditor: any[] = []\n\n propertyTarget: Component | null = null\n\n firstUpdated() {\n this.renderRoot.addEventListener('property-change', this.onPropertyChanged.bind(this) as EventListener)\n this.renderRoot.addEventListener('bounds-change', this.onBoundsChanged.bind(this) as EventListener)\n }\n\n updated(change: PropertyValues<this>) {\n change.has('scene') && this.onSceneChanged()\n change.has('selected') && this.onSelectedChanged(this.selected)\n change.has('collapsed') && this.onCollapsed(this.collapsed)\n }\n\n static get scopedElements() {\n return {\n 'property-shape': PropertyShapes,\n 'property-style': PropertyStyles,\n 'property-effect': PropertyEffects,\n 'property-specific': PropertySpecific,\n 'property-data-binding': PropertyDataBinding,\n 'scene-inspector': SceneInspector\n }\n }\n\n render() {\n var tabName = this.tabName ? this.tabName : 'shape'\n\n return html`\n <div\n tab\n @click=${(e: MouseEvent) => {\n this.tabName = (e.target as HTMLElement).getAttribute('name')\n }}\n >\n <md-icon name=\"shape\" ?selected=${tabName == 'shape'}>format_shapes</md-icon>\n <md-icon name=\"style\" ?selected=${tabName == 'style'}>palette</md-icon>\n <md-icon name=\"effect\" ?selected=${tabName == 'effect'}>movie_filter</md-icon>\n <md-icon name=\"specific\" ?selected=${tabName == 'specific'}>tune</md-icon>\n <md-icon name=\"data-binding\" ?selected=${tabName == 'data-binding'}>share</md-icon>\n <md-icon name=\"inspector\" ?selected=${tabName == 'inspector'}>visibility</md-icon>\n </div>\n\n <div content>\n ${html`\n ${{\n shape: html`\n <property-shape\n .value=${this.model}\n .bounds=${this.bounds}\n .selected=${this.selected}\n ?active=${tabName == 'shape'}\n ?is-line=${this.isLine(this.selected)}\n >\n </property-shape>\n `,\n style: html`\n <property-style\n .value=${this.model}\n .selected=${this.selected}\n .fonts=${this.fonts}\n ?active=${tabName == 'style'}\n >\n </property-style>\n `,\n effect: html`\n <property-effect .value=${this.model} .scene=${this.scene} ?active=${tabName == 'effect'}>\n </property-effect>\n `,\n specific: html`\n <property-specific\n .value=${this.model}\n .scene=${this.scene}\n .selected=${this.selected}\n .props=${this.specificProps}\n .propertyEditor=${this.propertyEditor}\n ?active=${tabName == 'specific'}\n >\n </property-specific>\n `,\n 'data-binding': html`\n <property-data-binding .scene=${this.scene} .value=${this.model} ?active=${tabName == 'data-binding'}>\n </property-data-binding>\n `,\n inspector: html`\n <scene-inspector .scene=${this.scene} ?active=${tabName == 'inspector'}></scene-inspector>\n `\n }[this.tabName!]}\n `}\n </div>\n `\n }\n\n private onPropertyChanged(e: CustomEvent) {\n var detail = e.detail\n\n if (this.propertyTarget) {\n /* 단일 컴포넌트의 경우에 적용 */\n this.scene && this.scene.undoableChange(() => this.propertyTarget!.set(detail))\n } else {\n /* 여러 컴포넌트의 경우에 적용 */\n this.scene && this.scene.undoableChange(() => this.selected.forEach(component => component.set(detail)))\n }\n }\n\n private onBoundsChanged(e: CustomEvent) {\n var detail = e.detail\n\n if (!this.scene) {\n return\n }\n\n if (this.propertyTarget) {\n /* 단일 컴포넌트의 경우에 적용 */\n this.scene.undoableChange(() => {\n this.propertyTarget!.bounds = {\n ...this.propertyTarget!.bounds,\n ...detail\n }\n })\n } else {\n /* 여러 컴포넌트의 경우에 적용 */\n this.scene.undoableChange(() => {\n this.selected.forEach(component => {\n component.bounds = {\n ...component.bounds,\n ...detail\n }\n })\n })\n }\n }\n\n private onChangedByScene() {\n if (this.propertyTarget) {\n this.model = {\n ...this.propertyTarget.model\n }\n this.setBounds(this.propertyTarget.bounds)\n }\n }\n\n private setPropertyTargetAsDefault() {\n if (!this.scene) {\n this.setPropertyTarget(null)\n this.specificProps = []\n this.model = null\n this.bounds = {}\n } else {\n this.scene.select('model-layer')\n }\n }\n\n private onCollapsed(collapsed: boolean) {\n !collapsed && (this.style.display = '')\n\n this.animate(\n collapsed\n ? [\n { transform: 'translateX(0)', opacity: 1, easing: 'ease-in' },\n { transform: 'translateX(100%)', opacity: 1 }\n ]\n : [\n { transform: 'translateX(100%)', opacity: 1 },\n { transform: 'translateX(0)', opacity: 1, easing: 'ease-out' }\n ],\n {\n duration: 500\n }\n ).onfinish = () => {\n collapsed && (this.style.display = 'none')\n dispatchEvent(new Event('resize'))\n }\n }\n\n private async onSceneChanged() {\n await this.updateComplete\n\n if (this.scene) this.selected = this.scene.select('model-layer')\n }\n\n private async onSelectedChanged(after: Component[]) {\n await this.updateComplete\n\n if (after.length == 1) {\n this.setPropertyTarget(after[0])\n // 컴포넌트 특성 속성(specific properties)을 먼저 바꾸고, 모델을 바꾸어준다.\n // 컴포넌트 속성에 따라 UI 컴포넌트가 준비되고, 이후에 모델값을 보여주도록 하기 위해서이다.\n this.specificProps = deepClone(this.propertyTarget!.nature.properties)\n this.model = {\n ...this.propertyTarget!.model\n }\n this.setBounds(this.propertyTarget!.bounds)\n } else if (after.length == 0) {\n // 선택이 안된 경우\n\n this.setPropertyTargetAsDefault()\n } else {\n // 다중 선택된 경우\n\n var type = after[0].model.type\n for (let i = 1; i < after.length; i++) {\n if (after[i].model.type != type) {\n type = undefined\n break\n }\n }\n\n this.setPropertyTarget(null)\n\n if (type) this.specificProps = deepClone(after[0].nature.properties)\n else this.specificProps = null\n\n this.model = {\n type: type,\n alpha: 1\n }\n this.bounds = {}\n }\n }\n\n private setPropertyTarget(newTarget: Component | null) {\n var oldTarget = this.propertyTarget\n\n if (oldTarget) {\n oldTarget.off('change', this.onChangedByScene, this)\n }\n if (newTarget) {\n newTarget.on('change', this.onChangedByScene, this)\n }\n\n this.propertyTarget = newTarget\n }\n\n private setBounds(bounds: BOUNDS) {\n this.bounds = {\n left: bounds.left,\n top: bounds.top,\n width: Math.round(bounds.width),\n height: Math.round(bounds.height)\n }\n }\n\n private isLine(selected: Component[]) {\n var isLine = false\n\n for (var i = 0; i < selected.length; i++) {\n var comp = selected[i]\n\n if (!comp.isLine || !comp.isLine()) {\n isLine = false\n return isLine\n }\n\n isLine = true\n }\n\n return isLine\n }\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const BoxPaddingEditorStyles: import("lit").CSSResult;
|
@@ -1,94 +0,0 @@
|
|
1
|
-
import { css } from 'lit';
|
2
|
-
export const BoxPaddingEditorStyles = css `
|
3
|
-
.box-padding {
|
4
|
-
width: 100%;
|
5
|
-
}
|
6
|
-
|
7
|
-
.box-padding td {
|
8
|
-
background: var(--url-icon-properties-padding) 50% 0 no-repeat;
|
9
|
-
}
|
10
|
-
|
11
|
-
.box-padding tr:nth-child(1),
|
12
|
-
.box-padding tr:nth-child(3) {
|
13
|
-
height: 20px;
|
14
|
-
}
|
15
|
-
|
16
|
-
.box-padding tr td:nth-child(1),
|
17
|
-
.box-padding tr td:nth-child(3) {
|
18
|
-
width: 18px;
|
19
|
-
}
|
20
|
-
|
21
|
-
.box-padding .slide1 {
|
22
|
-
background-position: 0 0;
|
23
|
-
}
|
24
|
-
|
25
|
-
.box-padding .slide2 {
|
26
|
-
background-position: 50% -40px;
|
27
|
-
background-color: rgba(69, 46, 41, 0.2);
|
28
|
-
}
|
29
|
-
|
30
|
-
.box-padding .slide3 {
|
31
|
-
background-position: 100% -440px;
|
32
|
-
}
|
33
|
-
|
34
|
-
.box-padding .slide4 {
|
35
|
-
background-position: 0 -360px;
|
36
|
-
background-color: rgba(69, 46, 41, 0.2);
|
37
|
-
}
|
38
|
-
|
39
|
-
.box-padding .slide5 {
|
40
|
-
background: none;
|
41
|
-
text-align: center;
|
42
|
-
}
|
43
|
-
|
44
|
-
.box-padding .slide6 {
|
45
|
-
background-position: 100% -160px;
|
46
|
-
background-color: rgba(69, 46, 41, 0.2);
|
47
|
-
}
|
48
|
-
|
49
|
-
.box-padding .slide7 {
|
50
|
-
background-position: 0 100%;
|
51
|
-
}
|
52
|
-
|
53
|
-
.box-padding .slide8 {
|
54
|
-
background-position: 50% -320px;
|
55
|
-
background-color: rgba(69, 46, 41, 0.2);
|
56
|
-
}
|
57
|
-
|
58
|
-
.box-padding .slide9 {
|
59
|
-
background-position: 0 0px;
|
60
|
-
}
|
61
|
-
|
62
|
-
.box-padding input {
|
63
|
-
background-color: transparent;
|
64
|
-
width: 35px;
|
65
|
-
margin: 0px;
|
66
|
-
padding: 0px;
|
67
|
-
clear: both;
|
68
|
-
float: initial;
|
69
|
-
border: 1px solid #fff;
|
70
|
-
border-width: 0 0 1px 0;
|
71
|
-
text-align: right;
|
72
|
-
font-size: 14px;
|
73
|
-
}
|
74
|
-
|
75
|
-
.slide5 input:nth-child(1),
|
76
|
-
.slide5 input:nth-child(4) {
|
77
|
-
display: block;
|
78
|
-
margin: auto;
|
79
|
-
}
|
80
|
-
|
81
|
-
.slide5 input:nth-child(2) {
|
82
|
-
float: left;
|
83
|
-
}
|
84
|
-
|
85
|
-
.slide5 input:nth-child(3) {
|
86
|
-
float: right;
|
87
|
-
margin-top: -25px;
|
88
|
-
}
|
89
|
-
|
90
|
-
.slide5 input:nth-child(4) {
|
91
|
-
margin-top: -5px;
|
92
|
-
}
|
93
|
-
`;
|
94
|
-
//# sourceMappingURL=box-padding-editor-styles.js.map
|