@operato/property-panel 10.29.108 → 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.
@@ -34,6 +34,7 @@ export declare class PropertyScene3D extends AbstractProperty {
34
34
  */
35
35
  private _renderPlacement;
36
36
  private _renderMode;
37
+ private _renderComposition;
37
38
  private _renderRenderer;
38
39
  /**
39
40
  * Environment 드롭다운 — 씬의 공간적 맥락을 정의.
@@ -27,7 +27,7 @@ export class PropertyScene3D extends AbstractProperty {
27
27
  */
28
28
  const value = lookedState({ state: this.value || {}, root: (_b = (_a = this.scene) === null || _a === void 0 ? void 0 : _a.root) === null || _b === void 0 ? void 0 : _b.root });
29
29
  return html `
30
- ${this._renderMode(value)} ${this._renderPlacement(value)}
30
+ ${this._renderMode(value)} ${this._renderComposition(value)} ${this._renderPlacement(value)}
31
31
  ${this._renderCamera(value)}
32
32
  ${this._renderRenderer(value)} ${this._renderSky(value)}
33
33
  ${this._renderHemisphereLight(value)} ${this._renderKeyLight(value)} ${this._renderLightingPresets()}
@@ -156,6 +156,63 @@ export class PropertyScene3D extends AbstractProperty {
156
156
  </fieldset>
157
157
  `;
158
158
  }
