@conduction/nextcloud-vue 2.76.0 → 2.78.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.
Files changed (173) hide show
  1. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js +23 -0
  2. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue3.js.map +1 -1
  4. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js +18 -3
  5. package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
  6. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +49 -3
  7. package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
  8. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +2 -1
  9. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  10. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  11. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +79 -1
  12. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  13. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +229 -203
  14. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  15. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue.js +9 -0
  16. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue.js.map +1 -0
  17. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue2.js +50 -0
  18. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue2.js.map +1 -0
  19. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue3.js +13 -0
  20. package/dist/esm/components/CnCellRenderer/CnGroupNameCell.vue3.js.map +1 -0
  21. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +37 -0
  22. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  23. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js +2 -2
  24. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  25. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +29 -4
  26. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  27. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  28. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +48 -6
  29. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  30. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +90 -51
  31. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  32. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue.js +1 -1
  33. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue2.js +45 -2
  34. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue2.js.map +1 -1
  35. package/dist/esm/components/CnDateRangePicker/CnDateRangePicker.vue3.js.map +1 -1
  36. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +16 -28
  37. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  38. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +12 -24
  39. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  40. package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue2.js +7 -2
  41. package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue2.js.map +1 -1
  42. package/dist/esm/components/CnFavouriteToggle/CnFavouriteToggle.vue3.js.map +1 -1
  43. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +114 -1
  44. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  45. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +115 -62
  46. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  47. package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js +89 -7
  48. package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue2.js.map +1 -1
  49. package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js +62 -30
  50. package/dist/esm/components/CnFollowToggle/CnFollowToggle.vue3.js.map +1 -1
  51. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +7 -1
  52. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  53. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  54. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js +4 -1
  55. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js.map +1 -1
  56. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js.map +1 -1
  57. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +104 -13
  58. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  59. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +13 -9
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  61. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +199 -7
  62. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  63. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +155 -119
  64. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  65. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +6 -0
  66. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
  67. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +4 -1
  68. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
  69. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +36 -0
  70. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  71. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +35 -23
  72. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  73. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue2.js +6 -2
  74. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue2.js.map +1 -1
  75. package/dist/esm/components/CnStatusBadge/CnStatusBadge.vue3.js.map +1 -1
  76. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +13 -0
  77. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  78. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  79. package/dist/esm/composables/useFormDraft.js +11 -1
  80. package/dist/esm/composables/useFormDraft.js.map +1 -1
  81. package/dist/esm/composables/useListView.js +4 -0
  82. package/dist/esm/composables/useListView.js.map +1 -1
  83. package/dist/esm/composables/useObjectPresence.js +15 -4
  84. package/dist/esm/composables/useObjectPresence.js.map +1 -1
  85. package/dist/esm/index.js +2 -1
  86. package/dist/esm/index.js.map +1 -1
  87. package/dist/esm/l10n/en.json.js +32 -1
  88. package/dist/esm/l10n/en.json.js.map +1 -1
  89. package/dist/esm/l10n/nl.json.js +32 -1
  90. package/dist/esm/l10n/nl.json.js.map +1 -1
  91. package/dist/esm/nextcloud-vue.css +500 -75
  92. package/dist/esm/store/plugins/interactions.js +20 -10
  93. package/dist/esm/store/plugins/interactions.js.map +1 -1
  94. package/dist/esm/store/useObjectStore.js +17 -0
  95. package/dist/esm/store/useObjectStore.js.map +1 -1
  96. package/dist/esm/utils/badgeVariants.js +32 -0
  97. package/dist/esm/utils/badgeVariants.js.map +1 -0
  98. package/dist/esm/utils/builtInFormatters.js +15 -7
  99. package/dist/esm/utils/builtInFormatters.js.map +1 -1
  100. package/dist/esm/utils/groupAutocomplete.js +63 -1
  101. package/dist/esm/utils/groupAutocomplete.js.map +1 -1
  102. package/dist/esm/utils/lensAvailability.js +90 -0
  103. package/dist/esm/utils/lensAvailability.js.map +1 -0
  104. package/dist/esm/utils/personalLenses.js +13 -6
  105. package/dist/esm/utils/personalLenses.js.map +1 -1
  106. package/dist/esm/utils/recordInteractions.js +31 -13
  107. package/dist/esm/utils/recordInteractions.js.map +1 -1
  108. package/dist/esm/utils/resolveFilterTokens.js +46 -3
  109. package/dist/esm/utils/resolveFilterTokens.js.map +1 -1
  110. package/dist/esm/utils/schema.js +1 -1
  111. package/dist/esm/utils/schema.js.map +1 -1
  112. package/dist/esm/utils/sentinelTokens.js +4 -4
  113. package/dist/esm/utils/sentinelTokens.js.map +1 -1
  114. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  115. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  116. package/dist/esm/utils/widgetVisibility.js +46 -1
  117. package/dist/esm/utils/widgetVisibility.js.map +1 -1
  118. package/dist/nextcloud-vue.cjs.js +4389 -2890
  119. package/dist/nextcloud-vue.cjs.js.map +2 -2
  120. package/dist/nextcloud-vue.css +500 -75
  121. package/l10n/en.json +32 -1
  122. package/l10n/nl.json +32 -1
  123. package/package.json +1 -1
  124. package/src/components/CnAiCompanion/CnAiCompanion.vue +23 -0
  125. package/src/components/CnAppNav/CnAppNav.vue +44 -5
  126. package/src/components/CnBoardView/CnBoardView.vue +2 -1
  127. package/src/components/CnCellRenderer/CnCellRenderer.md +1 -0
  128. package/src/components/CnCellRenderer/CnCellRenderer.vue +106 -9
  129. package/src/components/CnCellRenderer/CnGroupNameCell.vue +61 -0
  130. package/src/components/CnChartWidget/CnChartWidget.vue +39 -2
  131. package/src/components/CnDashboardPage/CnDashboardPage.vue +29 -4
  132. package/src/components/CnDataTable/CnDataTable.md +9 -0
  133. package/src/components/CnDataTable/CnDataTable.vue +87 -22
  134. package/src/components/CnDateRangePicker/CnDateRangePicker.vue +44 -1
  135. package/src/components/CnDetailPage/CnDetailPage.vue +10 -27
  136. package/src/components/CnFavouriteToggle/CnFavouriteToggle.vue +7 -2
  137. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +204 -5
  138. package/src/components/CnFollowToggle/CnFollowToggle.vue +118 -13
  139. package/src/components/CnFormDialog/CnFormDialog.vue +7 -1
  140. package/src/components/CnFormPage/CnFormPage.vue +4 -1
  141. package/src/components/CnIndexPage/CnIndexPage.md +36 -0
  142. package/src/components/CnIndexPage/CnIndexPage.vue +112 -19
  143. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +226 -2
  144. package/src/components/CnObjectSidebar/CnFilesTab.vue +9 -0
  145. package/src/components/CnStatWidget/CnStatWidget.vue +52 -2
  146. package/src/components/CnStatusBadge/CnStatusBadge.vue +6 -2
  147. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +13 -0
  148. package/src/composables/__tests__/useObjectPresence.spec.js +24 -0
  149. package/src/composables/useFormDraft.js +11 -1
  150. package/src/composables/useListView.js +4 -0
  151. package/src/composables/useObjectPresence.js +15 -4
  152. package/src/css/badge.css +31 -0
  153. package/src/css/kpi-card.css +51 -0
  154. package/src/css/look-board-detail.css +40 -2
  155. package/src/css/look-board-index.css +36 -0
  156. package/src/css/look-board.css +8 -0
  157. package/src/css/table.css +82 -17
  158. package/src/index.js +2 -1
  159. package/src/schemas/app-manifest-v2.schema.json +15 -11
  160. package/src/store/plugins/interactions.js +20 -10
  161. package/src/store/useObjectStore.js +17 -0
  162. package/src/utils/badgeVariants.js +29 -0
  163. package/src/utils/builtInFormatters.js +15 -7
  164. package/src/utils/groupAutocomplete.js +75 -0
  165. package/src/utils/index.js +1 -1
  166. package/src/utils/lensAvailability.js +86 -0
  167. package/src/utils/personalLenses.js +13 -6
  168. package/src/utils/recordInteractions.js +31 -13
  169. package/src/utils/resolveFilterTokens.js +45 -2
  170. package/src/utils/schema.js +1 -1
  171. package/src/utils/sentinelTokens.js +4 -4
  172. package/src/utils/validateManifestV2.compiled.js +2 -2
  173. package/src/utils/widgetVisibility.js +45 -0
