@conduction/nextcloud-vue 2.56.0-beta.73 → 2.56.0-beta.75
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/CnActionDialog/CnActionDialog.vue.js +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +90 -7
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +82 -79
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue.js +1 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js +12 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js.map +1 -1
- package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue3.js.map +1 -1
- package/dist/esm/components/CnCardNotices/CnCardNotices.vue.js +1 -1
- package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js +45 -7
- package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js.map +1 -1
- package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js +1 -1
- package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +10 -8
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +95 -88
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +40 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +149 -109
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
- package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +86 -8
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +137 -121
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js +56 -4
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js +166 -70
- package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js +123 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js +268 -0
- package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js +49 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js.map +1 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js +41 -0
- package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js.map +1 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +116 -8
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +110 -58
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +78 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +44 -3
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
- package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue.js +1 -1
- package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js +112 -1
- package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js +53 -18
- package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js +3 -3
- package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js +108 -74
- package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +219 -83
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +92 -58
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +56 -0
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +185 -123
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +2 -0
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +2 -1
- package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +197 -63
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +244 -161
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnSearchPage/CnSearchPage.vue.js +1 -1
- package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js +39 -1
- package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js.map +1 -1
- package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js +12 -2
- package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
- package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue.js +1 -1
- package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js +51 -2
- package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js.map +1 -1
- package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js +49 -11
- package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js.map +1 -1
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js +9 -0
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js.map +1 -0
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js +328 -0
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js.map +1 -0
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js +85 -0
- package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js.map +1 -0
- package/dist/esm/components/CnTaskFormWidget/index.js +24 -0
- package/dist/esm/components/CnTaskFormWidget/index.js.map +1 -0
- package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue.js +1 -1
- package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js +8 -2
- package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js +16 -3
- package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
- package/dist/esm/composables/indexSources.js +24 -4
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/composables/useFlowStore.js +75 -4
- package/dist/esm/composables/useFlowStore.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js +17 -0
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js +9 -1
- package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue2.js +15 -0
- package/dist/esm/dialogs/CnFlowEditModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowEditModal.vue3.js +13 -3
- package/dist/esm/dialogs/CnFlowEditModal.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue.js +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js +13 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnFlowStepPickerModal.vue3.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +52 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +51 -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 +1203 -812
- package/dist/esm/utils/dialogWidths.js +6 -4
- package/dist/esm/utils/dialogWidths.js.map +1 -1
- package/dist/esm/utils/fieldPill.js +77 -0
- package/dist/esm/utils/fieldPill.js.map +1 -0
- package/dist/esm/utils/flowCondition.js +177 -0
- package/dist/esm/utils/flowCondition.js.map +1 -0
- package/dist/esm/utils/flowRunStatus.js +64 -1
- package/dist/esm/utils/flowRunStatus.js.map +1 -1
- package/dist/esm/utils/flowStepList.js +385 -0
- package/dist/esm/utils/flowStepList.js.map +1 -0
- package/dist/esm/utils/libraryWidgetKeys.js +1 -0
- package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
- package/dist/esm/utils/searchRefusal.js +35 -1
- package/dist/esm/utils/searchRefusal.js.map +1 -1
- package/dist/esm/utils/widgetDispatch.js +1 -1
- package/dist/esm/utils/widgetDispatch.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +14837 -11411
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1203 -812
- package/l10n/en.json +52 -1
- package/l10n/nl.json +51 -1
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +116 -9
- package/src/components/CnBuildiqEditButton/CnBuildiqEditButton.vue +12 -1
- package/src/components/CnCardNotices/CnCardNotices.vue +46 -8
- package/src/components/CnCellRenderer/CnCellRenderer.vue +8 -0
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +61 -2
- package/src/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
- package/src/components/CnFlowDetail/CnFlowDetail.vue +110 -12
- package/src/components/CnFlowDetail/CnFlowDryRunResult.vue +163 -5
- package/src/components/CnFlowDetail/CnFlowStepList.vue +408 -0
- package/src/components/CnFlowDetail/CnFlowViewSwitch.vue +117 -0
- package/src/components/CnFlowDetail/index.js +2 -0
- package/src/components/CnFlowsPage/CnFlowBoard.vue +182 -25
- package/src/components/CnFlowsPage/CnFlowEditorPage.vue +101 -3
- package/src/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue +141 -1
- package/src/components/CnIndexPage/CnIndexHeaderMenu.vue +22 -4
- package/src/components/CnIndexPage/CnIndexPage.vue +172 -13
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +148 -4
- package/src/components/CnObjectSidebar/CnFilesTab.vue +3 -0
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +310 -66
- package/src/components/CnSearchPage/CnSearchPage.vue +50 -1
- package/src/components/CnStepper/CnStepper.vue +14 -5
- package/src/components/CnTaskFormFields/CnTaskFormFields.md +1 -0
- package/src/components/CnTaskFormFields/CnTaskFormFields.vue +89 -3
- package/src/components/CnTaskFormWidget/CnTaskFormWidget.vue +400 -0
- package/src/components/CnTaskFormWidget/index.js +23 -0
- package/src/components/CnTasksWidget/CnTasksWidget.vue +17 -3
- package/src/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
- package/src/components/index.js +2 -1
- package/src/composables/indexSources.js +24 -4
- package/src/composables/useFlowStore.js +75 -4
- package/src/css/index-page.css +10 -0
- package/src/dialogs/CnFlowEdgeEditModal.vue +28 -0
- package/src/dialogs/CnFlowEditModal.vue +26 -6
- package/src/dialogs/CnFlowStepPickerModal.vue +13 -1
- package/src/index.js +3 -0
- package/src/utils/dialogWidths.js +6 -4
- package/src/utils/fieldPill.js +73 -0
- package/src/utils/flowCondition.js +173 -0
- package/src/utils/flowRunStatus.js +63 -0
- package/src/utils/flowStepList.js +381 -0
- package/src/utils/libraryWidgetKeys.js +1 -0
- package/src/utils/searchRefusal.js +33 -0
- package/src/utils/widgetDispatch.js +1 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
5
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The list reading of a flow: the trigger, then the steps in run order.
|
|
11
|
+
*
|
|
12
|
+
* Nothing here is stored. The rows are derived from the flow document the
|
|
13
|
+
* canvas draws and every change goes back into that document, so the two views
|
|
14
|
+
* cannot drift.
|
|
15
|
+
*
|
|
16
|
+
* A `graph` is `{ nodes, lines, startIds, roleOf }`: the document's nodes, the
|
|
17
|
+
* store's `canvasEdges`, its `startNodeIds` and its `roleOfNodeType`.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {object} node A flow node.
|
|
22
|
+
* @return {{x: number, y: number}} Where it stands on the canvas.
|
|
23
|
+
*/
|
|
24
|
+
function placeOf(node) {
|
|
25
|
+
return { x: node.position?.x ?? node.x ?? 0, y: node.position?.y ?? node.y ?? 0 }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {Array<object>} lines The lines.
|
|
30
|
+
* @param {string} key `source` or `target`.
|
|
31
|
+
* @return {Map<string, Array<object>>} The lines by that end.
|
|
32
|
+
*/
|
|
33
|
+
function linesBy(lines, key) {
|
|
34
|
+
const grouped = new Map();
|
|
35
|
+
lines.forEach((line) => grouped.set(line[key], [...(grouped.get(line[key]) || []), line]));
|
|
36
|
+
|
|
37
|
+
return grouped
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The lines that lead onward from the starts. A line back into a step still
|
|
42
|
+
* open is a loop, and a loop has no order to contribute.
|
|
43
|
+
*
|
|
44
|
+
* @param {object} graph The graph.
|
|
45
|
+
* @param graph.lines
|
|
46
|
+
* @param graph.startIds
|
|
47
|
+
* @return {Array<object>} The lines without those going back.
|
|
48
|
+
*/
|
|
49
|
+
function forwardLines({ lines, startIds }) {
|
|
50
|
+
const outgoing = linesBy(lines, 'source');
|
|
51
|
+
const seen = new Map();
|
|
52
|
+
const kept = [];
|
|
53
|
+
const visit = (id) => {
|
|
54
|
+
seen.set(id, 'open');
|
|
55
|
+
for (const line of outgoing.get(id) || []) {
|
|
56
|
+
if (seen.get(line.target) !== 'open') {
|
|
57
|
+
kept.push(line);
|
|
58
|
+
}
|
|
59
|
+
if (!seen.has(line.target)) {
|
|
60
|
+
visit(line.target);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
seen.set(id, 'done');
|
|
64
|
+
};
|
|
65
|
+
startIds.filter((id) => !seen.has(id)).forEach(visit);
|
|
66
|
+
|
|
67
|
+
return kept
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* How many steps deep each reached node is, by its longest way in.
|
|
72
|
+
*
|
|
73
|
+
* @param {object} graph The graph.
|
|
74
|
+
* @return {Map<string, number>} The depth per node id; a loose node has none.
|
|
75
|
+
*/
|
|
76
|
+
function depths(graph) {
|
|
77
|
+
const lines = forwardLines(graph);
|
|
78
|
+
const depth = new Map(graph.startIds.map((id) => [id, 0]));
|
|
79
|
+
const deepen = ({ source, target }) => {
|
|
80
|
+
if (depth.has(source) && (depth.get(target) ?? -1) <= depth.get(source)) {
|
|
81
|
+
depth.set(target, depth.get(source) + 1);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
graph.nodes.forEach(() => lines.forEach(deepen));
|
|
85
|
+
|
|
86
|
+
return depth
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The nodes in run order: by depth, then top to bottom and left to right as
|
|
91
|
+
* they stand on the canvas. Nodes nothing leads to come last.
|
|
92
|
+
*
|
|
93
|
+
* @param {object} graph The graph.
|
|
94
|
+
* @return {Array<{node: object, loose: boolean}>} The ordered nodes.
|
|
95
|
+
*/
|
|
96
|
+
function orderFlowNodes(graph) {
|
|
97
|
+
const depth = depths(graph);
|
|
98
|
+
const entries = graph.nodes.map((node, index) => ({
|
|
99
|
+
node,
|
|
100
|
+
index,
|
|
101
|
+
loose: !depth.has(node.id),
|
|
102
|
+
depth: depth.get(node.id) ?? Infinity,
|
|
103
|
+
...placeOf(node),
|
|
104
|
+
}));
|
|
105
|
+
const byDepth = (a, b) => (a.loose === b.loose ? (a.loose ? 0 : a.depth - b.depth) : (a.loose ? 1 : -1));
|
|
106
|
+
|
|
107
|
+
return entries.sort((a, b) => byDepth(a, b) || a.y - b.y || a.x - b.x || a.index - b.index)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @param {object} line A drawn line.
|
|
112
|
+
* @return {string} When it is taken: its name, else its condition in words.
|
|
113
|
+
*/
|
|
114
|
+
function lineText(line) {
|
|
115
|
+
return line.data?.label || line.data?.conditionText || ''
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The chip on a step: when the line into it is taken. A plain line in means
|
|
120
|
+
* the step is reached regardless, so there is no condition to name.
|
|
121
|
+
*
|
|
122
|
+
* @param {Array<object>} into The lines into the step.
|
|
123
|
+
* @return {string} The chip's text, or ''.
|
|
124
|
+
*/
|
|
125
|
+
function whenText(into) {
|
|
126
|
+
const texts = into.map(lineText);
|
|
127
|
+
if (texts.length === 0 || texts.includes('')) {
|
|
128
|
+
return ''
|
|
129
|
+
}
|
|
130
|
+
if (into.every((line) => !line.data?.label && !line.data?.condition)) {
|
|
131
|
+
return texts[0]
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return translate('nextcloud-vue', 'Only if {condition}', { condition: texts.join(` ${translate('nextcloud-vue', 'or')} `) })
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @param {object} graph The graph.
|
|
139
|
+
* @param {string} id A node id.
|
|
140
|
+
* @return {{into: Array<object>, out: Array<object>}} The lines of that node.
|
|
141
|
+
*/
|
|
142
|
+
function linesOf(graph, id) {
|
|
143
|
+
return {
|
|
144
|
+
into: graph.lines.filter((line) => line.target === id),
|
|
145
|
+
out: graph.lines.filter((line) => line.source === id),
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @param {object} node A node.
|
|
151
|
+
* @return {boolean} Whether it routes through declared exits.
|
|
152
|
+
*/
|
|
153
|
+
function branches(node) {
|
|
154
|
+
return Array.isArray(node.exits) && node.exits.length > 0
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @param {object} graph The graph.
|
|
159
|
+
* @param {object} node A node.
|
|
160
|
+
* @return {boolean} Whether it may trade places with a neighbour.
|
|
161
|
+
*/
|
|
162
|
+
function isMovable(graph, node) {
|
|
163
|
+
return !branches(node) && !node.start && !node.initial && graph.roleOf(node.type) === 'step'
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Whether two neighbours in the list are a plain link of one chain: only then
|
|
168
|
+
* does swapping them mean what the arrows promise. Steps on a branch keep their
|
|
169
|
+
* place until the canvas moves them.
|
|
170
|
+
*
|
|
171
|
+
* @param {object} graph The graph.
|
|
172
|
+
* @param {Array<object>} pair The first and the second node.
|
|
173
|
+
* @return {boolean} Whether they can swap.
|
|
174
|
+
*/
|
|
175
|
+
function canSwap(graph, [first, second]) {
|
|
176
|
+
if (!isMovable(graph, first) || !isMovable(graph, second)) {
|
|
177
|
+
return false
|
|
178
|
+
}
|
|
179
|
+
const { out } = linesOf(graph, first.id);
|
|
180
|
+
const { into, out: onward } = linesOf(graph, second.id);
|
|
181
|
+
|
|
182
|
+
return out.length === 1 && out[0].target === second.id && into.length === 1 && onward.length <= 1
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* @param {object} graph The graph.
|
|
187
|
+
* @return {Array<object>} The steps in order, triggers left out.
|
|
188
|
+
*/
|
|
189
|
+
function orderedSteps(graph) {
|
|
190
|
+
return orderFlowNodes(graph).filter(({ node }) => graph.roleOf(node.type) !== 'trigger')
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The two steps a move would swap.
|
|
195
|
+
*
|
|
196
|
+
* @param {object} graph The graph.
|
|
197
|
+
* @param {{id: string, by: number}} move The step and -1 (up) or 1 (down).
|
|
198
|
+
* @return {Array<string>|null} Their ids, first in the list first; null when the move cannot be made.
|
|
199
|
+
*/
|
|
200
|
+
function flowStepSwap(graph, { id, by }) {
|
|
201
|
+
const steps = orderedSteps(graph).map((entry) => entry.node);
|
|
202
|
+
const index = steps.findIndex((node) => node.id === id);
|
|
203
|
+
const pair = by < 0 ? [steps[index - 1], steps[index]] : [steps[index], steps[index + 1]];
|
|
204
|
+
if (index < 0 || !pair[0] || !pair[1]) {
|
|
205
|
+
return null
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return canSwap(graph, pair) ? pair.map((node) => node.id) : null
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Where a step's lines lead, as the routes under a branching step.
|
|
213
|
+
*
|
|
214
|
+
* @param {Array<object>} out The step's outgoing lines.
|
|
215
|
+
* @param {object} names `{ numbers, titleOf }`: step numbers by id and a name fallback.
|
|
216
|
+
* @param names.numbers
|
|
217
|
+
* @param names.titleOf
|
|
218
|
+
* @return {Array<{id: string, label: string, to: string}>} The routes; none when it does not branch.
|
|
219
|
+
*/
|
|
220
|
+
function routesOf(out, { numbers, titleOf }) {
|
|
221
|
+
if (out.length < 2) {
|
|
222
|
+
return []
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return out.map((line) => ({
|
|
226
|
+
id: line.id,
|
|
227
|
+
label: lineText(line) || translate('nextcloud-vue', 'Otherwise'),
|
|
228
|
+
to: numbers.has(line.target) ? translate('nextcloud-vue', 'Step {n}', { n: numbers.get(line.target) }) : titleOf(line.target),
|
|
229
|
+
}))
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @param {object} graph The graph.
|
|
234
|
+
* @param {object} names `{ numbers, titleOf }`: step numbers by id and a name by node.
|
|
235
|
+
* @return {(entry: {node: object, loose: boolean}) => object} Builds one row.
|
|
236
|
+
*/
|
|
237
|
+
function rowBuilder(graph, names) {
|
|
238
|
+
return ({ node, loose }) => {
|
|
239
|
+
const { into, out } = linesOf(graph, node.id);
|
|
240
|
+
|
|
241
|
+
return { id: node.id, node, role: graph.roleOf(node.type), loose, n: names.numbers.get(node.id), when: whenText(into), routes: routesOf(out, names) }
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The rows of the list.
|
|
247
|
+
*
|
|
248
|
+
* @param {object} graph The graph.
|
|
249
|
+
* @param {(node: object) => string} titleOf The name a node goes by.
|
|
250
|
+
* @return {{triggers: Array<object>, steps: Array<object>}} The rows.
|
|
251
|
+
*/
|
|
252
|
+
function flowStepRows(graph, titleOf) {
|
|
253
|
+
const ordered = orderFlowNodes(graph);
|
|
254
|
+
const steps = ordered.filter(({ node }) => graph.roleOf(node.type) !== 'trigger');
|
|
255
|
+
const numbers = new Map(steps.map(({ node }, index) => [node.id, index + 1]));
|
|
256
|
+
const row = rowBuilder(graph, { numbers, titleOf: (id) => titleOf(graph.nodes.find((node) => node.id === id) || { id }) });
|
|
257
|
+
const swaps = (index) => index >= 0 && index + 1 < steps.length && canSwap(graph, [steps[index].node, steps[index + 1].node]);
|
|
258
|
+
|
|
259
|
+
return {
|
|
260
|
+
triggers: ordered.filter(({ node }) => graph.roleOf(node.type) === 'trigger').map(row),
|
|
261
|
+
steps: steps.map((entry, index) => ({ ...row(entry), canMoveUp: swaps(index - 1), canMoveDown: swaps(index) })),
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {string|Array<string>} value An edge endpoint, one id or a list.
|
|
267
|
+
* @param {(id: string) => string} change What becomes of an id.
|
|
268
|
+
* @return {string|Array<string>} The endpoint with the ids changed.
|
|
269
|
+
*/
|
|
270
|
+
function mapEndpoint(value, change) {
|
|
271
|
+
return Array.isArray(value) ? value.map(change) : change(value)
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @param {object} edge A stored edge.
|
|
276
|
+
* @param {object} change `{ keys, map }`: the endpoint keys to touch and what becomes of an id.
|
|
277
|
+
* @param change.keys
|
|
278
|
+
* @param change.map
|
|
279
|
+
* @return {object} The edge with those endpoints changed, in its own spelling.
|
|
280
|
+
*/
|
|
281
|
+
function mapEdge(edge, { keys, map }) {
|
|
282
|
+
const next = { ...edge };
|
|
283
|
+
keys.filter((key) => key in next).forEach((key) => {
|
|
284
|
+
next[key] = mapEndpoint(next[key], map);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
return next
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Swap two steps in the stored edges, whichever spelling they use. What led
|
|
292
|
+
* into the first now leads into the second, and the other way round.
|
|
293
|
+
*
|
|
294
|
+
* @param {Array<object>} edges The stored edges.
|
|
295
|
+
* @param {Array<string>} pair The two ids.
|
|
296
|
+
* @return {Array<object>} The new edges.
|
|
297
|
+
*/
|
|
298
|
+
function swapStepEdges(edges, [first, second]) {
|
|
299
|
+
const map = (id) => (id === first ? second : (id === second ? first : id));
|
|
300
|
+
|
|
301
|
+
return edges.map((edge) => mapEdge(edge, { keys: ['from', 'to', 'source', 'target'], map }))
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @param {object} node A node.
|
|
306
|
+
* @return {object} Its canvas place, in the spellings it carries.
|
|
307
|
+
*/
|
|
308
|
+
function placeFields(node) {
|
|
309
|
+
const { x, y, position } = node;
|
|
310
|
+
|
|
311
|
+
return { x, y, position }
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Swap two steps' places on the canvas, so the canvas reads as the list does.
|
|
316
|
+
*
|
|
317
|
+
* @param {Array<object>} nodes The nodes.
|
|
318
|
+
* @param {Array<string>} pair The two ids.
|
|
319
|
+
* @return {Array<object>} The new nodes.
|
|
320
|
+
*/
|
|
321
|
+
function swapStepPlaces(nodes, [first, second]) {
|
|
322
|
+
const a = nodes.find((node) => node.id === first);
|
|
323
|
+
const b = nodes.find((node) => node.id === second);
|
|
324
|
+
const places = new Map([[first, placeFields(b)], [second, placeFields(a)]]);
|
|
325
|
+
|
|
326
|
+
return nodes.map((node) => (places.has(node.id) ? { ...node, ...places.get(node.id) } : node))
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Where a step added at the bottom of the list goes in the flow.
|
|
331
|
+
*
|
|
332
|
+
* @param {object} graph The graph, before the step is added.
|
|
333
|
+
* @return {{end: object|null, last: object|null}} The closing step, and the step left without a way on.
|
|
334
|
+
*/
|
|
335
|
+
function flowStepTail(graph) {
|
|
336
|
+
const reached = orderFlowNodes(graph).filter((entry) => !entry.loose).map((entry) => entry.node);
|
|
337
|
+
const ends = reached.filter((node) => graph.roleOf(node.type) === 'end');
|
|
338
|
+
const open = reached.filter((node) => graph.roleOf(node.type) !== 'end' && linesOf(graph, node.id).out.length === 0);
|
|
339
|
+
|
|
340
|
+
return { end: ends[ends.length - 1] || null, last: open[open.length - 1] || null }
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* The edges with a new step in at the bottom: before the closing step when
|
|
345
|
+
* there is one, else after the last step.
|
|
346
|
+
*
|
|
347
|
+
* @param {Array<object>} edges The stored edges.
|
|
348
|
+
* @param {object} insert `{ id, end, last }`: the new step and flowStepTail()'s answer.
|
|
349
|
+
* @param insert.id
|
|
350
|
+
* @param insert.end
|
|
351
|
+
* @param insert.last
|
|
352
|
+
* @return {Array<object>} The new edges.
|
|
353
|
+
*/
|
|
354
|
+
function insertStepEdges(edges, { id, end, last }) {
|
|
355
|
+
const map = (target) => (target === end?.id ? id : target);
|
|
356
|
+
const leadsToEnd = (edge) => end !== null && [].concat(edge.to ?? edge.target).includes(end.id);
|
|
357
|
+
const reachesEnd = edges.some(leadsToEnd);
|
|
358
|
+
const before = last !== null && !reachesEnd ? [{ from: last.id, to: id }] : [];
|
|
359
|
+
const after = end !== null ? [{ from: id, to: end.id }] : [];
|
|
360
|
+
|
|
361
|
+
return [...edges.map((edge) => mapEdge(edge, { keys: ['to', 'target'], map })), ...before, ...after]
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* The edge that closes the gap a removed step leaves in a chain.
|
|
366
|
+
*
|
|
367
|
+
* @param {object} graph The graph.
|
|
368
|
+
* @param {string} id The step being removed.
|
|
369
|
+
* @return {object|null} The edge, or null when the step is not a plain link of a chain.
|
|
370
|
+
*/
|
|
371
|
+
function flowStepBridge(graph, id) {
|
|
372
|
+
const node = graph.nodes.find((candidate) => candidate.id === id);
|
|
373
|
+
const { into, out } = linesOf(graph, id);
|
|
374
|
+
const plain = node && !branches(node) && into.length === 1 && out.length === 1;
|
|
375
|
+
if (!plain || out[0].target === into[0].source) {
|
|
376
|
+
return null
|
|
377
|
+
}
|
|
378
|
+
const edge = into[0].data.edge;
|
|
379
|
+
const single = !Array.isArray(edge.from ?? edge.source) && !Array.isArray(edge.to ?? edge.target);
|
|
380
|
+
|
|
381
|
+
return single ? { ...edge, ['to' in edge ? 'to' : 'target']: out[0].target } : null
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export { flowStepBridge, flowStepRows, flowStepSwap, flowStepTail, insertStepEdges, orderFlowNodes, swapStepEdges, swapStepPlaces };
|
|
385
|
+
//# sourceMappingURL=flowStepList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowStepList.js","sources":["../../../src/utils/flowStepList.js"],"sourcesContent":["/**\n * SPDX-License-Identifier: EUPL-1.2\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n */\n\nimport { translate as t } from '@nextcloud/l10n'\n\n/**\n * The list reading of a flow: the trigger, then the steps in run order.\n *\n * Nothing here is stored. The rows are derived from the flow document the\n * canvas draws and every change goes back into that document, so the two views\n * cannot drift.\n *\n * A `graph` is `{ nodes, lines, startIds, roleOf }`: the document's nodes, the\n * store's `canvasEdges`, its `startNodeIds` and its `roleOfNodeType`.\n */\n\n/**\n * @param {object} node A flow node.\n * @return {{x: number, y: number}} Where it stands on the canvas.\n */\nfunction placeOf(node) {\n\treturn { x: node.position?.x ?? node.x ?? 0, y: node.position?.y ?? node.y ?? 0 }\n}\n\n/**\n * @param {Array<object>} lines The lines.\n * @param {string} key `source` or `target`.\n * @return {Map<string, Array<object>>} The lines by that end.\n */\nfunction linesBy(lines, key) {\n\tconst grouped = new Map()\n\tlines.forEach((line) => grouped.set(line[key], [...(grouped.get(line[key]) || []), line]))\n\n\treturn grouped\n}\n\n/**\n * The lines that lead onward from the starts. A line back into a step still\n * open is a loop, and a loop has no order to contribute.\n *\n * @param {object} graph The graph.\n * @param graph.lines\n * @param graph.startIds\n * @return {Array<object>} The lines without those going back.\n */\nfunction forwardLines({ lines, startIds }) {\n\tconst outgoing = linesBy(lines, 'source')\n\tconst seen = new Map()\n\tconst kept = []\n\tconst visit = (id) => {\n\t\tseen.set(id, 'open')\n\t\tfor (const line of outgoing.get(id) || []) {\n\t\t\tif (seen.get(line.target) !== 'open') {\n\t\t\t\tkept.push(line)\n\t\t\t}\n\t\t\tif (!seen.has(line.target)) {\n\t\t\t\tvisit(line.target)\n\t\t\t}\n\t\t}\n\t\tseen.set(id, 'done')\n\t}\n\tstartIds.filter((id) => !seen.has(id)).forEach(visit)\n\n\treturn kept\n}\n\n/**\n * How many steps deep each reached node is, by its longest way in.\n *\n * @param {object} graph The graph.\n * @return {Map<string, number>} The depth per node id; a loose node has none.\n */\nfunction depths(graph) {\n\tconst lines = forwardLines(graph)\n\tconst depth = new Map(graph.startIds.map((id) => [id, 0]))\n\tconst deepen = ({ source, target }) => {\n\t\tif (depth.has(source) && (depth.get(target) ?? -1) <= depth.get(source)) {\n\t\t\tdepth.set(target, depth.get(source) + 1)\n\t\t}\n\t}\n\tgraph.nodes.forEach(() => lines.forEach(deepen))\n\n\treturn depth\n}\n\n/**\n * The nodes in run order: by depth, then top to bottom and left to right as\n * they stand on the canvas. Nodes nothing leads to come last.\n *\n * @param {object} graph The graph.\n * @return {Array<{node: object, loose: boolean}>} The ordered nodes.\n */\nexport function orderFlowNodes(graph) {\n\tconst depth = depths(graph)\n\tconst entries = graph.nodes.map((node, index) => ({\n\t\tnode,\n\t\tindex,\n\t\tloose: !depth.has(node.id),\n\t\tdepth: depth.get(node.id) ?? Infinity,\n\t\t...placeOf(node),\n\t}))\n\tconst byDepth = (a, b) => (a.loose === b.loose ? (a.loose ? 0 : a.depth - b.depth) : (a.loose ? 1 : -1))\n\n\treturn entries.sort((a, b) => byDepth(a, b) || a.y - b.y || a.x - b.x || a.index - b.index)\n}\n\n/**\n * @param {object} line A drawn line.\n * @return {string} When it is taken: its name, else its condition in words.\n */\nfunction lineText(line) {\n\treturn line.data?.label || line.data?.conditionText || ''\n}\n\n/**\n * The chip on a step: when the line into it is taken. A plain line in means\n * the step is reached regardless, so there is no condition to name.\n *\n * @param {Array<object>} into The lines into the step.\n * @return {string} The chip's text, or ''.\n */\nfunction whenText(into) {\n\tconst texts = into.map(lineText)\n\tif (texts.length === 0 || texts.includes('')) {\n\t\treturn ''\n\t}\n\tif (into.every((line) => !line.data?.label && !line.data?.condition)) {\n\t\treturn texts[0]\n\t}\n\n\treturn t('nextcloud-vue', 'Only if {condition}', { condition: texts.join(` ${t('nextcloud-vue', 'or')} `) })\n}\n\n/**\n * @param {object} graph The graph.\n * @param {string} id A node id.\n * @return {{into: Array<object>, out: Array<object>}} The lines of that node.\n */\nfunction linesOf(graph, id) {\n\treturn {\n\t\tinto: graph.lines.filter((line) => line.target === id),\n\t\tout: graph.lines.filter((line) => line.source === id),\n\t}\n}\n\n/**\n * @param {object} node A node.\n * @return {boolean} Whether it routes through declared exits.\n */\nfunction branches(node) {\n\treturn Array.isArray(node.exits) && node.exits.length > 0\n}\n\n/**\n * @param {object} graph The graph.\n * @param {object} node A node.\n * @return {boolean} Whether it may trade places with a neighbour.\n */\nfunction isMovable(graph, node) {\n\treturn !branches(node) && !node.start && !node.initial && graph.roleOf(node.type) === 'step'\n}\n\n/**\n * Whether two neighbours in the list are a plain link of one chain: only then\n * does swapping them mean what the arrows promise. Steps on a branch keep their\n * place until the canvas moves them.\n *\n * @param {object} graph The graph.\n * @param {Array<object>} pair The first and the second node.\n * @return {boolean} Whether they can swap.\n */\nfunction canSwap(graph, [first, second]) {\n\tif (!isMovable(graph, first) || !isMovable(graph, second)) {\n\t\treturn false\n\t}\n\tconst { out } = linesOf(graph, first.id)\n\tconst { into, out: onward } = linesOf(graph, second.id)\n\n\treturn out.length === 1 && out[0].target === second.id && into.length === 1 && onward.length <= 1\n}\n\n/**\n * @param {object} graph The graph.\n * @return {Array<object>} The steps in order, triggers left out.\n */\nfunction orderedSteps(graph) {\n\treturn orderFlowNodes(graph).filter(({ node }) => graph.roleOf(node.type) !== 'trigger')\n}\n\n/**\n * The two steps a move would swap.\n *\n * @param {object} graph The graph.\n * @param {{id: string, by: number}} move The step and -1 (up) or 1 (down).\n * @return {Array<string>|null} Their ids, first in the list first; null when the move cannot be made.\n */\nexport function flowStepSwap(graph, { id, by }) {\n\tconst steps = orderedSteps(graph).map((entry) => entry.node)\n\tconst index = steps.findIndex((node) => node.id === id)\n\tconst pair = by < 0 ? [steps[index - 1], steps[index]] : [steps[index], steps[index + 1]]\n\tif (index < 0 || !pair[0] || !pair[1]) {\n\t\treturn null\n\t}\n\n\treturn canSwap(graph, pair) ? pair.map((node) => node.id) : null\n}\n\n/**\n * Where a step's lines lead, as the routes under a branching step.\n *\n * @param {Array<object>} out The step's outgoing lines.\n * @param {object} names `{ numbers, titleOf }`: step numbers by id and a name fallback.\n * @param names.numbers\n * @param names.titleOf\n * @return {Array<{id: string, label: string, to: string}>} The routes; none when it does not branch.\n */\nfunction routesOf(out, { numbers, titleOf }) {\n\tif (out.length < 2) {\n\t\treturn []\n\t}\n\n\treturn out.map((line) => ({\n\t\tid: line.id,\n\t\tlabel: lineText(line) || t('nextcloud-vue', 'Otherwise'),\n\t\tto: numbers.has(line.target) ? t('nextcloud-vue', 'Step {n}', { n: numbers.get(line.target) }) : titleOf(line.target),\n\t}))\n}\n\n/**\n * @param {object} graph The graph.\n * @param {object} names `{ numbers, titleOf }`: step numbers by id and a name by node.\n * @return {(entry: {node: object, loose: boolean}) => object} Builds one row.\n */\nfunction rowBuilder(graph, names) {\n\treturn ({ node, loose }) => {\n\t\tconst { into, out } = linesOf(graph, node.id)\n\n\t\treturn { id: node.id, node, role: graph.roleOf(node.type), loose, n: names.numbers.get(node.id), when: whenText(into), routes: routesOf(out, names) }\n\t}\n}\n\n/**\n * The rows of the list.\n *\n * @param {object} graph The graph.\n * @param {(node: object) => string} titleOf The name a node goes by.\n * @return {{triggers: Array<object>, steps: Array<object>}} The rows.\n */\nexport function flowStepRows(graph, titleOf) {\n\tconst ordered = orderFlowNodes(graph)\n\tconst steps = ordered.filter(({ node }) => graph.roleOf(node.type) !== 'trigger')\n\tconst numbers = new Map(steps.map(({ node }, index) => [node.id, index + 1]))\n\tconst row = rowBuilder(graph, { numbers, titleOf: (id) => titleOf(graph.nodes.find((node) => node.id === id) || { id }) })\n\tconst swaps = (index) => index >= 0 && index + 1 < steps.length && canSwap(graph, [steps[index].node, steps[index + 1].node])\n\n\treturn {\n\t\ttriggers: ordered.filter(({ node }) => graph.roleOf(node.type) === 'trigger').map(row),\n\t\tsteps: steps.map((entry, index) => ({ ...row(entry), canMoveUp: swaps(index - 1), canMoveDown: swaps(index) })),\n\t}\n}\n\n/**\n * @param {string|Array<string>} value An edge endpoint, one id or a list.\n * @param {(id: string) => string} change What becomes of an id.\n * @return {string|Array<string>} The endpoint with the ids changed.\n */\nfunction mapEndpoint(value, change) {\n\treturn Array.isArray(value) ? value.map(change) : change(value)\n}\n\n/**\n * @param {object} edge A stored edge.\n * @param {object} change `{ keys, map }`: the endpoint keys to touch and what becomes of an id.\n * @param change.keys\n * @param change.map\n * @return {object} The edge with those endpoints changed, in its own spelling.\n */\nfunction mapEdge(edge, { keys, map }) {\n\tconst next = { ...edge }\n\tkeys.filter((key) => key in next).forEach((key) => {\n\t\tnext[key] = mapEndpoint(next[key], map)\n\t})\n\n\treturn next\n}\n\n/**\n * Swap two steps in the stored edges, whichever spelling they use. What led\n * into the first now leads into the second, and the other way round.\n *\n * @param {Array<object>} edges The stored edges.\n * @param {Array<string>} pair The two ids.\n * @return {Array<object>} The new edges.\n */\nexport function swapStepEdges(edges, [first, second]) {\n\tconst map = (id) => (id === first ? second : (id === second ? first : id))\n\n\treturn edges.map((edge) => mapEdge(edge, { keys: ['from', 'to', 'source', 'target'], map }))\n}\n\n/**\n * @param {object} node A node.\n * @return {object} Its canvas place, in the spellings it carries.\n */\nfunction placeFields(node) {\n\tconst { x, y, position } = node\n\n\treturn { x, y, position }\n}\n\n/**\n * Swap two steps' places on the canvas, so the canvas reads as the list does.\n *\n * @param {Array<object>} nodes The nodes.\n * @param {Array<string>} pair The two ids.\n * @return {Array<object>} The new nodes.\n */\nexport function swapStepPlaces(nodes, [first, second]) {\n\tconst a = nodes.find((node) => node.id === first)\n\tconst b = nodes.find((node) => node.id === second)\n\tconst places = new Map([[first, placeFields(b)], [second, placeFields(a)]])\n\n\treturn nodes.map((node) => (places.has(node.id) ? { ...node, ...places.get(node.id) } : node))\n}\n\n/**\n * Where a step added at the bottom of the list goes in the flow.\n *\n * @param {object} graph The graph, before the step is added.\n * @return {{end: object|null, last: object|null}} The closing step, and the step left without a way on.\n */\nexport function flowStepTail(graph) {\n\tconst reached = orderFlowNodes(graph).filter((entry) => !entry.loose).map((entry) => entry.node)\n\tconst ends = reached.filter((node) => graph.roleOf(node.type) === 'end')\n\tconst open = reached.filter((node) => graph.roleOf(node.type) !== 'end' && linesOf(graph, node.id).out.length === 0)\n\n\treturn { end: ends[ends.length - 1] || null, last: open[open.length - 1] || null }\n}\n\n/**\n * The edges with a new step in at the bottom: before the closing step when\n * there is one, else after the last step.\n *\n * @param {Array<object>} edges The stored edges.\n * @param {object} insert `{ id, end, last }`: the new step and flowStepTail()'s answer.\n * @param insert.id\n * @param insert.end\n * @param insert.last\n * @return {Array<object>} The new edges.\n */\nexport function insertStepEdges(edges, { id, end, last }) {\n\tconst map = (target) => (target === end?.id ? id : target)\n\tconst leadsToEnd = (edge) => end !== null && [].concat(edge.to ?? edge.target).includes(end.id)\n\tconst reachesEnd = edges.some(leadsToEnd)\n\tconst before = last !== null && !reachesEnd ? [{ from: last.id, to: id }] : []\n\tconst after = end !== null ? [{ from: id, to: end.id }] : []\n\n\treturn [...edges.map((edge) => mapEdge(edge, { keys: ['to', 'target'], map })), ...before, ...after]\n}\n\n/**\n * The edge that closes the gap a removed step leaves in a chain.\n *\n * @param {object} graph The graph.\n * @param {string} id The step being removed.\n * @return {object|null} The edge, or null when the step is not a plain link of a chain.\n */\nexport function flowStepBridge(graph, id) {\n\tconst node = graph.nodes.find((candidate) => candidate.id === id)\n\tconst { into, out } = linesOf(graph, id)\n\tconst plain = node && !branches(node) && into.length === 1 && out.length === 1\n\tif (!plain || out[0].target === into[0].source) {\n\t\treturn null\n\t}\n\tconst edge = into[0].data.edge\n\tconst single = !Array.isArray(edge.from ?? edge.source) && !Array.isArray(edge.to ?? edge.target)\n\n\treturn single ? { ...edge, ['to' in edge ? 'to' : 'target']: out[0].target } : null\n}\n"],"names":["t"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;AAClF,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE;AAC7B,CAAC,MAAM,OAAO,GAAG,IAAI,GAAG,GAAE;AAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,EAAC;AAC3F;AACA,CAAC,OAAO,OAAO;AACf,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;AAC3C,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAC;AAC1C,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,GAAE;AACvB,CAAC,MAAM,IAAI,GAAG,GAAE;AAChB,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK;AACvB,EAAE,IAAI,CAA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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libraryWidgetKeys.js","sources":["../../../src/utils/libraryWidgetKeys.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * libraryWidgetKeys — the one vocabulary of widget keys the LIBRARY itself\n * renders, and the only list `validateManifestV2` is allowed to consult.\n *\n * WHY THIS MODULE EXISTS\n * ----------------------\n * The validator used to carry its own hand-written array of \"library built-in\n * widget keys\", with a comment instructing whoever added a built-in to append\n * it \"in the same PR\". That instruction was followed for five keys and missed\n * for six, so the validator knew 11 keys while the library actually rendered\n * 45. Nothing failed when the two disagreed, because the only consumer is an\n * exemption: a key the validator does not recognise is treated as a CUSTOM\n * registry component, which makes a legitimate single-widget library dashboard\n * fail the ADR-036 Decision 1 anti-pattern rule with advice (\"declare it as\n * type:'custom'\") that is wrong for a library widget.\n *\n * A comment cannot enforce anything, so the array moved here and\n * `tests/utils/libraryWidgetKeys.spec.js` now binds it to the two registries\n * that actually resolve a key at runtime:\n *\n * 1. `BUILT_IN_WIDGETS` (components/CnWidgetGrid/builtInWidgets.js) — the v2\n * manifest widget set `CnWidgetGrid` resolves a `widgetKey` against.\n * 2. The dashboard widget catalog (`dashboardWidgetRegistry`), populated by\n * `registerDashboardWidgets.js`. `CnWidgetGrid` falls back to it (third in\n * the chain, after the consumer registry and `BUILT_IN_WIDGETS`), so a\n * catalog key renders on a v2 page exactly like a `BUILT_IN_WIDGETS` one.\n *\n * The test asserts SET EQUALITY in both directions against the live registries,\n * so adding a widget to either registry without touching this file fails CI,\n * and deleting one without removing it here fails too. The lists below are the\n * validator's view; the registries are the truth the test holds them to.\n *\n * THE CATALOG IS NOT LEGACY. It is a live half of the same vocabulary, and the\n * old array already conceded the point by exempting `chart` and `stats-block`,\n * which are catalog-only keys that `BUILT_IN_WIDGETS` has never held. What it\n * got wrong was doing that for two keys and not the other thirty-seven.\n * `widgetDispatch.js` unified the two resolution paths for the same reason: a\n * widget authored against one vocabulary was invisible to the other and said\n * nothing about why (101 of 236 detail widgets on hrmq).\n *\n * @module utils/libraryWidgetKeys\n */\n\nimport { WIDGET_TYPE_ALIASES } from './widgetTypeAliases.js'\n\n/**\n * Keys of `BUILT_IN_WIDGETS` — the v2 manifest widget set.\n *\n * Kept in the registry's own declaration order so a diff against\n * `builtInWidgets.js` reads straight down.\n *\n * @type {string[]} Frozen.\n */\nexport const BUILT_IN_WIDGET_KEYS = Object.freeze([\n\t'object-table',\n\t'form-renderer',\n\t'map-viewer',\n\t'notice',\n\t'decision-list',\n\t'object-geo',\n\t'card-grid',\n\t'nav-card-grid',\n\t'data',\n\t'metadata',\n\t'related',\n\t'integration',\n\t'banner',\n\t'audit-trail',\n\t'timeline',\n\t'header',\n\t'text',\n\t'divider',\n\t'saved-view-alert',\n\t'exports',\n\t'object-translations',\n])\n\n/**\n * Widget types the LIBRARY registers into the dashboard catalog at import time\n * (`registerDashboardWidgets.js` and the widget `index.js` modules it pulls in).\n *\n * Deliberately a static list rather than a read of `dashboardWidgetRegistry`:\n * that object is mutable and consumer-extensible, so deriving the exemption\n * from it at call time would let an app register its own full-page component in\n * the catalog and walk straight through the ADR-036 Decision 1 rule the\n * exemption exists to enforce. Only keys the library itself ships are exempt.\n *\n * Sorted, because unlike `BUILT_IN_WIDGETS` these registrations are spread over\n * ~30 files and have no meaningful declaration order.\n *\n * @type {string[]} Frozen.\n */\nexport const DASHBOARD_CATALOG_WIDGET_KEYS = Object.freeze([\n\t'action-tiles',\n\t'ai-chat',\n\t'app-tiles',\n\t'attention-flag',\n\t'audit-trail',\n\t'banner',\n\t'calendar',\n\t'chart',\n\t'checklist',\n\t'checklist-run',\n\t'chips-field',\n\t'choice-picker',\n\t'conflict-resolve',\n\t'container',\n\t'conversation',\n\t'countdown',\n\t'create-form',\n\t'data',\n\t'delta',\n\t'device-frames',\n\t'divider',\n\t'document-review',\n\t'events',\n\t'facts',\n\t'field-groups',\n\t'field-list',\n\t'files',\n\t'flow-runs',\n\t'gauge',\n\t'grouped-cards',\n\t'handoff',\n\t'header',\n\t'image',\n\t'index-list',\n\t'interaction-form',\n\t'kb-search',\n\t'label',\n\t'link',\n\t'linked',\n\t'links',\n\t'macros',\n\t'mail',\n\t'map',\n\t'markdown',\n\t'menu',\n\t'nc-widget',\n\t'next-step',\n\t'notepad',\n\t// `news` was here until the widget moved to LaunchPad, which owns the feed\n\t// fetching. An app that renders one now gets it from LaunchPad's registry.\n\t'object-geo',\n\t'object-links',\n\t'object-list',\n\t'object-table',\n\t'parties',\n\t'party-actions',\n\t'people',\n\t'plan',\n\t'quicklinks',\n\t'radio-cards',\n\t'record-list',\n\t'record-notes',\n\t'related',\n\t'retention',\n\t'row-mark-list',\n\t'saved-view',\n\t'saved-views',\n\t'schema-rules',\n\t'sections',\n\t'slot-grid',\n\t'settings-form',\n\t'share-list',\n\t'spend-analytics',\n\t'stacked-bar',\n\t'stages',\n\t'stat',\n\t'stat-grid',\n\t'stats-block',\n\t'status-explainer',\n\t'switch-rows',\n\t'table',\n\t'tabs',\n\t'tasks',\n\t'team-workload',\n\t'text',\n\t'tile',\n\t'timeline',\n\t'toggle-table',\n\t'video',\n\t'week-strip',\n\t'working-calendar',\n\t'work-queue',\n\t'workspace-filter',\n])\n\n/**\n * Expand a key set over `WIDGET_TYPE_ALIASES` so both spellings of an aliased\n * widget are present whenever either one is.\n *\n * `CnWidgetGrid` resolves a key and its canonical form (`object-table` ⇄\n * `table`, `map-viewer` ⇄ `map`), so both spellings render and both must be\n * exempt. Today each registry happens to hold one side of each pair, which is\n * exactly the accident that would silently stop being true when the next alias\n * lands.\n *\n * @param {Set<string>} keys The key set to expand, mutated in place.\n * @return {Set<string>} The same set.\n */\nfunction expandAliases(keys) {\n\tfor (const [alias, canonical] of Object.entries(WIDGET_TYPE_ALIASES)) {\n\t\tif (keys.has(alias) || keys.has(canonical)) {\n\t\t\tkeys.add(alias)\n\t\t\tkeys.add(canonical)\n\t\t}\n\t}\n\treturn keys\n}\n\n/**\n * Every widget key the library renders itself: both registries, plus both\n * spellings of every alias.\n *\n * A `widgetKey` in this list is served by a library `Cn*` SFC and does NOT\n * count as a custom registry component for the single-12×12-widget dashboard\n * rule (ADR-036 Decision 1).\n *\n * @type {string[]} Frozen.\n */\nexport const LIBRARY_WIDGET_KEYS = Object.freeze([\n\t...expandAliases(new Set([\n\t\t...BUILT_IN_WIDGET_KEYS,\n\t\t...DASHBOARD_CATALOG_WIDGET_KEYS,\n\t])),\n])\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;AAClD,CAAC,cAAc;AACf,CAAC,eAAe;AAChB,CAAC,YAAY;AACb,CAAC,QAAQ;AACT,CAAC,eAAe;AAChB,CAAC,YAAY;AACb,CAAC,WAAW;AACZ,CAAC,eAAe;AAChB,CAAC,MAAM;AACP,CAAC,UAAU;AACX,CAAC,SAAS;AACV,CAAC,aAAa;AACd,CAAC,QAAQ;AACT,CAAC,aAAa;AACd,CAAC,UAAU;AACX,CAAC,QAAQ;AACT,CAAC,MAAM;AACP,CAAC,SAAS;AACV,CAAC,kBAAkB;AACnB,CAAC,SAAS;AACV,CAAC,qBAAqB;AACtB,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3D,CAAC,cAAc;AACf,CAAC,SAAS;AACV,CAAC,WAAW;AACZ,CAAC,gB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MAAM;AACP,CAAC,WAAW;AACZ,CAAC,aAAa;AACd,CAAC,kBAAkB;AACnB,CAAC,aAAa;AACd,CAAC,OAAO;AACR,CAAC,MAAM;AACP,CAAC,OAAO;AACR,CAAC,eAAe;AAChB,CAAC,MAAM;AACP,CAAC,MAAM;AACP,CAAC,UAAU;AACX,CAAC,cAAc;AACf,CAAC,OAAO;AACR,CAAC,YAAY;AACb,CAAC,kBAAkB;AACnB,CAAC,YAAY;AACb,CAAC,kBAAkB;AACnB,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;AACvE,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;AAC9C,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAC;AAClB,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAC;AACtB,GAAG;AACH,EAAE;AACF,CAAC,OAAO,IAAI;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;AACjD,CAAC,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC;AAC1B,EAAE,GAAG,oBAAoB;AACzB,EAAE,GAAG,6BAA6B;AAClC,EAAE,CAAC,CAAC;AACJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"libraryWidgetKeys.js","sources":["../../../src/utils/libraryWidgetKeys.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * libraryWidgetKeys — the one vocabulary of widget keys the LIBRARY itself\n * renders, and the only list `validateManifestV2` is allowed to consult.\n *\n * WHY THIS MODULE EXISTS\n * ----------------------\n * The validator used to carry its own hand-written array of \"library built-in\n * widget keys\", with a comment instructing whoever added a built-in to append\n * it \"in the same PR\". That instruction was followed for five keys and missed\n * for six, so the validator knew 11 keys while the library actually rendered\n * 45. Nothing failed when the two disagreed, because the only consumer is an\n * exemption: a key the validator does not recognise is treated as a CUSTOM\n * registry component, which makes a legitimate single-widget library dashboard\n * fail the ADR-036 Decision 1 anti-pattern rule with advice (\"declare it as\n * type:'custom'\") that is wrong for a library widget.\n *\n * A comment cannot enforce anything, so the array moved here and\n * `tests/utils/libraryWidgetKeys.spec.js` now binds it to the two registries\n * that actually resolve a key at runtime:\n *\n * 1. `BUILT_IN_WIDGETS` (components/CnWidgetGrid/builtInWidgets.js) — the v2\n * manifest widget set `CnWidgetGrid` resolves a `widgetKey` against.\n * 2. The dashboard widget catalog (`dashboardWidgetRegistry`), populated by\n * `registerDashboardWidgets.js`. `CnWidgetGrid` falls back to it (third in\n * the chain, after the consumer registry and `BUILT_IN_WIDGETS`), so a\n * catalog key renders on a v2 page exactly like a `BUILT_IN_WIDGETS` one.\n *\n * The test asserts SET EQUALITY in both directions against the live registries,\n * so adding a widget to either registry without touching this file fails CI,\n * and deleting one without removing it here fails too. The lists below are the\n * validator's view; the registries are the truth the test holds them to.\n *\n * THE CATALOG IS NOT LEGACY. It is a live half of the same vocabulary, and the\n * old array already conceded the point by exempting `chart` and `stats-block`,\n * which are catalog-only keys that `BUILT_IN_WIDGETS` has never held. What it\n * got wrong was doing that for two keys and not the other thirty-seven.\n * `widgetDispatch.js` unified the two resolution paths for the same reason: a\n * widget authored against one vocabulary was invisible to the other and said\n * nothing about why (101 of 236 detail widgets on hrmq).\n *\n * @module utils/libraryWidgetKeys\n */\n\nimport { WIDGET_TYPE_ALIASES } from './widgetTypeAliases.js'\n\n/**\n * Keys of `BUILT_IN_WIDGETS` — the v2 manifest widget set.\n *\n * Kept in the registry's own declaration order so a diff against\n * `builtInWidgets.js` reads straight down.\n *\n * @type {string[]} Frozen.\n */\nexport const BUILT_IN_WIDGET_KEYS = Object.freeze([\n\t'object-table',\n\t'form-renderer',\n\t'map-viewer',\n\t'notice',\n\t'decision-list',\n\t'object-geo',\n\t'card-grid',\n\t'nav-card-grid',\n\t'data',\n\t'metadata',\n\t'related',\n\t'integration',\n\t'banner',\n\t'audit-trail',\n\t'timeline',\n\t'header',\n\t'text',\n\t'divider',\n\t'saved-view-alert',\n\t'exports',\n\t'object-translations',\n])\n\n/**\n * Widget types the LIBRARY registers into the dashboard catalog at import time\n * (`registerDashboardWidgets.js` and the widget `index.js` modules it pulls in).\n *\n * Deliberately a static list rather than a read of `dashboardWidgetRegistry`:\n * that object is mutable and consumer-extensible, so deriving the exemption\n * from it at call time would let an app register its own full-page component in\n * the catalog and walk straight through the ADR-036 Decision 1 rule the\n * exemption exists to enforce. Only keys the library itself ships are exempt.\n *\n * Sorted, because unlike `BUILT_IN_WIDGETS` these registrations are spread over\n * ~30 files and have no meaningful declaration order.\n *\n * @type {string[]} Frozen.\n */\nexport const DASHBOARD_CATALOG_WIDGET_KEYS = Object.freeze([\n\t'action-tiles',\n\t'ai-chat',\n\t'app-tiles',\n\t'attention-flag',\n\t'audit-trail',\n\t'banner',\n\t'calendar',\n\t'chart',\n\t'checklist',\n\t'checklist-run',\n\t'chips-field',\n\t'choice-picker',\n\t'conflict-resolve',\n\t'container',\n\t'conversation',\n\t'countdown',\n\t'create-form',\n\t'data',\n\t'delta',\n\t'device-frames',\n\t'divider',\n\t'document-review',\n\t'events',\n\t'facts',\n\t'field-groups',\n\t'field-list',\n\t'files',\n\t'flow-runs',\n\t'gauge',\n\t'grouped-cards',\n\t'handoff',\n\t'header',\n\t'image',\n\t'index-list',\n\t'interaction-form',\n\t'kb-search',\n\t'label',\n\t'link',\n\t'linked',\n\t'links',\n\t'macros',\n\t'mail',\n\t'map',\n\t'markdown',\n\t'menu',\n\t'nc-widget',\n\t'next-step',\n\t'notepad',\n\t// `news` was here until the widget moved to LaunchPad, which owns the feed\n\t// fetching. An app that renders one now gets it from LaunchPad's registry.\n\t'object-geo',\n\t'object-links',\n\t'object-list',\n\t'object-table',\n\t'parties',\n\t'party-actions',\n\t'people',\n\t'plan',\n\t'quicklinks',\n\t'radio-cards',\n\t'record-list',\n\t'record-notes',\n\t'related',\n\t'retention',\n\t'row-mark-list',\n\t'saved-view',\n\t'saved-views',\n\t'schema-rules',\n\t'sections',\n\t'slot-grid',\n\t'settings-form',\n\t'share-list',\n\t'task-form',\n\t'spend-analytics',\n\t'stacked-bar',\n\t'stages',\n\t'stat',\n\t'stat-grid',\n\t'stats-block',\n\t'status-explainer',\n\t'switch-rows',\n\t'table',\n\t'tabs',\n\t'tasks',\n\t'team-workload',\n\t'text',\n\t'tile',\n\t'timeline',\n\t'toggle-table',\n\t'video',\n\t'week-strip',\n\t'working-calendar',\n\t'work-queue',\n\t'workspace-filter',\n])\n\n/**\n * Expand a key set over `WIDGET_TYPE_ALIASES` so both spellings of an aliased\n * widget are present whenever either one is.\n *\n * `CnWidgetGrid` resolves a key and its canonical form (`object-table` ⇄\n * `table`, `map-viewer` ⇄ `map`), so both spellings render and both must be\n * exempt. Today each registry happens to hold one side of each pair, which is\n * exactly the accident that would silently stop being true when the next alias\n * lands.\n *\n * @param {Set<string>} keys The key set to expand, mutated in place.\n * @return {Set<string>} The same set.\n */\nfunction expandAliases(keys) {\n\tfor (const [alias, canonical] of Object.entries(WIDGET_TYPE_ALIASES)) {\n\t\tif (keys.has(alias) || keys.has(canonical)) {\n\t\t\tkeys.add(alias)\n\t\t\tkeys.add(canonical)\n\t\t}\n\t}\n\treturn keys\n}\n\n/**\n * Every widget key the library renders itself: both registries, plus both\n * spellings of every alias.\n *\n * A `widgetKey` in this list is served by a library `Cn*` SFC and does NOT\n * count as a custom registry component for the single-12×12-widget dashboard\n * rule (ADR-036 Decision 1).\n *\n * @type {string[]} Frozen.\n */\nexport const LIBRARY_WIDGET_KEYS = Object.freeze([\n\t...expandAliases(new Set([\n\t\t...BUILT_IN_WIDGET_KEYS,\n\t\t...DASHBOARD_CATALOG_WIDGET_KEYS,\n\t])),\n])\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;AAClD,CAAC,cAAc;AACf,CAAC,eAAe;AAChB,CAAC,YAAY;AACb,CAAC,QAAQ;AACT,CAAC,eAAe;AAChB,CAAC,YAAY;AACb,CAAC,WAAW;AACZ,CAAC,eAAe;AAChB,CAAC,MAAM;AACP,CAAC,UAAU;AACX,CAAC,SAAS;AACV,CAAC,aAAa;AACd,CAAC,QAAQ;AACT,CAAC,aAAa;AACd,CAAC,UAAU;AACX,CAAC,QAAQ;AACT,CAAC,MAAM;AACP,CAAC,SAAS;AACV,CAAC,kBAAkB;AACnB,CAAC,SAAS;AACV,CAAC,qBAAqB;AACtB,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3D,CAAC,cAAc;AACf,CAAC,SAAS;AACV,CAAC,WAAW;AACZ,CAAC,gBAAgB;AACjB,CAAC,aAAa;AACd,CAAC,QAAQ;AACT,CAAC,UAAU;AACX,CAAC,OAAO;AACR,CAAC,WAAW;AACZ,CAAC,eAAe;AAChB,CAAC,aAAa;AACd,CAAC,eAAe;AAChB,CAAC,kBAAkB;AACnB,CAAC,WAAW;AACZ,CAAC,cAAc;AAC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AAC,UAAU;AACX,CAAC,cAAc;AACf,CAAC,OAAO;AACR,CAAC,YAAY;AACb,CAAC,kBAAkB;AACnB,CAAC,YAAY;AACb,CAAC,kBAAkB;AACnB,CAAC,EAAC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE;AACvE,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;AAC9C,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAC;AAClB,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAC;AACtB,GAAG;AACH,EAAE;AACF,CAAC,OAAO,IAAI;AACZ,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;AACjD,CAAC,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC;AAC1B,EAAE,GAAG,oBAAoB;AACzB,EAAE,GAAG,6BAA6B;AAClC,EAAE,CAAC,CAAC;AACJ,CAAC;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
5
|
* SPDX-License-Identifier: EUPL-1.2
|
|
@@ -58,5 +60,37 @@ function readSearchRefusal(error, term) {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
|
|
61
|
-
|
|
63
|
+
/**
|
|
64
|
+
* A refused search as a state notice under the search field: the position in
|
|
65
|
+
* the title, the server's reason, then that the list is not filtered. `title`
|
|
66
|
+
* (with `{position}`) and `after` replace the library's words, through the
|
|
67
|
+
* app's translate.
|
|
68
|
+
*
|
|
69
|
+
* @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field
|
|
70
|
+
* @param {{message: string, position: number}} refusal What `readSearchRefusal` read.
|
|
71
|
+
* @param {{title?: string, after?: string}|null} [words] The page's own words.
|
|
72
|
+
* @param {(text: string) => string} [translate] The app's translate.
|
|
73
|
+
* @return {object} The notice (`{ id, variant, role, layout, title, text }`).
|
|
74
|
+
*/
|
|
75
|
+
function searchRefusalNotice(refusal, words, translate$1) {
|
|
76
|
+
const tr = typeof translate$1 === 'function' ? translate$1 : (text) => text;
|
|
77
|
+
const own = words && typeof words === 'object' ? words : {};
|
|
78
|
+
const position = String(refusal.position);
|
|
79
|
+
const title = typeof own.title === 'string' && own.title !== ''
|
|
80
|
+
? tr(own.title).replace(/\{position\}/g, position)
|
|
81
|
+
: translate('nextcloud-vue', 'Search term not understood at position {position}:', { position });
|
|
82
|
+
const after = typeof own.after === 'string' && own.after !== ''
|
|
83
|
+
? tr(own.after)
|
|
84
|
+
: translate('nextcloud-vue', 'The list is not filtered; adjust the term.');
|
|
85
|
+
return {
|
|
86
|
+
id: 'search-refusal',
|
|
87
|
+
variant: 'error',
|
|
88
|
+
role: 'alert',
|
|
89
|
+
layout: 'inline',
|
|
90
|
+
title,
|
|
91
|
+
text: [refusal.message, after].filter((part) => part !== '').join(' '),
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { readSearchRefusal, searchRefusalNotice };
|
|
62
96
|
//# sourceMappingURL=searchRefusal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchRefusal.js","sources":["../../../src/utils/searchRefusal.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * A refused search, said where it was typed. OpenRegister refuses a `_search`\n * term it cannot parse (an unclosed bracket or quote) with `400 { error,\n * position, term }` rather than running it as a literal, which would return\n * nothing and read as an honest empty result.\n *\n * @module utils/searchRefusal\n */\n\n/** `<reason> at position <n>.`, the shape OpenRegister builds the message in. */\nconst POSITION_IN_MESSAGE = /\\bat position (\\d+)\\.?\\s*$/\n\n/**\n * The 1-based character a refusal points at, or null.\n *\n * @param {object} error The ApiError.\n * @return {number|null}\n */\nfunction positionOf(error) {\n\tconst carried = error.position ?? (error.details && typeof error.details === 'object' ? error.details.position : undefined)\n\tif (Number.isInteger(carried) && carried > 0) {\n\t\treturn carried\n\t}\n\tconst match = POSITION_IN_MESSAGE.exec(String(error.message || ''))\n\tconst parsed = match ? Number(match[1]) : 0\n\treturn parsed > 0 ? parsed : null\n}\n\n/**\n * A search refusal, or null when this failure is not one: not a 400, no term\n * typed, or no position to point at (then it is a plain failed fetch).\n *\n * @spec openspec/changes/index-search-refusal/specs/index-search-refusal/spec.md#requirement-a-refused-search-is-said-where-it-was-typed\n * @param {object|null} error The ApiError the store recorded.\n * @param {string} term The term the user typed.\n * @return {{message: string, position: number, term: string, before: string, at: string, after: string}|null}\n */\nexport function readSearchRefusal(error, term) {\n\tconst typed = typeof term === 'string' ? term : ''\n\tif (!error || typed.trim() === '' || Number(error.status) !== 400) {\n\t\treturn null\n\t}\n\tconst position = positionOf(error)\n\tif (position === null) {\n\t\treturn null\n\t}\n\tconst index = Math.min(position - 1, typed.length)\n\treturn {\n\t\tmessage: String(error.message || ''),\n\t\tposition,\n\t\tterm: typed,\n\t\tbefore: typed.slice(0, index),\n\t\tat: typed.slice(index, index + 1),\n\t\tafter: typed.slice(index + 1),\n\t}\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"searchRefusal.js","sources":["../../../src/utils/searchRefusal.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * A refused search, said where it was typed. OpenRegister refuses a `_search`\n * term it cannot parse (an unclosed bracket or quote) with `400 { error,\n * position, term }` rather than running it as a literal, which would return\n * nothing and read as an honest empty result.\n *\n * @module utils/searchRefusal\n */\nimport { translate as t } from '@nextcloud/l10n'\n\n/** `<reason> at position <n>.`, the shape OpenRegister builds the message in. */\nconst POSITION_IN_MESSAGE = /\\bat position (\\d+)\\.?\\s*$/\n\n/**\n * The 1-based character a refusal points at, or null.\n *\n * @param {object} error The ApiError.\n * @return {number|null}\n */\nfunction positionOf(error) {\n\tconst carried = error.position ?? (error.details && typeof error.details === 'object' ? error.details.position : undefined)\n\tif (Number.isInteger(carried) && carried > 0) {\n\t\treturn carried\n\t}\n\tconst match = POSITION_IN_MESSAGE.exec(String(error.message || ''))\n\tconst parsed = match ? Number(match[1]) : 0\n\treturn parsed > 0 ? parsed : null\n}\n\n/**\n * A search refusal, or null when this failure is not one: not a 400, no term\n * typed, or no position to point at (then it is a plain failed fetch).\n *\n * @spec openspec/changes/index-search-refusal/specs/index-search-refusal/spec.md#requirement-a-refused-search-is-said-where-it-was-typed\n * @param {object|null} error The ApiError the store recorded.\n * @param {string} term The term the user typed.\n * @return {{message: string, position: number, term: string, before: string, at: string, after: string}|null}\n */\nexport function readSearchRefusal(error, term) {\n\tconst typed = typeof term === 'string' ? term : ''\n\tif (!error || typed.trim() === '' || Number(error.status) !== 400) {\n\t\treturn null\n\t}\n\tconst position = positionOf(error)\n\tif (position === null) {\n\t\treturn null\n\t}\n\tconst index = Math.min(position - 1, typed.length)\n\treturn {\n\t\tmessage: String(error.message || ''),\n\t\tposition,\n\t\tterm: typed,\n\t\tbefore: typed.slice(0, index),\n\t\tat: typed.slice(index, index + 1),\n\t\tafter: typed.slice(index + 1),\n\t}\n}\n\n/**\n * A refused search as a state notice under the search field: the position in\n * the title, the server's reason, then that the list is not filtered. `title`\n * (with `{position}`) and `after` replace the library's words, through the\n * app's translate.\n *\n * @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field\n * @param {{message: string, position: number}} refusal What `readSearchRefusal` read.\n * @param {{title?: string, after?: string}|null} [words] The page's own words.\n * @param {(text: string) => string} [translate] The app's translate.\n * @return {object} The notice (`{ id, variant, role, layout, title, text }`).\n */\nexport function searchRefusalNotice(refusal, words, translate) {\n\tconst tr = typeof translate === 'function' ? translate : (text) => text\n\tconst own = words && typeof words === 'object' ? words : {}\n\tconst position = String(refusal.position)\n\tconst title = typeof own.title === 'string' && own.title !== ''\n\t\t? tr(own.title).replace(/\\{position\\}/g, position)\n\t\t: t('nextcloud-vue', 'Search term not understood at position {position}:', { position })\n\tconst after = typeof own.after === 'string' && own.after !== ''\n\t\t? tr(own.after)\n\t\t: t('nextcloud-vue', 'The list is not filtered; adjust the term.')\n\treturn {\n\t\tid: 'search-refusal',\n\t\tvariant: 'error',\n\t\trole: 'alert',\n\t\tlayout: 'inline',\n\t\ttitle,\n\t\ttext: [refusal.message, after].filter((part) => part !== '').join(' '),\n\t}\n}\n"],"names":["translate","t"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA,MAAM,mBAAmB,GAAG,6BAA4B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,OAAO,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,GAAG,SAAS,EAAC;AAC5H,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;AAC/C,EAAE,OAAO,OAAO;AAChB,EAAE;AACF,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,K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|
* @type {string[]}
|
|
69
69
|
*/
|
|
70
|
-
const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat', 'grouped-cards', 'plan', 'record-notes', 'field-groups', 'object-links', 'kb-search', 'share-list']);
|
|
70
|
+
const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat', 'grouped-cards', 'plan', 'record-notes', 'field-groups', 'object-links', 'kb-search', 'share-list', 'task-form']);
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* The stored content/config blob for a widget definition.
|