@conduction/nextcloud-vue 2.67.0 → 2.69.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 (91) hide show
  1. package/dist/esm/components/CnContextMenu/CnContextMenu.vue2.js +37 -26
  2. package/dist/esm/components/CnContextMenu/CnContextMenu.vue2.js.map +1 -1
  3. package/dist/esm/components/CnContextMenu/CnContextMenu.vue3.js +3 -3
  4. package/dist/esm/components/CnContextMenu/CnContextMenu.vue3.js.map +1 -1
  5. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +21 -35
  6. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  7. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +17 -0
  8. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  9. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +40 -3
  10. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  11. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +58 -16
  12. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  13. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +87 -18
  14. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  15. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +6 -1
  16. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  17. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +58 -48
  18. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  19. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -2
  20. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  21. package/dist/esm/components/CnIndexPage/defaultActions.js +6 -7
  22. package/dist/esm/components/CnIndexPage/defaultActions.js.map +1 -1
  23. package/dist/esm/components/CnRowActions/CnRowActions.vue2.js +33 -34
  24. package/dist/esm/components/CnRowActions/CnRowActions.vue2.js.map +1 -1
  25. package/dist/esm/components/CnRowActions/CnRowActions.vue3.js +3 -3
  26. package/dist/esm/components/CnRowActions/CnRowActions.vue3.js.map +1 -1
  27. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js +8 -2
  28. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue2.js.map +1 -1
  29. package/dist/esm/components/CnSetupWizard/CnSetupWizard.vue3.js.map +1 -1
  30. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +2 -2
  31. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  32. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  33. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +70 -1
  34. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  35. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +23 -3
  36. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  37. package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js +3 -2
  38. package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnTimelineWidget/CnTimelineWidget.vue3.js.map +1 -1
  40. package/dist/esm/composables/useContextMenu.js +4 -2
  41. package/dist/esm/composables/useContextMenu.js.map +1 -1
  42. package/dist/esm/l10n/en.json.js +3 -0
  43. package/dist/esm/l10n/en.json.js.map +1 -1
  44. package/dist/esm/l10n/nl.json.js +3 -0
  45. package/dist/esm/l10n/nl.json.js.map +1 -1
  46. package/dist/esm/mixins/pageViews.js +278 -11
  47. package/dist/esm/mixins/pageViews.js.map +1 -1
  48. package/dist/esm/store/plugins/dashboardLayouts.js +35 -1
  49. package/dist/esm/store/plugins/dashboardLayouts.js.map +1 -1
  50. package/dist/esm/utils/formatMetric.js +137 -16
  51. package/dist/esm/utils/formatMetric.js.map +1 -1
  52. package/dist/esm/utils/resolveRowActions.js +130 -0
  53. package/dist/esm/utils/resolveRowActions.js.map +1 -0
  54. package/dist/esm/utils/rowActionItem.js +104 -0
  55. package/dist/esm/utils/rowActionItem.js.map +1 -0
  56. package/dist/esm/utils/timelineEvents.js +44 -1
  57. package/dist/esm/utils/timelineEvents.js.map +1 -1
  58. package/dist/esm/utils/validateManifest.js +59 -3
  59. package/dist/esm/utils/validateManifest.js.map +1 -1
  60. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  61. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  62. package/dist/nextcloud-vue.cjs.js +1251 -232
  63. package/dist/nextcloud-vue.cjs.js.map +2 -2
  64. package/l10n/en.json +3 -0
  65. package/l10n/nl.json +3 -0
  66. package/package.json +1 -1
  67. package/scripts/.jsdoc-baselines.json +2 -2
  68. package/src/components/CnContextMenu/CnContextMenu.vue +40 -29
  69. package/src/components/CnDashboardPage/CnDashboardPage.md +2 -0
  70. package/src/components/CnDashboardPage/CnDashboardPage.vue +34 -35
  71. package/src/components/CnDetailPage/CnDetailPage.md +6 -0
  72. package/src/components/CnDetailPage/CnDetailPage.vue +67 -5
  73. package/src/components/CnFormDialog/CnFormDialog.vue +92 -18
  74. package/src/components/CnIndexPage/CnIndexPage.md +21 -0
  75. package/src/components/CnIndexPage/CnIndexPage.vue +61 -51
  76. package/src/components/CnIndexPage/defaultActions.js +6 -7
  77. package/src/components/CnRowActions/CnRowActions.vue +36 -37
  78. package/src/components/CnSetupWizard/CnSetupWizard.vue +8 -2
  79. package/src/components/CnStatWidget/CnStatWidget.vue +2 -2
  80. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +82 -3
  81. package/src/components/CnTimelineWidget/CnTimelineWidget.vue +3 -2
  82. package/src/composables/useContextMenu.js +4 -2
  83. package/src/mixins/pageViews.js +277 -10
  84. package/src/schemas/app-manifest-v2.schema.json +73 -9
  85. package/src/store/plugins/dashboardLayouts.js +34 -0
  86. package/src/utils/formatMetric.js +143 -15
  87. package/src/utils/resolveRowActions.js +127 -0
  88. package/src/utils/rowActionItem.js +100 -0
  89. package/src/utils/timelineEvents.js +43 -0
  90. package/src/utils/validateManifest.js +60 -3
  91. package/src/utils/validateManifestV2.compiled.js +2 -2
@@ -6,6 +6,8 @@
6
6
  // names exist.