159
+ /*
160
+ * A site that composes spaces (ADR-0254): turning about the point under the cursor, panels that come up over machines
161
+ * seen close, and spaces small on screen drawn as boxes. Each is on with its defaults; the board keeps any values it
162
+ * already has (a generator's thresholds and panel table). Turned off, a setting is kept with `enabled: false`, so
163
+ * turning it on again brings back what it was.
164
+ */
165
+ _renderComposition(value) {
166
+ const set = (key, on, whenOn) => {
167
+ this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: { [key]: on ? whenOn : undefined } }));
168
+ };
169
+ const kept = (v) => (v && typeof v === 'object' ? v : {});
170
+ const isOn = (v) => !!v && kept(v).enabled !== false;
171
+ /* on: its settings without the off mark; off: its settings, marked off */
172
+ const toggle = (key, on) => {
173
+ const { enabled, ...settings } = kept(value[key]);
174
+ this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: { [key]: on ? settings : { ...settings, enabled: false } } }));
175
+ };
176
+ return html `
177
+ <fieldset>
178
+ <legend><ox-i18n msgid="label.space composition">Space composition</ox-i18n></legend>
179
+ <div class="property-grid">
180
+ <input
181
+ id="cb-camera-pivot"
182
+ type="checkbox"
183
+ .checked=${value.cameraPivot === 'cursor'}
184
+ @change=${(e) => {
185
+ e.stopPropagation();
186
+ set('cameraPivot', e.target.checked, 'cursor');
187
+ }}
188
+ />
189
+ <label for="cb-camera-pivot"><ox-i18n msgid="label.camera pivot at cursor">Turn about the cursor</ox-i18n></label>
190
+
191
+ <input
192
+ id="cb-auto-panel"
193
+ type="checkbox"
194
+ .checked=${isOn(value.autoPanel)}
195
+ @change=${(e) => {
196
+ e.stopPropagation();
197
+ toggle('autoPanel', e.target.checked);
198
+ }}
199
+ />
200
+ <label for="cb-auto-panel"><ox-i18n msgid="label.auto panels">Automatic information panels</ox-i18n></label>
201
+
202
+ <input
203
+ id="cb-space-detail"
204
+ type="checkbox"
205
+ .checked=${isOn(value.spaceDetail)}
206
+ @change=${(e) => {
207
+ e.stopPropagation();
208
+ toggle('spaceDetail', e.target.checked);
209
+ }}
210
+ />
211
+ <label for="cb-space-detail"><ox-i18n msgid="label.space detail">Draw small spaces as boxes</ox-i18n></label>
212
+ </div>
213
+ </fieldset>
214
+ `;
215
+ }
159
216
  _renderRenderer(value) {
160
217
  var _a, _b, _c;
161
218
  const exposure = Number((_a = value.exposure) !== null && _a !== void 0 ? _a : 1.2);
@@ -14,5 +14,6 @@ export declare class Property3D extends AbstractProperty {
14
14
  selected: Component[];
15
15
  firstUpdated(): void;
16
16
  render(): import("lit-html").TemplateResult<1>;
17
+ private _renderAutoPanel;
17
18
  onValueChange(e: Event): void;
18
19
  }
@@ -16,6 +16,7 @@ import './property-material3d.js';
16
16
  export { PropertyScene3D } from './property-scene3d.js';
17
17
  import { html } from 'lit';
18
18
  import { property } from 'lit/decorators.js';
19
+ import { i18next } from '@operato/i18n';
19
20
  import { PropertyGridStyles } from '@operato/styles/property-grid-styles.js';
20
21
  import { AbstractProperty } from '../abstract-property.js';
21
22
  import { SizeLimitStyles, figureSizingOf, isSizeHeld, refuseSize, renderSizeLimits, shownSize } from '../size-limits.js';
@@ -110,9 +111,57 @@ export class Property3D extends AbstractProperty {
110
111
  </div>
111
112
  </fieldset>
112
113
 
114
+ ${this._renderAutoPanel(value)}
115
+
113
116
  <property-material3d .value=${value.material3d}></property-material3d>
114
117
  `;
115
118
  }
119
+ /*
120
+ * The component's own automatic information panel (ADR-0254): as its board says for its type, always, or never; and
121
+ * its priority among panels. It comes up only on a board that turns automatic panels on.
122
+ */
123
+ _renderAutoPanel(value) {
124
+ var _a;
125
+ const own = value.autoPanel;
126
+ const mode = own === false ? 'off' : own && typeof own === 'object' ? 'on' : '';
127
+ const send = (autoPanel) => this.dispatchEvent(new CustomEvent('property-change', { bubbles: true, composed: true, detail: { autoPanel } }));
128
+ return html `
129
+ <fieldset>
130
+ <legend><ox-i18n msgid="label.auto panel">Information panel</ox-i18n></legend>
131
+ <div class="property-grid">
132
+ <label><ox-i18n msgid="label.auto panel show">Show</ox-i18n></label>
133
+ <select
134
+ @change=${(e) => {
135
+ e.stopPropagation();
136
+ const v = e.target.value;
137
+ send(v === 'on' ? (own && typeof own === 'object' ? own : {}) : v === 'off' ? false : undefined);
138
+ }}
139
+ >
140
+ <option value="" ?selected=${mode === ''}>${i18next.t('label.auto panel by type')}</option>
141
+ <option value="on" ?selected=${mode === 'on'}>${i18next.t('label.auto panel on')}</option>
142
+ <option value="off" ?selected=${mode === 'off'}>${i18next.t('label.auto panel off')}</option>
143
+ </select>
144
+ ${mode === 'on'
145
+ ? html `
146
+ <label><ox-i18n msgid="label.auto panel priority">Priority</ox-i18n></label>
147
+ <input
148
+ type="number"
149
+ min="0"
150
+ step="1"
151
+ .value=${String((_a = own.priority) !== null && _a !== void 0 ? _a : '')}
152
+ @change=${(e) => {
153
+ e.stopPropagation();
154
+ const n = Number(e.target.value);
155
+ const { priority, ...rest } = own;
156
+ send(Number.isFinite(n) && e.target.value !== '' ? { ...rest, priority: n } : rest);
157
+ }}
158
+ />
159
+ `
160
+ : ''}
161
+ </div>
162
+ </fieldset>
163
+ `;
164
+ }
116
165
  onValueChange(e) {
117
166
  var _a, _b;
118
167
  var element = e.target;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/property-panel",
3
3
  "description": "Webcomponent property-panel following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "10.29.108",
5
+ "version": "10.29.109",
6
6
  "type": "module",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
@@ -128,5 +128,5 @@
128
128
  "prettier --write"
129
129
  ]
130
130
  },
131
- "gitHead": "92c535efe925903da1ac9a08d7234c101a24bb26"
131
+ "gitHead": "874663836d54a024c61f9c81dfaf65ba146aba60"
132
132
  }
@@ -804,5 +804,15 @@
804
804
  "label.measured-clipped": "Clipped to white",
805
805
  "label.measured-lighting-ratio": "Lighting ratio",
806
806
  "text.measured-in-3d": "Measured in the 3D view.",
807
- "button.measure-again": "Measure Again"
807
+ "button.measure-again": "Measure Again",
808
+ "label.space composition": "Space composition",
809
+ "label.camera pivot at cursor": "Turn about the cursor",
810
+ "label.auto panels": "Automatic information panels",
811
+ "label.space detail": "Draw small spaces as boxes",
812
+ "label.auto panel": "Information panel",
813
+ "label.auto panel show": "Show",
814
+ "label.auto panel by type": "As the board sets for its type",
815
+ "label.auto panel on": "Show",
816
+ "label.auto panel off": "Do not show",
817
+ "label.auto panel priority": "Priority"
808
818
  }
@@ -828,5 +828,15 @@
828
828
  "label.measured-clipped": "흰색 잘림",
829
829
  "label.measured-lighting-ratio": "조명비",
830
830
  "text.measured-in-3d": "3D 화면에서 측정할 수 있습니다.",
831
- "button.measure-again": "다시 측정"
831
+ "button.measure-again": "다시 측정",
832
+ "label.space composition": "공간 합성",
833
+ "label.camera pivot at cursor": "커서 기준 조작",
834
+ "label.auto panels": "자동 정보 패널",
835
+ "label.space detail": "작게 보이는 공간 간략 표시",
836
+ "label.auto panel": "정보 패널",
837
+ "label.auto panel show": "표시",
838
+ "label.auto panel by type": "보드의 유형별 설정 따름",
839
+ "label.auto panel on": "표시",
840
+ "label.auto panel off": "표시 안 함",
841
+ "label.auto panel priority": "우선순위"
832
842
  }