@things-factory/figure-viewer 10.1.312 → 10.1.314

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.
@@ -0,0 +1,22 @@
1
+ /** What a loss is told with. */
2
+ export interface ContextLossFacts {
3
+ /** Which view: the modeller's edit canvas, its preview, the catalog's preview, ... */
4
+ where: string;
5
+ /** The GPU as the browser names it, when it says. */
6
+ gpu?: string;
7
+ /** The screen's scale (devicePixelRatio). */
8
+ scale: number;
9
+ /** The drawing buffer, in device pixels. */
10
+ width: number;
11
+ height: number;
12
+ /** The 3D views standing in this page when it was lost, itself included. */
13
+ standing: number;
14
+ /** Whether the tab was in view. */
15
+ visible: boolean;
16
+ }
17
+ export type Say = (key: string, params?: Record<string, unknown>) => string;
18
+ /** The record's title and its line of facts. */
19
+ export declare function contextLossWords(facts: ContextLossFacts, say: Say): {
20
+ message: string;
21
+ detail: string;
22
+ };
@@ -0,0 +1,14 @@
1
+ /** The record's title and its line of facts. */
2
+ export function contextLossWords(facts, say) {
3
+ return {
4
+ message: say('figure.text.context-lost', { where: say(`figure.label.view-${facts.where}`) }),
5
+ detail: say('figure.text.context-lost-facts', {
6
+ gpu: facts.gpu || say('figure.text.context-lost-gpu-unknown'),
7
+ scale: Math.round(facts.scale * 100) / 100,
8
+ size: `${facts.width}×${facts.height}`,
9
+ standing: facts.standing,
10
+ shown: say(facts.visible ? 'figure.text.context-lost-shown' : 'figure.text.context-lost-hidden')
11
+ })
12
+ };
13
+ }
14
+ //# sourceMappingURL=context-loss-words.js.map
@@ -0,0 +1,9 @@
1
+ export { contextLossWords, type ContextLossFacts } from './context-loss-words.js';
2
+ /** A things-scene scene's 3D canvas: its renderer's, none before the 3D view stands. */
3
+ export declare function sceneCanvasOf(scene: unknown): HTMLCanvasElement | undefined;
4
+ /**
5
+ * Watches a view's 3D canvas, `canvasOf()` -- the scene's renderer canvas (`scene.root.renderer3d.domElement`), or
6
+ * none while there is no scene -- following it under `root` (the view's own root) as the scene is made again. Returns
7
+ * the stop.
8
+ */
9
+ export declare function watchContextLoss(root: ParentNode & Node, where: string, canvasOf: () => HTMLCanvasElement | undefined): () => void;
@@ -0,0 +1,97 @@
1
+ /*
2
+ * A 3D view whose WebGL context the browser takes back flashes while it is made again (2026-11-26: frequent on Windows,
3
+ * where Chrome draws WebGL through Direct3D and the driver resets a context under memory or time pressure). Each loss
4
+ * is kept in the screen's error record, quietly -- the person saw the flash -- with what the machine was: the GPU, the
5
+ * screen's scale, the drawing's size, how many 3D views were standing, whether the tab was in view. The record stays in
6
+ * the person's browser; it is read there (the bell's 오류 tab) or sent with an inquiry.
7
+ *
8
+ * Only the scene's 3D canvas is watched, handed over by the view. The first version watched every canvas under the view
9
+ * and asked each for a WebGL context to read the GPU's name: the scene's 2D overlays take their context only when
10
+ * first drawn, so the asking made each of them a WebGL context of its own -- two more contexts per view toward the
11
+ * browser's limit, the flash this records, and overlays that could never draw in 2D again (2026-11-26) -- and counted
12
+ * three views for every one.
13
+ */
14
+ import { i18next } from '@operato/i18n';
15
+ import { contextLossWords } from './context-loss-words.js';
16
+ export { contextLossWords } from './context-loss-words.js';
17
+ /* The 3D canvases watched in this page and whether each still holds its context. */
18
+ const watched = new Map();
19
+ const standing = () => [...watched].filter(([canvas, one]) => canvas.isConnected && !one.lost).length;
20
+ /**
21
+ * The GPU's name, read from the 3D canvas's own context. Asked of a canvas that already holds a WebGL2 context, the
22
+ * browser hands that one back; it is never asked of any other canvas, where asking would make one.
23
+ */
24
+ function gpuOf(canvas) {
25
+ try {
26
+ const gl = canvas.getContext('webgl2');
27
+ if (!gl || gl.isContextLost())
28
+ return undefined;
29
+ const info = gl.getExtension('WEBGL_debug_renderer_info');
30
+ return String(info ? gl.getParameter(info.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER)) || undefined;
31
+ }
32
+ catch {
33
+ return undefined;
34
+ }
35
+ }
36
+ function watch(canvas, where, mine) {
37
+ if (watched.has(canvas))
38
+ return;
39
+ mine.add(canvas);
40
+ const one = { lost: false, gpu: gpuOf(canvas) };
41
+ watched.set(canvas, one);
42
+ canvas.addEventListener('webglcontextlost', () => {
43
+ const facts = {
44
+ where,
45
+ gpu: one.gpu,
46
+ scale: window.devicePixelRatio || 1,
47
+ width: canvas.width,
48
+ height: canvas.height,
49
+ standing: standing(),
50
+ visible: document.visibilityState === 'visible'
51
+ };
52
+ one.lost = true;
53
+ /* A view taken down drops its own context on purpose: that is not a loss to tell. */
54
+ if (one.ended || !canvas.isConnected)
55
+ return;
56
+ const say = (key, params) => String(i18next.t(key, params));
57
+ document.dispatchEvent(new CustomEvent('record-error', { detail: contextLossWords(facts, say) }));
58
+ });
59
+ canvas.addEventListener('webglcontextrestored', () => (one.lost = false));
60
+ }
61
+ /** A things-scene scene's 3D canvas: its renderer's, none before the 3D view stands. */
62
+ export function sceneCanvasOf(scene) {
63
+ return scene?.root?.renderer3d?.domElement;
64
+ }
65
+ /**
66
+ * Watches a view's 3D canvas, `canvasOf()` -- the scene's renderer canvas (`scene.root.renderer3d.domElement`), or
67
+ * none while there is no scene -- following it under `root` (the view's own root) as the scene is made again. Returns
68
+ * the stop.
69
+ */
70
+ export function watchContextLoss(root, where, canvasOf) {
71
+ const mine = new Set();
72
+ const look = () => {
73
+ const canvas = canvasOf();
74
+ if (canvas?.isConnected)
75
+ watch(canvas, where, mine);
76
+ /* A canvas the scene took away was taken down with its context: its loss, coming after, is not told. */
77
+ for (const one of mine)
78
+ if (!one.isConnected)
79
+ end(one, mine);
80
+ };
81
+ look();
82
+ const observer = new MutationObserver(look);
83
+ observer.observe(root, { childList: true, subtree: true });
84
+ return () => {
85
+ observer.disconnect();
86
+ for (const canvas of mine)
87
+ end(canvas, mine);
88
+ };
89
+ }
90
+ function end(canvas, mine) {
91
+ const one = watched.get(canvas);
92
+ if (one)
93
+ one.ended = true;
94
+ watched.delete(canvas);
95
+ mine.delete(canvas);
96
+ }
97
+ //# sourceMappingURL=context-loss.js.map
@@ -40,6 +40,7 @@ export declare class FigureAssetViewer extends FigureAssetViewer_base {
40
40
  private board;
41
41
  connectedCallback(): void;
42
42
  protected updated(changed: PropertyValues): void;
43
+ private lossWatch?;
43
44
  firstUpdated(): void;
44
45
  disconnectedCallback(): void;
45
46
  render(): import("lit-html").TemplateResult<1>;
@@ -3,12 +3,13 @@ import '@material/web/icon/icon.js';
3
3
  import { css, html, LitElement, nothing } from 'lit';
4
4
  import { customElement, property, query, state } from 'lit/decorators.js';
5
5
  import { i18next, localize } from '@operato/i18n';
6
+ import { sceneCanvasOf, watchContextLoss } from './context-loss.js';
6
7
  import { ScrollbarStyles } from '@operato/styles';
7
8
  import { SurfaceStyles } from '@things-factory/styles';
8
9
  import { compileFigureAsset, figureDataExample } from '@hatiolab/figure-model';
9
10
  import { create, registerFigure, unregisterFigure } from '@hatiolab/things-scene';
10
11
  import { authoredSizeOf, bodyAtSize, previewOneInstance, sizeSpanOf, sizeWithinRange } from './preview-model.js';
11
- import { DEFAULT_VIEW, previewBoardDepth, sceneLook } from './figure-view.js';
12
+ import { DEFAULT_VIEW, figurePixelRatio, previewBoardDepth, sceneLook } from './figure-view.js';
12
13
  import { SidePanelStyles } from './side-panel-styles.js';
13
14
  import './figure-motion-controls.js';
14
15
  import { followTravelFloor, PREVIEW_CLIP_TRAVEL } from './travel-floor.js';
@@ -119,21 +120,35 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
119
120
  this.needsScene = true;
120
121
  if (this.hasUpdated)
121
122
  this.observer?.observe(this.stage);
123
+ if (this.hasUpdated && !this.lossWatch)
124
+ this.lossWatch = watchContextLoss(this.renderRoot, 'viewer', () => sceneCanvasOf(this.scene));
122
125
  this.requestUpdate();
123
126
  }
