@operato/board 10.29.107 → 10.29.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/board-model-source.d.ts +1 -0
- package/dist/src/board-model-source.js +29 -0
- package/dist/src/board-provider.d.ts +1 -0
- package/dist/src/board-provider.js +4 -23
- package/dist/src/component/facility.js +24 -1
- package/dist/src/graphql/data-channels.d.ts +4 -0
- package/dist/src/graphql/data-channels.js +30 -0
- package/dist/src/graphql/data-subscription.d.ts +1 -1
- package/dist/src/graphql/data-subscription.js +3 -22
- package/dist/src/ox-board-modeller.d.ts +2 -0
- package/dist/src/ox-board-modeller.js +2 -0
- package/dist/src/ox-property-editor-aisle.d.ts +25 -0
- package/dist/src/ox-property-editor-aisle.js +195 -0
- package/dist/src/ox-property-editor-space.d.ts +32 -0
- package/dist/src/ox-property-editor-space.js +384 -0
- package/package.json +4 -4
- package/translations/en.json +35 -1
- package/translations/ko.json +35 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { registerBoardModelSource } from '@hatiolab/things-scene';
|
|
3
|
+
import { client, gqlContext } from '@operato/graphql';
|
|
4
|
+
/*
|
|
5
|
+
* How a space reference (ADR-0254) reads the board it places: the published version, model and number. A board nobody
|
|
6
|
+
* published answers null and the reference says so; the draft is not shown in its place. Read from the server each time a
|
|
7
|
+
* viewer opens, so a newly published version is what the next viewer shows.
|
|
8
|
+
*/
|
|
9
|
+
registerBoardModelSource(async (boardId) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const response = await client.query({
|
|
12
|
+
query: gql `
|
|
13
|
+
query BoardPublishedModel($id: String!) {
|
|
14
|
+
boardPublished(id: $id) {
|
|
15
|
+
version
|
|
16
|
+
model
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`,
|
|
20
|
+
variables: { id: boardId },
|
|
21
|
+
context: gqlContext(),
|
|
22
|
+
fetchPolicy: 'network-only'
|
|
23
|
+
});
|
|
24
|
+
const published = (_a = response.data) === null || _a === void 0 ? void 0 : _a.boardPublished;
|
|
25
|
+
if (!(published === null || published === void 0 ? void 0 : published.model))
|
|
26
|
+
return null;
|
|
27
|
+
return { model: JSON.parse(published.model), version: (_b = published.version) !== null && _b !== void 0 ? _b : undefined };
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=board-model-source.js.map
|
|
@@ -3,7 +3,9 @@ import { error, ReferenceMap } from '@hatiolab/things-scene';
|
|
|
3
3
|
import { createResolvedScene } from './resolved-scene.js';
|
|
4
4
|
import { BoardDataStorage } from './data-storage/data-storage.js';
|
|
5
5
|
import { BoardModelCache } from './data-storage/board-model-cache.js';
|
|
6
|
-
import { client, gqlContext
|
|
6
|
+
import { client, gqlContext } from '@operato/graphql';
|
|
7
|
+
import './board-model-source.js';
|
|
8
|
+
import { subscribeComponent } from './graphql/data-channels.js';
|
|
7
9
|
export function createBoardProvider() {
|
|
8
10
|
const _provider = new ReferenceMap(async (boardId, resolve, reject) => {
|
|
9
11
|
var _a;
|
|
@@ -54,28 +56,7 @@ export function createBoardProvider() {
|
|
|
54
56
|
dataStorage: new BoardDataStorage(boardId),
|
|
55
57
|
loading: { startTime },
|
|
56
58
|
dataSubscriptionProvider: {
|
|
57
|
-
subscribe: async (tag, component) =>
|
|
58
|
-
return await subscribe({
|
|
59
|
-
query: gql `
|
|
60
|
-
subscription {
|
|
61
|
-
data(tag: "${tag}") {
|
|
62
|
-
tag
|
|
63
|
-
data
|
|
64
|
-
ts
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`
|
|
68
|
-
}, {
|
|
69
|
-
next: async ({ data }) => {
|
|
70
|
-
var _a, _b, _c;
|
|
71
|
-
if (data) {
|
|
72
|
-
const payload = data.data;
|
|
73
|
-
(_c = (_b = (_a = component.app) === null || _a === void 0 ? void 0 : _a.lagTracker) === null || _b === void 0 ? void 0 : _b.record) === null || _c === void 0 ? void 0 : _c.call(_b, payload.tag, payload.ts);
|
|
74
|
-
component.data = payload.data;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
},
|
|
59
|
+
subscribe: async (tag, component) => subscribeComponent(tag, component),
|
|
79
60
|
dispose() { }
|
|
80
61
|
}
|
|
81
62
|
}));
|
|
@@ -26,10 +26,33 @@ const icon = `
|
|
|
26
26
|
</g>
|
|
27
27
|
</svg>
|
|
28
28
|
`;
|
|
29
|
+
/*
|
|
30
|
+
A space of the site (ADR-0254): a rectangle drawn to the size its space board will be made at, 10 × 8 m and 4 m high on
|
|
31
|
+
a board of 1 cm a unit. Its board is made from its properties (「새 공간 보드 만들기」) or picked.
|
|
32
|
+
*/
|
|
33
|
+
const spaceIcon = 'data:image/svg+xml;utf8,' +
|
|
34
|
+
encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g fill="none" stroke="#3d8bfd" stroke-width="1.6" stroke-linejoin="round"><polygon points="4,11 15,6 26,11 15,16"/><polyline points="4,11 4,21 15,26 26,21 26,11"/><line x1="15" y1="16" x2="15" y2="26"/></g></svg>`);
|
|
35
|
+
const aisleIcon = 'data:image/svg+xml;utf8,' +
|
|
36
|
+
encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><g fill="none" stroke="#f5a524" stroke-width="1.6"><rect x="11" y="3" width="8" height="24"/><line x1="15" y1="5" x2="15" y2="25" stroke-dasharray="2.5 2"/></g></svg>`);
|
|
29
37
|
export const facility = {
|
|
30
38
|
name: 'facility',
|
|
31
39
|
description: 'floors, walls, mezzanines, and atmospheric backdrops — the built environment that holds everything else',
|
|
32
40
|
icon,
|
|
33
|
-
templates: [
|
|
41
|
+
templates: [
|
|
42
|
+
{
|
|
43
|
+
type: 'space-ref',
|
|
44
|
+
description: 'space -- a space board placed in the site',
|
|
45
|
+
group: 'facility',
|
|
46
|
+
icon: spaceIcon,
|
|
47
|
+
model: { type: 'space-ref', left: 100, top: 100, width: 1000, height: 800, depth: 400 }
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
type: 'aisle',
|
|
51
|
+
description: 'shared aisle -- spaces tie their edges to its sides',
|
|
52
|
+
group: 'facility',
|
|
53
|
+
icon: aisleIcon,
|
|
54
|
+
model: { type: 'aisle', left: 100, top: 100, width: 300, height: 1500, fillStyle: '#3C4045', markColor: '#e2b507', markWidth: 10 }
|
|
55
|
+
}
|
|
56
|
+
]
|
|
34
57
|
};
|
|
35
58
|
//# sourceMappingURL=facility.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SharedDataChannels } from '@hatiolab/things-scene';
|
|
2
|
+
export declare const dataChannels: SharedDataChannels;
|
|
3
|
+
/** Shows a tag's data on a component: its data, and the delivery delay recorded on the scene. */
|
|
4
|
+
export declare function subscribeComponent(tag: string, component: any): import("@hatiolab/things-scene").DataHandle;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
2
|
+
import { SharedDataChannels } from '@hatiolab/things-scene';
|
|
3
|
+
import { subscribe } from '@operato/graphql';
|
|
4
|
+
/*
|
|
5
|
+
* Every board scene of the page -- viewers, popups, the boards a site composes -- shares one `data(tag)` subscription
|
|
6
|
+
* per tag (ADR-0254 4): the first to show a tag opens it, the last to stop showing it closes it.
|
|
7
|
+
*/
|
|
8
|
+
export const dataChannels = new SharedDataChannels(async (tag, next) => subscribe({
|
|
9
|
+
query: gql `
|
|
10
|
+
subscription ($tag: String!) {
|
|
11
|
+
data(tag: $tag) {
|
|
12
|
+
tag
|
|
13
|
+
data
|
|
14
|
+
ts
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
`,
|
|
18
|
+
variables: { tag }
|
|
19
|
+
}, {
|
|
20
|
+
next: ({ data }) => data && next(data.data)
|
|
21
|
+
}));
|
|
22
|
+
/** Shows a tag's data on a component: its data, and the delivery delay recorded on the scene. */
|
|
23
|
+
export function subscribeComponent(tag, component) {
|
|
24
|
+
return dataChannels.subscribe(tag, (payload) => {
|
|
25
|
+
var _a, _b, _c;
|
|
26
|
+
(_c = (_b = (_a = component.app) === null || _a === void 0 ? void 0 : _a.lagTracker) === null || _b === void 0 ? void 0 : _b.record) === null || _c === void 0 ? void 0 : _c.call(_b, payload.tag, payload.ts);
|
|
27
|
+
component.data = payload.data;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=data-channels.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, DataSubscriptionProvider } from '@hatiolab/things-scene';
|
|
2
2
|
export declare class DataSubscriptionProviderImpl implements DataSubscriptionProvider {
|
|
3
|
-
subscribe(tag: string, component: Component): Promise<import("
|
|
3
|
+
subscribe(tag: string, component: Component): Promise<import("@hatiolab/things-scene").DataHandle>;
|
|
4
4
|
dispose(): void;
|
|
5
5
|
}
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { subscribeComponent } from './data-channels.js';
|
|
2
|
+
/* A tag a component shows is joined to the page's one subscription for it (data-channels.ts). */
|
|
3
3
|
export class DataSubscriptionProviderImpl {
|
|
4
4
|
async subscribe(tag, component) {
|
|
5
|
-
return
|
|
6
|
-
query: gql `
|
|
7
|
-
subscription {
|
|
8
|
-
data(tag: "${tag}") {
|
|
9
|
-
tag
|
|
10
|
-
data
|
|
11
|
-
ts
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
`
|
|
15
|
-
}, {
|
|
16
|
-
next: async ({ data }) => {
|
|
17
|
-
var _a, _b, _c;
|
|
18
|
-
if (data) {
|
|
19
|
-
const payload = data.data;
|
|
20
|
-
(_c = (_b = (_a = component.app) === null || _a === void 0 ? void 0 : _a.lagTracker) === null || _b === void 0 ? void 0 : _b.record) === null || _c === void 0 ? void 0 : _c.call(_b, payload.tag, payload.ts);
|
|
21
|
-
component.data = payload.data;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
5
|
+
return subscribeComponent(tag, component);
|
|
25
6
|
}
|
|
26
7
|
dispose() { }
|
|
27
8
|
}
|
|
@@ -9,6 +9,8 @@ import './ox-board-viewer.js';
|
|
|
9
9
|
import '@operato/input/ox-input-code.js';
|
|
10
10
|
import { LitElement, PropertyValues } from 'lit';
|
|
11
11
|
import { LoadTracker, Scene, SceneMode } from '@hatiolab/things-scene';
|
|
12
|
+
import './ox-property-editor-space.js';
|
|
13
|
+
import './ox-property-editor-aisle.js';
|
|
12
14
|
import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar.js';
|
|
13
15
|
import { EditToolbar } from './modeller/edit-toolbar.js';
|
|
14
16
|
import { SelectionToolbar } from './modeller/selection-toolbar.js';
|
|
@@ -16,6 +16,8 @@ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
|
|
|
16
16
|
import { OxPopup } from '@operato/popup';
|
|
17
17
|
import { openPopup } from '@operato/layout';
|
|
18
18
|
import { i18next } from '@operato/i18n';
|
|
19
|
+
import './ox-property-editor-space.js';
|
|
20
|
+
import './ox-property-editor-aisle.js';
|
|
19
21
|
import { isMacOS, togglefullscreen } from '@operato/utils';
|
|
20
22
|
import { ComponentToolbar } from './modeller/component-toolbar/component-toolbar.js';
|
|
21
23
|
import { EditToolbar } from './modeller/edit-toolbar.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/web/button/filled-tonal-button.js';
|
|
5
|
+
import '@material/web/button/outlined-button.js';
|
|
6
|
+
import { TemplateResult } from 'lit';
|
|
7
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
|
8
|
+
export declare class OxPropertyEditorAisle extends OxPropertyEditor {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
private aisle;
|
|
11
|
+
private plan?;
|
|
12
|
+
private planned;
|
|
13
|
+
firstUpdated(changes: Map<string, unknown>): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private readAisle;
|
|
16
|
+
private shown;
|
|
17
|
+
private units;
|
|
18
|
+
private clearPreview;
|
|
19
|
+
private planWidth;
|
|
20
|
+
private apply;
|
|
21
|
+
private shownMm;
|
|
22
|
+
private outsideBySpace;
|
|
23
|
+
private nameOf;
|
|
24
|
+
editorTemplate(value: any, spec: PropertySpec): TemplateResult;
|
|
25
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@material/web/button/filled-tonal-button.js';
|
|
6
|
+
import '@material/web/button/outlined-button.js';
|
|
7
|
+
import { css, html, nothing } from 'lit';
|
|
8
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
9
|
+
import { aisleRectOf, aisleWidthOf, displayToMm, drawingScaleFor, mmToDisplay, planAisleWidth } from '@hatiolab/things-scene';
|
|
10
|
+
import { i18next } from '@operato/i18n';
|
|
11
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
12
|
+
/*
|
|
13
|
+
* An aisle's width (ADR-0254 3, stage 5). A new width is planned before it is applied: the spaces tied to the aisle and
|
|
14
|
+
* how their boundaries move are listed and drawn -- the new boundary in orange, the one now dashed --, and a space that
|
|
15
|
+
* would be narrower than its least width holds the change back; components the new boundaries would leave outside are
|
|
16
|
+
* listed for each space and boxed. Picking a space's line selects it. Applied, the aisle keeps its centre line and the tied
|
|
17
|
+
* boundaries follow in the same change.
|
|
18
|
+
*/
|
|
19
|
+
let OxPropertyEditorAisle = class OxPropertyEditorAisle extends OxPropertyEditor {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.planned = '';
|
|
23
|
+
}
|
|
24
|
+
firstUpdated(changes) {
|
|
25
|
+
var _a;
|
|
26
|
+
(_a = super.firstUpdated) === null || _a === void 0 ? void 0 : _a.call(this, changes);
|
|
27
|
+
this.readAisle();
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
super.disconnectedCallback();
|
|
31
|
+
this.clearPreview();
|
|
32
|
+
}
|
|
33
|
+
readAisle() {
|
|
34
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
35
|
+
bubbles: true,
|
|
36
|
+
composed: true,
|
|
37
|
+
detail: { callback: (selected) => (this.aisle = selected === null || selected === void 0 ? void 0 : selected[0]) }
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
shown(units) {
|
|
41
|
+
const scale = drawingScaleFor(this.aisle);
|
|
42
|
+
return String(Math.round(mmToDisplay(units * scale.mmPerUnit, scale) * 100) / 100);
|
|
43
|
+
}
|
|
44
|
+
units(shown) {
|
|
45
|
+
const scale = drawingScaleFor(this.aisle);
|
|
46
|
+
return displayToMm(Number(shown) || 0, scale) / scale.mmPerUnit;
|
|
47
|
+
}
|
|
48
|
+
clearPreview() {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
for (const change of (_b = (_a = this.plan) === null || _a === void 0 ? void 0 : _a.changes) !== null && _b !== void 0 ? _b : [])
|
|
51
|
+
change.space.previewBoundary = undefined;
|
|
52
|
+
this.plan = undefined;
|
|
53
|
+
this.planned = '';
|
|
54
|
+
}
|
|
55
|
+
/* What the width typed would do, drawn and listed; nothing changes yet */
|
|
56
|
+
planWidth(shown) {
|
|
57
|
+
this.clearPreview();
|
|
58
|
+
const width = this.units(shown);
|
|
59
|
+
if (!this.aisle || !(width > 0) || Math.abs(width - aisleWidthOf(this.aisle)) < 1e-6)
|
|
60
|
+
return;
|
|
61
|
+
this.planned = shown;
|
|
62
|
+
this.plan = planAisleWidth(this.aisle.parent, this.aisle, width);
|
|
63
|
+
for (const change of this.plan.changes)
|
|
64
|
+
change.space.previewBoundary = change.after;
|
|
65
|
+
}
|
|
66
|
+
/* The aisle at its new width, in one change: its tied boundaries follow it (Aisle.onchange) */
|
|
67
|
+
apply() {
|
|
68
|
+
const plan = this.plan;
|
|
69
|
+
if (!plan || plan.violations.length)
|
|
70
|
+
return;
|
|
71
|
+
const { left, top, width, height } = plan.aisle;
|
|
72
|
+
this.clearPreview();
|
|
73
|
+
this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: { left, top, width, height } }));
|
|
74
|
+
setTimeout(() => this.requestUpdate(), 0);
|
|
75
|
+
}
|
|
76
|
+
/* mm in the drawing's unit */
|
|
77
|
+
shownMm(mm) {
|
|
78
|
+
const scale = drawingScaleFor(this.aisle);
|
|
79
|
+
return String(Math.round(mmToDisplay(mm, scale) * 100) / 100);
|
|
80
|
+
}
|
|
81
|
+
/* The components a plan would leave outside, a line for each space */
|
|
82
|
+
outsideBySpace(plan) {
|
|
83
|
+
var _a;
|
|
84
|
+
const by = new Map();
|
|
85
|
+
for (const o of plan.outside)
|
|
86
|
+
by.set(o.space, [...((_a = by.get(o.space)) !== null && _a !== void 0 ? _a : []), o]);
|
|
87
|
+
return [...by];
|
|
88
|
+
}
|
|
89
|
+
nameOf(space) {
|
|
90
|
+
return space.state.id || space.state.ref || '';
|
|
91
|
+
}
|
|
92
|
+
editorTemplate(value, spec) {
|
|
93
|
+
const aisle = this.aisle;
|
|
94
|
+
const unit = aisle ? drawingScaleFor(aisle).displayUnit : '';
|
|
95
|
+
const width = aisle ? this.shown(aisleWidthOf(aisle)) : '';
|
|
96
|
+
const plan = this.plan;
|
|
97
|
+
const narrow = (n) => this.shown(n);
|
|
98
|
+
/* a space's width across the aisle: left to right beside an aisle that runs up and down */
|
|
99
|
+
const vertical = aisle ? aisleRectOf(aisle).vertical : true;
|
|
100
|
+
const across = (r) => (vertical ? r.width : r.height);
|
|
101
|
+
return html `
|
|
102
|
+
<div fullwidth class="aisle">
|
|
103
|
+
<label>${i18next.t('label.aisle width')}</label>
|
|
104
|
+
<input
|
|
105
|
+
type="number"
|
|
106
|
+
step="0.1"
|
|
107
|
+
min="0"
|
|
108
|
+
.value=${this.planned || width}
|
|
109
|
+
@change=${(e) => {
|
|
110
|
+
e.stopPropagation();
|
|
111
|
+
this.planWidth(e.target.value);
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
<span>${unit}</span>
|
|
115
|
+
<div class="muted">${i18next.t('text.aisle keeps its centre line')}</div>
|
|
116
|
+
${plan
|
|
117
|
+
? html `
|
|
118
|
+
${plan.changes.length
|
|
119
|
+
? plan.changes.map(c => html `<div class="wide">
|
|
120
|
+
${i18next.t('text.aisle moves a space', { space: this.nameOf(c.space), before: `${narrow(across(c.before))} ${unit}`, after: `${narrow(across(c.after))} ${unit}` })}
|
|
121
|
+
</div>`)
|
|
122
|
+
: html `<div class="muted">${i18next.t('text.aisle moves no space')}</div>`}
|
|
123
|
+
${plan.violations.map(v => html `<button class="issue" @click=${() => (v.space.root.selected = [v.space])}>
|
|
124
|
+
${i18next.t('text.aisle narrows a space', { space: this.nameOf(v.space), width: `${narrow(v.width)} ${unit}`, min: `${narrow(v.minWidth)} ${unit}` })}
|
|
125
|
+
</button>`)}
|
|
126
|
+
${this.outsideBySpace(plan).map(([space, items]) => html `<button class="issue" @click=${() => (space.root.selected = [space])}>
|
|
127
|
+
${i18next.t('text.aisle leaves components outside', {
|
|
128
|
+
space: this.nameOf(space),
|
|
129
|
+
count: items.length,
|
|
130
|
+
items: items.map(o => `${o.component.state.id || o.component.state.type} ${this.shownMm(o.by)} ${unit}`).join(', ')
|
|
131
|
+
})}
|
|
132
|
+
</button>`)}
|
|
133
|
+
<div class="buttons">
|
|
134
|
+
<md-filled-tonal-button ?disabled=${plan.violations.length > 0} @click=${() => this.apply()}>${i18next.t('button.apply')}</md-filled-tonal-button>
|
|
135
|
+
<md-outlined-button @click=${() => this.clearPreview()}>${i18next.t('button.cancel')}</md-outlined-button>
|
|
136
|
+
</div>
|
|
137
|
+
`
|
|
138
|
+
: nothing}
|
|
139
|
+
</div>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
OxPropertyEditorAisle.styles = [
|
|
144
|
+
...OxPropertyEditor.styles,
|
|
145
|
+
css `
|
|
146
|
+
:host > div.aisle {
|
|
147
|
+
display: grid;
|
|
148
|
+
grid-template-columns: auto 1fr auto;
|
|
149
|
+
align-items: center;
|
|
150
|
+
gap: 4px 8px;
|
|
151
|
+
font: var(--label-font);
|
|
152
|
+
}
|
|
153
|
+
.aisle input {
|
|
154
|
+
width: 100%;
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
}
|
|
157
|
+
.aisle .wide {
|
|
158
|
+
grid-column: 1 / -1;
|
|
159
|
+
}
|
|
160
|
+
.aisle .muted {
|
|
161
|
+
grid-column: 1 / -1;
|
|
162
|
+
opacity: 0.7;
|
|
163
|
+
}
|
|
164
|
+
.aisle .issue {
|
|
165
|
+
grid-column: 1 / -1;
|
|
166
|
+
text-align: left;
|
|
167
|
+
color: var(--md-sys-color-error, #b3261e);
|
|
168
|
+
background: none;
|
|
169
|
+
border: none;
|
|
170
|
+
padding: 2px 0;
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
font: inherit;
|
|
173
|
+
}
|
|
174
|
+
.aisle .buttons {
|
|
175
|
+
grid-column: 1 / -1;
|
|
176
|
+
display: flex;
|
|
177
|
+
gap: 8px;
|
|
178
|
+
}
|
|
179
|
+
`
|
|
180
|
+
];
|
|
181
|
+
__decorate([
|
|
182
|
+
state()
|
|
183
|
+
], OxPropertyEditorAisle.prototype, "aisle", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
state()
|
|
186
|
+
], OxPropertyEditorAisle.prototype, "plan", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
state()
|
|
189
|
+
], OxPropertyEditorAisle.prototype, "planned", void 0);
|
|
190
|
+
OxPropertyEditorAisle = __decorate([
|
|
191
|
+
customElement('ox-property-editor-aisle')
|
|
192
|
+
], OxPropertyEditorAisle);
|
|
193
|
+
export { OxPropertyEditorAisle };
|
|
194
|
+
OxPropertyEditor.register({ aisle: 'ox-property-editor-aisle' });
|
|
195
|
+
//# sourceMappingURL=ox-property-editor-aisle.js.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/web/button/filled-tonal-button.js';
|
|
5
|
+
import './ox-editor-board-selector.js';
|
|
6
|
+
import { TemplateResult } from 'lit';
|
|
7
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
|
8
|
+
export declare class OxPropertyEditorSpace extends OxPropertyEditor {
|
|
9
|
+
static styles: import("lit").CSSResult[];
|
|
10
|
+
private space;
|
|
11
|
+
private busy;
|
|
12
|
+
private failure;
|
|
13
|
+
private names;
|
|
14
|
+
private nameOf;
|
|
15
|
+
private watched;
|
|
16
|
+
private onSpaceChange;
|
|
17
|
+
disconnectedCallback(): void;
|
|
18
|
+
private watch;
|
|
19
|
+
firstUpdated(changes: Map<string, unknown>): void;
|
|
20
|
+
updated(changes: Map<string, unknown>): void;
|
|
21
|
+
private readSpace;
|
|
22
|
+
private setOwn;
|
|
23
|
+
private toShown;
|
|
24
|
+
private toUnits;
|
|
25
|
+
private createBoard;
|
|
26
|
+
private freeName;
|
|
27
|
+
private statusOf;
|
|
28
|
+
private issuesTemplate;
|
|
29
|
+
private tieRefused;
|
|
30
|
+
private tiesTemplate;
|
|
31
|
+
editorTemplate(value: any, spec: PropertySpec): TemplateResult;
|
|
32
|
+
}
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@material/web/button/filled-tonal-button.js';
|
|
6
|
+
import './ox-editor-board-selector.js';
|
|
7
|
+
import gql from 'graphql-tag';
|
|
8
|
+
import { css, html, nothing } from 'lit';
|
|
9
|
+
import { customElement, state } from 'lit/decorators.js';
|
|
10
|
+
import { displayToMm, drawingScaleFor, EDGES, mmToDisplay, spaceIssuesOf, wouldCycle } from '@hatiolab/things-scene';
|
|
11
|
+
import { client, gqlContext } from '@operato/graphql';
|
|
12
|
+
import { i18next } from '@operato/i18n';
|
|
13
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
14
|
+
/*
|
|
15
|
+
* The space of a space reference (ADR-0254 3), in the modeller: the board it places -- picked, or made new at the size the
|
|
16
|
+
* space is drawn --, its floor and its height in the drawing's unit, and what is wrong with it: overlaps with the spaces
|
|
17
|
+
* beside it (picked, that space is selected) and components of its board standing out of it (fixed in that board).
|
|
18
|
+
*
|
|
19
|
+
* The value of this editor is the board (`ref`). The floor (`zPos`) and the height (`depth`) are the component's own
|
|
20
|
+
* properties: they are sent as property changes of their own, never as this editor's value.
|
|
21
|
+
*/
|
|
22
|
+
/* What a new space board takes from the site it is made for: its scale, its unit and its look */
|
|
23
|
+
const SITE_KEYS = ['mmPerUnit', 'displayUnit', 'threed', 'sceneLook', 'sceneLookId', 'placement'];
|
|
24
|
+
let OxPropertyEditorSpace = class OxPropertyEditorSpace extends OxPropertyEditor {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.busy = false;
|
|
28
|
+
this.failure = '';
|
|
29
|
+
/* the names of the boards other spaces place, read once each: a space is named by its id, else by its board */
|
|
30
|
+
this.names = new Map();
|
|
31
|
+
this.onSpaceChange = () => this.requestUpdate();
|
|
32
|
+
this.tieRefused = '';
|
|
33
|
+
}
|
|
34
|
+
nameOf(space) {
|
|
35
|
+
const { id, ref } = space.state;
|
|
36
|
+
if (id)
|
|
37
|
+
return id;
|
|
38
|
+
if (!ref)
|
|
39
|
+
return '';
|
|
40
|
+
if (!this.names.has(ref)) {
|
|
41
|
+
this.names.set(ref, '');
|
|
42
|
+
client
|
|
43
|
+
.query({ query: gql `query ($id: String!) { board(id: $id) { name } }`, variables: { id: ref }, context: gqlContext() })
|
|
44
|
+
.then(r => {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
this.names.set(ref, (_c = (_b = (_a = r.data) === null || _a === void 0 ? void 0 : _a.board) === null || _b === void 0 ? void 0 : _b.name) !== null && _c !== void 0 ? _c : '');
|
|
47
|
+
this.requestUpdate();
|
|
48
|
+
})
|
|
49
|
+
.catch(() => { });
|
|
50
|
+
}
|
|
51
|
+
return this.names.get(ref) || '';
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
super.disconnectedCallback();
|
|
55
|
+
this.watch(undefined);
|
|
56
|
+
}
|
|
57
|
+
watch(space) {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f;
|
|
59
|
+
if (this.watched === space)
|
|
60
|
+
return;
|
|
61
|
+
(_b = (_a = this.watched) === null || _a === void 0 ? void 0 : _a.off) === null || _b === void 0 ? void 0 : _b.call(_a, 'change', this.onSpaceChange);
|
|
62
|
+
(_d = (_c = this.watched) === null || _c === void 0 ? void 0 : _c.off) === null || _d === void 0 ? void 0 : _d.call(_c, 'space-status', this.onSpaceChange);
|
|
63
|
+
this.watched = space;
|
|
64
|
+
(_e = space === null || space === void 0 ? void 0 : space.on) === null || _e === void 0 ? void 0 : _e.call(space, 'change', this.onSpaceChange);
|
|
65
|
+
(_f = space === null || space === void 0 ? void 0 : space.on) === null || _f === void 0 ? void 0 : _f.call(space, 'space-status', this.onSpaceChange);
|
|
66
|
+
}
|
|
67
|
+
firstUpdated(changes) {
|
|
68
|
+
var _a;
|
|
69
|
+
(_a = super.firstUpdated) === null || _a === void 0 ? void 0 : _a.call(this, changes);
|
|
70
|
+
this.readSpace();
|
|
71
|
+
}
|
|
72
|
+
updated(changes) {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = super.updated) === null || _a === void 0 ? void 0 : _a.call(this, changes);
|
|
75
|
+
if (changes.has('value'))
|
|
76
|
+
this.readSpace();
|
|
77
|
+
}
|
|
78
|
+
/* The space selected: asked of the panel, which holds the selection */
|
|
79
|
+
readSpace() {
|
|
80
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
81
|
+
bubbles: true,
|
|
82
|
+
composed: true,
|
|
83
|
+
detail: {
|
|
84
|
+
callback: (selected) => {
|
|
85
|
+
this.space = selected === null || selected === void 0 ? void 0 : selected[0];
|
|
86
|
+
this.watch(this.space);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
setOwn(props) {
|
|
92
|
+
this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: props }));
|
|
93
|
+
setTimeout(() => this.requestUpdate(), 0);
|
|
94
|
+
}
|
|
95
|
+
/* A length of the drawing, in its display unit, as the drawing's coordinates and back */
|
|
96
|
+
toShown(units) {
|
|
97
|
+
const scale = drawingScaleFor(this.space);
|
|
98
|
+
return String(Math.round(mmToDisplay(units * scale.mmPerUnit, scale) * 1000) / 1000);
|
|
99
|
+
}
|
|
100
|
+
toUnits(shown) {
|
|
101
|
+
const scale = drawingScaleFor(this.space);
|
|
102
|
+
return displayToMm(Number(shown) || 0, scale) / scale.mmPerUnit;
|
|
103
|
+
}
|
|
104
|
+
async createBoard() {
|
|
105
|
+
var _a, _b, _c, _d, _e;
|
|
106
|
+
const space = this.space;
|
|
107
|
+
if (!space || this.busy)
|
|
108
|
+
return;
|
|
109
|
+
this.busy = true;
|
|
110
|
+
this.failure = '';
|
|
111
|
+
try {
|
|
112
|
+
const site = (_b = (_a = space.rootModel) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : {};
|
|
113
|
+
const model = { width: Math.round(space.state.width), height: Math.round(space.state.height), components: [] };
|
|
114
|
+
for (const key of SITE_KEYS)
|
|
115
|
+
if (site[key] !== undefined)
|
|
116
|
+
model[key] = site[key];
|
|
117
|
+
const base = i18next.t('text.new space board', { id: space.state.id || '' }).trim();
|
|
118
|
+
const name = await this.freeName(base);
|
|
119
|
+
const created = await client.mutate({
|
|
120
|
+
mutation: gql `
|
|
121
|
+
mutation ($board: NewBoard!) {
|
|
122
|
+
createBoard(board: $board) {
|
|
123
|
+
id
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`,
|
|
127
|
+
variables: { board: { name, description: i18next.t('text.space board description'), model: JSON.stringify(model) } },
|
|
128
|
+
context: gqlContext()
|
|
129
|
+
});
|
|
130
|
+
const id = (_d = (_c = created.data) === null || _c === void 0 ? void 0 : _c.createBoard) === null || _d === void 0 ? void 0 : _d.id;
|
|
131
|
+
/* a space shows its board's published version: the new board is published at once, empty */
|
|
132
|
+
await client.mutate({
|
|
133
|
+
mutation: gql `
|
|
134
|
+
mutation ($id: String!) {
|
|
135
|
+
releaseBoard(id: $id) {
|
|
136
|
+
id
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
variables: { id },
|
|
141
|
+
context: gqlContext()
|
|
142
|
+
});
|
|
143
|
+
this.value = id;
|
|
144
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
145
|
+
}
|
|
146
|
+
catch (e) {
|
|
147
|
+
this.failure = (_e = e === null || e === void 0 ? void 0 : e.message) !== null && _e !== void 0 ? _e : String(e);
|
|
148
|
+
}
|
|
149
|
+
finally {
|
|
150
|
+
this.busy = false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/* A board name nobody in the domain uses: the name, else the name with 2, 3, ... */
|
|
154
|
+
async freeName(base) {
|
|
155
|
+
var _a;
|
|
156
|
+
for (let n = 1; n < 50; n++) {
|
|
157
|
+
const name = n === 1 ? base : `${base} ${n}`;
|
|
158
|
+
const found = await client.query({
|
|
159
|
+
query: gql `
|
|
160
|
+
query ($name: String!) {
|
|
161
|
+
boardByName(name: $name) {
|
|
162
|
+
id
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
`,
|
|
166
|
+
variables: { name },
|
|
167
|
+
context: gqlContext(),
|
|
168
|
+
fetchPolicy: 'network-only'
|
|
169
|
+
});
|
|
170
|
+
if (!((_a = found.data) === null || _a === void 0 ? void 0 : _a.boardByName))
|
|
171
|
+
return name;
|
|
172
|
+
}
|
|
173
|
+
return `${base} ${Date.now()}`;
|
|
174
|
+
}
|
|
175
|
+
statusOf(space) {
|
|
176
|
+
var _a;
|
|
177
|
+
switch (space === null || space === void 0 ? void 0 : space.spaceStatus) {
|
|
178
|
+
case 'ready':
|
|
179
|
+
return space.spaceVersion ? i18next.t('text.space published version', { version: space.spaceVersion }) : '';
|
|
180
|
+
case 'loading':
|
|
181
|
+
return i18next.t('text.space loading');
|
|
182
|
+
case 'unpublished':
|
|
183
|
+
return i18next.t('text.space unpublished');
|
|
184
|
+
case 'cycle':
|
|
185
|
+
return i18next.t('text.space cycle');
|
|
186
|
+
case 'failed':
|
|
187
|
+
return i18next.t('text.space failed', { reason: (_a = space.spaceReason) !== null && _a !== void 0 ? _a : '' });
|
|
188
|
+
default:
|
|
189
|
+
return '';
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
issuesTemplate(space) {
|
|
193
|
+
const issues = space ? spaceIssuesOf(space) : [];
|
|
194
|
+
if (!issues.length)
|
|
195
|
+
return html `<div class="muted">${i18next.t('text.space no issue')}</div>`;
|
|
196
|
+
const scale = drawingScaleFor(space);
|
|
197
|
+
const shown = (mm) => `${Math.round(mmToDisplay(mm, scale) * 100) / 100} ${scale.displayUnit}`;
|
|
198
|
+
return html `${issues.map(issue => issue.kind === 'overlap'
|
|
199
|
+
? html `<button
|
|
200
|
+
class="issue"
|
|
201
|
+
title=${i18next.t('text.select the space')}
|
|
202
|
+
@click=${() => (issue.other.root.selected = [issue.other])}
|
|
203
|
+
>
|
|
204
|
+
${i18next.t('text.space overlap', { other: this.nameOf(issue.other), width: shown(issue.width), depth: shown(issue.depth) })}
|
|
205
|
+
</button>`
|
|
206
|
+
: issue.kind === 'narrow'
|
|
207
|
+
? html `<button class="issue" disabled>${i18next.t('text.space narrow', { width: shown(issue.width), min: shown(issue.depth) })}</button>`
|
|
208
|
+
: html `<button class="issue" disabled>
|
|
209
|
+
${i18next.t('text.space outside', { component: issue.component.state.id || issue.component.state.type, by: shown(issue.width) })}
|
|
210
|
+
</button>`)}`;
|
|
211
|
+
}
|
|
212
|
+
/*
|
|
213
|
+
The aisles and spaces beside it an edge can be tied to: those with an id. A tie that would close a loop is refused
|
|
214
|
+
and said; others are set as the space's own property.
|
|
215
|
+
*/
|
|
216
|
+
tiesTemplate(space) {
|
|
217
|
+
var _a, _b, _c;
|
|
218
|
+
if (!space)
|
|
219
|
+
return html ``;
|
|
220
|
+
const own = space.state.id;
|
|
221
|
+
const targets = ((_b = (_a = space.parent) === null || _a === void 0 ? void 0 : _a.components) !== null && _b !== void 0 ? _b : []).filter(c => { var _a, _b, _c; return c !== space && ((_a = c.state) === null || _a === void 0 ? void 0 : _a.id) && (((_b = c.model) === null || _b === void 0 ? void 0 : _b.type) === 'aisle' || ((_c = c.isReferenceContainer) === null || _c === void 0 ? void 0 : _c.call(c))); });
|
|
222
|
+
const edges = (_c = space.state.edges) !== null && _c !== void 0 ? _c : {};
|
|
223
|
+
const tie = (edge, select) => {
|
|
224
|
+
var _a, _b;
|
|
225
|
+
const to = select.value;
|
|
226
|
+
this.tieRefused = '';
|
|
227
|
+
if (to && wouldCycle(space.parent, space, to)) {
|
|
228
|
+
/* refused: the select shows the tie kept */
|
|
229
|
+
select.value = (_b = (_a = edges[edge]) === null || _a === void 0 ? void 0 : _a.to) !== null && _b !== void 0 ? _b : '';
|
|
230
|
+
this.tieRefused = i18next.t('text.space tie loop', { to });
|
|
231
|
+
this.requestUpdate();
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const next = { ...edges };
|
|
235
|
+
if (to)
|
|
236
|
+
next[edge] = { to };
|
|
237
|
+
else
|
|
238
|
+
delete next[edge];
|
|
239
|
+
this.setOwn({ edges: next });
|
|
240
|
+
};
|
|
241
|
+
return html `
|
|
242
|
+
<div class="wide">${i18next.t('label.space ties')}</div>
|
|
243
|
+
${!own ? html `<div class="muted">${i18next.t('text.space tie needs id')}</div>` : nothing}
|
|
244
|
+
${EDGES.map(edge => {
|
|
245
|
+
var _a, _b, _c;
|
|
246
|
+
return html `
|
|
247
|
+
<label>${i18next.t(`label.space edge ${edge}`)}</label>
|
|
248
|
+
<select
|
|
249
|
+
?disabled=${!own}
|
|
250
|
+
.value=${(_b = (_a = edges[edge]) === null || _a === void 0 ? void 0 : _a.to) !== null && _b !== void 0 ? _b : ''}
|
|
251
|
+
@change=${(e) => {
|
|
252
|
+
e.stopPropagation();
|
|
253
|
+
tie(edge, e.target);
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
<option value="" ?selected=${!((_c = edges[edge]) === null || _c === void 0 ? void 0 : _c.to)}>-</option>
|
|
257
|
+
${targets.map(t => { var _a; return html `<option value=${t.state.id} ?selected=${((_a = edges[edge]) === null || _a === void 0 ? void 0 : _a.to) === t.state.id}>${t.state.id}</option>`; })}
|
|
258
|
+
</select>
|
|
259
|
+
<span></span>
|
|
260
|
+
`;
|
|
261
|
+
})}
|
|
262
|
+
${this.tieRefused ? html `<div class="issue">${this.tieRefused}</div>` : nothing}
|
|
263
|
+
`;
|
|
264
|
+
}
|
|
265
|
+
editorTemplate(value, spec) {
|
|
266
|
+
var _a, _b;
|
|
267
|
+
const space = this.space;
|
|
268
|
+
const floor = space ? this.toShown((_a = space.state.zPos) !== null && _a !== void 0 ? _a : 0) : '';
|
|
269
|
+
const height = space ? this.toShown((_b = space.state.depth) !== null && _b !== void 0 ? _b : 0) : '';
|
|
270
|
+
const unit = space ? drawingScaleFor(space).displayUnit : '';
|
|
271
|
+
const stop = (e) => e.stopPropagation();
|
|
272
|
+
return html `
|
|
273
|
+
<ox-editor-board-selector id="editor" .value=${value} .properties=${spec.property}></ox-editor-board-selector>
|
|
274
|
+
<div fullwidth class="space">
|
|
275
|
+
${!value
|
|
276
|
+
? html `<md-filled-tonal-button class="wide" ?disabled=${this.busy || !space} @click=${() => this.createBoard()}>
|
|
277
|
+
${i18next.t('button.create space board')}
|
|
278
|
+
</md-filled-tonal-button>`
|
|
279
|
+
: nothing}
|
|
280
|
+
${this.failure ? html `<div class="issue">${this.failure}</div>` : nothing}
|
|
281
|
+
${this.statusOf(space) ? html `<div class="muted">${this.statusOf(space)}</div>` : nothing}
|
|
282
|
+
|
|
283
|
+
<label>${i18next.t('label.floor height')}</label>
|
|
284
|
+
<input
|
|
285
|
+
type="number"
|
|
286
|
+
step="0.1"
|
|
287
|
+
.value=${floor}
|
|
288
|
+
@change=${(e) => {
|
|
289
|
+
stop(e);
|
|
290
|
+
this.setOwn({ zPos: this.toUnits(e.target.value) });
|
|
291
|
+
}}
|
|
292
|
+
/>
|
|
293
|
+
<span>${unit}</span>
|
|
294
|
+
|
|
295
|
+
<label>${i18next.t('label.space height')}</label>
|
|
296
|
+
<input
|
|
297
|
+
type="number"
|
|
298
|
+
step="0.1"
|
|
299
|
+
min="0"
|
|
300
|
+
.value=${height}
|
|
301
|
+
@change=${(e) => {
|
|
302
|
+
stop(e);
|
|
303
|
+
this.setOwn({ depth: Math.max(0, this.toUnits(e.target.value)) });
|
|
304
|
+
}}
|
|
305
|
+
/>
|
|
306
|
+
<span>${unit}</span>
|
|
307
|
+
|
|
308
|
+
<label>${i18next.t('label.space min width')}</label>
|
|
309
|
+
<input
|
|
310
|
+
type="number"
|
|
311
|
+
step="0.1"
|
|
312
|
+
min="0"
|
|
313
|
+
.value=${(space === null || space === void 0 ? void 0 : space.state.minWidth) ? this.toShown(space.state.minWidth) : ''}
|
|
314
|
+
@change=${(e) => {
|
|
315
|
+
stop(e);
|
|
316
|
+
const shown = e.target.value;
|
|
317
|
+
this.setOwn({ minWidth: shown ? Math.max(0, this.toUnits(shown)) : undefined });
|
|
318
|
+
}}
|
|
319
|
+
/>
|
|
320
|
+
<span>${unit}</span>
|
|
321
|
+
|
|
322
|
+
${this.tiesTemplate(space)}
|
|
323
|
+
${this.issuesTemplate(space)}
|
|
324
|
+
</div>
|
|
325
|
+
`;
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
OxPropertyEditorSpace.styles = [
|
|
329
|
+
...OxPropertyEditor.styles,
|
|
330
|
+
css `
|
|
331
|
+
:host > div.space {
|
|
332
|
+
display: grid;
|
|
333
|
+
grid-template-columns: auto 1fr auto;
|
|
334
|
+
align-items: center;
|
|
335
|
+
gap: 4px 8px;
|
|
336
|
+
font: var(--label-font);
|
|
337
|
+
}
|
|
338
|
+
.space input {
|
|
339
|
+
width: 100%;
|
|
340
|
+
box-sizing: border-box;
|
|
341
|
+
}
|
|
342
|
+
.space .wide {
|
|
343
|
+
grid-column: 1 / -1;
|
|
344
|
+
}
|
|
345
|
+
.space .issue {
|
|
346
|
+
grid-column: 1 / -1;
|
|
347
|
+
text-align: left;
|
|
348
|
+
color: var(--md-sys-color-error, #b3261e);
|
|
349
|
+
background: none;
|
|
350
|
+
border: none;
|
|
351
|
+
padding: 2px 0;
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
font: inherit;
|
|
354
|
+
}
|
|
355
|
+
.space .issue[disabled] {
|
|
356
|
+
cursor: default;
|
|
357
|
+
}
|
|
358
|
+
.space .muted {
|
|
359
|
+
grid-column: 1 / -1;
|
|
360
|
+
opacity: 0.7;
|
|
361
|
+
}
|
|
362
|
+
.space select {
|
|
363
|
+
width: 100%;
|
|
364
|
+
}
|
|
365
|
+
`
|
|
366
|
+
];
|
|
367
|
+
__decorate([
|
|
368
|
+
state()
|
|
369
|
+
], OxPropertyEditorSpace.prototype, "space", void 0);
|
|
370
|
+
__decorate([
|
|
371
|
+
state()
|
|
372
|
+
], OxPropertyEditorSpace.prototype, "busy", void 0);
|
|
373
|
+
__decorate([
|
|
374
|
+
state()
|
|
375
|
+
], OxPropertyEditorSpace.prototype, "failure", void 0);
|
|
376
|
+
__decorate([
|
|
377
|
+
state()
|
|
378
|
+
], OxPropertyEditorSpace.prototype, "tieRefused", void 0);
|
|
379
|
+
OxPropertyEditorSpace = __decorate([
|
|
380
|
+
customElement('ox-property-editor-space')
|
|
381
|
+
], OxPropertyEditorSpace);
|
|
382
|
+
export { OxPropertyEditorSpace };
|
|
383
|
+
OxPropertyEditor.register({ space: 'ox-property-editor-space' });
|
|
384
|
+
//# sourceMappingURL=ox-property-editor-space.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@operato/board",
|
|
3
|
-
"version": "10.29.
|
|
3
|
+
"version": "10.29.109",
|
|
4
4
|
"description": "Webcomponent for board following open-wc recommendations",
|
|
5
5
|
"author": "heartyoh",
|
|
6
6
|
"type": "module",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"@operato/markdown": "^10.29.83",
|
|
153
153
|
"@operato/popup": "^10.29.96",
|
|
154
154
|
"@operato/property-editor": "^10.29.103",
|
|
155
|
-
"@operato/property-panel": "^10.29.
|
|
155
|
+
"@operato/property-panel": "^10.29.109",
|
|
156
156
|
"@operato/styles": "^10.29.83",
|
|
157
157
|
"@operato/utils": "^10.29.85",
|
|
158
158
|
"@types/file-saver": "^2.0.4",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"@custom-elements-manifest/analyzer": "^0.10.0",
|
|
168
168
|
"@hatiolab/figure-model": "^0.12.20",
|
|
169
169
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
170
|
-
"@hatiolab/things-scene": "^10.1.
|
|
170
|
+
"@hatiolab/things-scene": "^10.1.143",
|
|
171
171
|
"@open-wc/eslint-config": "^12.0.3",
|
|
172
172
|
"@open-wc/testing": "^4.0.0",
|
|
173
173
|
"@rollup/plugin-image": "^3.0.3",
|
|
@@ -203,5 +203,5 @@
|
|
|
203
203
|
"prettier --write"
|
|
204
204
|
]
|
|
205
205
|
},
|
|
206
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "874663836d54a024c61f9c81dfaf65ba146aba60"
|
|
207
207
|
}
|
package/translations/en.json
CHANGED
|
@@ -37,5 +37,39 @@
|
|
|
37
37
|
"label.visibility-domain": "public in group",
|
|
38
38
|
"label.visibility-private": "private",
|
|
39
39
|
"label.visibility-public": "public",
|
|
40
|
-
"text.figure-type-map-changed": "The figure type configuration has changed."
|
|
40
|
+
"text.figure-type-map-changed": "The figure type configuration has changed.",
|
|
41
|
+
"component.space-ref": "Space",
|
|
42
|
+
"label.space": "space board",
|
|
43
|
+
"label.floor height": "floor height",
|
|
44
|
+
"label.space height": "space height",
|
|
45
|
+
"button.create space board": "Create a space board",
|
|
46
|
+
"text.new space board": "Space {id}",
|
|
47
|
+
"text.space board description": "A space board made from a site board",
|
|
48
|
+
"text.space published version": "Showing published version v{version}.",
|
|
49
|
+
"text.space loading": "Loading the space board.",
|
|
50
|
+
"text.space unpublished": "The space board has no published version. Publish the space board.",
|
|
51
|
+
"text.space cycle": "The space board refers to itself.",
|
|
52
|
+
"text.space failed": "The space board could not be loaded: {reason}",
|
|
53
|
+
"text.space no issue": "No overlapping spaces and no components out of the space.",
|
|
54
|
+
"text.space overlap": "Overlaps {other}: {width} × {depth}",
|
|
55
|
+
"text.space outside": "{component} stands {by} out of the space. Fix it in the space board.",
|
|
56
|
+
"text.select the space": "Select this space",
|
|
57
|
+
"component.aisle": "Aisle",
|
|
58
|
+
"label.aisle": "aisle",
|
|
59
|
+
"label.aisle width": "aisle width",
|
|
60
|
+
"text.aisle keeps its centre line": "The width changes about the fixed centre line.",
|
|
61
|
+
"text.aisle moves a space": "{space}: width {before} → {after}",
|
|
62
|
+
"text.aisle moves no space": "No space is tied to this aisle.",
|
|
63
|
+
"text.aisle narrows a space": "{space}: width {width}, below its least width {min}. Cannot be applied.",
|
|
64
|
+
"button.apply": "Apply",
|
|
65
|
+
"label.space min width": "least width",
|
|
66
|
+
"label.space ties": "edge ties",
|
|
67
|
+
"label.space edge left": "left edge",
|
|
68
|
+
"label.space edge right": "right edge",
|
|
69
|
+
"label.space edge top": "top edge",
|
|
70
|
+
"label.space edge bottom": "bottom edge",
|
|
71
|
+
"text.space tie needs id": "Give this space an id to tie its edges.",
|
|
72
|
+
"text.space tie loop": "Tying to {to} would close a loop of placements. A loop cannot be saved.",
|
|
73
|
+
"text.space narrow": "Narrower than its least width: {width} (least {min})",
|
|
74
|
+
"text.aisle leaves components outside": "{space}: {count} out of the new boundary ({items})"
|
|
41
75
|
}
|
package/translations/ko.json
CHANGED
|
@@ -37,5 +37,39 @@
|
|
|
37
37
|
"label.visibility-domain": "그룹 내 공개",
|
|
38
38
|
"label.visibility-private": "비공개",
|
|
39
39
|
"label.visibility-public": "공개",
|
|
40
|
-
"text.figure-type-map-changed": "피규어 유형 구성이 변경되었습니다."
|
|
40
|
+
"text.figure-type-map-changed": "피규어 유형 구성이 변경되었습니다.",
|
|
41
|
+
"component.space-ref": "공간",
|
|
42
|
+
"label.space": "공간 보드",
|
|
43
|
+
"label.floor height": "바닥 높이",
|
|
44
|
+
"label.space height": "공간 높이",
|
|
45
|
+
"button.create space board": "새 공간 보드 만들기",
|
|
46
|
+
"text.new space board": "공간 {id}",
|
|
47
|
+
"text.space board description": "사업장 보드에서 만든 공간 보드",
|
|
48
|
+
"text.space published version": "표시 중인 발행 버전: v{version}",
|
|
49
|
+
"text.space loading": "공간 보드를 불러오는 중입니다.",
|
|
50
|
+
"text.space unpublished": "공간 보드에 발행된 버전이 없습니다. 공간 보드를 발행하세요.",
|
|
51
|
+
"text.space cycle": "공간 보드가 자기 자신을 참조합니다.",
|
|
52
|
+
"text.space failed": "공간 보드를 불러오지 못했습니다: {reason}",
|
|
53
|
+
"text.space no issue": "겹치는 공간과 경계 밖 설비가 없습니다.",
|
|
54
|
+
"text.space overlap": "겹치는 공간: {other} ({width} × {depth})",
|
|
55
|
+
"text.space outside": "경계 밖 설비: {component} ({by} 나감). 공간 보드에서 수정하세요.",
|
|
56
|
+
"text.select the space": "이 공간을 선택합니다",
|
|
57
|
+
"component.aisle": "통로",
|
|
58
|
+
"label.aisle": "통로",
|
|
59
|
+
"label.aisle width": "통로 폭",
|
|
60
|
+
"text.aisle keeps its centre line": "중심선을 고정한 채 폭을 바꿉니다.",
|
|
61
|
+
"text.aisle moves a space": "{space}: 폭 {before} → {after}",
|
|
62
|
+
"text.aisle moves no space": "이 통로에 연결된 공간이 없습니다.",
|
|
63
|
+
"text.aisle narrows a space": "{space}: 폭 {width}, 최소 폭 {min}에 미달합니다. 적용할 수 없습니다.",
|
|
64
|
+
"button.apply": "적용",
|
|
65
|
+
"label.space min width": "최소 폭",
|
|
66
|
+
"label.space ties": "경계 연결",
|
|
67
|
+
"label.space edge left": "왼쪽 변",
|
|
68
|
+
"label.space edge right": "오른쪽 변",
|
|
69
|
+
"label.space edge top": "위쪽 변",
|
|
70
|
+
"label.space edge bottom": "아래쪽 변",
|
|
71
|
+
"text.space tie needs id": "경계를 연결하려면 이 공간에 ID를 지정하세요.",
|
|
72
|
+
"text.space tie loop": "{to}에 연결하면 배치 조건이 순환합니다. 순환하는 배치 조건은 저장할 수 없습니다.",
|
|
73
|
+
"text.space narrow": "최소 폭 미달: 폭 {width} (최소 {min})",
|
|
74
|
+
"text.aisle leaves components outside": "{space}: 새 경계 밖으로 벗어나는 항목 {count}개 ({items})"
|
|
41
75
|
}
|