@things-factory/figure-ui 10.1.68 → 10.1.70
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/client/graphql/index.ts +89 -0
- package/client/modeller/figure-v3-links.ts +73 -7
- package/client/modeller/figure-v3-parts.ts +153 -2
- package/client/modeller/v3-editor.ts +133 -5
- package/client/modeller/v3-gizmo.ts +18 -2
- package/client/modeller/v3-links.ts +71 -2
- package/client/modeller/v3-palette.ts +2 -1
- package/client/modeller/v3-product-session.ts +8 -0
- package/client/modeller/v3-recipes.ts +69 -0
- package/client/pages/figure-recipe-page.ts +338 -0
- package/client/pages/figure-v3-modeller-page.ts +25 -2
- package/client/route.ts +4 -0
- package/dist-client/graphql/index.d.ts +21 -0
- package/dist-client/graphql/index.js +75 -0
- package/dist-client/graphql/index.js.map +1 -1
- package/dist-client/modeller/figure-v3-capability.d.ts +1 -1
- package/dist-client/modeller/figure-v3-clips.d.ts +1 -1
- package/dist-client/modeller/figure-v3-controls.d.ts +1 -1
- package/dist-client/modeller/figure-v3-links.d.ts +11 -1
- package/dist-client/modeller/figure-v3-links.js +69 -8
- package/dist-client/modeller/figure-v3-links.js.map +1 -1
- package/dist-client/modeller/figure-v3-material.d.ts +1 -1
- package/dist-client/modeller/figure-v3-parts.d.ts +15 -1
- package/dist-client/modeller/figure-v3-parts.js +166 -1
- package/dist-client/modeller/figure-v3-parts.js.map +1 -1
- package/dist-client/modeller/figure-v3-properties.d.ts +1 -1
- package/dist-client/modeller/v3-clips.d.ts +1 -1
- package/dist-client/modeller/v3-editor.d.ts +26 -0
- package/dist-client/modeller/v3-editor.js +147 -4
- package/dist-client/modeller/v3-editor.js.map +1 -1
- package/dist-client/modeller/v3-gizmo.d.ts +6 -0
- package/dist-client/modeller/v3-gizmo.js +20 -2
- package/dist-client/modeller/v3-gizmo.js.map +1 -1
- package/dist-client/modeller/v3-links.d.ts +27 -0
- package/dist-client/modeller/v3-links.js +68 -2
- package/dist-client/modeller/v3-links.js.map +1 -1
- package/dist-client/modeller/v3-palette.js +2 -1
- package/dist-client/modeller/v3-palette.js.map +1 -1
- package/dist-client/modeller/v3-product-session.d.ts +34 -0
- package/dist-client/modeller/v3-product-session.js +8 -0
- package/dist-client/modeller/v3-product-session.js.map +1 -1
- package/dist-client/modeller/v3-recipes.d.ts +26 -0
- package/dist-client/modeller/v3-recipes.js +69 -0
- package/dist-client/modeller/v3-recipes.js.map +1 -0
- package/dist-client/pages/figure-recipe-page.d.ts +41 -0
- package/dist-client/pages/figure-recipe-page.js +352 -0
- package/dist-client/pages/figure-recipe-page.js.map +1 -0
- package/dist-client/pages/figure-v3-modeller-page.d.ts +4 -0
- package/dist-client/pages/figure-v3-modeller-page.js +29 -2
- package/dist-client/pages/figure-v3-modeller-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.fui.tsbuildinfo +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/test/browser/modeller-page.js +15 -1
- package/test/browser/modeller.check.mjs +217 -2
- package/test/modeller-route.test.ts +9 -0
- package/test/v3-gizmo.test.ts +44 -0
- package/test/v3-links.test.ts +91 -1
- package/test/v3-recipes.test.ts +60 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +40 -8
- package/translations/ja.json +40 -8
- package/translations/ko.json +40 -8
- package/translations/ms.json +40 -8
- package/translations/zh.json +40 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figure-v3-parts.js","sourceRoot":"","sources":["../../client/modeller/figure-v3-parts.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,O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AE,CAAC,IAAI,EAAE,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;;KAExF,CAAA;IACH,CAAC;IAED,qCAAqC;IAC7B,GAAG,CAAC,IAAY,EAAE,MAAc;QACtC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACtF,CAAC;;AAjM0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;4CAAwB;AAEtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;+CAAc;AAEZ;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;6CAAe;AAKX;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;6CAAsB;AAKrB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;iDAAmF;AA3SvG,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA+dzB","sourcesContent":["import '@material/web/icon/icon.js'\nimport { css, html, LitElement, nothing } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { PART_LIMIT } from '@hatiolab/figure-model'\nimport type { V3PrimitiveCreation } from '@hatiolab/figure-model'\nimport type { V3BudgetLine } from './v3-maturity.js'\nimport { partLabelOf } from './v3-fields.js'\n\n/**\n * 도형 팔레트와 부품 목록 — V3 자산의 것.\n *\n * 팔레트는 목록 위에, 눈 단추는 늘 자리를 차지하고, 조작은 고른 줄에서만 보인다.\n *\n * 부품의 도형은 V3 평가가 준 `provider` 로 읽는다. 「숨김」은 여기서도 **작업대의 것**이다 — 저장되지 않고, 자산의 `visibility`(상태에 따라\n * 보이고 안 보이는 것)와는 다른 것이다. 그것은 속성 패널의 몫이다.\n *\n * 이 컴포넌트는 정본을 만지지 않는다. 무엇을 하겠다는 것만 알린다.\n */\n\n/** 한 줄 — V3 평가에서 이 패널이 읽는 것만. */\nexport interface V3PartRow {\n id: string\n provider: string\n /** 작업대에서 잠깐 가린 것. 저장되지 않는다. */\n hidden?: boolean\n /** 자산이 지금 상태에서 보이지 않는다고 한 것. 저장되는 것이고, 여기서는 표시만 한다. */\n invisible?: boolean\n /** 되풀이한 부품이면 지금 몇 개로 그려지나. 되풀이는 한 부품이다 — 한 줄로 보인다. */\n copies?: number\n}\n\n/** 제공자마다의 아이콘. Material Symbols 이름이다. */\nconst PROVIDER_ICON: Record<string, string> = {\n box: 'deployed_code',\n cylinder: 'database',\n ellipticCylinder: 'database',\n frustum: 'change_history',\n sphere: 'circle',\n roundedBox: 'crop_square',\n roundedBoxXZ: 'crop_square',\n hollowBox: 'check_box_outline_blank',\n hollowBoxXZ: 'check_box_outline_blank',\n polygon: 'pentagon',\n portal: 'door_front'\n}\n\n/** 팔레트 — 저작 API 가 만들 수 있는 것만 보인다. */\n/*\n The palette. A plate and a wall are boxes of a shape a person reaches for, so they are starting sizes, not kinds of their own.\n*/\nexport type V3PaletteKind = V3PrimitiveCreation['kind'] | 'plate' | 'wall'\nconst RECIPES: Array<{ kind: V3PaletteKind; icon: string; label: string }> = [\n { kind: 'box', icon: 'deployed_code', label: 'figure.label.primitive-cube' },\n { kind: 'cylinder', icon: 'database', label: 'figure.label.primitive-cylinder' },\n { kind: 'rounded-box', icon: 'crop_square', label: 'figure.label.primitive-rounded-box' },\n { kind: 'sphere', icon: 'circle', label: 'figure.label.primitive-sphere' },\n { kind: 'frustum', icon: 'change_history', label: 'figure.label.primitive-frustum' },\n { kind: 'polygon', icon: 'hexagon', label: 'figure.label.primitive-polygon' },\n { kind: 'plate', icon: 'check_box_outline_blank', label: 'figure.label.primitive-plate' },\n { kind: 'wall', icon: 'crop_portrait', label: 'figure.label.primitive-wall' },\n { kind: 'portal', icon: 'door_front', label: 'figure.label.primitive-portal' }\n]\n\n@customElement('figure-v3-parts')\nexport class FigureV3Parts extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n background-color: var(--md-sys-color-surface-container-lowest);\n /* The divider beside it is the editor's frame's (ox-three-pane). */\n color: var(--md-sys-color-on-surface);\n font: var(--label-font, inherit);\n font-size: 0.76rem;\n /* Folds by its own width: the editor gives this column 140 px when it has two columns (UX, 2026-09-24). */\n container-type: inline-size;\n }\n section {\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n section[list] {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n h3 {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 6px;\n margin: 0 0 6px 0;\n font-size: var(--ui-t-micro, 11px);\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n /* The cost line: the grade's letter in its colour, then what the figure costs. */\n button[budget] {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n width: 100%;\n margin: 0 0 6px;\n padding: 4px 6px;\n font: inherit;\n font-size: 0.68rem;\n line-height: 1.5;\n text-align: left;\n color: var(--md-sys-color-on-surface-variant);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n button[budget]:hover {\n background: var(--md-sys-color-surface-container);\n }\n button[budget] b {\n flex: none;\n min-width: 16px;\n text-align: center;\n border-radius: 4px;\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n }\n button[budget][grade='C'] b {\n color: var(--md-sys-color-on-tertiary-container);\n background: var(--md-sys-color-tertiary-container);\n }\n button[budget][grade='D'] {\n border-color: var(--md-sys-color-error);\n }\n button[budget][grade='D'] b {\n color: var(--md-sys-color-on-error);\n background: var(--md-sys-color-error);\n }\n button[budget] em {\n display: block;\n font-style: normal;\n color: var(--md-sys-color-error);\n }\n span[room][full] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n p[full] {\n margin: 4px 0 0;\n font-size: 0.68rem;\n color: var(--md-sys-color-error);\n }\n div[level] {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: center;\n gap: 6px;\n margin: 0 0 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[level] select {\n min-width: 0;\n padding: 2px 4px;\n font: inherit;\n font-size: 0.7rem;\n color: var(--md-sys-color-on-surface);\n background: var(--md-sys-color-surface-container-lowest);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n }\n small[copies] {\n color: var(--md-sys-color-on-surface-variant);\n }\n span[room] {\n font-size: 0.7rem;\n font-weight: 400;\n letter-spacing: 0;\n text-transform: none;\n }\n /* Three to a row, small (user, 2026-09-24): the palette is reached for, not read -- the list below is what grows. */\n div[palette] {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 3px;\n }\n button[shape] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1px;\n min-width: 0;\n padding: 5px 1px 4px;\n font: var(--label-font, inherit);\n font-size: 0.6rem;\n line-height: 1.2;\n text-align: center;\n overflow-wrap: anywhere;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n button[shape]:hover:not([disabled]) {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n button[shape][disabled] {\n opacity: 0.35;\n cursor: default;\n }\n button[shape] md-icon {\n --md-icon-size: 18px;\n }\n ol {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n li {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 6px;\n border-radius: 6px;\n cursor: pointer;\n }\n li:hover {\n background-color: var(--md-sys-color-surface-container);\n }\n li[selected] {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n }\n li md-icon {\n --md-icon-size: 16px;\n flex: none;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n button[eye][all] {\n margin-left: auto;\n opacity: 0.75;\n }\n button[eye][all]:hover {\n opacity: 1;\n }\n button[eye] {\n display: flex;\n flex: none;\n padding: 1px;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0;\n }\n li:hover button[eye],\n li[selected] button[eye],\n button[eye][off] {\n opacity: 1;\n }\n button[eye][off] {\n color: var(--md-sys-color-tertiary);\n }\n button[eye] md-icon {\n --md-icon-size: 15px;\n color: inherit;\n }\n li[off] span[label],\n li[off] > md-icon,\n li[invisible] span[label],\n li[invisible] > md-icon {\n opacity: 0.45;\n }\n li[selected] md-icon {\n color: inherit;\n }\n span[label] {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 0.78rem;\n }\n span[label] small {\n margin-left: 4px;\n font-size: 0.66rem;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n div[ops] {\n display: none;\n gap: 1px;\n }\n li[selected] div[ops] {\n display: flex;\n }\n div[ops] button {\n display: flex;\n padding: 2px;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n div[ops] button:hover:not([disabled]) {\n background-color: var(--md-sys-color-surface-container-lowest);\n }\n div[ops] button[disabled] {\n opacity: 0.3;\n cursor: default;\n }\n div[ops] md-icon {\n --md-icon-size: 15px;\n color: inherit;\n }\n /*\n Under 200 px the selected row's four buttons pushed its name out and the last one past the edge (seen at 140,\n 2026-09-24). They go to a line of their own under the name.\n */\n @container (max-width: 199px) {\n li[selected] {\n flex-wrap: wrap;\n }\n li[selected] div[ops] {\n flex-basis: 100%;\n justify-content: flex-end;\n }\n }\n p[quiet] {\n margin: 0;\n font-size: 0.76rem;\n line-height: 1.6;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n `\n ]\n\n @property({ type: Array }) parts: V3PartRow[] = []\n /** 고른 부품의 id. 자리(index)가 아니다 — V3 부품은 id 로 안정하게 가리킨다. */\n @property({ type: String }) selected = ''\n /** 편집할 수 없을 때(불러오는 중 · 저장 중) 팔레트와 조작을 잠근다. */\n @property({ type: Boolean }) locked = false\n /**\n * 이 도형이 치르는 값 — 삼각형 · 묶음 · 한 화면에 몇 대 · 등급. 부품을 더하는 바로 그 자리에서 보여야 로우폴리의\n * 기준이 저작을 이끈다. 등급이 D 면 무엇이 넘쳤는지를 적는다. 누르면 성숙도 탭이 열린다.\n */\n @property({ attribute: false }) budget?: V3BudgetLine\n /**\n * 디테일 등급(S/M/L)의 부품 한도(사용자 2026-09-24). 부품을 넣기 **전에** 몇 개 남았는지 보이고, 다 차면 팔레트가\n * 잠긴다. 되풀이는 한 부품으로 센다. 등급을 안 정했으면 한도는 없다.\n */\n @property({ attribute: false }) partBudget?: { level: 'S' | 'M' | 'L' | null; used: number; limit: number | null }\n\n render() {\n const b = this.partBudget\n const full = !!b && b.limit !== null && b.used >= b.limit\n return html`\n <section>\n <h3>${i18next.t('figure.label.shapes')}</h3>\n <div palette>\n ${RECIPES.map(\n recipe => html`\n <button\n shape\n ?disabled=${this.locked || full}\n title=${full ? i18next.t('figure.text.part-limit-reached') : i18next.t(recipe.label)}\n @click=${() => this.ask('add-part', { kind: recipe.kind })}\n >\n <md-icon>${recipe.icon}</md-icon>\n <span>${i18next.t(recipe.label)}</span>\n </button>\n `\n )}\n </div>\n ${full ? html`<p full>${i18next.t('figure.text.part-limit-reached-short', { level: b!.level, limit: b!.limit })}</p>` : nothing}\n </section>\n\n <section list>\n <h3>\n <span>${i18next.t('figure.label.parts')}</span>\n <span room ?full=${full} title=${i18next.t('figure.text.limit-comes-from-level')}\n >${b && b.limit !== null ? i18next.t('figure.text.n-of-limit', { used: b.used, limit: b.limit }) : (b?.used ?? this.parts.length)}</span\n >\n ${this.renderShowAll()}\n </h3>\n ${this.renderLevel()}\n ${this.renderBudget()}\n ${this.parts.length === 0\n ? html`<p quiet>${i18next.t('figure.text.no-parts-yet')}</p>`\n : html`<ol>\n ${this.parts.map((part, index) => this.renderRow(part, index))}\n </ol>`}\n </section>\n `\n }\n\n /** 디테일 등급 — 고르면 한도가 바뀐다. 목록 머리 아래. */\n private renderLevel() {\n const b = this.partBudget\n if (!b) return nothing\n return html`<div level>\n <label for=\"detail-level\">${i18next.t('figure.label.detail-level')}</label>\n <select\n id=\"detail-level\"\n title=${i18next.t('figure.text.detail-level-explained')}\n .value=${b.level ?? ''}\n ?disabled=${this.locked}\n @change=${(e: Event) => {\n const value = (e.target as HTMLSelectElement).value\n this.dispatchEvent(new CustomEvent('set-detail-level', { detail: { level: value || null }, bubbles: true, composed: true }))\n }}\n >\n <option value=\"\" ?selected=${!b.level}>${i18next.t('figure.label.detail-none')}</option>\n ${(['S', 'M', 'L'] as const).map(\n one => html`<option value=${one} ?selected=${one === b.level}>\n ${one} ${i18next.t('figure.label.detail-' + one)} · ${i18next.t('figure.text.n-parts-at-most', { limit: PART_LIMIT[one] })}\n </option>`\n )}\n </select>\n </div>`\n }\n\n private renderBudget() {\n const b = this.budget\n if (!b || !this.parts.length) return nothing\n const over = b.grade === 'D'\n return html`<button\n budget\n grade=${b.grade}\n title=${i18next.t('figure.text.parts-budget-open')}\n @click=${() => this.dispatchEvent(new CustomEvent('show-maturity', { bubbles: true, composed: true }))}\n >\n <b>${b.grade}</b>\n <span>\n ${i18next.t('figure.text.parts-budget', {\n triangles: b.triangles.toLocaleString(),\n groups: b.groups.toLocaleString(),\n instances: b.instances.toLocaleString()\n })}\n ${over\n ? html`<em\n >${i18next.t('figure.text.parts-budget-over', {\n budget: i18next.t('figure.label.budget-' + b.tightest.key),\n used: b.tightest.used.toLocaleString(),\n limit: b.tightest.limit.toLocaleString()\n })}</em\n >`\n : nothing}\n </span>\n </button>`\n }\n\n /** 한꺼번에 감추고 한꺼번에 되돌린다 — 하나라도 감춰져 있으면 다 되돌리고, 다 보이면 다 감춘다. */\n private renderShowAll() {\n if (this.parts.length === 0) return nothing\n const anyHidden = this.parts.some(part => part.hidden)\n return html`\n <button\n eye\n all\n ?off=${!anyHidden}\n title=${i18next.t(anyHidden ? 'figure.text.show-all-parts' : 'figure.text.hide-all-parts')}\n @click=${(e: Event) => {\n e.stopPropagation()\n this.ask('set-all-parts-hidden', { hidden: !anyHidden })\n }}\n >\n <md-icon>${anyHidden ? 'visibility' : 'visibility_off'}</md-icon>\n </button>\n `\n }\n\n private renderRow(part: V3PartRow, index: number) {\n const selected = part.id === this.selected\n const off = !!part.hidden\n return html`\n <li\n ?selected=${selected}\n ?off=${off}\n ?invisible=${!!part.invisible}\n @click=${() => this.ask('select-part', { id: part.id })}\n >\n <button\n eye\n ?off=${off}\n title=${i18next.t(off ? 'figure.text.show-this-part' : 'figure.text.hide-this-part')}\n @click=${(e: Event) => {\n e.stopPropagation()\n this.ask('toggle-part-hidden', { id: part.id })\n }}\n >\n <md-icon>${off ? 'visibility_off' : 'visibility'}</md-icon>\n </button>\n <md-icon>${PROVIDER_ICON[part.provider] ?? 'deployed_code'}</md-icon>\n <span label title=${part.id}\n >${partLabelOf(part.id)}${part.copies ? html` <small copies>× ${part.copies}</small>` : nothing}${part.invisible ? html`<small>${i18next.t('figure.label.state-hidden')}</small>` : nothing}</span\n >\n ${selected ? this.renderOps(part.id, index) : nothing}\n </li>\n `\n }\n\n /** 고른 줄의 조작. 못 하는 것은 빼지 않고 흐리게 둔다 — 자리가 밀리면 연달아 지우다 엉뚱한 것을 누른다. */\n private renderOps(id: string, index: number) {\n const count = this.parts.length\n const op = (name: string, icon: string, detail: object, enabled = true) => html`\n <button\n op=${name}\n ?disabled=${!enabled || this.locked}\n title=${i18next.t('figure.button.' + name)}\n @click=${(e: Event) => {\n e.stopPropagation()\n if (enabled && !this.locked) this.ask(name, detail)\n }}\n >\n <md-icon>${icon}</md-icon>\n </button>\n `\n return html`\n <div ops>\n ${op('move-part-up', 'arrow_upward', { id, to: index - 1 }, index > 0)}\n ${op('move-part-down', 'arrow_downward', { id, to: index + 1 }, index < count - 1)}\n ${op('duplicate-part', 'content_copy', { id })} ${op('remove-part', 'delete', { id })}\n </div>\n `\n }\n\n /** 정본을 고치지 않는다 — 무엇을 하겠다는 것만 알린다. */\n private ask(what: string, detail: object) {\n this.dispatchEvent(new CustomEvent(what, { detail, bubbles: true, composed: true }))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"figure-v3-parts.js","sourceRoot":"","sources":["../../client/modeller/figure-v3-parts.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,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;AAClE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEvF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAyB5C,yCAAyC;AACzC,MAAM,aAAa,GAA2B;IAC5C,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,UAAU;IACpB,gBAAgB,EAAE,UAAU;IAC5B,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,aAAa;IACzB,YAAY,EAAE,aAAa;IAC3B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'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { PART_LIMIT } from '@hatiolab/figure-model'\nimport type { V3PrimitiveCreation, V3Recipe, V3RecipeValue } from '@hatiolab/figure-model'\nimport { recipeFieldOf, recipeReady, recipeValueOf, recipeWord } from './v3-recipes.js'\nimport type { V3BudgetLine } from './v3-maturity.js'\nimport { partLabelOf } from './v3-fields.js'\n\n/**\n * 도형 팔레트와 부품 목록 — V3 자산의 것.\n *\n * 팔레트는 목록 위에, 눈 단추는 늘 자리를 차지하고, 조작은 고른 줄에서만 보인다.\n *\n * 부품의 도형은 V3 평가가 준 `provider` 로 읽는다. 「숨김」은 여기서도 **작업대의 것**이다 — 저장되지 않고, 자산의 `visibility`(상태에 따라\n * 보이고 안 보이는 것)와는 다른 것이다. 그것은 속성 패널의 몫이다.\n *\n * 이 컴포넌트는 정본을 만지지 않는다. 무엇을 하겠다는 것만 알린다.\n */\n\n/** 한 줄 — V3 평가에서 이 패널이 읽는 것만. */\nexport interface V3PartRow {\n id: string\n provider: string\n /** 작업대에서 잠깐 가린 것. 저장되지 않는다. */\n hidden?: boolean\n /** 자산이 지금 상태에서 보이지 않는다고 한 것. 저장되는 것이고, 여기서는 표시만 한다. */\n invisible?: boolean\n /** 되풀이한 부품이면 지금 몇 개로 그려지나. 되풀이는 한 부품이다 — 한 줄로 보인다. */\n copies?: number\n}\n\n/** 제공자마다의 아이콘. Material Symbols 이름이다. */\nconst PROVIDER_ICON: Record<string, string> = {\n box: 'deployed_code',\n cylinder: 'database',\n ellipticCylinder: 'database',\n frustum: 'change_history',\n sphere: 'circle',\n roundedBox: 'crop_square',\n roundedBoxXZ: 'crop_square',\n hollowBox: 'check_box_outline_blank',\n hollowBoxXZ: 'check_box_outline_blank',\n polygon: 'pentagon',\n portal: 'door_front'\n}\n\n/** 팔레트 — 저작 API 가 만들 수 있는 것만 보인다. */\n/*\n The palette. A plate and a wall are boxes of a shape a person reaches for, so they are starting sizes, not kinds of their own.\n*/\nexport type V3PaletteKind = V3PrimitiveCreation['kind'] | 'plate' | 'wall'\nconst RECIPES: Array<{ kind: V3PaletteKind; icon: string; label: string }> = [\n { kind: 'box', icon: 'deployed_code', label: 'figure.label.primitive-cube' },\n { kind: 'cylinder', icon: 'database', label: 'figure.label.primitive-cylinder' },\n { kind: 'rounded-box', icon: 'crop_square', label: 'figure.label.primitive-rounded-box' },\n { kind: 'sphere', icon: 'circle', label: 'figure.label.primitive-sphere' },\n { kind: 'frustum', icon: 'change_history', label: 'figure.label.primitive-frustum' },\n { kind: 'polygon', icon: 'hexagon', label: 'figure.label.primitive-polygon' },\n { kind: 'plate', icon: 'check_box_outline_blank', label: 'figure.label.primitive-plate' },\n { kind: 'wall', icon: 'crop_portrait', label: 'figure.label.primitive-wall' },\n { kind: 'portal', icon: 'door_front', label: 'figure.label.primitive-portal' }\n]\n\n@customElement('figure-v3-parts')\nexport class FigureV3Parts extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n background-color: var(--md-sys-color-surface-container-lowest);\n /* The divider beside it is the editor's frame's (ox-three-pane). */\n color: var(--md-sys-color-on-surface);\n font: var(--label-font, inherit);\n font-size: 0.76rem;\n /* Folds by its own width: the editor gives this column 140 px when it has two columns (UX, 2026-09-24). */\n container-type: inline-size;\n }\n section {\n padding: var(--spacing-medium, 8px) var(--spacing-large, 12px);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n }\n section[list] {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n h3 {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 6px;\n margin: 0 0 6px 0;\n font-size: var(--ui-t-micro, 11px);\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n /* The cost line: the grade's letter in its colour, then what the figure costs. */\n button[budget] {\n display: flex;\n align-items: flex-start;\n gap: 6px;\n width: 100%;\n margin: 0 0 6px;\n padding: 4px 6px;\n font: inherit;\n font-size: 0.68rem;\n line-height: 1.5;\n text-align: left;\n color: var(--md-sys-color-on-surface-variant);\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n button[budget]:hover {\n background: var(--md-sys-color-surface-container);\n }\n button[budget] b {\n flex: none;\n min-width: 16px;\n text-align: center;\n border-radius: 4px;\n color: var(--md-sys-color-on-primary-container);\n background: var(--md-sys-color-primary-container);\n }\n button[budget][grade='C'] b {\n color: var(--md-sys-color-on-tertiary-container);\n background: var(--md-sys-color-tertiary-container);\n }\n button[budget][grade='D'] {\n border-color: var(--md-sys-color-error);\n }\n button[budget][grade='D'] b {\n color: var(--md-sys-color-on-error);\n background: var(--md-sys-color-error);\n }\n button[budget] em {\n display: block;\n font-style: normal;\n color: var(--md-sys-color-error);\n }\n span[room][full] {\n color: var(--md-sys-color-error);\n font-weight: 600;\n }\n p[full] {\n margin: 4px 0 0;\n font-size: 0.68rem;\n color: var(--md-sys-color-error);\n }\n div[level] {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n align-items: center;\n gap: 6px;\n margin: 0 0 6px;\n font-size: 0.68rem;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[level] select {\n min-width: 0;\n padding: 2px 4px;\n font: inherit;\n font-size: 0.7rem;\n color: var(--md-sys-color-on-surface);\n background: var(--md-sys-color-surface-container-lowest);\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n }\n small[copies] {\n color: var(--md-sys-color-on-surface-variant);\n }\n span[room] {\n font-size: 0.7rem;\n font-weight: 400;\n letter-spacing: 0;\n text-transform: none;\n }\n /* Three to a row, small (user, 2026-09-24): the palette is reached for, not read -- the list below is what grows. */\n div[palette] {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 3px;\n }\n button[shape] {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 1px;\n min-width: 0;\n padding: 5px 1px 4px;\n font: var(--label-font, inherit);\n font-size: 0.6rem;\n line-height: 1.2;\n text-align: center;\n overflow-wrap: anywhere;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 6px;\n cursor: pointer;\n }\n div[recipe-list] {\n display: flex;\n flex-wrap: wrap;\n gap: 3px;\n }\n button[recipe] {\n padding: 4px 8px;\n font: inherit;\n font-size: 0.75rem;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n background: none;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 999em;\n cursor: pointer;\n }\n button[recipe][on] {\n color: var(--md-sys-color-on-secondary-container);\n background: var(--md-sys-color-secondary-container);\n border-color: transparent;\n }\n button[recipe]:disabled {\n opacity: 0.38;\n cursor: default;\n }\n div[recipe-form] {\n display: grid;\n gap: 6px;\n margin-top: 8px;\n padding: 8px;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 8px;\n font-size: 0.75rem;\n }\n /* The side pane is narrow (200 px, 160 under 860): the name above its field, not beside it. */\n div[recipe-form] label[field] {\n display: grid;\n gap: 2px;\n }\n div[recipe-form] input[type='number'],\n div[recipe-form] select {\n min-width: 0;\n font: inherit;\n }\n div[recipe-form] p[hint] {\n margin: 0;\n color: var(--md-sys-color-on-surface-variant);\n }\n div[recipe-form] p[error] {\n margin: 0;\n padding: 6px;\n white-space: pre-wrap;\n color: var(--md-sys-color-on-error-container);\n background: var(--md-sys-color-error-container);\n border-radius: 6px;\n }\n div[recipe-actions] {\n display: flex;\n gap: 6px;\n }\n div[recipe-actions] button {\n white-space: nowrap;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 4px 10px;\n font: inherit;\n border: 1px solid var(--md-sys-color-outline-variant);\n border-radius: 999em;\n background: none;\n color: var(--md-sys-color-on-surface);\n cursor: pointer;\n }\n div[recipe-actions] button[insert] {\n border-color: transparent;\n color: var(--md-sys-color-on-primary);\n background: var(--md-sys-color-primary);\n }\n button[shape]:hover:not([disabled]) {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n border-color: transparent;\n }\n button[shape][disabled] {\n opacity: 0.35;\n cursor: default;\n }\n button[shape] md-icon {\n --md-icon-size: 18px;\n }\n ol {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n li {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 6px;\n border-radius: 6px;\n cursor: pointer;\n }\n li:hover {\n background-color: var(--md-sys-color-surface-container);\n }\n li[selected] {\n color: var(--md-sys-color-on-primary-container);\n background-color: var(--md-sys-color-primary-container);\n }\n li md-icon {\n --md-icon-size: 16px;\n flex: none;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n button[eye][all] {\n margin-left: auto;\n opacity: 0.75;\n }\n button[eye][all]:hover {\n opacity: 1;\n }\n button[eye] {\n display: flex;\n flex: none;\n padding: 1px;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n opacity: 0;\n }\n li:hover button[eye],\n li[selected] button[eye],\n button[eye][off] {\n opacity: 1;\n }\n button[eye][off] {\n color: var(--md-sys-color-tertiary);\n }\n button[eye] md-icon {\n --md-icon-size: 15px;\n color: inherit;\n }\n li[off] span[label],\n li[off] > md-icon,\n li[invisible] span[label],\n li[invisible] > md-icon {\n opacity: 0.45;\n }\n li[selected] md-icon {\n color: inherit;\n }\n span[label] {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 0.78rem;\n }\n span[label] small {\n margin-left: 4px;\n font-size: 0.66rem;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n div[ops] {\n display: none;\n gap: 1px;\n }\n li[selected] div[ops] {\n display: flex;\n }\n div[ops] button {\n display: flex;\n padding: 2px;\n color: inherit;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n div[ops] button:hover:not([disabled]) {\n background-color: var(--md-sys-color-surface-container-lowest);\n }\n div[ops] button[disabled] {\n opacity: 0.3;\n cursor: default;\n }\n div[ops] md-icon {\n --md-icon-size: 15px;\n color: inherit;\n }\n /*\n Under 200 px the selected row's four buttons pushed its name out and the last one past the edge (seen at 140,\n 2026-09-24). They go to a line of their own under the name.\n */\n @container (max-width: 199px) {\n li[selected] {\n flex-wrap: wrap;\n }\n li[selected] div[ops] {\n flex-basis: 100%;\n justify-content: flex-end;\n }\n }\n p[quiet] {\n margin: 0;\n font-size: 0.76rem;\n line-height: 1.6;\n color: var(--md-sys-color-on-surface-variant, var(--md-sys-color-on-surface));\n }\n `\n ]\n\n @property({ type: Array }) parts: V3PartRow[] = []\n /** 고른 부품의 id. 자리(index)가 아니다 — V3 부품은 id 로 안정하게 가리킨다. */\n @property({ type: String }) selected = ''\n /** 편집할 수 없을 때(불러오는 중 · 저장 중) 팔레트와 조작을 잠근다. */\n @property({ type: Boolean }) locked = false\n /**\n * 이 도형이 치르는 값 — 삼각형 · 묶음 · 한 화면에 몇 대 · 등급. 부품을 더하는 바로 그 자리에서 보여야 로우폴리의\n * 기준이 저작을 이끈다. 등급이 D 면 무엇이 넘쳤는지를 적는다. 누르면 성숙도 탭이 열린다.\n */\n @property({ attribute: false }) budget?: V3BudgetLine\n /**\n * 디테일 등급(S/M/L)의 부품 한도(사용자 2026-09-24). 부품을 넣기 **전에** 몇 개 남았는지 보이고, 다 차면 팔레트가\n * 잠긴다. 되풀이는 한 부품으로 센다. 등급을 안 정했으면 한도는 없다.\n */\n @property({ attribute: false }) partBudget?: { level: 'S' | 'M' | 'L' | null; used: number; limit: number | null }\n /** The recipes this domain sees (ADR-0095). */\n @property({ attribute: false }) recipes: V3Recipe[] = []\n /** Why the last recipe put in was refused -- the kernel's sentence, as it is (ADR-0095 condition 3). */\n @property({ type: String }) recipeError = ''\n /** The recipe whose form is open, and the values in it. */\n @state() private openRecipe = ''\n @state() private recipeValues: Record<string, V3RecipeValue> = {}\n\n render() {\n const b = this.partBudget\n const full = !!b && b.limit !== null && b.used >= b.limit\n return html`\n <section>\n <h3>${i18next.t('figure.label.shapes')}</h3>\n <div palette>\n ${RECIPES.map(\n recipe => html`\n <button\n shape\n ?disabled=${this.locked || full}\n title=${full ? i18next.t('figure.text.part-limit-reached') : i18next.t(recipe.label)}\n @click=${() => this.ask('add-part', { kind: recipe.kind })}\n >\n <md-icon>${recipe.icon}</md-icon>\n <span>${i18next.t(recipe.label)}</span>\n </button>\n `\n )}\n </div>\n ${full ? html`<p full>${i18next.t('figure.text.part-limit-reached-short', { level: b!.level, limit: b!.limit })}</p>` : nothing}\n </section>\n ${this.renderRecipes(full)}\n\n <section list>\n <h3>\n <span>${i18next.t('figure.label.parts')}</span>\n <span room ?full=${full} title=${i18next.t('figure.text.limit-comes-from-level')}\n >${b && b.limit !== null ? i18next.t('figure.text.n-of-limit', { used: b.used, limit: b.limit }) : (b?.used ?? this.parts.length)}</span\n >\n ${this.renderShowAll()}\n </h3>\n ${this.renderLevel()}\n ${this.renderBudget()}\n ${this.parts.length === 0\n ? html`<p quiet>${i18next.t('figure.text.no-parts-yet')}</p>`\n : html`<ol>\n ${this.parts.map((part, index) => this.renderRow(part, index))}\n </ol>`}\n </section>\n `\n }\n\n /** 디테일 등급 — 고르면 한도가 바뀐다. 목록 머리 아래. */\n private renderLevel() {\n const b = this.partBudget\n if (!b) return nothing\n return html`<div level>\n <label for=\"detail-level\">${i18next.t('figure.label.detail-level')}</label>\n <select\n id=\"detail-level\"\n title=${i18next.t('figure.text.detail-level-explained')}\n .value=${b.level ?? ''}\n ?disabled=${this.locked}\n @change=${(e: Event) => {\n const value = (e.target as HTMLSelectElement).value\n this.dispatchEvent(new CustomEvent('set-detail-level', { detail: { level: value || null }, bubbles: true, composed: true }))\n }}\n >\n <option value=\"\" ?selected=${!b.level}>${i18next.t('figure.label.detail-none')}</option>\n ${(['S', 'M', 'L'] as const).map(\n one => html`<option value=${one} ?selected=${one === b.level}>\n ${one} ${i18next.t('figure.label.detail-' + one)} · ${i18next.t('figure.text.n-parts-at-most', { limit: PART_LIMIT[one] })}\n </option>`\n )}\n </select>\n </div>`\n }\n\n private renderBudget() {\n const b = this.budget\n if (!b || !this.parts.length) return nothing\n const over = b.grade === 'D'\n return html`<button\n budget\n grade=${b.grade}\n title=${i18next.t('figure.text.parts-budget-open')}\n @click=${() => this.dispatchEvent(new CustomEvent('show-maturity', { bubbles: true, composed: true }))}\n >\n <b>${b.grade}</b>\n <span>\n ${i18next.t('figure.text.parts-budget', {\n triangles: b.triangles.toLocaleString(),\n groups: b.groups.toLocaleString(),\n instances: b.instances.toLocaleString()\n })}\n ${over\n ? html`<em\n >${i18next.t('figure.text.parts-budget-over', {\n budget: i18next.t('figure.label.budget-' + b.tightest.key),\n used: b.tightest.used.toLocaleString(),\n limit: b.tightest.limit.toLocaleString()\n })}</em\n >`\n : nothing}\n </span>\n </button>`\n }\n\n /** 한꺼번에 감추고 한꺼번에 되돌린다 — 하나라도 감춰져 있으면 다 되돌리고, 다 보이면 다 감춘다. */\n private renderShowAll() {\n if (this.parts.length === 0) return nothing\n const anyHidden = this.parts.some(part => part.hidden)\n return html`\n <button\n eye\n all\n ?off=${!anyHidden}\n title=${i18next.t(anyHidden ? 'figure.text.show-all-parts' : 'figure.text.hide-all-parts')}\n @click=${(e: Event) => {\n e.stopPropagation()\n this.ask('set-all-parts-hidden', { hidden: !anyHidden })\n }}\n >\n <md-icon>${anyHidden ? 'visibility' : 'visibility_off'}</md-icon>\n </button>\n `\n }\n\n private renderRow(part: V3PartRow, index: number) {\n const selected = part.id === this.selected\n const off = !!part.hidden\n return html`\n <li\n ?selected=${selected}\n ?off=${off}\n ?invisible=${!!part.invisible}\n @click=${() => this.ask('select-part', { id: part.id })}\n >\n <button\n eye\n ?off=${off}\n title=${i18next.t(off ? 'figure.text.show-this-part' : 'figure.text.hide-this-part')}\n @click=${(e: Event) => {\n e.stopPropagation()\n this.ask('toggle-part-hidden', { id: part.id })\n }}\n >\n <md-icon>${off ? 'visibility_off' : 'visibility'}</md-icon>\n </button>\n <md-icon>${PROVIDER_ICON[part.provider] ?? 'deployed_code'}</md-icon>\n <span label title=${part.id}\n >${partLabelOf(part.id)}${part.copies ? html` <small copies>× ${part.copies}</small>` : nothing}${part.invisible ? html`<small>${i18next.t('figure.label.state-hidden')}</small>` : nothing}</span\n >\n ${selected ? this.renderOps(part.id, index) : nothing}\n </li>\n `\n }\n\n /** 고른 줄의 조작. 못 하는 것은 빼지 않고 흐리게 둔다 — 자리가 밀리면 연달아 지우다 엉뚱한 것을 누른다. */\n private renderOps(id: string, index: number) {\n const count = this.parts.length\n const op = (name: string, icon: string, detail: object, enabled = true) => html`\n <button\n op=${name}\n ?disabled=${!enabled || this.locked}\n title=${i18next.t('figure.button.' + name)}\n @click=${(e: Event) => {\n e.stopPropagation()\n if (enabled && !this.locked) this.ask(name, detail)\n }}\n >\n <md-icon>${icon}</md-icon>\n </button>\n `\n return html`\n <div ops>\n ${op('move-part-up', 'arrow_upward', { id, to: index - 1 }, index > 0)}\n ${op('move-part-down', 'arrow_downward', { id, to: index + 1 }, index < count - 1)}\n ${op('duplicate-part', 'content_copy', { id })} ${op('remove-part', 'delete', { id })}\n </div>\n `\n }\n\n /**\n * Recipes (ADR-0095): a door, a roller row -- parts made in one step, with a few numbers and choices. A recipe for a\n * part needs one chosen; its form opens under it, and putting it in is one step of the history.\n */\n private renderRecipes(full: boolean) {\n if (!this.recipes.length) return nothing\n const language = i18next.language || 'en'\n const open = this.recipes.find(r => r.name === this.openRecipe)\n return html`<section recipes>\n <h3>${i18next.t('figure.label.recipes')}</h3>\n <div recipe-list>\n ${this.recipes.map(recipe => {\n const ready = recipeReady(recipe, this.selected)\n return html`<button\n recipe=${recipe.name}\n ?on=${recipe.name === this.openRecipe}\n ?disabled=${this.locked || full || !ready}\n title=${ready ? recipeWord(recipe.description, language) : i18next.t('figure.text.recipe-needs-a-part')}\n @click=${() => this.openFor(recipe)}\n >\n ${recipeWord(recipe.title, language)}\n </button>`\n })}\n </div>\n ${this.selected || !this.recipes.some(r => r.target === 'part') ? nothing : html`<p hint>${i18next.t('figure.text.recipe-needs-a-part')}</p>`}\n ${open && recipeReady(open, this.selected) ? this.renderRecipeForm(open, language) : nothing}\n </section>`\n }\n\n private openFor(recipe: V3Recipe) {\n if (this.openRecipe === recipe.name) {\n this.openRecipe = ''\n return\n }\n this.openRecipe = recipe.name\n this.recipeValues = Object.fromEntries(recipe.params.map(p => [p.name, p.default]))\n }\n\n private renderRecipeForm(recipe: V3Recipe, language: string) {\n const set = (name: string, value: V3RecipeValue) => (this.recipeValues = { ...this.recipeValues, [name]: value })\n return html`<div recipe-form>\n ${recipe.target === 'part' ? html`<p hint>${i18next.t('figure.text.recipe-onto', { part: this.selected })}</p>` : nothing}\n ${recipe.params.map(param => {\n const label = recipeWord(param.label, language) || param.name\n const value = this.recipeValues[param.name] ?? param.default\n if (param.kind === 'flag')\n return html`<label toggle><input type=\"checkbox\" .checked=${value === true} @change=${(e: Event) => set(param.name, (e.target as HTMLInputElement).checked)} />${label}</label>`\n if (param.kind === 'choice' || param.kind === 'face')\n return html`<label field><span>${label}</span>\n <select @change=${(e: Event) => set(param.name, recipeValueOf(param, (e.target as HTMLSelectElement).value))}>\n ${(param.options ?? []).map(o => html`<option value=${String(o)} ?selected=${o === value}>${String(o)}</option>`)}\n </select></label>`\n return html`<label field><span>${label}${param.kind === 'ratio' ? ' (%)' : ''}</span>\n <input type=\"number\" step=\"any\" param=${param.name} .value=${recipeFieldOf(param, value)} @change=${(e: Event) => set(param.name, recipeValueOf(param, (e.target as HTMLInputElement).value))} /></label>`\n })}\n ${this.recipeError ? html`<p role=\"alert\" error>${this.recipeError}</p>` : nothing}\n <div recipe-actions>\n <button act insert ?disabled=${this.locked} @click=${() => this.ask('insert-recipe', { recipe, values: this.recipeValues })}>\n <md-icon>add</md-icon>${i18next.t('figure.button.insert-recipe')}\n </button>\n <button act @click=${() => (this.openRecipe = '')}>${i18next.t('figure.button.close')}</button>\n </div>\n </div>`\n }\n\n /** 정본을 고치지 않는다 — 무엇을 하겠다는 것만 알린다. */\n private ask(what: string, detail: object) {\n this.dispatchEvent(new CustomEvent(what, { detail, bubbles: true, composed: true }))\n }\n}\n"]}
|
|
@@ -28,7 +28,7 @@ export declare class FigureV3Properties extends FigureV3Properties_base {
|
|
|
28
28
|
private pickedPart?;
|
|
29
29
|
private pickedFace?;
|
|
30
30
|
private facts;
|
|
31
|
-
render():
|
|
31
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
32
32
|
private renderName;
|
|
33
33
|
/**
|
|
34
34
|
* The face the figure is placed by. In V3 it is part of the room declaration, so choosing one declares the room
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from 'lit';
|
|
2
2
|
import '@operato/layout';
|
|
3
|
+
import type { V3Recipe } from '@hatiolab/figure-model';
|
|
3
4
|
import type { V3ProductSession } from './v3-product-session.js';
|
|
4
5
|
import './v3-canvas.js';
|
|
5
6
|
import './figure-v3-parts.js';
|
|
@@ -16,6 +17,10 @@ import type { FirstSave } from './v3-first-save.js';
|
|
|
16
17
|
export declare class FigureV3Editor extends LitElement {
|
|
17
18
|
static styles: import("lit").CSSResult[];
|
|
18
19
|
session?: V3ProductSession;
|
|
20
|
+
/** The recipes this domain sees (ADR-0095), given by the page. */
|
|
21
|
+
recipes: V3Recipe[];
|
|
22
|
+
/** Why the last recipe was refused, in the kernel's words. */
|
|
23
|
+
private recipeError;
|
|
19
24
|
revision: number;
|
|
20
25
|
/** The verdict's count, drawn on its tab so it stays in sight while another tab is open. */
|
|
21
26
|
instances?: number;
|
|
@@ -35,6 +40,10 @@ export declare class FigureV3Editor extends LitElement {
|
|
|
35
40
|
private panes?;
|
|
36
41
|
/** What the middle shows: the parts being edited, or the figure placed on a board at eight sizes. */
|
|
37
42
|
private middle;
|
|
43
|
+
/** The gizmo shown on the selected part, as the tools in the bar and W · E · R choose it; none once the part changes. */
|
|
44
|
+
private gizmoMode?;
|
|
45
|
+
/** A line saying what a command did besides what was asked; gone at the next command. */
|
|
46
|
+
private notice;
|
|
38
47
|
/**
|
|
39
48
|
* How the workbench shows the figure, in the board's own state names. The viewer's, kept in
|
|
40
49
|
* their browser, never in the figure.
|
|
@@ -50,11 +59,19 @@ export declare class FigureV3Editor extends LitElement {
|
|
|
50
59
|
/** A value in hand -- typed, held on a spinner, scrubbed, dragged -- drawn at once and recorded on release. */
|
|
51
60
|
private live;
|
|
52
61
|
private lastContext;
|
|
62
|
+
/**
|
|
63
|
+
* Move, turn and size on the canvas, in the bar's tools: the gizmo the W · E · R keys give, found without knowing the
|
|
64
|
+
* keys (2026-09-26 -- a person dragging the part turned the camera). Each is offered only where the part's own
|
|
65
|
+
* numbers can take it (`gizmoReachOf`).
|
|
66
|
+
*/
|
|
67
|
+
private renderGizmoTools;
|
|
53
68
|
/** The modeller's keys (`v3-keys.ts`): undo, redo, duplicate, remove, back to the whole figure, the gizmo's modes. */
|
|
54
69
|
private onKey;
|
|
55
70
|
connectedCallback(): void;
|
|
56
71
|
disconnectedCallback(): void;
|
|
57
72
|
protected willUpdate(_changed: PropertyValues): void;
|
|
73
|
+
/** The scene toggles: the mode already shown takes the gizmo away. */
|
|
74
|
+
private useGizmo;
|
|
58
75
|
private run;
|
|
59
76
|
/** What the canvas draws: the figure with the value in hand when there is one, and without the parts hidden on the workbench. */
|
|
60
77
|
private drawnParts;
|
|
@@ -82,6 +99,15 @@ export declare class FigureV3Editor extends LitElement {
|
|
|
82
99
|
private movePart;
|
|
83
100
|
private removePart;
|
|
84
101
|
private toggleHiddenPart;
|
|
102
|
+
/** Whether the figure declares its size (the three size inputs). */
|
|
103
|
+
private hasSize;
|
|
104
|
+
/**
|
|
105
|
+
* A recipe put in (ADR-0095): resolved on the figure as it stands -- its parts take the next free name, onto the part
|
|
106
|
+
* chosen -- and applied as one step. Refused, the kernel's sentence goes to the form as it is (condition 3).
|
|
107
|
+
*/
|
|
108
|
+
private insertRecipe;
|
|
109
|
+
/** The design values of the asset being edited. */
|
|
110
|
+
private designValues;
|
|
85
111
|
/** What the gizmo may write for the selected part — read off the asset being edited. */
|
|
86
112
|
private reachOf;
|
|
87
113
|
/** A drag, written back as the part's own inputs — one step of the history, like typing the numbers. */
|
|
@@ -5,7 +5,7 @@ import { i18next } from '@operato/i18n';
|
|
|
5
5
|
import '@operato/layout';
|
|
6
6
|
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
7
|
import { live } from 'lit/directives/live.js';
|
|
8
|
-
import { PART_LIMIT, v3PartCountOf } from '@hatiolab/figure-model';
|
|
8
|
+
import { PART_LIMIT, parseV3Recipe, resolveV3Recipe, v3PartCountOf, v3RecipeIdFor } from '@hatiolab/figure-model';
|
|
9
9
|
import { captureV3Thumbnail } from './v3-thumbnail.js';
|
|
10
10
|
import { drawableV3Parts } from './v3-renderer.js';
|
|
11
11
|
import './v3-canvas.js';
|
|
@@ -18,7 +18,7 @@ import './figure-v3-preview.js';
|
|
|
18
18
|
import './figure-settings.js';
|
|
19
19
|
import { DEFAULT_VIEW } from './figure-view.js';
|
|
20
20
|
import './figure-v3-capability.js';
|
|
21
|
-
import { gizmoChanges, gizmoReachOf } from './v3-gizmo.js';
|
|
21
|
+
import { gizmoChanges, gizmoReachOf, keepBottomChanges } from './v3-gizmo.js';
|
|
22
22
|
import { keyActionOf } from './v3-keys.js';
|
|
23
23
|
import { groupFields, ownerOf, partLabelOf, repeatOf } from './v3-fields.js';
|
|
24
24
|
import { SidePanelStyles } from './side-panel-styles.js';
|
|
@@ -35,12 +35,18 @@ import { liveOverSession, NOTHING_LIVE, scrubbed, scrubStep } from './v3-live.js
|
|
|
35
35
|
let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
36
36
|
constructor() {
|
|
37
37
|
super(...arguments);
|
|
38
|
+
/** The recipes this domain sees (ADR-0095), given by the page. */
|
|
39
|
+
this.recipes = [];
|
|
40
|
+
/** Why the last recipe was refused, in the kernel's words. */
|
|
41
|
+
this.recipeError = '';
|
|
38
42
|
this.revision = 0;
|
|
39
43
|
this.selected = '';
|
|
40
44
|
this.error = '';
|
|
41
45
|
this.tab = 'properties';
|
|
42
46
|
/** What the middle shows: the parts being edited, or the figure placed on a board at eight sizes. */
|
|
43
47
|
this.middle = 'edit';
|
|
48
|
+
/** A line saying what a command did besides what was asked; gone at the next command. */
|
|
49
|
+
this.notice = '';
|
|
44
50
|
/**
|
|
45
51
|
* How the workbench shows the figure, in the board's own state names. The viewer's, kept in
|
|
46
52
|
* their browser, never in the figure.
|
|
@@ -72,7 +78,7 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
72
78
|
*/
|
|
73
79
|
e.stopPropagation();
|
|
74
80
|
if (action === 'translate' || action === 'rotate' || action === 'scale')
|
|
75
|
-
canvas
|
|
81
|
+
canvas && this.useGizmo(action);
|
|
76
82
|
else if (action === 'undo')
|
|
77
83
|
view.canUndo && this.run(() => this.session.undo());
|
|
78
84
|
else if (action === 'redo')
|
|
@@ -110,6 +116,37 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
110
116
|
ox-canvas-bar button[mode][aria-pressed='true'] {
|
|
111
117
|
border-color: var(--md-sys-color-primary);
|
|
112
118
|
}
|
|
119
|
+
/* The gizmo's tools, drawn as the bar's own icon buttons (undo, redo, fit). */
|
|
120
|
+
ox-canvas-bar .gizmo-tools {
|
|
121
|
+
display: inline-flex;
|
|
122
|
+
gap: 2px;
|
|
123
|
+
padding-left: 4px;
|
|
124
|
+
border-left: 1px solid var(--md-sys-color-outline-variant);
|
|
125
|
+
}
|
|
126
|
+
ox-canvas-bar button[tool] {
|
|
127
|
+
display: inline-grid;
|
|
128
|
+
place-items: center;
|
|
129
|
+
width: 32px;
|
|
130
|
+
height: 32px;
|
|
131
|
+
padding: 0;
|
|
132
|
+
border: none;
|
|
133
|
+
border-radius: var(--md-sys-shape-corner-small, 8px);
|
|
134
|
+
background: transparent;
|
|
135
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
138
|
+
ox-canvas-bar button[tool]:hover:not(:disabled) {
|
|
139
|
+
background: var(--md-sys-color-surface-container-high);
|
|
140
|
+
color: var(--md-sys-color-on-surface);
|
|
141
|
+
}
|
|
142
|
+
ox-canvas-bar button[tool][aria-pressed='true'] {
|
|
143
|
+
background: var(--md-sys-color-secondary-container);
|
|
144
|
+
color: var(--md-sys-color-on-secondary-container);
|
|
145
|
+
}
|
|
146
|
+
ox-canvas-bar button[tool]:disabled {
|
|
147
|
+
opacity: 0.38;
|
|
148
|
+
cursor: default;
|
|
149
|
+
}
|
|
113
150
|
figure-v3-preview {
|
|
114
151
|
min-width: 0;
|
|
115
152
|
min-height: 0;
|
|
@@ -258,6 +295,11 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
258
295
|
color: var(--md-sys-color-on-error-container);
|
|
259
296
|
white-space: pre-wrap;
|
|
260
297
|
}
|
|
298
|
+
.notice {
|
|
299
|
+
padding: 8px 10px;
|
|
300
|
+
background: var(--md-sys-color-surface-container);
|
|
301
|
+
color: var(--md-sys-color-on-surface);
|
|
302
|
+
}
|
|
261
303
|
.hint {
|
|
262
304
|
color: var(--md-sys-color-on-surface-variant);
|
|
263
305
|
line-height: 1.5;
|
|
@@ -281,6 +323,31 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
281
323
|
/* A browser that keeps nothing still shows the change for this visit. */
|
|
282
324
|
}
|
|
283
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Move, turn and size on the canvas, in the bar's tools: the gizmo the W · E · R keys give, found without knowing the
|
|
328
|
+
* keys (2026-09-26 -- a person dragging the part turned the camera). Each is offered only where the part's own
|
|
329
|
+
* numbers can take it (`gizmoReachOf`).
|
|
330
|
+
*/
|
|
331
|
+
renderGizmoTools(editing) {
|
|
332
|
+
const reach = editing && this.selected ? this.reachOf(this.selected) : undefined;
|
|
333
|
+
const tools = [
|
|
334
|
+
{ mode: 'translate', icon: 'open_with', key: 'W', can: !!reach?.translate },
|
|
335
|
+
{ mode: 'rotate', icon: '3d_rotation', key: 'E', can: !!reach?.rotate },
|
|
336
|
+
{ mode: 'scale', icon: 'open_in_full', key: 'R', can: !!reach?.scale }
|
|
337
|
+
];
|
|
338
|
+
return html `<span class="gizmo-tools" role="group" aria-label=${i18next.t('figure.label.gizmo-tools')}>
|
|
339
|
+
${tools.map(tool => html `<button
|
|
340
|
+
tool
|
|
341
|
+
aria-pressed=${String(this.gizmoMode === tool.mode)}
|
|
342
|
+
?disabled=${!tool.can}
|
|
343
|
+
aria-label=${i18next.t('figure.button.gizmo-' + tool.mode)}
|
|
344
|
+
title=${`${i18next.t('figure.button.gizmo-' + tool.mode)} (${tool.key})${tool.can || !this.selected ? '' : ' · ' + i18next.t('figure.text.gizmo-not-own')}`}
|
|
345
|
+
@click=${() => this.useGizmo(tool.mode)}
|
|
346
|
+
>
|
|
347
|
+
<md-icon>${tool.icon}</md-icon>
|
|
348
|
+
</button>`)}
|
|
349
|
+
</span>`;
|
|
350
|
+
}
|
|
284
351
|
connectedCallback() {
|
|
285
352
|
super.connectedCallback();
|
|
286
353
|
window.addEventListener('keydown', this.onKey, true);
|
|
@@ -299,6 +366,13 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
299
366
|
}
|
|
300
367
|
if (view && !view.geometry.some(g => ownerOf(g.id) === this.selected))
|
|
301
368
|
this.selected = '';
|
|
369
|
+
if (_changed.has('selected'))
|
|
370
|
+
this.gizmoMode = undefined;
|
|
371
|
+
}
|
|
372
|
+
/** The scene toggles: the mode already shown takes the gizmo away. */
|
|
373
|
+
useGizmo(mode) {
|
|
374
|
+
this.renderRoot.querySelector('figure-v3-canvas')?.gizmo(mode);
|
|
375
|
+
this.gizmoMode = this.gizmoMode === mode ? undefined : mode;
|
|
302
376
|
}
|
|
303
377
|
run(action) {
|
|
304
378
|
try {
|
|
@@ -438,6 +512,39 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
438
512
|
next.add(id);
|
|
439
513
|
this.hiddenParts = next;
|
|
440
514
|
}
|
|
515
|
+
/** Whether the figure declares its size (the three size inputs). */
|
|
516
|
+
hasSize() {
|
|
517
|
+
const values = this.designValues();
|
|
518
|
+
return ['x', 'y', 'z'].every(axis => typeof values[`size.${axis}`] === 'number');
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* A recipe put in (ADR-0095): resolved on the figure as it stands -- its parts take the next free name, onto the part
|
|
522
|
+
* chosen -- and applied as one step. Refused, the kernel's sentence goes to the form as it is (condition 3).
|
|
523
|
+
*/
|
|
524
|
+
insertRecipe(recipe, values) {
|
|
525
|
+
try {
|
|
526
|
+
const asset = JSON.parse(this.session.source());
|
|
527
|
+
const checked = parseV3Recipe(recipe);
|
|
528
|
+
const id = v3RecipeIdFor(asset, checked);
|
|
529
|
+
const steps = resolveV3Recipe(checked, { id, ...(checked.target === 'part' ? { target: this.selected } : {}), values });
|
|
530
|
+
this.session.applyRecipe(steps);
|
|
531
|
+
this.recipeError = '';
|
|
532
|
+
this.error = '';
|
|
533
|
+
this.changed();
|
|
534
|
+
}
|
|
535
|
+
catch (error) {
|
|
536
|
+
this.recipeError = error instanceof Error ? error.message : String(error);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
/** The design values of the asset being edited. */
|
|
540
|
+
designValues() {
|
|
541
|
+
try {
|
|
542
|
+
return this.session ? (JSON.parse(this.session.source()).designInputs ?? {}) : {};
|
|
543
|
+
}
|
|
544
|
+
catch {
|
|
545
|
+
return {};
|
|
546
|
+
}
|
|
547
|
+
}
|
|
441
548
|
/** What the gizmo may write for the selected part — read off the asset being edited. */
|
|
442
549
|
reachOf(id) {
|
|
443
550
|
const none = { translate: false, rotate: false, scale: false };
|
|
@@ -669,9 +776,20 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
669
776
|
/** One command, one step of the history. A refusal a person can meet here is said in their words. */
|
|
670
777
|
linkCommand(action) {
|
|
671
778
|
this.retry = undefined;
|
|
779
|
+
this.notice = '';
|
|
780
|
+
const hadSize = this.hasSize();
|
|
672
781
|
try {
|
|
673
782
|
this.session.command(action);
|
|
674
783
|
this.error = '';
|
|
784
|
+
/* What the command did besides what was asked, in one line: the figure's size declared to follow (ADR ruling Q1). */
|
|
785
|
+
if (action.kind === 'follow-size' && !hadSize) {
|
|
786
|
+
const size = this.designValues();
|
|
787
|
+
this.notice = i18next.t('figure.text.size-declared-to-follow', {
|
|
788
|
+
x: Math.round(size['size.x'] ?? 0).toLocaleString(),
|
|
789
|
+
y: Math.round(size['size.y'] ?? 0).toLocaleString(),
|
|
790
|
+
z: Math.round(size['size.z'] ?? 0).toLocaleString()
|
|
791
|
+
});
|
|
792
|
+
}
|
|
675
793
|
this.changed();
|
|
676
794
|
}
|
|
677
795
|
catch (error) {
|
|
@@ -694,8 +812,12 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
694
812
|
}
|
|
695
813
|
changeField(field, event) {
|
|
696
814
|
const input = event.target, value = input.valueAsNumber;
|
|
815
|
+
/* A height typed in keeps the part's bottom where it is, as the scale gizmo does. */
|
|
816
|
+
const part = this.selected;
|
|
817
|
+
const kept = field.role !== 'state' && part ? keepBottomChanges(part, this.reachOf(part), field.id, value, this.designValues()) : [];
|
|
697
818
|
this.run(() => this.session.apply([
|
|
698
|
-
{ kind: field.role === 'state' ? 'set-state' : 'set-design', input: field.id, unit: field.unit, value }
|
|
819
|
+
{ kind: field.role === 'state' ? 'set-state' : 'set-design', input: field.id, unit: field.unit, value },
|
|
820
|
+
...kept
|
|
699
821
|
]));
|
|
700
822
|
// Rejected edits must also restore the displayed numeric value.
|
|
701
823
|
input.value = String(this.session.read().fields.find(i => i.id === field.id).value);
|
|
@@ -1022,6 +1144,7 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
1022
1144
|
@canvas-redo=${() => this.run(() => this.session.redo())}
|
|
1023
1145
|
@canvas-fit=${() => this.renderRoot.querySelector('figure-v3-canvas')?.fit()}
|
|
1024
1146
|
>
|
|
1147
|
+
${this.renderGizmoTools(!unavailable && this.middle === 'edit')}
|
|
1025
1148
|
${['edit', 'preview'].map(mode => html `<button slot="mode" mode aria-pressed=${String(this.middle === mode)} title=${i18next.t('figure.text.mode-' + mode + '-explained')} @click=${() => (this.middle = mode)}>
|
|
1026
1149
|
${i18next.t('figure.label.mode-' + mode)}
|
|
1027
1150
|
</button>`)}
|
|
@@ -1036,6 +1159,7 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
1036
1159
|
: null}
|
|
1037
1160
|
</div>`
|
|
1038
1161
|
: null}
|
|
1162
|
+
${this.notice ? html `<div role="status" class="notice">${this.notice}</div>` : null}
|
|
1039
1163
|
<ox-three-pane>
|
|
1040
1164
|
<figure-v3-parts
|
|
1041
1165
|
slot="start"
|
|
@@ -1047,6 +1171,9 @@ let FigureV3Editor = class FigureV3Editor extends LitElement {
|
|
|
1047
1171
|
.selected=${this.selected}
|
|
1048
1172
|
?locked=${unavailable}
|
|
1049
1173
|
@add-part=${(e) => this.add(e.detail.kind)}
|
|
1174
|
+
.recipes=${this.recipes}
|
|
1175
|
+
.recipeError=${this.recipeError}
|
|
1176
|
+
@insert-recipe=${(e) => this.insertRecipe(e.detail.recipe, e.detail.values)}
|
|
1050
1177
|
@select-part=${(e) => this.choose(e.detail.id)}
|
|
1051
1178
|
@toggle-part-hidden=${(e) => this.toggleHiddenPart(e.detail.id)}
|
|
1052
1179
|
@set-all-parts-hidden=${(e) => (this.hiddenParts = e.detail.hidden ? new Set(view.geometry.map(g => ownerOf(g.id))) : new Set())}
|
|
@@ -1197,6 +1324,14 @@ __decorate([
|
|
|
1197
1324
|
property({ attribute: false }),
|
|
1198
1325
|
__metadata("design:type", Object)
|
|
1199
1326
|
], FigureV3Editor.prototype, "session", void 0);
|
|
1327
|
+
__decorate([
|
|
1328
|
+
property({ attribute: false }),
|
|
1329
|
+
__metadata("design:type", Array)
|
|
1330
|
+
], FigureV3Editor.prototype, "recipes", void 0);
|
|
1331
|
+
__decorate([
|
|
1332
|
+
state(),
|
|
1333
|
+
__metadata("design:type", Object)
|
|
1334
|
+
], FigureV3Editor.prototype, "recipeError", void 0);
|
|
1200
1335
|
__decorate([
|
|
1201
1336
|
property({ type: Number }),
|
|
1202
1337
|
__metadata("design:type", Object)
|
|
@@ -1237,6 +1372,14 @@ __decorate([
|
|
|
1237
1372
|
state(),
|
|
1238
1373
|
__metadata("design:type", String)
|
|
1239
1374
|
], FigureV3Editor.prototype, "middle", void 0);
|
|
1375
|
+
__decorate([
|
|
1376
|
+
state(),
|
|
1377
|
+
__metadata("design:type", String)
|
|
1378
|
+
], FigureV3Editor.prototype, "gizmoMode", void 0);
|
|
1379
|
+
__decorate([
|
|
1380
|
+
state(),
|
|
1381
|
+
__metadata("design:type", Object)
|
|
1382
|
+
], FigureV3Editor.prototype, "notice", void 0);
|
|
1240
1383
|
__decorate([
|
|
1241
1384
|
state(),
|
|
1242
1385
|
__metadata("design:type", Object)
|