124
127
  updated(changed) {
125
128
  // Reconnection and a new asset can arrive in the same update. Build exactly once.
126
- if (changed.has('asset') || this.needsScene) {
127
- this.needsScene = false;
128
- this.standUp();
129
- }
129
+ if (changed.has('asset'))
130
+ this.needsScene = true;
131
+ /*
132
+ Not while off the page: Lit still runs an update queued before the element was taken off, and a scene built then
133
+ is never disposed -- disconnectedCallback has already run. The catalogue's detail dock did this on every reopen:
134
+ the viewer left in it reconnected, was taken off again by the dock's next render, and its queued update stood up a
135
+ scene on a detached stage, a WebGL context and a drawing buffer of tens of megapixels kept for good. Connected
136
+ again, it builds then.
137
+ */
138
+ if (!this.needsScene || !this.isConnected)
139
+ return;
140
+ this.needsScene = false;
141
+ this.standUp();
130
142
  }
131
143
  firstUpdated() {
144
+ this.lossWatch = watchContextLoss(this.renderRoot, 'viewer', () => sceneCanvasOf(this.scene));
132
145
  this.observer = new ResizeObserver(() => this.scene?.resize?.());
133
146
  this.observer.observe(this.stage);
134
147
  }
135
148
  disconnectedCallback() {
136
149
  super.disconnectedCallback();
150
+ this.lossWatch?.();
151
+ this.lossWatch = undefined;
137
152
  this.observer?.disconnect();
138
153
  this.teardown();
139
154
  }
@@ -370,7 +385,7 @@ let FigureAssetViewer = class FigureAssetViewer extends localize(i18next)(LitEle
370
385
  depth: previewBoardDepth({ placement: asset.placement, base: { y: size.y } }, DEFAULT_VIEW.ceilingHeight, 1),
371
386
  threed: true, sky: 'color', ...sceneLook(DEFAULT_VIEW),
372
387
  placement: DEFAULT_VIEW.placement, heights: { floor: 0, ceiling: DEFAULT_VIEW.ceilingHeight },
373
- pixelRatio: Math.min(3, (window.devicePixelRatio || 1) * 2),
388
+ pixelRatio: figurePixelRatio(),
374
389
  components
375
390
  } });
376
391
  this.centre();
@@ -90,6 +90,17 @@ export declare function sceneLook(view: ViewSettings): Record<string, unknown>;
90
90
  * (inverted)」.
91
91
  */
92
92
  export declare const SCENE_REFERENCES: readonly ["floor", "space", "inverted"];
93
+ /**
94
+ * How many device pixels a 3D view draws a CSS pixel with: the screen's own, at most 2 (2026-11-26).
95
+ *
96
+ * The views drew at twice the screen's scale (09-06, smoother silhouettes): 4x the pixels at 100 %, 9x at 150 %, and
97
+ * the post-processing targets with them. That load is what Chrome on Windows, drawing WebGL through Direct3D, answers
98
+ * by taking the context back -- the view flashes as it is made again. The screen's own scale with MSAA keeps edges
99
+ * close to it. The cap is 2, not 1.5: at 1.5 a Retina screen (2) was drawn below its own pixels and stretched, lines and
100
+ * the grid's labels soft, for nothing the Windows screens (1, 1.25, 1.5) gain; a 3-scale phone stays at 2.
101
+ */
102
+ export declare const FIGURE_PIXEL_RATIO_CAP = 2;
103
+ export declare function figurePixelRatio(deviceScale?: number): number;
93
104
  /** 배경색 기본값. 회색이라 부품 색이 제 색으로 보인다. */
94
105
  export declare const WORKBENCH = "#7c7c7c";
95
106
  /**
@@ -38,6 +38,19 @@ export function sceneLook(view) {
38
38
  * (inverted)」.
39
39
  */
40
40
  export const SCENE_REFERENCES = ['floor', 'space', 'inverted'];
41
+ /**
42
+ * How many device pixels a 3D view draws a CSS pixel with: the screen's own, at most 2 (2026-11-26).
43
+ *
44
+ * The views drew at twice the screen's scale (09-06, smoother silhouettes): 4x the pixels at 100 %, 9x at 150 %, and
45
+ * the post-processing targets with them. That load is what Chrome on Windows, drawing WebGL through Direct3D, answers
46
+ * by taking the context back -- the view flashes as it is made again. The screen's own scale with MSAA keeps edges
47
+ * close to it. The cap is 2, not 1.5: at 1.5 a Retina screen (2) was drawn below its own pixels and stretched, lines and
48
+ * the grid's labels soft, for nothing the Windows screens (1, 1.25, 1.5) gain; a 3-scale phone stays at 2.
49
+ */
50
+ export const FIGURE_PIXEL_RATIO_CAP = 2;
51
+ export function figurePixelRatio(deviceScale = typeof window === 'undefined' ? 1 : window.devicePixelRatio || 1) {
52
+ return Math.min(FIGURE_PIXEL_RATIO_CAP, deviceScale > 0 ? deviceScale : 1);
53
+ }
41
54
  /** 배경색 기본값. 회색이라 부품 색이 제 색으로 보인다. */
42
55
  export const WORKBENCH = '#7c7c7c';