@@ -8,12 +8,17 @@ import { setFavourite } from '../../utils/recordInteractions.js';
8
8
  /**
9
9
  * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.
10
10
  *
11
+ * @deprecated Following and favourites are one feature since OpenRegister's
12
+ * `merge-follow-and-favourites`: a favourite is a follow with notifications
13
+ * off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders
14
+ * this star any more; it stays exported for one minor line so an app that
15
+ * placed it itself keeps working (the server answers it as a quiet follow).
16
+ *
11
17
  * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)
12
18
  * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on
13
19
  * failure it flips back and shows the server's message. The server's answer is
14
20
  * written into the stored object's `@self`, so a list showing the same record
15
- * agrees. `CnDetailPage` renders it beside the title; `CnIndexPage` renders it
16
- * per row for `showFavouriteColumn`.
21
+ * agrees.
17
22
  *
18
23
  * Example:
19
24
  * ```vue
@@ -1 +1 @@
1
- {"version":3,"file":"CnFavouriteToggle.vue2.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees. `CnDetailPage` renders it beside the title; `CnIndexPage` renders it\n * per row for `showFavouriteColumn`.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["t"],"mappings":";;;;;;;AA8BA;AACC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,mBAAmB;;AAEzB,CAAA,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa;;AAE3C,CAAA,KAAK,EAAE;;AAEN,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;;AAGD,EAAA,MAAM,EAAE;GACP,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;;EAGD,SAAS,EAAE;GACV,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC;GACtD;;AAED;EACA,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,MAAMA,SAAC,CAAC,eAAe,EAAE,wBAAwB,CAAC;GAC3D;EACD;;CAED,KAAK,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,CAAC;;AAE3D,CAAA,IAAI,GAAG;AACN,EAAA,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAM,EAAA;EAC5C;;AAED,CAAA,QAAQ,EAAE;AACT,EAAA,KAAK,GAAG;GACP,OAAO,IAAI,CAAC,KAAM,GAAE,IAAI,CAAC,cAAc,IAAI,CAAC,QAAO;GACnD;EACD;;AAED,CAAA,KAAK,EAAE;AACN,EAAA,SAAS,CAAC,KAAK,EAAE;AAChB,GAAA,IAAI,CAAC,KAAM,GAAE,MAAI;GACjB;EACD;;AAED,CAAA,OAAO,EAAE;EACR,MAAM,MAAM,GAAG;GACd,IAAI,IAAI,CAAC,IAAI,EAAE;IACd,MAAK;AACN,IAAA;GACA,MAAM,QAAS,GAAE,IAAI,CAAC,MAAI;AAC1B,GAAA,IAAI,CAAC,KAAM,GAAE,CAAC,SAAO;GACrB,IAAI,CAAC,IAAK,GAAE,KAAG;AACf,GAAA,MAAM,MAAK,GAAI,MAAM,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAA;AACvF,GAAA,IAAI,CAAC,IAAG,GAAI,MAAI;AAChB,GAAA,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;AACf,IAAA,IAAI,CAAC,KAAM,GAAE,SAAO;AACpB,IAAA,MAAM,OAAQ,GAAE,MAAM,CAAC,MAAO,KAAI,GAAE;OACjCA,SAAC,CAAC,eAAe,EAAE,oCAAoC,CAAA;AACzD,QAAG,MAAM,CAAC,OAAM,IAAKA,SAAC,CAAC,eAAe,EAAE,iCAAiC,CAAC,EAAA;AAC3E,IAAA,OAAO,qDAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,SAAQ,EAAG,KAAK,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,EAAA;AACvF;IACA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAA;IAC3B,IAAI,MAAM,CAAC,MAAO,KAAI,GAAG,EAAE;AAC1B;KACA,IAAI,CAAC,KAAK,CAAC,WAAW,EAAA;AACvB,KAAA;IACA,MAAK;AACN,IAAA;AACA,GAAA,eAAe,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAA;AACpF;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAA;AAC9C;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,KAAK,EAAA;GACzC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnFavouriteToggle.vue2.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * @deprecated Following and favourites are one feature since OpenRegister's\n * `merge-follow-and-favourites`: a favourite is a follow with notifications\n * off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders\n * this star any more; it stays exported for one minor line so an app that\n * placed it itself keeps working (the server answers it as a quiet follow).\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["t"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"CnFavouriteToggle.vue3.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue?vue&type=template&id=836dad16&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees. `CnDetailPage` renders it beside the title; `CnIndexPage` renders it\n * per row for `showFavouriteColumn`.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["_createBlock","_normalizeClass"],"mappings":";;;;;;;uBASEA;IACA,KAAK,EAAAC,cAAA,CAAA,CAAC,qBAAY,EAAA,EAAA,yBAAA,EACL,KAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACb,IAAA,OAAO,EAAC,UAAO;AACd,IAAA,cAAY,EAAE,KAAK,CAAA,KAAA,GAAA,MAAA,GAAA,OAAA;AACnB,IAAA,YAAU,EAAE,QAAK,CAAA,KAAA;AACjB,IAAA,KAAK,EAAE,QAAK,CAAA,KAAA;AACZ,IAAA,QAAQ,EAAE,KAAI,CAAA,IAAA;iBACJ,EAAC,qBAAqB;AAChC,IAAA,OAAK,gBAAI,QAAA,CAAA,MAAA,EAAA,CAAA,MAAA,CAAA,CAAA;;AACD,IAAA,IAAA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnFavouriteToggle.vue3.js","sources":["../../../../src/components/CnFavouriteToggle/CnFavouriteToggle.vue?vue&type=template&id=836dad16&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<NcButton\n\t\tclass=\"cn-favourite-toggle\"\n\t\t:class=\"{ 'cn-favourite-toggle--on': state }\"\n\t\tvariant=\"tertiary\"\n\t\t:aria-pressed=\"state ? 'true' : 'false'\"\n\t\t:aria-label=\"label\"\n\t\t:title=\"label\"\n\t\t:disabled=\"busy\"\n\t\tdata-testid=\"cn-favourite-toggle\"\n\t\t@click.stop=\"toggle\">\n\t\t<template #icon>\n\t\t\t<Star v-if=\"state\" :size=\"20\" class=\"cn-favourite-toggle__star\" />\n\t\t\t<StarOutline v-else :size=\"20\" />\n\t\t</template>\n\t</NcButton>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton } from '@nextcloud/vue'\nimport Star from 'vue-material-design-icons/Star.vue'\nimport StarOutline from 'vue-material-design-icons/StarOutline.vue'\nimport { patchStoredSelf } from '../../utils/patchStoredSelf.js'\nimport { setFavourite } from '../../utils/recordInteractions.js'\n\n/**\n * CnFavouriteToggle — a star bound to a record's `@self.favourite` marker.\n *\n * @deprecated Following and favourites are one feature since OpenRegister's\n * `merge-follow-and-favourites`: a favourite is a follow with notifications\n * off. Use `CnFollowToggle`. Neither `CnDetailPage` nor `CnIndexPage` renders\n * this star any more; it stays exported for one minor line so an app that\n * placed it itself keeps working (the server answers it as a quiet follow).\n *\n * A click flips the star at once and sends `PUT` (star) or `DELETE` (unstar)\n * `/apps/openregister/api/objects/{register}/{schema}/{id}/favourite`; on\n * failure it flips back and shows the server's message. The server's answer is\n * written into the stored object's `@self`, so a list showing the same record\n * agrees.\n *\n * Example:\n * ```vue\n * <CnFavouriteToggle register=\"pipelinq\" schema=\"ticket\" :object-id=\"id\"\n * :favourite=\"object['@self'].favourite\" />\n * ```\n */\nexport default {\n\tname: 'CnFavouriteToggle',\n\n\tcomponents: { NcButton, Star, StarOutline },\n\n\tprops: {\n\t\t/** Register slug of the record. */\n\t\tregister: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Schema slug of the record. */\n\t\tschema: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Id of the record. */\n\t\tobjectId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether the record is currently starred (`@self.favourite`). */\n\t\tfavourite: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Accessible label when the record is not starred. */\n\t\taddLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Add to favourites'),\n\t\t},\n\n\t\t/** Accessible label when the record is starred. */\n\t\tremoveLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Remove from favourites'),\n\t\t},\n\t},\n\n\temits: ['change', 'error', 'not-found', 'update:favourite'],\n\n\tdata() {\n\t\treturn { state: this.favourite, busy: false }\n\t},\n\n\tcomputed: {\n\t\tlabel() {\n\t\t\treturn this.state ? this.removeLabel : this.addLabel\n\t\t},\n\t},\n\n\twatch: {\n\t\tfavourite(value) {\n\t\t\tthis.state = value\n\t\t},\n\t},\n\n\tmethods: {\n\t\tasync toggle() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst previous = this.state\n\t\t\tthis.state = !previous\n\t\t\tthis.busy = true\n\t\t\tconst result = await setFavourite(this.register, this.schema, this.objectId, this.state)\n\t\t\tthis.busy = false\n\t\t\tif (!result.ok) {\n\t\t\t\tthis.state = previous\n\t\t\t\tconst message = result.status === 404\n\t\t\t\t\t? t('nextcloud-vue', 'You can no longer see this record.')\n\t\t\t\t\t: (result.message || t('nextcloud-vue', 'Could not change the favourite.'))\n\t\t\t\timport('@nextcloud/dialogs').then(({ showError }) => showError(message)).catch(() => {})\n\t\t\t\t/** @event error Emitted when the call failed; payload is the message shown. */\n\t\t\t\tthis.$emit('error', message)\n\t\t\t\tif (result.status === 404) {\n\t\t\t\t\t/** @event not-found Emitted on a 404: the record went away or access was withdrawn. */\n\t\t\t\t\tthis.$emit('not-found')\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tpatchStoredSelf(this.register, this.schema, this.objectId, { favourite: this.state })\n\t\t\t/** @event change Emitted after a successful call. Payload: `{ favourite }`. */\n\t\t\tthis.$emit('change', { favourite: this.state })\n\t\t\t/** @event update:favourite Emitted with the new state, for `v-model:favourite`. */\n\t\t\tthis.$emit('update:favourite', this.state)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-favourite-toggle__star {\n\tcolor: var(--color-warning);\n}\n</style>\n"],"names":["_createBlock","_normalizeClass"],"mappings":";;;;;;;uBASEA;IACA,KAAK,EAAAC,cAAA,CAAA,CAAC,qBAAY,EAAA,EAAA,yBAAA,EACL,KAAA,CAAA,KAAA,EAAA,CAAA,CAAA;AACb,IAAA,OAAO,EAAC,UAAO;AACd,IAAA,cAAY,EAAE,KAAK,CAAA,KAAA,GAAA,MAAA,GAAA,OAAA;AACnB,IAAA,YAAU,EAAE,QAAK,CAAA,KAAA;AACjB,IAAA,KAAK,EAAE,QAAK,CAAA,KAAA;AACZ,IAAA,QAAQ,EAAE,KAAI,CAAA,IAAA;iBACJ,EAAC,qBAAqB;AAChC,IAAA,OAAK,gBAAI,QAAA,CAAA,MAAA,EAAA,CAAA,MAAA,CAAA,CAAA;;AACD,IAAA,IAAA;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { getCurrentUser } from '@nextcloud/auth';
2
2
  import axios__default from '@nextcloud/axios';
3
3
  import { View, sortNodes, getNewFileMenuEntries, FileType, getFileActions, formatFileSize } from '@nextcloud/files';
4
4
  import { getRootPath, getClient, resultToNode, getRemoteURL, getDefaultPropfind } from '@nextcloud/files/dav';
5
- import { translate } from '@nextcloud/l10n';
5
+ import { translate, translatePlural } from '@nextcloud/l10n';
6
6
  import { generateUrl } from '@nextcloud/router';
7
7
  import { NcActionButton, NcActionCheckbox, NcActionLink, NcActionSeparator, NcActions, NcBreadcrumb, NcBreadcrumbs, NcButton, NcDateTime, NcDialog, NcIconSvgWrapper, NcLoadingIcon, NcProgressBar, NcTextField } from '@nextcloud/vue';
8
8
  import AlertCircleOutline from 'vue-material-design-icons/AlertCircleOutline.vue';
@@ -177,6 +177,51 @@ var script = {
177
177
  default: () => translate('nextcloud-vue', 'Show in Files'),
178
178
  },
179
179
 
180
+ /**
181
+ * Show a primary upload button beside the New menu, which then steps
182
+ * back to a secondary button. Off (the default) keeps the upload
183
+ * inside the New menu only.
184
+ */
185
+ uploadButton: {
186
+ type: Boolean,
187
+ default: false,
188
+ },
189
+
190
+ /** Label of the upload button `uploadButton` shows. */
191
+ uploadButtonLabel: {
192
+ type: String,
193
+ default: () => translate('nextcloud-vue', 'Add files'),
194
+ },
195
+
196
+ /**
197
+ * Draw the drop state over the browser while files are dragged onto
198
+ * it (a dashed frame and `dropLabel`, centred) and announce it to
199
+ * screen readers. Off (the default) keeps the plain dashed outline and
200
+ * announces nothing.
201
+ */
202
+ dropOverlay: {
203
+ type: Boolean,
204
+ default: false,
205
+ },
206
+
207
+ /** The line `dropOverlay` draws and announces. */
208
+ dropLabel: {
209
+ type: String,
210
+ default: () => translate('nextcloud-vue', 'Drop to add'),
211
+ },
212
+
213
+ /** Show a line under the list saying files can be dropped on it. */
214
+ dropHint: {
215
+ type: Boolean,
216
+ default: false,
217
+ },
218
+
219
+ /** The line `dropHint` shows. */
220
+ dropHintLabel: {
221
+ type: String,
222
+ default: () => translate('nextcloud-vue', 'Or drag files onto this list.'),
223
+ },
224
+
180
225
  /** Title of the empty state. */
181
226
  emptyLabel: {
182
227
  type: String,
@@ -279,6 +324,10 @@ var script = {
279
324
  */
280
325
  visibleColumnKeys: null,
281
326
  dragging: false,
327
+ /** Nested dragenter/dragleave pairs, so a child does not end the drag. */
328
+ dragDepth: 0,
329
+ /** What the live region says: the drop label, then what was added. */
330
+ dropStatus: '',
282
331
  uploads: [],
283
332
  previewFailed: {},
284
333
  newFolderOpen: false,
@@ -818,10 +867,74 @@ var script = {
818
867
  */
819
868
  async onDrop(event) {
820
869
  this.dragging = false;
870
+ this.dragDepth = 0;
871
+ this.dropStatus = '';
821
872
  const files = event.dataTransfer?.files;
822
873
  if (files?.length) {
823
874
  await this.uploadFiles(files);
875
+ if (this.dropOverlay) {
876
+ this.dropStatus = translatePlural('nextcloud-vue', '%n file added', '%n files added', files.length);
877
+ }
878
+ }
879
+ },
880
+
881
+ /**
882
+ * Something is dragged into the browser: show the drop state when it
883
+ * carries files, and say so once.
884
+ *
885
+ * @param {DragEvent} event The drag.
886
+ * @return {void}
887
+ */
888
+ onDragEnter(event) {
889
+ if (!this.carriesFiles(event)) {
890
+ return
891
+ }
892
+ this.dragDepth++;
893
+ if (!this.dragging) {
894
+ this.dragging = true;
895
+ this.dropStatus = this.dropOverlay ? this.dropLabel : '';
896
+ }
897
+ },
898
+
899
+ /**
900
+ * Keep the drop state while files move over the browser.
901
+ *
902
+ * @param {DragEvent} event The drag.
903
+ * @return {void}
904
+ */
905
+ onDragOver(event) {
906
+ if (this.carriesFiles(event)) {
907
+ this.dragging = true;
908
+ }
909
+ },
910
+
911
+ /**
912
+ * Something left the browser, or one of its children. The drop state
913
+ * ends only when the drag has left the browser itself.
914
+ *
915
+ * @return {void}
916
+ */
917
+ onDragLeave() {
918
+ this.dragDepth = Math.max(0, this.dragDepth - 1);
919
+ if (this.dragDepth === 0) {
920
+ this.dragging = false;
921
+ this.dropStatus = '';
922
+ }
923
+ },
924
+
925
+ /**
926
+ * Whether a drag carries files (not text or a link from the page).
927
+ * A drag whose types cannot be read counts as files, as before.
928
+ *
929
+ * @param {DragEvent} event The drag.
930
+ * @return {boolean}
931
+ */
932
+ carriesFiles(event) {
933
+ const types = event?.dataTransfer?.types;
934
+ if (!types) {
935
+ return true
824
936
  }
937
+ return Array.from(types).includes('Files')
825
938
  },
826
939
 
827
940
  /**