@conduction/nextcloud-vue 2.56.0-beta.73 → 2.56.0-beta.74
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/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/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/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 +129 -8
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +46 -36
- 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/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +12 -0
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +12 -0
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +637 -475
- package/dist/esm/utils/fieldPill.js +77 -0
- package/dist/esm/utils/fieldPill.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 +7416 -5865
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +637 -475
- package/l10n/en.json +12 -0
- package/l10n/nl.json +12 -0
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +116 -9
- package/src/components/CnCardNotices/CnCardNotices.vue +46 -8
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +61 -2
- package/src/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
- package/src/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue +141 -1
- package/src/components/CnIndexPage/CnIndexHeaderMenu.vue +22 -4
- package/src/components/CnIndexPage/CnIndexPage.vue +143 -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 +1 -0
- package/src/css/index-page.css +6 -0
- package/src/index.js +1 -0
- package/src/utils/fieldPill.js +73 -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,77 @@
|
|
|
1
|
+
import { isBadgeVariant } from './badgeVariants.js';
|
|
2
|
+
import { variantForColor } from './headerFieldChips.js';
|
|
3
|
+
import { readPath } from './readPath.js';
|
|
4
|
+
import { evaluateVisibleWhenLocal } from './visibleWhen.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
8
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
9
|
+
*
|
|
10
|
+
* fieldPill: the status pill a widget draws for a row from a pill config, so
|
|
11
|
+
* a record list, grouped cards and a checklist read the same keys.
|
|
12
|
+
*
|
|
13
|
+
* @module utils/fieldPill
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The pill for a row.
|
|
18
|
+
*
|
|
19
|
+
* `{ field, labels?, colorMap?, colorField?, variant?, variantWhen?, hideValues? }`
|
|
20
|
+
* reads the value at `field`: its label through `labels`, its tone through
|
|
21
|
+
* `colorMap` (keys match case-insensitively), else the colour name at
|
|
22
|
+
* `colorField`, else `variant`. `variantWhen` (`[{ when, variant }]`, the first
|
|
23
|
+
* whose local condition holds for the row) wins over all of them.
|
|
24
|
+
*
|
|
25
|
+
* `{ cases: [{ when, label, variant? }], label?, variant? }` takes the first
|
|
26
|
+
* case whose `when` holds, else the pill's own `label`; a label with `{field}`
|
|
27
|
+
* tokens is filled from the row and draws nothing when it fills to ''.
|
|
28
|
+
*
|
|
29
|
+
* @param {object} row The row.
|
|
30
|
+
* @param {object} pill The pill config.
|
|
31
|
+
* @param {object} [options] Options.
|
|
32
|
+
* @param {(text: string) => string} [options.translate] The app's translate.
|
|
33
|
+
* @param {(template: string, row: object) => string} [options.fill] Fill a template from the row (translated).
|
|
34
|
+
* @return {{label: string, variant: string}|null} The pill, or null.
|
|
35
|
+
* @spec openspec/changes/record-list-pill-cases-footer-choice/specs/record-list/spec.md#requirement-a-record-list-row-pill-can-read-a-state-from-several-fields
|
|
36
|
+
* @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md
|
|
37
|
+
*/
|
|
38
|
+
function fieldPill(row, pill, options = {}) {
|
|
39
|
+
const translate = typeof options.translate === 'function' ? options.translate : (text) => text;
|
|
40
|
+
const fill = typeof options.fill === 'function' ? options.fill : (template) => translate(template);
|
|
41
|
+
if (pill && typeof pill === 'object' && Array.isArray(pill.cases)) {
|
|
42
|
+
const found = pill.cases.find((entry) => entry && typeof entry === 'object' && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}));
|
|
43
|
+
const chosen = found || pill;
|
|
44
|
+
if (typeof chosen.label !== 'string' || chosen.label === '') {
|
|
45
|
+
return null
|
|
46
|
+
}
|
|
47
|
+
const label = chosen.label.indexOf('{') === -1 ? translate(chosen.label) : fill(chosen.label, row);
|
|
48
|
+
return label === '' ? null : { label, variant: isBadgeVariant(chosen.variant) ? chosen.variant : 'default' }
|
|
49
|
+
}
|
|
50
|
+
if (!pill || typeof pill !== 'object' || !pill.field) {
|
|
51
|
+
return null
|
|
52
|
+
}
|
|
53
|
+
const raw = readPath(row, pill.field);
|
|
54
|
+
if (raw === null || raw === undefined || raw === '' || typeof raw === 'object') {
|
|
55
|
+
return null
|
|
56
|
+
}
|
|
57
|
+
const key = String(raw);
|
|
58
|
+
if (Array.isArray(pill.hideValues) && pill.hideValues.map(String).includes(key)) {
|
|
59
|
+
return null
|
|
60
|
+
}
|
|
61
|
+
const labels = pill.labels && typeof pill.labels === 'object' ? pill.labels : {};
|
|
62
|
+
const map = pill.colorMap && typeof pill.colorMap === 'object' ? pill.colorMap : {};
|
|
63
|
+
const found = Object.keys(map).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
64
|
+
const rule = Array.isArray(pill.variantWhen)
|
|
65
|
+
? pill.variantWhen.find((entry) => entry && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}))
|
|
66
|
+
: null;
|
|
67
|
+
const colour = pill.colorField ? readPath(row, pill.colorField) : null;
|
|
68
|
+
const fromRow = typeof colour === 'string' && colour !== '' ? variantForColor(colour) : null;
|
|
69
|
+
const variant = rule ? rule.variant : (found ? map[found] : (fromRow || pill.variant));
|
|
70
|
+
return {
|
|
71
|
+
label: labels[key] ? translate(labels[key]) : key,
|
|
72
|
+
variant: isBadgeVariant(variant) ? variant : 'default',
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { fieldPill };
|
|
77
|
+
//# sourceMappingURL=fieldPill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldPill.js","sources":["../../../src/utils/fieldPill.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * fieldPill: the status pill a widget draws for a row from a pill config, so\n * a record list, grouped cards and a checklist read the same keys.\n *\n * @module utils/fieldPill\n */\nimport { isBadgeVariant } from './badgeVariants.js'\nimport { variantForColor } from './headerFieldChips.js'\nimport { readPath } from './readPath.js'\nimport { evaluateVisibleWhenLocal } from './visibleWhen.js'\n\n/**\n * The pill for a row.\n *\n * `{ field, labels?, colorMap?, colorField?, variant?, variantWhen?, hideValues? }`\n * reads the value at `field`: its label through `labels`, its tone through\n * `colorMap` (keys match case-insensitively), else the colour name at\n * `colorField`, else `variant`. `variantWhen` (`[{ when, variant }]`, the first\n * whose local condition holds for the row) wins over all of them.\n *\n * `{ cases: [{ when, label, variant? }], label?, variant? }` takes the first\n * case whose `when` holds, else the pill's own `label`; a label with `{field}`\n * tokens is filled from the row and draws nothing when it fills to ''.\n *\n * @param {object} row The row.\n * @param {object} pill The pill config.\n * @param {object} [options] Options.\n * @param {(text: string) => string} [options.translate] The app's translate.\n * @param {(template: string, row: object) => string} [options.fill] Fill a template from the row (translated).\n * @return {{label: string, variant: string}|null} The pill, or null.\n * @spec openspec/changes/record-list-pill-cases-footer-choice/specs/record-list/spec.md#requirement-a-record-list-row-pill-can-read-a-state-from-several-fields\n * @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md\n */\nexport function fieldPill(row, pill, options = {}) {\n\tconst translate = typeof options.translate === 'function' ? options.translate : (text) => text\n\tconst fill = typeof options.fill === 'function' ? options.fill : (template) => translate(template)\n\tif (pill && typeof pill === 'object' && Array.isArray(pill.cases)) {\n\t\tconst found = pill.cases.find((entry) => entry && typeof entry === 'object' && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}))\n\t\tconst chosen = found || pill\n\t\tif (typeof chosen.label !== 'string' || chosen.label === '') {\n\t\t\treturn null\n\t\t}\n\t\tconst label = chosen.label.indexOf('{') === -1 ? translate(chosen.label) : fill(chosen.label, row)\n\t\treturn label === '' ? null : { label, variant: isBadgeVariant(chosen.variant) ? chosen.variant : 'default' }\n\t}\n\tif (!pill || typeof pill !== 'object' || !pill.field) {\n\t\treturn null\n\t}\n\tconst raw = readPath(row, pill.field)\n\tif (raw === null || raw === undefined || raw === '' || typeof raw === 'object') {\n\t\treturn null\n\t}\n\tconst key = String(raw)\n\tif (Array.isArray(pill.hideValues) && pill.hideValues.map(String).includes(key)) {\n\t\treturn null\n\t}\n\tconst labels = pill.labels && typeof pill.labels === 'object' ? pill.labels : {}\n\tconst map = pill.colorMap && typeof pill.colorMap === 'object' ? pill.colorMap : {}\n\tconst found = Object.keys(map).find((k) => k.toLowerCase() === key.toLowerCase())\n\tconst rule = Array.isArray(pill.variantWhen)\n\t\t? pill.variantWhen.find((entry) => entry && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}))\n\t\t: null\n\tconst colour = pill.colorField ? readPath(row, pill.colorField) : null\n\tconst fromRow = typeof colour === 'string' && colour !== '' ? variantForColor(colour) : null\n\tconst variant = rule ? rule.variant : (found ? map[found] : (fromRow || pill.variant))\n\treturn {\n\t\tlabel: labels[key] ? translate(labels[key]) : key,\n\t\tvariant: isBadgeVariant(variant) ? variant : 'default',\n\t}\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE;AACnD,CAAC,MAAM,SAAS,GAAG,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU,GAAG,OAAO,CAAC,SAAS,GAAG,CAAC,IAAI,KAAK,KAAI;AAC/F,CAAC,MAAM,IAAI,GAAG,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,GAAG,OAAO,CAAC,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,EAAC;AACnG,CAAC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;AACpE,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,wBAAwB,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,EAAC;AAC/I,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI,KAAI;AAC9B,EAAE,IAAI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/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,gBAAgB;AACjB,CAAC,aAAa;AACd,CAAC,QAAQ;AACT,CAAC,UAAU;AACX,CAAC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AC,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;AACf,CAAC,WAAW;AACZ,CAAC,aAAa;AACd,CAAC,MAAM;AACP,CAAC,OAAO;AAC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AC,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,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,EAAC;AACpE,CAAC,MAAM,MAAM,GAA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(['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.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetDispatch.js","sources":["../../../src/utils/widgetDispatch.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * widgetDispatch — how a detail-page widget definition picks its renderer.\n *\n * These predicates used to live as methods on `CnDetailPage`, each one calling\n * `findWidget(item)` first. That was fine while the detail grid was the only\n * surface rendering a widget definition. `CnTabsWidget` is a second one: it\n * renders the SAME definitions with no card chrome, because the tab strip owns\n * the title and the Actions menu instead.\n *\n * Two copies of \"is this a card widget?\" is exactly the kind of thing that\n * drifts. One copy grows a type, the other does not, and the symptom is a\n * widget that renders correctly on the page and blank inside a tab, with\n * nothing in the console either way. So the decisions live here as pure\n * functions over a widget DEFINITION, and both surfaces import them.\n *\n * The functions take the resolved definition, not a layout item. Resolving an\n * item to a definition needs the surface's own widget list, which is the one\n * part that genuinely differs between the two.\n *\n * @module utils/widgetDispatch\n */\n\nimport { BUILT_IN_WIDGETS } from '../components/CnWidgetGrid/builtInWidgets.js'\nimport { getWidgetTypeEntry } from '../components/CnWidgetGrid/dashboardWidgetRegistry.js'\nimport { canonicalWidgetType } from './widgetTypeAliases.js'\n\n/**\n * Content-only catalog widgets: bare renderers with no chrome of their own.\n * On a card surface they need the titled wrapper; inside a tab panel the strip\n * already supplies the title, so they render bare.\n *\n * `flow-runs` belongs here for the same reason the lists do: it renders a bare\n * row list, so without the wrapper it appeared on the detail page as loose text\n * with no title and no card, which ADR-062 rule 5 forbids (\"every body widget\n * has card chrome and its manifest title\"). It is NOT in the Add-action list,\n * because a run is started by a flow, never by a person clicking Add.\n * `tasks` follows for the same two reasons: a bare row list, and a task is\n * created by a flow, never by a person clicking Add.\n * `facts` is a bare list of label/value rows about one object: on a side\n * card it needs the same titled wrapper, and there is nothing to Add.\n * `field-list` draws rows of one object field and carries its own add form,\n * so it takes the titled wrapper and not the catalog Add action.\n * `record-list` draws bare rows of another schema's objects; the card and its\n * header (link, note) come from the host, and it has no Add.\n * `parties` draws a record's parties by role and `map` a bare Leaflet map:\n * on a card surface both need the titled wrapper, and neither has an Add.\n * `object-translations` is a bare per-language editor that takes the titled\n * wrapper and has no Add.\n * `row-mark-list` draws bare rows with their marks and one Save; the card and\n * its title come from the host, and it has no Add.\n * `slot-grid` draws a bare table with its own add buttons per cell; the card\n * and its title come from the host, and the catalog Add does not apply.\n * `handoff` is one action on one record; the card and title come from the host.\n * `macros` lists a record's macros with their buttons; the card and title come from the host.\n * `record-notes` edits a text field of the record in view, with no card of its own.\n * `field-groups` draws several list fields of the record as label and value pairs, and\n * `object-links` the record's links to other records; both take the titled wrapper\n * and report their own Add for its title row, so the catalog Add does not apply.\n * `grouped-cards` draws groups of cards (DqZaaktype \"Fasen en taken\") with no card of\n * its own; the card, title and subtitle come from the host, and it has no Add.\n * `kb-search` draws a bare search field and its results; on a side card it\n * needs the titled wrapper (PqKlant \"Kennisbank\"), and it has no Add.\n *\n * @type {string[]}\n */\nexport 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'])\n\n/**\n * The stored content/config blob for a widget definition.\n *\n * @param {object} def The widget definition.\n * @return {object} The definition's `content`, or an empty object.\n */\nexport function widgetContentOf(def) {\n\treturn (def && def.content && typeof def.content === 'object') ? def.content : {}\n}\n\n/**\n * Whether the definition is the schema-driven `data` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'data'`.\n */\nexport function isDataWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'data'\n}\n\n/**\n * Whether the definition is the schema-driven `related` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'related'`.\n */\nexport function isRelatedWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'related'\n}\n\n/**\n * Whether the definition is the `object-geo` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'object-geo'`.\n */\nexport function isGeoWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'object-geo'\n}\n\n/**\n * Whether the definition names a registered integration leaf.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'integration'` with an `integrationId`.\n */\nexport function isIntegrationWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'integration' && typeof def.integrationId === 'string'\n}\n\n/**\n * Whether the definition is a content-only catalog widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the type is in {@link CONTENT_ONLY_TYPES}.\n */\nexport function isContentOnlyWidgetDef(def) {\n\treturn Boolean(def) && CONTENT_ONLY_TYPES.includes(def.type)\n}\n\n/**\n * Whether the definition is a registry \"card\" widget: a self-contained KPI,\n * gauge or delta tile that headlines itself (registry entry `card: true`).\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the registry entry declares `card`.\n */\nexport function isCardWidgetDef(def) {\n\tif (!def || !def.type) {\n\t\treturn false\n\t}\n\tconst entry = getWidgetTypeEntry(def.type)\n\treturn Boolean(entry && entry.card === true)\n}\n\n/**\n * Resolve the registered RENDERER for a content-driven catalog widget type.\n *\n * Integration widgets resolve separately, and `data` needs object context the\n * caller supplies, so both are excluded from this generic fallback.\n *\n * Resolution order is consumer registry, then the dashboard catalog, then\n * `BUILT_IN_WIDGETS`. Those last two were near-disjoint vocabularies until they\n * were unified here: the dashboard catalog held chart / map / object-list /\n * related / stats-block / table, `BUILT_IN_WIDGETS` held audit-trail / banner /\n * card-grid / data / divider / form-renderer / header / integration /\n * map-viewer / metadata / nav-card-grid / object-geo / related / text, and only\n * `related` was in both. A widget authored against one was invisible to the\n * other, and the surface rendered nothing while saying nothing about why. On\n * hrmq that was 101 of 236 detail widgets.\n *\n * With `typeAsWritten`, a type registered in its own right wins over its\n * alias, as on CnDashboardPage: there `object-table` is the host adapter that\n * reads `content.source`, not the `table` widget its alias names. A detail\n * page keeps the alias first, as its manifests were written against it.\n *\n * @param {object} def The widget definition.\n * @param {object} [cnRegistry] The consumer's component registry, if any.\n * @param {{typeAsWritten?: boolean}} [options] Resolution options.\n * @return {object|null} The renderer component, or null.\n */\nexport function resolveRegistryRenderer(def, cnRegistry = {}, options = {}) {\n\tif (!def || !def.type || def.type === 'integration' || def.type === 'data') {\n\t\treturn null\n\t}\n\t// Consumer registry FIRST — the order REQ-MVR-005 mandates (\"Custom widget\n\t// overrides built-in\"), and the order CnWidgetGrid already uses.\n\tconst consumer = (cnRegistry || {})[def.type]\n\tif (consumer) {\n\t\treturn consumer.component ?? consumer\n\t}\n\tconst entry = (options.typeAsWritten === true && getWidgetTypeEntry(def.type)) || getWidgetTypeEntry(canonicalWidgetType(def.type))\n\tif (entry && entry.renderer) {\n\t\treturn entry.renderer\n\t}\n\treturn BUILT_IN_WIDGETS[canonicalWidgetType(def.type)] || BUILT_IN_WIDGETS[def.type] || null\n}\n\n/**\n * The effective title for a widget definition.\n *\n * A title-owning type (registry `ownsTitle`, e.g. `related`) keeps its editable\n * title in `content.title`, and that MUST win over the chrome `def.title`.\n * Otherwise a non-empty seed title permanently shadows the user's edit and the\n * title can never be changed. Without a `content.title` it falls back to\n * `def.title`. Every other type reads `def.title` first.\n *\n * @param {object} def The widget definition.\n * @return {string|undefined} The title, or undefined to let the widget default.\n */\nexport function widgetTitleOf(def) {\n\tif (!def) {\n\t\treturn undefined\n\t}\n\tconst content = widgetContentOf(def)\n\tconst entry = getWidgetTypeEntry(def.type)\n\tif (entry && entry.ownsTitle) {\n\t\t// A manifest that never set content.title keeps its def.title.\n\t\tif (typeof content.title !== 'string') {\n\t\t\treturn def.title || undefined\n\t\t}\n\t\treturn content.title || undefined\n\t}\n\treturn def.title || content.title || undefined\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;AAIA;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;AACY,MAAC,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,WAAW,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AG,CAAC,IAAI,CAAC,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;AAC7F,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,CAAC,IAAI,CAAC,GAAG,EAAE;AACX,EAAE,OAAO,SAAS;AAClB,EAAE;AACF,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,EAAC;AACrC,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAC;AAC3C,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE;AAC/B;AACA,EAAE,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;AACzC,GAAG,OAAO,GAAG,CAAC,KAAK,IAAI,SAAS;AAChC,GAAG;AACH,EAAE,OAAO,OAAO,CAAC,KAAK,IAAI,SAAS;AACnC,EAAE;AACF,CAAC,OAAO,GAAG,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,SAAS;AAC/C;;;;"}
|
|
1
|
+
{"version":3,"file":"widgetDispatch.js","sources":["../../../src/utils/widgetDispatch.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * widgetDispatch — how a detail-page widget definition picks its renderer.\n *\n * These predicates used to live as methods on `CnDetailPage`, each one calling\n * `findWidget(item)` first. That was fine while the detail grid was the only\n * surface rendering a widget definition. `CnTabsWidget` is a second one: it\n * renders the SAME definitions with no card chrome, because the tab strip owns\n * the title and the Actions menu instead.\n *\n * Two copies of \"is this a card widget?\" is exactly the kind of thing that\n * drifts. One copy grows a type, the other does not, and the symptom is a\n * widget that renders correctly on the page and blank inside a tab, with\n * nothing in the console either way. So the decisions live here as pure\n * functions over a widget DEFINITION, and both surfaces import them.\n *\n * The functions take the resolved definition, not a layout item. Resolving an\n * item to a definition needs the surface's own widget list, which is the one\n * part that genuinely differs between the two.\n *\n * @module utils/widgetDispatch\n */\n\nimport { BUILT_IN_WIDGETS } from '../components/CnWidgetGrid/builtInWidgets.js'\nimport { getWidgetTypeEntry } from '../components/CnWidgetGrid/dashboardWidgetRegistry.js'\nimport { canonicalWidgetType } from './widgetTypeAliases.js'\n\n/**\n * Content-only catalog widgets: bare renderers with no chrome of their own.\n * On a card surface they need the titled wrapper; inside a tab panel the strip\n * already supplies the title, so they render bare.\n *\n * `flow-runs` belongs here for the same reason the lists do: it renders a bare\n * row list, so without the wrapper it appeared on the detail page as loose text\n * with no title and no card, which ADR-062 rule 5 forbids (\"every body widget\n * has card chrome and its manifest title\"). It is NOT in the Add-action list,\n * because a run is started by a flow, never by a person clicking Add.\n * `tasks` follows for the same two reasons: a bare row list, and a task is\n * created by a flow, never by a person clicking Add.\n * `facts` is a bare list of label/value rows about one object: on a side\n * card it needs the same titled wrapper, and there is nothing to Add.\n * `field-list` draws rows of one object field and carries its own add form,\n * so it takes the titled wrapper and not the catalog Add action.\n * `record-list` draws bare rows of another schema's objects; the card and its\n * header (link, note) come from the host, and it has no Add.\n * `parties` draws a record's parties by role and `map` a bare Leaflet map:\n * on a card surface both need the titled wrapper, and neither has an Add.\n * `object-translations` is a bare per-language editor that takes the titled\n * wrapper and has no Add.\n * `row-mark-list` draws bare rows with their marks and one Save; the card and\n * its title come from the host, and it has no Add.\n * `slot-grid` draws a bare table with its own add buttons per cell; the card\n * and its title come from the host, and the catalog Add does not apply.\n * `handoff` is one action on one record; the card and title come from the host.\n * `macros` lists a record's macros with their buttons; the card and title come from the host.\n * `record-notes` edits a text field of the record in view, with no card of its own.\n * `field-groups` draws several list fields of the record as label and value pairs, and\n * `object-links` the record's links to other records; both take the titled wrapper\n * and report their own Add for its title row, so the catalog Add does not apply.\n * `grouped-cards` draws groups of cards (DqZaaktype \"Fasen en taken\") with no card of\n * its own; the card, title and subtitle come from the host, and it has no Add.\n * `kb-search` draws a bare search field and its results; on a side card it\n * needs the titled wrapper (PqKlant \"Kennisbank\"), and it has no Add.\n *\n * @type {string[]}\n */\nexport 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'])\n\n/**\n * The stored content/config blob for a widget definition.\n *\n * @param {object} def The widget definition.\n * @return {object} The definition's `content`, or an empty object.\n */\nexport function widgetContentOf(def) {\n\treturn (def && def.content && typeof def.content === 'object') ? def.content : {}\n}\n\n/**\n * Whether the definition is the schema-driven `data` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'data'`.\n */\nexport function isDataWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'data'\n}\n\n/**\n * Whether the definition is the schema-driven `related` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'related'`.\n */\nexport function isRelatedWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'related'\n}\n\n/**\n * Whether the definition is the `object-geo` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'object-geo'`.\n */\nexport function isGeoWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'object-geo'\n}\n\n/**\n * Whether the definition names a registered integration leaf.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'integration'` with an `integrationId`.\n */\nexport function isIntegrationWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'integration' && typeof def.integrationId === 'string'\n}\n\n/**\n * Whether the definition is a content-only catalog widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the type is in {@link CONTENT_ONLY_TYPES}.\n */\nexport function isContentOnlyWidgetDef(def) {\n\treturn Boolean(def) && CONTENT_ONLY_TYPES.includes(def.type)\n}\n\n/**\n * Whether the definition is a registry \"card\" widget: a self-contained KPI,\n * gauge or delta tile that headlines itself (registry entry `card: true`).\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the registry entry declares `card`.\n */\nexport function isCardWidgetDef(def) {\n\tif (!def || !def.type) {\n\t\treturn false\n\t}\n\tconst entry = getWidgetTypeEntry(def.type)\n\treturn Boolean(entry && entry.card === true)\n}\n\n/**\n * Resolve the registered RENDERER for a content-driven catalog widget type.\n *\n * Integration widgets resolve separately, and `data` needs object context the\n * caller supplies, so both are excluded from this generic fallback.\n *\n * Resolution order is consumer registry, then the dashboard catalog, then\n * `BUILT_IN_WIDGETS`. Those last two were near-disjoint vocabularies until they\n * were unified here: the dashboard catalog held chart / map / object-list /\n * related / stats-block / table, `BUILT_IN_WIDGETS` held audit-trail / banner /\n * card-grid / data / divider / form-renderer / header / integration /\n * map-viewer / metadata / nav-card-grid / object-geo / related / text, and only\n * `related` was in both. A widget authored against one was invisible to the\n * other, and the surface rendered nothing while saying nothing about why. On\n * hrmq that was 101 of 236 detail widgets.\n *\n * With `typeAsWritten`, a type registered in its own right wins over its\n * alias, as on CnDashboardPage: there `object-table` is the host adapter that\n * reads `content.source`, not the `table` widget its alias names. A detail\n * page keeps the alias first, as its manifests were written against it.\n *\n * @param {object} def The widget definition.\n * @param {object} [cnRegistry] The consumer's component registry, if any.\n * @param {{typeAsWritten?: boolean}} [options] Resolution options.\n * @return {object|null} The renderer component, or null.\n */\nexport function resolveRegistryRenderer(def, cnRegistry = {}, options = {}) {\n\tif (!def || !def.type || def.type === 'integration' || def.type === 'data') {\n\t\treturn null\n\t}\n\t// Consumer registry FIRST — the order REQ-MVR-005 mandates (\"Custom widget\n\t// overrides built-in\"), and the order CnWidgetGrid already uses.\n\tconst consumer = (cnRegistry || {})[def.type]\n\tif (consumer) {\n\t\treturn consumer.component ?? consumer\n\t}\n\tconst entry = (options.typeAsWritten === true && getWidgetTypeEntry(def.type)) || getWidgetTypeEntry(canonicalWidgetType(def.type))\n\tif (entry && entry.renderer) {\n\t\treturn entry.renderer\n\t}\n\treturn BUILT_IN_WIDGETS[canonicalWidgetType(def.type)] || BUILT_IN_WIDGETS[def.type] || null\n}\n\n/**\n * The effective title for a widget definition.\n *\n * A title-owning type (registry `ownsTitle`, e.g. `related`) keeps its editable\n * title in `content.title`, and that MUST win over the chrome `def.title`.\n * Otherwise a non-empty seed title permanently shadows the user's edit and the\n * title can never be changed. Without a `content.title` it falls back to\n * `def.title`. Every other type reads `def.title` first.\n *\n * @param {object} def The widget definition.\n * @return {string|undefined} The title, or undefined to let the widget default.\n */\nexport function widgetTitleOf(def) {\n\tif (!def) {\n\t\treturn undefined\n\t}\n\tconst content = widgetContentOf(def)\n\tconst entry = getWidgetTypeEntry(def.type)\n\tif (entry && entry.ownsTitle) {\n\t\t// A manifest that never set content.title keeps its def.title.\n\t\tif (typeof content.title !== 'string') {\n\t\t\treturn def.title || undefined\n\t\t}\n\t\treturn content.title || undefined\n\t}\n\treturn def.title || content.title || undefined\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;AAIA;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;AACY,MAAC,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAA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