@things-factory/board-ui 10.1.227 → 10.1.229
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/dist-client/pages/board-list-page.d.ts +1 -1
- package/dist-client/pages/board-list-page.js +8 -8
- package/dist-client/pages/board-list-page.js.map +1 -1
- package/dist-client/pages/board-modeller-page.d.ts +1 -1
- package/dist-client/pages/board-modeller-page.js +2 -2
- package/dist-client/pages/board-modeller-page.js.map +1 -1
- package/dist-client/pages/board-player-page.d.ts +1 -1
- package/dist-client/pages/board-player-page.js +4 -4
- package/dist-client/pages/board-player-page.js.map +1 -1
- package/dist-client/pages/board-viewer-page.d.ts +1 -1
- package/dist-client/pages/board-viewer-page.js +3 -3
- package/dist-client/pages/board-viewer-page.js.map +1 -1
- package/dist-client/pages/play-list-page.d.ts +1 -1
- package/dist-client/pages/play-list-page.js +10 -10
- package/dist-client/pages/play-list-page.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/translations/en.json +0 -2
- package/translations/es.json +0 -2
- package/translations/ja.json +0 -2
- package/translations/ko.json +0 -2
- package/translations/ms.json +0 -2
- package/translations/zh.json +0 -2
|
@@ -162,7 +162,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
162
162
|
},
|
|
163
163
|
sorters: []
|
|
164
164
|
};
|
|
165
|
-
this.
|
|
165
|
+
this.load();
|
|
166
166
|
}
|
|
167
167
|
async fetchHandler(_option) {
|
|
168
168
|
const favorites = this.favorites || [];
|
|
@@ -173,13 +173,13 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
173
173
|
}));
|
|
174
174
|
return { total: records.length, records };
|
|
175
175
|
}
|
|
176
|
-
async
|
|
176
|
+
async load() {
|
|
177
177
|
this.groups = (await fetchPlayGroupList()).playGroups.items;
|
|
178
178
|
this.groups && (await this.refreshBoards());
|
|
179
179
|
}
|
|
180
180
|
async refreshBoards() {
|
|
181
181
|
if (!this.groups) {
|
|
182
|
-
await this.
|
|
182
|
+
await this.load();
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
if (!this.groupId) {
|
|
@@ -258,7 +258,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
258
258
|
container: this.shadowRoot,
|
|
259
259
|
scrollable: this.grist,
|
|
260
260
|
refresh: () => {
|
|
261
|
-
return this.
|
|
261
|
+
return this.load();
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
}
|
|
@@ -297,7 +297,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
297
297
|
catch (ex) {
|
|
298
298
|
notify('error', ex, ex);
|
|
299
299
|
}
|
|
300
|
-
this.
|
|
300
|
+
this.load();
|
|
301
301
|
}
|
|
302
302
|
async onUpdatePlayGroup(playGroup) {
|
|
303
303
|
try {
|
|
@@ -307,7 +307,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
307
307
|
catch (ex) {
|
|
308
308
|
notify('error', ex, ex);
|
|
309
309
|
}
|
|
310
|
-
this.
|
|
310
|
+
this.load();
|
|
311
311
|
}
|
|
312
312
|
async onDeletePlayGroup(playGroup) {
|
|
313
313
|
try {
|
|
@@ -317,7 +317,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
317
317
|
catch (ex) {
|
|
318
318
|
notify('error', ex, ex);
|
|
319
319
|
}
|
|
320
|
-
this.
|
|
320
|
+
this.load();
|
|
321
321
|
}
|
|
322
322
|
async onUpdateBoard(board) {
|
|
323
323
|
try {
|
|
@@ -353,7 +353,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
353
353
|
catch (ex) {
|
|
354
354
|
notify('error', ex, ex);
|
|
355
355
|
}
|
|
356
|
-
this.
|
|
356
|
+
this.load();
|
|
357
357
|
}
|
|
358
358
|
async onLeavePlayGroup({ board, playGroup }) {
|
|
359
359
|
try {
|
|
@@ -375,7 +375,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
375
375
|
catch (ex) {
|
|
376
376
|
notify('error', ex, ex);
|
|
377
377
|
}
|
|
378
|
-
this.
|
|
378
|
+
this.load();
|
|
379
379
|
}
|
|
380
380
|
async onReorder({ ids, movedId }) {
|
|
381
381
|
const groupId = this.groupId;
|
|
@@ -400,7 +400,7 @@ let PlayListPage = class PlayListPage extends localize(i18next)(PageView) {
|
|
|
400
400
|
catch (ex) {
|
|
401
401
|
notify('error', ex, ex);
|
|
402
402
|
/* 실패 시에만 서버 데이터로 복원 */
|
|
403
|
-
this.
|
|
403
|
+
this.load();
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
async toggleFavorite(board) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"play-list-page.js","sourceRoot":"","sources":["../../client/pages/play-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,2CAA2C,CAAA;AAElD,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,C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6gBxB","sourcesContent":["import '@operato/data-grist'\nimport '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@operato/input/ox-input-select-buttons.js'\n\nimport '../viewparts/play-group-info.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { UPDATE_FAVORITES } from '@things-factory/fav-base/client'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { pulltorefresh } from '@operato/pull-to-refresh'\nimport { notify } from '../utils/notify-helper.js'\nimport { boardMeta } from '../utils/board-meta.js'\nimport { CardCatalogStyles } from '@operato/styles'\n\nimport { boardCardThumb } from '../board-list/board-card-thumb.js'\n\nimport {\n createPlayGroup,\n deletePlayGroup,\n fetchPlayGroup,\n fetchPlayGroupList,\n updateBoard,\n updatePlayGroup\n} from '../graphql'\n\n/*\n * Same board-card look as board-list-page (ox-grist CARD mode, drag-reorder — see\n * `data-grist`'s `rows.reorderable`, ADR: shared component over a board-only fork).\n * A play group's board set is small and its own array *is* the order, so there is no pagination or\n * server-side sort here - `fetchHandler` always hands back the whole thing.\n */\n@customElement('play-list-page')\nexport class PlayListPage extends localize(i18next)(PageView) {\n static styles = [\n /* The frame owns the page shell; the grist is the content it sizes (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n /* The card itself - every card catalog's (@operato/styles), the FAB with it. */\n CardCatalogStyles,\n css`\n /*\n The play groups are chips, not a tab strip - the same select-buttons the list's own\n facets use, so this page and board-list read as one product. One is always pressed:\n a play list is *of* a group, there is no \"all groups\" view here.\n */\n ox-input-select-buttons {\n flex: 1;\n }\n `\n ]\n\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) boards: any[] = []\n @property({ type: Array }) favorites: any[] = []\n @property({ type: Object }) gristConfig: any\n\n @query('ox-grist') private grist!: DataGrist\n\n private page?: string\n\n get context() {\n /* The pressed chip already names the group; the title names the screen, as board-list's does. */\n return {\n title: i18next.t('title.play list'),\n board_topmenu: true\n }\n }\n\n render() {\n const current = (this.groups || []).find(group => group.id === this.groupId)\n\n return html`\n <ox-grist\n class=\"page-fill\"\n mode=\"CARD\"\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @reorder=${e => this.onReorder(e.detail)}\n >\n <div slot=\"headroom\">\n <ox-input-select-buttons\n .value=${this.groupId || ''}\n .options=${(this.groups || []).map(group => ({ display: group.name, value: group.id }))}\n @change=${(e: CustomEvent) => {\n const id = e.detail\n /* The URL stays the source of truth - same round trip a deep link takes. */\n if (id && id !== this.groupId) navigate(`${this.page || 'play-list'}/${id}`)\n }}\n ></ox-input-select-buttons>\n ${current\n ? html`\n <md-text-button @click=${() => this.onInfoPlayGroup(current)}>\n <md-icon slot=\"icon\">edit</md-icon>\n ${i18next.t('text.edit play-group', { defaultValue: 'Edit' })}\n </md-text-button>\n `\n : ''}\n <md-text-button @click=${() => this.onInfoPlayGroup(undefined)}>\n <md-icon slot=\"icon\">playlist_add</md-icon>\n ${i18next.t('text.new play-group', { defaultValue: 'New Play Group' })}\n </md-text-button>\n </div>\n </ox-grist>\n\n ${this.groupId\n ? html`\n <button fab title=${i18next.t('label.play', { defaultValue: 'Play' })} @click=${() => navigate(`board-player/${this.groupId}`)}>\n <md-icon>play_arrow</md-icon>${i18next.t('label.play', { defaultValue: 'Play' })}\n </button>\n `\n : ''}\n `\n }\n\n async pageInitialized() {\n this.gristConfig = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'meta'],\n details: []\n },\n columns: [\n {\n type: 'image',\n name: 'thumbnail',\n record: {\n editable: false,\n align: 'center',\n renderEmpty: true,\n /* The picture and the draft badge (board-card-thumb.ts); info/favorite are gutter columns\n * below, as on board-list-page.ts. */\n renderer: (value, column, record) => boardCardThumb(record)\n }\n },\n { type: 'string', name: 'name', record: { editable: false } },\n { type: 'string', name: 'meta', record: { editable: false } },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'edit',\n /* Edit first, the star last - same order as board-list-page.ts. */\n icon: 'edit',\n quiet: true,\n title: i18next.t('button.edit'),\n handlers: {\n click: (_columns, _data, _column, record) => this.onInfoBoard(record)\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'favorite',\n icon: (record?: any) => (record?.favorited ? 'star' : 'star_border'),\n quiet: (record?: any) => !record?.favorited,\n title: (record?: any) =>\n i18next.t(record?.favorited ? 'label.unfavorite' : 'label.favorite', {\n defaultValue: record?.favorited ? 'Remove from favorites' : 'Add to favorites'\n }),\n handlers: {\n click: (_columns, _data, _column, record) => this.toggleFavorite(record)\n }\n }\n ],\n rows: {\n selectable: false,\n appendable: false,\n reorderable: true,\n handlers: {\n click: (_columns, _data, _column, record) => navigate(`board-viewer/${record.id}`)\n }\n },\n sorters: []\n }\n\n this.refresh()\n }\n\n async fetchHandler(_option: FetchOption) {\n const favorites = this.favorites || []\n const records = (this.boards || []).map(board => ({\n ...board,\n favorited: favorites.includes(board.id),\n meta: boardMeta(board)\n }))\n\n return { total: records.length, records }\n }\n\n async refresh() {\n this.groups = (await fetchPlayGroupList()).playGroups.items\n\n this.groups && (await this.refreshBoards())\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.refresh()\n return\n }\n\n if (!this.groupId) {\n const groupId = this.groups && this.groups[0] && this.groups[0].id\n\n /*\n * Build the address from the page name, not by appending to window.location: re-entering\n * this page from the rail while a play-list/<id> URL is still current appended a second\n * id (play-list/<id>/<id>), the route stopped matching and groupId came back empty - no chip\n * pressed, no Edit button (seen live 2026-09-23).\n */\n if (groupId) {\n navigate(`${this.page || 'play-list'}/${groupId}`, true)\n }\n return\n }\n\n if (this.groupId) {\n const playGroup = (await fetchPlayGroup(this.groupId)).playGroup\n this.boards = playGroup ? playGroup.boards : []\n } else {\n this.boards = []\n }\n\n this.updateContext()\n this.grist?.fetch()\n\n if (this.grist) {\n this.grist.style.transition = ''\n this.grist.style.transform = `translate3d(0, 0, 0)`\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n this.page = lifecycle.page\n /*\n * On a full page load the router can deliver the bare /play-list lifecycle *after* this\n * page has already redirected itself to /play-list/<first group> - the id would be wiped\n * while the URL still shows it (no chip pressed, no Edit button; seen live 2026-09-23).\n * The address bar is the source of truth, so read the id back from it in that case.\n */\n this.groupId = lifecycle.resourceId || this.groupIdFromLocation()\n\n await this.updateComplete\n\n this.refreshBoards()\n }\n }\n\n private groupIdFromLocation(): string {\n const segments = location.pathname.split('/').filter(Boolean)\n const at = segments.lastIndexOf(this.page || 'play-list')\n\n return at >= 0 ? segments[at + 1] || '' : ''\n }\n\n private _unsubscribe?: () => void\n\n connectedCallback() {\n super.connectedCallback()\n\n this._applyState()\n\n this._unsubscribe = store.subscribe(() => this._applyState())\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this._unsubscribe?.()\n }\n\n private _applyState() {\n const __state__ = store.getState() as any\n const favorites = __state__.favorite.favorites\n\n /*\n * `store.subscribe` fires on every dispatch anywhere in the app, not just favorite changes - an\n * unconditional fetch() here risks a loop if fetch() completing itself dispatches through this\n * same store (board-list-page.ts hit exactly this).\n */\n const changed = JSON.stringify(favorites) !== JSON.stringify(this.favorites)\n this.favorites = favorites\n\n if (changed) {\n this.grist?.fetch()\n }\n }\n\n firstUpdated() {\n /* Groups are chips now, one tap each - the swipe-between-routes gesture the tab strip needed\n * no longer has a job here. */\n pulltorefresh({\n container: this.shadowRoot,\n scrollable: this.grist,\n refresh: () => {\n return this.refresh()\n }\n })\n }\n\n async onInfoBoard(board) {\n openPopup(\n html`\n <board-info\n .board=${board}\n .groupId=${this.groupId}\n @update-board=${e => this.onUpdateBoard(e.detail)}\n @delete-board=${e => this.onDeleteBoard(e.detail)}\n @join-playgroup=${e => this.onJoinPlayGroup(e.detail)}\n @leave-playgroup=${e => this.onLeavePlayGroup(e.detail)}\n ></board-info>\n `,\n { backdrop: true, size: 'medium', closable: true, title: board.name }\n )\n }\n\n async onInfoPlayGroup(group) {\n openPopup(\n html`\n <play-group-info\n .playGroup=${group}\n @update-play-group=${e => this.onUpdatePlayGroup(e.detail)}\n @delete-play-group=${e => this.onDeletePlayGroup(e.detail)}\n @create-play-group=${e => this.onCreatePlayGroup(e.detail)}\n ></play-group-info>\n `,\n {\n backdrop: true,\n size: 'small',\n closable: true,\n title: group?.name || i18next.t('text.new play-group', { defaultValue: 'New Play Group' })\n }\n )\n }\n\n async onCreatePlayGroup(playGroup) {\n try {\n await createPlayGroup(playGroup)\n notify('info', i18next.t('text.play-group created', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onUpdatePlayGroup(playGroup) {\n try {\n await updatePlayGroup(playGroup)\n notify('info', i18next.t('text.play-group updated', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onDeletePlayGroup(playGroup) {\n try {\n await deletePlayGroup(playGroup.id)\n notify('info', i18next.t('text.play-group deleted', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onUpdateBoard(board) {\n try {\n await updateBoard(board)\n notify('info', i18next.t('text.board updated', { board: board.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refreshBoards()\n }\n\n async onDeleteBoard(board) {\n const playGroup = this.groups && this.groups.find(group => group.id === this.groupId)\n await this.onLeavePlayGroup({ board, playGroup })\n }\n\n async onJoinPlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n notify('info', i18next.t('text.joined into play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onLeavePlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n notify('info', i18next.t('text.leaved from play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refresh()\n }\n\n async onReorder({ ids, movedId }: { ids: string[]; movedId: string }) {\n const groupId = this.groupId\n\n try {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n reorderPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: ids\n }\n })\n\n const playGroup = response.data.reorderPlayGroup\n\n notify('info', i18next.t('text.reorder play-group', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n /* 실패 시에만 서버 데이터로 복원 */\n this.refresh()\n }\n }\n\n async toggleFavorite(board) {\n const wasFavorite = (this.favorites || []).includes(board.id)\n\n /*\n * The star answers the click at once; the server round trip only confirms it. Before, nothing\n * moved until the mutation, the favorites re-query, the store dispatch and a full refetch had\n * all come back - a click with no reaction reads as a click that did not land.\n *\n * `favorites` is set locally too, so the store update that follows carries the same list and\n * `_applyState` does not trigger the refetch that would repaint every card.\n */\n this.favorites = wasFavorite\n ? (this.favorites || []).filter(id => id !== board.id)\n : [...(this.favorites || []), board.id]\n this.patchRecord(board.id, { favorited: !wasFavorite })\n\n try {\n if (wasFavorite) {\n await this.removeFavorite(board.id)\n } else {\n await this.addFavorite(board.id)\n }\n } catch (ex) {\n /* Put it back the way it was and say why. */\n this.favorites = wasFavorite\n ? [...(this.favorites || []), board.id]\n : (this.favorites || []).filter(id => id !== board.id)\n this.patchRecord(board.id, { favorited: wasFavorite })\n notify('error', (ex as any)?.message || String(ex))\n }\n }\n\n /** Replaces one record in the grist in place, so only that card re-renders. */\n private patchRecord(id: string, patch: Record<string, unknown>) {\n const grist = this.grist\n const data = grist?.data\n\n if (!data?.records) {\n return\n }\n\n grist.data = {\n ...data,\n records: data.records.map(record => (record.id === id ? { ...record, ...patch } : record))\n }\n }\n\n async removeFavorite(boardId) {\n await client.mutate({\n mutation: gql`\n mutation {\n deleteFavorite(routing: \"${boardId}\")\n }\n `\n })\n\n this.refreshFavorites()\n }\n\n async addFavorite(boardId) {\n await client.mutate({\n mutation: gql`\n mutation {\n createFavorite(favorite: {\n routing: \"${boardId}\"\n }) {\n id\n routing\n }\n }\n `\n })\n\n this.refreshFavorites()\n }\n\n async refreshFavorites() {\n const response = await client.query({\n query: gql`\n query {\n myFavorites {\n id\n routing\n }\n }\n `\n })\n\n store.dispatch({\n type: UPDATE_FAVORITES,\n favorites: response.data.myFavorites.map(favorite => favorite.routing)\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"play-list-page.js","sourceRoot":"","sources":["../../client/pages/play-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAC5C,OAAO,2CAA2C,CAAA;AAElD,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAi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AA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAAiB;AAEjB;IAA1B,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;2CAAA;AA3BjC,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CA6gBxB","sourcesContent":["import '@operato/data-grist'\nimport '@material/web/icon/icon.js'\nimport '@material/web/button/text-button.js'\nimport '@operato/input/ox-input-select-buttons.js'\n\nimport '../viewparts/play-group-info.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { UPDATE_FAVORITES } from '@things-factory/fav-base/client'\nimport { openPopup } from '@operato/layout'\nimport { navigate, PageView, store } from '@operato/shell'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonGristStyles, CommonHeaderStyles, ScrollbarStyles, WorkSurfacePageStyles } from '@operato/styles'\nimport { pulltorefresh } from '@operato/pull-to-refresh'\nimport { notify } from '../utils/notify-helper.js'\nimport { boardMeta } from '../utils/board-meta.js'\nimport { CardCatalogStyles } from '@operato/styles'\n\nimport { boardCardThumb } from '../board-list/board-card-thumb.js'\n\nimport {\n createPlayGroup,\n deletePlayGroup,\n fetchPlayGroup,\n fetchPlayGroupList,\n updateBoard,\n updatePlayGroup\n} from '../graphql'\n\n/*\n * Same board-card look as board-list-page (ox-grist CARD mode, drag-reorder — see\n * `data-grist`'s `rows.reorderable`, ADR: shared component over a board-only fork).\n * A play group's board set is small and its own array *is* the order, so there is no pagination or\n * server-side sort here - `fetchHandler` always hands back the whole thing.\n */\n@customElement('play-list-page')\nexport class PlayListPage extends localize(i18next)(PageView) {\n static styles = [\n /* The frame owns the page shell; the grist is the content it sizes (ADR-0060 decision 8). */\n WorkSurfacePageStyles,\n ScrollbarStyles,\n CommonGristStyles,\n CommonHeaderStyles,\n /* The card itself - every card catalog's (@operato/styles), the FAB with it. */\n CardCatalogStyles,\n css`\n /*\n The play groups are chips, not a tab strip - the same select-buttons the list's own\n facets use, so this page and board-list read as one product. One is always pressed:\n a play list is *of* a group, there is no \"all groups\" view here.\n */\n ox-input-select-buttons {\n flex: 1;\n }\n `\n ]\n\n @property({ type: String }) groupId?: string\n @property({ type: Array }) groups: any[] = []\n @property({ type: Array }) boards: any[] = []\n @property({ type: Array }) favorites: any[] = []\n @property({ type: Object }) gristConfig: any\n\n @query('ox-grist') private grist!: DataGrist\n\n private page?: string\n\n get context() {\n /* The pressed chip already names the group; the title names the screen, as board-list's does. */\n return {\n title: i18next.t('title.play list'),\n board_topmenu: true\n }\n }\n\n render() {\n const current = (this.groups || []).find(group => group.id === this.groupId)\n\n return html`\n <ox-grist\n class=\"page-fill\"\n mode=\"CARD\"\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @reorder=${e => this.onReorder(e.detail)}\n >\n <div slot=\"headroom\">\n <ox-input-select-buttons\n .value=${this.groupId || ''}\n .options=${(this.groups || []).map(group => ({ display: group.name, value: group.id }))}\n @change=${(e: CustomEvent) => {\n const id = e.detail\n /* The URL stays the source of truth - same round trip a deep link takes. */\n if (id && id !== this.groupId) navigate(`${this.page || 'play-list'}/${id}`)\n }}\n ></ox-input-select-buttons>\n ${current\n ? html`\n <md-text-button @click=${() => this.onInfoPlayGroup(current)}>\n <md-icon slot=\"icon\">edit</md-icon>\n ${i18next.t('text.edit play-group', { defaultValue: 'Edit' })}\n </md-text-button>\n `\n : ''}\n <md-text-button @click=${() => this.onInfoPlayGroup(undefined)}>\n <md-icon slot=\"icon\">playlist_add</md-icon>\n ${i18next.t('text.new play-group', { defaultValue: 'New Play Group' })}\n </md-text-button>\n </div>\n </ox-grist>\n\n ${this.groupId\n ? html`\n <button fab title=${i18next.t('label.play', { defaultValue: 'Play' })} @click=${() => navigate(`board-player/${this.groupId}`)}>\n <md-icon>play_arrow</md-icon>${i18next.t('label.play', { defaultValue: 'Play' })}\n </button>\n `\n : ''}\n `\n }\n\n async pageInitialized() {\n this.gristConfig = {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name', 'meta'],\n details: []\n },\n columns: [\n {\n type: 'image',\n name: 'thumbnail',\n record: {\n editable: false,\n align: 'center',\n renderEmpty: true,\n /* The picture and the draft badge (board-card-thumb.ts); info/favorite are gutter columns\n * below, as on board-list-page.ts. */\n renderer: (value, column, record) => boardCardThumb(record)\n }\n },\n { type: 'string', name: 'name', record: { editable: false } },\n { type: 'string', name: 'meta', record: { editable: false } },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'edit',\n /* Edit first, the star last - same order as board-list-page.ts. */\n icon: 'edit',\n quiet: true,\n title: i18next.t('button.edit'),\n handlers: {\n click: (_columns, _data, _column, record) => this.onInfoBoard(record)\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n name: 'favorite',\n icon: (record?: any) => (record?.favorited ? 'star' : 'star_border'),\n quiet: (record?: any) => !record?.favorited,\n title: (record?: any) =>\n i18next.t(record?.favorited ? 'label.unfavorite' : 'label.favorite', {\n defaultValue: record?.favorited ? 'Remove from favorites' : 'Add to favorites'\n }),\n handlers: {\n click: (_columns, _data, _column, record) => this.toggleFavorite(record)\n }\n }\n ],\n rows: {\n selectable: false,\n appendable: false,\n reorderable: true,\n handlers: {\n click: (_columns, _data, _column, record) => navigate(`board-viewer/${record.id}`)\n }\n },\n sorters: []\n }\n\n this.load()\n }\n\n async fetchHandler(_option: FetchOption) {\n const favorites = this.favorites || []\n const records = (this.boards || []).map(board => ({\n ...board,\n favorited: favorites.includes(board.id),\n meta: boardMeta(board)\n }))\n\n return { total: records.length, records }\n }\n\n async load() {\n this.groups = (await fetchPlayGroupList()).playGroups.items\n\n this.groups && (await this.refreshBoards())\n }\n\n async refreshBoards() {\n if (!this.groups) {\n await this.load()\n return\n }\n\n if (!this.groupId) {\n const groupId = this.groups && this.groups[0] && this.groups[0].id\n\n /*\n * Build the address from the page name, not by appending to window.location: re-entering\n * this page from the rail while a play-list/<id> URL is still current appended a second\n * id (play-list/<id>/<id>), the route stopped matching and groupId came back empty - no chip\n * pressed, no Edit button (seen live 2026-09-23).\n */\n if (groupId) {\n navigate(`${this.page || 'play-list'}/${groupId}`, true)\n }\n return\n }\n\n if (this.groupId) {\n const playGroup = (await fetchPlayGroup(this.groupId)).playGroup\n this.boards = playGroup ? playGroup.boards : []\n } else {\n this.boards = []\n }\n\n this.updateContext()\n this.grist?.fetch()\n\n if (this.grist) {\n this.grist.style.transition = ''\n this.grist.style.transform = `translate3d(0, 0, 0)`\n }\n }\n\n async pageUpdated(changes, lifecycle) {\n if (this.active) {\n this.page = lifecycle.page\n /*\n * On a full page load the router can deliver the bare /play-list lifecycle *after* this\n * page has already redirected itself to /play-list/<first group> - the id would be wiped\n * while the URL still shows it (no chip pressed, no Edit button; seen live 2026-09-23).\n * The address bar is the source of truth, so read the id back from it in that case.\n */\n this.groupId = lifecycle.resourceId || this.groupIdFromLocation()\n\n await this.updateComplete\n\n this.refreshBoards()\n }\n }\n\n private groupIdFromLocation(): string {\n const segments = location.pathname.split('/').filter(Boolean)\n const at = segments.lastIndexOf(this.page || 'play-list')\n\n return at >= 0 ? segments[at + 1] || '' : ''\n }\n\n private _unsubscribe?: () => void\n\n connectedCallback() {\n super.connectedCallback()\n\n this._applyState()\n\n this._unsubscribe = store.subscribe(() => this._applyState())\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n this._unsubscribe?.()\n }\n\n private _applyState() {\n const __state__ = store.getState() as any\n const favorites = __state__.favorite.favorites\n\n /*\n * `store.subscribe` fires on every dispatch anywhere in the app, not just favorite changes - an\n * unconditional fetch() here risks a loop if fetch() completing itself dispatches through this\n * same store (board-list-page.ts hit exactly this).\n */\n const changed = JSON.stringify(favorites) !== JSON.stringify(this.favorites)\n this.favorites = favorites\n\n if (changed) {\n this.grist?.fetch()\n }\n }\n\n firstUpdated() {\n /* Groups are chips now, one tap each - the swipe-between-routes gesture the tab strip needed\n * no longer has a job here. */\n pulltorefresh({\n container: this.shadowRoot,\n scrollable: this.grist,\n refresh: () => {\n return this.load()\n }\n })\n }\n\n async onInfoBoard(board) {\n openPopup(\n html`\n <board-info\n .board=${board}\n .groupId=${this.groupId}\n @update-board=${e => this.onUpdateBoard(e.detail)}\n @delete-board=${e => this.onDeleteBoard(e.detail)}\n @join-playgroup=${e => this.onJoinPlayGroup(e.detail)}\n @leave-playgroup=${e => this.onLeavePlayGroup(e.detail)}\n ></board-info>\n `,\n { backdrop: true, size: 'medium', closable: true, title: board.name }\n )\n }\n\n async onInfoPlayGroup(group) {\n openPopup(\n html`\n <play-group-info\n .playGroup=${group}\n @update-play-group=${e => this.onUpdatePlayGroup(e.detail)}\n @delete-play-group=${e => this.onDeletePlayGroup(e.detail)}\n @create-play-group=${e => this.onCreatePlayGroup(e.detail)}\n ></play-group-info>\n `,\n {\n backdrop: true,\n size: 'small',\n closable: true,\n title: group?.name || i18next.t('text.new play-group', { defaultValue: 'New Play Group' })\n }\n )\n }\n\n async onCreatePlayGroup(playGroup) {\n try {\n await createPlayGroup(playGroup)\n notify('info', i18next.t('text.play-group created', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.load()\n }\n\n async onUpdatePlayGroup(playGroup) {\n try {\n await updatePlayGroup(playGroup)\n notify('info', i18next.t('text.play-group updated', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.load()\n }\n\n async onDeletePlayGroup(playGroup) {\n try {\n await deletePlayGroup(playGroup.id)\n notify('info', i18next.t('text.play-group deleted', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.load()\n }\n\n async onUpdateBoard(board) {\n try {\n await updateBoard(board)\n notify('info', i18next.t('text.board updated', { board: board.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.refreshBoards()\n }\n\n async onDeleteBoard(board) {\n const playGroup = this.groups && this.groups.find(group => group.id === this.groupId)\n await this.onLeavePlayGroup({ board, playGroup })\n }\n\n async onJoinPlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation JoinPlayGroup($id: String!, $boardIds: [String!]!) {\n joinPlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n notify('info', i18next.t('text.joined into play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.load()\n }\n\n async onLeavePlayGroup({ board, playGroup }) {\n try {\n await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n leavePlayGroup(id: $id, boardIds: $boardIds) {\n id\n }\n }\n `,\n variables: {\n id: playGroup.id,\n boardIds: [board.id]\n }\n })\n\n notify('info', i18next.t('text.leaved from play-group', { board: board.name, playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n }\n\n this.load()\n }\n\n async onReorder({ ids, movedId }: { ids: string[]; movedId: string }) {\n const groupId = this.groupId\n\n try {\n const response = await client.mutate({\n mutation: gql`\n mutation ($id: String!, $boardIds: [String!]!) {\n reorderPlayGroup(id: $id, boardIds: $boardIds) {\n id\n name\n }\n }\n `,\n variables: {\n id: groupId,\n boardIds: ids\n }\n })\n\n const playGroup = response.data.reorderPlayGroup\n\n notify('info', i18next.t('text.reorder play-group', { playGroup: playGroup.name }))\n } catch (ex) {\n notify('error', ex, ex)\n /* 실패 시에만 서버 데이터로 복원 */\n this.load()\n }\n }\n\n async toggleFavorite(board) {\n const wasFavorite = (this.favorites || []).includes(board.id)\n\n /*\n * The star answers the click at once; the server round trip only confirms it. Before, nothing\n * moved until the mutation, the favorites re-query, the store dispatch and a full refetch had\n * all come back - a click with no reaction reads as a click that did not land.\n *\n * `favorites` is set locally too, so the store update that follows carries the same list and\n * `_applyState` does not trigger the refetch that would repaint every card.\n */\n this.favorites = wasFavorite\n ? (this.favorites || []).filter(id => id !== board.id)\n : [...(this.favorites || []), board.id]\n this.patchRecord(board.id, { favorited: !wasFavorite })\n\n try {\n if (wasFavorite) {\n await this.removeFavorite(board.id)\n } else {\n await this.addFavorite(board.id)\n }\n } catch (ex) {\n /* Put it back the way it was and say why. */\n this.favorites = wasFavorite\n ? [...(this.favorites || []), board.id]\n : (this.favorites || []).filter(id => id !== board.id)\n this.patchRecord(board.id, { favorited: wasFavorite })\n notify('error', (ex as any)?.message || String(ex))\n }\n }\n\n /** Replaces one record in the grist in place, so only that card re-renders. */\n private patchRecord(id: string, patch: Record<string, unknown>) {\n const grist = this.grist\n const data = grist?.data\n\n if (!data?.records) {\n return\n }\n\n grist.data = {\n ...data,\n records: data.records.map(record => (record.id === id ? { ...record, ...patch } : record))\n }\n }\n\n async removeFavorite(boardId) {\n await client.mutate({\n mutation: gql`\n mutation {\n deleteFavorite(routing: \"${boardId}\")\n }\n `\n })\n\n this.refreshFavorites()\n }\n\n async addFavorite(boardId) {\n await client.mutate({\n mutation: gql`\n mutation {\n createFavorite(favorite: {\n routing: \"${boardId}\"\n }) {\n id\n routing\n }\n }\n `\n })\n\n this.refreshFavorites()\n }\n\n async refreshFavorites() {\n const response = await client.query({\n query: gql`\n query {\n myFavorites {\n id\n routing\n }\n }\n `\n })\n\n store.dispatch({\n type: UPDATE_FAVORITES,\n favorites: response.data.myFavorites.map(favorite => favorite.routing)\n })\n }\n}\n"]}
|