@things-factory/worklist 10.1.28 → 10.1.29

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.
Files changed (24) hide show
  1. package/dist-client/pages/activity/activity-page.js +9 -18
  2. package/dist-client/pages/activity/activity-page.js.map +1 -1
  3. package/dist-client/pages/activity-approval/activity-approval-page.d.ts +14 -2
  4. package/dist-client/pages/activity-approval/activity-approval-page.js +120 -45
  5. package/dist-client/pages/activity-approval/activity-approval-page.js.map +1 -1
  6. package/dist-client/pages/activity-catalog/activity-catalog-page.d.ts +1 -0
  7. package/dist-client/pages/activity-catalog/activity-catalog-page.js +5 -0
  8. package/dist-client/pages/activity-catalog/activity-catalog-page.js.map +1 -1
  9. package/dist-client/pages/activity-instance/activity-instance-start-page.js +7 -7
  10. package/dist-client/pages/activity-instance/activity-instance-start-page.js.map +1 -1
  11. package/dist-client/pages/activity-thread/activity-thread-page.d.ts +1 -0
  12. package/dist-client/pages/activity-thread/activity-thread-page.js +5 -0
  13. package/dist-client/pages/activity-thread/activity-thread-page.js.map +1 -1
  14. package/dist-client/pages/activity-thread/activity-thread-view-page.d.ts +1 -0
  15. package/dist-client/pages/activity-thread/activity-thread-view-page.js +5 -0
  16. package/dist-client/pages/activity-thread/activity-thread-view-page.js.map +1 -1
  17. package/dist-client/tsconfig.tsbuildinfo +1 -1
  18. package/dist-server/tsconfig.tsbuildinfo +1 -1
  19. package/package.json +10 -10
  20. package/translations/en.json +27 -14
  21. package/translations/ja.json +27 -14
  22. package/translations/ko.json +27 -14
  23. package/translations/ms.json +27 -14
  24. package/translations/zh.json +27 -14
@@ -10,7 +10,7 @@ import { client } from '@operato/graphql';
10
10
  import { i18next, localize } from '@operato/i18n';
11
11
  import { ranMutation } from '../../components/say-outcome.js';
12
12
  import { PageView } from '@operato/shell';