43
56
  /**
@@ -0,0 +1,61 @@
1
+ import type { TemplateResult } from 'lit';
2
+ /** The connection as the window may see it: never the key. */
3
+ export interface FigureSourceConnection {
4
+ url?: string | null;
5
+ domain?: string | null;
6
+ tokenSet: boolean;
7
+ /** The key as the framework shows a secret: enough to tell which it is. */
8
+ tokenHint?: string | null;
9
+ }
10
+ /** One figure of the figure server's catalog, as its latest release. */
11
+ export interface FigureSourceItem {
12
+ figureId: string;
13
+ fullName: string;
14
+ ref: string;
15
+ version: number;
16
+ name?: string | null;
17
+ names?: Record<string, string> | null;
18
+ deprecated?: boolean;
19
+ thumbnailHash?: string | null;
20
+ }
21
+ export type FigureSourceTone = 'plain' | 'warn' | 'crit' | 'muted';
22
+ export interface FigureSourceAdapter<Item extends FigureSourceItem = FigureSourceItem, Result = unknown> {
23
+ readConnection(): Promise<FigureSourceConnection>;
24
+ saveConnection(patch: {
25
+ url?: string;
26
+ domain?: string;
27
+ token?: string;
28
+ }): Promise<FigureSourceConnection>;
29
+ /** Asks the figure server with the saved connection: ok and how many figures, or what to fix. */
30
+ checkConnection(): Promise<{
31
+ ok: boolean;
32
+ total?: number | null;
33
+ message?: string | null;
34
+ }>;
35
+ catalog(params: {
36
+ search: string | null;
37
+ page: number;
38
+ limit: number;
39
+ }): Promise<{
40
+ items: Item[];
41
+ total: number;
42
+ }>;
43
+ install(items: Item[]): Promise<Result>;
44
+ /** The picture's address on this server (the key never reaches the browser), or null. */
45
+ thumbnailUrl(item: Item): string | null;
46
+ /** What this server holds of the figure: the chip's words and how loud it is. */
47
+ status(item: Item): {
48
+ label: string;
49
+ tone: FigureSourceTone;
50
+ };
51
+ /** The line under the name: its version, and this server's when it differs. */
52
+ version(item: Item): string;
53
+ /** The install button's words: a board server installs, a figure server takes in. The board's words when left out. */
54
+ installLabel?(count: number): string;
55
+ /** What became of the install, in the app's words. */
56
+ renderResult(result: Result): TemplateResult;
57
+ /** Whether the install changed what this server holds -- the opener reads itself again then. */
58
+ changed(result: Result): boolean;
59
+ /** A line under the connection card (the board server says where its capability module stands). */
60
+ renderConnectionNote?(connection: FigureSourceConnection): TemplateResult | undefined;
61
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=source-adapter.js.map
@@ -0,0 +1,26 @@
1
+ import '@material/web/button/outlined-button.js';
2
+ import '@material/web/button/text-button.js';
3
+ import '@things-factory/setting-base';
4
+ import { LitElement, nothing } from 'lit';
5
+ import type { FigureSourceAdapter } from './source-adapter.js';
6
+ declare const FigureSourceConnectionCard_base: (new (...args: any[]) => LitElement) & typeof LitElement;
7
+ /**
8
+ * 「피규어 서버 연결」 (ADR-0114 decision 21, ADR-0231) - the figure server figures are taken from: its address, the
9
+ * domain on it and the key it issued. The key is never read back - the card says whether it is set, and a new one
10
+ * replaces it. What it reads and writes is the opener's (`adapter`): a board server's library, or a figure server.
11
+ */
12
+ export declare class FigureSourceConnectionCard extends FigureSourceConnectionCard_base {
13
+ static styles: import("lit").CSSResult[];
14
+ adapter?: FigureSourceAdapter<any, any>;
15
+ private setting?;
16
+ private draft;
17
+ private busy;
18
+ private checking;
19
+ private checked?;
20
+ connectedCallback(): Promise<void>;
21
+ private read;
22
+ render(): typeof nothing | import("lit-html").TemplateResult<1>;
23
+ private check;
24
+ private save;
25
+ }
26
+ export {};
@@ -0,0 +1,217 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/button/outlined-button.js';
3
+ import '@material/web/button/text-button.js';
4
+ import '@things-factory/setting-base';
5
+ import { css, html, LitElement, nothing } from 'lit';
6
+ import { customElement, property, state } from 'lit/decorators.js';
7
+ import { i18next, localize } from '@operato/i18n';
8
+ import { notify } from '@operato/layout';
9
+ import { FieldHintStyles } from '@operato/styles';
10
+ /**
11
+ * 「피규어 서버 연결」 (ADR-0114 decision 21, ADR-0231) - the figure server figures are taken from: its address, the
12
+ * domain on it and the key it issued. The key is never read back - the card says whether it is set, and a new one
13
+ * replaces it. What it reads and writes is the opener's (`adapter`): a board server's library, or a figure server.
14
+ */
15
+ let FigureSourceConnectionCard = class FigureSourceConnectionCard extends localize(i18next)(LitElement) {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.draft = {};
19
+ this.busy = false;
20
+ this.checking = false;
21
+ }
22
+ static { this.styles = [
23
+ FieldHintStyles,
24
+ css `
25
+ div[content] {
26
+ display: grid;
27
+ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
28
+ align-items: start;
29
+ gap: var(--spacing-medium, 8px) var(--spacing-large, 12px);
30
+ }
31
+ @media (max-width: 600px) {
32
+ div[content] {
33
+ grid-template-columns: minmax(0, 1fr);
34
+ }
35
+ }
36
+ label {
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: var(--spacing-small, 4px);
40
+ font: var(--label-font);
41
+ color: var(--md-sys-color-on-surface);
42
+ text-transform: var(--label-text-transform);
43
+ }
44
+ label.wide {
45
+ grid-column: 1 / -1;
46
+ }
47
+ input {
48
+ box-sizing: border-box;
49
+ width: 100%;
50
+ height: var(--form-element-height-medium, 32px);
51
+ background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
52
+ color: var(--input-field-color, var(--md-sys-color-on-surface));
53
+ border: var(--border-dim-color);
54
+ border-radius: var(--border-radius);
55
+ padding: var(--input-padding);
56
+ font: var(--input-font);
57
+ text-transform: none;
58
+ }
59
+ div[actions] {
60
+ grid-column: 1 / -1;
61
+ display: flex;
62
+ justify-content: flex-end;
63
+ align-items: center;
64
+ gap: var(--spacing-small, 4px);
65
+ }
66
+ [checked] {
67
+ margin-right: auto;
68
+ font-size: var(--ui-t-small, 11.5px);
69
+ }
70
+ small[missing] {
71
+ color: var(--ui-warn, #b26b00);
72
+ }
73
+ [checked][failed] {
74
+ color: var(--ui-crit, var(--md-sys-color-error));
75
+ }
76
+ [note] {
77
+ grid-column: 1 / -1;
78
+ }
79
+ `
80
+ ]; }
81
+ async connectedCallback() {
82
+ super.connectedCallback();
83
+ await this.read();
84
+ }
85
+ async read() {
86
+ try {
87
+ this.setting = (await this.adapter?.readConnection()) ?? { tokenSet: false };
88
+ }
89
+ catch {
90
+ this.setting = { tokenSet: false };
91
+ }
92
+ }
93
+ render() {
94
+ const setting = this.setting;
95
+ if (!setting)
96
+ return nothing;
97
+ const busy = this.busy;
98
+ const value = (name) => this.draft[name] ?? setting[name] ?? '';
99
+ /* Once any part is saved, a part still empty says the connection waits for it - an example is not a value. */
100
+ const begun = !!(setting.url || setting.domain || setting.tokenSet);
101
+ const missing = (name) => (begun && !setting[name] ? html `<small class="hint" missing>${i18next.t('figure.text.source-missing')}</small>` : nothing);
102
+ const set = (name, text) => (this.draft = { ...this.draft, [name]: text });
103
+ const note = this.adapter?.renderConnectionNote?.(setting);
104
+ return html `
105
+ <setting-let>
106
+ <span slot="title">${i18next.t('figure.title.source-connection')}</span>
107
+ <div slot="content" content>
108
+ <label
109
+ >${i18next.t('figure.label.source-url')}
110
+ <input
111
+ type="url"
112
+ autocomplete="off"
113
+ placeholder=${i18next.t('figure.text.source-example', { value: 'https://figure.hatiolab.com' })}
114
+ .value=${value('url')}
115
+ ?disabled=${busy}
116
+ @input=${(e) => set('url', e.target.value)}
117
+ />${missing('url')}</label
118
+ >
119
+ <label
120
+ >${i18next.t('figure.label.source-domain')}
121
+ <input
122
+ autocomplete="off"
123
+ placeholder=${i18next.t('figure.text.source-example', { value: 'system' })}
124
+ .value=${value('domain')}
125
+ ?disabled=${busy}
126
+ @input=${(e) => set('domain', e.target.value)}
127
+ />${missing('domain')}</label
128
+ >
129
+ <label class="wide"
130
+ >${i18next.t('figure.label.source-token')}
131
+ <input type="password" autocomplete="off" .value=${this.draft.token ?? ''} ?disabled=${busy} @input=${(e) => set('token', e.target.value)} />
132
+ <small class="hint"
133
+ >${setting.tokenSet ? i18next.t('figure.text.source-token-set', { hint: setting.tokenHint ?? '' }) : i18next.t('figure.text.source-token-unset')}</small
134
+ ></label
135
+ >
136
+ ${note ? html `<div note>${note}</div>` : nothing}
137
+ <div actions>
138
+ ${this.checked ? html `<span checked ?failed=${!this.checked.ok} role="status">${this.checked.text}</span>` : nothing}
139
+ <md-text-button ?disabled=${busy || this.checking || !setting.url || !setting.tokenSet} @click=${() => this.check()}
140
+ >${i18next.t('figure.button.source-check')}</md-text-button
141
+ >
142
+ <md-outlined-button ?disabled=${busy || !Object.keys(this.draft).length} @click=${() => this.save()}>${i18next.t('figure.button.source-save')}</md-outlined-button>
143
+ </div>
144
+ </div>
145
+ </setting-let>
146
+ `;
147
+ }
148
+ /* One catalog row asked with the saved setting: the answer says what to fix. */
149
+ async check() {
150
+ if (!this.adapter)
151
+ return;
152
+ this.checking = true;
153
+ this.checked = undefined;
154
+ try {
155
+ const answer = await this.adapter.checkConnection();
156
+ await this.read();
157
+ this.checked = answer.ok
158
+ ? { ok: true, text: i18next.t('figure.text.source-check-ok', { count: answer.total ?? 0 }) }
159
+ : { ok: false, text: answer.message ?? '' };
160
+ }
161
+ catch (e) {
162
+ this.checked = { ok: false, text: e?.message ?? String(e) };
163
+ }
164
+ finally {
165
+ this.checking = false;
166
+ }
167
+ }
168
+ async save() {
169
+ if (!this.adapter)
170
+ return;
171
+ /* A key left blank stays as it is - the card never holds the key it read. */
172
+ const { token, ...rest } = this.draft;
173
+ this.busy = true;
174
+ try {
175
+ this.setting = await this.adapter.saveConnection({ ...rest, ...(token?.trim() ? { token } : {}) });
176
+ this.draft = {};
177
+ this.checked = undefined;
178
+ notify({ message: i18next.t('figure.text.source-saved') });
179
+ this.dispatchEvent(new CustomEvent('saved', { bubbles: true, composed: true }));
180
+ }
181
+ catch (e) {
182
+ notify({ level: 'error', message: e?.message ?? String(e) });
183
+ }
184
+ finally {
185
+ this.busy = false;
186
+ }
187
+ }
188
+ };
189
+ __decorate([
190
+ property({ attribute: false }),
191
+ __metadata("design:type", Object)
192
+ ], FigureSourceConnectionCard.prototype, "adapter", void 0);
193
+ __decorate([
194
+ state(),
195
+ __metadata("design:type", Object)
196
+ ], FigureSourceConnectionCard.prototype, "setting", void 0);
197
+ __decorate([
198
+ state(),
199
+ __metadata("design:type", Object)
200
+ ], FigureSourceConnectionCard.prototype, "draft", void 0);
201
+ __decorate([
202
+ state(),
203
+ __metadata("design:type", Object)
204
+ ], FigureSourceConnectionCard.prototype, "busy", void 0);
205
+ __decorate([
206
+ state(),
207
+ __metadata("design:type", Object)
208
+ ], FigureSourceConnectionCard.prototype, "checking", void 0);
209
+ __decorate([
210
+ state(),
211
+ __metadata("design:type", Object)
212
+ ], FigureSourceConnectionCard.prototype, "checked", void 0);
213
+ FigureSourceConnectionCard = __decorate([
214
+ customElement('figure-source-connection')
215
+ ], FigureSourceConnectionCard);
216
+ export { FigureSourceConnectionCard };
217
+ //# sourceMappingURL=source-connection.js.map
@@ -0,0 +1,38 @@
1
+ import '@material/web/button/text-button.js';
2
+ import '@material/web/button/filled-button.js';
3
+ import '@operato/popup/ox-popup-actions.js';
4
+ import './source-connection.js';
5
+ import { LitElement } from 'lit';
6
+ import type { FigureSourceAdapter } from './source-adapter.js';
7
+ declare const FigureSourceInstall_base: (new (...args: any[]) => LitElement) & typeof LitElement;
8
+ export declare class FigureSourceInstall extends FigureSourceInstall_base {
9
+ static styles: import("lit").CSSResult[];
10
+ adapter?: FigureSourceAdapter<any, any>;
11
+ /** The window keeps the connection (no Settings card for it in this app). */
12
+ holdsConnection: boolean;
13
+ private search;
14
+ private items;
15
+ private total;
16
+ private reading;
17
+ private installing;
18
+ private failure;
19
+ private chosen;
20
+ private result?;
21
+ private source?;
22
+ private connecting;
23
+ connectedCallback(): void;
24
+ private get connected();
25
+ private readSource;
26
+ private renderConnection;
27
+ render(): import("lit-html").TemplateResult<1>;
28
+ private renderItem;
29
+ private choose;
30
+ private read;
31
+ private install;
32
+ }
33
+ declare global {
34
+ interface HTMLElementTagNameMap {
35
+ 'figure-source-install': FigureSourceInstall;
36
+ }
37
+ }
38
+ export {};
@@ -0,0 +1,332 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@material/web/button/text-button.js';
3
+ import '@material/web/button/filled-button.js';
4
+ import '@operato/popup/ox-popup-actions.js';
5
+ import './source-connection.js';
6
+ import { css, html, LitElement, nothing } from 'lit';
7
+ import { customElement, property, state } from 'lit/decorators.js';
8
+ import { i18next, localize } from '@operato/i18n';
9
+ import { CommonPopupStyles, FormFieldStyles, PopupBodyStyles, PopupFieldStyles } from '@operato/styles';
10
+ /** How many figures one read brings; 「더 보기」 reads the next. */
11
+ const PAGE = 50;
12
+ /*
13
+ * Taking figures from a figure server (ADR-0114 amendment 2026-11-14, ADR-0231): its catalog, the pictures and the
14
+ * install are the opener's doors (`adapter`), so the browser never talks to the figure server. One window for a board
15
+ * server installing into its library and a figure server taking figures in as its own.
16
+ *
17
+ * `holdsConnection`: an app with no Settings card for it keeps the connection here -- the connection card while none is
18
+ * set, and the server it takes from with 「연결 바꾸기」 once it is.
19
+ */
20
+ let FigureSourceInstall = class FigureSourceInstall extends localize(i18next)(LitElement) {
21
+ constructor() {
22
+ super(...arguments);
23
+ /** The window keeps the connection (no Settings card for it in this app). */
24
+ this.holdsConnection = false;
25
+ this.search = '';
26
+ this.items = [];
27
+ this.total = 0;
28
+ this.reading = false;
29
+ this.installing = false;
30
+ this.failure = '';
31
+ this.chosen = new Set();
32
+ this.connecting = false;
33
+ }
34
+ static { this.styles = [
35
+ CommonPopupStyles,
36
+ PopupBodyStyles,
37
+ FormFieldStyles,
38
+ PopupFieldStyles,
39
+ css `
40
+ ul[figures] {
41
+ list-style: none;
42
+ margin: 0;
43
+ padding: 0;
44
+ display: flex;
45
+ flex-direction: column;
46
+ }
47
+ ul[figures] li {
48
+ display: grid;
49
+ grid-template-columns: auto 48px minmax(0, 1fr) auto;
50
+ align-items: center;
51
+ gap: var(--spacing-medium, 8px);
52
+ padding: var(--spacing-small, 4px) 0;
53
+ border-bottom: 1px solid var(--ui-line-soft, var(--md-sys-color-surface-container));
54
+ }
55
+ [thumb] {
56
+ width: 48px;
57
+ height: 36px;
58
+ object-fit: contain;
59
+ border-radius: var(--border-radius, 4px);
60
+ background: var(--ui-line-soft, var(--md-sys-color-surface-container));
61
+ }
62
+ [title] {
63
+ display: flex;
64
+ flex-direction: column;
65
+ min-width: 0;
66
+ }
67
+ [title] strong,
68
+ [title] small {
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ }
73
+ [title] small {
74
+ color: var(--ui-muted);
75
+ font-family: var(--ui-mono, monospace);
76
+ font-size: var(--ui-t-small, 11.5px);
77
+ }
78
+ [chips] {
79
+ display: flex;
80
+ gap: var(--spacing-small, 4px);
81
+ justify-content: flex-end;
82
+ flex-wrap: wrap;
83
+ }
84
+ [chip] {
85
+ padding: 1px 6px;
86
+ border-radius: 999px;
87
+ font-size: var(--ui-t-small, 11.5px);
88
+ white-space: nowrap;
89
+ border: 1px solid currentColor;
90
+ }
91
+ [chip='plain'] {
92
+ color: var(--ui-ink, var(--md-sys-color-on-surface));
93
+ }
94
+ [chip='muted'] {
95
+ color: var(--ui-muted);
96
+ }
97
+ [chip='warn'] {
98
+ color: var(--ui-warn, #b26b00);
99
+ }
100
+ [chip='crit'] {
101
+ color: var(--ui-crit, var(--md-sys-color-error));
102
+ }
103
+ [refused] {
104
+ color: var(--ui-crit, var(--md-sys-color-error));
105
+ margin: 0;
106
+ }
107
+ [more] {
108
+ align-self: center;
109
+ }
110
+ [connection] {
111
+ display: flex;
112
+ align-items: center;
113
+ gap: var(--spacing-small, 4px);
114
+ color: var(--ui-muted);
115
+ font-size: var(--ui-t-small, 11.5px);
116
+ }
117
+ [connection] md-text-button {
118
+ margin-left: auto;
119
+ }
120
+ `
121
+ ]; }
122
+ connectedCallback() {
123
+ super.connectedCallback();
124
+ this.holdsConnection ? this.readSource() : this.read(true);
125
+ }
126
+ get connected() {
127
+ return !!(this.source?.url && this.source?.domain && this.source?.tokenSet);
128
+ }
129
+ /* The connection this window holds: the catalog is read once it is complete. */
130
+ async readSource() {
131
+ try {
132
+ this.source = (await this.adapter?.readConnection()) ?? { tokenSet: false };
133
+ }
134
+ catch {
135
+ this.source = { tokenSet: false };
136
+ }
137
+ this.connecting = !this.connected;
138
+ if (this.connected)
139
+ await this.read(true);
140
+ }
141
+ renderConnection() {
142
+ if (!this.holdsConnection || !this.source)
143
+ return nothing;
144
+ const host = this.source.url ? this.source.url.replace(/^https?:\/\//, '') : '';
145
+ return html `
146
+ ${this.connected
147
+ ? html `<div connection>
148
+ <span>${host} · ${this.source.domain}</span>
149
+ <md-text-button @click=${() => (this.connecting = !this.connecting)}>${i18next.t('figure.button.source-change')}</md-text-button>
150
+ </div>`
151
+ : nothing}
152
+ ${this.connecting
153
+ ? html `<figure-source-connection
154
+ .adapter=${this.adapter}
155
+ @saved=${(e) => {
156
+ e.stopPropagation();
157
+ this.readSource();
158
+ }}
159
+ ></figure-source-connection>`
160
+ : nothing}
161
+ `;
162
+ }
163
+ render() {
164
+ const count = this.chosen.size;
165
+ if (this.holdsConnection && !this.connected) {
166
+ return html `
167
+ <div class="body">${this.renderConnection()}</div>
168
+ <ox-popup-actions>
169
+ <md-text-button slot="cancel" @click=${() => this.dispatchEvent(new CustomEvent('close'))}>${i18next.t('figure.button.source-close')}</md-text-button>
170
+ </ox-popup-actions>
171
+ `;
172
+ }
173
+ return html `
174
+ <div class="body">
175
+ ${this.renderConnection()}
176
+ <label class="field">
177
+ <span>${i18next.t('figure.label.source-search')}</span>
178
+ <input
179
+ type="search"
180
+ .value=${this.search}
181
+ placeholder=${i18next.t('figure.text.source-search')}
182
+ @change=${(e) => {
183
+ this.search = e.target.value.trim();
184
+ this.read(true);
185
+ }}
186
+ />
187
+ </label>
188
+
189
+ ${this.failure ? html `<p refused role="alert">${this.failure}</p>` : nothing}
190
+ ${!this.failure && !this.reading && !this.items.length ? html `<div class="note">${i18next.t('figure.text.source-empty')}</div>` : nothing}
191
+
192
+ <ul figures>
193
+ ${this.items.map(item => this.renderItem(item))}
194
+ </ul>
195
+ ${this.items.length < this.total
196
+ ? html `<md-text-button more ?disabled=${this.reading} @click=${() => this.read(false)}>${i18next.t('figure.button.source-more')}</md-text-button>`
197
+ : nothing}
198
+
199
+ ${this.result !== undefined && this.adapter ? this.adapter.renderResult(this.result) : nothing}
200
+ </div>
201
+
202
+ <ox-popup-actions>
203
+ <md-text-button slot="cancel" @click=${() => this.dispatchEvent(new CustomEvent('close'))}>${i18next.t('figure.button.source-close')}</md-text-button>
204
+ <md-filled-button slot="confirm" ?disabled=${!count || this.installing} @click=${() => this.install()}>
205
+ ${this.adapter?.installLabel ? this.adapter.installLabel(count) : i18next.t('figure.button.source-install', { count })}
206
+ </md-filled-button>
207
+ </ox-popup-actions>
208
+ `;
209
+ }
210
+ renderItem(item) {
211
+ const adapter = this.adapter;
212
+ const name = item.names?.[i18next.language] ?? item.name ?? item.fullName;
213
+ const picture = item.thumbnailHash ? adapter.thumbnailUrl(item) : null;
214
+ const status = adapter.status(item);
215
+ return html `<li>
216
+ <input
217
+ type="checkbox"
218
+ aria-label=${name}
219
+ .checked=${this.chosen.has(item.ref)}
220
+ ?disabled=${this.installing}
221
+ @change=${(e) => this.choose(item.ref, e.target.checked)}
222
+ />
223
+ ${picture ? html `<img thumb src=${picture} alt="" loading="lazy" />` : html `<span thumb></span>`}
224
+ <span title>
225
+ <strong>${name}</strong>
226
+ <small>${item.fullName} · ${adapter.version(item)}</small>
227
+ </span>
228
+ <span chips>
229
+ ${item.deprecated ? html `<span chip="muted">${i18next.t('figure.text.source-deprecated')}</span>` : nothing}
230
+ <span chip=${status.tone}>${status.label}</span>
231
+ </span>
232
+ </li>`;
233
+ }
234
+ choose(ref, on) {
235
+ const next = new Set(this.chosen);
236
+ on ? next.add(ref) : next.delete(ref);
237
+ this.chosen = next;
238
+ }
239
+ async read(fresh) {
240
+ if (!this.adapter)
241
+ return;
242
+ this.reading = true;
243
+ this.failure = '';
244
+ const page = fresh ? 1 : Math.floor(this.items.length / PAGE) + 1;
245
+ try {
246
+ const { items, total } = await this.adapter.catalog({ search: this.search || null, page, limit: PAGE });
247
+ this.items = fresh ? items : [...this.items, ...items];
248
+ this.total = total;
249
+ }
250
+ catch (e) {
251
+ this.failure = e?.message ?? String(e);
252
+ if (fresh)
253
+ this.items = [];
254
+ }
255
+ finally {
256
+ this.reading = false;
257
+ }
258
+ }
259
+ async install() {
260
+ if (!this.adapter)
261
+ return;
262
+ this.installing = true;
263
+ this.result = undefined;
264
+ try {
265
+ const picked = this.items.filter(item => this.chosen.has(item.ref));
266
+ this.result = await this.adapter.install(picked);
267
+ this.chosen = new Set();
268
+ if (this.adapter.changed(this.result))
269
+ this.dispatchEvent(new CustomEvent('imported', { detail: this.result }));
270
+ await this.read(true);
271
+ }
272
+ catch (e) {
273
+ this.failure = e?.message ?? String(e);
274
+ }
275
+ finally {
276
+ this.installing = false;
277
+ }
278
+ }
279
+ };
280
+ __decorate([
281
+ property({ attribute: false }),
282
+ __metadata("design:type", Object)
283
+ ], FigureSourceInstall.prototype, "adapter", void 0);
284
+ __decorate([
285
+ property({ type: Boolean }),
286
+ __metadata("design:type", Object)
287
+ ], FigureSourceInstall.prototype, "holdsConnection", void 0);
288
+ __decorate([
289
+ state(),
290
+ __metadata("design:type", Object)
291
+ ], FigureSourceInstall.prototype, "search", void 0);
292
+ __decorate([
293
+ state(),
294
+ __metadata("design:type", Array)
295
+ ], FigureSourceInstall.prototype, "items", void 0);
296
+ __decorate([
297
+ state(),
298
+ __metadata("design:type", Object)
299
+ ], FigureSourceInstall.prototype, "total", void 0);
300
+ __decorate([
301
+ state(),
302
+ __metadata("design:type", Object)
303
+ ], FigureSourceInstall.prototype, "reading", void 0);
304
+ __decorate([
305
+ state(),
306
+ __metadata("design:type", Object)
307
+ ], FigureSourceInstall.prototype, "installing", void 0);
308
+ __decorate([
309
+ state(),
310
+ __metadata("design:type", Object)
311
+ ], FigureSourceInstall.prototype, "failure", void 0);
312
+ __decorate([
313
+ state(),
314
+ __metadata("design:type", Object)
315
+ ], FigureSourceInstall.prototype, "chosen", void 0);
316
+ __decorate([
317
+ state(),
318
+ __metadata("design:type", Object)
319
+ ], FigureSourceInstall.prototype, "result", void 0);
320
+ __decorate([
321
+ state(),
322
+ __metadata("design:type", Object)
323
+ ], FigureSourceInstall.prototype, "source", void 0);
324
+ __decorate([
325
+ state(),
326
+ __metadata("design:type", Object)
327
+ ], FigureSourceInstall.prototype, "connecting", void 0);
328
+ FigureSourceInstall = __decorate([
329
+ customElement('figure-source-install')
330
+ ], FigureSourceInstall);
331
+ export { FigureSourceInstall };
332
+ //# sourceMappingURL=source-install.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-viewer",
3
- "version": "10.1.312",
3
+ "version": "10.1.314",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "files": [
@@ -41,13 +41,16 @@
41
41
  "test": "FIGURE_FREEZE_COMPILED=1 node --import ./test/resolve-ts-siblings.mjs --test test/*.test.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@hatiolab/figure-model": "^0.12.29",
45
- "@hatiolab/things-scene": "^10.1.130",
44
+ "@hatiolab/figure-model": "^0.12.31",
45
+ "@hatiolab/things-scene": "^10.1.132",
46
46
  "@material/web": "^2.0.0",
47
47
  "@operato/i18n": "^10.0.0",
48
+ "@operato/layout": "^10.29.43",
49
+ "@operato/popup": "^10.29.25",
48
50
  "@operato/styles": "^10.0.0",
51
+ "@things-factory/setting-base": "^10.1.314",
49
52
  "@things-factory/styles": "^10.1.281",
50
53
  "lit": "^3.1.2"
51
54
  },
52
- "gitHead": "b7992e0298b0b0efcf88d1649d3b21bb8ee20997"
55
+ "gitHead": "8d74df0a0618131ff17309638a6aa0affbd4c77d"
53
56
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "sample data",
111
111
  "figure.text.data-value-from-sample": "The data tab's sample gives this value. Turn off 「apply to the preview」 in the data tab to set it here.",
112
112
  "figure.text.control-played": "Playing",
113
- "figure.text.control-played-explained": "The {clip} clip is moving this control. Stop the clip to give it a value."
113
+ "figure.text.control-played-explained": "The {clip} clip is moving this control. Stop the clip to give it a value.",
114
+ "figure.text.source-deprecated": "deprecated",
115
+ "figure.text.source-search": "search by name",
116
+ "figure.button.source-install": "install {count}",
117
+ "figure.button.source-close": "close",
118
+ "figure.button.source-more": "more",
119
+ "figure.label.source-search": "search figures",
120
+ "figure.text.source-empty": "There are no figures to install.",
121
+ "figure.button.source-change": "Change connection",
122
+ "figure.title.source-connection": "Figure server",
123
+ "figure.label.source-url": "server address",
124
+ "figure.label.source-domain": "domain on the figure server",
125
+ "figure.label.source-token": "access token",
126
+ "figure.text.source-token-set": "Saved ({hint}). Enter a new token to replace it.",
127
+ "figure.text.source-token-unset": "Enter the token issued under 「Board server install keys」 in the figure server's Settings.",
128
+ "figure.button.source-check": "check connection",
129
+ "figure.text.source-check-ok": "Connected. {count} figures can be installed.",
130
+ "figure.text.source-saved": "Saved.",
131
+ "figure.text.source-example": "e.g. {value}",
132
+ "figure.text.source-missing": "Needed to connect.",
133
+ "figure.button.source-save": "save",
134
+ "figure.text.context-lost": "The 3D view of {where} was reset by the graphics device and drawn again.",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · scale {scale} · size {size} · {standing} 3D views · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "unknown",
137
+ "figure.text.context-lost-shown": "tab in view",
138
+ "figure.text.context-lost-hidden": "tab hidden",
139
+ "figure.label.view-modeller": "the modeller",
140
+ "figure.label.view-preview": "the modeller's preview",
141
+ "figure.label.view-viewer": "the figure preview"
114
142
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "datos de muestra",
111
111
  "figure.text.data-value-from-sample": "La muestra de la pestaña de datos da este valor. Desactive «aplicar a la vista previa» en la pestaña de datos para fijarlo aquí.",
112
112
  "figure.text.control-played": "En reproducción",
113
- "figure.text.control-played-explained": "El clip {clip} está moviendo este control. Detén el clip para darle un valor."
113
+ "figure.text.control-played-explained": "El clip {clip} está moviendo este control. Detén el clip para darle un valor.",
114
+ "figure.text.source-deprecated": "no recomendada",
115
+ "figure.text.source-search": "buscar por nombre",
116
+ "figure.button.source-install": "instalar {count}",
117
+ "figure.button.source-close": "cerrar",
118
+ "figure.button.source-more": "ver más",
119
+ "figure.label.source-search": "buscar figuras",
120
+ "figure.text.source-empty": "No hay figuras para instalar.",
121
+ "figure.button.source-change": "Cambiar conexión",
122
+ "figure.title.source-connection": "Servidor de figuras",
123
+ "figure.label.source-url": "dirección del servidor",
124
+ "figure.label.source-domain": "dominio en el servidor de figuras",
125
+ "figure.label.source-token": "token de acceso",
126
+ "figure.text.source-token-set": "Guardado ({hint}). Introduzca un token nuevo para reemplazarlo.",
127
+ "figure.text.source-token-unset": "Introduzca el token emitido en 「Claves de instalación de servidores de tableros」 en la Configuración del servidor de figuras.",
128
+ "figure.button.source-check": "comprobar conexión",
129
+ "figure.text.source-check-ok": "Conectado. Se pueden instalar {count} figuras.",
130
+ "figure.text.source-saved": "Guardado.",
131
+ "figure.text.source-example": "p. ej. {value}",
132
+ "figure.text.source-missing": "Necesario para conectar.",
133
+ "figure.button.source-save": "guardar",
134
+ "figure.text.context-lost": "La vista 3D de {where} fue reiniciada por el dispositivo gráfico y se volvió a dibujar.",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · escala {scale} · tamaño {size} · {standing} vistas 3D · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "desconocida",
137
+ "figure.text.context-lost-shown": "pestaña visible",
138
+ "figure.text.context-lost-hidden": "pestaña oculta",
139
+ "figure.label.view-modeller": "el modelador",
140
+ "figure.label.view-preview": "la vista previa del modelador",
141
+ "figure.label.view-viewer": "la vista previa de la figura"
114
142
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "サンプルデータ",
111
111
  "figure.text.data-value-from-sample": "データタブのサンプルデータがこの値を決めます。データタブで「プレビューに適用」をオフにするとここで変更できます。",
112
112
  "figure.text.control-played": "再生中",
113
- "figure.text.control-played-explained": "{clip} クリップがこの操作値を動かしています。クリップを止めると値を与えられます。"
113
+ "figure.text.control-played-explained": "{clip} クリップがこの操作値を動かしています。クリップを止めると値を与えられます。",
114
+ "figure.text.source-deprecated": "非推奨",
115
+ "figure.text.source-search": "名前で検索",
116
+ "figure.button.source-install": "{count} 件をインストール",
117
+ "figure.button.source-close": "閉じる",
118
+ "figure.button.source-more": "さらに表示",
119
+ "figure.label.source-search": "Figure を検索",
120
+ "figure.text.source-empty": "インストールできる Figure がありません。",
121
+ "figure.button.source-change": "接続を変更",
122
+ "figure.title.source-connection": "Figure サーバー接続",
123
+ "figure.label.source-url": "サーバーアドレス",
124
+ "figure.label.source-domain": "Figure サーバーのドメイン",
125
+ "figure.label.source-token": "アクセストークン",
126
+ "figure.text.source-token-set": "保存済みです({hint})。変更するには新しいトークンを入力してください。",
127
+ "figure.text.source-token-unset": "フィギュアサーバーの設定「ボードサーバーのインストールキー」で発行したトークンを入力してください。",
128
+ "figure.button.source-check": "接続確認",
129
+ "figure.text.source-check-ok": "接続しました。インストールできる Figure は {count} 件です。",
130
+ "figure.text.source-saved": "保存しました。",
131
+ "figure.text.source-example": "例: {value}",
132
+ "figure.text.source-missing": "入力すると接続されます。",
133
+ "figure.button.source-save": "保存",
134
+ "figure.text.context-lost": "{where}の3D画面がグラフィックデバイスで初期化され、再描画しました。",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · 倍率 {scale} · サイズ {size} · 3D画面 {standing}個 · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "不明",
137
+ "figure.text.context-lost-shown": "表示中のタブ",
138
+ "figure.text.context-lost-hidden": "非表示のタブ",
139
+ "figure.label.view-modeller": "モデラー編集",
140
+ "figure.label.view-preview": "モデラーのプレビュー",
141
+ "figure.label.view-viewer": "フィギュアのプレビュー"
114
142
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "견본 데이터",
111
111
  "figure.text.data-value-from-sample": "데이터 탭의 견본 데이터가 이 값을 정합니다. 데이터 탭에서 「미리보기에 적용」을 끄면 여기서 바꿀 수 있습니다.",
112
112
  "figure.text.control-played": "재생 중",
113
- "figure.text.control-played-explained": "{clip} 클립이 이 조작값을 제어하고 있습니다. 값을 직접 변경하려면 클립 재생을 중지하세요."
113
+ "figure.text.control-played-explained": "{clip} 클립이 이 조작값을 제어하고 있습니다. 값을 직접 변경하려면 클립 재생을 중지하세요.",
114
+ "figure.text.source-deprecated": "권장 안 함",
115
+ "figure.text.source-search": "이름으로 찾기",
116
+ "figure.button.source-install": "{count}개 설치",
117
+ "figure.button.source-close": "닫기",
118
+ "figure.button.source-more": "더 보기",
119
+ "figure.label.source-search": "피규어 검색",
120
+ "figure.text.source-empty": "설치할 수 있는 피규어가 없습니다.",
121
+ "figure.button.source-change": "연결 바꾸기",
122
+ "figure.title.source-connection": "피규어 서버 연결",
123
+ "figure.label.source-url": "서버 주소",
124
+ "figure.label.source-domain": "피규어 서버의 사업장",
125
+ "figure.label.source-token": "접속 토큰",
126
+ "figure.text.source-token-set": "저장되어 있습니다({hint}). 변경하려면 새 토큰을 입력하세요.",
127
+ "figure.text.source-token-unset": "피규어 서버 설정의 「보드 서버 설치 키」에서 발급받은 토큰을 입력하세요.",
128
+ "figure.button.source-check": "연결 확인",
129
+ "figure.text.source-check-ok": "연결되었습니다. 설치할 수 있는 피규어는 {count}개입니다.",
130
+ "figure.text.source-saved": "저장되었습니다.",
131
+ "figure.text.source-example": "예: {value}",
132
+ "figure.text.source-missing": "입력해야 연결됩니다.",
133
+ "figure.button.source-save": "저장",
134
+ "figure.text.context-lost": "{where}의 3D 화면이 그래픽 장치에서 초기화되어 다시 그렸습니다.",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · 배율 {scale} · 크기 {size} · 3D 화면 {standing}개 · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "알 수 없음",
137
+ "figure.text.context-lost-shown": "보이는 탭",
138
+ "figure.text.context-lost-hidden": "숨은 탭",
139
+ "figure.label.view-modeller": "모델러 편집",
140
+ "figure.label.view-preview": "모델러 미리보기",
141
+ "figure.label.view-viewer": "피규어 미리보기"
114
142
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "data sampel",
111
111
  "figure.text.data-value-from-sample": "Sampel dalam tab data memberi nilai ini. Matikan 「guna pada pratonton」 dalam tab data untuk menetapkannya di sini.",
112
112
  "figure.text.control-played": "Dimainkan",
113
- "figure.text.control-played-explained": "Klip {clip} sedang menggerakkan kawalan ini. Hentikan klip untuk memberinya nilai."
113
+ "figure.text.control-played-explained": "Klip {clip} sedang menggerakkan kawalan ini. Hentikan klip untuk memberinya nilai.",
114
+ "figure.text.source-deprecated": "tidak disyorkan",
115
+ "figure.text.source-search": "cari mengikut nama",
116
+ "figure.button.source-install": "pasang {count}",
117
+ "figure.button.source-close": "tutup",
118
+ "figure.button.source-more": "lagi",
119
+ "figure.label.source-search": "cari figure",
120
+ "figure.text.source-empty": "Tiada figure untuk dipasang.",
121
+ "figure.button.source-change": "Tukar sambungan",
122
+ "figure.title.source-connection": "Pelayan figure",
123
+ "figure.label.source-url": "alamat pelayan",
124
+ "figure.label.source-domain": "domain pada pelayan figure",
125
+ "figure.label.source-token": "token akses",
126
+ "figure.text.source-token-set": "Disimpan ({hint}). Masukkan token baharu untuk menggantikannya.",
127
+ "figure.text.source-token-unset": "Masukkan token yang dikeluarkan di 「Kunci pemasangan pelayan papan」 dalam Tetapan pelayan figura.",
128
+ "figure.button.source-check": "semak sambungan",
129
+ "figure.text.source-check-ok": "Disambungkan. {count} figure boleh dipasang.",
130
+ "figure.text.source-saved": "Disimpan.",
131
+ "figure.text.source-example": "cth. {value}",
132
+ "figure.text.source-missing": "Diperlukan untuk menyambung.",
133
+ "figure.button.source-save": "simpan",
134
+ "figure.text.context-lost": "Paparan 3D {where} ditetapkan semula oleh peranti grafik dan dilukis semula.",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · skala {scale} · saiz {size} · {standing} paparan 3D · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "tidak diketahui",
137
+ "figure.text.context-lost-shown": "tab kelihatan",
138
+ "figure.text.context-lost-hidden": "tab tersembunyi",
139
+ "figure.label.view-modeller": "pemodel",
140
+ "figure.label.view-preview": "pratonton pemodel",
141
+ "figure.label.view-viewer": "pratonton figura"
114
142
  }
