@conduction/nextcloud-vue 2.165.0 → 2.166.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/dist/esm/components/CnActionButtons/CnActionButtons.vue.js +1 -1
  2. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +7 -0
  3. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  6. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +10 -0
  7. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  8. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js +1 -1
  9. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  10. package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +1 -1
  11. package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -1
  12. package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -1
  13. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  14. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +50 -7
  15. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  17. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +13 -0
  18. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  19. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
  20. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  21. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +39 -4
  22. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  23. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -1
  24. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  25. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue.js +1 -1
  26. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue2.js.map +1 -1
  27. package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue3.js.map +1 -1
  28. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js +9 -0
  29. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js.map +1 -0
  30. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js +232 -0
  31. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js.map +1 -0
  32. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js +61 -0
  33. package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js.map +1 -0
  34. package/dist/esm/components/CnFieldGroupsWidget/index.js +28 -0
  35. package/dist/esm/components/CnFieldGroupsWidget/index.js.map +1 -0
  36. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  37. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +80 -6
  38. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +361 -289
  40. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  41. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
  42. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +9 -0
  43. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
  44. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +2 -1
  45. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
  46. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue.js +1 -1
  47. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js +21 -0
  48. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js.map +1 -1
  49. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js +12 -2
  50. package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js.map +1 -1
  51. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  52. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +17 -0
  53. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  54. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +6 -3
  55. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  56. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js +33 -2
  57. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js.map +1 -1
  58. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js +2 -2
  59. package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js.map +1 -1
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +83 -8
  61. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  62. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -1
  63. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  64. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js +9 -0
  65. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js.map +1 -0
  66. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js +187 -0
  67. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js.map +1 -0
  68. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js +106 -0
  69. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js.map +1 -0
  70. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js +9 -0
  71. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js.map +1 -0
  72. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js +421 -0
  73. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js.map +1 -0
  74. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js +131 -0
  75. package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js.map +1 -0
  76. package/dist/esm/components/CnObjectLinksWidget/index.js +29 -0
  77. package/dist/esm/components/CnObjectLinksWidget/index.js.map +1 -0
  78. package/dist/esm/components/CnObjectLinksWidget/objectLinks.js +22 -0
  79. package/dist/esm/components/CnObjectLinksWidget/objectLinks.js.map +1 -0
  80. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  81. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +48 -13
  82. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  83. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +44 -20
  84. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  85. package/dist/esm/components/CnPagination/CnPagination.vue2.js +26 -0
  86. package/dist/esm/components/CnPagination/CnPagination.vue2.js.map +1 -1
  87. package/dist/esm/components/CnPagination/CnPagination.vue3.js +40 -37
  88. package/dist/esm/components/CnPagination/CnPagination.vue3.js.map +1 -1
  89. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
  90. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  91. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
  92. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +4 -0
  93. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  94. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  95. package/dist/esm/index.js +2 -0
  96. package/dist/esm/index.js.map +1 -1
  97. package/dist/esm/l10n/en.json.js +18 -1
  98. package/dist/esm/l10n/en.json.js.map +1 -1
  99. package/dist/esm/l10n/nl.json.js +18 -1
  100. package/dist/esm/l10n/nl.json.js.map +1 -1
  101. package/dist/esm/library-style.js +1 -1
  102. package/dist/esm/nextcloud-vue.css +635 -329
  103. package/dist/esm/utils/actionsDispatcher.js +9 -5
  104. package/dist/esm/utils/actionsDispatcher.js.map +1 -1
  105. package/dist/esm/utils/libraryWidgetKeys.js +2 -0
  106. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  107. package/dist/esm/utils/objectParties.js +68 -1
  108. package/dist/esm/utils/objectParties.js.map +1 -1
  109. package/dist/esm/utils/overlayInset.js +60 -0
  110. package/dist/esm/utils/overlayInset.js.map +1 -0
  111. package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
  112. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  113. package/dist/esm/utils/widgetDispatch.js +4 -1
  114. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  115. package/dist/nextcloud-vue.cjs.js +8444 -6584
  116. package/dist/nextcloud-vue.cjs.js.map +2 -2
  117. package/dist/nextcloud-vue.css +635 -329
  118. package/l10n/en.json +18 -1
  119. package/l10n/nl.json +18 -1
  120. package/package.json +1 -1
  121. package/src/components/CnActionButtons/CnActionButtons.vue +7 -0
  122. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +11 -1
  123. package/src/components/CnChipListManager/CnChipListManager.vue +4 -1
  124. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +50 -7
  125. package/src/components/CnDataTable/CnDataTable.md +1 -0
  126. package/src/components/CnDataTable/CnDataTable.vue +14 -0
  127. package/src/components/CnDetailPage/CnDetailPage.md +1 -0
  128. package/src/components/CnDetailPage/CnDetailPage.vue +40 -4
  129. package/src/components/CnExpandableRow/CnExpandableRow.vue +7 -4
  130. package/src/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue +287 -0
  131. package/src/components/CnFieldGroupsWidget/index.js +27 -0
  132. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +162 -7
  133. package/src/components/CnFlowDetail/CnFlowDetail.vue +10 -0
  134. package/src/components/CnFlowDetail/CnFlowRunSummary.vue +26 -1
  135. package/src/components/CnFlowsPage/CnFlowBoard.vue +90 -4
  136. package/src/components/CnGraphCanvas/CnGraphCanvas.vue +35 -4
  137. package/src/components/CnIndexPage/CnIndexPage.md +1 -1
  138. package/src/components/CnIndexPage/CnIndexPage.vue +83 -7
  139. package/src/components/CnObjectLinksWidget/CnObjectLinkDialog.vue +267 -0
  140. package/src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue +532 -0
  141. package/src/components/CnObjectLinksWidget/index.js +28 -0
  142. package/src/components/CnObjectLinksWidget/objectLinks.js +19 -0
  143. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +65 -15
  144. package/src/components/CnPagination/CnPagination.md +1 -0
  145. package/src/components/CnPagination/CnPagination.vue +27 -1
  146. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
  147. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +4 -0
  148. package/src/components/index.js +2 -0
  149. package/src/css/dialog.css +25 -3
  150. package/src/css/index-page.css +22 -8
  151. package/src/css/look-board-detail.css +41 -0
  152. package/src/css/look-board-index.css +52 -1
  153. package/src/css/look-board.css +17 -0
  154. package/src/index.js +2 -0
  155. package/src/schemas/app-manifest-v2.schema.json +3 -3
  156. package/src/utils/actionsDispatcher.js +9 -5
  157. package/src/utils/libraryWidgetKeys.js +2 -0
  158. package/src/utils/objectParties.js +67 -0
  159. package/src/utils/overlayInset.js +57 -0
  160. package/src/utils/validateManifestV2.compiled.js +2 -2
  161. package/src/utils/widgetDispatch.js +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Whether a party's kind is among the kinds a record accepts. Two\n * vocabularies meet here: the party's kind is its schema's (`person`,\n * `organisation`, `colleague`), while the accepted kinds may be role kinds\n * that name the identity shapes they take (pipelinq's `aanvrager` with\n * `identityShapes: [\"naturalPerson\", \"organization\"]`). When the accepted\n * kinds name shapes, the party's own kind is matched by the shapes the\n * listing gives it; a kind that names none cannot be judged and passes.\n * Otherwise the codes are compared.\n *\n * @param {string} partyKind The party's kind key.\n * @param {Array<object>} accepted The accepted kinds.\n * @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).\n * @return {boolean} False only when the party is known not to fit.\n * @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary\n */\nexport function partyKindAccepted(partyKind, accepted, own) {\n\tconst kinds = Array.isArray(accepted) ? accepted : []\n\tconst shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])))\n\tif (shapes.size === 0) {\n\t\treturn kinds.some((kind) => kindCode(kind) === partyKind)\n\t}\n\tconst mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes\n\tif (!Array.isArray(mine) || mine.length === 0) {\n\t\treturn true\n\t}\n\treturn mine.some((shape) => shapes.has(shape))\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n"],"names":["t"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE;AACvD,CAAC,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAClF,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC;AACxB,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAC;AACxE,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;AACjC,EAAE,OAAO,QAAQ,CAAC,KAAK;AACvB,EAAE;AACF,CAAC,OAAO,GAAG,KAAK,OAAO,GAAGA,SAAC,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG,GAAG;AAC7D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,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AAG,EAAC;AACb,EAAE,IAAI,MAAM,KAAK,EAAE,EAAE;AACrB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC;AACpC,GAAG;AACH,EAAE;AACF,CAAC,OAAO,MAAM;AACd,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,CAAC,OAAO,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;AACtE;;;;"}