13
- import { CommonButtonStyles, ScrollbarStyles } from '@operato/styles';
13
+ import { CommonButtonStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles';
14
14
  import { provider } from '@operato/board/board-provider.js';
15
15
  function getSafeFormatter(locale, options) {
16
16
  try {
@@ -40,24 +40,15 @@ let ActivityPage = class ActivityPage extends localize(i18next)(PageView) {
40
40
  this.loadError = null;
41
41
  }
42
42
  static { this.styles = [
43
+ /*
44
+ * The frame owns the page shell; the task's content is what it sizes (ADR-0060 decision 8).
45
+ * `ox-board-viewer` asks for `height: 100%`, which only means something inside a box whose own
46
+ * height is settled - the frame settles it.
47
+ */
48
+ WorkSurfacePageStyles,
43
49
  ScrollbarStyles,
44
50
  css `
45
- :host {
46
- display: flex;
47
- flex-direction: column;
48
-
49
- width: 100%;
50
- padding: 5px;
51
- overflow: auto;
52
- }
53
-
54
- [header] {
55
- display: block;
56
- padding: 5px;
57
- }
58
-
59
51
  [content] {
60
- flex: 1;
61
52
  display: block;
62
53
  padding: 5px;
63
54
  }
@@ -109,7 +100,7 @@ let ActivityPage = class ActivityPage extends localize(i18next)(PageView) {
109
100
  renderActivity() {
110
101
  const { name, description, state, thumbnail, dueAt, createdAt } = this.activityInstance || {};
111
102
  return html `
112
- <div header>
103
+ <div header class="page-headroom">
113
104
  <div>name: ${name}</div>
114
105
  <div>description: ${description}</div>
115
106
  <div>state: ${state}</div>
@@ -118,7 +109,7 @@ let ActivityPage = class ActivityPage extends localize(i18next)(PageView) {
118
109
  <img src=${thumbnail} />
119
110
  </div>
120
111
 
121
- <div content>${this.activityContent()}</div>
112
+ <div content class="page-fill">${this.activityContent()}</div>
122
113
  `;
123
114
  }
124
115
  activityContent() {
@@ -1 +1 @@
1
- {"version":3,"file":"activity-page.js","sourceRoot":"","sources":["../../../client/pages/activity/activity-page.ts"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAA;AAC7C,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B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E,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,oCAAoC,CAAC,EAAE,EAAE,CAAC,CACpG,CAAA;IACH,CAAC;;AAxX2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;sDAAsB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CAAW;AAE7B;IAAR,KAAK,EAAE;;4CAAe;AACd;IAAR,KAAK,EAAE;;+CAA0B;AA+JR;IAAzB,KAAK,CAAC,iBAAiB,CAAC;;iDAAiB;AAlM/B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAwZxB","sourcesContent":["import '@operato/list-state/ox-page-state.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { provider } from '@operato/board/board-provider.js'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\nexport const ActivityInstanceStatus = {\n Draft: 'draft',\n Issued: 'issued',\n Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Pending: 'pending',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-page')\nexport class ActivityPage extends localize(i18next)(PageView) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n width: 100%;\n padding: 5px;\n overflow: auto;\n }\n\n [header] {\n display: block;\n padding: 5px;\n }\n\n [content] {\n flex: 1;\n display: block;\n padding: 5px;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n `\n ]\n\n @property({ type: Object }) activityInstance: any\n @property({ type: Object }) board: any\n\n @state() loaded = false\n @state() loadError: unknown = null\n\n /** The id this screen last read, so retry asks for the same task. */\n private lastId?: string\n\n get context() {\n const startable = [ActivityInstanceStatus.Assigned, ActivityInstanceStatus.Issued].includes(\n this.activityInstance?.state\n )\n\n const finishable = [ActivityInstanceStatus.Started].includes(this.activityInstance?.state)\n const savable = finishable\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity',\n actions: [\n startable && {\n title: i18next.t('button.play'),\n action: this._startActivityInstance.bind(this),\n ...CommonButtonStyles.play\n },\n\n savable && {\n title: i18next.t('button.save'),\n action: this._saveActivityInstance.bind(this),\n ...CommonButtonStyles.save\n },\n\n finishable && {\n title: i18next.t('button.finish'),\n action: this._endActivityInstance.bind(this),\n ...CommonButtonStyles.save\n }\n ].filter(Boolean /* truthy only */)\n }\n }\n\n render() {\n /*\n * Reading and failing both drew the same empty header, so a task that could not be read looked\n * like a task with nothing in it (ADR-0060 decision 8).\n */\n return html`<ox-page-state\n .loading=${!this.loaded && !this.loadError}\n .error=${this.loadError}\n @retry=${() => this.lastId && this.fetchActivityInstance(this.lastId)}\n >${this.renderActivity()}</ox-page-state\n >`\n }\n\n renderActivity() {\n const { name, description, state, thumbnail, dueAt, createdAt } = this.activityInstance || {}\n return html`\n <div header>\n <div>name: ${name}</div>\n <div>description: ${description}</div>\n <div>state: ${state}</div>\n <div>posted at: ${createdAt && formatter.format(new Date(createdAt))}</div>\n <div>due at: ${dueAt && formatter.format(new Date(dueAt))}</div>\n <img src=${thumbnail} />\n </div>\n\n <div content>${this.activityContent()}</div>\n `\n }\n\n activityContent() {\n switch (this.activityInstance?.uiType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'page':\n case 'external':\n default:\n return html``\n }\n }\n\n templateContent() {\n const { uiSource: template } = this.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options }\n })\n }\n\n getOutputSpec() {\n const model = this.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options }\n })\n }\n\n generatedContent() {\n var { input, output } = this.activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityInstance.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n }\n\n boardContent() {\n const { uiSource: boardId, input, output } = this.activityInstance\n\n if (!this.board || this.board.id !== boardId) {\n this.board = { id: boardId }\n }\n\n return html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n }\n\n @query('ox-board-viewer') boardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.boardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityInstance')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active) {\n this.fetchActivityInstance(lifecycle.resourceId)\n }\n }\n\n async fetchActivityInstance(id) {\n this.lastId = id\n this.loadError = null\n\n try {\n const response = await client.query({\n query: gql`\n query activityInstance($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors?.length || !response.data?.activityInstance) {\n throw (\n response.errors?.[0] || new Error(i18next.t('error.activity-instance not found', { activityInstance: id }))\n )\n }\n\n this.activityInstance = response.data.activityInstance\n this.loaded = true\n } catch (error) {\n this.loadError = error\n }\n }\n\n async _startActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object) {\n startActivityInstance(id: $id, output: $output) {\n name\n }\n }\n `,\n variables: { id, output }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n await this.fetchActivityInstance(this.activityInstance.id)\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully') } })\n )\n }\n\n async _saveActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $save: ActivityInstanceSave!) {\n draftActivityInstance(id: $id, save: $save) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id, save: { output } }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n this.activityInstance = outcome.data.saveActivityInstance\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } })\n )\n }\n\n async _endActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object, $reason: String) {\n endActivityInstance(id: $id, output: $output, reason: $reason) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id, output, reason }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n this.activityInstance = outcome.data.endActivityInstance\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully') } })\n )\n }\n}\n"]}
1
+ {"version":3,"file":"activity-page.js","sourceRoot":"","sources":["../../../client/pages/activity/activity-page.ts"],"names":[],"mappings":";AAAA,OAAO,sCAAsC,CAAA;AAC7C,OAAO,wDAAwD,CAAA;AAC/D,OAAO,mCAAmC,CAAA;AAE1C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE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W;AAE7B;IAAR,KAAK,EAAE;;4CAAe;AACd;IAAR,KAAK,EAAE;;+CAA0B;AA+JR;IAAzB,KAAK,CAAC,iBAAiB,CAAC;;iDAAiB;AAzL/B,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CA+YxB","sourcesContent":["import '@operato/list-state/ox-page-state.js'\nimport '@operato/property-editor/ox-properties-dynamic-view.js'\nimport '@operato/board/ox-board-viewer.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ranMutation } from '../../components/say-outcome.js'\nimport { PageView } from '@operato/shell'\nimport { CommonButtonStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { provider } from '@operato/board/board-provider.js'\n\nfunction getSafeFormatter(locale: string, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat {\n try {\n const safeLocale = locale || 'en-US'\n return new Intl.DateTimeFormat(safeLocale, options)\n } catch (e) {\n console.warn(`Invalid locale or options provided: ${locale}, falling back to default en-US.`, e)\n return new Intl.DateTimeFormat('en-US', options)\n }\n}\n\nconst formatter = getSafeFormatter(navigator.language, { dateStyle: 'full', timeStyle: 'short' })\n\nexport const ActivityInstanceStatus = {\n Draft: 'draft',\n Issued: 'issued',\n Unassigned: 'unassigned',\n Assigned: 'assigned',\n Started: 'started',\n Pending: 'pending',\n Ended: 'ended',\n Aborted: 'aborted'\n}\n\n@customElement('activity-page')\nexport class ActivityPage extends localize(i18next)(PageView) {\n static styles = [\n /*\n * The frame owns the page shell; the task's content is what it sizes (ADR-0060 decision 8).\n * `ox-board-viewer` asks for `height: 100%`, which only means something inside a box whose own\n * height is settled - the frame settles it.\n */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n css`\n [content] {\n display: block;\n padding: 5px;\n }\n\n ox-board-viewer {\n width: 100%;\n height: 100%;\n }\n `\n ]\n\n @property({ type: Object }) activityInstance: any\n @property({ type: Object }) board: any\n\n @state() loaded = false\n @state() loadError: unknown = null\n\n /** The id this screen last read, so retry asks for the same task. */\n private lastId?: string\n\n get context() {\n const startable = [ActivityInstanceStatus.Assigned, ActivityInstanceStatus.Issued].includes(\n this.activityInstance?.state\n )\n\n const finishable = [ActivityInstanceStatus.Started].includes(this.activityInstance?.state)\n const savable = finishable\n\n return {\n title: this.lifecycle?.params?.['title'] || i18next.t('title.activity'),\n help: 'worklist/activity',\n actions: [\n startable && {\n title: i18next.t('button.play'),\n action: this._startActivityInstance.bind(this),\n ...CommonButtonStyles.play\n },\n\n savable && {\n title: i18next.t('button.save'),\n action: this._saveActivityInstance.bind(this),\n ...CommonButtonStyles.save\n },\n\n finishable && {\n title: i18next.t('button.finish'),\n action: this._endActivityInstance.bind(this),\n ...CommonButtonStyles.save\n }\n ].filter(Boolean /* truthy only */)\n }\n }\n\n render() {\n /*\n * Reading and failing both drew the same empty header, so a task that could not be read looked\n * like a task with nothing in it (ADR-0060 decision 8).\n */\n return html`<ox-page-state\n .loading=${!this.loaded && !this.loadError}\n .error=${this.loadError}\n @retry=${() => this.lastId && this.fetchActivityInstance(this.lastId)}\n >${this.renderActivity()}</ox-page-state\n >`\n }\n\n renderActivity() {\n const { name, description, state, thumbnail, dueAt, createdAt } = this.activityInstance || {}\n return html`\n <div header class=\"page-headroom\">\n <div>name: ${name}</div>\n <div>description: ${description}</div>\n <div>state: ${state}</div>\n <div>posted at: ${createdAt && formatter.format(new Date(createdAt))}</div>\n <div>due at: ${dueAt && formatter.format(new Date(dueAt))}</div>\n <img src=${thumbnail} />\n </div>\n\n <div content class=\"page-fill\">${this.activityContent()}</div>\n `\n }\n\n activityContent() {\n switch (this.activityInstance?.uiType) {\n case 'template':\n return this.templateContent()\n case 'generated':\n return this.generatedContent()\n case 'board':\n return this.boardContent()\n case 'page':\n case 'external':\n default:\n return html``\n }\n }\n\n templateContent() {\n const { uiSource: template } = this.activityInstance\n return unsafeHTML(template)\n }\n\n getInputSpec() {\n const model = this.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'in' || item.inout === 'inout')\n .map(item => {\n return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options }\n })\n }\n\n getOutputSpec() {\n const model = this.activityInstance?.activity?.model\n\n return (model || [])\n .filter(item => item.inout === 'inout' || item.inout === 'out')\n .map(item => {\n return { ...item, name: item.tag, label: item.tKey || item.name, property: item.options }\n })\n }\n\n generatedContent() {\n var { input, output } = this.activityInstance || {}\n\n const inputSpec = this.getInputSpec()\n const outputSpec = this.getOutputSpec()\n\n if (!output) {\n output = inputSpec\n .filter(item => item.inout === 'inout')\n .reduce((inout, item) => {\n inout[item.name] = input[item.name]\n return inout\n }, {})\n }\n\n return html`\n <fieldset>\n <legend>Input</legend>\n <ox-properties-dynamic-view data-name=\"input\" .props=${inputSpec} .value=${input}></ox-properties-dynamic-view>\n </fieldset>\n\n <fieldset>\n <legend>Output</legend>\n <ox-properties-dynamic-view\n data-name=\"output\"\n .props=${outputSpec}\n .value=${output}\n @property-change=${e => (this.activityInstance.output = e.currentTarget.value)}\n ></ox-properties-dynamic-view>\n </fieldset>\n `\n }\n\n boardContent() {\n const { uiSource: boardId, input, output } = this.activityInstance\n\n if (!this.board || this.board.id !== boardId) {\n this.board = { id: boardId }\n }\n\n return html`\n <ox-board-viewer\n style=\"background-color: white;\"\n .board=${this.board}\n .provider=${provider}\n .values=${{ ...input, ...output }}\n hide-fullscreen\n hide-navigation\n ></ox-board-viewer>\n `\n }\n\n @query('ox-board-viewer') boardViewer: any\n\n getOutputFromBoard() {\n const outputSpec = this.getOutputSpec()\n const data = this.boardViewer.getSceneValues()\n\n return outputSpec.reduce((output, spec) => {\n output[spec.name] = data[spec.name]\n return output\n }, {})\n }\n\n updated(changes) {\n if (changes.has('activityInstance')) {\n this.updateContext()\n }\n }\n\n async pageUpdated(changes, lifecycle, changedBefore) {\n if (this.active) {\n this.fetchActivityInstance(lifecycle.resourceId)\n }\n }\n\n async fetchActivityInstance(id) {\n this.lastId = id\n this.loadError = null\n\n try {\n const response = await client.query({\n query: gql`\n query activityInstance($id: String!) {\n activityInstance(id: $id) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id }\n })\n\n if (response.errors?.length || !response.data?.activityInstance) {\n throw (\n response.errors?.[0] || new Error(i18next.t('error.activity-instance not found', { activityInstance: id }))\n )\n }\n\n this.activityInstance = response.data.activityInstance\n this.loaded = true\n } catch (error) {\n this.loadError = error\n }\n }\n\n async _startActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object) {\n startActivityInstance(id: $id, output: $output) {\n name\n }\n }\n `,\n variables: { id, output }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n await this.fetchActivityInstance(this.activityInstance.id)\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_started_successfully') } })\n )\n }\n\n async _saveActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $save: ActivityInstanceSave!) {\n draftActivityInstance(id: $id, save: $save) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id, save: { output } }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n this.activityInstance = outcome.data.saveActivityInstance\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_saved_successfully') } })\n )\n }\n\n async _endActivityInstance() {\n var { id, output, reason, uiType } = this.activityInstance\n if (uiType === 'board') {\n output = this.getOutputFromBoard()\n }\n\n const outcome = await ranMutation(() =>\n client.mutate({\n mutation: gql`\n mutation ($id: String!, $output: Object, $reason: String) {\n endActivityInstance(id: $id, output: $output, reason: $reason) {\n id\n name\n description\n state\n activity {\n model {\n name\n description\n active\n tag\n inout\n type\n unit\n options\n quantifier\n spec\n }\n }\n thumbnail\n input\n output\n uiType\n uiSource\n dueAt\n createdAt\n }\n }\n `,\n variables: { id, output, reason }\n })\n )\n\n if (!outcome.ok) {\n return\n }\n\n this.activityInstance = outcome.data.endActivityInstance\n\n document.dispatchEvent(\n new CustomEvent('notify', { detail: { message: i18next.t('text.task_is_finished_successfully') } })\n )\n }\n}\n"]}
@@ -19,6 +19,13 @@ declare const ActivityApprovalPage_base: (new (...args: any[]) => import("lit").
19
19
  export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
20
20
  static styles: import("lit").CSSResult[];
21
21
  activityApproval: any;
22
+ /**
23
+ * 타임라인이 옆에 설 만큼 넓은가.
24
+ *
25
+ * 폭은 CSS 가 정하지만 타임라인을 펴는 것은 속성이라 CSS 로 안 된다. 같은 값을 두 곳에 적지
26
+ * 않도록 물음은 하나이고(`BESIDE`), 그 물음을 CSS 와 여기가 함께 쓴다.
27
+ */
28
+ private beside;
22
29
  /**
23
30
  * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**
24
31
  *
@@ -50,10 +57,13 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
50
57
  */
51
58
  get isReference(): boolean;
52
59
  get context(): {
60
+ frame: string;
53
61
  title: any;
54
62
  help: string;
55
63
  menu: string;
56
64
  actions: {
65
+ title: string;
66
+ action: () => Promise<void>;
57
67
  icon: string;
58
68
  emphasis: {
59
69
  raised: boolean;
@@ -61,10 +71,12 @@ export declare class ActivityApprovalPage extends ActivityApprovalPage_base {
61
71
  dense: boolean;
62
72
  danger: boolean;
63
73
  };
64
- title: string;
65
- action: () => void;
66
74
  }[];
67
75
  };
76
+ private media?;
77
+ private onBeside;
78
+ connectedCallback(): void;
79
+ disconnectedCallback(): void;
68
80
  render(): TemplateResult<1>;
69
81
  private renderApproval;
70
82
  /** 화면에 낼 항목이 하나라도 있나. 타임라인을 펴 둘지 정하는 자리가 쓴다. */
@@ -6,7 +6,7 @@ import '@operato/board/ox-board-viewer.js';
6
6
  import '../../components/activity-approval-ribon.js';
7
7
  import '../../components/activity-thread-timeline.js';
8
8
  import gql from 'graphql-tag';
9
- import { css, html, nothing } from 'lit';
9
+ import { css, html, nothing, unsafeCSS } from 'lit';
10
10
  import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
11
11
  import { customElement, query, state } from 'lit/decorators.js';
12
12
  import { keyed } from 'lit/directives/keyed.js';
@@ -16,7 +16,7 @@ import { i18next, localize } from '@operato/i18n';
16
16
  import { ranMutation } from '../../components/say-outcome.js';
17
17
  import { approvalGate } from './approval-gate.js';
18
18
  import { PageView } from '@operato/shell';
19
- import { CommonButtonStyles, DocumentPageStyles, ScrollbarStyles } from '@operato/styles';
19
+ import { DocumentPageStyles, ScrollbarStyles } from '@operato/styles';
20
20
  import { provider } from '@operato/board/board-provider.js';
21
21
  import { isReferenceStep } from '@things-factory/organization/dist-client';
22
22
  import { ActivityFieldsStyles, declaredLabel, fieldValue, inputSpecOf, outputSpecOf, renderGiven } from '../../components/activity-fields.js';
@@ -111,9 +111,18 @@ export const ActivityThreadStatus = {
111
111
  Ended: 'ended',
112
112
  Aborted: 'aborted'
113
113
  };
114
+ /** 타임라인이 옆에 서는 폭 — 읽는 단 1080 + 사이 24 + 최소 판 360 + page 좌우 40. */
115
+ const BESIDE = '(min-width: 1504px)';
114
116
  let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(PageView) {
115
117
  constructor() {
116
118
  super(...arguments);
119
+ /**
120
+ * 타임라인이 옆에 설 만큼 넓은가.
121
+ *
122
+ * 폭은 CSS 가 정하지만 타임라인을 펴는 것은 속성이라 CSS 로 안 된다. 같은 값을 두 곳에 적지
123
+ * 않도록 물음은 하나이고(`BESIDE`), 그 물음을 CSS 와 여기가 함께 쓴다.
124
+ */
125
+ this.beside = false;
117
126
  /**
118
127
  * 조회를 마쳤나 — **「아직 안 읽었다」와 「없다」는 다르다.**
119
128
  *
@@ -126,6 +135,7 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
126
135
  this.loaded = false;
127
136
  /** Why the approval could not be read - ox-page-state says it, with retry (ADR-0060 decision 8). */
128
137
  this.loadError = null;
138
+ this.onBeside = () => (this.beside = !!this.media?.matches);
129
139
  }
130
140
  static { this.styles = [
131
141
  /* The frame owns the page shell and the reading column (ADR-0060 decision 8). */
@@ -138,6 +148,72 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
138
148
  font-size: var(--ui-t-body, 13px);
139
149
  }
140
150
 
151
+ /*
152
+ * 넓을 때만 타임라인이 옆에 선다 — **읽는 단은 줄이지 않는다.**
153
+ *
154
+ * 결재자가 판단에 쓰는 것(결정 · 사유 · 의견)이 왼쪽이고, 참고하는 것(타임라인)이 오른쪽이다.
155
+ * 처음 낸 안은 읽는 단 1080 안에서 둘로 쪼개는 것이었는데, 그러면 결정 카드가 1014 에서
156
+ * 520 으로 줄어든다 — 주된 것을 좁혀 참고용 자리를 만드는 꼴이라 물렀다.
157
+ *
158
+ * 그래서 **읽는 단을 넘는 여분이 한 판만큼 있을 때만** 편다:
159
+ *
160
+ * 1080(읽는 단) + 24(사이) + 360(최소 판) + 40(page 좌우 여백) = 1504
161
+ *
162
+ * 그 아래에서는 한 단이고 차례가 그대로다 — 결재선 · 결정 · 타임라인 · 의견. 좁은 화면이
163
+ * 기본이고 넓은 화면이 덤이다.
164
+ */
165
+ @media ${unsafeCSS(BESIDE)} {
166
+ .page {
167
+ max-width: none;
168
+ display: grid;
169
+ grid-template-columns: var(--ui-measure, 1080px) minmax(360px, 1fr);
170
+ column-gap: 24px;
171
+ align-items: start;
172
+ }
173
+
174
+ /*
175
+ * 두 판의 자리는 문서 차례가 아니라 격자가 정한다. 문서 차례는 좁은 화면 그대로 두어야
176
+ * 하고(결재선 · 결정 · 타임라인 · 의견), 넓은 화면에서만 타임라인이 오른쪽으로 빠진다.
177
+ */
178
+ .main {
179
+ grid-column: 1;
180
+ min-width: 0;
181
+ }
182
+
183
+ /* 옆에 선 타임라인은 읽는 동안 따라온다 — 결정과 맞대어 보는 값이다. */
184
+ .aside {
185
+ grid-column: 2;
186
+ grid-row: 1 / span 3;
187
+ position: sticky;
188
+ top: 0;
189
+ }
190
+ }
191
+
192
+ .comment-actions {
193
+ display: flex;
194
+ justify-content: flex-end;
195
+ }
196
+
197
+ .comment-actions button {
198
+ display: inline-flex;
199
+ align-items: center;
200
+ gap: 4px;
201
+ height: var(--form-action-height, 32px);
202
+ padding: 0 12px;
203
+ border: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));
204
+ border-radius: var(--ui-r-small, 6px);
205
+ background: transparent;
206
+ color: var(--ui-ink, var(--md-sys-color-on-surface));
207
+ font: inherit;
208
+ font-size: var(--ui-t-body, 13px);
209
+ cursor: pointer;
210
+ }
211
+
212
+ .comment-actions md-icon {
213
+ font-size: 16px;
214
+ --md-icon-size: 16px;
215
+ }
216
+
141
217
  /* 카드가 담아 주므로 안에 들어오는 화면은 자기 면과 여백을 갖지 않는다. */
142
218
  /*
143
219
  * 줄어들지 않는다 — 줄어들면 본문이 잘린다.
@@ -370,6 +446,11 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
370
446
  get context() {
371
447
  const judgment = this.activityApproval?.judgment;
372
448
  return {
449
+ /*
450
+ * 이 화면이 어떤 틀인가 — 동작 줄이 이것을 읽고 자기 오른쪽 끝을 내용에 맞춘다
451
+ * (ADR-0060 결정 9 보탬). 안 적으면 창 폭이고, 그것은 작업면의 모양이다.
452
+ */
453
+ frame: 'document',
373
454
  title: this.lifecycle?.params?.['title'] || i18next.t('title.activity approval'),
374
455
  help: 'worklist/activity-approval',
375
456
  /*
@@ -391,32 +472,9 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
391
472
  * reader looking for them.
392
473
  */
393
474
  actions: judgment
394
- ? [
395
- {
396
- title: i18next.t('button.close'),
397
- action: () => {
398
- history.back();
399
- },
400
- ...CommonButtonStyles.back
401
- }
402
- ]
475
+ ? []
403
476
  : this.isReference
404
- ? [
405
- {
406
- title: i18next.t('button.save-note'),
407
- action: this.saveActivityApproval.bind(this),
408
- icon: 'edit_note',
409
- emphasis: { raised: true, outlined: false, dense: false, danger: false }
410
- },
411
- {
412
- title: i18next.t('button.close'),
413
- action: () => {
414
- history.back();
415
- },
416
- ...CommonButtonStyles.back,
417
- icon: 'close'
418
- }
419
- ]
477
+ ? []
420
478
  : /*
421
479
  * ── 세 단추의 순서와 무게 (2026-09-06) ──────────────────────────
422
480
  * 전에는 반려가 첫 자리였고, 승인 · 반려 · 저장이 모두 같은 모양이었다. 되돌리기 어려운
@@ -443,24 +501,20 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
443
501
  icon: 'assignment_return',
444
502
  emphasis: { raised: false, outlined: true, dense: false, danger: false }
445
503
  },
446
- {
447
- title: i18next.t('button.save-note'),
448
- action: this.saveActivityApproval.bind(this),
449
- icon: 'edit_note',
450
- emphasis: { raised: false, outlined: true, dense: false, danger: false }
451
- },
452
- {
453
- title: i18next.t('button.close'),
454
- action: () => {
455
- history.back();
456
- },
457
- ...CommonButtonStyles.back,
458
- icon: 'close'
459
- }
460
504
  ]
461
505
  // activityApproval: this.activityApproval
462
506
  };
463
507
  }
508
+ connectedCallback() {
509
+ super.connectedCallback();
510
+ this.media = window.matchMedia(BESIDE);
511
+ this.onBeside();
512
+ this.media.addEventListener('change', this.onBeside);
513
+ }
514
+ disconnectedCallback() {
515
+ this.media?.removeEventListener('change', this.onBeside);
516
+ super.disconnectedCallback();
517
+ }
464
518
  render() {
465
519
  /* Reading and failing both drew nothing at all, so a failure looked like an empty screen. */
466
520
  return html `<div class="page">
@@ -483,20 +537,26 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
483
537
  const { terminatedAt } = this.activityApproval;
484
538
  const editable = !terminatedAt;
485
539
  return html `
486
- <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>
487
- ${this.activityContent()}
540
+ <div class="main">
541
+ <activity-approval-ribon .activityApproval=${this.activityApproval}></activity-approval-ribon>
542
+ ${this.activityContent()}
543
+ </div>
488
544
  <!--
489
545
  보일 항목이 하나도 없으면 타임라인을 편다 — 그때는 화면이 「아래 타임라인의 상신 사유와
490
546
  이력을 보고 판단하세요」로 여기를 가리키므로, 접혀 있으면 그 안내가 거짓말이 된다.
547
+
548
+ 옆에 설 자리가 있을 때도 편다. 접힌 줄을 눌러 펴는 동작이, 그 줄이 이미 보이는 자리에
549
+ 있으면 하는 일이 없다.
491
550
  -->
492
551
  <activity-thread-timeline
552
+ class="aside"
493
553
  .activityThread=${this.activityThread}
494
- ?open=${!this.hasFields()}
554
+ ?open=${!this.hasFields() || this.beside}
495
555
  short-form
496
556
  ></activity-thread-timeline>
497
557
  ${editable
498
558
  ? html `
499
- <div comment>
559
+ <div comment class="main">
500
560
  <section>
501
561
  <h2>${i18next.t('field.wl-comment')}</h2>
502
562
  <textarea
@@ -519,6 +579,17 @@ let ActivityApprovalPage = class ActivityApprovalPage extends localize(i18next)(
519
579
  <p class="hint">
520
580
  ${i18next.t(this.isReference ? 'text.reference-comment-hint' : 'text.approval-comment-hint')}
521
581
  </p>
582
+
583
+ <!--
584
+ 의견을 저장하는 단추는 의견 상자 옆이다(ADR-0060 결정 9 보탬). 동작 줄에는
585
+ 결정만 둔다 — 전에는 승인 · 반려와 같은 줄에 같은 무게로 서서 셋 다 결정처럼
586
+ 읽혔고, 좁은 화면에서는 넘침 메뉴로 밀려 반려가 숨을 수 있었다.
587
+ -->
588
+ <div class="comment-actions">
589
+ <button @click=${this.saveActivityApproval.bind(this)}>
590
+ <md-icon>edit_note</md-icon>${i18next.t('button.save-note')}
591
+ </button>
592
+ </div>
522
593
  </section>
523
594
  </div>
524
595
  `
@@ -1025,6 +1096,10 @@ __decorate([
1025
1096
  state(),
1026
1097
  __metadata("design:type", Object)
1027
1098
  ], ActivityApprovalPage.prototype, "activityApproval", void 0);
1099
+ __decorate([
1100
+ state(),
1101
+ __metadata("design:type", Object)
1102
+ ], ActivityApprovalPage.prototype, "beside", void 0);
1028
1103
  __decorate([
1029
1104
  state(),
1030
1105
  __metadata("design:type", Object)