@operato/slot-layout-editor 10.29.85 → 10.29.87
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/draft.d.ts +9 -0
- package/dist/src/draft.js +15 -0
- package/dist/src/issue-text.js +6 -1
- package/dist/src/ox-slot-layout-editor.d.ts +17 -2
- package/dist/src/ox-slot-layout-editor.js +85 -15
- package/package.json +5 -5
- package/translations/en.json +5 -1
- package/translations/es.json +5 -1
- package/translations/ja.json +5 -1
- package/translations/ko.json +5 -1
- package/translations/ms.json +5 -1
- package/translations/zh.json +5 -1
package/dist/src/draft.d.ts
CHANGED
|
@@ -38,6 +38,15 @@ export declare function removeTier<L extends SlotLayout>(layout: L, tierNo: numb
|
|
|
38
38
|
/** Tier 가 선 Anchor, 적재 방식, Anchor 기준 배치 */
|
|
39
39
|
export type TierPatch = Partial<Pick<SlotLayoutTier, 'anchorId' | 'mount' | 'position' | 'rotation'>>;
|
|
40
40
|
export declare function updateTier<L extends SlotLayout>(layout: L, tierNo: number, patch: TierPatch): L;
|
|
41
|
+
/**
|
|
42
|
+
* Tier 가 면 크기를 따르게 하거나(ADR-0051 §4.3 결정 7) 그만두게 한다. 따르면 지금 숫자는 face 크기(와 그 위 공간)에서의 값이다.
|
|
43
|
+
* face 를 주지 않으면 따르지 않는다
|
|
44
|
+
*/
|
|
45
|
+
export declare function setTierFollowsFace<L extends SlotLayout>(layout: L, tierNo: number, face: {
|
|
46
|
+
width: number;
|
|
47
|
+
depth: number;
|
|
48
|
+
height?: number;
|
|
49
|
+
} | undefined): L;
|
|
41
50
|
/**
|
|
42
51
|
* 층의 패턴을 바꾼다. 자리 규격은 그대로 두고 자리 수·간격은 지금 배치를 이어받는다.
|
|
43
52
|
* CUSTOM 으로 바꾸면 지금 자리들의 위치·규격을 그대로 적어 둔다.
|
package/dist/src/draft.js
CHANGED
|
@@ -50,6 +50,21 @@ export function updateTier(layout, tierNo, patch) {
|
|
|
50
50
|
Object.assign(tier, clone(patch));
|
|
51
51
|
return next;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Tier 가 면 크기를 따르게 하거나(ADR-0051 §4.3 결정 7) 그만두게 한다. 따르면 지금 숫자는 face 크기(와 그 위 공간)에서의 값이다.
|
|
55
|
+
* face 를 주지 않으면 따르지 않는다
|
|
56
|
+
*/
|
|
57
|
+
export function setTierFollowsFace(layout, tierNo, face) {
|
|
58
|
+
const next = clone(layout);
|
|
59
|
+
const tier = next.tiers.find(t => t.tierNo === tierNo);
|
|
60
|
+
if (!tier)
|
|
61
|
+
return next;
|
|
62
|
+
if (face)
|
|
63
|
+
tier.followsFace = clone(face);
|
|
64
|
+
else
|
|
65
|
+
delete tier.followsFace;
|
|
66
|
+
return next;
|
|
67
|
+
}
|
|
53
68
|
// ── 패턴 ───────────────────────────────────────────────────────────────────
|
|
54
69
|
const specOf = (l) => {
|
|
55
70
|
if (l.pattern === 'CUSTOM') {
|
package/dist/src/issue-text.js
CHANGED
|
@@ -22,7 +22,8 @@ export const ISSUE_TEXT = {
|
|
|
22
22
|
SLOTS_REQUIRED: 'At least one slot is required',
|
|
23
23
|
SLOT_NUMBER_DUPLICATE: 'Slot {slotNo} is used twice',
|
|
24
24
|
NOT_PERSISTABLE: 'Cannot be saved ({value})',
|
|
25
|
-
ACCEPTS_EMPTY: 'The list of types it takes is empty; choose 「Any type」 to take any item'
|
|
25
|
+
ACCEPTS_EMPTY: 'The list of types it takes is empty; choose 「Any type」 to take any item',
|
|
26
|
+
FOLLOWS_FACE_TURN: 'A tier that follows its face size turns by 90° steps only'
|
|
26
27
|
};
|
|
27
28
|
export const t = (key, fallback, opts = {}) => i18next.t(`label.slot-layout.${key}`, { defaultValue: fallback, ...opts });
|
|
28
29
|
/** 자리 공간 경고의 기본 문구. 번역 키는 label.slot-layout.space.{코드} */
|
|
@@ -103,6 +104,10 @@ const FIELD_OF_PATH = {
|
|
|
103
104
|
'position.y': 'position-y',
|
|
104
105
|
'position.z': 'position-z',
|
|
105
106
|
rotation: 'tier-rotation',
|
|
107
|
+
followsFace: 'follows-face',
|
|
108
|
+
'followsFace.width': 'follows-face',
|
|
109
|
+
'followsFace.depth': 'follows-face',
|
|
110
|
+
'followsFace.height': 'follows-face',
|
|
106
111
|
layout: 'pattern',
|
|
107
112
|
'layout.pattern': 'pattern',
|
|
108
113
|
'layout.count': 'count',
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* 기본값을 쓰게 된 뒤 보일 값은 호스트가 options.effective 로 다시 준다.
|
|
15
15
|
*/
|
|
16
16
|
import { LitElement } from 'lit';
|
|
17
|
-
import { type SlotLayout, type SlotSpaceOptions } from '@hatiolab/things-scene';
|
|
17
|
+
import { type SlotLayout, type SlotLayoutTier, type SlotSpaceOptions } from '@hatiolab/things-scene';
|
|
18
18
|
import { type HeldItem, type PresetSize, type SlotLayoutPreset } from './draft.js';
|
|
19
19
|
import { type EditorIssue } from './issue-text.js';
|
|
20
20
|
export interface SlotLayoutEditorNote {
|
|
@@ -52,6 +52,11 @@ export interface SlotLayoutEditorOptions<L extends SlotLayout = SlotLayout> {
|
|
|
52
52
|
}[];
|
|
53
53
|
/** Anchor 가 주는 적재면 크기 (Anchor 기준 X·Z). 그림에 면을 그리고, 자리가 면 밖으로 나가는지 알린다. 없으면 확인 불가로 보인다 */
|
|
54
54
|
anchorFaces?: SlotSpaceOptions['anchorFaces'];
|
|
55
|
+
/**
|
|
56
|
+
* 각 Anchor 면 위에 남은 공간 (mm). 주면 「면 크기를 따름」 층의 높이도 그 공간을 따른다(ADR-0051 §4.3 결정 7).
|
|
57
|
+
* anchorFaces 가 있는 Anchor 위의 층만 면 크기를 따를 수 있다
|
|
58
|
+
*/
|
|
59
|
+
anchorRooms?: Record<string, number>;
|
|
55
60
|
/** 레이아웃 길이 단위 (예: mm). 그림과 칸 이름에 붙인다 */
|
|
56
61
|
unit?: string;
|
|
57
62
|
/** 받는 타입을 고르는 목록 (아이템 타입 코드·이름). 없으면 코드를 직접 적는다 */
|
|
@@ -76,6 +81,8 @@ export declare class OxSlotLayoutEditor extends OxSlotLayoutEditor_base {
|
|
|
76
81
|
/** 개별 설정. 없으면 undefined */
|
|
77
82
|
value: SlotLayout | undefined;
|
|
78
83
|
options: SlotLayoutEditorOptions;
|
|
84
|
+
/** The faces the host has in hand (the part picked on its canvas): the tier on one of them is the one shown. */
|
|
85
|
+
focusAnchors: readonly string[] | undefined;
|
|
79
86
|
draft: SlotLayout | undefined;
|
|
80
87
|
tier: number;
|
|
81
88
|
dirty: boolean;
|
|
@@ -86,11 +93,16 @@ export declare class OxSlotLayoutEditor extends OxSlotLayoutEditor_base {
|
|
|
86
93
|
fitNote: string | undefined;
|
|
87
94
|
private _drag;
|
|
88
95
|
willUpdate(changed: Map<string, unknown>): void;
|
|
96
|
+
private _followFocus;
|
|
97
|
+
private _startUpdate;
|
|
89
98
|
/** 편집 중인 값을 버리고 개별 설정(없으면 호스트 기본값)에서 다시 시작한다. 고른 Tier 는 남아 있으면 그대로 */
|
|
90
99
|
reset(): void;
|
|
91
100
|
private _startFromHost;
|
|
92
101
|
get issues(): EditorIssue[];
|
|
93
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* 자리끼리 겹치거나 면 밖으로 나가는 설정, 면 크기를 몰라 확인하지 못한 Anchor. 적용을 막지 않는다. 면 크기를 따르는 층은
|
|
104
|
+
* 지금 면 크기에서의 레이아웃으로 본다(ADR-0051 §4.3 결정 7): 다른 크기의 배치에서 적을 때의 숫자로 재지 않는다
|
|
105
|
+
*/
|
|
94
106
|
get warnings(): EditorIssue[];
|
|
95
107
|
/** 적용하면 뜻이 바뀌는 주소 (지금 적용된 값 기준) */
|
|
96
108
|
get impact(): import("./draft.js").AddressImpact;
|
|
@@ -109,6 +121,9 @@ export declare class OxSlotLayoutEditor extends OxSlotLayoutEditor_base {
|
|
|
109
121
|
/** 프리셋으로 다시 시작한다. 지금 값에 덧붙은 호스트 키(Tier 밖의 키)는 가져온다 */
|
|
110
122
|
private _startFrom;
|
|
111
123
|
private _renderDraft;
|
|
124
|
+
private _pickTier;
|
|
125
|
+
addTier(tier: Omit<SlotLayoutTier, 'tierNo'>): void;
|
|
126
|
+
private _faceAt;
|
|
112
127
|
/** 복사한 Tier 를 골라 둔다. 같은 자리에 겹쳐 생기므로 바로 이어서 배치를 고친다 */
|
|
113
128
|
private _copyTier;
|
|
114
129
|
private _anchorName;
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
import { __decorate } from "tslib";
|
|
17
17
|
import { css, html, nothing, LitElement, svg } from 'lit';
|
|
18
18
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
19
|
+
import { live } from 'lit/directives/live.js';
|
|
19
20
|
import { i18next, localize } from '@operato/i18n';
|
|
20
|
-
import { persistenceIssues, rotatedFootprint, slotSpaceWarnings, validateSlotLayout } from '@hatiolab/things-scene';
|
|
21
|
-
import { addCustomSlot, addressImpact, anchorFaceSlots, applyPreset, copyTier, fitTierToFace, heldItemStatuses, pitchToPoint, removeCustomSlot, removeTier, setTierPattern, updatePattern, updateSlotSpec, updateTier } from './draft.js';
|
|
21
|
+
import { persistenceIssues, rotatedFootprint, slotSpaceWarnings, slotLayoutAtFaces, validateSlotLayout } from '@hatiolab/things-scene';
|
|
22
|
+
import { addCustomSlot, addressImpact, anchorFaceSlots, applyPreset, copyTier, fitTierToFace, heldItemStatuses, pitchToPoint, removeCustomSlot, removeTier, setTierPattern, updatePattern, updateSlotSpec, updateTier, setTierFollowsFace } from './draft.js';
|
|
22
23
|
import { fitFaceText, fitText, issueField, issueMessage, issueText as defaultIssueText, ISSUE_TEXT, spaceWarningLines, t } from './issue-text.js';
|
|
23
24
|
const num = (e) => {
|
|
24
25
|
const n = e.target.valueAsNumber;
|
|
@@ -33,6 +34,7 @@ const SLOT = '#1976d2';
|
|
|
33
34
|
const FIELD_LABEL = {
|
|
34
35
|
anchor: ['face', 'Face'],
|
|
35
36
|
mount: ['mount', 'Mount'],
|
|
37
|
+
'follows-face': ['follows-face', 'Face size'],
|
|
36
38
|
'position-x': ['position-x', 'Position X'],
|
|
37
39
|
'position-y': ['position-y', 'Position Y (height)'],
|
|
38
40
|
'position-z': ['position-z', 'Position Z'],
|
|
@@ -108,6 +110,22 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
112
|
willUpdate(changed) {
|
|
113
|
+
this._startUpdate(changed);
|
|
114
|
+
if (changed.has('focusAnchors') || changed.has('value'))
|
|
115
|
+
this._followFocus();
|
|
116
|
+
}
|
|
117
|
+
/* The host's part picked on its canvas opens the tier on that part's face; a face no tier stands on leaves it as it is. */
|
|
118
|
+
_followFocus() {
|
|
119
|
+
var _a, _b, _c;
|
|
120
|
+
const faces = this.focusAnchors;
|
|
121
|
+
const tiers = (_b = (_a = this.draft) === null || _a === void 0 ? void 0 : _a.tiers) !== null && _b !== void 0 ? _b : [];
|
|
122
|
+
if (!(faces === null || faces === void 0 ? void 0 : faces.length) || faces.includes((_c = tiers.find(x => x.tierNo === this.tier)) === null || _c === void 0 ? void 0 : _c.anchorId))
|
|
123
|
+
return;
|
|
124
|
+
const on = tiers.find(x => faces.includes(x.anchorId));
|
|
125
|
+
if (on)
|
|
126
|
+
this.tier = on.tierNo;
|
|
127
|
+
}
|
|
128
|
+
_startUpdate(changed) {
|
|
111
129
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
112
130
|
// 호스트가 렌더마다 새 options 를 넘겨도 편집 중인 값을 잃지 않도록, 값이나 호스트 기본값이 바뀔 때만 다시 시작한다
|
|
113
131
|
const before = changed.get('options');
|
|
@@ -163,12 +181,17 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
163
181
|
// 저장 불가 검사는 검증을 통과한 값에만 보인다 (같은 문제를 두 번 적지 않는다)
|
|
164
182
|
return unique.length ? unique : persistenceIssues(this.draft);
|
|
165
183
|
}
|
|
166
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* 자리끼리 겹치거나 면 밖으로 나가는 설정, 면 크기를 몰라 확인하지 못한 Anchor. 적용을 막지 않는다. 면 크기를 따르는 층은
|
|
186
|
+
* 지금 면 크기에서의 레이아웃으로 본다(ADR-0051 §4.3 결정 7): 다른 크기의 배치에서 적을 때의 숫자로 재지 않는다
|
|
187
|
+
*/
|
|
167
188
|
get warnings() {
|
|
168
|
-
var _a;
|
|
189
|
+
var _a, _b;
|
|
169
190
|
if (!this.draft || this.issues.length)
|
|
170
191
|
return [];
|
|
171
|
-
|
|
192
|
+
const faces = (_a = this.options) === null || _a === void 0 ? void 0 : _a.anchorFaces;
|
|
193
|
+
const sized = faces ? slotLayoutAtFaces(this.draft, faces, (_b = this.options) === null || _b === void 0 ? void 0 : _b.anchorRooms) : this.draft;
|
|
194
|
+
return slotSpaceWarnings(sized, { anchorFaces: faces });
|
|
172
195
|
}
|
|
173
196
|
/** 적용하면 뜻이 바뀌는 주소 (지금 적용된 값 기준) */
|
|
174
197
|
get impact() {
|
|
@@ -350,7 +373,7 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
350
373
|
return html `
|
|
351
374
|
${this._renderPicture(draft, tier.tierNo)}
|
|
352
375
|
<div class="tiers">
|
|
353
|
-
${draft.tiers.map(x => html `<button data-tier=${x.tierNo} aria-pressed=${x.tierNo === tier.tierNo ? 'true' : 'false'} @click=${() =>
|
|
376
|
+
${draft.tiers.map(x => html `<button data-tier=${x.tierNo} aria-pressed=${x.tierNo === tier.tierNo ? 'true' : 'false'} @click=${() => this._pickTier(x)}>
|
|
354
377
|
${t('tier-n', 'Tier {n}', { n: x.tierNo })}
|
|
355
378
|
</button>`)}
|
|
356
379
|
<button class="end" data-action="copy-tier" @click=${() => this._copyTier(draft, tier.tierNo)}>${t('copy-tier', 'Copy tier')}</button>
|
|
@@ -367,6 +390,39 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
367
390
|
${(_l = (_k = (_j = this.options) === null || _j === void 0 ? void 0 : _j.renderExtra) === null || _k === void 0 ? void 0 : _k.call(_j, draft, next => this._edit(next))) !== null && _l !== void 0 ? _l : nothing}
|
|
368
391
|
`;
|
|
369
392
|
}
|
|
393
|
+
/*
|
|
394
|
+
A tier picked here is said to the host with the face it stands on: a host with a canvas picks that face's part there
|
|
395
|
+
too, so the panel and the canvas speak of the same plate (figure modeller 2026-11-16).
|
|
396
|
+
*/
|
|
397
|
+
_pickTier(tier) {
|
|
398
|
+
if (tier.tierNo === this.tier)
|
|
399
|
+
return;
|
|
400
|
+
this.tier = tier.tierNo;
|
|
401
|
+
this.dispatchEvent(new CustomEvent('slot-layout-tier-select', { detail: { tierNo: tier.tierNo, anchorId: tier.anchorId }, bubbles: true, composed: true }));
|
|
402
|
+
}
|
|
403
|
+
/*
|
|
404
|
+
A tier the host makes -- a place on a part's face, picked on its canvas -- added as the next tier and shown. Kept in
|
|
405
|
+
the draft like any edit: it goes out on Apply (figure modeller, ADR-0051 §4.3 decision 3).
|
|
406
|
+
*/
|
|
407
|
+
addTier(tier) {
|
|
408
|
+
var _a;
|
|
409
|
+
const draft = (_a = this.draft) !== null && _a !== void 0 ? _a : { tiers: [] };
|
|
410
|
+
const tierNo = draft.tiers.length ? Math.max(...draft.tiers.map(t => t.tierNo)) + 1 : 1;
|
|
411
|
+
this.tier = tierNo;
|
|
412
|
+
this._edit({ ...structuredClone(draft), tiers: [...structuredClone(draft.tiers), { ...structuredClone(tier), tierNo }] });
|
|
413
|
+
}
|
|
414
|
+
/*
|
|
415
|
+
The face a tier would follow (ADR-0051 §4.3 decision 7): its size and, when the host measures it, the room over it.
|
|
416
|
+
None when the host gives no size for that face -- a holder whose anchors are not faces does not follow.
|
|
417
|
+
*/
|
|
418
|
+
_faceAt(anchorId) {
|
|
419
|
+
var _a, _b, _c, _d;
|
|
420
|
+
const face = anchorId ? (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.anchorFaces) === null || _b === void 0 ? void 0 : _b[anchorId] : undefined;
|
|
421
|
+
if (!face || !(face.width > 0) || !(face.depth > 0))
|
|
422
|
+
return undefined;
|
|
423
|
+
const room = (_d = (_c = this.options) === null || _c === void 0 ? void 0 : _c.anchorRooms) === null || _d === void 0 ? void 0 : _d[anchorId];
|
|
424
|
+
return { width: face.width, depth: face.depth, ...(room && room > 0 ? { height: room } : {}) };
|
|
425
|
+
}
|
|
370
426
|
/** 복사한 Tier 를 골라 둔다. 같은 자리에 겹쳐 생기므로 바로 이어서 배치를 고친다 */
|
|
371
427
|
_copyTier(draft, tierNo) {
|
|
372
428
|
const next = copyTier(draft, tierNo);
|
|
@@ -586,10 +642,15 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
586
642
|
</div>`;
|
|
587
643
|
}
|
|
588
644
|
_renderTier(draft, tierNo, errors) {
|
|
589
|
-
var _a, _b, _c, _d, _e;
|
|
645
|
+
var _a, _b, _c, _d, _e, _f;
|
|
590
646
|
const tier = draft.tiers.find(x => x.tierNo === tierNo);
|
|
591
647
|
const anchors = (_a = this.options) === null || _a === void 0 ? void 0 : _a.anchors;
|
|
592
|
-
|
|
648
|
+
/* A tier that follows its face, moved to another face, follows that one: its numbers are read as at the face it stands on. */
|
|
649
|
+
const editTier = (patch) => {
|
|
650
|
+
var _a;
|
|
651
|
+
const next = updateTier(draft, tierNo, patch);
|
|
652
|
+
this._edit(patch.anchorId && tier.followsFace ? setTierFollowsFace(next, tierNo, (_a = this._faceAt(patch.anchorId)) !== null && _a !== void 0 ? _a : tier.followsFace) : next);
|
|
653
|
+
};
|
|
593
654
|
const position = (_b = tier.position) !== null && _b !== void 0 ? _b : { x: 0, y: 0, z: 0 };
|
|
594
655
|
const fine = ['position-x', 'position-y', 'position-z', 'tier-rotation'].some(f => errors.has(f));
|
|
595
656
|
const u = this._unit();
|
|
@@ -597,16 +658,22 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
597
658
|
<section data-section="where">
|
|
598
659
|
<h4>${t('where', 'Where')}</h4>
|
|
599
660
|
${this._row('anchor', t('face', 'Face'), (anchors === null || anchors === void 0 ? void 0 : anchors.length)
|
|
600
|
-
? html `<select data-field="anchor" ?invalid=${errors.has('anchor')} @change=${(e) => editTier({ anchorId: e.target.value })}>
|
|
601
|
-
${anchors.some(a => a.id === tier.anchorId) ? nothing : html `<option value=${(
|
|
661
|
+
? html `<select data-field="anchor" ?invalid=${errors.has('anchor')} .value=${live((_c = tier.anchorId) !== null && _c !== void 0 ? _c : '')} @change=${(e) => editTier({ anchorId: e.target.value })}>
|
|
662
|
+
${anchors.some(a => a.id === tier.anchorId) ? nothing : html `<option value=${(_d = tier.anchorId) !== null && _d !== void 0 ? _d : ''} selected>${(_e = tier.anchorId) !== null && _e !== void 0 ? _e : ''}</option>`}
|
|
602
663
|
${anchors.map(a => html `<option value=${a.id} ?selected=${a.id === tier.anchorId}>${this._anchorName(a.id)}</option>`)}
|
|
603
664
|
</select>`
|
|
604
|
-
: html `<input data-field="anchor" ?invalid=${errors.has('anchor')} .value=${(
|
|
665
|
+
: html `<input data-field="anchor" ?invalid=${errors.has('anchor')} .value=${(_f = tier.anchorId) !== null && _f !== void 0 ? _f : ''} @change=${(e) => editTier({ anchorId: e.target.value.trim() })} />`, errors)}
|
|
605
666
|
${this._row('mount', t('mount', 'Mount'), this._seg('mount', tier.mount, [
|
|
606
667
|
['ON', t('mount.ON', 'On')],
|
|
607
668
|
['IN', t('mount.IN', 'In')],
|
|
608
669
|
['HANG', t('mount.HANG', 'Hang')]
|
|
609
670
|
], mount => editTier({ mount }), errors), errors)}
|
|
671
|
+
${this._faceAt(tier.anchorId)
|
|
672
|
+
? this._row('follows-face', t('follows-face', 'Face size'), this._seg('follows-face', tier.followsFace ? 'FOLLOW' : 'KEEP', [
|
|
673
|
+
['FOLLOW', t('follows-face.FOLLOW', 'Follow')],
|
|
674
|
+
['KEEP', t('follows-face.KEEP', 'Keep the numbers')]
|
|
675
|
+
], v => this._edit(setTierFollowsFace(draft, tierNo, v === 'FOLLOW' ? this._faceAt(tier.anchorId) : undefined)), errors), errors)
|
|
676
|
+
: nothing}
|
|
610
677
|
</section>
|
|
611
678
|
${this._renderArrangement(draft, tierNo, errors)} ${this._renderSlot(draft, tierNo, errors)}
|
|
612
679
|
<details data-section="fine" ?open=${fine}>
|
|
@@ -622,7 +689,7 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
622
689
|
}
|
|
623
690
|
/** 자리를 어떻게 늘어놓는가: 패턴, 수, 간격, 방향, 1번 자리. 그리고 [면에 맞춤] */
|
|
624
691
|
_renderArrangement(draft, tierNo, errors) {
|
|
625
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
692
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
626
693
|
const tier = draft.tiers.find(x => x.tierNo === tierNo);
|
|
627
694
|
const l = tier.layout;
|
|
628
695
|
const edit = (patch) => this._edit(updatePattern(draft, tierNo, patch));
|
|
@@ -673,11 +740,11 @@ let OxSlotLayoutEditor = class OxSlotLayoutEditor extends localize(i18next)(LitE
|
|
|
673
740
|
${this._row('cols', t('cols', 'Columns (X)'), this._num('cols', l.cols, n => edit({ cols: n }), errors, { min: '1', step: '1' }), errors)}
|
|
674
741
|
${this._row('pitch-x', html `${t('pitch-x', 'Pitch X')}${u}`, this._num('pitch-x', (_b = l.pitch) === null || _b === void 0 ? void 0 : _b.x, n => edit({ pitch: { ...l.pitch, x: n } }), errors), errors)}
|
|
675
742
|
${this._row('pitch-z', html `${t('pitch-z', 'Pitch Z')}${u}`, html `<div class="inline">${this._num('pitch-z', (_c = l.pitch) === null || _c === void 0 ? void 0 : _c.z, n => edit({ pitch: { ...l.pitch, z: n } }), errors)} ${fitButton}</div>`, errors)}
|
|
676
|
-
${this._row('order', t('order', 'Numbering'), html `<select data-field="order" @change=${(e) => edit({ order: e.target.value })}>
|
|
743
|
+
${this._row('order', t('order', 'Numbering'), html `<select data-field="order" .value=${live((_d = l.order) !== null && _d !== void 0 ? _d : 'ROW_MAJOR')} @change=${(e) => edit({ order: e.target.value })}>
|
|
677
744
|
${['ROW_MAJOR', 'COL_MAJOR', 'SERPENTINE_ROW', 'SERPENTINE_COL'].map(o => { var _a; return html `<option value=${o} ?selected=${o === ((_a = l.order) !== null && _a !== void 0 ? _a : 'ROW_MAJOR')}>${t(`order.${o}`, o)}</option>`; })}
|
|
678
745
|
</select>`, errors)}
|
|
679
|
-
${this._row('origin-x', t('origin-x', 'Slot 1 at X'), this._seg('origin-x', (
|
|
680
|
-
${this._row('origin-z', t('origin-z', 'Slot 1 at Z'), this._seg('origin-z', (
|
|
746
|
+
${this._row('origin-x', t('origin-x', 'Slot 1 at X'), this._seg('origin-x', (_f = (_e = l.origin) === null || _e === void 0 ? void 0 : _e.x) !== null && _f !== void 0 ? _f : 'MIN', side('X'), x => edit({ origin: { z: 'MIN', ...l.origin, x } }), errors), errors)}
|
|
747
|
+
${this._row('origin-z', t('origin-z', 'Slot 1 at Z'), this._seg('origin-z', (_h = (_g = l.origin) === null || _g === void 0 ? void 0 : _g.z) !== null && _h !== void 0 ? _h : 'MIN', side('Z'), z => edit({ origin: { x: 'MIN', ...l.origin, z } }), errors), errors)}
|
|
681
748
|
`
|
|
682
749
|
: nothing}
|
|
683
750
|
${l.pattern === 'SINGLE' ? html `<label class="l"></label><div class="inline">${fitButton}</div>` : nothing}
|
|
@@ -1037,6 +1104,9 @@ __decorate([
|
|
|
1037
1104
|
__decorate([
|
|
1038
1105
|
property({ attribute: false })
|
|
1039
1106
|
], OxSlotLayoutEditor.prototype, "options", void 0);
|
|
1107
|
+
__decorate([
|
|
1108
|
+
property({ attribute: false })
|
|
1109
|
+
], OxSlotLayoutEditor.prototype, "focusAnchors", void 0);
|
|
1040
1110
|
__decorate([
|
|
1041
1111
|
state()
|
|
1042
1112
|
], OxSlotLayoutEditor.prototype, "draft", void 0);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/slot-layout-editor",
|
|
3
3
|
"description": "Editor for a holder's tiers and slots (things-scene slot layout): edit, validate, preview",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "10.29.
|
|
5
|
+
"version": "10.29.87",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/src/index.js",
|
|
8
8
|
"module": "dist/src/index.js",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@operato/i18n": "^10.29.85",
|
|
49
|
-
"@operato/property-editor": "^10.29.
|
|
49
|
+
"@operato/property-editor": "^10.29.87",
|
|
50
50
|
"lit": "^3.1.2"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@hatiolab/things-scene": "^10.1.
|
|
53
|
+
"@hatiolab/things-scene": "^10.1.122"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
57
|
-
"@hatiolab/things-scene": "^10.1.
|
|
57
|
+
"@hatiolab/things-scene": "^10.1.122",
|
|
58
58
|
"@open-wc/testing": "^4.0.0",
|
|
59
59
|
"@web/dev-server": "^0.4.0",
|
|
60
60
|
"@web/test-runner": "^0.19.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"typescript": "^5.0.4"
|
|
67
67
|
},
|
|
68
68
|
"prettier": "@hatiolab/prettier-config",
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "5b486a37c6b182fcd15785c5f8c04b95faa3600a"
|
|
70
70
|
}
|
package/translations/en.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "Use default",
|
|
129
129
|
"label.slot-layout.w": "W",
|
|
130
130
|
"label.slot-layout.where": "Where",
|
|
131
|
-
"label.slot-layout.width": "Width (X)"
|
|
131
|
+
"label.slot-layout.width": "Width (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "Face size",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "Follow",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "Keep the numbers",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "A tier that follows its face size turns by 90° steps only"
|
|
132
136
|
}
|
package/translations/es.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "Usar valor predeterminado",
|
|
129
129
|
"label.slot-layout.w": "An",
|
|
130
130
|
"label.slot-layout.where": "Dónde",
|
|
131
|
-
"label.slot-layout.width": "Anchura (X)"
|
|
131
|
+
"label.slot-layout.width": "Anchura (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "Tamaño de la cara",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "Seguir",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "Mantener los números",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "Un nivel que sigue el tamaño de su cara solo gira en pasos de 90°"
|
|
132
136
|
}
|
package/translations/ja.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "Use default",
|
|
129
129
|
"label.slot-layout.w": "W",
|
|
130
130
|
"label.slot-layout.where": "置く場所",
|
|
131
|
-
"label.slot-layout.width": "Width (X)"
|
|
131
|
+
"label.slot-layout.width": "Width (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "面の大きさ",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "追従",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "数値のまま",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "面の大きさに追従する段は 90° 単位でのみ回転できます"
|
|
132
136
|
}
|
package/translations/ko.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "기본값 사용",
|
|
129
129
|
"label.slot-layout.w": "폭",
|
|
130
130
|
"label.slot-layout.where": "놓을 곳",
|
|
131
|
-
"label.slot-layout.width": "폭 (X)"
|
|
131
|
+
"label.slot-layout.width": "폭 (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "면 크기",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "따름",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "숫자 그대로",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "면 크기를 따르는 층은 90° 단위로만 돌릴 수 있습니다"
|
|
132
136
|
}
|
package/translations/ms.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "Use default",
|
|
129
129
|
"label.slot-layout.w": "W",
|
|
130
130
|
"label.slot-layout.where": "Di mana",
|
|
131
|
-
"label.slot-layout.width": "Width (X)"
|
|
131
|
+
"label.slot-layout.width": "Width (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "Saiz muka",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "Ikut",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "Kekalkan nombor",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "Tingkat yang mengikut saiz mukanya hanya berpusing 90° setiap langkah"
|
|
132
136
|
}
|
package/translations/zh.json
CHANGED
|
@@ -128,5 +128,9 @@
|
|
|
128
128
|
"label.slot-layout.use-default": "Use default",
|
|
129
129
|
"label.slot-layout.w": "W",
|
|
130
130
|
"label.slot-layout.where": "放置处",
|
|
131
|
-
"label.slot-layout.width": "Width (X)"
|
|
131
|
+
"label.slot-layout.width": "Width (X)",
|
|
132
|
+
"label.slot-layout.follows-face": "面尺寸",
|
|
133
|
+
"label.slot-layout.follows-face.FOLLOW": "跟随",
|
|
134
|
+
"label.slot-layout.follows-face.KEEP": "保持数值",
|
|
135
|
+
"label.slot-layout.issue.FOLLOWS_FACE_TURN": "跟随面尺寸的层只能以 90° 为单位旋转"
|
|
132
136
|
}
|