1
+ {"version":3,"file":"objectParties.js","sources":["../../../src/utils/objectParties.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * objectParties — reading the parties of a record as OpenRegister's party\n * model answers them (`GET .../objects/{register}/{schema}/{id}/parties`:\n * `{ primary, roles, kinds, byRole, results }`, and `GET .../parties/{uuid}`\n * for one party with its indicators).\n *\n * Pure functions, so CnObjectPartiesWidget and its tests read one shape.\n *\n * @module utils/objectParties\n */\n\nimport { translate as t } from '@nextcloud/l10n'\nimport { boardDateLocale, formatBoardDate } from './boardDate.js'\nimport { readPath } from './readPath.js'\n\n/**\n * What a role is called: the app's own word (`roleLabels`), else the label\n * the listing declares, else the key. `other` is a party with no role.\n *\n * @param {string} key The role key.\n * @param {Array<{key: string, label?: string}>} roles The roles the listing declares.\n * @param {Record<string, string>} [roleLabels] The app's words, by key.\n * @return {string} The label.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function roleLabel(key, roles, roleLabels = {}) {\n\tif (roleLabels && typeof roleLabels[key] === 'string' && roleLabels[key] !== '') {\n\t\treturn roleLabels[key]\n\t}\n\tconst declared = (roles || []).find((role) => role && role.key === key)\n\tif (declared && declared.label) {\n\t\treturn declared.label\n\t}\n\treturn key === 'other' ? t('nextcloud-vue', 'No role') : key\n}\n\n/**\n * The parties of one role, the primary party first.\n *\n * @param {Array<object>} parties The role's rows.\n * @param {string|null} primary The primary party's uuid.\n * @return {Array<object>} The rows.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function partiesInOrder(parties, primary) {\n\tconst rows = Array.isArray(parties) ? parties.filter(Boolean) : []\n\tif (!primary) {\n\t\treturn rows\n\t}\n\treturn [\n\t\t...rows.filter((row) => row.partyUuid === primary),\n\t\t...rows.filter((row) => row.partyUuid !== primary),\n\t]\n}\n\n/**\n * The roles of a listing as groups, the group holding the primary party first.\n *\n * @param {object|null} listing The `/parties` answer.\n * @param {Record<string, string>} [roleLabels] The app's words for the roles.\n * @return {Array<{key: string, label: string, parties: Array<object>}>} The groups.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function rolesInOrder(listing, roleLabels = {}) {\n\tif (!listing || typeof listing !== 'object') {\n\t\treturn []\n\t}\n\tconst byRole = listing.byRole && typeof listing.byRole === 'object' ? listing.byRole : {}\n\tconst primary = listing.primary || null\n\tconst groups = Object.keys(byRole).map((key) => ({\n\t\tkey,\n\t\tlabel: roleLabel(key, listing.roles, roleLabels),\n\t\tparties: partiesInOrder(byRole[key], primary),\n\t}))\n\tconst holdsPrimary = (group) => !!primary && group.parties.some((party) => party.partyUuid === primary)\n\treturn [...groups.filter(holdsPrimary), ...groups.filter((group) => !holdsPrimary(group))]\n}\n\n/**\n * What an indicator means for what may be done: an indicator always carries\n * its verdict, never a bare chip. `refuse-publication` and `refuse-send` are\n * blocking (`error`); anything else asks to be read first (`warning`).\n *\n * @param {object} indicator The indicator (`{ key, label, effect }`).\n * @param {object} [labels] The app's words: `verdictPublication`, `verdictSend`, `verdictWarn`.\n * @return {{effect: string, severity: string, label: string, verdict: string}} The verdict.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorVerdict(indicator, labels = {}) {\n\tconst effect = String(indicator?.effect || '').trim()\n\tconst label = String(indicator?.label || indicator?.key || '').trim()\n\tif (effect === 'refuse-publication') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictPublication || t('nextcloud-vue', 'Publishing a file on this record is refused') }\n\t}\n\tif (effect === 'refuse-send') {\n\t\treturn { effect, severity: 'error', label, verdict: labels.verdictSend || t('nextcloud-vue', 'A message to this party is refused') }\n\t}\n\treturn { effect: effect === '' ? 'warn' : effect, severity: 'warning', label, verdict: labels.verdictWarn || t('nextcloud-vue', 'Read this before acting on the record') }\n}\n\n/**\n * Every indicator on a set of parties, each knowing whose it is.\n *\n * @param {Array<object>} parties The party records.\n * @return {Array<object>} The indicators with `party` and `partyName`.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function indicatorsOf(parties) {\n\tconst found = []\n\tfor (const party of parties || []) {\n\t\tif (!party) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const indicator of Array.isArray(party.indicators) ? party.indicators : []) {\n\t\t\tif (indicator) {\n\t\t\t\tfound.push({ ...indicator, party: party.id || party.uuid || '', partyName: party.name || party.displayName || '' })\n\t\t\t}\n\t\t}\n\t}\n\treturn found\n}\n\n/**\n * Who represents whom: participant uuid to the uuid of the party it acts for,\n * read from role rows (`{ participant, representedParty }`).\n *\n * @param {Array<object>|null} rows The role rows.\n * @return {Record<string, string>} The map.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function representedByMap(rows) {\n\tconst map = {}\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst participant = String(row?.participant || '').trim()\n\t\tconst represented = String(row?.representedParty?.id || row?.representedParty || '').trim()\n\t\tif (participant !== '' && represented !== '') {\n\t\t\tmap[participant] = represented\n\t\t}\n\t}\n\treturn map\n}\n\n/**\n * The documents a party sent and received: sender is the party, or the party\n * is among the recipients.\n *\n * @param {Array<object>} documents The documents.\n * @param {string} identifier The party's uuid.\n * @param {{senderField?: string, recipientsField?: string}} [fields] Where a document names them.\n * @return {{sent: Array<object>, received: Array<object>}} The two lists.\n * @spec openspec/changes/dq-abstract-record-widgets/specs/record-widgets/spec.md#requirement-a-record-shows-its-parties-by-role\n */\nexport function documentsOfParty(documents, identifier, fields = {}) {\n\tconst id = String(identifier || '').trim()\n\tconst rows = Array.isArray(documents) ? documents : []\n\tif (id === '') {\n\t\treturn { sent: [], received: [] }\n\t}\n\tconst sender = fields.senderField || 'sender'\n\tconst recipients = fields.recipientsField || 'recipients'\n\treturn {\n\t\tsent: rows.filter((row) => String(row?.[sender] || '').trim() === id),\n\t\treceived: rows.filter((row) => (Array.isArray(row?.[recipients]) ? row[recipients] : []).map((entry) => String(entry || '').trim()).includes(id)),\n\t}\n}\n\n/**\n * The code of a party kind (`code`, else `key`).\n *\n * @param {object} kind The kind.\n * @return {string} The code.\n */\nexport function kindCode(kind) {\n\treturn String(kind?.code || kind?.key || '')\n}\n\n/**\n * Whether a party's kind is among the kinds a record accepts. Two\n * vocabularies meet here: the party's kind is its schema's (`person`,\n * `organisation`, `colleague`), while the accepted kinds may be role kinds\n * that name the identity shapes they take (pipelinq's `aanvrager` with\n * `identityShapes: [\"naturalPerson\", \"organization\"]`). When the accepted\n * kinds name shapes, the party's own kind is matched by the shapes the\n * listing gives it; a kind that names none cannot be judged and passes.\n * Otherwise the codes are compared.\n *\n * @param {string} partyKind The party's kind key.\n * @param {Array<object>} accepted The accepted kinds.\n * @param {Array<object>} own The listing's own kinds (`{ key, identityShapes? }`).\n * @return {boolean} False only when the party is known not to fit.\n * @spec openspec/changes/parties-accepted-kinds-by-shape/specs/object-parties/spec.md#requirement-a-party-is-checked-against-the-accepted-kinds-in-one-vocabulary\n */\nexport function partyKindAccepted(partyKind, accepted, own) {\n\tconst kinds = Array.isArray(accepted) ? accepted : []\n\tconst shapes = new Set(kinds.flatMap((kind) => (Array.isArray(kind?.identityShapes) ? kind.identityShapes : [])))\n\tif (shapes.size === 0) {\n\t\treturn kinds.some((kind) => kindCode(kind) === partyKind)\n\t}\n\tconst mine = (Array.isArray(own) ? own : []).find((kind) => kindCode(kind) === partyKind)?.identityShapes\n\tif (!Array.isArray(mine) || mine.length === 0) {\n\t\treturn true\n\t}\n\treturn mine.some((shape) => shapes.has(shape))\n}\n\n/**\n * Write a value at a dotted path, creating the objects on the way.\n *\n * @param {object} target The object written into.\n * @param {string} path The dotted path (`name.surname`).\n * @param {unknown} value The value.\n * @return {void}\n */\nfunction writePath(target, path, value) {\n\tconst keys = String(path).split('.').filter((key) => key !== '')\n\tlet node = target\n\tkeys.slice(0, -1).forEach((key) => {\n\t\tif (!node[key] || typeof node[key] !== 'object') {\n\t\t\tnode[key] = {}\n\t\t}\n\t\tnode = node[key]\n\t})\n\tif (keys.length > 0) {\n\t\tnode[keys[keys.length - 1]] = value\n\t}\n}\n\n/**\n * The record a new party is saved as, from the fields a host declares.\n *\n * Each field `{ key, path?, address? }` writes its trimmed value at `path`\n * (default `key`); a field with `address: { path, kind, type }` instead adds\n * `{ kind, type, value }` to the list at that path, the shape OpenRegister's\n * party model reads as the party's addresses. `compose` names the paths a\n * derived field joins with a space, skipping the empty ones\n * (`{ displayName: [\"name.givenNames\", \"name.namePrefix\", \"name.surname\"] }`).\n * A field of `type: \"integer\"` is saved as a number when it reads as one.\n * An empty value is left out.\n *\n * @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.\n * @param {Record<string, string>} values The values by field key.\n * @return {object} The record.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function newPartyRecord(create, values) {\n\tconst record = {}\n\tfor (const field of Array.isArray(create?.fields) ? create.fields : []) {\n\t\tconst value = String(values?.[field?.key] ?? '').trim()\n\t\tif (!field || !field.key || value === '') {\n\t\t\tcontinue\n\t\t}\n\t\tif (field.address && field.address.path) {\n\t\t\tconst list = readPath(record, field.address.path)\n\t\t\tconst entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }\n\t\t\twritePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])\n\t\t\tcontinue\n\t\t}\n\t\twritePath(record, field.path || field.key, field.type === 'integer' && /^-?\\d+$/.test(value) ? Number(value) : value)\n\t}\n\tfor (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {\n\t\tconst joined = (Array.isArray(paths) ? paths : [])\n\t\t\t.map((path) => String(readPath(record, path) ?? '').trim())\n\t\t\t.filter((part) => part !== '')\n\t\t\t.join(' ')\n\t\tif (joined !== '') {\n\t\t\twritePath(record, target, joined)\n\t\t}\n\t}\n\treturn record\n}\n\n/**\n * The uuid a create answered with: `id`, `uuid` or `@self.id`.\n *\n * @param {object} saved The saved object.\n * @return {string} The uuid, or ''.\n * @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties\n */\nexport function savedUuid(saved) {\n\treturn String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')\n}\n\n/**\n * The board row's meta line (DqZaakBetrokkenen \"Rollen\", design-system #811):\n * the primary mark, the role, the link's note and the extra lines, by middots.\n * A role that follows the primary mark reads in lower case (\"Primaire partij ·\n * verzoeker\"), unless it is an abbreviation. No kind word: the row's role and\n * note already say what the party is.\n *\n * @param {{primary: string, role: string, note: string, extras: Array<string>}} parts The parts.\n * @return {string} The line.\n * @spec openspec/changes/parties-board-rows-r40/specs/record-widgets/spec.md#requirement-a-board-party-row-reads-as-design-system-811-draws-it\n */\nexport function boardMetaLine({ primary = '', role = '', note = '', extras = [] }) {\n\tlet shownRole = typeof role === 'string' ? role : ''\n\tconst abbreviation = shownRole.length > 1 && shownRole[1] === shownRole[1].toUpperCase() && shownRole[1] !== shownRole[1].toLowerCase()\n\tif (primary && shownRole !== '' && !abbreviation) {\n\t\tshownRole = shownRole[0].toLowerCase() + shownRole.slice(1)\n\t}\n\treturn [primary, shownRole, note, ...(Array.isArray(extras) ? extras : [])]\n\t\t.filter((part) => typeof part === 'string' && part.trim() !== '')\n\t\t.join(' · ')\n}\n\n/**\n * Whether a party's row says it has no secrecy (`content.secrecy`): its kind\n * is one of `kinds`, its record carries no indicator keyed `indicator`, and,\n * with `primaryOnly`, it is the record's primary party.\n *\n * @param {object} party The listing row (`partyUuid`, `partyKind`).\n * @param {object|undefined} record The party record with its `indicators`.\n * @param {{indicator: string, kinds?: Array<string>, primaryOnly?: boolean}|undefined} secrecy The declaration.\n * @param {string|null} primary The primary party's uuid.\n * @return {boolean}\n * @spec openspec/changes/parties-board-rows-r40/specs/record-widgets/spec.md#requirement-a-party-of-a-listed-kind-says-it-has-no-secrecy\n */\nexport function showsNoSecrecy(party, record, secrecy, primary) {\n\tif (!secrecy || typeof secrecy.indicator !== 'string' || secrecy.indicator === '' || !party) {\n\t\treturn false\n\t}\n\tconst kinds = Array.isArray(secrecy.kinds) ? secrecy.kinds : []\n\tif (kinds.length > 0 && !kinds.includes(party.partyKind)) {\n\t\treturn false\n\t}\n\tif (secrecy.primaryOnly === true && (!primary || party.partyUuid !== primary)) {\n\t\treturn false\n\t}\n\tconst indicators = Array.isArray(record?.indicators) ? record.indicators : []\n\treturn !indicators.some((indicator) => indicator && indicator.key === secrecy.indicator)\n}\n\n/**\n * The pill that names when a party's link ends (`validUntil`), in the app's\n * words with `{date}`: \"Machtiging tot 31 dec\". Empty without words or an end.\n *\n * @param {object} party The link row.\n * @param {string} label The words, with `{date}`.\n * @param {Date} [now] The reference moment, for the year.\n * @param {string} [locale] BCP 47 tag (defaults to the user's).\n * @return {string} The pill text, or ''.\n * @spec openspec/changes/party-representation-end-pill/specs/record-widgets/spec.md#requirement-a-representatives-row-names-when-the-representation-ends\n */\nexport function untilPillOf(party, label, now = new Date(), locale = boardDateLocale()) {\n\tconst words = typeof label === 'string' ? label : ''\n\tconst date = words === '' ? '' : formatBoardDate(party?.validUntil, now, locale)\n\treturn date === '' ? '' : words.replaceAll('{date}', date)\n}\n"],"names":["t"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,EAAE,EAAE;AACvD,CAAC,IAAI,UAAU,IAAI,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE;AAClF,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC;AACxB,EAAE;AACF,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAC;AACxE,CAAC,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;AACjC,EAAE,OAAO,QAAQ,CAAC,KAAK;AACvB,EAAE;AACF,CAAC,OAAO,GAAG,KAAK,OAAO,GAAGA,SAAC,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG,GAAG;AAC7D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE;AACjD,CAAC,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,GAAE;AACnE,CAAC,IAAI,CAAC,OAAO,EAAE;AACf,EAAE,OAAO,IAAI;AACb,EAAE;AACF,CAAC,OAAO;AACR,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,SAAS,KAAK,OAAO,CAAC;A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AAC;AAC3D;;;;"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ * SPDX-License-Identifier: EUPL-1.2
4
+ */
5
+
6
+ const SIDES = ['top', 'right', 'bottom', 'left'];
7
+
8
+ /**
9
+ * How far chrome floating over a frame reaches into it, per side.
10
+ *
11
+ * A box taller than half the frame is a side panel and reserves its width on
12
+ * the side it stands; any other box is a strip and reserves its height from
13
+ * the top or the bottom, whichever half holds its centre. Boxes with no size
14
+ * (not drawn) are skipped.
15
+ *
16
+ * @param {DOMRect|object|null} frame The frame's rect.
17
+ * @param {Array<DOMRect|object|null>} rects The floating boxes' rects.
18
+ * @return {{top: number, right: number, bottom: number, left: number}} Pixels per side.
19
+ */
20
+ function overlayInset(frame, rects) {
21
+ const inset = { top: 0, right: 0, bottom: 0, left: 0 };
22
+ if (!frame || !frame.width || !frame.height) {
23
+ return inset
24
+ }
25
+ for (const rect of rects || []) {
26
+ if (!rect || !rect.width || !rect.height) {
27
+ continue
28
+ }
29
+ if (rect.height > frame.height / 2) {
30
+ if (rect.left + rect.width / 2 > frame.left + frame.width / 2) {
31
+ inset.right = Math.max(inset.right, frame.right - rect.left);
32
+ } else {
33
+ inset.left = Math.max(inset.left, rect.right - frame.left);
34
+ }
35
+ } else if (rect.top + rect.height / 2 < frame.top + frame.height / 2) {
36
+ inset.top = Math.max(inset.top, rect.bottom - frame.top);
37
+ } else {
38
+ inset.bottom = Math.max(inset.bottom, frame.bottom - rect.top);
39
+ }
40
+ }
41
+ return inset
42
+ }
43
+
44
+ /**
45
+ * Vue Flow's fit padding for a canvas with chrome over it: each side's inset
46
+ * plus a gap, in pixels. Without an inset, Vue Flow's own 0.1.
47
+ *
48
+ * @param {object|null} inset Pixels per side, as overlayInset returns.
49
+ * @param {number} gap Pixels kept clear beyond the inset.
50
+ * @return {number|object} The `padding` for Vue Flow's fitView.
51
+ */
52
+ function fitPaddingFor(inset, gap = 24) {
53
+ if (!inset || !SIDES.some((side) => inset[side] > 0)) {
54
+ return 0.1
55
+ }
56
+ return Object.fromEntries(SIDES.map((side) => [side, `${Math.round((inset[side] || 0) + gap)}px`]))
57
+ }
58
+
59
+ export { fitPaddingFor, overlayInset };
60
+ //# sourceMappingURL=overlayInset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlayInset.js","sources":["../../../src/utils/overlayInset.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n */\n\nconst SIDES = ['top', 'right', 'bottom', 'left']\n\n/**\n * How far chrome floating over a frame reaches into it, per side.\n *\n * A box taller than half the frame is a side panel and reserves its width on\n * the side it stands; any other box is a strip and reserves its height from\n * the top or the bottom, whichever half holds its centre. Boxes with no size\n * (not drawn) are skipped.\n *\n * @param {DOMRect|object|null} frame The frame's rect.\n * @param {Array<DOMRect|object|null>} rects The floating boxes' rects.\n * @return {{top: number, right: number, bottom: number, left: number}} Pixels per side.\n */\nexport function overlayInset(frame, rects) {\n\tconst inset = { top: 0, right: 0, bottom: 0, left: 0 }\n\tif (!frame || !frame.width || !frame.height) {\n\t\treturn inset\n\t}\n\tfor (const rect of rects || []) {\n\t\tif (!rect || !rect.width || !rect.height) {\n\t\t\tcontinue\n\t\t}\n\t\tif (rect.height > frame.height / 2) {\n\t\t\tif (rect.left + rect.width / 2 > frame.left + frame.width / 2) {\n\t\t\t\tinset.right = Math.max(inset.right, frame.right - rect.left)\n\t\t\t} else {\n\t\t\t\tinset.left = Math.max(inset.left, rect.right - frame.left)\n\t\t\t}\n\t\t} else if (rect.top + rect.height / 2 < frame.top + frame.height / 2) {\n\t\t\tinset.top = Math.max(inset.top, rect.bottom - frame.top)\n\t\t} else {\n\t\t\tinset.bottom = Math.max(inset.bottom, frame.bottom - rect.top)\n\t\t}\n\t}\n\treturn inset\n}\n\n/**\n * Vue Flow's fit padding for a canvas with chrome over it: each side's inset\n * plus a gap, in pixels. Without an inset, Vue Flow's own 0.1.\n *\n * @param {object|null} inset Pixels per side, as overlayInset returns.\n * @param {number} gap Pixels kept clear beyond the inset.\n * @return {number|object} The `padding` for Vue Flow's fitView.\n */\nexport function fitPaddingFor(inset, gap = 24) {\n\tif (!inset || !SIDES.some((side) => inset[side] > 0)) {\n\t\treturn 0.1\n\t}\n\treturn Object.fromEntries(SIDES.map((side) => [side, `${Math.round((inset[side] || 0) + gap)}px`]))\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE;AAC3C,CAAC,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAE;AACvD,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;AAC9C,EAAE,OAAO,KAAK;AACd,EAAE;AACF,CAAC,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE;AACjC,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;AAC5C,GAAG,QAAQ;AACX,GAAG;AACH,EAAE,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AACtC,GAAG,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE;AAClE,IAAI,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,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