7
7
  import { BUILT_IN_FILE_COLUMNS } from '../components/CnFilesBrowser/filesBrowserColumns.js'
8
8
  import { LIBRARY_WIDGET_KEYS } from './libraryWidgetKeys.js'
9
+ // The same resolver CnIndexPage orders row actions with, so the placement warnings measure the order that actually renders.
10
+ import { resolveRowActions } from './resolveRowActions.js'
9
11
  // Shared slot→columns resolution so the validator's grid bound matches the
10
12
  // renderer (CnWidgetGrid) exactly. A mismatch would let a manifest pass
11
13
  // validation yet clip at render time.
@@ -120,9 +122,14 @@ const CHART_VALUE_AXIS_BASELINES = ['auto', 'zero', 'fit']
120
122
  * page's own `config.columns` does not declare (the page declares which
121
123
  * columns it has; a scope only chooses among them)
122
124
  *
125
+ * It also returns non-fatal `warnings`, which never affect `valid` (index pages with an `entitySource` are skipped):
126
+ * - A `"builtin:<id>"` placeholder whose built-in the manifest's toggles turn off
127
+ * - The built-in Delete enabled but not the last entry of the rendered row action order
128
+ *
123
129
  * @spec openspec/changes/manifest-v2-schema/specs/manifest-v2-schema/spec.md
130
+ * @spec openspec/changes/row-action-builtin-placement/specs/index-page/spec.md
124
131
  * @param {object} manifest The v2 manifest object to validate.
125
- * @return {{ valid: boolean, errors: string[] }}
132
+ * @return {{ valid: boolean, errors: string[], warnings: string[] }}
126
133
  */
127
134
  export function validateManifestV2(manifest) {
128
135
  // Clone so Ajv useDefaults mutations don't affect the caller's copy.
@@ -789,7 +796,57 @@ export function validateManifestV2(manifest) {
789
796
  })
790
797
  }
791
798
 
792
- return { valid: errors.length === 0, errors }
799
+ // --- Post-schema warnings (never affect `valid`) ---
800
+ const warnings = []
801
+
802
+ // W1. Row action placement on an index page: a placeholder whose built-in the manifest turns off, and the built-in Delete placed before other row actions.
803
+ // An entitySource page is skipped: its built-in defaults depend on the source at runtime.
804
+ if (Array.isArray(clone.pages)) {
805
+ clone.pages.forEach((page, pIndex) => {
806
+ const config = page && page.type === 'index' && isPlainObject(page.config) ? page.config : null
807
+ if (!config || !Array.isArray(config.actions) || typeof config.entitySource === 'string') {
808
+ return
809
+ }
810
+ const resolved = resolveRowActions(config.actions, indexPageBuiltinStubs(config))
811
+ for (const warning of resolved.warnings) {
812
+ if (warning.code === 'disabled-placeholder') {
813
+ warnings.push(`pages[${pIndex}]/config/actions: ${warning.message}`)
814
+ }
815
+ }
816
+ if (resolved.deleteNotLast) {
817
+ warnings.push(`pages[${pIndex}]/config/actions: "builtin:delete" is not the last row action in the rendered order (enabled built-ins the array does not place are appended after it); Delete is normally last`)
818
+ }
819
+ })
820
+ }
821
+
822
+ return { valid: errors.length === 0, errors, warnings }
823
+ }
824
+
825
+ /**
826
+ * The built-in row actions an index page enables, as `{ id, builtin, label }` stubs in default order.
827
+ * They are read from its config the way CnPageRenderer derives the show*Action props: an explicit `config.show*Action` wins over `config.actionToggles`, and `config.readOnly: true` turns Edit, Copy and Delete off by default.
828
+ * A non-boolean value counts as the default.
829
+ *
830
+ * @param {object} config The page's config.
831
+ * @return {Array<{id: string, builtin: true, label: string}>} The enabled built-ins.
832
+ */
833
+ function indexPageBuiltinStubs(config) {
834
+ const toggles = isPlainObject(config.actionToggles) ? config.actionToggles : {}
835
+ const flag = (key, readOnlyOff) => {
836
+ if (typeof config[key] === 'boolean') {
837
+ return config[key]
838
+ }
839
+ if (typeof toggles[key] === 'boolean') {
840
+ return toggles[key]
841
+ }
842
+ return !(readOnlyOff && config.readOnly === true)
843
+ }
844
+ return [
845
+ ['view', flag('showViewAction', false)],
846
+ ['edit', flag('showEditAction', true)],
847
+ ['copy', flag('showCopyAction', true)],
848
+ ['delete', flag('showDeleteAction', true)],
849
+ ].filter(([, on]) => on).map(([id]) => ({ id, builtin: true, label: id }))
793
850
  }
794
851
 
795
852
  /**
@@ -853,7 +910,7 @@ function isSentinel(value) {
853
910
  * `pageTypes` registry is known up-front. When omitted, any
854
911
  * non-empty string is accepted; the runtime renderer logs a warning
855
912
  * for unknown types.
856
- * @return {{ valid: boolean, errors: string[] }}
913
+ * @return {{ valid: boolean, errors: string[], warnings?: string[] }} A v2 manifest also gets `warnings`, which never affect `valid`.
857
914
  */
858
915
  export function validateManifest(manifest, options = {}) {
859
916
  // Dispatch to v2 validator when the manifest declares a v2 $schema.