@conduction/nextcloud-vue 2.160.0 → 2.162.0
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/esm/components/CnActionsMenu/CnActionsMenu.vue2.js +3 -2
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue2.js.map +1 -1
- package/dist/esm/components/CnActionsMenu/CnActionsMenu.vue3.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue.js +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js +2 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue2.js.map +1 -1
- package/dist/esm/components/CnAddressSearch/CnAddressSearch.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +20 -2
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +8 -8
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +23 -0
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +48 -5
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +2 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +4 -3
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue.js +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js +2 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesWidget/CnFilesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue.js +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js +41 -39
- package/dist/esm/components/CnFlowRunsWidget/CnFlowRunsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/dist/esm/components/CnFolderSidebar/webdavFolders.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +11 -3
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js +2 -1
- package/dist/esm/components/CnMenuWidget/menuActive.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +39 -2
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue.js +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +5 -5
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +10 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +3 -2
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js +2 -2
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue3.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +130 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js +27 -16
- package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +9 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +9 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +641 -569
- package/dist/esm/utils/auditEntries.js +25 -1
- package/dist/esm/utils/auditEntries.js.map +1 -1
- package/dist/esm/utils/buildManifestRoutes.js +2 -1
- package/dist/esm/utils/buildManifestRoutes.js.map +1 -1
- package/dist/esm/utils/cnFetch.js +1 -15
- package/dist/esm/utils/cnFetch.js.map +1 -1
- package/dist/esm/utils/fillTemplate.js +29 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/forge.js +4 -1
- package/dist/esm/utils/forge.js.map +1 -1
- package/dist/esm/utils/myTeam.js +17 -3
- package/dist/esm/utils/myTeam.js.map +1 -1
- package/dist/esm/utils/rowAggregate.js +20 -1
- package/dist/esm/utils/rowAggregate.js.map +1 -1
- package/dist/esm/utils/trailingSlashes.js +24 -0
- package/dist/esm/utils/trailingSlashes.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +1069 -683
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +641 -569
- package/l10n/en.json +9 -1
- package/l10n/nl.json +9 -1
- package/package.json +1 -1
- package/src/components/CnActionsMenu/CnActionsMenu.vue +3 -2
- package/src/components/CnAddressSearch/CnAddressSearch.vue +2 -1
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +20 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +2 -1
- package/src/components/CnDataTable/CnDataTable.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +23 -0
- package/src/components/CnFactsWidget/CnFactsWidget.vue +49 -5
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +4 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +6 -5
- package/src/components/CnFilesWidget/CnFilesWidget.vue +2 -1
- package/src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue +1 -1
- package/src/components/CnFolderSidebar/webdavFolders.js +2 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +11 -3
- package/src/components/CnMenuWidget/menuActive.js +2 -1
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +40 -3
- package/src/components/CnPageTreeNode/CnPageTreeNode.vue +2 -1
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +5 -5
- package/src/components/CnStatWidget/CnStatWidget.vue +10 -1
- package/src/components/CnTabsWidget/CnTabsWidget.vue +3 -2
- package/src/components/CnTimelineWidget/CnTimelineWidget.vue +2 -2
- package/src/css/dialog.css +7 -0
- package/src/css/look-board-detail.css +35 -0
- package/src/css/look-board.css +18 -1
- package/src/integrations/builtin/email/CnEmailTab.vue +155 -4
- package/src/utils/auditEntries.js +24 -0
- package/src/utils/buildManifestRoutes.js +2 -1
- package/src/utils/cnFetch.js +3 -15
- package/src/utils/fillTemplate.js +29 -2
- package/src/utils/forge.js +3 -1
- package/src/utils/myTeam.js +17 -3
- package/src/utils/rowAggregate.js +19 -0
- package/src/utils/trailingSlashes.js +21 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFilesWidget.vue3.js","sources":["../../../../src/components/CnFilesWidget/CnFilesWidget.vue?vue&type=template&id=7f34dd98&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-files-widget\"\n\t\t:class=\"{ 'cn-files-widget--dragging': isDragging }\"\n\t\t@dragenter=\"onDragEnter\"\n\t\t@dragover=\"onDragOver\"\n\t\t@dragleave=\"onDragLeave\"\n\t\t@drop=\"onDrop\">\n\t\t<div class=\"cn-files-widget__toolbar\">\n\t\t\t<nav\n\t\t\t\tv-if=\"!objectBound\"\n\t\t\t\tclass=\"cn-files-widget__breadcrumb\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Folder breadcrumb')\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-files-widget__crumb cn-files-widget__crumb--root\"\n\t\t\t\t\t:aria-current=\"currentSubPath === '/' ? 'page' : null\"\n\t\t\t\t\t@click=\"navigateTo('/')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Root') }}\n\t\t\t\t</button>\n\t\t\t\t<template v-for=\"(segment, index) in pathSegments\" :key=\"index\">\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclass=\"cn-files-widget__separator\">/</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-files-widget__crumb\"\n\t\t\t\t\t\t:aria-current=\"index === pathSegments.length - 1 ? 'page' : null\"\n\t\t\t\t\t\t@click=\"navigateTo(segmentPathTo(index))\">\n\t\t\t\t\t\t{{ segment }}\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t</nav>\n\n\t\t\t<input\n\t\t\t\tv-model=\"searchQuery\"\n\t\t\t\ttype=\"search\"\n\t\t\t\tclass=\"cn-files-widget__search\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Search this folder')\"\n\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search this folder…')\">\n\n\t\t\t<button\n\t\t\t\tv-if=\"canShowUpload\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__upload\"\n\t\t\t\t@click=\"triggerUpload\">\n\t\t\t\t{{ t('nextcloud-vue', 'Upload File') }}\n\t\t\t</button>\n\t\t\t<!--\n\t\t\t\t`:ref`, not `ref`. Note `:aria-hidden=\"true\"` does NOT save this:\n\t\t\t\ta binding to a LITERAL CONSTANT is constant-folded, so the vnode\n\t\t\t\tstays fully static and the compiler hoists it to module scope.\n\t\t\t\tA hoisted vnode's ref has no owner instance, and `setRef()`'s\n\t\t\t\tnull-owner guard — along with its early `return` — is compiled\n\t\t\t\tout of production builds, so it dereferences null and throws\n\t\t\t\t`Cannot read properties of null (reading 'refs')`, aborting the\n\t\t\t\trender of the page that mounted this widget.\n\n\t\t\t\tConfirmed by instrumenting Vue's own warning to print the ref\n\t\t\t\tname: `[DEBUG ref=\"fileInput\" vnodeType=input]`. This widget is\n\t\t\t\tthe `files` integration leaf, which is how it reaches a detail\n\t\t\t\tpage. See CnFilesTab for the full account of the mechanism.\n\t\t\t-->\n\t\t\t<input\n\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\ttype=\"file\"\n\t\t\t\tmultiple\n\t\t\t\tclass=\"cn-files-widget__file-input\"\n\t\t\t\t:aria-hidden=\"true\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t@change=\"onFileInputChange\">\n\t\t</div>\n\n\t\t<div\n\t\t\tv-if=\"isDragging && canShowUpload\"\n\t\t\tclass=\"cn-files-widget__dropzone\"\n\t\t\taria-hidden=\"true\">\n\t\t\t{{ t('nextcloud-vue', 'Drop files to upload') }}\n\t\t</div>\n\n\t\t<div v-if=\"loading\" class=\"cn-files-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'Loading folder…') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"unavailable\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--unavailable\">\n\t\t\t{{ t('nextcloud-vue', 'Files is not available') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode === 'no_access'\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--no-access\">\n\t\t\t{{ t('nextcloud-vue', 'You don\\'t have access to this folder.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode === 'folder_not_found'\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--not-found\">\n\t\t\t{{ t('nextcloud-vue', 'Folder no longer exists.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--error\">\n\t\t\t{{ t('nextcloud-vue', 'Failed to load folder contents.') }}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__retry\"\n\t\t\t\t@click=\"fetchContents\">\n\t\t\t\t{{ t('nextcloud-vue', 'Retry') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"filteredItems.length === 0 && !searchQuery\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--empty\">\n\t\t\t{{ t('nextcloud-vue', 'This folder is empty.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"filteredItems.length === 0 && searchQuery\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--empty\">\n\t\t\t{{ noSearchResultsLabel }}\n\t\t</div>\n\n\t\t<ul\n\t\t\tv-else\n\t\t\tclass=\"cn-files-widget__list\"\n\t\t\t:class=\"{ 'cn-files-widget__list--grid': viewMode === 'grid' }\">\n\t\t\t<li\n\t\t\t\tv-for=\"item in filteredItems\"\n\t\t\t\t:key=\"item.fileId\"\n\t\t\t\tclass=\"cn-files-widget__row\"\n\t\t\t\t:class=\"{ 'cn-files-widget__row--folder': item.isFolder }\">\n\t\t\t\t<!-- Files are real links (new tab, copyable); folders browse in-widget. -->\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.isFolder ? 'button' : 'a'\"\n\t\t\t\t\t:type=\"item.isFolder ? 'button' : undefined\"\n\t\t\t\t\t:href=\"item.isFolder ? undefined : (fileUrl(item.fileId) || undefined)\"\n\t\t\t\t\t:target=\"item.isFolder ? undefined : '_blank'\"\n\t\t\t\t\t:rel=\"item.isFolder ? undefined : 'noopener noreferrer'\"\n\t\t\t\t\tclass=\"cn-files-widget__row-name\"\n\t\t\t\t\t@click=\"onRowClick(item, $event)\">\n\t\t\t\t\t<span aria-hidden=\"true\" class=\"cn-files-widget__row-icon\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-if=\"showThumbnails && !item.isFolder && item.thumbnailUrl && !failedThumbs[item.fileId]\"\n\t\t\t\t\t\t\t:src=\"item.thumbnailUrl\"\n\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\tclass=\"cn-files-widget__row-thumb\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t@error=\"onThumbError(item)\">\n\t\t\t\t\t\t<template v-else>{{ item.isFolder ? '📁' : '📄' }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-files-widget__row-label\">{{ item.name }}</span>\n\t\t\t\t</component>\n\t\t\t\t<span class=\"cn-files-widget__row-modified\">{{ item.modifiedAt }}</span>\n\t\t\t\t<span class=\"cn-files-widget__row-size\">{{ formatSize(item.size, item.isFolder) }}</span>\n\t\t\t\t<button\n\t\t\t\t\tv-if=\"canDeleteItem(item)\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-files-widget__row-delete\"\n\t\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Delete {name}', { name: item.name })\"\n\t\t\t\t\t@click=\"confirmDelete(item)\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Delete') }}\n\t\t\t\t</button>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<div v-if=\"nextCursor\" class=\"cn-files-widget__pagination\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__more\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t{{ t('nextcloud-vue', 'Load more') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<CnFilePreview v-if=\"previewFile\" :file=\"previewFile\" @close=\"previewFile = null\" />\n\n\t\t<CnFilesWidgetDeleteDialog\n\t\t\t:open=\"confirmTarget !== null\"\n\t\t\t:fileName=\"confirmTarget ? confirmTarget.name : ''\"\n\t\t\t@update:open=\"onDeleteDialogToggle\"\n\t\t\t@confirm=\"performDelete\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport CnFilesWidgetDeleteDialog from '../../dialogs/CnFilesWidgetDeleteDialog.vue'\nimport CnFilePreview from '../CnFilePreview/CnFilePreview.vue'\nimport { useFileOpener } from '../../composables/useFileOpener.js'\n\n/**\n * CnFilesWidget — an inline Nextcloud Files browser rendered as a dashboard\n * widget (catalog type `files`, migrated from the launchpad `files` widget).\n *\n * NC-INTEGRATION DEPENDENCY: this widget reads folder contents from a host\n * application's `/api/widgets/files/{placementId}/...` endpoints (the same\n * contract the launchpad/mydash backend served) and deep-links file rows into\n * the Nextcloud **Files** app via the canonical `/f/{fileid}` permalink. The\n * `@nextcloud/axios` + `@nextcloud/router` helpers are imported LAZILY at call\n * time so the widget code never hard-couples to a network stack at module load\n * (keeps the no-op css transform path clean and lets a host without the backing\n * endpoint mount the component without side-effects). When the backing endpoint\n * is absent the widget degrades to a localised disabled / empty state rather\n * than throwing — see the `unavailable` data flag and the `folder_not_found` /\n * `no_access` error branches.\n *\n * Every placement instance owns its own navigation stack: the sub-path resets\n * to `/` whenever the `placement` prop changes, so re-configuring the widget\n * root never leaves the user on a stale path.\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnFilesWidget',\n\n\tcomponents: {\n\t\tCnFilePreview,\n\t\tCnFilesWidgetDeleteDialog,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted content blob configuring the folder + toolbar — see\n\t\t * `CnFilesWidgetForm` for the full shape (`folderPath`, `fileId`,\n\t\t * `viewMode`, `allowUpload`, `allowDelete`, …).\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Placement entity; its `id` scopes the host Files endpoint. */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Whether the dashboard shell is in admin mode. */\n\t\tisAdmin: { // eslint-disable-line vue/no-unused-properties -- the dashboard shell passes this to every widget; declared so it does not fall through to $attrs.\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Whether the dashboard shell is in edit mode. */\n\t\tcanEdit: { // eslint-disable-line vue/no-unused-properties -- the dashboard shell passes this to every widget; declared so it does not fall through to $attrs.\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * App base for the host's files-widget endpoints\n\t\t * (`{apiBase}/api/widgets/files/{placementId}/...`). Lets a consuming\n\t\t * app point the widget at its own backend (e.g. `/apps/launchpad`).\n\t\t * Defaults to `/apps/files`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tapiBase: {\n\t\t\ttype: String,\n\t\t\tdefault: '/apps/files',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister object id this widget attaches\n\t\t * files to. When `objectId` + `register` + `schema` are all set (they\n\t\t * are auto-supplied by `CnWidgetGrid`'s detail-page context merge), the\n\t\t * widget lists/uploads/deletes against the object's Nextcloud folder via\n\t\t * the OpenRegister object endpoints instead of the dashboard\n\t\t * `/api/widgets/files/...` contract. Empty (default) keeps the dashboard\n\t\t * placement behaviour unchanged.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister register slug of the bound object.\n\t\t * See the `objectId` prop.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister schema of the bound object. Accepts\n\t\t * either a slug string or the resolved schema object (as merged by\n\t\t * `CnWidgetGrid`); the slug is derived by the `schemaSlug` computed. See\n\t\t * the `objectId` prop.\n\t\t *\n\t\t * @type {string|object}\n\t\t */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * App base for the OpenRegister object-file endpoints used in\n\t\t * object-bound mode (`{objectApiBase}/objects/{register}/{schema}/{id}/...`).\n\t\t * Defaults to `/apps/openregister/api`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tobjectApiBase: {\n\t\t\ttype: String,\n\t\t\tdefault: '/apps/openregister/api',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The file shown in the in-page preview, or null. */\n\t\t\tpreviewFile: null,\n\t\t\t/**\n\t\t\t * The hidden file input, set by the template's function ref (kept off `$refs` so the ref stays dynamic — see the template).\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\titems: [],\n\t\t\tcurrentSubPath: '/',\n\t\t\tloading: false,\n\t\t\terrorCode: null,\n\t\t\tunavailable: false,\n\t\t\tnextCursor: null,\n\t\t\tsearchQuery: '',\n\t\t\tconfirmTarget: null,\n\t\t\t// fileId → true for thumbnails whose <img> failed to load, so the\n\t\t\t// row falls back to the generic icon instead of a broken image.\n\t\t\tfailedThumbs: {},\n\t\t\t// Whether a file drag is currently hovering the widget (drop overlay).\n\t\t\tisDragging: false,\n\t\t\t// Depth counter so nested dragenter/dragleave don't flicker the overlay.\n\t\t\tdragDepth: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Numeric placement id used to scope the host Files endpoint.\n\t\t *\n\t\t * @return {number} the placement id, or `0` when no placement is bound.\n\t\t */\n\t\tplacementId() {\n\t\t\treturn Number(this.placement?.id || 0)\n\t\t},\n\n\t\t/**\n\t\t * The schema slug in object-bound mode. Accepts either a slug string or\n\t\t * the resolved schema object merged by `CnWidgetGrid` (in which case the\n\t\t * slug is read from `slug`/`id`/`uuid`).\n\t\t *\n\t\t * @return {string} the schema slug, or `''` when unavailable.\n\t\t */\n\t\tschemaSlug() {\n\t\t\tconst s = this.schema\n\t\t\tif (typeof s === 'string') {\n\t\t\t\treturn s\n\t\t\t}\n\t\t\treturn (s && (s.slug || s.id || s.uuid)) || ''\n\t\t},\n\n\t\t/**\n\t\t * Whether the widget runs in object-bound mode — i.e. it attaches files\n\t\t * to a specific OpenRegister object rather than a dashboard placement.\n\t\t *\n\t\t * @return {boolean} `true` when `objectId`, `register` and `schemaSlug` are all set.\n\t\t */\n\t\tobjectBound() {\n\t\t\treturn !!(this.objectId && this.register && this.schemaSlug)\n\t\t},\n\n\t\t/**\n\t\t * Stable identity key for the bound object, or `''` in dashboard mode.\n\t\t * Watched to (re)fetch when the object context first resolves (the schema\n\t\t * object arrives after the ids) or when the widget rebinds to another\n\t\t * object.\n\t\t *\n\t\t * @return {string} `register/schema/objectId`, or `''` when not object-bound.\n\t\t */\n\t\tobjectKey() {\n\t\t\treturn this.objectBound\n\t\t\t\t? `${this.register}/${this.schemaSlug}/${this.objectId}`\n\t\t\t\t: ''\n\t\t},\n\n\t\t/**\n\t\t * Whether the upload affordance is enabled by configuration. Defaults to\n\t\t * enabled in BOTH modes — a Files widget is an add-files surface — and is\n\t\t * only suppressed when a placement explicitly sets `allowUpload: false`.\n\t\t * (Object-bound mode already defaulted on, matching the object sidebar's\n\t\t * Files tab; beta extended the same default to dashboard placements.)\n\t\t *\n\t\t * @return {boolean} `true` unless `content.allowUpload` is explicitly false.\n\t\t */\n\t\tallowUpload() {\n\t\t\treturn this.content?.allowUpload !== false\n\t\t},\n\n\t\t/**\n\t\t * Whether per-row delete affordances are enabled by configuration. On by\n\t\t * default in object-bound mode (unless `content.allowDelete` is explicitly\n\t\t * false); opt-in (`content.allowDelete === true`) in dashboard mode.\n\t\t *\n\t\t * @return {boolean} `true` when deletes are allowed.\n\t\t */\n\t\tallowDelete() {\n\t\t\tif (this.objectBound) {\n\t\t\t\treturn this.content?.allowDelete !== false\n\t\t\t}\n\t\t\treturn this.content?.allowDelete === true\n\t\t},\n\n\t\t/**\n\t\t * Layout for the file listing, from `content.viewMode`. `'grid'` renders\n\t\t * the items as a tile grid; any other value (`'list'`, `'tree'`, unset)\n\t\t * renders the default list. Tree navigation is not implemented, so\n\t\t * `'tree'` falls back to the list layout.\n\t\t *\n\t\t * @return {string} `'grid'` or `'list'`.\n\t\t */\n\t\tviewMode() {\n\t\t\treturn this.content?.viewMode === 'grid' ? 'grid' : 'list'\n\t\t},\n\n\t\t/**\n\t\t * Whether file rows show a preview thumbnail (from `content.showThumbnails`).\n\t\t * Defaults to on; only an explicit `false` disables it. Files without a\n\t\t * backend-provided `thumbnailUrl` still fall back to the generic icon.\n\t\t *\n\t\t * @return {boolean} `true` unless `content.showThumbnails` is explicitly false.\n\t\t */\n\t\tshowThumbnails() {\n\t\t\treturn this.content?.showThumbnails !== false\n\t\t},\n\n\t\t/**\n\t\t * Heuristic write-permission check: an empty folder optimistically\n\t\t * surfaces the upload button (the backend re-validates), otherwise at\n\t\t * least one editable child is required.\n\t\t *\n\t\t * @return {boolean} `true` when the viewer is treated as having write access.\n\t\t */\n\t\tviewerCanWrite() {\n\t\t\tif (this.items.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn this.items.some((item) => item.canEdit === true)\n\t\t},\n\n\t\t/**\n\t\t * Whether the upload button should render.\n\t\t *\n\t\t * @return {boolean} `true` when upload is allowed, writable, and not errored.\n\t\t */\n\t\tcanShowUpload() {\n\t\t\treturn this.allowUpload && this.viewerCanWrite && !this.errorCode && !this.unavailable\n\t\t},\n\n\t\t/**\n\t\t * The current sub-path split into breadcrumb segments.\n\t\t *\n\t\t * @return {string[]} the path segments (empty at root).\n\t\t */\n\t\tpathSegments() {\n\t\t\tif (!this.currentSubPath || this.currentSubPath === '/') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.currentSubPath\n\t\t\t\t.split('/')\n\t\t\t\t.map((segment) => segment.trim())\n\t\t\t\t.filter((segment) => segment !== '')\n\t\t},\n\n\t\t/**\n\t\t * The items filtered by the in-widget search query.\n\t\t *\n\t\t * @return {Array<object>} the matching items (all items when the query is empty).\n\t\t */\n\t\tfilteredItems() {\n\t\t\tconst query = this.searchQuery.trim().toLowerCase()\n\t\t\tif (query === '') {\n\t\t\t\treturn this.items\n\t\t\t}\n\t\t\treturn this.items.filter((item) => {\n\t\t\t\tconst name = String(item.name || '').toLowerCase()\n\t\t\t\treturn name.includes(query)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The localised \"no results\" label for the active search query.\n\t\t *\n\t\t * @return {string} the no-results message.\n\t\t */\n\t\tnoSearchResultsLabel() {\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'No files matching \\'{query}\\'',\n\t\t\t\t{ query: this.searchQuery },\n\t\t\t)\n\t\t},\n\t},\n\n\twatch: {\n\t\tplacement: {\n\t\t\timmediate: true,\n\t\t\t/**\n\t\t\t * Reset navigation state and refetch whenever the placement changes.\n\t\t\t * Dashboard mode only — object-bound mode is driven by `objectKey`.\n\t\t\t *\n\t\t\t * @return {void}\n\t\t\t */\n\t\t\thandler() {\n\t\t\t\tif (this.objectBound) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.resetListing()\n\t\t\t\tthis.fetchContents()\n\t\t\t},\n\t\t},\n\n\t\tobjectKey: {\n\t\t\timmediate: true,\n\t\t\t/**\n\t\t\t * Reset and refetch when the bound object first resolves or changes.\n\t\t\t *\n\t\t\t * @param {string} key the new object key (`''` in dashboard mode).\n\t\t\t * @return {void}\n\t\t\t */\n\t\t\thandler(key) {\n\t\t\t\tif (!key) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.resetListing()\n\t\t\t\tthis.fetchContents()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Function ref for the hidden file input; a method so the binding is\n\t\t * stable across renders and the vnode stays dynamic.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Reset the listing/navigation state before a (re)fetch.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tresetListing() {\n\t\t\tthis.currentSubPath = '/'\n\t\t\tthis.items = []\n\t\t\tthis.nextCursor = null\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\t\t},\n\n\t\t/**\n\t\t * Fetch (or append) one page of folder contents from the host Files\n\t\t * endpoint. Degrades gracefully: a missing endpoint flips `unavailable`,\n\t\t * a 404/403 maps to a typed `errorCode`, and no exception escapes.\n\t\t *\n\t\t * @param {boolean} [append] whether to append to the existing list (pagination).\n\t\t * @return {Promise<void>} resolves when the fetch settles.\n\t\t */\n\t\tasync fetchContents(append = false) {\n\t\t\tif (this.objectBound) {\n\t\t\t\treturn this.fetchObjectFiles()\n\t\t\t}\n\t\t\tif (this.placementId === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.loading = !append\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/contents`,\n\t\t\t\t\t{ placementId: this.placementId },\n\t\t\t\t)\n\t\t\t\tconst params = {\n\t\t\t\t\tcurrentPath: this.currentSubPath,\n\t\t\t\t\tlimit: 50,\n\t\t\t\t}\n\t\t\t\tif (append && this.nextCursor) {\n\t\t\t\t\tparams.cursor = this.nextCursor\n\t\t\t\t}\n\n\t\t\t\tconst response = await axios.get(url, { params })\n\t\t\t\tconst data = response?.data || {}\n\t\t\t\tconst nextItems = Array.isArray(data.items) ? data.items : []\n\t\t\t\tthis.items = append ? this.items.concat(nextItems) : nextItems\n\t\t\t\tthis.nextCursor = data.nextCursor || null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err?.response?.status\n\t\t\t\tconst code = err?.response?.data?.error\n\t\t\t\tif (status === 404 || code === 'folder_not_found') {\n\t\t\t\t\tthis.errorCode = 'folder_not_found'\n\t\t\t\t} else if (status === 403 || code === 'no_access') {\n\t\t\t\t\tthis.errorCode = 'no_access'\n\t\t\t\t} else if (status === undefined) {\n\t\t\t\t\t// No HTTP response at all — the backing Files endpoint is\n\t\t\t\t\t// not installed/reachable; degrade to the disabled state.\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t} else {\n\t\t\t\t\tthis.errorCode = 'unknown_error'\n\t\t\t\t}\n\t\t\t\tif (!append) {\n\t\t\t\t\tthis.items = []\n\t\t\t\t\tthis.nextCursor = null\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Object-bound listing: fetch the bound OpenRegister object's files from\n\t\t * `{objectApiBase}/objects/{register}/{schema}/{id}/files` and map them\n\t\t * onto the widget's flat item shape (no folder navigation). Degrades the\n\t\t * same way as the dashboard fetch: 404/403 → typed `errorCode`, no HTTP\n\t\t * response → `unavailable`.\n\t\t *\n\t\t * @return {Promise<void>} resolves when the fetch settles.\n\t\t */\n\t\tasync fetchObjectFiles() {\n\t\t\tthis.loading = true\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/files`,\n\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId },\n\t\t\t\t)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tconst data = response?.data || {}\n\t\t\t\tconst results = Array.isArray(data)\n\t\t\t\t\t? data\n\t\t\t\t\t: (Array.isArray(data.results) ? data.results : [])\n\t\t\t\tthis.items = results.map((file) => {\n\t\t\t\t\tconst mime = file.mimeType || file.mimetype || file.type || ''\n\t\t\t\t\t// SVG: Nextcloud's rasterised /core/preview is usually\n\t\t\t\t\t// unavailable for SVG (no rsvg/imagick), so stream the raw file\n\t\t\t\t\t// from OpenRegister's authenticated per-file download endpoint\n\t\t\t\t\t// (works for the owner's un-shared uploads via the session\n\t\t\t\t\t// cookie; the widget's other calls use the same objectApiBase).\n\t\t\t\t\t// Rendered through the list's <img>, the SVG runs in the\n\t\t\t\t\t// browser's restricted image mode — inline <script> / event\n\t\t\t\t\t// handlers never execute and external refs don't load — so\n\t\t\t\t\t// untrusted SVG is shown safely without a bespoke sandbox.\n\t\t\t\t\t// Other images use the rasterised server preview; anything else\n\t\t\t\t\t// gets the generic icon (a missing preview also falls back via\n\t\t\t\t\t// the <img> @error handler).\n\t\t\t\t\tlet thumbnailUrl = null\n\t\t\t\t\tif (file.id && /^image\\/svg\\+xml$/i.test(mime)) {\n\t\t\t\t\t\tthumbnailUrl = generateUrl(`${this.objectApiBase}/files/{fileId}/download`, { fileId: file.id })\n\t\t\t\t\t} else if (file.id && /^image\\//.test(mime)) {\n\t\t\t\t\t\tthumbnailUrl = generateUrl('/core/preview?fileId={fileId}&x=256&y=256&a=1', { fileId: file.id })\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: file.name || file.title || '',\n\t\t\t\t\t\tfileId: file.id,\n\t\t\t\t\t\tmimeType: mime,\n\t\t\t\t\t\tpath: file.path || '',\n\t\t\t\t\t\tdownloadUrl: file.id ? generateUrl(`${this.objectApiBase}/files/{fileId}/download`, { fileId: file.id }) : '',\n\t\t\t\t\t\tisFolder: false,\n\t\t\t\t\t\tsize: file.size,\n\t\t\t\t\t\tmodifiedAt: file.modified || file.updated || '',\n\t\t\t\t\t\tthumbnailUrl,\n\t\t\t\t\t\tcanEdit: true,\n\t\t\t\t\t\tcanDelete: this.allowDelete,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tthis.nextCursor = null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err?.response?.status\n\t\t\t\tif (status === 404) {\n\t\t\t\t\tthis.errorCode = 'folder_not_found'\n\t\t\t\t} else if (status === 403) {\n\t\t\t\t\tthis.errorCode = 'no_access'\n\t\t\t\t} else if (status === undefined) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t} else {\n\t\t\t\t\tthis.errorCode = 'unknown_error'\n\t\t\t\t}\n\t\t\t\tthis.items = []\n\t\t\t\tthis.nextCursor = null\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Load the next page when a cursor is present.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tloadMore() {\n\t\t\tif (this.nextCursor) {\n\t\t\t\tthis.fetchContents(true)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show a file in the in-page preview.\n\t\t *\n\t\t * @param {object} file The file to preview.\n\t\t */\n\t\tshowPreview(file) {\n\t\t\tthis.previewFile = file\n\t\t},\n\n\t\t/**\n\t\t * Handle a row click: a folder is browsed in place, a file opens through\n\t\t * the shared opener (Viewer, preview, browser, Files app).\n\t\t *\n\t\t * @param {object} item the clicked row.\n\t\t * @param {MouseEvent} [event] the click event.\n\t\t * @return {void}\n\t\t */\n\t\tonRowClick(item, event) {\n\t\t\tif (item.isFolder) {\n\t\t\t\tthis.onItemClick(item)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Keep the link's own behaviour for a modified click (new tab, etc.).\n\t\t\tif (event && (event.ctrlKey || event.metaKey || event.shiftKey || event.button === 1)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event) {\n\t\t\t\tevent.preventDefault()\n\t\t\t}\n\t\t\tuseFileOpener({ onPreview: this.showPreview }).open({\n\t\t\t\tid: item.fileId,\n\t\t\t\tname: item.name,\n\t\t\t\ttype: item.mimeType || item.mimetype || item.type || '',\n\t\t\t\tpath: item.path || '',\n\t\t\t\taccessUrl: item.accessUrl || '',\n\t\t\t\tdownloadUrl: item.downloadUrl || '',\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Descend into a folder row.\n\t\t *\n\t\t * @param {object} item the clicked folder item.\n\t\t * @return {void}\n\t\t */\n\t\tonItemClick(item) {\n\t\t\tthis.navigateTo(this.joinPath(this.currentSubPath, item.name))\n\t\t},\n\n\t\t/**\n\t\t * Navigate to a sub-path, clearing search + pagination and refetching.\n\t\t *\n\t\t * @param {string} path the target sub-path.\n\t\t * @return {void}\n\t\t */\n\t\tnavigateTo(path) {\n\t\t\tthis.currentSubPath = path || '/'\n\t\t\tthis.searchQuery = ''\n\t\t\tthis.nextCursor = null\n\t\t\tthis.fetchContents()\n\t\t},\n\n\t\t/**\n\t\t * Build the sub-path up to (and including) a breadcrumb segment index.\n\t\t *\n\t\t * @param {number} index the segment index.\n\t\t * @return {string} the assembled sub-path.\n\t\t */\n\t\tsegmentPathTo(index) {\n\t\t\tconst segments = this.pathSegments.slice(0, index + 1)\n\t\t\treturn '/' + segments.join('/')\n\t\t},\n\n\t\t/**\n\t\t * Join a base path and a child name into a normalised sub-path.\n\t\t *\n\t\t * @param {string} base the base path.\n\t\t * @param {string} name the child name.\n\t\t * @return {string} the joined path.\n\t\t */\n\t\tjoinPath(base, name) {\n\t\t\tconst trimmedBase = String(base || '/').replace(/\\/+$/, '')\n\t\t\tconst trimmedName = String(name || '').replace(/^\\/+/, '')\n\t\t\tif (trimmedBase === '' || trimmedBase === '/') {\n\t\t\t\treturn '/' + trimmedName\n\t\t\t}\n\t\t\treturn `${trimmedBase}/${trimmedName}`\n\t\t},\n\n\t\t/**\n\t\t * The Files-app permalink for a file.\n\t\t *\n\t\t * @param {number|string} fileId the Nextcloud file id.\n\t\t * @return {string} the URL, or '' without a file id.\n\t\t */\n\t\tfileUrl(fileId) {\n\t\t\tif (!fileId) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Canonical permalink: `/f/{fileid}` resolves the id to its folder\n\t\t\t// and opens the file; generateUrl adds `index.php` where needed.\n\t\t\treturn generateUrl('/f/{fileid}', { fileid: fileId })\n\t\t},\n\n\t\t/**\n\t\t * Whether a per-row delete button should render for an item.\n\t\t *\n\t\t * @param {object} item the item.\n\t\t * @return {boolean} `true` when delete is allowed and the item is deletable.\n\t\t */\n\t\tcanDeleteItem(item) {\n\t\t\treturn this.allowDelete === true && item.canDelete === true\n\t\t},\n\n\t\t/**\n\t\t * Mark an item's thumbnail as failed so the row falls back to the\n\t\t * generic icon. Fires when the preview `<img>` cannot load (e.g. the\n\t\t * preview was not generated in time).\n\t\t *\n\t\t * @param {object} item the item whose thumbnail failed.\n\t\t * @return {void}\n\t\t */\n\t\tonThumbError(item) {\n\t\t\tthis.failedThumbs[item.fileId] = true\n\t\t},\n\n\t\t/**\n\t\t * Open the delete-confirmation modal for an item.\n\t\t *\n\t\t * @param {object} item the item to delete.\n\t\t * @return {void}\n\t\t */\n\t\tconfirmDelete(item) {\n\t\t\tthis.confirmTarget = item\n\t\t},\n\n\t\t/**\n\t\t * React to the delete dialog's open-state changes. Closing it (Cancel,\n\t\t * Esc, click-outside, or the header X) clears the pending target.\n\t\t *\n\t\t * @param {boolean} open the dialog's new open state.\n\t\t * @return {void}\n\t\t */\n\t\tonDeleteDialogToggle(open) {\n\t\t\tif (!open) {\n\t\t\t\tthis.confirmTarget = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete the confirmed target via the host Files endpoint, refreshing\n\t\t * the listing on failure so the UI stays truthful.\n\t\t *\n\t\t * @return {Promise<void>} resolves when the delete settles.\n\t\t */\n\t\tasync performDelete() {\n\t\t\tconst target = this.confirmTarget\n\t\t\tif (!target) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = this.objectBound\n\t\t\t\t\t? generateUrl(\n\t\t\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/files/{fileId}`,\n\t\t\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId, fileId: target.fileId },\n\t\t\t\t\t\t)\n\t\t\t\t\t: generateUrl(\n\t\t\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/files/{fileId}`,\n\t\t\t\t\t\t\t{ placementId: this.placementId, fileId: target.fileId },\n\t\t\t\t\t\t)\n\t\t\t\tawait axios.delete(url)\n\t\t\t\tthis.items = this.items.filter((item) => item.fileId !== target.fileId)\n\t\t\t} catch {\n\t\t\t\tthis.fetchContents()\n\t\t\t} finally {\n\t\t\t\tthis.confirmTarget = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Trigger the hidden file input from the upload button.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttriggerUpload() {\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Upload the chosen files to the host Files endpoint and refresh.\n\t\t *\n\t\t * @param {Event} event the file-input change event.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync onFileInputChange(event) {\n\t\t\tconst fileList = event?.target?.files\n\t\t\tawait this.uploadFiles(fileList)\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.value = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * POST a FileList (from the picker or a drag-and-drop) to the host Files\n\t\t * endpoint, then refresh the listing. No-op when there is nothing to upload\n\t\t * or upload is not permitted; never throws.\n\t\t *\n\t\t * @param {FileList|File[]|null} fileList the files to upload.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync uploadFiles(fileList) {\n\t\t\tif (!fileList || fileList.length === 0 || !this.canShowUpload) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst formData = new FormData()\n\t\t\tfor (let i = 0; i < fileList.length; i++) {\n\t\t\t\tformData.append('files[]', fileList[i])\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tif (this.objectBound) {\n\t\t\t\t\tconst objectUrl = generateUrl(\n\t\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/filesMultipart`,\n\t\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId },\n\t\t\t\t\t)\n\t\t\t\t\tawait axios.post(objectUrl, formData)\n\t\t\t\t} else {\n\t\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/upload`,\n\t\t\t\t\t\t{ placementId: this.placementId },\n\t\t\t\t\t)\n\t\t\t\t\tawait axios.post(url, formData, {\n\t\t\t\t\t\tparams: { currentPath: this.currentSubPath },\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tthis.fetchContents()\n\t\t\t} catch {\n\t\t\t\tthis.fetchContents()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Track a drag entering the widget (depth-counted so nested elements don't\n\t\t * flicker the drop overlay).\n\t\t *\n\t\t * @param {DragEvent} event the dragenter event.\n\t\t * @return {void}\n\t\t */\n\t\tonDragEnter(event) {\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tthis.dragDepth++\n\t\t\tthis.isDragging = true\n\t\t},\n\n\t\t/**\n\t\t * Keep the browser from opening the dragged file and mark the drop as a copy.\n\t\t *\n\t\t * @param {DragEvent} event the dragover event.\n\t\t * @return {void}\n\t\t */\n\t\tonDragOver(event) {\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tif (event.dataTransfer) {\n\t\t\t\tevent.dataTransfer.dropEffect = 'copy'\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Track a drag leaving the widget, clearing the overlay at depth zero.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonDragLeave() {\n\t\t\tif (this.dragDepth > 0) {\n\t\t\t\tthis.dragDepth--\n\t\t\t}\n\t\t\tif (this.dragDepth === 0) {\n\t\t\t\tthis.isDragging = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle a file drop — upload the dropped files into the current folder.\n\t\t *\n\t\t * @param {DragEvent} event the drop event.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync onDrop(event) {\n\t\t\tthis.dragDepth = 0\n\t\t\tthis.isDragging = false\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tawait this.uploadFiles(event.dataTransfer?.files)\n\t\t},\n\n\t\t/**\n\t\t * Whether a drag event is carrying files (vs. text / an internal drag).\n\t\t *\n\t\t * @param {DragEvent} event the drag event.\n\t\t * @return {boolean} `true` when the payload includes files.\n\t\t */\n\t\thasFiles(event) {\n\t\t\tconst types = event?.dataTransfer?.types\n\t\t\tif (!types) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn Array.from(types).includes('Files')\n\t\t},\n\n\t\t/**\n\t\t * Human-format a byte count (folders render an empty size).\n\t\t *\n\t\t * @param {number} bytes the byte count.\n\t\t * @param {boolean} isFolder whether the item is a folder.\n\t\t * @return {string} the formatted size.\n\t\t */\n\t\tformatSize(bytes, isFolder) {\n\t\t\tif (isFolder) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = Number(bytes || 0)\n\t\t\tif (value === 0) {\n\t\t\t\treturn '0 B'\n\t\t\t}\n\t\t\tconst units = ['B', 'KB', 'MB', 'GB', 'TB']\n\t\t\tlet unitIndex = 0\n\t\t\tlet display = value\n\t\t\twhile (display >= 1024 && unitIndex < units.length - 1) {\n\t\t\t\tdisplay = display / 1024\n\t\t\t\tunitIndex++\n\t\t\t}\n\t\t\treturn `${display.toFixed(unitIndex === 0 ? 0 : 1)} ${units[unitIndex]}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-files-widget {\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\theight: 100%;\n\toverflow: hidden;\n}\n\n.cn-files-widget--dragging {\n\toutline: 2px dashed var(--color-primary-element);\n\toutline-offset: -2px;\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__dropzone {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 5;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n\tbackground: var(--color-primary-element-light, rgba(0, 130, 201, 0.1));\n\tcolor: var(--color-primary-element);\n\tfont-weight: 600;\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n.cn-files-widget__breadcrumb {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 4px;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-files-widget__crumb {\n\tbackground: transparent;\n\tborder: none;\n\tpadding: 4px 6px;\n\tcursor: pointer;\n\tcolor: var(--color-primary-element);\n\tfont: inherit;\n}\n\n.cn-files-widget__crumb[aria-current='page'] {\n\tcolor: var(--color-main-text);\n\tcursor: default;\n}\n\n.cn-files-widget__separator {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-files-widget__search {\n\tflex: 0 1 200px;\n\tpadding: 4px 8px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-files-widget__upload {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-files-widget__file-input {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tpadding: 0;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\tborder: 0;\n}\n\n.cn-files-widget__state {\n\tpadding: 16px;\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n}\n\n.cn-files-widget__retry {\n\tdisplay: block;\n\tmargin: 8px auto 0;\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-background-hover);\n\tcursor: pointer;\n}\n\n.cn-files-widget__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\toverflow: auto;\n\tflex: 1 1 auto;\n}\n\n.cn-files-widget__row {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 140px 80px auto;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 6px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-files-widget__row-name {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tbackground: transparent;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\ttext-align: left;\n\tcolor: var(--color-main-text);\n\tfont: inherit;\n\ttext-decoration: none;\n\tmin-width: 0;\n}\n\n.cn-files-widget__row-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex: 0 0 auto;\n\twidth: 24px;\n\theight: 24px;\n}\n\n.cn-files-widget__row-thumb {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-background-dark);\n}\n\n.cn-files-widget__row-label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-files-widget__row-modified,\n.cn-files-widget__row-size {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n}\n\n.cn-files-widget__row-delete {\n\tbackground: transparent;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tpadding: 2px 8px;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tcolor: var(--color-error);\n}\n\n/* Grid view (content.viewMode === 'grid'): lay the rows out as tiles. */\n.cn-files-widget__list--grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fill, minmax(120px, 1fr));\n\tgap: 8px;\n\tpadding: 4px;\n\talign-content: start;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row {\n\tgrid-template-columns: 1fr;\n\tjustify-items: center;\n\ttext-align: center;\n\tgap: 4px;\n\tpadding: 10px 6px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-name {\n\tflex-direction: column;\n\talign-items: center;\n\tmax-width: 100%;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-label {\n\tmax-width: 100%;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-icon {\n\tfont-size: 32px;\n\twidth: 56px;\n\theight: 56px;\n}\n\n/* Keep tiles compact — the modified date is list-view detail. */\n.cn-files-widget__list--grid .cn-files-widget__row-modified {\n\tdisplay: none;\n}\n\n.cn-files-widget__pagination {\n\ttext-align: center;\n\tpadding: 8px 0;\n}\n\n.cn-files-widget__more {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-background-hover);\n\tcursor: pointer;\n}\n\n</style>\n"],"names":["_normalizeClass","_createElementVNode","_Fragment","_renderList","_createElementBlock","_toDisplayString","_createTextVNode","_resolveDynamicComponent","_openBlock","_createBlock","_createVNode"],"mappings":";;AAkBO,MAAA,UAAA,GAAA,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AA,CAAkC,MAAlC,EAAA,WAAkC,EAAAI,eAAA,CAAA,IAAA,CAAA,UAAA,CAAA,EAAA,CAAA,YAAA;0BAClCJ,kBAAqE,CAAA,MAAA,EAArE,WAAqE,EAAAI,eAAA,CAA3B,QAAU,CAAA,UAAA,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;AAE/D,0BAAA,CAAA,QAAA,CAAA,aAAa,CAAC,IAAI,CAAA;8DAMpB,CAAA,QAAA,EAAA;;AALJ,gCAAA,IAAI,EAAC,QAAE;AACP,gCAAA,KAAE,EAAA,6BAAA;AACD,gCAAA,YAAA,EAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,eAAA,EAAA,EAAA,IAAA,EAAA,IAAA,CAAA,IAAA,EAAA,CAAA;;iDAEE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,oBAAA,WAAA,CAAA;;;;;KAKI,KAAU,CAAA,UAAA;AAAnB,SAAAG,SAAA,EAAA,EAAAJ,kBAAA,CAOI,OAPJ,WAOI,EAAA;UANLH,kBAKS,CAAA,QAAA,EAAA;AAJR,YAAA,IAAG,EAAA,QAAA;;AAEF,YAAA,OAAK,0CAAE,QAAQ,CAAA,QAAA,IAAA,QAAA,CAAA,QAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA;;;;KAKG,KAAW,CAAA,WAAA;sBAA/BQ,WAAkC,CAAA,wBAAA,EAAA;;AAAA,UAAA,IAAA,EAAA,KAAA,CAAA,WAAA;AAAA,UAAA,OAAA,uCAAA,KAAA,CAAA,WAAA,GAAA,IAAA,CAAA,CAAA;;;IAEnCC;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFilesWidget.vue3.js","sources":["../../../../src/components/CnFilesWidget/CnFilesWidget.vue?vue&type=template&id=1626aa43&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-files-widget\"\n\t\t:class=\"{ 'cn-files-widget--dragging': isDragging }\"\n\t\t@dragenter=\"onDragEnter\"\n\t\t@dragover=\"onDragOver\"\n\t\t@dragleave=\"onDragLeave\"\n\t\t@drop=\"onDrop\">\n\t\t<div class=\"cn-files-widget__toolbar\">\n\t\t\t<nav\n\t\t\t\tv-if=\"!objectBound\"\n\t\t\t\tclass=\"cn-files-widget__breadcrumb\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Folder breadcrumb')\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-files-widget__crumb cn-files-widget__crumb--root\"\n\t\t\t\t\t:aria-current=\"currentSubPath === '/' ? 'page' : null\"\n\t\t\t\t\t@click=\"navigateTo('/')\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Root') }}\n\t\t\t\t</button>\n\t\t\t\t<template v-for=\"(segment, index) in pathSegments\" :key=\"index\">\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclass=\"cn-files-widget__separator\">/</span>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"cn-files-widget__crumb\"\n\t\t\t\t\t\t:aria-current=\"index === pathSegments.length - 1 ? 'page' : null\"\n\t\t\t\t\t\t@click=\"navigateTo(segmentPathTo(index))\">\n\t\t\t\t\t\t{{ segment }}\n\t\t\t\t\t</button>\n\t\t\t\t</template>\n\t\t\t</nav>\n\n\t\t\t<input\n\t\t\t\tv-model=\"searchQuery\"\n\t\t\t\ttype=\"search\"\n\t\t\t\tclass=\"cn-files-widget__search\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Search this folder')\"\n\t\t\t\t:placeholder=\"t('nextcloud-vue', 'Search this folder…')\">\n\n\t\t\t<button\n\t\t\t\tv-if=\"canShowUpload\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__upload\"\n\t\t\t\t@click=\"triggerUpload\">\n\t\t\t\t{{ t('nextcloud-vue', 'Upload File') }}\n\t\t\t</button>\n\t\t\t<!--\n\t\t\t\t`:ref`, not `ref`. Note `:aria-hidden=\"true\"` does NOT save this:\n\t\t\t\ta binding to a LITERAL CONSTANT is constant-folded, so the vnode\n\t\t\t\tstays fully static and the compiler hoists it to module scope.\n\t\t\t\tA hoisted vnode's ref has no owner instance, and `setRef()`'s\n\t\t\t\tnull-owner guard — along with its early `return` — is compiled\n\t\t\t\tout of production builds, so it dereferences null and throws\n\t\t\t\t`Cannot read properties of null (reading 'refs')`, aborting the\n\t\t\t\trender of the page that mounted this widget.\n\n\t\t\t\tConfirmed by instrumenting Vue's own warning to print the ref\n\t\t\t\tname: `[DEBUG ref=\"fileInput\" vnodeType=input]`. This widget is\n\t\t\t\tthe `files` integration leaf, which is how it reaches a detail\n\t\t\t\tpage. See CnFilesTab for the full account of the mechanism.\n\t\t\t-->\n\t\t\t<input\n\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\ttype=\"file\"\n\t\t\t\tmultiple\n\t\t\t\tclass=\"cn-files-widget__file-input\"\n\t\t\t\t:aria-hidden=\"true\"\n\t\t\t\ttabindex=\"-1\"\n\t\t\t\t@change=\"onFileInputChange\">\n\t\t</div>\n\n\t\t<div\n\t\t\tv-if=\"isDragging && canShowUpload\"\n\t\t\tclass=\"cn-files-widget__dropzone\"\n\t\t\taria-hidden=\"true\">\n\t\t\t{{ t('nextcloud-vue', 'Drop files to upload') }}\n\t\t</div>\n\n\t\t<div v-if=\"loading\" class=\"cn-files-widget__state\">\n\t\t\t{{ t('nextcloud-vue', 'Loading folder…') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"unavailable\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--unavailable\">\n\t\t\t{{ t('nextcloud-vue', 'Files is not available') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode === 'no_access'\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--no-access\">\n\t\t\t{{ t('nextcloud-vue', 'You don\\'t have access to this folder.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode === 'folder_not_found'\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--not-found\">\n\t\t\t{{ t('nextcloud-vue', 'Folder no longer exists.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"errorCode\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--error\">\n\t\t\t{{ t('nextcloud-vue', 'Failed to load folder contents.') }}\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__retry\"\n\t\t\t\t@click=\"fetchContents\">\n\t\t\t\t{{ t('nextcloud-vue', 'Retry') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"filteredItems.length === 0 && !searchQuery\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--empty\">\n\t\t\t{{ t('nextcloud-vue', 'This folder is empty.') }}\n\t\t</div>\n\n\t\t<div\n\t\t\tv-else-if=\"filteredItems.length === 0 && searchQuery\"\n\t\t\tclass=\"cn-files-widget__state cn-files-widget__state--empty\">\n\t\t\t{{ noSearchResultsLabel }}\n\t\t</div>\n\n\t\t<ul\n\t\t\tv-else\n\t\t\tclass=\"cn-files-widget__list\"\n\t\t\t:class=\"{ 'cn-files-widget__list--grid': viewMode === 'grid' }\">\n\t\t\t<li\n\t\t\t\tv-for=\"item in filteredItems\"\n\t\t\t\t:key=\"item.fileId\"\n\t\t\t\tclass=\"cn-files-widget__row\"\n\t\t\t\t:class=\"{ 'cn-files-widget__row--folder': item.isFolder }\">\n\t\t\t\t<!-- Files are real links (new tab, copyable); folders browse in-widget. -->\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.isFolder ? 'button' : 'a'\"\n\t\t\t\t\t:type=\"item.isFolder ? 'button' : undefined\"\n\t\t\t\t\t:href=\"item.isFolder ? undefined : (fileUrl(item.fileId) || undefined)\"\n\t\t\t\t\t:target=\"item.isFolder ? undefined : '_blank'\"\n\t\t\t\t\t:rel=\"item.isFolder ? undefined : 'noopener noreferrer'\"\n\t\t\t\t\tclass=\"cn-files-widget__row-name\"\n\t\t\t\t\t@click=\"onRowClick(item, $event)\">\n\t\t\t\t\t<span aria-hidden=\"true\" class=\"cn-files-widget__row-icon\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-if=\"showThumbnails && !item.isFolder && item.thumbnailUrl && !failedThumbs[item.fileId]\"\n\t\t\t\t\t\t\t:src=\"item.thumbnailUrl\"\n\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\tclass=\"cn-files-widget__row-thumb\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t@error=\"onThumbError(item)\">\n\t\t\t\t\t\t<template v-else>{{ item.isFolder ? '📁' : '📄' }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-files-widget__row-label\">{{ item.name }}</span>\n\t\t\t\t</component>\n\t\t\t\t<span class=\"cn-files-widget__row-modified\">{{ item.modifiedAt }}</span>\n\t\t\t\t<span class=\"cn-files-widget__row-size\">{{ formatSize(item.size, item.isFolder) }}</span>\n\t\t\t\t<button\n\t\t\t\t\tv-if=\"canDeleteItem(item)\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"cn-files-widget__row-delete\"\n\t\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Delete {name}', { name: item.name })\"\n\t\t\t\t\t@click=\"confirmDelete(item)\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Delete') }}\n\t\t\t\t</button>\n\t\t\t</li>\n\t\t</ul>\n\n\t\t<div v-if=\"nextCursor\" class=\"cn-files-widget__pagination\">\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-files-widget__more\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t{{ t('nextcloud-vue', 'Load more') }}\n\t\t\t</button>\n\t\t</div>\n\n\t\t<CnFilePreview v-if=\"previewFile\" :file=\"previewFile\" @close=\"previewFile = null\" />\n\n\t\t<CnFilesWidgetDeleteDialog\n\t\t\t:open=\"confirmTarget !== null\"\n\t\t\t:fileName=\"confirmTarget ? confirmTarget.name : ''\"\n\t\t\t@update:open=\"onDeleteDialogToggle\"\n\t\t\t@confirm=\"performDelete\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport CnFilesWidgetDeleteDialog from '../../dialogs/CnFilesWidgetDeleteDialog.vue'\nimport CnFilePreview from '../CnFilePreview/CnFilePreview.vue'\nimport { useFileOpener } from '../../composables/useFileOpener.js'\nimport { stripTrailingSlashes } from '../../utils/trailingSlashes.js'\n\n/**\n * CnFilesWidget — an inline Nextcloud Files browser rendered as a dashboard\n * widget (catalog type `files`, migrated from the launchpad `files` widget).\n *\n * NC-INTEGRATION DEPENDENCY: this widget reads folder contents from a host\n * application's `/api/widgets/files/{placementId}/...` endpoints (the same\n * contract the launchpad/mydash backend served) and deep-links file rows into\n * the Nextcloud **Files** app via the canonical `/f/{fileid}` permalink. The\n * `@nextcloud/axios` + `@nextcloud/router` helpers are imported LAZILY at call\n * time so the widget code never hard-couples to a network stack at module load\n * (keeps the no-op css transform path clean and lets a host without the backing\n * endpoint mount the component without side-effects). When the backing endpoint\n * is absent the widget degrades to a localised disabled / empty state rather\n * than throwing — see the `unavailable` data flag and the `folder_not_found` /\n * `no_access` error branches.\n *\n * Every placement instance owns its own navigation stack: the sub-path resets\n * to `/` whenever the `placement` prop changes, so re-configuring the widget\n * root never leaves the user on a stale path.\n *\n * @spec openspec/changes/cn-widget-library/specs/cn-widget-library/spec.md\n */\nexport default {\n\tname: 'CnFilesWidget',\n\n\tcomponents: {\n\t\tCnFilePreview,\n\t\tCnFilesWidgetDeleteDialog,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Persisted content blob configuring the folder + toolbar — see\n\t\t * `CnFilesWidgetForm` for the full shape (`folderPath`, `fileId`,\n\t\t * `viewMode`, `allowUpload`, `allowDelete`, …).\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Placement entity; its `id` scopes the host Files endpoint. */\n\t\tplacement: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Whether the dashboard shell is in admin mode. */\n\t\tisAdmin: { // eslint-disable-line vue/no-unused-properties -- the dashboard shell passes this to every widget; declared so it does not fall through to $attrs.\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Whether the dashboard shell is in edit mode. */\n\t\tcanEdit: { // eslint-disable-line vue/no-unused-properties -- the dashboard shell passes this to every widget; declared so it does not fall through to $attrs.\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * App base for the host's files-widget endpoints\n\t\t * (`{apiBase}/api/widgets/files/{placementId}/...`). Lets a consuming\n\t\t * app point the widget at its own backend (e.g. `/apps/launchpad`).\n\t\t * Defaults to `/apps/files`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tapiBase: {\n\t\t\ttype: String,\n\t\t\tdefault: '/apps/files',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister object id this widget attaches\n\t\t * files to. When `objectId` + `register` + `schema` are all set (they\n\t\t * are auto-supplied by `CnWidgetGrid`'s detail-page context merge), the\n\t\t * widget lists/uploads/deletes against the object's Nextcloud folder via\n\t\t * the OpenRegister object endpoints instead of the dashboard\n\t\t * `/api/widgets/files/...` contract. Empty (default) keeps the dashboard\n\t\t * placement behaviour unchanged.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister register slug of the bound object.\n\t\t * See the `objectId` prop.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Object-bound mode: the OpenRegister schema of the bound object. Accepts\n\t\t * either a slug string or the resolved schema object (as merged by\n\t\t * `CnWidgetGrid`); the slug is derived by the `schemaSlug` computed. See\n\t\t * the `objectId` prop.\n\t\t *\n\t\t * @type {string|object}\n\t\t */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * App base for the OpenRegister object-file endpoints used in\n\t\t * object-bound mode (`{objectApiBase}/objects/{register}/{schema}/{id}/...`).\n\t\t * Defaults to `/apps/openregister/api`.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tobjectApiBase: {\n\t\t\ttype: String,\n\t\t\tdefault: '/apps/openregister/api',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The file shown in the in-page preview, or null. */\n\t\t\tpreviewFile: null,\n\t\t\t/**\n\t\t\t * The hidden file input, set by the template's function ref (kept off `$refs` so the ref stays dynamic — see the template).\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\titems: [],\n\t\t\tcurrentSubPath: '/',\n\t\t\tloading: false,\n\t\t\terrorCode: null,\n\t\t\tunavailable: false,\n\t\t\tnextCursor: null,\n\t\t\tsearchQuery: '',\n\t\t\tconfirmTarget: null,\n\t\t\t// fileId → true for thumbnails whose <img> failed to load, so the\n\t\t\t// row falls back to the generic icon instead of a broken image.\n\t\t\tfailedThumbs: {},\n\t\t\t// Whether a file drag is currently hovering the widget (drop overlay).\n\t\t\tisDragging: false,\n\t\t\t// Depth counter so nested dragenter/dragleave don't flicker the overlay.\n\t\t\tdragDepth: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Numeric placement id used to scope the host Files endpoint.\n\t\t *\n\t\t * @return {number} the placement id, or `0` when no placement is bound.\n\t\t */\n\t\tplacementId() {\n\t\t\treturn Number(this.placement?.id || 0)\n\t\t},\n\n\t\t/**\n\t\t * The schema slug in object-bound mode. Accepts either a slug string or\n\t\t * the resolved schema object merged by `CnWidgetGrid` (in which case the\n\t\t * slug is read from `slug`/`id`/`uuid`).\n\t\t *\n\t\t * @return {string} the schema slug, or `''` when unavailable.\n\t\t */\n\t\tschemaSlug() {\n\t\t\tconst s = this.schema\n\t\t\tif (typeof s === 'string') {\n\t\t\t\treturn s\n\t\t\t}\n\t\t\treturn (s && (s.slug || s.id || s.uuid)) || ''\n\t\t},\n\n\t\t/**\n\t\t * Whether the widget runs in object-bound mode — i.e. it attaches files\n\t\t * to a specific OpenRegister object rather than a dashboard placement.\n\t\t *\n\t\t * @return {boolean} `true` when `objectId`, `register` and `schemaSlug` are all set.\n\t\t */\n\t\tobjectBound() {\n\t\t\treturn !!(this.objectId && this.register && this.schemaSlug)\n\t\t},\n\n\t\t/**\n\t\t * Stable identity key for the bound object, or `''` in dashboard mode.\n\t\t * Watched to (re)fetch when the object context first resolves (the schema\n\t\t * object arrives after the ids) or when the widget rebinds to another\n\t\t * object.\n\t\t *\n\t\t * @return {string} `register/schema/objectId`, or `''` when not object-bound.\n\t\t */\n\t\tobjectKey() {\n\t\t\treturn this.objectBound\n\t\t\t\t? `${this.register}/${this.schemaSlug}/${this.objectId}`\n\t\t\t\t: ''\n\t\t},\n\n\t\t/**\n\t\t * Whether the upload affordance is enabled by configuration. Defaults to\n\t\t * enabled in BOTH modes — a Files widget is an add-files surface — and is\n\t\t * only suppressed when a placement explicitly sets `allowUpload: false`.\n\t\t * (Object-bound mode already defaulted on, matching the object sidebar's\n\t\t * Files tab; beta extended the same default to dashboard placements.)\n\t\t *\n\t\t * @return {boolean} `true` unless `content.allowUpload` is explicitly false.\n\t\t */\n\t\tallowUpload() {\n\t\t\treturn this.content?.allowUpload !== false\n\t\t},\n\n\t\t/**\n\t\t * Whether per-row delete affordances are enabled by configuration. On by\n\t\t * default in object-bound mode (unless `content.allowDelete` is explicitly\n\t\t * false); opt-in (`content.allowDelete === true`) in dashboard mode.\n\t\t *\n\t\t * @return {boolean} `true` when deletes are allowed.\n\t\t */\n\t\tallowDelete() {\n\t\t\tif (this.objectBound) {\n\t\t\t\treturn this.content?.allowDelete !== false\n\t\t\t}\n\t\t\treturn this.content?.allowDelete === true\n\t\t},\n\n\t\t/**\n\t\t * Layout for the file listing, from `content.viewMode`. `'grid'` renders\n\t\t * the items as a tile grid; any other value (`'list'`, `'tree'`, unset)\n\t\t * renders the default list. Tree navigation is not implemented, so\n\t\t * `'tree'` falls back to the list layout.\n\t\t *\n\t\t * @return {string} `'grid'` or `'list'`.\n\t\t */\n\t\tviewMode() {\n\t\t\treturn this.content?.viewMode === 'grid' ? 'grid' : 'list'\n\t\t},\n\n\t\t/**\n\t\t * Whether file rows show a preview thumbnail (from `content.showThumbnails`).\n\t\t * Defaults to on; only an explicit `false` disables it. Files without a\n\t\t * backend-provided `thumbnailUrl` still fall back to the generic icon.\n\t\t *\n\t\t * @return {boolean} `true` unless `content.showThumbnails` is explicitly false.\n\t\t */\n\t\tshowThumbnails() {\n\t\t\treturn this.content?.showThumbnails !== false\n\t\t},\n\n\t\t/**\n\t\t * Heuristic write-permission check: an empty folder optimistically\n\t\t * surfaces the upload button (the backend re-validates), otherwise at\n\t\t * least one editable child is required.\n\t\t *\n\t\t * @return {boolean} `true` when the viewer is treated as having write access.\n\t\t */\n\t\tviewerCanWrite() {\n\t\t\tif (this.items.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn this.items.some((item) => item.canEdit === true)\n\t\t},\n\n\t\t/**\n\t\t * Whether the upload button should render.\n\t\t *\n\t\t * @return {boolean} `true` when upload is allowed, writable, and not errored.\n\t\t */\n\t\tcanShowUpload() {\n\t\t\treturn this.allowUpload && this.viewerCanWrite && !this.errorCode && !this.unavailable\n\t\t},\n\n\t\t/**\n\t\t * The current sub-path split into breadcrumb segments.\n\t\t *\n\t\t * @return {string[]} the path segments (empty at root).\n\t\t */\n\t\tpathSegments() {\n\t\t\tif (!this.currentSubPath || this.currentSubPath === '/') {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.currentSubPath\n\t\t\t\t.split('/')\n\t\t\t\t.map((segment) => segment.trim())\n\t\t\t\t.filter((segment) => segment !== '')\n\t\t},\n\n\t\t/**\n\t\t * The items filtered by the in-widget search query.\n\t\t *\n\t\t * @return {Array<object>} the matching items (all items when the query is empty).\n\t\t */\n\t\tfilteredItems() {\n\t\t\tconst query = this.searchQuery.trim().toLowerCase()\n\t\t\tif (query === '') {\n\t\t\t\treturn this.items\n\t\t\t}\n\t\t\treturn this.items.filter((item) => {\n\t\t\t\tconst name = String(item.name || '').toLowerCase()\n\t\t\t\treturn name.includes(query)\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The localised \"no results\" label for the active search query.\n\t\t *\n\t\t * @return {string} the no-results message.\n\t\t */\n\t\tnoSearchResultsLabel() {\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'No files matching \\'{query}\\'',\n\t\t\t\t{ query: this.searchQuery },\n\t\t\t)\n\t\t},\n\t},\n\n\twatch: {\n\t\tplacement: {\n\t\t\timmediate: true,\n\t\t\t/**\n\t\t\t * Reset navigation state and refetch whenever the placement changes.\n\t\t\t * Dashboard mode only — object-bound mode is driven by `objectKey`.\n\t\t\t *\n\t\t\t * @return {void}\n\t\t\t */\n\t\t\thandler() {\n\t\t\t\tif (this.objectBound) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.resetListing()\n\t\t\t\tthis.fetchContents()\n\t\t\t},\n\t\t},\n\n\t\tobjectKey: {\n\t\t\timmediate: true,\n\t\t\t/**\n\t\t\t * Reset and refetch when the bound object first resolves or changes.\n\t\t\t *\n\t\t\t * @param {string} key the new object key (`''` in dashboard mode).\n\t\t\t * @return {void}\n\t\t\t */\n\t\t\thandler(key) {\n\t\t\t\tif (!key) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.resetListing()\n\t\t\t\tthis.fetchContents()\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Function ref for the hidden file input; a method so the binding is\n\t\t * stable across renders and the vnode stays dynamic.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Reset the listing/navigation state before a (re)fetch.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tresetListing() {\n\t\t\tthis.currentSubPath = '/'\n\t\t\tthis.items = []\n\t\t\tthis.nextCursor = null\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\t\t},\n\n\t\t/**\n\t\t * Fetch (or append) one page of folder contents from the host Files\n\t\t * endpoint. Degrades gracefully: a missing endpoint flips `unavailable`,\n\t\t * a 404/403 maps to a typed `errorCode`, and no exception escapes.\n\t\t *\n\t\t * @param {boolean} [append] whether to append to the existing list (pagination).\n\t\t * @return {Promise<void>} resolves when the fetch settles.\n\t\t */\n\t\tasync fetchContents(append = false) {\n\t\t\tif (this.objectBound) {\n\t\t\t\treturn this.fetchObjectFiles()\n\t\t\t}\n\t\t\tif (this.placementId === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.loading = !append\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/contents`,\n\t\t\t\t\t{ placementId: this.placementId },\n\t\t\t\t)\n\t\t\t\tconst params = {\n\t\t\t\t\tcurrentPath: this.currentSubPath,\n\t\t\t\t\tlimit: 50,\n\t\t\t\t}\n\t\t\t\tif (append && this.nextCursor) {\n\t\t\t\t\tparams.cursor = this.nextCursor\n\t\t\t\t}\n\n\t\t\t\tconst response = await axios.get(url, { params })\n\t\t\t\tconst data = response?.data || {}\n\t\t\t\tconst nextItems = Array.isArray(data.items) ? data.items : []\n\t\t\t\tthis.items = append ? this.items.concat(nextItems) : nextItems\n\t\t\t\tthis.nextCursor = data.nextCursor || null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err?.response?.status\n\t\t\t\tconst code = err?.response?.data?.error\n\t\t\t\tif (status === 404 || code === 'folder_not_found') {\n\t\t\t\t\tthis.errorCode = 'folder_not_found'\n\t\t\t\t} else if (status === 403 || code === 'no_access') {\n\t\t\t\t\tthis.errorCode = 'no_access'\n\t\t\t\t} else if (status === undefined) {\n\t\t\t\t\t// No HTTP response at all — the backing Files endpoint is\n\t\t\t\t\t// not installed/reachable; degrade to the disabled state.\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t} else {\n\t\t\t\t\tthis.errorCode = 'unknown_error'\n\t\t\t\t}\n\t\t\t\tif (!append) {\n\t\t\t\t\tthis.items = []\n\t\t\t\t\tthis.nextCursor = null\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Object-bound listing: fetch the bound OpenRegister object's files from\n\t\t * `{objectApiBase}/objects/{register}/{schema}/{id}/files` and map them\n\t\t * onto the widget's flat item shape (no folder navigation). Degrades the\n\t\t * same way as the dashboard fetch: 404/403 → typed `errorCode`, no HTTP\n\t\t * response → `unavailable`.\n\t\t *\n\t\t * @return {Promise<void>} resolves when the fetch settles.\n\t\t */\n\t\tasync fetchObjectFiles() {\n\t\t\tthis.loading = true\n\t\t\tthis.errorCode = null\n\t\t\tthis.unavailable = false\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/files`,\n\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId },\n\t\t\t\t)\n\t\t\t\tconst response = await axios.get(url)\n\t\t\t\tconst data = response?.data || {}\n\t\t\t\tconst results = Array.isArray(data)\n\t\t\t\t\t? data\n\t\t\t\t\t: (Array.isArray(data.results) ? data.results : [])\n\t\t\t\tthis.items = results.map((file) => {\n\t\t\t\t\tconst mime = file.mimeType || file.mimetype || file.type || ''\n\t\t\t\t\t// SVG: Nextcloud's rasterised /core/preview is usually\n\t\t\t\t\t// unavailable for SVG (no rsvg/imagick), so stream the raw file\n\t\t\t\t\t// from OpenRegister's authenticated per-file download endpoint\n\t\t\t\t\t// (works for the owner's un-shared uploads via the session\n\t\t\t\t\t// cookie; the widget's other calls use the same objectApiBase).\n\t\t\t\t\t// Rendered through the list's <img>, the SVG runs in the\n\t\t\t\t\t// browser's restricted image mode — inline <script> / event\n\t\t\t\t\t// handlers never execute and external refs don't load — so\n\t\t\t\t\t// untrusted SVG is shown safely without a bespoke sandbox.\n\t\t\t\t\t// Other images use the rasterised server preview; anything else\n\t\t\t\t\t// gets the generic icon (a missing preview also falls back via\n\t\t\t\t\t// the <img> @error handler).\n\t\t\t\t\tlet thumbnailUrl = null\n\t\t\t\t\tif (file.id && /^image\\/svg\\+xml$/i.test(mime)) {\n\t\t\t\t\t\tthumbnailUrl = generateUrl(`${this.objectApiBase}/files/{fileId}/download`, { fileId: file.id })\n\t\t\t\t\t} else if (file.id && /^image\\//.test(mime)) {\n\t\t\t\t\t\tthumbnailUrl = generateUrl('/core/preview?fileId={fileId}&x=256&y=256&a=1', { fileId: file.id })\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\tname: file.name || file.title || '',\n\t\t\t\t\t\tfileId: file.id,\n\t\t\t\t\t\tmimeType: mime,\n\t\t\t\t\t\tpath: file.path || '',\n\t\t\t\t\t\tdownloadUrl: file.id ? generateUrl(`${this.objectApiBase}/files/{fileId}/download`, { fileId: file.id }) : '',\n\t\t\t\t\t\tisFolder: false,\n\t\t\t\t\t\tsize: file.size,\n\t\t\t\t\t\tmodifiedAt: file.modified || file.updated || '',\n\t\t\t\t\t\tthumbnailUrl,\n\t\t\t\t\t\tcanEdit: true,\n\t\t\t\t\t\tcanDelete: this.allowDelete,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tthis.nextCursor = null\n\t\t\t} catch (err) {\n\t\t\t\tconst status = err?.response?.status\n\t\t\t\tif (status === 404) {\n\t\t\t\t\tthis.errorCode = 'folder_not_found'\n\t\t\t\t} else if (status === 403) {\n\t\t\t\t\tthis.errorCode = 'no_access'\n\t\t\t\t} else if (status === undefined) {\n\t\t\t\t\tthis.unavailable = true\n\t\t\t\t} else {\n\t\t\t\t\tthis.errorCode = 'unknown_error'\n\t\t\t\t}\n\t\t\t\tthis.items = []\n\t\t\t\tthis.nextCursor = null\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Load the next page when a cursor is present.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tloadMore() {\n\t\t\tif (this.nextCursor) {\n\t\t\t\tthis.fetchContents(true)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show a file in the in-page preview.\n\t\t *\n\t\t * @param {object} file The file to preview.\n\t\t */\n\t\tshowPreview(file) {\n\t\t\tthis.previewFile = file\n\t\t},\n\n\t\t/**\n\t\t * Handle a row click: a folder is browsed in place, a file opens through\n\t\t * the shared opener (Viewer, preview, browser, Files app).\n\t\t *\n\t\t * @param {object} item the clicked row.\n\t\t * @param {MouseEvent} [event] the click event.\n\t\t * @return {void}\n\t\t */\n\t\tonRowClick(item, event) {\n\t\t\tif (item.isFolder) {\n\t\t\t\tthis.onItemClick(item)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Keep the link's own behaviour for a modified click (new tab, etc.).\n\t\t\tif (event && (event.ctrlKey || event.metaKey || event.shiftKey || event.button === 1)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event) {\n\t\t\t\tevent.preventDefault()\n\t\t\t}\n\t\t\tuseFileOpener({ onPreview: this.showPreview }).open({\n\t\t\t\tid: item.fileId,\n\t\t\t\tname: item.name,\n\t\t\t\ttype: item.mimeType || item.mimetype || item.type || '',\n\t\t\t\tpath: item.path || '',\n\t\t\t\taccessUrl: item.accessUrl || '',\n\t\t\t\tdownloadUrl: item.downloadUrl || '',\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Descend into a folder row.\n\t\t *\n\t\t * @param {object} item the clicked folder item.\n\t\t * @return {void}\n\t\t */\n\t\tonItemClick(item) {\n\t\t\tthis.navigateTo(this.joinPath(this.currentSubPath, item.name))\n\t\t},\n\n\t\t/**\n\t\t * Navigate to a sub-path, clearing search + pagination and refetching.\n\t\t *\n\t\t * @param {string} path the target sub-path.\n\t\t * @return {void}\n\t\t */\n\t\tnavigateTo(path) {\n\t\t\tthis.currentSubPath = path || '/'\n\t\t\tthis.searchQuery = ''\n\t\t\tthis.nextCursor = null\n\t\t\tthis.fetchContents()\n\t\t},\n\n\t\t/**\n\t\t * Build the sub-path up to (and including) a breadcrumb segment index.\n\t\t *\n\t\t * @param {number} index the segment index.\n\t\t * @return {string} the assembled sub-path.\n\t\t */\n\t\tsegmentPathTo(index) {\n\t\t\tconst segments = this.pathSegments.slice(0, index + 1)\n\t\t\treturn '/' + segments.join('/')\n\t\t},\n\n\t\t/**\n\t\t * Join a base path and a child name into a normalised sub-path.\n\t\t *\n\t\t * @param {string} base the base path.\n\t\t * @param {string} name the child name.\n\t\t * @return {string} the joined path.\n\t\t */\n\t\tjoinPath(base, name) {\n\t\t\tconst trimmedBase = stripTrailingSlashes(String(base || '/'))\n\t\t\tconst trimmedName = String(name || '').replace(/^\\/+/, '')\n\t\t\tif (trimmedBase === '' || trimmedBase === '/') {\n\t\t\t\treturn '/' + trimmedName\n\t\t\t}\n\t\t\treturn `${trimmedBase}/${trimmedName}`\n\t\t},\n\n\t\t/**\n\t\t * The Files-app permalink for a file.\n\t\t *\n\t\t * @param {number|string} fileId the Nextcloud file id.\n\t\t * @return {string} the URL, or '' without a file id.\n\t\t */\n\t\tfileUrl(fileId) {\n\t\t\tif (!fileId) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Canonical permalink: `/f/{fileid}` resolves the id to its folder\n\t\t\t// and opens the file; generateUrl adds `index.php` where needed.\n\t\t\treturn generateUrl('/f/{fileid}', { fileid: fileId })\n\t\t},\n\n\t\t/**\n\t\t * Whether a per-row delete button should render for an item.\n\t\t *\n\t\t * @param {object} item the item.\n\t\t * @return {boolean} `true` when delete is allowed and the item is deletable.\n\t\t */\n\t\tcanDeleteItem(item) {\n\t\t\treturn this.allowDelete === true && item.canDelete === true\n\t\t},\n\n\t\t/**\n\t\t * Mark an item's thumbnail as failed so the row falls back to the\n\t\t * generic icon. Fires when the preview `<img>` cannot load (e.g. the\n\t\t * preview was not generated in time).\n\t\t *\n\t\t * @param {object} item the item whose thumbnail failed.\n\t\t * @return {void}\n\t\t */\n\t\tonThumbError(item) {\n\t\t\tthis.failedThumbs[item.fileId] = true\n\t\t},\n\n\t\t/**\n\t\t * Open the delete-confirmation modal for an item.\n\t\t *\n\t\t * @param {object} item the item to delete.\n\t\t * @return {void}\n\t\t */\n\t\tconfirmDelete(item) {\n\t\t\tthis.confirmTarget = item\n\t\t},\n\n\t\t/**\n\t\t * React to the delete dialog's open-state changes. Closing it (Cancel,\n\t\t * Esc, click-outside, or the header X) clears the pending target.\n\t\t *\n\t\t * @param {boolean} open the dialog's new open state.\n\t\t * @return {void}\n\t\t */\n\t\tonDeleteDialogToggle(open) {\n\t\t\tif (!open) {\n\t\t\t\tthis.confirmTarget = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Delete the confirmed target via the host Files endpoint, refreshing\n\t\t * the listing on failure so the UI stays truthful.\n\t\t *\n\t\t * @return {Promise<void>} resolves when the delete settles.\n\t\t */\n\t\tasync performDelete() {\n\t\t\tconst target = this.confirmTarget\n\t\t\tif (!target) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tconst url = this.objectBound\n\t\t\t\t\t? generateUrl(\n\t\t\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/files/{fileId}`,\n\t\t\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId, fileId: target.fileId },\n\t\t\t\t\t\t)\n\t\t\t\t\t: generateUrl(\n\t\t\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/files/{fileId}`,\n\t\t\t\t\t\t\t{ placementId: this.placementId, fileId: target.fileId },\n\t\t\t\t\t\t)\n\t\t\t\tawait axios.delete(url)\n\t\t\t\tthis.items = this.items.filter((item) => item.fileId !== target.fileId)\n\t\t\t} catch {\n\t\t\t\tthis.fetchContents()\n\t\t\t} finally {\n\t\t\t\tthis.confirmTarget = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Trigger the hidden file input from the upload button.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\ttriggerUpload() {\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.click()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Upload the chosen files to the host Files endpoint and refresh.\n\t\t *\n\t\t * @param {Event} event the file-input change event.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync onFileInputChange(event) {\n\t\t\tconst fileList = event?.target?.files\n\t\t\tawait this.uploadFiles(fileList)\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.value = ''\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * POST a FileList (from the picker or a drag-and-drop) to the host Files\n\t\t * endpoint, then refresh the listing. No-op when there is nothing to upload\n\t\t * or upload is not permitted; never throws.\n\t\t *\n\t\t * @param {FileList|File[]|null} fileList the files to upload.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync uploadFiles(fileList) {\n\t\t\tif (!fileList || fileList.length === 0 || !this.canShowUpload) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst formData = new FormData()\n\t\t\tfor (let i = 0; i < fileList.length; i++) {\n\t\t\t\tformData.append('files[]', fileList[i])\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\n\t\t\t\tif (this.objectBound) {\n\t\t\t\t\tconst objectUrl = generateUrl(\n\t\t\t\t\t\t`${this.objectApiBase}/objects/{register}/{schema}/{objectId}/filesMultipart`,\n\t\t\t\t\t\t{ register: this.register, schema: this.schemaSlug, objectId: this.objectId },\n\t\t\t\t\t)\n\t\t\t\t\tawait axios.post(objectUrl, formData)\n\t\t\t\t} else {\n\t\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t\t`${this.apiBase}/api/widgets/files/{placementId}/upload`,\n\t\t\t\t\t\t{ placementId: this.placementId },\n\t\t\t\t\t)\n\t\t\t\t\tawait axios.post(url, formData, {\n\t\t\t\t\t\tparams: { currentPath: this.currentSubPath },\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tthis.fetchContents()\n\t\t\t} catch {\n\t\t\t\tthis.fetchContents()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Track a drag entering the widget (depth-counted so nested elements don't\n\t\t * flicker the drop overlay).\n\t\t *\n\t\t * @param {DragEvent} event the dragenter event.\n\t\t * @return {void}\n\t\t */\n\t\tonDragEnter(event) {\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tthis.dragDepth++\n\t\t\tthis.isDragging = true\n\t\t},\n\n\t\t/**\n\t\t * Keep the browser from opening the dragged file and mark the drop as a copy.\n\t\t *\n\t\t * @param {DragEvent} event the dragover event.\n\t\t * @return {void}\n\t\t */\n\t\tonDragOver(event) {\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tif (event.dataTransfer) {\n\t\t\t\tevent.dataTransfer.dropEffect = 'copy'\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Track a drag leaving the widget, clearing the overlay at depth zero.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonDragLeave() {\n\t\t\tif (this.dragDepth > 0) {\n\t\t\t\tthis.dragDepth--\n\t\t\t}\n\t\t\tif (this.dragDepth === 0) {\n\t\t\t\tthis.isDragging = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Handle a file drop — upload the dropped files into the current folder.\n\t\t *\n\t\t * @param {DragEvent} event the drop event.\n\t\t * @return {Promise<void>} resolves when the upload settles.\n\t\t */\n\t\tasync onDrop(event) {\n\t\t\tthis.dragDepth = 0\n\t\t\tthis.isDragging = false\n\t\t\tif (!this.canShowUpload || !this.hasFiles(event)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tevent.preventDefault()\n\t\t\tawait this.uploadFiles(event.dataTransfer?.files)\n\t\t},\n\n\t\t/**\n\t\t * Whether a drag event is carrying files (vs. text / an internal drag).\n\t\t *\n\t\t * @param {DragEvent} event the drag event.\n\t\t * @return {boolean} `true` when the payload includes files.\n\t\t */\n\t\thasFiles(event) {\n\t\t\tconst types = event?.dataTransfer?.types\n\t\t\tif (!types) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn Array.from(types).includes('Files')\n\t\t},\n\n\t\t/**\n\t\t * Human-format a byte count (folders render an empty size).\n\t\t *\n\t\t * @param {number} bytes the byte count.\n\t\t * @param {boolean} isFolder whether the item is a folder.\n\t\t * @return {string} the formatted size.\n\t\t */\n\t\tformatSize(bytes, isFolder) {\n\t\t\tif (isFolder) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = Number(bytes || 0)\n\t\t\tif (value === 0) {\n\t\t\t\treturn '0 B'\n\t\t\t}\n\t\t\tconst units = ['B', 'KB', 'MB', 'GB', 'TB']\n\t\t\tlet unitIndex = 0\n\t\t\tlet display = value\n\t\t\twhile (display >= 1024 && unitIndex < units.length - 1) {\n\t\t\t\tdisplay = display / 1024\n\t\t\t\tunitIndex++\n\t\t\t}\n\t\t\treturn `${display.toFixed(unitIndex === 0 ? 0 : 1)} ${units[unitIndex]}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-files-widget {\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\theight: 100%;\n\toverflow: hidden;\n}\n\n.cn-files-widget--dragging {\n\toutline: 2px dashed var(--color-primary-element);\n\toutline-offset: -2px;\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__dropzone {\n\tposition: absolute;\n\tinset: 0;\n\tz-index: 5;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n\tbackground: var(--color-primary-element-light, rgba(0, 130, 201, 0.1));\n\tcolor: var(--color-primary-element);\n\tfont-weight: 600;\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tflex-wrap: wrap;\n}\n\n.cn-files-widget__breadcrumb {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 4px;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-files-widget__crumb {\n\tbackground: transparent;\n\tborder: none;\n\tpadding: 4px 6px;\n\tcursor: pointer;\n\tcolor: var(--color-primary-element);\n\tfont: inherit;\n}\n\n.cn-files-widget__crumb[aria-current='page'] {\n\tcolor: var(--color-main-text);\n\tcursor: default;\n}\n\n.cn-files-widget__separator {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-files-widget__search {\n\tflex: 0 1 200px;\n\tpadding: 4px 8px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n}\n\n.cn-files-widget__upload {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-primary-element);\n\tcolor: var(--color-primary-element-text);\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-files-widget__file-input {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tpadding: 0;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\tborder: 0;\n}\n\n.cn-files-widget__state {\n\tpadding: 16px;\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n}\n\n.cn-files-widget__retry {\n\tdisplay: block;\n\tmargin: 8px auto 0;\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-background-hover);\n\tcursor: pointer;\n}\n\n.cn-files-widget__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\toverflow: auto;\n\tflex: 1 1 auto;\n}\n\n.cn-files-widget__row {\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 140px 80px auto;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 6px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-files-widget__row-name {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tbackground: transparent;\n\tborder: none;\n\tpadding: 0;\n\tcursor: pointer;\n\ttext-align: left;\n\tcolor: var(--color-main-text);\n\tfont: inherit;\n\ttext-decoration: none;\n\tmin-width: 0;\n}\n\n.cn-files-widget__row-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex: 0 0 auto;\n\twidth: 24px;\n\theight: 24px;\n}\n\n.cn-files-widget__row-thumb {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tborder-radius: var(--border-radius);\n\tbackground-color: var(--color-background-dark);\n}\n\n.cn-files-widget__row-label {\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-files-widget__row-modified,\n.cn-files-widget__row-size {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n}\n\n.cn-files-widget__row-delete {\n\tbackground: transparent;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tpadding: 2px 8px;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tcolor: var(--color-error);\n}\n\n/* Grid view (content.viewMode === 'grid'): lay the rows out as tiles. */\n.cn-files-widget__list--grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fill, minmax(120px, 1fr));\n\tgap: 8px;\n\tpadding: 4px;\n\talign-content: start;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row {\n\tgrid-template-columns: 1fr;\n\tjustify-items: center;\n\ttext-align: center;\n\tgap: 4px;\n\tpadding: 10px 6px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-name {\n\tflex-direction: column;\n\talign-items: center;\n\tmax-width: 100%;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-label {\n\tmax-width: 100%;\n}\n\n.cn-files-widget__list--grid .cn-files-widget__row-icon {\n\tfont-size: 32px;\n\twidth: 56px;\n\theight: 56px;\n}\n\n/* Keep tiles compact — the modified date is list-view detail. */\n.cn-files-widget__list--grid .cn-files-widget__row-modified {\n\tdisplay: none;\n}\n\n.cn-files-widget__pagination {\n\ttext-align: center;\n\tpadding: 8px 0;\n}\n\n.cn-files-widget__more {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n\tbackground: var(--color-background-hover);\n\tcursor: pointer;\n}\n\n</style>\n"],"names":["_normalizeClass","_createElementVNode","_Fragment","_renderList","_createElementBlock","_toDisplayString","_createTextVNode","_resolveDynamicComponent","_openBlock","_createBlock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
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-2cd6fe28";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnFlowRunsWidget.vue2.js","sources":["../../../../src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-flow-runs-widget\" :class=\"{ 'cn-flow-runs-widget--pills': pills }\">\n\t\t<!-- One quiet line on failure, never a leaked axios status string\n\t\t (ADR-062). The real error goes to the console. -->\n\t\t<p v-if=\"error\" class=\"cn-flow-runs-widget__error\">\n\t\t\t{{ tr('Could not load the running flows') }}\n\t\t</p>\n\t\t<!-- A configured-but-unresolved subject token also shows the loading\n\t\t state: \"no runs\" would be a claim about a case the widget has not\n\t\t identified yet. -->\n\t\t<div v-else-if=\"(loading || subjectPending) && rows.length === 0\" class=\"cn-flow-runs-widget__loading\">\n\t\t\t<NcLoadingIcon :size=\"24\" />\n\t\t</div>\n\t\t<!-- A subject where nothing EVER ran gets its own line: distinct from\n\t\t a case that is merely quiet right now. -->\n\t\t<p v-else-if=\"neverRan\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t{{ tr('No flows have run yet') }}\n\t\t</p>\n\t\t<!-- Nothing running is the NORMAL state for this widget, not an\n\t\t error and not a void: one muted line, no illustration. -->\n\t\t<p v-else-if=\"rows.length === 0 && showHistory === false\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<template v-else>\n\t\t\t<p v-if=\"rows.length === 0 && content.quietLineWithHistory !== false\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t\t{{ emptyLabel }}\n\t\t\t</p>\n\t\t\t<ul v-else class=\"cn-flow-runs-widget__list\">\n\t\t\t\t<li\n\t\t\t\t\tv-for=\"(run, index) in rows\"\n\t\t\t\t\t:key=\"run.uuid || `row-${index}`\"\n\t\t\t\t\tclass=\"cn-flow-runs-widget__row\"\n\t\t\t\t\t:class=\"{ 'cn-flow-runs-widget__row--linked': isLinked }\"\n\t\t\t\t\t:data-status=\"run.status\">\n\t\t\t\t\t<component\n\t\t\t\t\t\t:is=\"runHref(run) ? 'a' : 'div'\"\n\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row-content\"\n\t\t\t\t\t\t:href=\"runHref(run) || undefined\"\n\t\t\t\t\t\t@click=\"onRowClick($event, run)\">\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-if=\"!pills\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__dot\"\n\t\t\t\t\t\t\t:class=\"`cn-flow-runs-widget__dot--${run.status}`\"\n\t\t\t\t\t\t\t:title=\"statusLabel(run.status)\" />\n\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__body\">\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__name\">{{ run.flowName }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__meta\">{{ metaLine(run) }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\tv-if=\"pills\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__pill\"\n\t\t\t\t\t\t\t:label=\"statusLabel(run.status)\"\n\t\t\t\t\t\t\t:variant=\"statusVariant(run.status)\"\n\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__age\">{{ ageLabel(run) }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<!-- The remainder is a count, never a scrollbar: the widget shows\n\t\t\t what fits its cell and states the honest total (ADR-062). -->\n\t\t\t<p v-if=\"hiddenCount > 0\" class=\"cn-flow-runs-widget__more\">\n\t\t\t\t{{ moreLabel }}\n\t\t\t</p>\n\t\t\t<!-- The subject's run history. Terminal rows sit under their own\n\t\t\t labelled section with a hollow dot and a muted name, so live\n\t\t\t and finished never rely on colour alone to tell apart. -->\n\t\t\t<template v-if=\"showHistory\">\n\t\t\t\t<p v-if=\"content.historyTitle !== false\" class=\"cn-flow-runs-widget__history-title\">\n\t\t\t\t\t{{ tr('Earlier runs') }}\n\t\t\t\t</p>\n\t\t\t\t<p v-if=\"completedError\" class=\"cn-flow-runs-widget__error\">\n\t\t\t\t\t{{ tr('Could not load the run history') }}\n\t\t\t\t</p>\n\t\t\t\t<ul v-else class=\"cn-flow-runs-widget__list\">\n\t\t\t\t\t<li\n\t\t\t\t\t\tv-for=\"(run, index) in completedRows\"\n\t\t\t\t\t\t:key=\"run.uuid || `completed-${index}`\"\n\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row cn-flow-runs-widget__row--terminal\"\n\t\t\t\t\t\t:class=\"{ 'cn-flow-runs-widget__row--linked': isLinked }\"\n\t\t\t\t\t\t:data-status=\"run.status\">\n\t\t\t\t\t\t<component\n\t\t\t\t\t\t\t:is=\"runHref(run) ? 'a' : 'div'\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row-content\"\n\t\t\t\t\t\t\t:href=\"runHref(run) || undefined\"\n\t\t\t\t\t\t\t@click=\"onRowClick($event, run)\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"!pills\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__dot cn-flow-runs-widget__dot--terminal\"\n\t\t\t\t\t\t\t\t:class=\"`cn-flow-runs-widget__dot--${run.status}`\"\n\t\t\t\t\t\t\t\t:title=\"statusLabel(run.status)\" />\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__body\">\n\t\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__name\">{{ run.flowName }}</span>\n\t\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__meta\">{{ metaLine(run) }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\t\tv-if=\"pills\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__pill\"\n\t\t\t\t\t\t\t\t:label=\"statusLabel(run.status)\"\n\t\t\t\t\t\t\t\t:variant=\"statusVariant(run.status)\"\n\t\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__age\">{{ ageLabel(run) }}</span>\n\t\t\t\t\t\t</component>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<p v-if=\"completedError === '' && completedHiddenCount > 0\" class=\"cn-flow-runs-widget__more\">\n\t\t\t\t\t{{ completedMoreLabel }}\n\t\t\t\t</p>\n\t\t\t</template>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport { computed, inject, ref } from 'vue'\nimport { useEndpointSource } from '../../composables/useEndpointSource.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { formatBoardDate } from '../../utils/boardDate.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { resolveDeepTokens, resolveFilterValue } from '../../utils/resolveFilterTokens.js'\nimport { CnStatusBadge } from '../CnStatusBadge/index.js'\n\n/**\n * The OpenRegister endpoint that lists the caller's live flow runs.\n *\n * Every Conduction app runs its flows on OpenRegister's ONE flow engine\n * (ADR-065), so \"what is running right now\" has a single answer for the whole\n * instance and this widget can be app-agnostic: an app places it and gets its\n * users' live runs without shipping a controller, a store or a view.\n *\n * @type {string}\n */\nconst ACTIVE_RUNS_URL = '/apps/openregister/api/flow-runs/active'\n\n/**\n * The OpenRegister endpoint that lists the finished runs for ONE subject\n * object. Subject-required by contract (openregister change\n * `flow-runs-subject-scope`): there is no org-wide \"all finished runs\" here,\n * so the widget only ever calls it with a resolved subject uuid.\n *\n * @type {string}\n */\nconst COMPLETED_RUNS_URL = '/apps/openregister/api/flow-runs/completed'\n\n/**\n * Statuses, in the order a person reads them: what is executing, what is\n * queued behind it, what is parked waiting on a timer or a child run, and\n * then the terminal set a subject's run history renders.\n *\n * @type {Record<string, string>}\n */\nconst STATUS_LABELS = {\n\trunning: 'Running',\n\tqueued: 'Queued',\n\tsuspended: 'Waiting',\n\tcompleted: 'Completed',\n\tstopped: 'Stopped',\n\tfailed: 'Failed',\n\tdead_letter: 'Failed after retries',\n}\n\n/**\n * The terminal statuses (FlowRun::TERMINAL on the OpenRegister side). Rows\n * with one of these are HISTORY: rendered in the earlier-runs section with a\n * hollow dot and a muted name, never mixed into the live list.\n *\n * @type {string[]}\n */\nconst TERMINAL_STATUSES = ['completed', 'stopped', 'failed', 'dead_letter']\n\n/**\n * CnFlowRunsWidget — the live flow runs for the viewer's organisation.\n *\n * Reads OpenRegister's `flow-runs/active` surface (non-terminal runs, scoped\n * server-side to the caller's organisation) and renders one row per run: its\n * flow's NAME, what triggered it, the step it currently sits on, and how long\n * it has been going. Placed by its registry type key `flow-runs`, so any app\n * gets the widget from a single manifest placement:\n *\n * ```js\n * { id: 'running-flows', type: 'flow-runs', title: 'Running flows',\n * content: { limit: 6, pollSeconds: 15, rowRoute: 'GraphDetail' } }\n * ```\n *\n * Why it polls: a run is a moving thing. A widget titled \"running flows\" that\n * only reflects the moment the dashboard mounted would be wrong within\n * seconds and would look identical to being right — so it refetches on an\n * interval, and stops while the tab is hidden so an idle dashboard is not a\n * background request loop.\n *\n * Statuses shown are ALL the non-terminal ones (queued / running / suspended),\n * because filtering to literally `running` would show an empty widget almost\n * always: a run holds that status only during a worker pass, while queued and\n * suspended are where live runs actually wait. See FlowRun::ACTIVE.\n *\n * Subject mode: a `content.subject` (a subject object uuid, or the\n * `@objectId` / `@object.<field>` token a detail placement authors) narrows\n * the live list to one case AND adds that case's finished runs below it, so\n * a flow that completed does not look like nothing ever happened. Tokens\n * resolve against the detail surface's injected object context, the same\n * route CnStatWidget and CnChartWidget take.\n *\n * @spec openspec/changes/cn-flow-runs-widget/specs/cn-flow-runs-widget/spec.md\n * @spec openspec/changes/cn-flow-runs-widget-subject/specs/cn-flow-runs-widget-subject/spec.md\n */\nexport default {\n\tname: 'CnFlowRunsWidget',\n\n\tcomponents: {\n\t\tCnStatusBadge,\n\t\tNcLoadingIcon,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function, provided by CnAppRoot (identity by default)\n\t\t * so a library string localises through the consuming app's l10n.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's action dispatcher (CnPageRenderer), for `headerAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's persisted configuration blob.\n\t\t *\n\t\t * - `limit` — rows to request AND show (1–50, default 6). The total is\n\t\t * always reported honestly regardless of this cap.\n\t\t * - `pollSeconds` — refetch interval (default 15; `0` disables polling).\n\t\t * - `rowRoute` — vue-router route NAME to open on a row click, receiving\n\t\t * the run's flow id as `:id` and the clicked run's uuid as `?run=`, so\n\t\t * the flow opens with that run inspected rather than merely open.\n\t\t * Omitted = rows are not clickable, which is correct for an app that\n\t\t * has no flow-detail page.\n\t\t * - `runRoute` — vue-router route NAME to open on a row click, receiving\n\t\t * the RUN's uuid as `:id`. Takes precedence over `rowRoute`; a row\n\t\t * without a run uuid falls back to the `rowRoute` flow-id behaviour.\n\t\t * - `subject` — a subject object uuid, or an object-context token\n\t\t * (`@objectId`, `@object.<field>`) a detail placement authors. When\n\t\t * set, the live list is filtered to that subject server-side and the\n\t\t * subject's finished runs render below it. Absent = today's org-wide\n\t\t * widget, unchanged.\n\t\t * - `emptyText` — override for the \"nothing running\" line.\n\t\t * - `quietLineWithHistory` — `false` leaves out the \"nothing running\"\n\t\t * line while the subject has finished runs to list.\n\t\t * - `historyTitle` — `false` leaves out the \"Earlier runs\" heading.\n\t\t * - `statusPill` — `true` shows the status as a pill on each row\n\t\t * (no dot, and the meta line leaves the status out), rows ruled.\n\t\t * - `statusLabels` — words per status (`{ completed: 'Succeeded' }`),\n\t\t * translated, over the built-in ones.\n\t\t * - `triggerLabels` — the meta line per trigger in words\n\t\t * (`{ 'object.created': 'Started when the case was created' }`), translated.\n\t\t * - `age` — `'datetime'` shows when the run started (\"3 okt, 14:32\")\n\t\t * instead of how long ago (\"13d\").\n\t\t * - `headerAction` — an action descriptor drawn in the card header\n\t\t * (`{ label, icon?, ...action }`, \"Flow uitvoeren\"), reported through\n\t\t * the `header` event and dispatched with the page's dispatcher; its\n\t\t * tokens resolve against the record. The runs are read again after it.\n\t\t *\n\t\t * @type {{limit?: number, pollSeconds?: number, rowRoute?: string, runRoute?: string, subject?: string, emptyText?: string, title?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Widget placement id, so the per-widget Refresh action\n\t\t * (`cn:widget:refresh`) reaches this instance's fetch.\n\t\t */\n\t\twidgetId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Translate function. Falls back to the injected `cnTranslate`.\n\t\t * Provide explicitly when mounting outside a CnAppRoot ancestor.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tsetup(props) {\n\t\t// The shared endpoint engine owns request dedup, the short-TTL cache\n\t\t// and the cn:page:refresh / cn:widget:refresh subscriptions — the same\n\t\t// binding CnStatWidget's endpoint mode uses, so a page-level Refresh\n\t\t// updates this widget with everything else on the page.\n\t\tconst widgetIdRef = ref(props.widgetId)\n\n\t\t// The detail surface's object context, injected the same way the other\n\t\t// endpoint-bound widgets (stat / chart / audit-trail) receive it, so a\n\t\t// `subject: '@objectId'` placement binds the CURRENT object without the\n\t\t// manifest hardcoding a uuid. Null on plain dashboards — the token then\n\t\t// stays unresolved and the endpoint engine's `blocked` semantics hold\n\t\t// the fetch instead of sending a literal `@objectId` to the server.\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst tokenCtx = () => ({\n\t\t\tworkspace: {},\n\t\t\tconfig: {},\n\t\t\t...(resolveObjectTokenContext(objectCtxRaw, detailCtxRaw) || {}),\n\t\t})\n\n\t\tconst configuredSubject = () => {\n\t\t\tconst subject = props.content && props.content.subject\n\t\t\treturn (typeof subject === 'string' && subject !== '') ? subject : ''\n\t\t}\n\n\t\t/**\n\t\t * The subject uuid after token resolution: `''` when no subject is\n\t\t * configured, `null` while a token still waits on the object context,\n\t\t * else the concrete uuid.\n\t\t */\n\t\tconst resolvedSubject = computed(() => {\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = resolveFilterValue(subject, tokenCtx())\n\t\t\tif (typeof value === 'string' && value.charAt(0) === '@') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (value === undefined || value === null) ? null : String(value)\n\t\t})\n\n\t\tconst source = () => {\n\t\t\tconst params = { limit: normaliseLimit(props.content && props.content.limit) }\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject !== '') {\n\t\t\t\tparams.subject = subject\n\t\t\t}\n\t\t\treturn { url: ACTIVE_RUNS_URL, method: 'GET', params }\n\t\t}\n\t\tconst { data, loading, error, refetch } = useEndpointSource(source, {\n\t\t\twidgetId: widgetIdRef,\n\t\t\tctx: tokenCtx,\n\t\t})\n\n\t\t// The history half of the subject view. A null config (no subject)\n\t\t// means the composable never queries: the org-wide widget stays a\n\t\t// single-request surface, bit-identical to before.\n\t\tconst completedSource = () => {\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\turl: COMPLETED_RUNS_URL,\n\t\t\t\tmethod: 'GET',\n\t\t\t\tparams: { subject, limit: normaliseLimit(props.content && props.content.limit) },\n\t\t\t}\n\t\t}\n\t\tconst {\n\t\t\tdata: completedData,\n\t\t\tloading: completedLoading,\n\t\t\terror: completedError,\n\t\t\trefetch: refetchCompleted,\n\t\t} = useEndpointSource(completedSource, {\n\t\t\twidgetId: widgetIdRef,\n\t\t\tctx: tokenCtx,\n\t\t})\n\n\t\t// `inject` is re-read in setup so Vue 2.7 and Vue 3 resolve it\n\t\t// identically to the Options `inject` block (CnStatWidget precedent).\n\t\tconst injectedTranslate = inject('cnTranslate', null)\n\n\t\treturn {\n\t\t\tpayload: data,\n\t\t\tloading,\n\t\t\terror,\n\t\t\trefetch,\n\t\t\tcompletedPayload: completedData,\n\t\t\tcompletedLoading,\n\t\t\tcompletedError,\n\t\t\trefetchCompleted,\n\t\t\tresolvedSubject,\n\t\t\tinjectedTranslate,\n\t\t\ttokenCtx,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tpollTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the explicit prop, then the injected\n\t\t * host one, then `@nextcloud/l10n` under the library's own app id.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\ttr() {\n\t\t\tconst fn = this.translate ?? this.injectedTranslate ?? this.cnTranslate\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\treturn (key) => fn(key)\n\t\t\t}\n\t\t\treturn (key) => t('nextcloud-vue', key)\n\t\t},\n\n\t\t/**\n\t\t * The rows to render — the endpoint's bounded page, defensively\n\t\t * re-capped so a wider server default can never overflow the cell.\n\t\t *\n\t\t * @return {Array<object>} The run rows.\n\t\t */\n\t\trows() {\n\t\t\tconst results = (this.payload && this.payload.results) || []\n\t\t\tif (Array.isArray(results) === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn results.slice(0, normaliseLimit(this.content.limit))\n\t\t},\n\n\t\t/**\n\t\t * How many live runs exist beyond the rendered rows.\n\t\t *\n\t\t * Read off the server's `total`, NOT the array length — the point of\n\t\t * the total is to be honest about what the cell could not fit.\n\t\t *\n\t\t * @return {number} The hidden run count (never negative).\n\t\t */\n\t\thiddenCount() {\n\t\t\tconst total = Number((this.payload && this.payload.total) ?? this.rows.length)\n\t\t\tif (Number.isFinite(total) === false) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(0, total - this.rows.length)\n\t\t},\n\n\t\t/** The \"+N more\" line. */\n\t\tmoreLabel() {\n\t\t\treturn this.tr('+{count} more').replace('{count}', String(this.hiddenCount))\n\t\t},\n\n\t\t/** Whether each row shows its status as a pill (`content.statusPill`). */\n\t\tpills() {\n\t\t\treturn this.content.statusPill === true\n\t\t},\n\n\t\t/** The nothing-running line. */\n\t\temptyLabel() {\n\t\t\tconst override = this.content.emptyText\n\t\t\tif (typeof override === 'string' && override !== '') {\n\t\t\t\treturn this.tr(override)\n\t\t\t}\n\t\t\treturn this.tr('No flows are running')\n\t\t},\n\n\t\t/** Whether this placement is scoped to one subject object. */\n\t\thasSubject() {\n\t\t\treturn typeof this.content.subject === 'string' && this.content.subject !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether a configured subject token still waits on the object\n\t\t * context. The widget shows its loading state instead of an empty\n\t\t * line then: \"no runs\" would be a claim about a case it has not\n\t\t * identified yet.\n\t\t *\n\t\t * @return {boolean} True while the subject is configured but unresolved.\n\t\t */\n\t\tsubjectPending() {\n\t\t\treturn this.hasSubject && this.resolvedSubject === null\n\t\t},\n\n\t\t/**\n\t\t * The subject's finished runs — the completed-runs read's bounded\n\t\t * page, re-capped like the live rows.\n\t\t *\n\t\t * @return {Array<object>} The terminal run rows (empty without a subject).\n\t\t */\n\t\tcompletedRows() {\n\t\t\tif (this.hasSubject === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst results = (this.completedPayload && this.completedPayload.results) || []\n\t\t\tif (Array.isArray(results) === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn results.slice(0, normaliseLimit(this.content.limit))\n\t\t},\n\n\t\t/**\n\t\t * How many finished runs exist beyond the rendered history rows, read\n\t\t * off the completed read's honest total.\n\t\t *\n\t\t * @return {number} The hidden finished-run count (never negative).\n\t\t */\n\t\tcompletedHiddenCount() {\n\t\t\tconst total = Number((this.completedPayload && this.completedPayload.total) ?? this.completedRows.length)\n\t\t\tif (Number.isFinite(total) === false) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(0, total - this.completedRows.length)\n\t\t},\n\n\t\t/** The \"+N earlier\" line under the history section. */\n\t\tcompletedMoreLabel() {\n\t\t\treturn this.tr('+{count} earlier').replace('{count}', String(this.completedHiddenCount))\n\t\t},\n\n\t\t/**\n\t\t * Whether this subject has NO runs at all, live or finished. Rendered\n\t\t * as its own line: a case where nothing ever ran reads differently\n\t\t * from a case that is merely quiet right now.\n\t\t *\n\t\t * @return {boolean} True when both reads settled empty for a subject.\n\t\t */\n\t\tneverRan() {\n\t\t\treturn this.hasSubject\n\t\t\t\t&& this.subjectPending === false\n\t\t\t\t&& this.loading === false\n\t\t\t\t&& this.completedLoading === false\n\t\t\t\t&& this.completedError === ''\n\t\t\t\t&& this.rows.length === 0\n\t\t\t\t&& this.completedRows.length === 0\n\t\t},\n\n\t\t/** Whether the history section renders (rows or a failed history read). */\n\t\tshowHistory() {\n\t\t\treturn this.hasSubject\n\t\t\t\t&& this.subjectPending === false\n\t\t\t\t&& (this.completedRows.length > 0 || this.completedError !== '')\n\t\t},\n\n\t\t/** Whether a row click navigates (a `runRoute` or `rowRoute` is configured). */\n\t\tisLinked() {\n\t\t\treturn (typeof this.content.rowRoute === 'string' && this.content.rowRoute !== '')\n\t\t\t\t|| (typeof this.content.runRoute === 'string' && this.content.runRoute !== '')\n\t\t},\n\n\t\t/**\n\t\t * Poll interval in ms, or 0 when polling is off.\n\t\t *\n\t\t * Floored at 5s so a mis-authored `pollSeconds: 0.1` cannot turn a\n\t\t * dashboard into a request storm; `0` remains an explicit opt-out.\n\t\t *\n\t\t * @return {number} The interval in milliseconds.\n\t\t */\n\t\tpollMs() {\n\t\t\tconst raw = this.content.pollSeconds\n\t\t\tconst seconds = (raw === undefined || raw === null) ? 15 : Number(raw)\n\t\t\tif (Number.isFinite(seconds) === false || seconds <= 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(5, seconds) * 1000\n\t\t},\n\t},\n\n\twatch: {\n\t\t'content.headerAction': {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.emitHeader()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.emitHeader()\n\t\tthis.startPolling()\n\t\tdocument.addEventListener('visibilitychange', this.onVisibilityChange)\n\t},\n\n\tbeforeUnmount() {\n\t\tthis.teardown()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Tell the card around the runs what its header shows: the header\n\t\t * action, if any.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitHeader() {\n\t\t\tconst action = this.content && this.content.headerAction\n\t\t\tconst usable = action && typeof action === 'object' && typeof action.label === 'string' && action.label !== ''\n\t\t\t/**\n\t\t\t * @event header The card header's parts: `{ link, note, action, pill }`, `action` being `{ label, icon, run }` or null.\n\t\t\t */\n\t\t\tthis.$emit('header', {\n\t\t\t\tlink: null,\n\t\t\t\tnote: '',\n\t\t\t\taction: usable ? { label: this.tr(action.label), icon: action.icon || '', run: () => this.runHeaderAction() } : null,\n\t\t\t\tpill: null,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Run the header action with the record's tokens resolved, then read the\n\t\t * runs again so a started run shows.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync runHeaderAction() {\n\t\t\tconst { label, icon, ...action } = resolveDeepTokens(this.content.headerAction, this.tokenCtx())\n\t\t\ttry {\n\t\t\t\tconst outcome = await (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t\t: dispatchAction(action, { router: this.$router || null }))\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.refetchAll()\n\t\t},\n\n\t\t/**\n\t\t * Start (or restart) the refetch interval, unless polling is disabled.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartPolling() {\n\t\t\tthis.stopPolling()\n\t\t\tif (this.pollMs === 0 || document.hidden === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.pollTimer = setInterval(() => {\n\t\t\t\tthis.refetchAll()\n\t\t\t}, this.pollMs)\n\t\t},\n\n\t\t/**\n\t\t * Refetch the live read, and the history read when a subject is\n\t\t * configured — a run that finishes between polls must MOVE to the\n\t\t * history section, not vanish from the widget.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trefetchAll() {\n\t\t\tthis.refetch(true)\n\t\t\tif (this.hasSubject) {\n\t\t\t\tthis.refetchCompleted(true)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clear the refetch interval.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstopPolling() {\n\t\t\tif (this.pollTimer !== null) {\n\t\t\t\tclearInterval(this.pollTimer)\n\t\t\t\tthis.pollTimer = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove the timer and the visibility listener.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tteardown() {\n\t\t\tthis.stopPolling()\n\t\t\tdocument.removeEventListener('visibilitychange', this.onVisibilityChange)\n\t\t},\n\n\t\t/**\n\t\t * Pause polling while the tab is hidden; refetch once and resume when\n\t\t * it comes back, so returning to the dashboard shows current state\n\t\t * rather than whatever was true when the tab was backgrounded.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonVisibilityChange() {\n\t\t\tif (document.hidden === true) {\n\t\t\t\tthis.stopPolling()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.refetchAll()\n\t\t\tthis.startPolling()\n\t\t},\n\n\t\t/**\n\t\t * Whether a run's status is terminal — the history half of the\n\t\t * subject view. Drives the hollow-dot / muted-name row treatment.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {boolean} True for a finished run.\n\t\t */\n\t\tisTerminal(run) {\n\t\t\treturn TERMINAL_STATUSES.includes(run && run.status)\n\t\t},\n\n\t\t/**\n\t\t * The human label for a status, falling back to the raw value so an\n\t\t * engine that gains a status still renders something truthful.\n\t\t *\n\t\t * @param {string} status The run status.\n\t\t * @return {string} The label.\n\t\t */\n\t\tstatusLabel(status) {\n\t\t\tconst own = this.content.statusLabels && this.content.statusLabels[status]\n\t\t\tconst key = (typeof own === 'string' && own !== '') ? own : STATUS_LABELS[status]\n\t\t\treturn key ? this.tr(key) : String(status || '')\n\t\t},\n\n\t\t/**\n\t\t * The pill tone of a status: finished well is success, failed is error,\n\t\t * anything still going is info.\n\t\t *\n\t\t * @param {string} status The run status.\n\t\t * @return {string} A CnStatusBadge variant.\n\t\t * @spec openspec/changes/flow-runs-ruled-with-pills/specs/cn-flow-runs-widget/spec.md\n\t\t */\n\t\tstatusVariant(status) {\n\t\t\tif (status === 'completed') {\n\t\t\t\treturn 'success'\n\t\t\t}\n\t\t\tif (status === 'failed' || status === 'dead_letter') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn status === 'stopped' ? 'default' : 'info'\n\t\t},\n\n\t\t/**\n\t\t * The secondary line: status, the step the run sits on, and what\n\t\t * triggered it — whichever of those the run actually carries.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The meta line.\n\t\t */\n\t\tmetaLine(run) {\n\t\t\tconst words = this.content.triggerLabels && this.content.triggerLabels[run.trigger]\n\t\t\tif (typeof words === 'string' && words !== '') {\n\t\t\t\treturn this.tr(words)\n\t\t\t}\n\t\t\tconst parts = this.pills ? [] : [this.statusLabel(run.status)]\n\t\t\tif (run.step) {\n\t\t\t\tparts.push(String(run.step))\n\t\t\t}\n\t\t\tif (run.trigger) {\n\t\t\t\tparts.push(String(run.trigger))\n\t\t\t}\n\t\t\treturn parts.join(' · ')\n\t\t},\n\n\t\t/**\n\t\t * How long the run has been going, as a coarse relative label.\n\t\t *\n\t\t * Coarse on purpose: a dashboard reader wants \"8m\", not a timestamp,\n\t\t * and a second-precision label on a 15s poll would read as stale.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The age label, or '' when the run has no start time.\n\t\t */\n\t\tageLabel(run) {\n\t\t\tconst started = Date.parse(run.created || '')\n\t\t\tif (Number.isFinite(started) === false) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.content.age === 'datetime') {\n\t\t\t\tconst at = new Date(started)\n\t\t\t\tconst pad = (value) => String(value).padStart(2, '0')\n\t\t\t\treturn `${formatBoardDate(at)}, ${pad(at.getHours())}:${pad(at.getMinutes())}`\n\t\t\t}\n\t\t\tconst seconds = Math.max(0, Math.round((Date.now() - started) / 1000))\n\t\t\tif (seconds < 60) {\n\t\t\t\treturn this.tr('now')\n\t\t\t}\n\t\t\tconst minutes = Math.round(seconds / 60)\n\t\t\tif (minutes < 60) {\n\t\t\t\treturn `${minutes}m`\n\t\t\t}\n\t\t\tconst hours = Math.round(minutes / 60)\n\t\t\tif (hours < 24) {\n\t\t\t\treturn `${hours}h`\n\t\t\t}\n\t\t\treturn `${Math.round(hours / 24)}d`\n\t\t},\n\n\t\t/**\n\t\t * The route a run row links to, or null when it links nowhere.\n\t\t *\n\t\t * `runRoute` wins when the row carries a run uuid: on a case page a\n\t\t * click means \"show me THIS run\", and the run uuid is the deep link\n\t\t * the row contract carries. Without a `runRoute` (or on a row with no\n\t\t * uuid) `rowRoute` receives the FLOW id, the surface every\n\t\t * flow-authoring app has.\n\t\t *\n\t\t * The flow id alone answers the wrong question, so the run travels as\n\t\t * `?run=`, the address CnFlowDetail documents its `run` prop as\n\t\t * reading: a `rowRoute` click and a pasted run link open the same\n\t\t * screen.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {object|null} A vue-router location, or null.\n\t\t */\n\t\trunTarget(run) {\n\t\t\tif (this.isLinked === false || !this.$router) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst hasUuid = run.uuid !== undefined && run.uuid !== null && run.uuid !== ''\n\t\t\tconst runRoute = this.content.runRoute\n\t\t\tif (typeof runRoute === 'string' && runRoute !== '' && hasUuid) {\n\t\t\t\treturn { name: runRoute, params: { id: String(run.uuid) } }\n\t\t\t}\n\t\t\tif (typeof this.content.rowRoute !== 'string' || this.content.rowRoute === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst id = run.flowId\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst target = { name: this.content.rowRoute, params: { id: String(id) } }\n\t\t\t// An empty `?run=` is not a deep link; CnFlowDetail's `run` prop\n\t\t\t// defaults to '' so \"no run named\" stays one value.\n\t\t\tif (hasUuid) {\n\t\t\t\ttarget.query = { run: String(run.uuid) }\n\t\t\t}\n\t\t\treturn target\n\t\t},\n\n\t\t/**\n\t\t * The href of a run row's link, or '' when the row links nowhere.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The resolved href.\n\t\t */\n\t\trunHref(run) {\n\t\t\treturn resolveHref(this.runTarget(run), this.$router)\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on a run row's link in-app; modified clicks\n\t\t * are left to the browser.\n\t\t *\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @param {object} run The clicked run row.\n\t\t * @return {void}\n\t\t */\n\t\tonRowClick(event, run) {\n\t\t\tfollowLinkClick(event, this.runTarget(run), this.$router)\n\t\t},\n\t},\n}\n\n/**\n * Clamp a configured row limit into the range the endpoint accepts.\n *\n * @param {number|string|undefined} raw The configured limit.\n * @return {number} A limit between 1 and 50 (default 6).\n */\nfunction normaliseLimit(raw) {\n\tconst n = Number(raw)\n\tif (Number.isFinite(n) === false || n <= 0) {\n\t\treturn 6\n\t}\n\treturn Math.min(50, Math.round(n))\n}\n</script>\n\n<style scoped>\n.cn-flow-runs-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__loading {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 8px 0;\n}\n\n.cn-flow-runs-widget__empty,\n.cn-flow-runs-widget__error,\n.cn-flow-runs-widget__more {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-runs-widget__more {\n\tpadding-top: 4px;\n}\n\n.cn-flow-runs-widget__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__row {\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__row:last-child {\n\tborder-bottom: none;\n}\n\n.cn-flow-runs-widget__row-content {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 6px 0;\n\tmin-width: 0;\n\tcolor: inherit;\n\ttext-decoration: none;\n}\n\na.cn-flow-runs-widget__row-content {\n\tcursor: pointer;\n}\n\n.cn-flow-runs-widget__dot {\n\tflex: 0 0 auto;\n\twidth: 8px;\n\theight: 8px;\n\tborder-radius: 50%;\n\tbackground: var(--color-text-maxcontrast);\n}\n\n/* Executing now — the primary colour, and the only row that animates. */\n.cn-flow-runs-widget__dot--running {\n\tbackground: var(--color-primary-element, #0082c9);\n\tanimation: cn-flow-runs-pulse 1.6s ease-in-out infinite;\n}\n\n.cn-flow-runs-widget__dot--queued {\n\tbackground: var(--color-warning, #c28900);\n}\n\n.cn-flow-runs-widget__dot--suspended {\n\tbackground: var(--color-text-maxcontrast);\n}\n\n/* Terminal rows: the dot is a hollow RING, so live (filled) and finished\n (hollow) never differ by colour alone. The per-status colour still rides\n on the ring's border. */\n.cn-flow-runs-widget__dot--terminal {\n\twidth: 6px;\n\theight: 6px;\n\tbackground: transparent;\n\tborder: 2px solid var(--color-text-maxcontrast);\n}\n\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--completed {\n\tborder-color: var(--color-success, #2d7b41);\n}\n\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--failed,\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--dead_letter {\n\tborder-color: var(--color-error, #d91f2d);\n}\n\n.cn-flow-runs-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\tflex: 1 1 auto;\n}\n\n.cn-flow-runs-widget__name {\n\tfont-weight: 600;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n/* Finished runs read as history: regular weight, muted colour. The hollow\n dot and the section label carry the distinction for anyone who cannot\n rely on colour. */\n.cn-flow-runs-widget__row--terminal .cn-flow-runs-widget__name {\n\tfont-weight: 400;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Must sit AFTER the plain `__name` rule: the compound selector is more\n specific, and stylelint's no-descending-specificity flags the reverse\n order because the cascade then depends on specificity rather than\n source order — the shape that quietly stops working when someone adds\n a competing rule. */\na.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name {\n\ttext-decoration: underline;\n}\n\n.cn-flow-runs-widget__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.cn-flow-runs-widget__age {\n\tflex: 0 0 auto;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\tfont-variant-numeric: tabular-nums;\n}\n\n/* The history section label. Small caps text, not a colour: the section\n boundary must survive monochrome. */\n.cn-flow-runs-widget__history-title {\n\tmargin: 0;\n\tpadding-top: 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\tfont-weight: 600;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.04em;\n}\n\n/* Status pills: each row ruled on top, the name over its meta line, the pill\n and the start moment at the end, as the Dq case boards draw the Flows card. */\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row {\n\tborder-top: 1px solid var(--color-border);\n\tborder-bottom: none;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row-content {\n\tflex-wrap: wrap;\n\tgap: 6px 16px;\n\tpadding: 11px 0;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__body {\n\tflex: 1 1 260px;\n\tgap: 2px;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__name,\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row--terminal .cn-flow-runs-widget__name {\n\tfont-size: 15px;\n\tfont-weight: 500;\n\tline-height: normal;\n\tcolor: var(--color-main-text);\n\twhite-space: normal;\n}\n\n/* The name and the meta on the font's own leading: a row 58px high, as the\n boards draw it (r32: 67). */\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__meta {\n\tfont-size: 13px;\n\tline-height: normal;\n\twhite-space: normal;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__age {\n\tflex: 0 0 104px;\n\tfont-size: 13px;\n\ttext-align: end;\n}\n\n@keyframes cn-flow-runs-pulse {\n\t0%, 100% { opacity: 1; }\n\t50% { opacity: 0.35; }\n}\n\n/* Respect a reduced-motion preference: the pulse is decoration, and the dot\n colour already carries the status. */\n@media (prefers-reduced-motion: reduce) {\n\t.cn-flow-runs-widget__dot--running {\n\t\tanimation: none;\n\t}\n}\n</style>\n"],"names":["CnStatusBadge","t"],"mappings":";;;;;;;;;;;AAgIA;;AAEC;;AAEA;AACA;;AAEA;;;AAGD,MAAM,eAAc,GAAI,0CAAwC;;AAEhE;;;AAGC;;AAEA;;;AAGD,MAAM,kBAAmB,GAAE,6CAA2C;;AAEtE;;;;AAIC;;;AAGD,MAAM,gBAAgB;AACrB,CAAA,OAAO,EAAE,SAA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Z;;AAED;;AAEC;;AAEA;;EAED,OAAO,CAAC,GAAG,EAAE;GACZ,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAA;GACpD;;AAED;;AAEC;AACA;AACA;AACA;;;AAGD,EAAA,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE;GACtB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,EAAA;GACxD;EACD;AACF,EAAA;;AAEA;;AAEC;;AAEA;;AAED,SAAS,cAAc,CAAC,GAAG,EAAE;AAC5B,CAAA,MAAM,IAAI,MAAM,CAAC,GAAG,EAAA;AACpB,CAAA,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAE,KAAI,KAAI,IAAK,CAAA,IAAK,CAAC,EAAE;AAC3C,EAAA,OAAO,CAAA;AACR,EAAA;AACA,CAAA,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AAClC;;;;"}
|
|
1
|
+
{"version":3,"file":"CnFlowRunsWidget.vue2.js","sources":["../../../../src/components/CnFlowRunsWidget/CnFlowRunsWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-flow-runs-widget\" :class=\"{ 'cn-flow-runs-widget--pills': pills }\">\n\t\t<!-- One quiet line on failure, never a leaked axios status string\n\t\t (ADR-062). The real error goes to the console. -->\n\t\t<p v-if=\"error\" class=\"cn-flow-runs-widget__error\">\n\t\t\t{{ tr('Could not load the running flows') }}\n\t\t</p>\n\t\t<!-- A configured-but-unresolved subject token also shows the loading\n\t\t state: \"no runs\" would be a claim about a case the widget has not\n\t\t identified yet. -->\n\t\t<div v-else-if=\"(loading || subjectPending) && rows.length === 0\" class=\"cn-flow-runs-widget__loading\">\n\t\t\t<NcLoadingIcon :size=\"24\" />\n\t\t</div>\n\t\t<!-- A subject where nothing EVER ran gets its own line: distinct from\n\t\t a case that is merely quiet right now. -->\n\t\t<p v-else-if=\"neverRan\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t{{ tr('No flows have run yet') }}\n\t\t</p>\n\t\t<!-- Nothing running is the NORMAL state for this widget, not an\n\t\t error and not a void: one muted line, no illustration. -->\n\t\t<p v-else-if=\"rows.length === 0 && showHistory === false\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<template v-else>\n\t\t\t<p v-if=\"rows.length === 0 && content.quietLineWithHistory !== false\" class=\"cn-flow-runs-widget__empty\">\n\t\t\t\t{{ emptyLabel }}\n\t\t\t</p>\n\t\t\t<ul v-else-if=\"rows.length > 0\" class=\"cn-flow-runs-widget__list\">\n\t\t\t\t<li\n\t\t\t\t\tv-for=\"(run, index) in rows\"\n\t\t\t\t\t:key=\"run.uuid || `row-${index}`\"\n\t\t\t\t\tclass=\"cn-flow-runs-widget__row\"\n\t\t\t\t\t:class=\"{ 'cn-flow-runs-widget__row--linked': isLinked }\"\n\t\t\t\t\t:data-status=\"run.status\">\n\t\t\t\t\t<component\n\t\t\t\t\t\t:is=\"runHref(run) ? 'a' : 'div'\"\n\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row-content\"\n\t\t\t\t\t\t:href=\"runHref(run) || undefined\"\n\t\t\t\t\t\t@click=\"onRowClick($event, run)\">\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-if=\"!pills\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__dot\"\n\t\t\t\t\t\t\t:class=\"`cn-flow-runs-widget__dot--${run.status}`\"\n\t\t\t\t\t\t\t:title=\"statusLabel(run.status)\" />\n\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__body\">\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__name\">{{ run.flowName }}</span>\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__meta\">{{ metaLine(run) }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\tv-if=\"pills\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__pill\"\n\t\t\t\t\t\t\t:label=\"statusLabel(run.status)\"\n\t\t\t\t\t\t\t:variant=\"statusVariant(run.status)\"\n\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__age\">{{ ageLabel(run) }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<!-- The remainder is a count, never a scrollbar: the widget shows\n\t\t\t what fits its cell and states the honest total (ADR-062). -->\n\t\t\t<p v-if=\"hiddenCount > 0\" class=\"cn-flow-runs-widget__more\">\n\t\t\t\t{{ moreLabel }}\n\t\t\t</p>\n\t\t\t<!-- The subject's run history. Terminal rows sit under their own\n\t\t\t labelled section with a hollow dot and a muted name, so live\n\t\t\t and finished never rely on colour alone to tell apart. -->\n\t\t\t<template v-if=\"showHistory\">\n\t\t\t\t<p v-if=\"content.historyTitle !== false\" class=\"cn-flow-runs-widget__history-title\">\n\t\t\t\t\t{{ tr('Earlier runs') }}\n\t\t\t\t</p>\n\t\t\t\t<p v-if=\"completedError\" class=\"cn-flow-runs-widget__error\">\n\t\t\t\t\t{{ tr('Could not load the run history') }}\n\t\t\t\t</p>\n\t\t\t\t<ul v-else class=\"cn-flow-runs-widget__list\">\n\t\t\t\t\t<li\n\t\t\t\t\t\tv-for=\"(run, index) in completedRows\"\n\t\t\t\t\t\t:key=\"run.uuid || `completed-${index}`\"\n\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row cn-flow-runs-widget__row--terminal\"\n\t\t\t\t\t\t:class=\"{ 'cn-flow-runs-widget__row--linked': isLinked }\"\n\t\t\t\t\t\t:data-status=\"run.status\">\n\t\t\t\t\t\t<component\n\t\t\t\t\t\t\t:is=\"runHref(run) ? 'a' : 'div'\"\n\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__row-content\"\n\t\t\t\t\t\t\t:href=\"runHref(run) || undefined\"\n\t\t\t\t\t\t\t@click=\"onRowClick($event, run)\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tv-if=\"!pills\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__dot cn-flow-runs-widget__dot--terminal\"\n\t\t\t\t\t\t\t\t:class=\"`cn-flow-runs-widget__dot--${run.status}`\"\n\t\t\t\t\t\t\t\t:title=\"statusLabel(run.status)\" />\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__body\">\n\t\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__name\">{{ run.flowName }}</span>\n\t\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__meta\">{{ metaLine(run) }}</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\t\tv-if=\"pills\"\n\t\t\t\t\t\t\t\tclass=\"cn-flow-runs-widget__pill\"\n\t\t\t\t\t\t\t\t:label=\"statusLabel(run.status)\"\n\t\t\t\t\t\t\t\t:variant=\"statusVariant(run.status)\"\n\t\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t\t<span class=\"cn-flow-runs-widget__age\">{{ ageLabel(run) }}</span>\n\t\t\t\t\t\t</component>\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t\t<p v-if=\"completedError === '' && completedHiddenCount > 0\" class=\"cn-flow-runs-widget__more\">\n\t\t\t\t\t{{ completedMoreLabel }}\n\t\t\t\t</p>\n\t\t\t</template>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport { computed, inject, ref } from 'vue'\nimport { useEndpointSource } from '../../composables/useEndpointSource.js'\nimport { dispatchAction } from '../../utils/actionsDispatcher.js'\nimport { formatBoardDate } from '../../utils/boardDate.js'\nimport { resolveObjectTokenContext } from '../../utils/detailObjectContext.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { resolveDeepTokens, resolveFilterValue } from '../../utils/resolveFilterTokens.js'\nimport { CnStatusBadge } from '../CnStatusBadge/index.js'\n\n/**\n * The OpenRegister endpoint that lists the caller's live flow runs.\n *\n * Every Conduction app runs its flows on OpenRegister's ONE flow engine\n * (ADR-065), so \"what is running right now\" has a single answer for the whole\n * instance and this widget can be app-agnostic: an app places it and gets its\n * users' live runs without shipping a controller, a store or a view.\n *\n * @type {string}\n */\nconst ACTIVE_RUNS_URL = '/apps/openregister/api/flow-runs/active'\n\n/**\n * The OpenRegister endpoint that lists the finished runs for ONE subject\n * object. Subject-required by contract (openregister change\n * `flow-runs-subject-scope`): there is no org-wide \"all finished runs\" here,\n * so the widget only ever calls it with a resolved subject uuid.\n *\n * @type {string}\n */\nconst COMPLETED_RUNS_URL = '/apps/openregister/api/flow-runs/completed'\n\n/**\n * Statuses, in the order a person reads them: what is executing, what is\n * queued behind it, what is parked waiting on a timer or a child run, and\n * then the terminal set a subject's run history renders.\n *\n * @type {Record<string, string>}\n */\nconst STATUS_LABELS = {\n\trunning: 'Running',\n\tqueued: 'Queued',\n\tsuspended: 'Waiting',\n\tcompleted: 'Completed',\n\tstopped: 'Stopped',\n\tfailed: 'Failed',\n\tdead_letter: 'Failed after retries',\n}\n\n/**\n * The terminal statuses (FlowRun::TERMINAL on the OpenRegister side). Rows\n * with one of these are HISTORY: rendered in the earlier-runs section with a\n * hollow dot and a muted name, never mixed into the live list.\n *\n * @type {string[]}\n */\nconst TERMINAL_STATUSES = ['completed', 'stopped', 'failed', 'dead_letter']\n\n/**\n * CnFlowRunsWidget — the live flow runs for the viewer's organisation.\n *\n * Reads OpenRegister's `flow-runs/active` surface (non-terminal runs, scoped\n * server-side to the caller's organisation) and renders one row per run: its\n * flow's NAME, what triggered it, the step it currently sits on, and how long\n * it has been going. Placed by its registry type key `flow-runs`, so any app\n * gets the widget from a single manifest placement:\n *\n * ```js\n * { id: 'running-flows', type: 'flow-runs', title: 'Running flows',\n * content: { limit: 6, pollSeconds: 15, rowRoute: 'GraphDetail' } }\n * ```\n *\n * Why it polls: a run is a moving thing. A widget titled \"running flows\" that\n * only reflects the moment the dashboard mounted would be wrong within\n * seconds and would look identical to being right — so it refetches on an\n * interval, and stops while the tab is hidden so an idle dashboard is not a\n * background request loop.\n *\n * Statuses shown are ALL the non-terminal ones (queued / running / suspended),\n * because filtering to literally `running` would show an empty widget almost\n * always: a run holds that status only during a worker pass, while queued and\n * suspended are where live runs actually wait. See FlowRun::ACTIVE.\n *\n * Subject mode: a `content.subject` (a subject object uuid, or the\n * `@objectId` / `@object.<field>` token a detail placement authors) narrows\n * the live list to one case AND adds that case's finished runs below it, so\n * a flow that completed does not look like nothing ever happened. Tokens\n * resolve against the detail surface's injected object context, the same\n * route CnStatWidget and CnChartWidget take.\n *\n * @spec openspec/changes/cn-flow-runs-widget/specs/cn-flow-runs-widget/spec.md\n * @spec openspec/changes/cn-flow-runs-widget-subject/specs/cn-flow-runs-widget-subject/spec.md\n */\nexport default {\n\tname: 'CnFlowRunsWidget',\n\n\tcomponents: {\n\t\tCnStatusBadge,\n\t\tNcLoadingIcon,\n\t},\n\n\tinject: {\n\t\t/**\n\t\t * Host translate function, provided by CnAppRoot (identity by default)\n\t\t * so a library string localises through the consuming app's l10n.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's action dispatcher (CnPageRenderer), for `headerAction`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's persisted configuration blob.\n\t\t *\n\t\t * - `limit` — rows to request AND show (1–50, default 6). The total is\n\t\t * always reported honestly regardless of this cap.\n\t\t * - `pollSeconds` — refetch interval (default 15; `0` disables polling).\n\t\t * - `rowRoute` — vue-router route NAME to open on a row click, receiving\n\t\t * the run's flow id as `:id` and the clicked run's uuid as `?run=`, so\n\t\t * the flow opens with that run inspected rather than merely open.\n\t\t * Omitted = rows are not clickable, which is correct for an app that\n\t\t * has no flow-detail page.\n\t\t * - `runRoute` — vue-router route NAME to open on a row click, receiving\n\t\t * the RUN's uuid as `:id`. Takes precedence over `rowRoute`; a row\n\t\t * without a run uuid falls back to the `rowRoute` flow-id behaviour.\n\t\t * - `subject` — a subject object uuid, or an object-context token\n\t\t * (`@objectId`, `@object.<field>`) a detail placement authors. When\n\t\t * set, the live list is filtered to that subject server-side and the\n\t\t * subject's finished runs render below it. Absent = today's org-wide\n\t\t * widget, unchanged.\n\t\t * - `emptyText` — override for the \"nothing running\" line.\n\t\t * - `quietLineWithHistory` — `false` leaves out the \"nothing running\"\n\t\t * line while the subject has finished runs to list.\n\t\t * - `historyTitle` — `false` leaves out the \"Earlier runs\" heading.\n\t\t * - `statusPill` — `true` shows the status as a pill on each row\n\t\t * (no dot, and the meta line leaves the status out), rows ruled.\n\t\t * - `statusLabels` — words per status (`{ completed: 'Succeeded' }`),\n\t\t * translated, over the built-in ones.\n\t\t * - `triggerLabels` — the meta line per trigger in words\n\t\t * (`{ 'object.created': 'Started when the case was created' }`), translated.\n\t\t * - `age` — `'datetime'` shows when the run started (\"3 okt, 14:32\")\n\t\t * instead of how long ago (\"13d\").\n\t\t * - `headerAction` — an action descriptor drawn in the card header\n\t\t * (`{ label, icon?, ...action }`, \"Flow uitvoeren\"), reported through\n\t\t * the `header` event and dispatched with the page's dispatcher; its\n\t\t * tokens resolve against the record. The runs are read again after it.\n\t\t *\n\t\t * @type {{limit?: number, pollSeconds?: number, rowRoute?: string, runRoute?: string, subject?: string, emptyText?: string, title?: string}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Widget placement id, so the per-widget Refresh action\n\t\t * (`cn:widget:refresh`) reaches this instance's fetch.\n\t\t */\n\t\twidgetId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Translate function. Falls back to the injected `cnTranslate`.\n\t\t * Provide explicitly when mounting outside a CnAppRoot ancestor.\n\t\t *\n\t\t * @type {((key: string) => string)|null}\n\t\t */\n\t\ttranslate: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tsetup(props) {\n\t\t// The shared endpoint engine owns request dedup, the short-TTL cache\n\t\t// and the cn:page:refresh / cn:widget:refresh subscriptions — the same\n\t\t// binding CnStatWidget's endpoint mode uses, so a page-level Refresh\n\t\t// updates this widget with everything else on the page.\n\t\tconst widgetIdRef = ref(props.widgetId)\n\n\t\t// The detail surface's object context, injected the same way the other\n\t\t// endpoint-bound widgets (stat / chart / audit-trail) receive it, so a\n\t\t// `subject: '@objectId'` placement binds the CURRENT object without the\n\t\t// manifest hardcoding a uuid. Null on plain dashboards — the token then\n\t\t// stays unresolved and the endpoint engine's `blocked` semantics hold\n\t\t// the fetch instead of sending a literal `@objectId` to the server.\n\t\tconst objectCtxRaw = inject('cnObjectContext', null)\n\t\tconst detailCtxRaw = inject('cnDetailObjectContext', null)\n\t\tconst tokenCtx = () => ({\n\t\t\tworkspace: {},\n\t\t\tconfig: {},\n\t\t\t...(resolveObjectTokenContext(objectCtxRaw, detailCtxRaw) || {}),\n\t\t})\n\n\t\tconst configuredSubject = () => {\n\t\t\tconst subject = props.content && props.content.subject\n\t\t\treturn (typeof subject === 'string' && subject !== '') ? subject : ''\n\t\t}\n\n\t\t/**\n\t\t * The subject uuid after token resolution: `''` when no subject is\n\t\t * configured, `null` while a token still waits on the object context,\n\t\t * else the concrete uuid.\n\t\t */\n\t\tconst resolvedSubject = computed(() => {\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst value = resolveFilterValue(subject, tokenCtx())\n\t\t\tif (typeof value === 'string' && value.charAt(0) === '@') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (value === undefined || value === null) ? null : String(value)\n\t\t})\n\n\t\tconst source = () => {\n\t\t\tconst params = { limit: normaliseLimit(props.content && props.content.limit) }\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject !== '') {\n\t\t\t\tparams.subject = subject\n\t\t\t}\n\t\t\treturn { url: ACTIVE_RUNS_URL, method: 'GET', params }\n\t\t}\n\t\tconst { data, loading, error, refetch } = useEndpointSource(source, {\n\t\t\twidgetId: widgetIdRef,\n\t\t\tctx: tokenCtx,\n\t\t})\n\n\t\t// The history half of the subject view. A null config (no subject)\n\t\t// means the composable never queries: the org-wide widget stays a\n\t\t// single-request surface, bit-identical to before.\n\t\tconst completedSource = () => {\n\t\t\tconst subject = configuredSubject()\n\t\t\tif (subject === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\turl: COMPLETED_RUNS_URL,\n\t\t\t\tmethod: 'GET',\n\t\t\t\tparams: { subject, limit: normaliseLimit(props.content && props.content.limit) },\n\t\t\t}\n\t\t}\n\t\tconst {\n\t\t\tdata: completedData,\n\t\t\tloading: completedLoading,\n\t\t\terror: completedError,\n\t\t\trefetch: refetchCompleted,\n\t\t} = useEndpointSource(completedSource, {\n\t\t\twidgetId: widgetIdRef,\n\t\t\tctx: tokenCtx,\n\t\t})\n\n\t\t// `inject` is re-read in setup so Vue 2.7 and Vue 3 resolve it\n\t\t// identically to the Options `inject` block (CnStatWidget precedent).\n\t\tconst injectedTranslate = inject('cnTranslate', null)\n\n\t\treturn {\n\t\t\tpayload: data,\n\t\t\tloading,\n\t\t\terror,\n\t\t\trefetch,\n\t\t\tcompletedPayload: completedData,\n\t\t\tcompletedLoading,\n\t\t\tcompletedError,\n\t\t\trefetchCompleted,\n\t\t\tresolvedSubject,\n\t\t\tinjectedTranslate,\n\t\t\ttokenCtx,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tpollTimer: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Effective translate function: the explicit prop, then the injected\n\t\t * host one, then `@nextcloud/l10n` under the library's own app id.\n\t\t *\n\t\t * @return {(key: string) => string}\n\t\t */\n\t\ttr() {\n\t\t\tconst fn = this.translate ?? this.injectedTranslate ?? this.cnTranslate\n\t\t\tif (typeof fn === 'function') {\n\t\t\t\treturn (key) => fn(key)\n\t\t\t}\n\t\t\treturn (key) => t('nextcloud-vue', key)\n\t\t},\n\n\t\t/**\n\t\t * The rows to render — the endpoint's bounded page, defensively\n\t\t * re-capped so a wider server default can never overflow the cell.\n\t\t *\n\t\t * @return {Array<object>} The run rows.\n\t\t */\n\t\trows() {\n\t\t\tconst results = (this.payload && this.payload.results) || []\n\t\t\tif (Array.isArray(results) === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn results.slice(0, normaliseLimit(this.content.limit))\n\t\t},\n\n\t\t/**\n\t\t * How many live runs exist beyond the rendered rows.\n\t\t *\n\t\t * Read off the server's `total`, NOT the array length — the point of\n\t\t * the total is to be honest about what the cell could not fit.\n\t\t *\n\t\t * @return {number} The hidden run count (never negative).\n\t\t */\n\t\thiddenCount() {\n\t\t\tconst total = Number((this.payload && this.payload.total) ?? this.rows.length)\n\t\t\tif (Number.isFinite(total) === false) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(0, total - this.rows.length)\n\t\t},\n\n\t\t/** The \"+N more\" line. */\n\t\tmoreLabel() {\n\t\t\treturn this.tr('+{count} more').replace('{count}', String(this.hiddenCount))\n\t\t},\n\n\t\t/** Whether each row shows its status as a pill (`content.statusPill`). */\n\t\tpills() {\n\t\t\treturn this.content.statusPill === true\n\t\t},\n\n\t\t/** The nothing-running line. */\n\t\temptyLabel() {\n\t\t\tconst override = this.content.emptyText\n\t\t\tif (typeof override === 'string' && override !== '') {\n\t\t\t\treturn this.tr(override)\n\t\t\t}\n\t\t\treturn this.tr('No flows are running')\n\t\t},\n\n\t\t/** Whether this placement is scoped to one subject object. */\n\t\thasSubject() {\n\t\t\treturn typeof this.content.subject === 'string' && this.content.subject !== ''\n\t\t},\n\n\t\t/**\n\t\t * Whether a configured subject token still waits on the object\n\t\t * context. The widget shows its loading state instead of an empty\n\t\t * line then: \"no runs\" would be a claim about a case it has not\n\t\t * identified yet.\n\t\t *\n\t\t * @return {boolean} True while the subject is configured but unresolved.\n\t\t */\n\t\tsubjectPending() {\n\t\t\treturn this.hasSubject && this.resolvedSubject === null\n\t\t},\n\n\t\t/**\n\t\t * The subject's finished runs — the completed-runs read's bounded\n\t\t * page, re-capped like the live rows.\n\t\t *\n\t\t * @return {Array<object>} The terminal run rows (empty without a subject).\n\t\t */\n\t\tcompletedRows() {\n\t\t\tif (this.hasSubject === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tconst results = (this.completedPayload && this.completedPayload.results) || []\n\t\t\tif (Array.isArray(results) === false) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn results.slice(0, normaliseLimit(this.content.limit))\n\t\t},\n\n\t\t/**\n\t\t * How many finished runs exist beyond the rendered history rows, read\n\t\t * off the completed read's honest total.\n\t\t *\n\t\t * @return {number} The hidden finished-run count (never negative).\n\t\t */\n\t\tcompletedHiddenCount() {\n\t\t\tconst total = Number((this.completedPayload && this.completedPayload.total) ?? this.completedRows.length)\n\t\t\tif (Number.isFinite(total) === false) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(0, total - this.completedRows.length)\n\t\t},\n\n\t\t/** The \"+N earlier\" line under the history section. */\n\t\tcompletedMoreLabel() {\n\t\t\treturn this.tr('+{count} earlier').replace('{count}', String(this.completedHiddenCount))\n\t\t},\n\n\t\t/**\n\t\t * Whether this subject has NO runs at all, live or finished. Rendered\n\t\t * as its own line: a case where nothing ever ran reads differently\n\t\t * from a case that is merely quiet right now.\n\t\t *\n\t\t * @return {boolean} True when both reads settled empty for a subject.\n\t\t */\n\t\tneverRan() {\n\t\t\treturn this.hasSubject\n\t\t\t\t&& this.subjectPending === false\n\t\t\t\t&& this.loading === false\n\t\t\t\t&& this.completedLoading === false\n\t\t\t\t&& this.completedError === ''\n\t\t\t\t&& this.rows.length === 0\n\t\t\t\t&& this.completedRows.length === 0\n\t\t},\n\n\t\t/** Whether the history section renders (rows or a failed history read). */\n\t\tshowHistory() {\n\t\t\treturn this.hasSubject\n\t\t\t\t&& this.subjectPending === false\n\t\t\t\t&& (this.completedRows.length > 0 || this.completedError !== '')\n\t\t},\n\n\t\t/** Whether a row click navigates (a `runRoute` or `rowRoute` is configured). */\n\t\tisLinked() {\n\t\t\treturn (typeof this.content.rowRoute === 'string' && this.content.rowRoute !== '')\n\t\t\t\t|| (typeof this.content.runRoute === 'string' && this.content.runRoute !== '')\n\t\t},\n\n\t\t/**\n\t\t * Poll interval in ms, or 0 when polling is off.\n\t\t *\n\t\t * Floored at 5s so a mis-authored `pollSeconds: 0.1` cannot turn a\n\t\t * dashboard into a request storm; `0` remains an explicit opt-out.\n\t\t *\n\t\t * @return {number} The interval in milliseconds.\n\t\t */\n\t\tpollMs() {\n\t\t\tconst raw = this.content.pollSeconds\n\t\t\tconst seconds = (raw === undefined || raw === null) ? 15 : Number(raw)\n\t\t\tif (Number.isFinite(seconds) === false || seconds <= 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn Math.max(5, seconds) * 1000\n\t\t},\n\t},\n\n\twatch: {\n\t\t'content.headerAction': {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.emitHeader()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.emitHeader()\n\t\tthis.startPolling()\n\t\tdocument.addEventListener('visibilitychange', this.onVisibilityChange)\n\t},\n\n\tbeforeUnmount() {\n\t\tthis.teardown()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Tell the card around the runs what its header shows: the header\n\t\t * action, if any.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\temitHeader() {\n\t\t\tconst action = this.content && this.content.headerAction\n\t\t\tconst usable = action && typeof action === 'object' && typeof action.label === 'string' && action.label !== ''\n\t\t\t/**\n\t\t\t * @event header The card header's parts: `{ link, note, action, pill }`, `action` being `{ label, icon, run }` or null.\n\t\t\t */\n\t\t\tthis.$emit('header', {\n\t\t\t\tlink: null,\n\t\t\t\tnote: '',\n\t\t\t\taction: usable ? { label: this.tr(action.label), icon: action.icon || '', run: () => this.runHeaderAction() } : null,\n\t\t\t\tpill: null,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Run the header action with the record's tokens resolved, then read the\n\t\t * runs again so a started run shows.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync runHeaderAction() {\n\t\t\tconst { label, icon, ...action } = resolveDeepTokens(this.content.headerAction, this.tokenCtx())\n\t\t\ttry {\n\t\t\t\tconst outcome = await (typeof this.cnDispatchAction === 'function'\n\t\t\t\t\t? this.cnDispatchAction(action)\n\t\t\t\t\t: dispatchAction(action, { router: this.$router || null }))\n\t\t\t\tif (outcome === false) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.refetchAll()\n\t\t},\n\n\t\t/**\n\t\t * Start (or restart) the refetch interval, unless polling is disabled.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstartPolling() {\n\t\t\tthis.stopPolling()\n\t\t\tif (this.pollMs === 0 || document.hidden === true) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.pollTimer = setInterval(() => {\n\t\t\t\tthis.refetchAll()\n\t\t\t}, this.pollMs)\n\t\t},\n\n\t\t/**\n\t\t * Refetch the live read, and the history read when a subject is\n\t\t * configured — a run that finishes between polls must MOVE to the\n\t\t * history section, not vanish from the widget.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trefetchAll() {\n\t\t\tthis.refetch(true)\n\t\t\tif (this.hasSubject) {\n\t\t\t\tthis.refetchCompleted(true)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clear the refetch interval.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tstopPolling() {\n\t\t\tif (this.pollTimer !== null) {\n\t\t\t\tclearInterval(this.pollTimer)\n\t\t\t\tthis.pollTimer = null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove the timer and the visibility listener.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tteardown() {\n\t\t\tthis.stopPolling()\n\t\t\tdocument.removeEventListener('visibilitychange', this.onVisibilityChange)\n\t\t},\n\n\t\t/**\n\t\t * Pause polling while the tab is hidden; refetch once and resume when\n\t\t * it comes back, so returning to the dashboard shows current state\n\t\t * rather than whatever was true when the tab was backgrounded.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonVisibilityChange() {\n\t\t\tif (document.hidden === true) {\n\t\t\t\tthis.stopPolling()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.refetchAll()\n\t\t\tthis.startPolling()\n\t\t},\n\n\t\t/**\n\t\t * Whether a run's status is terminal — the history half of the\n\t\t * subject view. Drives the hollow-dot / muted-name row treatment.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {boolean} True for a finished run.\n\t\t */\n\t\tisTerminal(run) {\n\t\t\treturn TERMINAL_STATUSES.includes(run && run.status)\n\t\t},\n\n\t\t/**\n\t\t * The human label for a status, falling back to the raw value so an\n\t\t * engine that gains a status still renders something truthful.\n\t\t *\n\t\t * @param {string} status The run status.\n\t\t * @return {string} The label.\n\t\t */\n\t\tstatusLabel(status) {\n\t\t\tconst own = this.content.statusLabels && this.content.statusLabels[status]\n\t\t\tconst key = (typeof own === 'string' && own !== '') ? own : STATUS_LABELS[status]\n\t\t\treturn key ? this.tr(key) : String(status || '')\n\t\t},\n\n\t\t/**\n\t\t * The pill tone of a status: finished well is success, failed is error,\n\t\t * anything still going is info.\n\t\t *\n\t\t * @param {string} status The run status.\n\t\t * @return {string} A CnStatusBadge variant.\n\t\t * @spec openspec/changes/flow-runs-ruled-with-pills/specs/cn-flow-runs-widget/spec.md\n\t\t */\n\t\tstatusVariant(status) {\n\t\t\tif (status === 'completed') {\n\t\t\t\treturn 'success'\n\t\t\t}\n\t\t\tif (status === 'failed' || status === 'dead_letter') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn status === 'stopped' ? 'default' : 'info'\n\t\t},\n\n\t\t/**\n\t\t * The secondary line: status, the step the run sits on, and what\n\t\t * triggered it — whichever of those the run actually carries.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The meta line.\n\t\t */\n\t\tmetaLine(run) {\n\t\t\tconst words = this.content.triggerLabels && this.content.triggerLabels[run.trigger]\n\t\t\tif (typeof words === 'string' && words !== '') {\n\t\t\t\treturn this.tr(words)\n\t\t\t}\n\t\t\tconst parts = this.pills ? [] : [this.statusLabel(run.status)]\n\t\t\tif (run.step) {\n\t\t\t\tparts.push(String(run.step))\n\t\t\t}\n\t\t\tif (run.trigger) {\n\t\t\t\tparts.push(String(run.trigger))\n\t\t\t}\n\t\t\treturn parts.join(' · ')\n\t\t},\n\n\t\t/**\n\t\t * How long the run has been going, as a coarse relative label.\n\t\t *\n\t\t * Coarse on purpose: a dashboard reader wants \"8m\", not a timestamp,\n\t\t * and a second-precision label on a 15s poll would read as stale.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The age label, or '' when the run has no start time.\n\t\t */\n\t\tageLabel(run) {\n\t\t\tconst started = Date.parse(run.created || '')\n\t\t\tif (Number.isFinite(started) === false) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.content.age === 'datetime') {\n\t\t\t\tconst at = new Date(started)\n\t\t\t\tconst pad = (value) => String(value).padStart(2, '0')\n\t\t\t\treturn `${formatBoardDate(at)}, ${pad(at.getHours())}:${pad(at.getMinutes())}`\n\t\t\t}\n\t\t\tconst seconds = Math.max(0, Math.round((Date.now() - started) / 1000))\n\t\t\tif (seconds < 60) {\n\t\t\t\treturn this.tr('now')\n\t\t\t}\n\t\t\tconst minutes = Math.round(seconds / 60)\n\t\t\tif (minutes < 60) {\n\t\t\t\treturn `${minutes}m`\n\t\t\t}\n\t\t\tconst hours = Math.round(minutes / 60)\n\t\t\tif (hours < 24) {\n\t\t\t\treturn `${hours}h`\n\t\t\t}\n\t\t\treturn `${Math.round(hours / 24)}d`\n\t\t},\n\n\t\t/**\n\t\t * The route a run row links to, or null when it links nowhere.\n\t\t *\n\t\t * `runRoute` wins when the row carries a run uuid: on a case page a\n\t\t * click means \"show me THIS run\", and the run uuid is the deep link\n\t\t * the row contract carries. Without a `runRoute` (or on a row with no\n\t\t * uuid) `rowRoute` receives the FLOW id, the surface every\n\t\t * flow-authoring app has.\n\t\t *\n\t\t * The flow id alone answers the wrong question, so the run travels as\n\t\t * `?run=`, the address CnFlowDetail documents its `run` prop as\n\t\t * reading: a `rowRoute` click and a pasted run link open the same\n\t\t * screen.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {object|null} A vue-router location, or null.\n\t\t */\n\t\trunTarget(run) {\n\t\t\tif (this.isLinked === false || !this.$router) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst hasUuid = run.uuid !== undefined && run.uuid !== null && run.uuid !== ''\n\t\t\tconst runRoute = this.content.runRoute\n\t\t\tif (typeof runRoute === 'string' && runRoute !== '' && hasUuid) {\n\t\t\t\treturn { name: runRoute, params: { id: String(run.uuid) } }\n\t\t\t}\n\t\t\tif (typeof this.content.rowRoute !== 'string' || this.content.rowRoute === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst id = run.flowId\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst target = { name: this.content.rowRoute, params: { id: String(id) } }\n\t\t\t// An empty `?run=` is not a deep link; CnFlowDetail's `run` prop\n\t\t\t// defaults to '' so \"no run named\" stays one value.\n\t\t\tif (hasUuid) {\n\t\t\t\ttarget.query = { run: String(run.uuid) }\n\t\t\t}\n\t\t\treturn target\n\t\t},\n\n\t\t/**\n\t\t * The href of a run row's link, or '' when the row links nowhere.\n\t\t *\n\t\t * @param {object} run The run row.\n\t\t * @return {string} The resolved href.\n\t\t */\n\t\trunHref(run) {\n\t\t\treturn resolveHref(this.runTarget(run), this.$router)\n\t\t},\n\n\t\t/**\n\t\t * Route a plain click on a run row's link in-app; modified clicks\n\t\t * are left to the browser.\n\t\t *\n\t\t * @param {MouseEvent} event The click event.\n\t\t * @param {object} run The clicked run row.\n\t\t * @return {void}\n\t\t */\n\t\tonRowClick(event, run) {\n\t\t\tfollowLinkClick(event, this.runTarget(run), this.$router)\n\t\t},\n\t},\n}\n\n/**\n * Clamp a configured row limit into the range the endpoint accepts.\n *\n * @param {number|string|undefined} raw The configured limit.\n * @return {number} A limit between 1 and 50 (default 6).\n */\nfunction normaliseLimit(raw) {\n\tconst n = Number(raw)\n\tif (Number.isFinite(n) === false || n <= 0) {\n\t\treturn 6\n\t}\n\treturn Math.min(50, Math.round(n))\n}\n</script>\n\n<style scoped>\n.cn-flow-runs-widget {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__loading {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 8px 0;\n}\n\n.cn-flow-runs-widget__empty,\n.cn-flow-runs-widget__error,\n.cn-flow-runs-widget__more {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-flow-runs-widget__more {\n\tpadding-top: 4px;\n}\n\n.cn-flow-runs-widget__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__row {\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 0;\n}\n\n.cn-flow-runs-widget__row:last-child {\n\tborder-bottom: none;\n}\n\n.cn-flow-runs-widget__row-content {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 6px 0;\n\tmin-width: 0;\n\tcolor: inherit;\n\ttext-decoration: none;\n}\n\na.cn-flow-runs-widget__row-content {\n\tcursor: pointer;\n}\n\n.cn-flow-runs-widget__dot {\n\tflex: 0 0 auto;\n\twidth: 8px;\n\theight: 8px;\n\tborder-radius: 50%;\n\tbackground: var(--color-text-maxcontrast);\n}\n\n/* Executing now — the primary colour, and the only row that animates. */\n.cn-flow-runs-widget__dot--running {\n\tbackground: var(--color-primary-element, #0082c9);\n\tanimation: cn-flow-runs-pulse 1.6s ease-in-out infinite;\n}\n\n.cn-flow-runs-widget__dot--queued {\n\tbackground: var(--color-warning, #c28900);\n}\n\n.cn-flow-runs-widget__dot--suspended {\n\tbackground: var(--color-text-maxcontrast);\n}\n\n/* Terminal rows: the dot is a hollow RING, so live (filled) and finished\n (hollow) never differ by colour alone. The per-status colour still rides\n on the ring's border. */\n.cn-flow-runs-widget__dot--terminal {\n\twidth: 6px;\n\theight: 6px;\n\tbackground: transparent;\n\tborder: 2px solid var(--color-text-maxcontrast);\n}\n\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--completed {\n\tborder-color: var(--color-success, #2d7b41);\n}\n\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--failed,\n.cn-flow-runs-widget__dot--terminal.cn-flow-runs-widget__dot--dead_letter {\n\tborder-color: var(--color-error, #d91f2d);\n}\n\n.cn-flow-runs-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-width: 0;\n\tflex: 1 1 auto;\n}\n\n.cn-flow-runs-widget__name {\n\tfont-weight: 600;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n/* Finished runs read as history: regular weight, muted colour. The hollow\n dot and the section label carry the distinction for anyone who cannot\n rely on colour. */\n.cn-flow-runs-widget__row--terminal .cn-flow-runs-widget__name {\n\tfont-weight: 400;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n/* Must sit AFTER the plain `__name` rule: the compound selector is more\n specific, and stylelint's no-descending-specificity flags the reverse\n order because the cascade then depends on specificity rather than\n source order — the shape that quietly stops working when someone adds\n a competing rule. */\na.cn-flow-runs-widget__row-content:hover .cn-flow-runs-widget__name {\n\ttext-decoration: underline;\n}\n\n.cn-flow-runs-widget__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.cn-flow-runs-widget__age {\n\tflex: 0 0 auto;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\tfont-variant-numeric: tabular-nums;\n}\n\n/* The history section label. Small caps text, not a colour: the section\n boundary must survive monochrome. */\n.cn-flow-runs-widget__history-title {\n\tmargin: 0;\n\tpadding-top: 8px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 12px;\n\tfont-weight: 600;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.04em;\n}\n\n/* Status pills: each row ruled on top, the name over its meta line, the pill\n and the start moment at the end, as the Dq case boards draw the Flows card. */\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row {\n\tborder-top: 1px solid var(--color-border);\n\tborder-bottom: none;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row-content {\n\tflex-wrap: wrap;\n\tgap: 6px 16px;\n\tpadding: 11px 0;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__body {\n\tflex: 1 1 260px;\n\tgap: 2px;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__name,\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__row--terminal .cn-flow-runs-widget__name {\n\tfont-size: 15px;\n\tfont-weight: 500;\n\tline-height: normal;\n\tcolor: var(--color-main-text);\n\twhite-space: normal;\n}\n\n/* The name and the meta on the font's own leading: a row 58px high, as the\n boards draw it (r32: 67). */\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__meta {\n\tfont-size: 13px;\n\tline-height: normal;\n\twhite-space: normal;\n}\n\n.cn-flow-runs-widget--pills .cn-flow-runs-widget__age {\n\tflex: 0 0 104px;\n\tfont-size: 13px;\n\ttext-align: end;\n}\n\n@keyframes cn-flow-runs-pulse {\n\t0%, 100% { opacity: 1; }\n\t50% { opacity: 0.35; }\n}\n\n/* Respect a reduced-motion preference: the pulse is decoration, and the dot\n colour already carries the status. */\n@media (prefers-reduced-motion: reduce) {\n\t.cn-flow-runs-widget__dot--running {\n\t\tanimation: none;\n\t}\n}\n</style>\n"],"names":["CnStatusBadge","t"],"mappings":";;;;;;;;;;;AAgIA;;AAEC;;AAEA;AACA;;AAEA;;;AAGD,MAAM,eAAc,GAAI,0CAAwC;;AAEhE;;;AAGC;;AAEA;;;AAGD,MAAM,kBAAmB,GAAE,6CAA2C;;AAEtE;;;;AAIC;;;AAGD,MAAM,gBAAgB;AACrB,CAAA,OAAO,EAAE,SAAS;AAClB,CAAA,MAAM,EAAE,QAAQ;AAChB,CAAA,SAAS,EAAE,SAAS;AACpB,CAAA,SAAS,EAAE,WAAW;AACtB,CAAA,OAAO,EAAE,SAAS;AAClB,CAAA,MAAM,EAAE,QAAQ;AAChB,CAAA,WAAW,EAAE,sBAAsB;AACpC,EAAA;;AAEA;AACC;AACA;;AAEA;AACA;;AAED,MAAM,iBAAgB,GAAI,CAAC,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAA;;AAE1E;;AAEC;AACA;AACA;AACA;;AAEA;AACA;;;;AAIA;AACA;;;;;;AAMA;AACA;AACA;AACA;;AAEA;;AAEA;;;;AAIA;AACA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,kBAAkB;;CAExB,UAAU,EAAE;iBACXA,UAAa;EACb,aAAa;EACb;;AAED,CAAA,MAAM,EAAE;AACP;;;;AAIA,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;AAC5C;AACA,EAAA,gBAAgB,EAAE,EAAE,OAAO,EAAE,MAAM;EACnC;;AAED,C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