@@ -110,5 +110,33 @@
110
110
  "figure.label.data-value-from-sample": "示例数据",
111
111
  "figure.text.data-value-from-sample": "此值由数据页的示例数据决定。在数据页关闭「应用到预览」后可在此修改。",
112
112
  "figure.text.control-played": "播放中",
113
- "figure.text.control-played-explained": "{clip} 片段正在驱动此控制值。停止片段后即可赋值。"
113
+ "figure.text.control-played-explained": "{clip} 片段正在驱动此控制值。停止片段后即可赋值。",
114
+ "figure.text.source-deprecated": "不推荐",
115
+ "figure.text.source-search": "按名称搜索",
116
+ "figure.button.source-install": "安装 {count} 个",
117
+ "figure.button.source-close": "关闭",
118
+ "figure.button.source-more": "显示更多",
119
+ "figure.label.source-search": "搜索图形",
120
+ "figure.text.source-empty": "没有可安装的图形。",
121
+ "figure.button.source-change": "更改连接",
122
+ "figure.title.source-connection": "图形服务器连接",
123
+ "figure.label.source-url": "服务器地址",
124
+ "figure.label.source-domain": "图形服务器上的域",
125
+ "figure.label.source-token": "访问令牌",
126
+ "figure.text.source-token-set": "已保存({hint})。如需更改,请输入新令牌。",
127
+ "figure.text.source-token-unset": "请输入在图形服务器设置「看板服务器安装密钥」中签发的令牌。",
128
+ "figure.button.source-check": "检查连接",
129
+ "figure.text.source-check-ok": "已连接。可安装的图形有 {count} 个。",
130
+ "figure.text.source-saved": "已保存。",
131
+ "figure.text.source-example": "例如:{value}",
132
+ "figure.text.source-missing": "需要填写才能连接。",
133
+ "figure.button.source-save": "保存",
134
+ "figure.text.context-lost": "{where}的 3D 画面被图形设备重置,已重新绘制。",
135
+ "figure.text.context-lost-facts": "GPU {gpu} · 缩放 {scale} · 尺寸 {size} · 3D 画面 {standing} 个 · {shown}",
136
+ "figure.text.context-lost-gpu-unknown": "未知",
137
+ "figure.text.context-lost-shown": "可见标签页",
138
+ "figure.text.context-lost-hidden": "隐藏标签页",
139
+ "figure.label.view-modeller": "建模器编辑",
140
+ "figure.label.view-preview": "建模器预览",
141
+ "figure.label.view-viewer": "图形预览"
114
142
  }