@things-factory/figure-library 10.1.278 → 10.1.280
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/package.json +22 -8
- package/dist-client/bootstrap.js.map +0 -1
- package/dist-client/editors/ox-property-editor-figure-data.js.map +0 -1
- package/dist-client/editors/ox-property-editor-figure-legends.js.map +0 -1
- package/dist-client/figure-library-changed.js.map +0 -1
- package/dist-client/figure-library-file.js.map +0 -1
- package/dist-client/figure-palette-group.js.map +0 -1
- package/dist-client/figure-palette.js.map +0 -1
- package/dist-client/index.js.map +0 -1
- package/dist-client/item-types/index.js.map +0 -1
- package/dist-client/item-types/item-types-editor.js.map +0 -1
- package/dist-client/item-types/item-types-renderer.js.map +0 -1
- package/dist-client/item-types/item-types-rows.js.map +0 -1
- package/dist-client/item-types/ox-item-types-input.js.map +0 -1
- package/dist-client/legend-looks/legend-looks-editor.js.map +0 -1
- package/dist-client/legend-looks/legend-looks.js.map +0 -1
- package/dist-client/legend-looks/ox-legend-looks.js.map +0 -1
- package/dist-client/pages/figure-library-page.js.map +0 -1
- package/dist-client/route.js.map +0 -1
- package/dist-client/tsconfig.tsbuildinfo +0 -1
- package/dist-client/viewparts/figure-package-import.js.map +0 -1
- package/dist-client/viewparts/figure-releases-popup.js.map +0 -1
- package/dist-client/viewparts/figure-version.js.map +0 -1
- package/dist-client/viewparts/release-pair.js.map +0 -1
- package/dist-server/index.js.map +0 -1
- package/dist-server/routers/figure-library-file-router.js.map +0 -1
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/figure-library-release/figure-library-release.js.map +0 -1
- package/dist-server/service/figure-library-resolver.js.map +0 -1
- package/dist-server/service/figure-library-types.js.map +0 -1
- package/dist-server/service/figure-type-map/figure-type-map-entry.js.map +0 -1
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/library/blueprints.js.map +0 -1
- package/dist-server/service/library/board-walk.js.map +0 -1
- package/dist-server/service/library/derived.js.map +0 -1
- package/dist-server/service/library/extensions.js.map +0 -1
- package/dist-server/service/library/figures.js.map +0 -1
- package/dist-server/service/library/import.js.map +0 -1
- package/dist-server/service/library/inspection.js.map +0 -1
- package/dist-server/service/library/library-files.js.map +0 -1
- package/dist-server/service/library/type-map.js.map +0 -1
- package/dist-server/tsconfig.tsbuildinfo +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/figure-library",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.280",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist-client",
|
|
8
|
+
"dist-server",
|
|
9
|
+
"things-factory.config.js",
|
|
10
|
+
"translations",
|
|
11
|
+
"!**/*.map",
|
|
12
|
+
"!**/*.test.*",
|
|
13
|
+
"!**/*.spec.*",
|
|
14
|
+
"!**/test/**",
|
|
15
|
+
"!**/tests/**",
|
|
16
|
+
"!**/__tests__/**",
|
|
17
|
+
"!**/*.tsbuildinfo",
|
|
18
|
+
"!**/.DS_Store"
|
|
19
|
+
],
|
|
6
20
|
"things-factory": true,
|
|
7
21
|
"author": "heartyoh <heartyoh@hatiolab.com>",
|
|
8
22
|
"description": "Figures a board server imports and manages itself: the library of imported releases and the release each figure draws with (ADR-0114)",
|
|
@@ -40,12 +54,12 @@
|
|
|
40
54
|
"@operato/slot-layout-editor": "^10.29.58",
|
|
41
55
|
"@operato/styles": "^10.29.23",
|
|
42
56
|
"@operato/utils": "^10.0.0",
|
|
43
|
-
"@things-factory/attachment-base": "^10.1.
|
|
44
|
-
"@things-factory/auth-base": "^10.1.
|
|
45
|
-
"@things-factory/board-service": "^10.1.
|
|
46
|
-
"@things-factory/env": "^10.1.
|
|
47
|
-
"@things-factory/figure-viewer": "^10.1.
|
|
48
|
-
"@things-factory/shell": "^10.1.
|
|
57
|
+
"@things-factory/attachment-base": "^10.1.280",
|
|
58
|
+
"@things-factory/auth-base": "^10.1.280",
|
|
59
|
+
"@things-factory/board-service": "^10.1.280",
|
|
60
|
+
"@things-factory/env": "^10.1.280",
|
|
61
|
+
"@things-factory/figure-viewer": "^10.1.280",
|
|
62
|
+
"@things-factory/shell": "^10.1.280",
|
|
49
63
|
"graphql-scalars": "^1.22.4",
|
|
50
64
|
"graphql-tag": "^2.12.6",
|
|
51
65
|
"graphql-upload": "^15.0.2",
|
|
@@ -53,5 +67,5 @@
|
|
|
53
67
|
"koa-router": "^7.4.0",
|
|
54
68
|
"lit": "^3.1.2"
|
|
55
69
|
},
|
|
56
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "14ce4b7f5957272d63115af316a7dc1ab030e152"
|
|
57
71
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AAEzE,OAAO,6CAA6C,CAAA;AACpD,OAAO,gDAAgD,CAAA;AAEvD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,gBAAgB,CAAC,QAAQ,CAAC,EAAE,aAAa,EAAE,gCAAgC,EAAE,CAAC,CAAA;IAC9E,gBAAgB,CAAC,QAAQ,CAAC,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,CAAC,CAAA;IACpF,cAAc,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;IACjD,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["import { registerEditor } from '@operato/data-grist'\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { SLOT_LAYOUT_EDITORS } from '@operato/slot-layout-editor'\n\nimport { LegendLooksEditor } from './legend-looks/legend-looks-editor.js'\n\nimport './editors/ox-property-editor-figure-data.js'\nimport './editors/ox-property-editor-figure-legends.js'\n\n/**\n * The editors the board's property panel needs for the properties a placed figure names: its data -- shape, each value\n * and where it came from (`figure-data`) --, the legend each of its table roles shows by (`figure-legends`, ADR-0166\n * 11) and its slot layout, which a placement may override (`slot-layout`, ADR-0118 decision 8). Registered here, where\n * every app that places library figures on its boards loads this module; the scene component list does not carry\n * figure packages, and without these the panel skips the three properties.\n *\n * And the one legend editor, a grist editor `legend-looks`: a legend theme's looks -- colour, effect, values, a motion\n * group's clip, speed and pause (ADR-0166 11). The board's 「테마」 list uses it for its legend kinds when it is here.\n */\nexport default function bootstrap() {\n OxPropertyEditor.register({ 'figure-data': 'ox-property-editor-figure-data' })\n OxPropertyEditor.register({ 'figure-legends': 'ox-property-editor-figure-legends' })\n registerEditor('legend-looks', LegendLooksEditor)\n OxPropertyEditor.register(Object.fromEntries(SLOT_LAYOUT_EDITORS.map(e => [e.type, e.element])))\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-property-editor-figure-data.js","sourceRoot":"","sources":["../../client/editors/ox-property-editor-figure-data.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAqB,MAAM,0BAA0B,CAAA;AAG9E,OAAO,+DAA+D,CAAA;AACtE,OAAO,EAAE,kBAAkB,EAAkD,MAAM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,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE;SAC9B,CAAC,CAAA;IACJ,CAAC;;AAnCU,0BAA0B;IADtC,aAAa,CAAC,gCAAgC,CAAC;GACnC,0BAA0B,CAoCtC","sourcesContent":["import { css, html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor, type PropertySpec } from '@operato/property-editor'\nimport type { FigureAsset } from '@hatiolab/figure-model'\n\nimport '@things-factory/figure-viewer/dist-client/figure-data-list.js'\nimport { figureDataReportOf, type FigureDataReport, type FigureDataSnapshot } from '@things-factory/figure-viewer/dist-client/figure-data-report.js'\n\n/** The parts of a placed figure the section reads: things-scene's FigureInstance, as the property panel holds it. */\ninterface PlacedFigure {\n state?: { data?: unknown; parameters?: Record<string, unknown> }\n figureInputs?: {\n asset: FigureAsset\n dataValues: FigureDataSnapshot['values']\n diagnostics(): FigureDataSnapshot['refused']\n }\n}\n\n/**\n * 「Figure 데이터」 on the board's property panel (data binding design, decision 3): what the selected figure is given\n * and what it makes of it -- its data shape as a tree, each value now and where it came from, what each moves, a control\n * the board's own state values hold, why data was refused, the fields the data has that the shape does not name, and an\n * example to copy. It changes nothing: the figure's data comes from the board's data source or a mapping, its saved\n * values from 「데이터 값」 above.\n */\n@customElement('ox-property-editor-figure-data')\nexport class OxPropertyEditorFigureData extends OxPropertyEditor {\n static styles = [\n ...OxPropertyEditor.styles,\n css`\n figure-data-list,\n [hint] {\n grid-column: 1 / -1;\n }\n [hint] {\n margin: 0;\n font-size: var(--ui-t-small, 11.5px);\n color: var(--md-sys-color-on-surface-variant);\n }\n `\n ]\n\n editorTemplate(value: unknown, spec: PropertySpec) {\n const report = this.reportOf(value)\n return report ? html`<figure-data-list .report=${report}></figure-data-list>` : html`<p hint>${i18next.t('figure.text.board-data-none')}</p>`\n }\n\n /** The selected figure's report; none for a figure with no data shape, or a selection of several. */\n private reportOf(value: unknown): FigureDataReport | null {\n let selected: unknown[] | undefined\n this.dispatchEvent(new CustomEvent('i-need-selected', { bubbles: true, composed: true, detail: { callback: (s: unknown[]) => (selected = s) } }))\n const figure = selected?.length === 1 ? (selected[0] as PlacedFigure) : undefined\n const inputs = figure?.figureInputs\n if (!inputs) return null\n return figureDataReportOf({\n asset: inputs.asset,\n data: value ?? figure!.state?.data,\n parameters: figure!.state?.parameters ?? null,\n values: inputs.dataValues,\n refused: inputs.diagnostics()\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-property-editor-figure-data': OxPropertyEditorFigureData\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-property-editor-figure-legends.js","sourceRoot":"","sources":["../../client/editors/ox-property-editor-figure-legends.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAqB,MAAM,0BAA0B,CAAA;AAG9E,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAmB5E,MAAM,KAAK,GAAG,EAAE,CAAA;AAChB,MAAM,GAAG,GAAG,gBAAgB,CAAA;AAE5B;;;;;;;;;GASG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,gBAAgB;IAA5D;;QAwFY,YAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA;QACrD;;;;UAIE;QACM,UAAK,GAAG,KAAK,CAAA;IA2HvB,CAAC;aAxNQ,WAAM,GAAG;QACd,GAAG,gBAAgB,CAAC,MAAM;QAC1B,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA;QAC1M,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,MAAM,KAAK,CAAC;YAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAiB,CAAC,CAAA;IACxE,CAAC;IAED,kHAAkH;IAC1G,KAAK,CAAC,MAAgC;QAC5C,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM;YAAE,OAAM;QAC3C,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAClD,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAClD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QACvE,MAAM,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACpC,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACjD,CAAC;;AAxNU,6BAA6B;IADzC,aAAa,CAAC,mCAAmC,CAAC;GACtC,6BAA6B,CAyNzC","sourcesContent":["import { css, html, nothing, type PropertyValues } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { FIGURE_OWN_TABLE } from '@hatiolab/things-scene'\nimport { i18next } from '@operato/i18n'\nimport { OxPropertyEditor, type PropertySpec } from '@operato/property-editor'\nimport type { FigureAsset, FigureDataTableBinding } from '@hatiolab/figure-model'\n\nimport { legendFits, legendTablesOf } from '../legend-looks/legend-looks.js'\n\n/** The parts of a placed figure the section reads and writes: things-scene's FigureInstance, as the property panel holds it. */\ninterface PlacedFigure {\n state?: { legends?: Record<string, string> }\n set(props: Record<string, unknown>): void\n on?(event: string, listener: (...args: unknown[]) => void): void\n off?(event: string, listener: (...args: unknown[]) => void): void\n /** The board: its default legend for each role (`legends`). */\n rootModel?: PlacedFigure & { state?: { legends?: Record<string, string> } }\n /** The scene's root container: the legends the scene was given, by name (`style`). */\n root?: { style?: Record<string, unknown> }\n figureInputs?: {\n asset: FigureAsset\n tableUses: Readonly<Record<string, { value: unknown; key: string | null; source: string; legend?: string }>>\n diagnostics(): ReadonlyArray<{ severity: string; reason: string; binding?: string; key?: string; column?: string; legend?: string; value?: unknown }>\n }\n}\n\nconst BOARD = ''\nconst OWN = FIGURE_OWN_TABLE\n\n/**\n * 「범례」 on the board's property panel for a figure whose tables a legend may take (ADR-0166 7, 11): per legend role,\n * the legend this placement shows the role's tables by -- the board's default, one of the scene's legends of the\n * kind that fits (a code map for a code table, a range map for a range table), or the figure's own table -- and the\n * board's default for the role, set from here. Under each role, what its tables show now: the value, the row it\n * matched, and the table it came from; what of a legend was not taken.\n *\n * The property is the placement's `legends` (role → legend name); the board's default is the board's `legends`,\n * written in the same undoable change. Legends are edited where they live, in the domain's legend themes.\n */\n@customElement('ox-property-editor-figure-legends')\nexport class OxPropertyEditorFigureLegends extends OxPropertyEditor {\n static styles = [\n ...OxPropertyEditor.styles,\n css`\n [body] {\n grid-column: 1 / -1;\n display: grid;\n gap: 8px;\n font-size: var(--ui-t-small, 11.5px);\n }\n section {\n display: grid;\n gap: 4px;\n }\n [role] {\n display: flex;\n gap: 6px;\n align-items: baseline;\n }\n [role] small {\n color: var(--md-sys-color-on-surface-variant);\n }\n [choose] {\n display: flex;\n gap: 4px;\n align-items: center;\n }\n [choose] select {\n flex: 1;\n min-width: 0;\n }\n [choose] button {\n height: 24px;\n padding: 0 8px;\n font: inherit;\n color: var(--md-sys-color-primary);\n border: none;\n border-radius: 6px;\n background: transparent;\n cursor: pointer;\n white-space: nowrap;\n }\n [choose] button:hover {\n background: var(--md-sys-color-surface-container-high);\n }\n [choose] button:disabled {\n color: var(--md-sys-color-on-surface-variant);\n cursor: default;\n }\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n display: grid;\n gap: 2px;\n }\n li {\n display: flex;\n flex-wrap: wrap;\n gap: 0 6px;\n align-items: baseline;\n }\n li [meta] {\n margin-left: auto;\n display: flex;\n gap: 4px;\n align-items: baseline;\n }\n [source] {\n padding: 0 4px;\n border-radius: 4px;\n background: var(--md-sys-color-surface-container-high);\n color: var(--md-sys-color-on-surface-variant);\n }\n [hint] {\n width: 100%;\n margin: 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n [warn] {\n width: 100%;\n margin: 0;\n color: var(--md-sys-color-error);\n }\n `\n ]\n\n private watched?: { figure: PlacedFigure; board?: PlacedFigure }\n private readonly refresh = () => this.requestUpdate()\n /*\n Whether the selected figure was asked for since the value last came. The panel answers inside an undoable change,\n and each answer leaves a snapshot to undo to even when nothing changed: the figure is asked for when the panel gives\n a value (a new selection makes a new section), not again for each change the figure says.\n */\n private asked = false\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.watch(undefined)\n }\n\n willUpdate(changed: PropertyValues<this>) {\n if (changed.has('value')) this.asked = false\n }\n\n editorTemplate(value: unknown, _spec: PropertySpec) {\n const figure = this.asked ? this.watched?.figure : this.selectedFigure()\n this.asked = true\n const inputs = figure?.figureInputs\n this.watch(figure)\n if (!figure || !inputs) return html`<div body><p hint>${i18next.t('figure.text.legend-select-one')}</p></div>`\n const chosen = (value && typeof value === 'object' ? value : {}) as Record<string, string>\n const board = figure.rootModel?.state?.legends ?? {}\n const style = figure.root?.style ?? {}\n const tables = legendTablesOf(inputs.asset)\n const roles = [...new Set(tables.map(t => t.legend!.role))]\n const notes = inputs.diagnostics().filter(d => d.severity === 'note')\n return html`<div body>\n ${roles.map(role => this.renderRole(role, tables.filter(t => t.legend!.role === role), chosen, board, style, inputs.tableUses, notes))}\n </div>`\n }\n\n private renderRole(\n role: string,\n tables: FigureDataTableBinding[],\n chosen: Record<string, string>,\n board: Record<string, string>,\n style: Record<string, unknown>,\n uses: NonNullable<PlacedFigure['figureInputs']>['tableUses'],\n notes: ReturnType<NonNullable<PlacedFigure['figureInputs']>['diagnostics']>\n ) {\n const lookup = tables[0]!.lookup\n /* The scene's legends of the kind that fits: a code table a code map, a range table a range map. */\n const fitting = Object.keys(style).filter(name => legendFits(lookup, style[name]))\n const own = chosen[role]\n if (own && !fitting.includes(own)) fitting.push(own)\n const boardDefault = board[role]\n const domain = Object.prototype.hasOwnProperty.call(style, role)\n const fallback = boardDefault ? `${i18next.t('figure.label.legend-board')} · ${boardDefault}` : domain ? `${i18next.t('figure.label.legend-domain')} · ${role}` : i18next.t('figure.label.legend-figure-table')\n return html`<section>\n <div role><b>${role}</b><small>${tables.map(t => t.label ?? t.accessor).join(', ')}</small></div>\n <div choose>\n <select data-role=${role} aria-label=${role}>\n <option value=${BOARD} ?selected=${!own}>${fallback}</option>\n ${fitting.map(name => html`<option value=${name} ?selected=${own === name}>${name}${Object.prototype.hasOwnProperty.call(style, name) ? '' : ` · ${i18next.t('figure.label.legend-absent')}`}</option>`)}\n <option value=${OWN} ?selected=${own === OWN}>${i18next.t('figure.label.legend-figure-table')}</option>\n </select>\n <button ?disabled=${!own || own === boardDefault} title=${i18next.t('figure.text.legend-make-board-default')} @click=${() => this.makeBoardDefault(role, own)}>\n ${i18next.t('figure.button.legend-board-default')}\n </button>\n </div>\n <ul>\n ${tables.map(t => {\n const use = uses[t.id]\n const row = !use || use.value === undefined ? undefined : use.key === null ? i18next.t('figure.label.legend-row-none') : use.key === 'default' ? i18next.t('figure.label.legend-default-code') : use.key\n return html`<li>\n <span>${t.label ?? t.accessor}</span>\n <span meta>\n ${use?.value === undefined ? html`<span hint>${i18next.t('figure.text.legend-no-value')}</span>` : html`<b>${String(use.value)}</b> → ${row}`}\n ${use ? html`<span source>${use.source === 'figure' ? i18next.t('figure.label.legend-figure-table') : (use.legend ?? use.source)}</span>` : nothing}\n </span>\n </li>`\n })}\n </ul>\n ${notes\n .filter(n => tables.some(t => t.id === n.binding))\n .map(n => html`<p warn>${i18next.t('figure.text.legend-note-' + n.reason, { key: n.key ?? '', column: n.column ?? '', legend: n.legend ?? '', value: typeof n.value === 'string' ? n.value : JSON.stringify(n.value ?? '') })}</p>`)}\n </section>`\n }\n\n override _valueChanged(e: Event) {\n e.stopPropagation()\n const select = e.target as HTMLSelectElement\n const role = select.getAttribute?.('data-role')\n if (!role) return\n const next = { ...((this.value && typeof this.value === 'object' ? this.value : {}) as Record<string, string>) }\n if (select.value === BOARD) delete next[role]\n else next[role] = select.value\n this.value = Object.keys(next).length ? next : undefined\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n /** The board's default for the role, this placement's choice, in one undoable change; the placement then follows it. */\n private makeBoardDefault(role: string, name: string | undefined) {\n this.withSelected(figure => {\n const board = { ...(figure.rootModel?.state?.legends ?? {}) }\n if (name) board[role] = name\n else delete board[role]\n figure.rootModel?.set({ legends: board })\n const own = { ...(figure.state?.legends ?? {}) }\n delete own[role]\n figure.set({ legends: Object.keys(own).length ? own : undefined })\n })\n }\n\n private selectedFigure(): PlacedFigure | undefined {\n let figure: PlacedFigure | undefined\n this.withSelected(f => (figure = f), false)\n return figure\n }\n\n /** The one selected figure, given to `use` inside the panel's undoable change; none for a selection of several. */\n private withSelected(use: (figure: PlacedFigure) => void, write = true) {\n let selected: unknown[] | undefined\n this.dispatchEvent(new CustomEvent('i-need-selected', { bubbles: true, composed: true, detail: { callback: (s: unknown[]) => ((selected = s), write && s?.length === 1 && use(s[0] as PlacedFigure)) } }))\n if (!write && selected?.length === 1) use(selected[0] as PlacedFigure)\n }\n\n /* The data's codes and the board's choices change outside this section (live data, undo): it reads them again. */\n private watch(figure: PlacedFigure | undefined) {\n if (this.watched?.figure === figure) return\n this.watched?.figure.off?.('change', this.refresh)\n this.watched?.board?.off?.('change', this.refresh)\n this.watched = figure ? { figure, board: figure.rootModel } : undefined\n figure?.on?.('change', this.refresh)\n figure?.rootModel?.on?.('change', this.refresh)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-property-editor-figure-legends': OxPropertyEditorFigureLegends\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-library-changed.js","sourceRoot":"","sources":["../client/figure-library-changed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAE9D,wEAAwE;AACxE,MAAM,UAAU,sBAAsB,CAAC,SAAsB,MAAM;IACjE,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAA;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAyB,EAAE,SAAsB,MAAM;IAC5F,IAAI,OAAkC,CAAA;IACtC,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,MAAM,GAAG,GAAG,KAAK,IAAI,EAAE;QACrB,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,GAAG,IAAI,CAAA;YACZ,OAAM;QACR,CAAC;QACD,GAAG,CAAC;YACF,KAAK,GAAG,KAAK,CAAA;YACb,OAAO,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;YAChC,MAAM,OAAO,CAAA;QACf,CAAC,QAAQ,KAAK,EAAC;QACf,OAAO,GAAG,SAAS,CAAA;IACrB,CAAC,CAAA;IACD,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAA;IACpD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAA;AACtE,CAAC","sourcesContent":["/*\n * The library's type map changed: a package was imported, a figure was archived or brought back, or another release\n * was chosen to draw with (ADR-0114). The modeller tray was read once at boot, so a figure imported later stayed out of\n * it until the page reloaded. Whatever changes the type map says so here, and the tray reads it again.\n */\n\nexport const FIGURE_LIBRARY_CHANGED = 'figure-library-changed'\n\n/** Said after the server accepted a change to the domain's type map. */\nexport function announceLibraryChanged(target: EventTarget = window): void {\n target.dispatchEvent(new Event(FIGURE_LIBRARY_CHANGED))\n}\n\n/**\n * Runs `read` on every change. Changes that arrive while a read is under way fold into one more read after it, so\n * the last read always sees the last change and two reads never race to register the tray.\n */\nexport function keepCurrentWithLibrary(read: () => Promise<void>, target: EventTarget = window): () => void {\n let running: Promise<void> | undefined\n let again = false\n const run = async () => {\n if (running) {\n again = true\n return\n }\n do {\n again = false\n running = read().catch(() => {})\n await running\n } while (again)\n running = undefined\n }\n target.addEventListener(FIGURE_LIBRARY_CHANGED, run)\n return () => target.removeEventListener(FIGURE_LIBRARY_CHANGED, run)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-library-file.js","sourceRoot":"","sources":["../client/figure-library-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C;;;;GAIG;AACH,IAAI,OAA+C,CAAA;AAEnD,MAAM,UAAU,uBAAuB,CAAC,QAAgD;IACtF,OAAO,GAAG,QAAQ,CAAA;AACpB,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,wBAAwB,IAAI,EAAE,CAAA;AAC9G,CAAC","sourcesContent":["import { getPathInfo } from '@operato/utils'\n\n/*\n * Where a library file -- a figure's thumbnail or mesh -- is fetched by its hash. This server serves them at\n * `/figure-library-file/:hash`; an app whose figure library lives on another server says where with\n * `setFigureLibraryFileUrl` (fmsim on the customer's REST server).\n */\nlet resolve: ((hash: string) => string) | undefined\n\nexport function setFigureLibraryFileUrl(resolver: ((hash: string) => string) | undefined): void {\n resolve = resolver\n}\n\nexport function figureLibraryFileUrl(hash: string): string {\n return resolve ? resolve(hash) : `${getPathInfo(location.pathname).contextPath}/figure-library-file/${hash}`\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-palette-group.js","sourceRoot":"","sources":["../client/figure-palette-group.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA6CH,2FAA2F;AAC3F,MAAM,UAAU,oBAAoB,CAAC,KAAmC;IACtE,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACnF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAmC,EACnC,EAAE,OAAO,EAAE,CAAC,EAAwG;IAEpH,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,CAAC,CAAC,oCAAoC,CAAC;QACpD,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,eAAe;QACvB,SAAS,EAAE,KAAK;aACb,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;aAC5B,GAAG,CAAC,IAAI,CAAC,EAAE;YACV,MAAM,OAAO,GAAG,IAAI,CAAC,OAAQ,CAAA;YAC7B,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,EAAE,IAAI,CAAA;YACtF,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,OAAO,CAAC,IAAI;gBACzB,KAAK,EAAE,QAAiB;gBACxB,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;gBAChD,yGAAyG;gBACzG,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;gBAC3C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI;gBACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM;gBACxB,GAAG,CAAC,CAAC,OAAO,CAAC,eAAe,IAAI;oBAC9B,gBAAgB,EAAE,CAAC,CAAC,wCAAwC,CAAC;oBAC7D,iBAAiB,EAAE,CAAC,CAAC,uCAAuC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;iBAC/F,CAAC;aACH,CAAA;QACH,CAAC,CAAC;KACL,CAAA;AACH,CAAC","sourcesContent":["/*\n * The modeller tray's \"Figure\" group, from the domain's figure type map (ADR-0114): one template per line, with the\n * release it draws with. A line whose format this server cannot read is shown dimmed with its reason and cannot be\n * placed. Pure: the lines and the words come in, the group goes out -- `figure-palette.ts` asks the server.\n */\n\n/** One line of the domain's type map, as the tray reads it. */\nexport interface FigureTypeMapLine {\n name: string\n release?: {\n ref: string\n name: string\n formatSupported: boolean\n /** Whether the release is tagged as the look of an item a holder holds (ADR-0155 amendment 2). */\n item?: boolean | null\n /** Whether the figure holds things itself. */\n holder?: boolean | null\n assetFormat?: string\n dependencies?: Array<{ role: string; hash: string }>\n } | null\n}\n\nexport interface FigurePaletteTemplate {\n type: string\n description: string\n group: 'figure'\n /** The release's thumbnail; a modeller's tray template always has the field, undefined when there is none. */\n icon: string | undefined\n model: { type: string; left: number; top: number }\n unavailableLabel?: string\n unavailableReason?: string\n /**\n * The release is tagged as the look of an item a holder holds (ADR-0155 amendment 2). The platform tray offers it all\n * the same (ADR-0123 결정 11); a modeller whose boards place items only by data leaves out an item that holds nothing\n * (fmsim's, where items are carriers). An item that holds -- a reel cart an AGV carries -- is still placed by hand.\n */\n item: boolean\n /** The figure holds things itself. */\n holder: boolean\n}\n\nexport interface FigurePaletteGroup {\n name: 'figure'\n description: string\n icon: string\n symbol: string\n templates: FigurePaletteTemplate[]\n}\n\n/** The lines a board can place now: those with a release in a format this server reads. */\nexport function placeableFigureTypes(lines: readonly FigureTypeMapLine[]): string[] {\n return lines.filter(line => line.release?.formatSupported).map(line => line.name)\n}\n\n/**\n * The tray group. `fileUrl` is where a figure file is fetched by its hash; `t` the app's translator.\n * A line with no release has nothing to draw and is left out.\n */\nexport function figurePaletteGroupOf(\n lines: readonly FigureTypeMapLine[],\n { fileUrl, t }: { fileUrl: (hash: string) => string; t: (key: string, options?: Record<string, unknown>) => string }\n): FigurePaletteGroup {\n return {\n name: 'figure',\n description: t('figure-library.palette.description'),\n icon: '',\n symbol: 'deployed_code',\n templates: lines\n .filter(line => line.release)\n .map(line => {\n const release = line.release!\n const thumbnail = (release.dependencies ?? []).find(d => d.role === 'thumbnail')?.hash\n return {\n type: line.name,\n description: release.name,\n group: 'figure' as const,\n icon: thumbnail ? fileUrl(thumbnail) : undefined,\n /* No box: placed, the figure takes the size it is made at through the drawing's scale (ADR-0144 2.3). */\n model: { type: line.name, left: 0, top: 0 },\n item: !!release.item,\n holder: !!release.holder,\n ...(!release.formatSupported && {\n unavailableLabel: t('figure-library.text.format-unsupported'),\n unavailableReason: t('figure-library.text.cannot-use-format', { format: release.assetFormat })\n })\n }\n })\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-palette.js","sourceRoot":"","sources":["../client/figure-palette.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAmD,MAAM,2BAA2B,CAAA;AACvI,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAE/D,cAAc,2BAA2B,CAAA;AAEzC,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;CAenB,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,aAAkD;IAC5F,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,KAAK,GAAwB,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,aAAa,IAAI,EAAE,CAAA;YACnI;;;cAGE;YACF,MAAM,SAAS,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAA;YAC7C,IAAI,SAAS,CAAC,MAAM;gBAAE,MAAM,mBAAmB,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;YAElG,+GAA+G;YAC/G,aAAa,CAAC,oBAAoB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;QAC7H,CAAC;QAAC,MAAM,CAAC;YACP,4FAA4F;QAC9F,CAAC;IACH,CAAC,CAAA;IACD,MAAM,IAAI,EAAE,CAAA;IACZ,sBAAsB,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC","sourcesContent":["/*\n * The figures this board server imported (ADR-0114), in a board modeller's tray. Every app whose boards place library\n * figures calls this once from its bootstrap and hands it its modeller's `registerGroup` -- the tray belongs to the\n * modeller the app uses, and an app may carry its own (fmsim).\n */\nimport gql from 'graphql-tag'\n\nimport { resolveUnknownTypes } from '@hatiolab/things-scene'\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\n\nimport { figurePaletteGroupOf, placeableFigureTypes, type FigurePaletteGroup, type FigureTypeMapLine } from './figure-palette-group.js'\nimport { keepCurrentWithLibrary } from './figure-library-changed.js'\nimport { figureLibraryFileUrl } from './figure-library-file.js'\n\nexport * from './figure-palette-group.js'\n\nconst TYPE_MAP = gql`\n query {\n figureTypeMap {\n name\n release {\n ref\n name\n formatSupported\n item\n holder\n assetFormat\n dependencies\n }\n }\n }\n`\n\n/**\n * Asks the type map, registers the figures that can be placed, and gives the tray its \"Figure\" group -- now, and again\n * whenever the library changes (an import, an archive, another release chosen), so a figure imported while the app is\n * open is in the tray without a reload. A server with no figure library, or a user with no right to read it, gets no\n * group and no error: the tray simply has none.\n */\nexport async function registerFigurePalette(registerGroup: (group: FigurePaletteGroup) => void): Promise<void> {\n const read = async () => {\n try {\n const lines: FigureTypeMapLine[] = (await client.query({ query: TYPE_MAP, fetchPolicy: 'network-only' })).data?.figureTypeMap ?? []\n /*\n A figure placed from the tray must already be registered: the scene resolves types only when a board opens, and\n a type nobody registered is placed as the stand-in that cannot move. The figure provider registers them now.\n */\n const placeable = placeableFigureTypes(lines)\n if (placeable.length) await resolveUnknownTypes({ components: placeable.map(type => ({ type })) })\n\n /* The modeller replaces a group registered under the same name, so a second read updates the tray in place. */\n registerGroup(figurePaletteGroupOf(lines, { fileUrl: figureLibraryFileUrl, t: (key, options) => i18next.t(key, options) }))\n } catch {\n /* No figure library on this server or no right to read it: the tray has no Figure group. */\n }\n }\n await read()\n keepCurrentWithLibrary(read)\n}\n"]}
|
package/dist-client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA","sourcesContent":["export * from './pages/figure-library-page'\nexport * from './figure-library-file'\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/item-types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,GAAG,MAAM,aAAa,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAsB,MAAM,wBAAwB,CAAA;AAElG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AAEpC,MAAM,UAAU,uBAAuB,CAAC,OAAe,gBAAgB;IACrE,cAAc,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAA;IAC5C,gBAAgB,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAA;AAClD,CAAC;AAED,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;CAW3B,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAe,gBAAgB;IACxE,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;YAClC,KAAK,EAAE,gBAAgB;YACvB,SAAS,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE;YACvE,WAAW,EAAE,cAAc;SAC5B,CAAC,CAAA;QACF,OAAO,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,mBAAmB,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IACtC,CAAC;AACH,CAAC","sourcesContent":["/*\n * Item types (ADR-0155): the domain's table, kept as a theme of type item-types -- or the type an app keeps them under\n * (fmsim, whose items are carriers: carrier-types). An app's bootstrap calls registerItemTypesEditor() once, with its\n * type, so its theme screen edits and shows that type's value.\n */\nimport gql from 'graphql-tag'\n\nimport { registerEditor, registerRenderer } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { ITEM_TYPES_THEME, itemTypesFromThemes, type ItemTypeTable } from '@hatiolab/things-scene'\n\nimport { OxGristEditorItemTypes } from './item-types-editor.js'\nimport { OxGristRendererItemTypes } from './item-types-renderer.js'\n\nexport { ITEM_TYPES_THEME }\nexport * from './item-types-rows.js'\n\nexport function registerItemTypesEditor(type: string = ITEM_TYPES_THEME): void {\n registerEditor(type, OxGristEditorItemTypes)\n registerRenderer(type, OxGristRendererItemTypes)\n}\n\nconst ITEM_TYPE_THEMES = gql`\n query ($filters: [Filter!]) {\n themes(filters: $filters) {\n items {\n name\n type\n active\n value\n }\n }\n }\n`\n\n/**\n * The domain's item type table (ADR-0155): its active theme of the type, read by things-scene's rule. Asked each time a\n * scene opens, so a board opened after the table changed draws by the new one. A server without themes, or a user with\n * no right to read them, gets an empty table.\n */\nexport async function fetchDomainItemTypes(type: string = ITEM_TYPES_THEME): Promise<ItemTypeTable> {\n try {\n const { data } = await client.query({\n query: ITEM_TYPE_THEMES,\n variables: { filters: [{ name: 'type', operator: 'eq', value: type }] },\n fetchPolicy: 'network-only'\n })\n return itemTypesFromThemes(data?.themes?.items ?? [], type)\n } catch {\n return itemTypesFromThemes([], type)\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-types-editor.js","sourceRoot":"","sources":["../../client/item-types/item-types-editor.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,0BAA0B,CAAA;AAEjC,O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E,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;aACvI,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QACD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAA,8BAA8B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,eAAe,yBAAyB,EAAE;YACxI,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,EAAE,EAAE;SACtF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAtCY,sBAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CAsClC","sourcesContent":["/*\n * The value cell of a theme of type item-types (ADR-0155): shows how many types the table has and opens the table in a\n * popup. The value is written back as it came -- an object, or text for a store that keeps text.\n */\nimport './ox-item-types-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, type PopupHandle } from '@operato/popup'\n\nimport { rowsOf, valueOf, type ItemTypeRow } from './item-types-rows.js'\n\n@customElement('ox-grist-editor-item-types')\nexport class OxGristEditorItemTypes extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return html`<div tabindex=\"0\">${i18next.t('figure-library.item-types.count', { count: rowsOf(this.value).length })}</div>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openTable()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n if (e.key == 'Enter') {\n e.stopPropagation()\n this.openTable()\n }\n }\n\n openTable() {\n delete this.popup\n const asText = typeof this.value === 'string'\n const confirmCallback = (rows: ItemTypeRow[]) => {\n const value = valueOf(rows)\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: { before: this.value, after: asText ? JSON.stringify(value) : value, record: this.record, column: this.column, row: this.row }\n })\n )\n }\n this.popup = openPopup(html`<ox-item-types-input .rows=${rowsOf(this.value)} .confirmCallback=${confirmCallback}></ox-item-types-input>`, {\n backdrop: true,\n size: 'large',\n title: `${i18next.t('figure-library.item-types.title')} : ${this.record?.name ?? ''}`\n })\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"item-types-renderer.js","sourceRoot":"","sources":["../../client/item-types/item-types-renderer.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAI1B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE7C,MAAM,CAAC,MAAM,wBAAwB,GAAkB,CAAC,KAAc,EAAE,EAAE;IACxE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5D,OAAO,IAAI,CAAA,eAAe,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;AAC1E,CAAC,CAAA","sourcesContent":["/* The value cell of a theme of type item-types, shown: its codes, as many as fit (ADR-0155). */\nimport { html } from 'lit'\n\nimport type { FieldRenderer } from '@operato/data-grist'\n\nimport { rowsOf } from './item-types-rows.js'\n\nexport const OxGristRendererItemTypes: FieldRenderer = (value: unknown) => {\n const codes = rowsOf(value).map(r => r.code).filter(Boolean)\n return html`<span title=${codes.join(', ')}>${codes.join(' · ')}</span>`\n}\n"]}
|
|
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GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACpI,CAAC","sourcesContent":["/*\n * The item type table as the editor shows it (ADR-0155): one row per type, each cell as typed. The value a theme of\n * type item-types (fmsim: carrier-types) keeps is `{ types: [{ code, name, figure }] }` -- a type has no size\n * (amendment 1); what holds is judged by things-scene's one rule (readItemTypes), so the editor and every scene read a\n * table the same way.\n */\nimport { readItemTypes, type ItemTypeIssue } from '@hatiolab/things-scene'\n\n/** One row as typed. */\nexport interface ItemTypeRow {\n code: string\n name: string\n figure: string\n}\n\nexport const emptyRow = (): ItemTypeRow => ({ code: '', name: '', figure: '' })\n\nconst text = (v: unknown) => (v === undefined || v === null ? '' : String(v))\n\n/** The rows of a theme's value; a value given as text (a store that keeps text) is read as JSON. Anything else: none. */\nexport function rowsOf(value: unknown): ItemTypeRow[] {\n let v = value\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n } catch {\n return []\n }\n }\n const types = v && typeof v === 'object' && Array.isArray((v as any).types) ? (v as any).types : []\n return types.map((t: any) => ({ code: text(t?.code), name: text(t?.name), figure: text(t?.figure) }))\n}\n\n/** The value the rows make. Rows with nothing typed are left out. */\nexport function valueOf(rows: ReadonlyArray<ItemTypeRow>): { types: any[] } {\n return {\n types: rows\n .filter(r => Object.values(r).some(c => c.trim() !== ''))\n .map(r => {\n const type: any = { code: r.code }\n if (r.name.trim()) type.name = r.name\n if (r.figure.trim()) type.figure = r.figure.trim()\n return type\n })\n }\n}\n\n/** What does not hold, by row: the issues of things-scene's rule, each on the rows (of those written) it names. */\nexport function rowIssues(rows: ReadonlyArray<ItemTypeRow>): Map<number, ItemTypeIssue[]> {\n const written = rows.map((r, i) => [r, i] as const).filter(([r]) => Object.values(r).some(c => c.trim() !== ''))\n const { issues } = readItemTypes(valueOf(rows))\n const byRow = new Map<number, ItemTypeIssue[]>()\n const add = (at: number, issue: ItemTypeIssue) => {\n const row = written[at]?.[1]\n if (row !== undefined) byRow.set(row, [...(byRow.get(row) ?? []), issue])\n }\n for (const issue of issues) {\n if ('at' in issue && typeof issue.at === 'number') add(issue.at, issue)\n else if ('at' in issue && Array.isArray(issue.at)) for (const at of issue.at) add(at, issue)\n }\n return byRow\n}\n\n/**\n * What the figure picker shows for each figure: its display name alone, or with its full name when another figure shows\n * the same display name, and the full name when it has none. The full name stays in the picker's tooltip.\n */\nexport function figureChoiceLabels(figures: ReadonlyArray<{ name: string; display?: string | null }>): Map<string, string> {\n const shown = (f: { name: string; display?: string | null }) => (f.display && f.display.trim() ? f.display : f.name)\n const count = new Map<string, number>()\n for (const f of figures) count.set(shown(f), (count.get(shown(f)) ?? 0) + 1)\n return new Map(figures.map(f => [f.name, count.get(shown(f))! > 1 && shown(f) !== f.name ? `${shown(f)} (${f.name})` : shown(f)]))\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-item-types-input.js","sourceRoot":"","sources":["../../client/item-types/ox-item-types-input.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,OAAO,uCAAuC,CAAA;AAC9C,OAAO,qCAAqC,CAAA;AAC5C,OAAO,4BAA4B,CAAA;AACnC,OAAO,oCAAoC,CAAA;AAE3C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,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AE,CAAA;YAC9G,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,CAAa,EAAE,CAAa,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;YACzE,IAAI,CAAC,OAAO,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;QACtC,CAAC;QACD,OAAO,IAAI,CAAC,OAAQ,CAAC,OAAO,CAAA;IAC9B,CAAC;;AA5I0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;8CAAyB;AACvB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDAAgD;AAQ1D;IAAhB,KAAK,EAAE;;0DAA6C;AAxH1C,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA4P5B","sourcesContent":["/*\n * The item type table of a domain (ADR-0155), edited in a popup from a theme of type item-types (fmsim: carrier-types):\n * one row per type -- code, name, the figure it is drawn by. A type has no size; an item is drawn at the size of the\n * place it sits in (amendment 1). The figure is chosen from the names the domain's library marks as items (amendment\n * 1 E · F), shown with their thumbnails. What does not hold is said on its row by things-scene's rule and the table is\n * not confirmed until it holds; a figure written before that is no longer marked is told on its row and does not stop it.\n *\n * The words are the module's translations; an app whose items are called otherwise (fmsim: carriers) says them its own way.\n */\nimport '@material/web/button/filled-button.js'\nimport '@material/web/button/text-button.js'\nimport '@material/web/icon/icon.js'\nimport '@operato/popup/ox-popup-actions.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { QueryController } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { CommonPopupStyles, FormFieldStyles, PopupBodyStyles } from '@operato/styles'\nimport type { ItemTypeIssue } from '@hatiolab/things-scene'\n\nimport { emptyRow, figureChoiceLabels, rowIssues, type ItemTypeRow } from './item-types-rows.js'\nimport { figureLibraryFileUrl } from '../figure-library-file.js'\n\n/* The names the domain draws as items, with the name and thumbnail of the release each draws with. */\nconst ITEM_FIGURES = gql`\n query ($filters: [Filter!], $pagination: Pagination) {\n figureLibraryFigures(filters: $filters, pagination: $pagination) {\n items {\n name\n release {\n name\n dependencies\n }\n }\n }\n }\n`\n\n/** As many item figures as one domain is expected to have; the picker lists them all. */\nconst ITEM_FIGURE_LIMIT = 500\n\ninterface ItemFigure {\n name: string\n label: string\n thumbnail: string\n}\n\nconst t = (key: string, options?: Record<string, unknown>) => i18next.t(`figure-library.item-types.${key}`, options)\n\n/*\n * The house popup (operato-application design/ui/page-standard.md 7 · 8): CommonPopupStyles' card, only the body\n * scrolls (PopupBodyStyles), native fields at the table height (FormFieldStyles small), each row's problems right under\n * it, the row's own button at its end, and cancel · confirm in ox-popup-actions.\n */\n@customElement('ox-item-types-input')\nexport class OxItemTypesInput extends LitElement {\n static styles = [\n CommonPopupStyles,\n PopupBodyStyles,\n FormFieldStyles,\n css`\n :host {\n width: 100%;\n height: 100%;\n max-height: none;\n --popup-min-width: 0;\n }\n table {\n width: 100%;\n border-collapse: collapse;\n }\n th {\n position: sticky;\n top: 0;\n z-index: 1;\n background: var(--ui-bg, #ffffff);\n text-align: left;\n font-weight: normal;\n font-size: var(--popup-font-size-small);\n color: var(--ui-muted, #57676f);\n padding: 0 var(--spacing-small, 4px) var(--spacing-small, 4px);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n white-space: nowrap;\n }\n td {\n padding: var(--spacing-small, 4px);\n vertical-align: middle;\n }\n tr[type] td {\n border-top: 1px solid var(--ui-line-soft, #eef1f3);\n }\n tr[issues] td {\n padding-top: 0;\n }\n /*\n Widths by what they hold (page-standard 7): a code is an identifier such as FORMATION_TRAY, wider than a\n quantity; a type's name is a few words; the figure takes the rest.\n */\n th[code],\n td[code] {\n width: 160px;\n }\n th[name],\n td[name] {\n width: 200px;\n }\n input,\n select {\n width: 100%;\n }\n td[thumb] {\n width: 32px;\n padding-right: 0;\n }\n [thumb] img,\n [thumb] [no-thumb] {\n display: grid;\n place-items: center;\n box-sizing: border-box;\n width: 32px;\n height: 32px;\n object-fit: contain;\n border-radius: var(--md-sys-shape-corner-small, 4px);\n background: var(--md-sys-color-surface-container, #eef1f3);\n color: var(--ui-muted, #57676f);\n --md-icon-size: 16px;\n }\n td[end] {\n width: 1%;\n text-align: right;\n }\n /* A row's own button: quiet, an icon with its name in the tooltip (page-standard 8). */\n button[quiet] {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-small, 4px);\n height: var(--form-element-height-small, 26px);\n padding: 0 var(--spacing-small, 4px);\n border: 0;\n border-radius: var(--md-sys-shape-corner-small, 4px);\n background: transparent;\n color: var(--ui-muted, #57676f);\n font: inherit;\n font-weight: 600;\n cursor: pointer;\n --md-icon-size: 16px;\n }\n button[quiet]:hover {\n background: var(--ui-line-soft, #eef1f3);\n color: var(--ui-ink, #17242c);\n }\n button[quiet][add] md-icon {\n color: var(--md-sys-color-primary);\n }\n [issue] {\n color: var(--ui-crit, var(--md-sys-color-error));\n font-size: var(--popup-font-size-small);\n }\n [warning] {\n color: var(--ui-muted, #57676f);\n font-size: var(--popup-font-size-small);\n }\n `\n ]\n\n /** The rows as typed; the popup's own copy (see the note in ox-popup-value-map-input on re-rendered popups). */\n @property({ type: Array }) rows: ItemTypeRow[] = []\n @property({ type: Object }) confirmCallback?: (rows: ItemTypeRow[]) => void\n\n /* The domain's item figures (ADR-0190). */\n private itemFigures = new QueryController(this, ITEM_FIGURES, {\n variables: () => ({ filters: [{ name: 'item', operator: 'eq', value: true }], pagination: { page: 1, limit: ITEM_FIGURE_LIMIT } })\n })\n private choices?: { of: unknown; figures: ItemFigure[] }\n /** Thumbnails that could not be drawn: the empty mark in their place, not a broken image. */\n @state() private unreadThumbnails = new Set<string>()\n\n render() {\n const issues = rowIssues(this.rows)\n return html`\n <div class=\"body\">\n ${this.figures?.length === 0 ? html`<div class=\"note\">${t('no-item-figures')}</div>` : nothing}\n <table>\n <thead>\n <tr>\n <th></th>\n <th code>${t('code')}</th>\n <th name>${t('name')}</th>\n <th>${t('figure')}</th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n ${this.rows.map((row, i) => this.renderRow(row, i, issues.get(i) ?? []))}\n <tr>\n <td></td>\n <td colspan=\"4\"><button quiet add @click=${this.onAdd}><md-icon>add</md-icon>${t('add')}</button></td>\n </tr>\n </tbody>\n </table>\n ${issues.size ? html`<div class=\"failure\">${t('fix-rows', { count: issues.size })}</div>` : nothing}\n </div>\n <ox-popup-actions>\n <md-text-button slot=\"cancel\" @click=${this.onCancel}>${i18next.t('button.cancel')}</md-text-button>\n <md-filled-button slot=\"confirm\" ?disabled=${issues.size > 0} @click=${this.onConfirm}>${i18next.t('button.confirm')}</md-filled-button>\n </ox-popup-actions>\n `\n }\n\n private renderRow(row: ItemTypeRow, i: number, issues: ItemTypeIssue[]) {\n const figures = this.figures ?? []\n const chosen = figures.find(f => f.name === row.figure)\n /* A figure written before that the library no longer marks as an item: kept as written, and told. */\n const unmarked = !!row.figure && this.figures !== null && !chosen\n const thumbnail = chosen?.thumbnail && !this.unreadThumbnails.has(chosen.thumbnail) ? chosen.thumbnail : ''\n return html`\n <tr type>\n <td thumb>\n ${thumbnail\n ? html`<img src=${thumbnail} alt=\"\" @error=${() => (this.unreadThumbnails = new Set([...this.unreadThumbnails, thumbnail]))} />`\n : html`<span no-thumb title=${row.figure ? t('no-thumbnail') : t('figure-none')}>\n <md-icon>${row.figure ? 'image_not_supported' : 'inventory_2'}</md-icon>\n </span>`}\n </td>\n <td code><input small .value=${row.code} data-row=${i} data-key=\"code\" @input=${this.onInput} /></td>\n <td name><input small .value=${row.name} data-row=${i} data-key=\"name\" @input=${this.onInput} /></td>\n <td>\n <select small data-row=${i} data-key=\"figure\" title=${row.figure} @change=${this.onInput}>\n <option value=\"\" ?selected=${!row.figure}>${t('figure-none')}</option>\n ${unmarked ? html`<option value=${row.figure} selected>${row.figure}</option>` : nothing}\n ${figures.map(f => html`<option value=${f.name} ?selected=${f.name === row.figure}>${f.label}</option>`)}\n </select>\n </td>\n <td end>\n <button quiet remove title=${t('remove')} aria-label=${t('remove')} data-row=${i} @click=${this.onRemove}><md-icon>delete</md-icon></button>\n </td>\n </tr>\n ${issues.length || unmarked\n ? html`<tr issues>\n <td></td>\n <td colspan=\"4\">\n ${issues.map(issue => html`<div issue>${this.issueText(issue)}</div>`)}\n ${unmarked ? html`<div warning>${t('figure-not-item')}</div>` : nothing}\n </td>\n </tr>`\n : nothing}\n `\n }\n\n /* A code that does not hold is invalid to the browser too: the shared field style outlines it once it is typed in (:user-invalid). */\n updated() {\n const issues = rowIssues(this.rows)\n this.renderRoot.querySelectorAll<HTMLInputElement>('input[data-key=\"code\"]').forEach(input => {\n const row = issues.get(Number(input.dataset.row))\n input.setCustomValidity(row?.length ? this.issueText(row[0]) : '')\n })\n }\n\n private issueText(issue: ItemTypeIssue): string {\n if (issue.code === 'item-type-duplicate') return t('issue.duplicate', { rows: issue.at.map(n => n + 1).join(', ') })\n return t(`issue.${issue.code.replace('item-type-', '')}`)\n }\n\n private onInput(e: Event) {\n const input = e.target as HTMLInputElement | HTMLSelectElement\n const i = Number(input.dataset.row)\n const key = input.dataset.key as keyof ItemTypeRow\n this.rows = this.rows.map((r, n) => (n === i ? { ...r, [key]: input.value } : r))\n }\n\n private onAdd() {\n this.rows = [...this.rows, emptyRow()]\n }\n\n private onRemove(e: Event) {\n const i = Number((e.currentTarget as HTMLElement).dataset.row)\n this.rows = this.rows.filter((_, n) => n !== i)\n }\n\n private onCancel() {\n closePopup(this)\n }\n\n private onConfirm() {\n if (rowIssues(this.rows).size) return\n this.confirmCallback?.(this.rows)\n closePopup(this)\n }\n\n /** The domain's item figures by display name; null until they are read, empty when the library cannot be read or marks none. */\n private get figures(): ItemFigure[] | null {\n if (this.itemFigures.error) return []\n const data = this.itemFigures.data\n if (!data) return null\n if (this.choices?.of !== data) {\n const items = data.figureLibraryFigures?.items ?? []\n const labels = figureChoiceLabels(items.map((item: any) => ({ name: item.name, display: item.release?.name })))\n const figures = items\n .map((item: any) => {\n const hash = item.release?.dependencies?.find((d: any) => d.role === 'thumbnail')?.hash\n return { name: item.name, label: labels.get(item.name)!, thumbnail: hash ? figureLibraryFileUrl(hash) : '' }\n })\n .sort((a: ItemFigure, b: ItemFigure) => a.label.localeCompare(b.label))\n this.choices = { of: data, figures }\n }\n return this.choices!.figures\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legend-looks-editor.js","sourceRoot":"","sources":["../../client/legend-looks/legend-looks-editor.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAoB,MAAM,gBAAgB,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAErE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAoC,MAAM,mBAAmB,CAAA;AAE7F;;;;;GAKG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,aAAa;IAGlD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAA,qBAAqB,OAAO,CAAC,CAAC,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAA;IAC1I,CAAC;I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;IACH,CAAC;;AA5C2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAA+B;AAC9B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yDAA+C;AAE/C;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;iDAA0B;AAKG;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;;oDAAmB;AAEjB;IAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;;sDAAsB;AAhClE,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAmE5B","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-legend-looks.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { closePopup, openPopup, type PopupHandle } from '@operato/popup'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\n\nimport { legendLooksOf, legendOf, type LegendLooks, type LookInput } from './legend-looks.js'\n\n/**\n * A legend theme's value, edited look by look (ADR-0166 11): the board's 「테마」 list opens this for its legend kinds --\n * a code map (`color-map`, `animation-map`) or a range map (`color-ranges`) -- when this module is loaded. Each code's\n * colour, effect, values for named state inputs, and a motion group's clip, speed and pause; what else an entry holds\n * is kept. A look that is a colour alone is written as the colour, as a colour map keeps it.\n */\n@customElement('legend-looks-editor')\nexport class LegendLooksEditor extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return html`<div tabindex=\"0\">${i18next.t('figure.label.legend-count', { count: Object.keys(legendLooksOf(this.value)).length })}</div>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openLooks()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n if (e.key == 'Enter') {\n e.stopPropagation()\n this.openLooks()\n }\n }\n\n /** The value written back as it came -- an object, or text for a store that keeps text. */\n openLooks() {\n delete this.popup\n const asText = typeof this.value === 'string'\n /* The popup is drawn again from its first binding when the layout redraws: the looks being edited live in `draft`. */\n const draft = { looks: legendLooksOf(this.value) }\n const confirmCallback = (looks: LegendLooks) => {\n const after = legendOf(looks)\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: { before: this.value, after: asText ? JSON.stringify(after) : after, record: this.record, column: this.column, row: this.row }\n })\n )\n }\n this.popup = openPopup(html`<legend-looks-popup .draft=${draft} .confirmCallback=${confirmCallback}></legend-looks-popup>`, {\n backdrop: true,\n size: 'large',\n title: `${i18next.t('figure.label.legend-edit')} : ${this.record?.name ?? ''}`\n })\n }\n}\n\n@customElement('legend-looks-popup')\nexport class LegendLooksPopup extends LitElement {\n static styles = [\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--md-sys-color-surface);\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-legend-looks {\n flex: 1;\n overflow-y: auto;\n padding: var(--spacing-medium, 8px);\n align-content: start;\n }\n `\n ]\n\n @property({ type: Object }) draft!: { looks: LegendLooks }\n @property({ type: Object }) confirmCallback!: (looks: LegendLooks) => void\n /** Inputs offered for a value, with name, unit and range (fmsim: those its carrier figures' tables set). */\n @property({ type: Array }) addable: LookInput[] = []\n /**\n * Colour only: no effect, no values, no motion -- fmsim's carrier legend, whose figures take the thickness from their own\n * fixed table (ADR-0167 12). What an entry already holds is kept.\n */\n @property({ type: Boolean, attribute: 'colour-only' }) colourOnly = false\n /** The colour a new code starts with: a colour map's entries have one. */\n @property({ type: String, attribute: 'default-color' }) defaultColor?: string\n\n render() {\n return html`\n <ox-legend-looks\n .looks=${this.draft.looks}\n .addable=${this.addable}\n default-color=${this.defaultColor ?? ''}\n show-given\n ?name-inputs=${!this.addable.length}\n ?no-values=${this.colourOnly}\n ?effects=${!this.colourOnly}\n ?motion=${!this.colourOnly}\n ?color-optional=${!this.colourOnly}\n @looks-change=${(e: CustomEvent<{ looks: LegendLooks }>) => {\n e.stopPropagation()\n this.draft.looks = e.detail.looks\n }}\n ></ox-legend-looks>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${() => closePopup(this)} danger><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>\n <button\n @click=${() => {\n this.confirmCallback?.(this.draft.looks)\n closePopup(this)\n }}\n done\n >\n <md-icon>done</md-icon>${i18next.t('button.confirm')}\n </button>\n </div>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'legend-looks-editor': LegendLooksEditor\n 'legend-looks-popup': LegendLooksPopup\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legend-looks.js","sourceRoot":"","sources":["../../client/legend-looks/legend-looks.ts"],"names":[],"mappings":"AA0CA,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAgC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAChH,MAAM,QAAQ,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAEhG,wIAAwI;AACxI,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,CAAC,GAAG,KAAK,CAAA;IACb,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC1B,IAAI,CAAC;YACH,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACnB,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IACD,IAAI,CAAC,Q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AAQ,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;AACpE,CAAC","sourcesContent":["/*\n * A legend as a person reads and writes it (ADR-0166 7, 11): a board-service theme record -- code (or interval) → look --\n * that a consumer may give a figure's table of the same role in its place. A look holds the columns of a table's\n * entries: a colour, an effect, a value per state input, a clip, a speed, a pause. A colour map keeps a look that is a\n * colour alone as the colour itself, so a 2D reader of the map reads it as before; what else an entry holds (fmsim's 2D\n * animation) is kept as it is.\n *\n * Nothing here decides how a look is taken: things-scene looks a code up (`resolveLegend`, `resolveLegendEntries`) and\n * says what it did not take on the figure's inputs. Kept apart from the elements so it is tested without a board.\n */\nimport type { FigureAsset, FigureDataTableBinding } from '@hatiolab/figure-model'\n\nexport interface LegendLookEffect {\n kind: 'blink' | 'glow'\n hz?: number\n}\n\n/** One code's look. Any part may be missing; a value is in its input's own unit. Other fields of an entry ride along. */\nexport interface LegendLook {\n color?: string\n effect?: LegendLookEffect | null\n values?: Record<string, number>\n clip?: string\n speed?: number\n paused?: boolean\n [other: string]: unknown\n}\n\n/** A legend's looks: code → look, `default` for a code it does not name. */\nexport type LegendLooks = Record<string, LegendLook>\n\n/** A state input a legend may give a value to: the input, its name, unit and range, and the figures' tables that take it. */\nexport interface LookInput {\n input: string\n label: string\n unit?: string\n min?: number\n max?: number\n /** What gives it, as the choice says it: the figures and the tables. */\n givenBy?: string\n}\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v)\nconst isColour = (v: unknown): v is string => typeof v === 'string' && /^#[0-9a-f]{6}$/i.test(v)\n\n/** A legend's value as looks: an entry that is a colour is that colour; one that is a record is itself; anything else reads as none. */\nexport function legendLooksOf(value: unknown): LegendLooks {\n let v = value\n if (typeof v === 'string') {\n try {\n v = JSON.parse(v)\n } catch {\n return {}\n }\n }\n if (!isRecord(v)) return {}\n const out: LegendLooks = {}\n for (const [code, entry] of Object.entries(v)) {\n if (isColour(entry)) out[code] = { color: entry }\n else if (isRecord(entry)) out[code] = { ...entry }\n }\n return out\n}\n\n/** Looks as a legend keeps them: a look that is a colour alone is the colour, as a colour map has it; the rest whole. */\nexport function legendOf(looks: LegendLooks): Record<string, unknown> {\n return Object.fromEntries(Object.entries(looks).map(([code, look]) => [code, Object.keys(look).length === 1 && isColour(look.color) ? look.color : look]))\n}\n\n/**\n * One code's look with some parts changed: a part given as undefined is taken away, so the legend no longer gives it.\n * A look left with nothing stays, as a code the legend names.\n */\nexport function withLook(looks: LegendLooks, code: string, patch: Partial<LegendLook>): LegendLooks {\n const look: LegendLook = { ...(looks[code] ?? {}) }\n for (const [part, value] of Object.entries(patch)) {\n if (value === undefined) delete look[part]\n else look[part] = value\n }\n return { ...looks, [code]: look }\n}\n\n/** One value of one code's look: a number sets it, undefined takes it away. Other inputs' values stay as they were. */\nexport function withLookValue(looks: LegendLooks, code: string, input: string, value: number | undefined): LegendLooks {\n const held = looks[code]?.values\n const values: Record<string, unknown> = isRecord(held) ? { ...held } : {}\n if (value === undefined) delete values[input]\n else values[input] = value\n return withLook(looks, code, { values: Object.keys(values).length ? (values as Record<string, number>) : undefined })\n}\n\nexport function withCode(looks: LegendLooks, code: string): LegendLooks {\n return code in looks ? looks : { ...looks, [code]: {} }\n}\n\nexport function withoutCode(looks: LegendLooks, code: string): LegendLooks {\n const { [code]: _gone, ...rest } = looks\n return rest\n}\n\n/** The inputs some look gives a value to, in the order first met. */\nexport function inputsGivenIn(looks: LegendLooks): string[] {\n const seen = new Set<string>()\n for (const look of Object.values(looks)) if (isRecord(look.values)) for (const input of Object.keys(look.values)) seen.add(input)\n return [...seen]\n}\n\n/** The tables of a figure a legend may take the place of: those naming a legend role, each with its role. */\nexport const legendTablesOf = (asset: FigureAsset): FigureDataTableBinding[] =>\n (asset.dataInterface?.bindings ?? []).filter((b): b is FigureDataTableBinding => b.rule === 'table' && !!b.legend)\n\n/**\n * The state inputs a legend of a role may give values to on this figure: each input a table of that role sets, with its\n * name, unit and range. `role` left out: every table that names a role.\n */\nexport function legendInputsOf(asset: FigureAsset, role?: string): LookInput[] {\n const declared = new Map(asset.document.model.inputs.map(i => [i.id, i] as const))\n const out: LookInput[] = []\n for (const b of legendTablesOf(asset)) {\n if (role !== undefined && b.legend!.role !== role) continue\n for (const input of b.targets.inputs ?? []) {\n if (out.some(o => o.input === input)) continue\n const d = declared.get(input)\n out.push({\n input,\n label: asset.stateInputs?.[input]?.label ?? input,\n ...(d?.unit !== undefined ? { unit: d.unit } : {}),\n ...(d?.min !== undefined ? { min: d.min } : {}),\n ...(d?.max !== undefined ? { max: d.max } : {}),\n givenBy: b.label ?? b.accessor\n })\n }\n }\n return out\n}\n\n/**\n * Which kind of legend fits a table (ADR-0166 7): a code table takes a code map (`color-map`, `animation-map`), a range\n * table a range map (`color-ranges`). A legend whose kind the scene does not say is told by its keys: every key but\n * `default` an interval `from~to` is a range map.\n */\nexport function legendFits(lookup: 'code' | 'ranges', legend: unknown): boolean {\n const looks = legendLooksOf(legend)\n const keys = Object.keys(looks).filter(k => k !== 'default')\n if (!Object.keys(looks).length) return false\n const ranged = keys.length > 0 && keys.every(k => /^-?[\\d.]*~-?[\\d.]*$/.test(k))\n return lookup === 'ranges' ? ranged || keys.length === 0 : !ranged\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-legend-looks.js","sourceRoot":"","sources":["../../client/legend-looks/ox-legend-looks.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,WAAW,EAAoC,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CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;AACjG,CAAC;AAED,SAAS,OAAO,CAAC,KAAgB;IAC/B,OAAO,KAAK,CAAC,GAAG,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACjH,CAAC","sourcesContent":["import { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\nimport { inputsGivenIn, withCode, withLook, withLookValue, withoutCode, type LegendLooks, type LookInput } from './legend-looks.js'\n\nconst DEFAULT = 'default'\n\n/**\n * A legend's looks, one card per code (ADR-0166 7, 11): its colour, its effect, a value for each state input the\n * figures' tables of its role set -- with the input's name, unit and range -- and a clip, speed and pause for a motion\n * group. Every change sends `looks-change` with the whole looks; the host writes them where the legend lives.\n *\n * A value outside its input's range is not taken from the field (as the property panel's number maps). Values for\n * inputs not shown -- another figure's, in a legend shared by many -- are kept as they are, and so is whatever else an\n * entry holds (fmsim's 2D animation).\n *\n * The one legend editor: the board's legend themes (「테마」) and fmsim's legend editor both write looks through it.\n */\n@customElement('ox-legend-looks')\nexport class OxLegendLooks extends LitElement {\n static styles = css`\n :host {\n display: grid;\n gap: 6px;\n font: var(--property-editor-field-font, 0.76rem var(--theme-font, Roboto, sans-serif));\n color: var(--md-sys-color-on-surface);\n }\n\n [cards] {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(var(--legend-looks-card-min, 220px), 1fr));\n gap: 6px;\n }\n\n section {\n display: grid;\n gap: 3px;\n padding: 4px 6px 6px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n }\n\n header {\n display: flex;\n align-items: center;\n gap: 6px;\n min-height: 24px;\n }\n\n header b {\n font-weight: 600;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n header [end] {\n margin-left: auto;\n display: flex;\n gap: 2px;\n }\n\n input[type='color'] {\n flex: none;\n width: 22px;\n height: 18px;\n padding: 0;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 4px;\n background: none;\n cursor: pointer;\n }\n\n input[type='color']::-webkit-color-swatch-wrapper {\n padding: 1px;\n }\n\n input[type='color']::-webkit-color-swatch {\n border: none;\n border-radius: 3px;\n }\n\n /*\n * No colour given: the swatch is an empty dashed box until one is picked. A colour the field cannot show, it shows\n * black, as the browser does; the figure's refusal says why.\n */\n input[type='color'][unset] {\n border-style: dashed;\n opacity: 0.6;\n }\n\n input[type='color'][unset]::-webkit-color-swatch {\n background: transparent !important;\n }\n\n [fields] {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(56px, 72px) minmax(0, auto);\n gap: 3px 6px;\n align-items: center;\n }\n\n [fields] > [name] {\n color: var(--md-sys-color-on-surface-variant);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n [fields] > [unit] {\n color: var(--md-sys-color-outline);\n font-size: 0.68rem;\n white-space: nowrap;\n }\n\n input:not([type='color']),\n select {\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n height: var(--property-editor-field-height, 24px);\n padding: 0 4px;\n font: inherit;\n color: inherit;\n border: var(--property-editor-border, 1px solid var(--md-sys-color-outline-variant));\n border-radius: var(--property-editor-border-radius, 6px);\n background: var(--property-editor-background, var(--md-sys-color-surface-container-high));\n }\n\n input[type='number'] {\n text-align: right;\n font-variant-numeric: tabular-nums;\n }\n\n input:hover,\n select:hover {\n border-color: var(--property-editor-border-color-hover, var(--md-sys-color-outline-variant));\n }\n\n input:focus,\n select:focus {\n outline: none;\n border-color: var(--property-editor-border-color-focus, var(--md-sys-color-primary));\n }\n\n [aria-invalid='true'] {\n border-color: var(--md-sys-color-error) !important;\n }\n\n /* The effect's choice takes the field and the unit columns; a blink's rate takes the field after it. */\n [fields] > select[wide] {\n grid-column: 2 / -1;\n }\n\n button {\n height: 24px;\n padding: 0 8px;\n font: inherit;\n color: var(--md-sys-color-primary);\n border: none;\n border-radius: 6px;\n background: transparent;\n cursor: pointer;\n white-space: nowrap;\n }\n\n button:hover {\n background: var(--md-sys-color-surface-container-high);\n }\n\n button[icon] {\n width: 22px;\n padding: 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n\n footer {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n align-items: center;\n }\n\n footer input {\n flex: 1 1 80px;\n width: auto;\n }\n\n footer select {\n flex: 1 1 120px;\n width: auto;\n }\n\n [empty] {\n margin: 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n `\n\n @property({ type: Object }) looks: LegendLooks = {}\n /** The state inputs shown, one field each. */\n @property({ type: Array }) inputs: LookInput[] = []\n /** Inputs that can be added as a field: those the figures' tables of the legend's role set. */\n @property({ type: Array }) addable: LookInput[] = []\n /** Whether every input a look gives a value to has a field, offered or not: a legend, which no one figure reads. */\n @property({ type: Boolean, attribute: 'show-given' }) showGiven = false\n /** Whether an input can be added by its name typed, when no figure says which there are. */\n @property({ type: Boolean, attribute: 'name-inputs' }) nameInputs = false\n /** The clips a look may choose; none, no clip field. */\n @property({ type: Array }) clips: string[] = []\n @property({ type: Boolean }) effects = false\n /** Whether a look may give a motion group's speed and pause. */\n @property({ type: Boolean }) motion = false\n /** Whether a look may give no colour; a colour map's entry has one. */\n @property({ type: Boolean, attribute: 'color-optional' }) colorOptional = false\n /** The colour a new code starts with. */\n @property({ type: String, attribute: 'default-color' }) defaultColor?: string\n /** Whether looks give values at all: a legend whose consumer takes colour and effect only (fmsim's carrier legends) gives none. */\n @property({ type: Boolean, attribute: 'no-values' }) noValues = false\n @property({ type: Boolean }) disabled = false\n\n @state() private added: LookInput[] = []\n @state() private newCode = ''\n @state() private newInput = ''\n\n render() {\n const codes = Object.keys(this.looks).sort((a, b) => Number(a === DEFAULT) - Number(b === DEFAULT))\n const shown = this.shownInputs()\n const addable = this.noValues ? [] : this.addable.filter(a => !shown.some(s => s.input === a.input))\n return html`\n ${codes.length\n ? html`<div cards>${codes.map(code => this.renderCard(code, shown))}</div>`\n : html`<p empty>${i18next.t('figure.text.legend-looks-empty')}</p>`}\n <footer>\n <input\n aria-label=${i18next.t('figure.label.legend-code')}\n placeholder=${i18next.t('figure.label.legend-code')}\n .value=${this.newCode}\n ?disabled=${this.disabled}\n @input=${(e: Event) => (this.newCode = (e.target as HTMLInputElement).value)}\n @keydown=${(e: KeyboardEvent) => e.key === 'Enter' && this.addCode(this.newCode)}\n />\n <button ?disabled=${this.disabled || !this.newCode.trim()} @click=${() => this.addCode(this.newCode)}>${i18next.t('figure.button.legend-add-code')}</button>\n ${DEFAULT in this.looks ? nothing : html`<button ?disabled=${this.disabled} @click=${() => this.addCode(DEFAULT)}>${i18next.t('figure.button.legend-add-default')}</button>`}\n ${addable.length\n ? html`<select\n aria-label=${i18next.t('figure.button.legend-add-value')}\n ?disabled=${this.disabled}\n @change=${(e: Event) => {\n const select = e.target as HTMLSelectElement\n const picked = addable.find(a => a.input === select.value)\n if (picked) this.added = [...this.added, picked]\n select.value = ''\n }}\n >\n <option value=\"\">${i18next.t('figure.button.legend-add-value')}</option>\n ${addable.map(a => html`<option value=${a.input}>${describeInput(a)}</option>`)}\n </select>`\n : nothing}\n ${this.nameInputs && !this.noValues\n ? html`<input\n aria-label=${i18next.t('figure.label.legend-input-name')}\n placeholder=${i18next.t('figure.label.legend-input-name')}\n .value=${this.newInput}\n ?disabled=${this.disabled}\n @input=${(e: Event) => (this.newInput = (e.target as HTMLInputElement).value)}\n />\n <button ?disabled=${this.disabled || !this.newInput.trim()} @click=${() => this.addInput(this.newInput)}>${i18next.t('figure.button.legend-add-value')}</button>`\n : nothing}\n </footer>\n `\n }\n\n /** The inputs shown: those given, those added here, and, with `showGiven`, any a look gives a value to. */\n private shownInputs(): LookInput[] {\n if (this.noValues) return []\n const shown = [...this.inputs]\n for (const one of this.added) if (!shown.some(s => s.input === one.input)) shown.push(one)\n if (this.showGiven)\n for (const input of inputsGivenIn(this.looks))\n if (!shown.some(s => s.input === input)) shown.push(this.addable.find(a => a.input === input) ?? { input, label: input })\n return shown\n }\n\n private renderCard(code: string, inputs: LookInput[]) {\n const look = this.looks[code] ?? {}\n const values = look.values && typeof look.values === 'object' ? (look.values as Record<string, unknown>) : {}\n const effect = look.effect && typeof look.effect === 'object' ? look.effect : undefined\n return html`<section data-code=${code}>\n <header>\n <input\n type=\"color\"\n aria-label=${i18next.t('figure.label.legend-color')}\n title=${look.color === undefined ? i18next.t('figure.label.legend-color-none') : String(look.color)}\n ?unset=${look.color === undefined}\n .value=${typeof look.color === 'string' ? look.color : '#000000'}\n ?disabled=${this.disabled}\n @change=${(e: Event) => this.change(withLook(this.looks, code, { color: (e.target as HTMLInputElement).value.toUpperCase() }))}\n />\n <b title=${code}>${code === DEFAULT ? i18next.t('figure.label.legend-default-code') : code}</b>\n <span end>\n ${this.colorOptional && look.color !== undefined\n ? html`<button icon title=${i18next.t('figure.button.legend-clear-color')} ?disabled=${this.disabled} @click=${() => this.change(withLook(this.looks, code, { color: undefined }))}>⌀</button>`\n : nothing}\n <button icon title=${i18next.t('figure.button.legend-remove-code')} ?disabled=${this.disabled} @click=${() => this.change(withoutCode(this.looks, code))}>×</button>\n </span>\n </header>\n <div fields>\n ${this.effects\n ? html`<span name>${i18next.t('figure.label.legend-effect')}</span>\n <select\n ?wide=${effect?.kind !== 'blink'}\n aria-label=${i18next.t('figure.label.legend-effect')}\n ?disabled=${this.disabled}\n @change=${(e: Event) => {\n const kind = (e.target as HTMLSelectElement).value\n this.change(withLook(this.looks, code, { effect: kind === 'blink' ? { kind, hz: effect?.hz ?? 1 } : kind === 'glow' ? { kind } : undefined }))\n }}\n >\n ${['', 'blink', 'glow'].map(k => html`<option value=${k} ?selected=${(effect?.kind ?? '') === k}>${i18next.t('figure.label.legend-effect-' + (k || 'none'))}</option>`)}\n </select>\n ${effect?.kind === 'blink'\n ? html`<input\n type=\"number\"\n step=\"any\"\n aria-label=${i18next.t('figure.label.legend-effect-hz')}\n .value=${String(effect.hz ?? 1)}\n ?disabled=${this.disabled}\n @change=${(e: Event) => {\n const hz = (e.target as HTMLInputElement).valueAsNumber\n if (!(Number.isFinite(hz) && hz > 0)) return this.requestUpdate()\n this.change(withLook(this.looks, code, { effect: { kind: 'blink', hz } }))\n }}\n />`\n : nothing}`\n : nothing}\n ${inputs.map(input => {\n const held = values[input.input]\n return html`<span name title=${describeInput(input)}>${input.label}</span>\n <input\n type=\"number\"\n step=\"any\"\n data-input=${input.input}\n aria-label=${input.label}\n placeholder=${rangeOf(input) ?? ''}\n .value=${held === undefined ? '' : String(held)}\n ?disabled=${this.disabled}\n @change=${(e: Event) => this.changeValue(code, input, e.target as HTMLInputElement)}\n />\n <span unit>${[input.unit, rangeOf(input)].filter(Boolean).join(' ')}</span>`\n })}\n ${this.clips.length\n ? html`<span name>${i18next.t('figure.label.legend-clip')}</span>\n <select\n wide\n aria-label=${i18next.t('figure.label.legend-clip')}\n ?disabled=${this.disabled}\n @change=${(e: Event) => this.change(withLook(this.looks, code, { clip: (e.target as HTMLSelectElement).value || undefined }))}\n >\n <option value=\"\" ?selected=${look.clip === undefined}>${i18next.t('figure.label.legend-clip-none')}</option>\n ${[...new Set([...this.clips, ...(look.clip !== undefined && !this.clips.includes(look.clip) ? [look.clip] : [])])].map(\n clip => html`<option value=${clip} ?selected=${look.clip === clip}>${clip}</option>`\n )}\n </select>`\n : nothing}\n ${this.motion\n ? html`<span name>${i18next.t('figure.label.legend-speed')}</span>\n <input\n type=\"number\"\n step=\"any\"\n min=\"0\"\n max=\"3\"\n aria-label=${i18next.t('figure.label.legend-speed')}\n .value=${typeof look.speed === 'number' ? String(look.speed) : ''}\n ?disabled=${this.disabled}\n @change=${(e: Event) => {\n const field = e.target as HTMLInputElement\n const speed = field.valueAsNumber\n if (field.value.trim() === '') return this.change(withLook(this.looks, code, { speed: undefined }))\n if (!(speed >= 0 && speed <= 3)) return this.requestUpdate()\n this.change(withLook(this.looks, code, { speed }))\n }}\n />\n <span unit>0~3</span>\n <span name>${i18next.t('figure.label.legend-paused')}</span>\n <select\n wide\n aria-label=${i18next.t('figure.label.legend-paused')}\n ?disabled=${this.disabled}\n @change=${(e: Event) => {\n const v = (e.target as HTMLSelectElement).value\n this.change(withLook(this.looks, code, { paused: v === '' ? undefined : v === 'true' }))\n }}\n >\n ${['', 'false', 'true'].map(v => html`<option value=${v} ?selected=${String(look.paused ?? '') === v}>${i18next.t('figure.label.legend-paused-' + (v || 'none'))}</option>`)}\n </select>`\n : nothing}\n </div>\n </section>`\n }\n\n private addCode(code: string) {\n const trimmed = code.trim()\n if (!trimmed) return\n this.newCode = ''\n if (trimmed in this.looks) return\n this.change(this.defaultColor ? withLook(this.looks, trimmed, { color: this.defaultColor }) : withCode(this.looks, trimmed))\n }\n\n /** A number in range is taken; an empty field takes the value away (the next source gives it); anything else is not taken. */\n private changeValue(code: string, input: LookInput, field: HTMLInputElement) {\n if (field.value.trim() === '') return this.change(withLookValue(this.looks, code, input.input, undefined))\n const value = field.valueAsNumber\n const outside = !Number.isFinite(value) || (input.min !== undefined && value < input.min) || (input.max !== undefined && value > input.max)\n if (outside) {\n const held = this.looks[code]?.values?.[input.input]\n field.value = held === undefined ? '' : String(held)\n return\n }\n this.change(withLookValue(this.looks, code, input.input, value))\n }\n\n /** An input named by hand: a field for it on every card, its values the looks' own. */\n private addInput(name: string) {\n const input = name.trim()\n this.newInput = ''\n if (!input || this.added.some(a => a.input === input) || this.inputs.some(a => a.input === input)) return\n this.added = [...this.added, { input, label: input }]\n }\n\n private change(looks: LegendLooks) {\n this.looks = looks\n this.dispatchEvent(new CustomEvent('looks-change', { bubbles: true, composed: true, detail: { looks } }))\n }\n}\n\n/** An input as the choice and the tooltip say it: its name, unit and range, and the tables that set it. */\nexport function describeInput(input: LookInput): string {\n const tail = [input.unit, rangeOf(input)].filter(Boolean).join(' ')\n return `${input.label}${tail ? ` (${tail})` : ''}${input.givenBy ? ` · ${input.givenBy}` : ''}`\n}\n\nfunction rangeOf(input: LookInput): string | undefined {\n return input.min !== undefined || input.max !== undefined ? `${input.min ?? ''}~${input.max ?? ''}` : undefined\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ox-legend-looks': OxLegendLooks\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"figure-library-page.js","sourceRoot":"","sources":["../../client/pages/figure-library-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,sCAAsC,CAAA;AAC7C,OAAO,gEAAgE,CAAA;AACvE,OAAO,uCAAuC,CAAA;AAC9C,OAAO,uCAAuC,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAE5D,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAW,MAAM,KAAK,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAElI,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;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ox-card-thumb.js'\nimport '@things-factory/figure-viewer/dist-client/figure-thumb-mark.js'\nimport '../viewparts/figure-releases-popup.js'\nimport '../viewparts/figure-package-import.js'\nimport { versionText } from '../viewparts/figure-version.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, nothing } from 'lit'\nimport { customElement, query, state } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { openPopup } from '@operato/popup'\nimport { PageView } from '@operato/shell'\nimport { CardCatalogStyles, CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\n\nimport { figureLibraryFileUrl } from '../figure-library-file.js'\n\n/*\n * The board server's figures (ADR-0114, amended 2026-10-12), as a card catalogue with the board catalog's card: the\n * thumbnail, the name, and one line - the full name and the version it draws with. The one thing to know before opening\n * a card is its corner marker: cannot be read here, not drawing the latest, or deprecated. Clicking a card opens its\n * releases side by side to compare them and choose the one it draws with.\n *\n * The library is expected to grow to many figures, so the list pages from the server and the filters (category,\n * capability) are drop-down lists in the filter bar beside the name search. Upload, the screen's one primary action, is\n * the FAB; it opens a popup whose drop box takes the package and says what it came to.\n */\n\nconst FIGURES = gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: figureLibraryFigures(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n name\n archivedAt\n item\n latestVersion\n releaseCount\n release {\n id\n name\n version\n category\n capabilities\n formatSupported\n deprecated\n dependencies\n }\n latest {\n id\n name\n version\n formatSupported\n dependencies\n }\n }\n total\n }\n }\n`\n\nconst FACETS = gql`\n query {\n figureLibraryFacets {\n categories\n uncategorized\n capabilities\n incapable\n }\n }\n`\n\n/** The filter value for a figure with no category, or one that declares no capability. */\nconst NONE = '-'\n\n@customElement('figure-library-page')\nexport class FigureLibraryPage extends localize(i18next)(PageView) {\n static styles = [\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n /* The card, its picture cell and the upload FAB: every card catalog's (ADR-0117 amendment 2026-10-13). */\n CardCatalogStyles,\n css`\n ox-filters-form {\n flex: 1;\n }\n `\n ]\n\n @state() private gristConfig: any\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('figure-library.title'),\n search: {\n placeholder: i18next.t('figure-library.text.search'),\n handler: (search: string) => {\n this.grist.searchText = search\n },\n value: this.grist?.searchText || ''\n }\n }\n }\n\n render() {\n return html`\n <ox-grist class=\"page-fill\" mode=\"CARD\" .config=${this.gristConfig} .fetchHandler=${this.fetchHandler}>\n <div slot=\"headroom\">\n <ox-filters-form autofocus without-search></ox-filters-form>\n </div>\n </ox-grist>\n\n <button fab @click=${() => this.openImport()}>\n <md-icon>upload_file</md-icon>${i18next.t('figure-library.button.upload')}\n </button>\n `\n }\n\n async pageInitialized() {\n await this.configure()\n }\n\n /*\n * The filter options are read once here (and again after an import), never per render: an async options function\n * runs on every render of the filter bar and replaces the open list's options under the pointer.\n */\n private async configure() {\n const { categories, capabilities } = await this.facets()\n this.gristConfig = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['title', 'meta'],\n details: []\n },\n columns: [\n {\n type: 'image',\n name: 'thumbnail',\n record: { editable: false, renderEmpty: true, renderer: (_value, _column, record) => this.thumbnailOf(record) }\n },\n {\n type: 'string',\n name: 'title',\n record: {\n editable: false,\n renderer: (_value, _column, record) => (record.release ?? record.latest).name\n }\n },\n {\n type: 'string',\n name: 'meta',\n record: { editable: false, renderer: (_value, _column, record) => this.metaOf(record) }\n },\n { type: 'string', name: 'name', hidden: true, record: { editable: false }, filter: 'search' },\n {\n type: 'select',\n name: 'category',\n header: i18next.t('figure-library.label.category'),\n hidden: true,\n record: { editable: false },\n filter: { operator: 'eq', options: categories }\n },\n {\n type: 'select',\n name: 'capability',\n header: i18next.t('figure-library.label.capability'),\n hidden: true,\n record: { editable: false },\n filter: { operator: 'eq', options: capabilities }\n },\n /* Only the names this domain draws as items (ADR-0155 개정 1 E): what an item type table picks a look from. */\n {\n type: 'boolean',\n name: 'item',\n header: i18next.t('figure-library.label.item-only'),\n hidden: true,\n record: { editable: false },\n filter: { operator: 'eq' }\n },\n /* Archived figures are left out unless this box is checked (ADR-0114 결정 18, 화면; user 2026-10-22). */\n {\n type: 'boolean',\n name: 'archived',\n header: i18next.t('figure-library.label.archived'),\n hidden: true,\n record: { editable: false },\n filter: { operator: 'eq' }\n }\n ],\n rows: {\n selectable: false,\n appendable: false,\n handlers: {\n click: (_columns, _data, _column, record) => record && this.openReleases(record)\n }\n },\n pagination: { pages: [24, 48, 96] }\n }\n }\n\n async pageUpdated() {\n if (this.active) this.grist?.fetch()\n }\n\n private fetchHandler = async ({ page = 1, limit = 24, filters = [] }: FetchOption) => {\n const response = await client.query({\n query: FIGURES,\n variables: {\n /* The name search arrives as %text%; the server matches parts itself. */\n filters: filters\n .filter(filter => filter.value !== undefined && filter.value !== '' && !(Array.isArray(filter.value) && !filter.value.length))\n .map(filter => ({ ...filter, value: typeof filter.value === 'string' ? filter.value.replace(/^%|%$/g, '') : filter.value })),\n pagination: { page, limit }\n },\n fetchPolicy: 'network-only'\n })\n return { total: response.data.responses.total || 0, records: response.data.responses.items || [] }\n }\n\n /** The filter options, from what the figures that draw carry. */\n private async facets() {\n const response = await client.query({ query: FACETS, fetchPolicy: 'network-only' })\n const facets = response.data?.figureLibraryFacets ?? { categories: [], capabilities: [] }\n return {\n categories: [\n ...facets.categories.map((value: string) => ({ display: value, value })),\n ...(facets.uncategorized ? [{ display: i18next.t('figure-library.text.no-category'), value: NONE }] : [])\n ],\n capabilities: [\n ...facets.capabilities.map((value: string) => ({ display: i18next.t(`figure.label.role-${value}`, { defaultValue: value }), value })),\n ...(facets.incapable ? [{ display: i18next.t('figure-library.text.no-capability'), value: NONE }] : [])\n ]\n }\n }\n\n /** The picture cell every catalog card draws, with the one marker this figure needs. */\n private thumbnailOf(record: any) {\n const hash = (record?.release ?? record?.latest)?.dependencies?.find((d: any) => d.role === 'thumbnail')?.hash\n const [badge, tone] = this.markerOf(record)\n return html`<ox-card-thumb\n src=${hash ? figureLibraryFileUrl(hash) : ''}\n alt=${(record?.release ?? record?.latest)?.name ?? ''}\n badge=${badge}\n tone=${tone}\n >\n <figure-thumb-mark slot=\"empty\" .label=${i18next.t('figure-library.text.no-thumbnail')}></figure-thumb-mark>\n </ox-card-thumb>`\n }\n\n /**\n * The one thing a card says before it is opened, the gravest first: it is archived, nothing here can draw it, it does\n * not draw its latest release, or the release it draws is deprecated. A figure drawing its latest says nothing.\n */\n private markerOf(record: any): [string, 'plain' | 'warn' | 'crit'] {\n if (record?.archivedAt) return [i18next.t('figure-library.text.archived'), 'plain']\n const release = record?.release\n if (!release) return [i18next.t('figure-library.text.format-unsupported'), 'crit']\n if (release.version !== record.latestVersion) return [i18next.t('figure-library.text.not-latest'), 'warn']\n if (release.deprecated) return [i18next.t('figure-library.text.deprecated'), 'plain']\n return ['', 'plain']\n }\n\n /** The line under the name: the full name and the version it draws with, as a board card's 「v1 · 3일 전」, and whether it is an item. */\n private metaOf(record: any): string {\n const line = record?.release ? `${record.name} · ${versionText(record.release.version)}` : record?.name ?? ''\n return record?.item ? `${line} · ${i18next.t('figure-library.text.item')}` : line\n }\n\n private openReleases(record: any) {\n openPopup(\n html`<figure-releases-popup\n .name=${record.name}\n .drawing=${record.release?.id ?? ''}\n .archived=${!!record.archivedAt}\n @saved=${() => this.grist.fetch()}\n ></figure-releases-popup>`,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('figure-library.title.releases-of', { name: (record.release ?? record.latest).name, count: record.releaseCount })\n }\n )\n }\n\n private openImport() {\n openPopup(\n html`<figure-package-import\n @imported=${async () => {\n await this.configure()\n this.grist.fetch()\n }}\n ></figure-package-import>`,\n { backdrop: true, size: 'small', closable: true, title: i18next.t('figure-library.button.upload') }\n )\n }\n}\n"]}
|
package/dist-client/route.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAY;IACxC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,gBAAgB;YACnB,MAAM,CAAC,6BAA6B,CAAC,CAAA;YACrC,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page: string) {\n switch (page) {\n case 'figure-library':\n import('./pages/figure-library-page')\n return page\n }\n}\n"]}
|