@conduction/nextcloud-vue 2.171.0 → 2.173.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 (76) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  4. package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue2.js +3 -2
  5. package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue2.js.map +1 -1
  6. package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js +2 -1
  7. package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js.map +1 -1
  8. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js +39 -0
  9. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js.map +1 -1
  10. package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue3.js.map +1 -1
  11. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  12. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +22 -3
  13. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  14. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  15. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  16. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  17. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  19. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +75 -4
  20. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  21. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  22. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  23. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +7 -3
  24. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  25. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  26. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
  27. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +34 -4
  28. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  29. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +42 -34
  30. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  31. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  32. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +21 -6
  33. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  34. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  35. package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
  36. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +54 -4
  37. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
  38. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +32 -26
  39. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
  40. package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
  41. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +28 -4
  42. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
  43. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +4 -1
  44. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
  45. package/dist/esm/composables/aiChatConfig.js +13 -1
  46. package/dist/esm/composables/aiChatConfig.js.map +1 -1
  47. package/dist/esm/composables/useAiChatStream.js +53 -1
  48. package/dist/esm/composables/useAiChatStream.js.map +1 -1
  49. package/dist/esm/library-style.js +1 -1
  50. package/dist/esm/nextcloud-vue.css +745 -403
  51. package/dist/esm/utils/builtInFormatters.js +19 -1
  52. package/dist/esm/utils/builtInFormatters.js.map +1 -1
  53. package/dist/nextcloud-vue.cjs.js +919 -569
  54. package/dist/nextcloud-vue.cjs.js.map +2 -2
  55. package/dist/nextcloud-vue.css +745 -403
  56. package/package.json +1 -1
  57. package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
  58. package/src/components/CnAiCompanion/CnAiChatWidget.md +1 -0
  59. package/src/components/CnAiCompanion/CnAiChatWidget.vue +4 -2
  60. package/src/components/CnAiCompanion/CnAiCompanion.md +1 -0
  61. package/src/components/CnAiCompanion/CnAiCompanion.vue +39 -0
  62. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
  63. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +5 -2
  64. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
  65. package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
  66. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +45 -4
  67. package/src/components/CnFlowsPage/CnFlowBoard.vue +27 -6
  68. package/src/components/CnTreeView/CnTreeNode.vue +69 -6
  69. package/src/components/CnTreeView/CnTreeView.vue +31 -4
  70. package/src/composables/aiChatConfig.js +12 -0
  71. package/src/composables/useAiChatStream.js +53 -0
  72. package/src/css/look-board-detail.css +200 -6
  73. package/src/css/look-board-index.css +7 -6
  74. package/src/css/look-board.css +118 -0
  75. package/src/css/patches.css +4 -1
  76. package/src/utils/builtInFormatters.js +18 -0
@@ -23,10 +23,16 @@ var script = {
23
23
  labelKey: { type: String, default: 'label' },
24
24
  /** Node-field key for the children array. */
25
25
  childrenKey: { type: String, default: 'children' },
26
- /** A11y label for the expand button. */
27
- expandLabel: { type: String, default: 'Expand' },
28
- /** A11y label for the collapse button. */
29
- collapseLabel: { type: String, default: 'Collapse' },
26
+ /** A11y label for the expand button, or `(node) => string`. */
27
+ expandLabel: { type: [String, Function], default: 'Expand' },
28
+ /** A11y label for the collapse button, or `(node) => string`. */
29
+ collapseLabel: { type: [String, Function], default: 'Collapse' },
30
+ /** Extra expand-button attributes per node, `(node, depth) => object`. */
31
+ toggleAttrs: { type: Function, default: null },
32
+ /** Extra row attributes per node, `(node, depth) => object`. */
33
+ rowAttrs: { type: Function, default: null },
34
+ /** Rows take focus and select on Enter or Space. */
35
+ focusableRows: { type: Boolean, default: false },
30
36
  },
31
37
 
32
38
  emits: ['select', 'toggle'],
@@ -58,6 +64,34 @@ var script = {
58
64
  isSelected() {
59
65
  return this.selectedId === this.node[this.idKey]
60
66
  },
67
+
68
+ /**
69
+ * The expand button's accessible name for this node.
70
+ *
71
+ * @return {string}
72
+ */
73
+ toggleLabel() {
74
+ const label = this.isExpanded ? this.collapseLabel : this.expandLabel;
75
+ return typeof label === 'function' ? label(this.node) : label
76
+ },
77
+
78
+ /**
79
+ * The host's extra attributes for this row.
80
+ *
81
+ * @return {object}
82
+ */
83
+ extraRowAttrs() {
84
+ return this.rowAttrs ? this.rowAttrs(this.node, this.depth) : {}
85
+ },
86
+
87
+ /**
88
+ * The host's extra attributes for this row's expand button.
89
+ *
90
+ * @return {object}
91
+ */
92
+ extraToggleAttrs() {
93
+ return this.toggleAttrs ? this.toggleAttrs(this.node, this.depth) : {}
94
+ },
61
95
  },
62
96
 
63
97
  methods: {
@@ -68,6 +102,22 @@ var script = {
68
102
  onRowClick() {
69
103
  this.$emit('select', this.node);
70
104
  },
105
+
106
+ /**
107
+ * Enter or Space on a focusable row selects its node. Keys pressed on
108
+ * the expand button or an action inside the row are theirs.
109
+ *
110
+ * @param {KeyboardEvent} event The key event.
111
+ */
112
+ onRowKeydown(event) {
113
+ if (!this.focusableRows || event.target !== event.currentTarget) {
114
+ return
115
+ }
116
+ if (event.key === 'Enter' || event.key === ' ') {
117
+ event.preventDefault();
118
+ this.$emit('select', this.node);
119
+ }
120
+ },
71
121
  },
72
122
  };
73
123
 
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeNode.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t@click=\"onRowClick\">\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"isExpanded ? collapseLabel : expandLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<ul v-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button. */\n\t\texpandLabel: { type: String, default: 'Expand' },\n\t\t/** A11y label for the collapse button. */\n\t\tcollapseLabel: { type: String, default: 'Collapse' },\n\t},\n\n\temits: ['select', 'toggle'],\n\tcomputed: {\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":[],"mappings":"AAgEA;;;;AAIC;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;AAClB,CAAA,KAAK,EAAE;AACN;AACA,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;EAEtC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA,EAAG;AACnC;AACA,EAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;;AAErC,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;EAE7C,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM;;AAErD,EAAA,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;AACtC;AACA,EAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5C;AACA,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;AAClD;AACA,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU;AAChD;EACA,aAAa,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;EACpD;;CAED,KAAK,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC3B,CAAA,QAAQ,EAAE;AACT;AACC;AACA;AACA;;EAED,WAAW,GAAG;AACb,GAAA,MAAM,CAAE,GAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAA;AACpC,GAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,SAAS,CAAA;GACtC;;AAED;AACC;AACA;AACA;;EAED,UAAU,GAAG;GACZ,OAAO,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;GACtD;;AAED;AACC;AACA;AACA;;EAED,UAAU,GAAG;AACZ,GAAA,OAAO,IAAI,CAAC,UAAW,KAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA;GAC/C;EACD;;AAED,CAAA,OAAO,EAAE;AACR,EAAA,MAAM,GAAG;AACR,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;GAC1C;;EAED,UAAU,GAAG;GACZ,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAA;GAC9B;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnTreeNode.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\tv-bind=\"extraRowAttrs\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t:tabindex=\"focusableRows ? 0 : undefined\"\n\t\t\t@click=\"onRowClick\"\n\t\t\t@keydown=\"onRowKeydown\">\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tv-bind=\"extraToggleAttrs\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"toggleLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<ul v-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button, or `(node) => string`. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string`. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/** Extra expand-button attributes per node, `(node, depth) => object`. */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/** Extra row attributes per node, `(node, depth) => object`. */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/** Rows take focus and select on Enter or Space. */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'toggle'],\n\tcomputed: {\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\n\t\t/**\n\t\t * The expand button's accessible name for this node.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\ttoggleLabel() {\n\t\t\tconst label = this.isExpanded ? this.collapseLabel : this.expandLabel\n\t\t\treturn typeof label === 'function' ? label(this.node) : label\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraRowAttrs() {\n\t\t\treturn this.rowAttrs ? this.rowAttrs(this.node, this.depth) : {}\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row's expand button.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraToggleAttrs() {\n\t\t\treturn this.toggleAttrs ? this.toggleAttrs(this.node, this.depth) : {}\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\n\t\t/**\n\t\t * Enter or Space on a focusable row selects its node. Keys pressed on\n\t\t * the expand button or an action inside the row are theirs.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t */\n\t\tonRowKeydown(event) {\n\t\t\tif (!this.focusableRows || event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.key === 'Enter' || event.key === ' ') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.$emit('select', this.node)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n/* A row made focusable by `focusableRows` shows where keyboard focus is (WCAG 2.4.7). */\n.cn-tree-node__row[tabindex]:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":[],"mappings":"AAuEA;;;;AAIC;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;AAClB,CAAA,KAAK,EAAE;AACN;AACA,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;EAEtC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA,EAAG;AACnC;AACA,EAAA,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI;;AAErC,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;;EAE7C,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM;;AAErD,EAAA,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;AACtC;AACA,EAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;AAC5C;AACA,EAAA,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;;EAElD,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAO,EAAG;;EAE5D,aAAa,EAAE,EAAE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CAAC,KAAK,CAAE,GAAE,EAAC;GAC/D;;AAED;;AAEC;AACA;;AAED,EAAA,gBAAgB,GAAG;AAClB,GAAA,OAAO,IAAI,CAAC,WAAY,GAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAA,GAAI,EAAC;GACrE;EACD;;AAED,CAAA,OAAO,EAAE;AACR,EAAA,MAAM,GAAG;AACR,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;GAC1C;;EAED,UAAU,GAAG;GACZ,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAA;GAC9B;;AAED;;;AAGC;AACA;;AAED,EAAA,YAAY,CAAC,KAAK,EAAE;GACnB,IAAI,CAAC,IAAI,CAAC,aAAc,IAAG,KAAK,CAAC,MAAK,KAAM,KAAK,CAAC,aAAa,EAAE;IAChE,MAAK;AACN,IAAA;AACA,GAAA,IAAI,KAAK,CAAC,QAAQ,WAAW,KAAK,CAAC,GAAI,KAAI,GAAG,EAAE;AAC/C,IAAA,KAAK,CAAC,cAAc,GAAC;IACrB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAA;AAC/B,IAAA;GACA;EACD;AACF;;;;"}
@@ -1,21 +1,22 @@
1
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, withModifiers, toDisplayString, createCommentVNode, renderSlot, createTextVNode, Fragment, renderList, createBlock, createSlots, withCtx, mergeProps } from 'vue';
1
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, mergeProps, withModifiers, toDisplayString, createCommentVNode, renderSlot, createTextVNode, Fragment, renderList, createBlock, createSlots, withCtx } from 'vue';
2
2
 
3
3
  const _hoisted_1 = ["data-node-id", "aria-expanded", "aria-selected"];
4
- const _hoisted_2 = ["aria-label"];
5
- const _hoisted_3 = {
4
+ const _hoisted_2 = ["tabindex"];
5
+ const _hoisted_3 = ["aria-label"];
6
+ const _hoisted_4 = {
6
7
  key: 1,
7
8
  class: "cn-tree-node__toggle cn-tree-node__toggle--leaf"
8
9
  };
9
- const _hoisted_4 = {
10
+ const _hoisted_5 = {
10
11
  key: 2,
11
12
  class: "cn-tree-node__icon"
12
13
  };
13
- const _hoisted_5 = { class: "cn-tree-node__label" };
14
- const _hoisted_6 = {
14
+ const _hoisted_6 = { class: "cn-tree-node__label" };
15
+ const _hoisted_7 = {
15
16
  key: 3,
16
17
  class: "cn-tree-node__badge"
17
18
  };
18
- const _hoisted_7 = {
19
+ const _hoisted_8 = {
19
20
  key: 0,
20
21
  class: "cn-tree-node__children",
21
22
  role: "group"
@@ -34,28 +35,30 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
34
35
  "aria-expanded": $options.hasChildren ? $options.isExpanded : undefined,
35
36
  "aria-selected": $options.isSelected
36
37
  }, [
37
- createElementVNode("div", {
38
- class: "cn-tree-node__row",
39
- style: normalizeStyle({ paddingLeft: ($props.depth * $props.indent) + 'px' }),
40
- onClick: _cache[1] || (_cache[1] = (...args) => ($options.onRowClick && $options.onRowClick(...args)))
41
- }, [
38
+ createElementVNode("div", mergeProps({ class: "cn-tree-node__row" }, $options.extraRowAttrs, {
39
+ style: { paddingLeft: ($props.depth * $props.indent) + 'px' },
40
+ tabindex: $props.focusableRows ? 0 : undefined,
41
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.onRowClick && $options.onRowClick(...args))),
42
+ onKeydown: _cache[2] || (_cache[2] = (...args) => ($options.onRowKeydown && $options.onRowKeydown(...args)))
43
+ }), [
42
44
  ($options.hasChildren)
43
- ? (openBlock(), createElementBlock("button", {
45
+ ? (openBlock(), createElementBlock("button", mergeProps({
44
46
  key: 0,
45
- type: "button",
47
+ type: "button"
48
+ }, $options.extraToggleAttrs, {
46
49
  class: "cn-tree-node__toggle",
47
- "aria-label": $options.isExpanded ? $props.collapseLabel : $props.expandLabel,
50
+ "aria-label": $options.toggleLabel,
48
51
  onClick: _cache[0] || (_cache[0] = withModifiers((...args) => ($options.toggle && $options.toggle(...args)), ["stop"]))
49
- }, [
52
+ }), [
50
53
  createElementVNode("span", {
51
54
  class: normalizeClass(["cn-tree-node__caret", { 'cn-tree-node__caret--open': $options.isExpanded }])
52
55
  }, "▸", 2 /* CLASS */)
53
- ], 8 /* PROPS */, _hoisted_2))
54
- : (openBlock(), createElementBlock("span", _hoisted_3)),
56
+ ], 16 /* FULL_PROPS */, _hoisted_3))
57
+ : (openBlock(), createElementBlock("span", _hoisted_4)),
55
58
  ($props.node.icon)
56
- ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString($props.node.icon), 1 /* TEXT */))
59
+ ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString($props.node.icon), 1 /* TEXT */))
57
60
  : createCommentVNode("v-if", true),
58
- createElementVNode("span", _hoisted_5, [
61
+ createElementVNode("span", _hoisted_6, [
59
62
  renderSlot(_ctx.$slots, "label", {
60
63
  node: $props.node,
61
64
  depth: $props.depth,
@@ -65,15 +68,15 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
65
68
  ])
66
69
  ]),
67
70
  ($props.node.badge !== undefined)
68
- ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString($props.node.badge), 1 /* TEXT */))
71
+ ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($props.node.badge), 1 /* TEXT */))
69
72
  : createCommentVNode("v-if", true),
70
73
  renderSlot(_ctx.$slots, "actions", {
71
74
  node: $props.node,
72
75
  depth: $props.depth
73
76
  })
74
- ], 4 /* STYLE */),
77
+ ], 16 /* FULL_PROPS */, _hoisted_2),
75
78
  ($options.hasChildren && $options.isExpanded)
76
- ? (openBlock(), createElementBlock("ul", _hoisted_7, [
79
+ ? (openBlock(), createElementBlock("ul", _hoisted_8, [
77
80
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.node[$props.childrenKey], (child) => {
78
81
  return (openBlock(), createBlock(_component_CnTreeNode, {
79
82
  key: child[$props.idKey],
@@ -87,8 +90,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
87
90
  childrenKey: $props.childrenKey,
88
91
  expandLabel: $props.expandLabel,
89
92
  collapseLabel: $props.collapseLabel,
90
- onToggle: _cache[2] || (_cache[2] = $event => (_ctx.$emit('toggle', $event))),
91
- onSelect: _cache[3] || (_cache[3] = $event => (_ctx.$emit('select', $event)))
93
+ toggleAttrs: $props.toggleAttrs,
94
+ rowAttrs: $props.rowAttrs,
95
+ focusableRows: $props.focusableRows,
96
+ onToggle: _cache[3] || (_cache[3] = $event => (_ctx.$emit('toggle', $event))),
97
+ onSelect: _cache[4] || (_cache[4] = $event => (_ctx.$emit('select', $event)))
92
98
  }, createSlots({
93
99
  actions: withCtx((scope) => [
94
100
  renderSlot(_ctx.$slots, "actions", mergeProps({ ref_for: true }, scope))
@@ -104,7 +110,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
104
110
  key: "0"
105
111
  }
106
112
  : undefined
107
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "depth", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel"]))
113
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "depth", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "toggleAttrs", "rowAttrs", "focusableRows"]))
108
114
  }), 128 /* KEYED_FRAGMENT */))
109
115
  ]))
110
116
  : createCommentVNode("v-if", true)
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeNode.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue?vue&type=template&id=478b0cc7&lang.js"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t@click=\"onRowClick\">\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"isExpanded ? collapseLabel : expandLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<ul v-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button. */\n\t\texpandLabel: { type: String, default: 'Expand' },\n\t\t/** A11y label for the collapse button. */\n\t\tcollapseLabel: { type: String, default: 'Collapse' },\n\t},\n\n\temits: ['select', 'toggle'],\n\tcomputed: {\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_normalizeStyle","_normalizeClass","_openBlock","_toDisplayString","_renderSlot","_createTextVNode","_Fragment","_renderList","_createBlock","_withCtx","_mergeProps"],"mappings":";;;;;;AAoBgB,EAAA,KAAK,EAAC;;;;AAEI,EAAA,KAAK,EAAC,oBAAoB;;AAC3C,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,qBAAqB,GAAA;;;AAOK,EAAA,KAAK,EAAC,qBAAqB;;;;AAO7B,EAAA,KAAK,EAAC,wBAAuB;AAAE,EAAA,IAAI,EAAC,OAAO;;;;;;uBApCjFA,kBA2DI,CAAA,IAAA,EAAA;AA3DA,IAAA,KAAK,kBAAC,cAAa,EAAA;6BACd,QAAA,CAAA,UAAA;6BAAA,QAAA,CAAA,UAAA;;IAIP,cAAY,EAAE,MAAI,CAAA,IAAA,CAAC,MAAK,CAAA,KAAA,CAAA;AACzB,IAAA,IAAI,EAAC,UAAS;AACb,IAAA,eAAa,EAAE,QAAA,CAAA,WAAU,GAAI,QAAA,CAAA,UAAW,GAAE,SAAS;AACnD,IAAA,eAAa,EAAE,QAAU,CAAA,UAAA;;IAC1BC,kBAyBK,CAAA,KAAA,EAAA;AAzBA,MAAA,KAAK,EAAC,mBAAkB;MAC3B,KAAK,EAAAC,cAAA,CAAA,EAAA,WAAA,EAAA,CAAkB,MAAM,CAAA,KAAA,GAAE,MAAM,CAAA,MAAA,IAAA,IAAA,EAAA,CAAA;AACrC,MAAA,OAAK,0CAAE,QAAU,CAAA,UAAA,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA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,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,IAAK,CAAA,KAAA,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA,CAAA;;cACpB,OAAO,EAAAC,OAAA,CACjB,CAAqC,KADb,KAAA;gBACxBL,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCM,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,cAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;0BAAG,OAAK;AACnC,oBAAA,EAAA,EAAAD,OAAA,CAAA,CADqC,KAAK,KAAA;sBAC1CL,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCM,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnTreeNode.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeNode.vue?vue&type=template&id=aba6ea88&lang.js"],"sourcesContent":["<template>\n\t<li class=\"cn-tree-node\"\n\t\t:class=\"{\n\t\t\t'cn-tree-node--selected': isSelected,\n\t\t\t'cn-tree-node--expanded': isExpanded,\n\t\t}\"\n\t\t:data-node-id=\"node[idKey]\"\n\t\trole=\"treeitem\"\n\t\t:aria-expanded=\"hasChildren ? isExpanded : undefined\"\n\t\t:aria-selected=\"isSelected\">\n\t\t<div class=\"cn-tree-node__row\"\n\t\t\tv-bind=\"extraRowAttrs\"\n\t\t\t:style=\"{ paddingLeft: (depth * indent) + 'px' }\"\n\t\t\t:tabindex=\"focusableRows ? 0 : undefined\"\n\t\t\t@click=\"onRowClick\"\n\t\t\t@keydown=\"onRowKeydown\">\n\t\t\t<button v-if=\"hasChildren\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tv-bind=\"extraToggleAttrs\"\n\t\t\t\tclass=\"cn-tree-node__toggle\"\n\t\t\t\t:aria-label=\"toggleLabel\"\n\t\t\t\t@click.stop=\"toggle\">\n\t\t\t\t<span class=\"cn-tree-node__caret\" :class=\"{ 'cn-tree-node__caret--open': isExpanded }\">▸</span>\n\t\t\t</button>\n\t\t\t<span v-else class=\"cn-tree-node__toggle cn-tree-node__toggle--leaf\" />\n\n\t\t\t<span v-if=\"node.icon\" class=\"cn-tree-node__icon\">{{ node.icon }}</span>\n\t\t\t<span class=\"cn-tree-node__label\">\n\t\t\t\t<!-- @slot label The row's label. Scope: { node, depth, expanded }. Defaults to the node's label text. -->\n\t\t\t\t<slot name=\"label\"\n\t\t\t\t\t:node=\"node\"\n\t\t\t\t\t:depth=\"depth\"\n\t\t\t\t\t:expanded=\"isExpanded\">{{ node[labelKey] }}</slot>\n\t\t\t</span>\n\t\t\t<span v-if=\"node.badge !== undefined\" class=\"cn-tree-node__badge\">{{ node.badge }}</span>\n\n\t\t\t<!-- @slot actions Inline per-row actions slot. Scope:\n\t\t\t { node, depth }. -->\n\t\t\t<slot name=\"actions\" :node=\"node\" :depth=\"depth\" />\n\t\t</div>\n\n\t\t<ul v-if=\"hasChildren && isExpanded\" class=\"cn-tree-node__children\" role=\"group\">\n\t\t\t<CnTreeNode v-for=\"child in node[childrenKey]\"\n\t\t\t\t:key=\"child[idKey]\"\n\t\t\t\t:node=\"child\"\n\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedIds\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"$emit('toggle', $event)\"\n\t\t\t\t@select=\"$emit('select', $event)\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</li>\n</template>\n\n<script>\n/**\n * CnTreeNode — Recursive tree row used inside CnTreeView. Renders\n * its own row + recurses for children when expanded. Not exported\n * as a separate barrel entry — consumers use CnTreeView and the\n * recursion is internal.\n */\nexport default {\n\tname: 'CnTreeNode',\n\tprops: {\n\t\t/** The node data. */\n\t\tnode: { type: Object, required: true },\n\t\t/** Depth (drives indent). */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** Pixels of padding per depth level. */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Set of expanded node ids. */\n\t\texpandedIds: { type: Object, required: true },\n\t\t/** Currently selected node id, read off `node[idKey]` (or null). */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Node-field key for the id. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Node-field key for the display label. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Node-field key for the children array. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** A11y label for the expand button, or `(node) => string`. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string`. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/** Extra expand-button attributes per node, `(node, depth) => object`. */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/** Extra row attributes per node, `(node, depth) => object`. */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/** Rows take focus and select on Enter or Space. */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'toggle'],\n\tcomputed: {\n\t\t/**\n\t\t * Whether this node has any children at all.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasChildren() {\n\t\t\tconst c = this.node[this.childrenKey]\n\t\t\treturn Array.isArray(c) && c.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is currently expanded.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisExpanded() {\n\t\t\treturn Boolean(this.expandedIds[this.node[this.idKey]])\n\t\t},\n\n\t\t/**\n\t\t * Whether this node is the currently-selected one.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected() {\n\t\t\treturn this.selectedId === this.node[this.idKey]\n\t\t},\n\n\t\t/**\n\t\t * The expand button's accessible name for this node.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\ttoggleLabel() {\n\t\t\tconst label = this.isExpanded ? this.collapseLabel : this.expandLabel\n\t\t\treturn typeof label === 'function' ? label(this.node) : label\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraRowAttrs() {\n\t\t\treturn this.rowAttrs ? this.rowAttrs(this.node, this.depth) : {}\n\t\t},\n\n\t\t/**\n\t\t * The host's extra attributes for this row's expand button.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\textraToggleAttrs() {\n\t\t\treturn this.toggleAttrs ? this.toggleAttrs(this.node, this.depth) : {}\n\t\t},\n\t},\n\n\tmethods: {\n\t\ttoggle() {\n\t\t\tthis.$emit('toggle', this.node[this.idKey])\n\t\t},\n\n\t\tonRowClick() {\n\t\t\tthis.$emit('select', this.node)\n\t\t},\n\n\t\t/**\n\t\t * Enter or Space on a focusable row selects its node. Keys pressed on\n\t\t * the expand button or an action inside the row are theirs.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t */\n\t\tonRowKeydown(event) {\n\t\t\tif (!this.focusableRows || event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.key === 'Enter' || event.key === ' ') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.$emit('select', this.node)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-node {\n\tlist-style: none;\n}\n\n.cn-tree-node__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 4px 6px;\n\tborder-radius: var(--border-radius);\n\tcursor: pointer;\n}\n\n.cn-tree-node__row:hover {\n\tbackground: var(--color-background-hover);\n}\n\n/* A row made focusable by `focusableRows` shows where keyboard focus is (WCAG 2.4.7). */\n.cn-tree-node__row[tabindex]:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-tree-node--selected > .cn-tree-node__row {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__toggle {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tpadding: 0;\n\twidth: 18px;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n.cn-tree-node__toggle--leaf {\n\tcursor: default;\n}\n\n.cn-tree-node__caret {\n\tdisplay: inline-block;\n\ttransition: transform 0.15s ease;\n\tfont-size: 0.9em;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__caret--open {\n\ttransform: rotate(90deg);\n\tcolor: var(--color-main-text);\n}\n\n.cn-tree-node__icon {\n\tfont-size: 0.9em;\n}\n\n.cn-tree-node__label {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-tree-node__badge {\n\tfont-size: 0.8em;\n\tpadding: 1px 6px;\n\tborder-radius: 9999px;\n\tbackground: var(--color-background-hover);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-node__children {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_mergeProps","_openBlock","_normalizeClass","_toDisplayString","_renderSlot","_createTextVNode","_Fragment","_renderList","_createBl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,CAAA,CAAA,GAAA,MAAA,KAAE,IAAK,CAAA,KAAA,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA,CAAA;;cACpB,OAAO,EAAAC,OAAA,CACjB,CAAqC,KADb,KAAA;gBACxBL,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCJ,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,cAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;0BAAG,OAAK;AACnC,oBAAA,EAAA,EAAAS,OAAA,CAAA,CADqC,KAAK,KAAA;sBAC1CL,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCJ,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnTreeView.vue2.js';
2
2
  import { render } from './CnTreeView.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-23ded820";
5
+ script.__scopeId = "data-v-790ecd66";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -31,6 +31,14 @@ import __sfc_main from './CnTreeNode.vue.js';
31
31
  * - `#label` — the label of every row, for an icon, a marker or a test id
32
32
  * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row
33
33
  * shows `node[labelKey]`.
34
+ *
35
+ * Per-node hooks, all off by default:
36
+ * - `expandLabel` / `collapseLabel` take a function `(node) => string` for a
37
+ * name per row, e.g. "Expand {name}".
38
+ * - `toggleAttrs` and `rowAttrs` add attributes per node to the expand button
39
+ * and the row (test ids, `data-*`, an active class, a role).
40
+ * - `focusableRows` lets keyboard users reach a row and select it with
41
+ * Enter or Space.
34
42
  */
35
43
  var script = {
36
44
  name: 'CnTreeView',
@@ -80,10 +88,26 @@ var script = {
80
88
  description: { type: String, default: '' },
81
89
  /** Empty-state text when nodes[] is empty. */
82
90
  emptyLabel: { type: String, default: 'No items.' },
83
- /** A11y label for the expand button. */
84
- expandLabel: { type: String, default: 'Expand' },
85
- /** A11y label for the collapse button. */
86
- collapseLabel: { type: String, default: 'Collapse' },
91
+ /** A11y label for the expand button, or `(node) => string` for a name per row. */
92
+ expandLabel: { type: [String, Function], default: 'Expand' },
93
+ /** A11y label for the collapse button, or `(node) => string` for a name per row. */
94
+ collapseLabel: { type: [String, Function], default: 'Collapse' },
95
+ /**
96
+ * Extra attributes for each row's expand button, as `(node, depth) => object`,
97
+ * e.g. a test id per node. Null adds none.
98
+ */
99
+ toggleAttrs: { type: Function, default: null },
100
+ /**
101
+ * Extra attributes for each row, as `(node, depth) => object`: a class,
102
+ * `data-*` attributes, or a `role` and `aria-label`. `class` and `style`
103
+ * merge with the row's own. Null adds none.
104
+ */
105
+ rowAttrs: { type: Function, default: null },
106
+ /**
107
+ * Makes each row reachable with Tab (`tabindex="0"`); Enter or Space on
108
+ * the row selects its node, like a click. Off, rows are click-only.
109
+ */
110
+ focusableRows: { type: Boolean, default: false },
87
111
  /** Expand all nodes on mount. */
88
112
  expandAllOnMount: { type: Boolean, default: false },
89
113
  },
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeView.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * Drag-drop reorder is intentionally a follow-up (issue #278).\n * The widget's public contract (props, events, selection model)\n * is forward-compatible — adding `draggable: true` later won't\n * touch existing v-model bindings.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button. */\n\t\texpandLabel: { type: String, default: 'Expand' },\n\t\t/** A11y label for the collapse button. */\n\t\tcollapseLabel: { type: String, default: 'Collapse' },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id'],\n\tcomputed: {\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["CnTreeNode"],"mappings":";;AAiDA;;;;AAIC;;;;;AAKA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;AAKD,aAAe;AACd,CAAA,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AC,EAAA;IACjB,MAAK;IACN,IAAI,CAAC,IAAI,CAAC,EAAE,EAAA;AACb,IAAA;;;;;AAKA;;AAEC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,EAAA;GACtC;;AAED;;AAEC;;;;AAID,EAAA,UAAU,CAAC,IAAI,EAAE;;AAEhB;;AAEC;;;GAGD,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;AACjD;AACC;AACA;;;GAGD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAA;GACzB;;AAED;AACC;AACA;;;EAGD,SAAS,GAAG;GACX,MAAM,GAAE,GAAI,GAAC;AACb,GAAA,MAAM,IAAG,GAAI,CAAC,CAAC,KAAK;IACnB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;IACtB,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,EAAA;AAC7B,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;AACtB,KAAA,EAAE,CAAC,OAAO,CAAC,IAAI,EAAA;AAChB,KAAA;AACD,KAAA;GACA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAA;;;;;AAK3B;;AAEC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,EAAA;GACrC;;AAED;AACC;AACA;;;EAGD,WAAW,GAAG;;;;;AAKb;;AAEC;;;AAGD,GAAA,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,EAAE,EAAA;GACpC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnTreeView.vue2.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * Drag-drop reorder is intentionally a follow-up (issue #278).\n * The widget's public contract (props, events, selection model)\n * is forward-compatible — adding `draggable: true` later won't\n * touch existing v-model bindings.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n *\n * Per-node hooks, all off by default:\n * - `expandLabel` / `collapseLabel` take a function `(node) => string` for a\n * name per row, e.g. \"Expand {name}\".\n * - `toggleAttrs` and `rowAttrs` add attributes per node to the expand button\n * and the row (test ids, `data-*`, an active class, a role).\n * - `focusableRows` lets keyboard users reach a row and select it with\n * Enter or Space.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button, or `(node) => string` for a name per row. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string` for a name per row. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/**\n\t\t * Extra attributes for each row's expand button, as `(node, depth) => object`,\n\t\t * e.g. a test id per node. Null adds none.\n\t\t */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Extra attributes for each row, as `(node, depth) => object`: a class,\n\t\t * `data-*` attributes, or a `role` and `aria-label`. `class` and `style`\n\t\t * merge with the row's own. Null adds none.\n\t\t */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Makes each row reachable with Tab (`tabindex=\"0\"`); Enter or Space on\n\t\t * the row selects its node, like a click. Off, rows are click-only.\n\t\t */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id'],\n\tcomputed: {\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["CnTreeNode"],"mappings":";;AAoDA;;;;AAIC;;;;;AAKA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;;;;;AAKD,aAAe;AACd,CAAA,IAAI,EAAE,YAAY;CAClB,UAAU,EAAE,cAAEA,UAAS,EAAG;AAC1B,CAAA,KAAK,EAAE;AACN;AACC;AACA;AACA;;AAEA;;;;;AAKA;AACA;;AAED,EAAA,KAAK,EAA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 -56,6 +56,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
56
56
  childrenKey: $props.childrenKey,
57
57
  expandLabel: $props.expandLabel,
58
58
  collapseLabel: $props.collapseLabel,
59
+ toggleAttrs: $props.toggleAttrs,
60
+ rowAttrs: $props.rowAttrs,
61
+ focusableRows: $props.focusableRows,
59
62
  onToggle: $options.toggleNode,
60
63
  onSelect: $options.selectNode
61
64
  }, createSlots({
@@ -73,7 +76,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
73
76
  key: "0"
74
77
  }
75
78
  : undefined
76
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "onToggle", "onSelect"]))
79
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["node", "indent", "expandedIds", "selectedId", "idKey", "labelKey", "childrenKey", "expandLabel", "collapseLabel", "toggleAttrs", "rowAttrs", "focusableRows", "onToggle", "onSelect"]))
77
80
  }), 128 /* KEYED_FRAGMENT */))
78
81
  ]))
79
82
  ]))
@@ -1 +1 @@
1
- {"version":3,"file":"CnTreeView.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue?vue&type=template&id=23ded820&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * Drag-drop reorder is intentionally a follow-up (issue #278).\n * The widget's public contract (props, events, selection model)\n * is forward-compatible — adding `draggable: true` later won't\n * touch existing v-model bindings.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button. */\n\t\texpandLabel: { type: String, default: 'Expand' },\n\t\t/** A11y label for the collapse button. */\n\t\tcollapseLabel: { type: String, default: 'Collapse' },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id'],\n\tcomputed: {\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_Fragment","_renderList","_createBlock","_withCtx","_renderSlot","_mergeProps"],"mappings":";;;AACM,EAAA,KAAK,EAAC,cAAe;AAAA,EAAA,aAAW,EAAC,cAAc;;;;AACf,EAAA,KAAK,EAAC,sB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,EAAE,MAAK,CAAA,KAAA;AACZ,cAAA,QAAQ,EAAE,MAAQ,CAAA,QAAA;AAClB,cAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,cAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,cAAA,aAAa,EAAE,MAAa,CAAA,aAAA;AAC5B,cAAA,QAAM,EAAE,QAAU,CAAA,UAAA;AAClB,cAAA,QAAM,EAAE,QAAU,CAAA,UAAA;;cACR,OAAO,EAAAC,OAAA,CAGjB,CAAqC,KAHb,KAAA;gBAGxBC,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCC,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,cAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;0BAAG,OAAK;AAInC,oBAAA,EAAA,EAAAF,OAAA,CAAA,CAJqC,KAAK,KAAA;sBAI1CC,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCC,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnTreeView.vue3.js","sources":["../../../../src/components/CnTreeView/CnTreeView.vue?vue&type=template&id=790ecd66&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-tree-view\" data-testid=\"cn-tree-view\">\n\t\t<header v-if=\"title || description\" class=\"cn-tree-view__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-tree-view__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-tree-view__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"safeNodes.length === 0\" class=\"cn-tree-view__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\n\t\t<ul v-else class=\"cn-tree-view__root\" role=\"tree\">\n\t\t\t<CnTreeNode v-for=\"node in safeNodes\"\n\t\t\t\t:key=\"node[idKey]\"\n\t\t\t\t:node=\"node\"\n\t\t\t\t:depth=\"0\"\n\t\t\t\t:indent=\"indent\"\n\t\t\t\t:expandedIds=\"expandedMap\"\n\t\t\t\t:selectedId=\"selectedId\"\n\t\t\t\t:idKey=\"idKey\"\n\t\t\t\t:labelKey=\"labelKey\"\n\t\t\t\t:childrenKey=\"childrenKey\"\n\t\t\t\t:expandLabel=\"expandLabel\"\n\t\t\t\t:collapseLabel=\"collapseLabel\"\n\t\t\t\t:toggleAttrs=\"toggleAttrs\"\n\t\t\t\t:rowAttrs=\"rowAttrs\"\n\t\t\t\t:focusableRows=\"focusableRows\"\n\t\t\t\t@toggle=\"toggleNode\"\n\t\t\t\t@select=\"selectNode\">\n\t\t\t\t<template #actions=\"scope\">\n\t\t\t\t\t<!-- @slot actions Per-row actions. Scope:\n\t\t\t\t\t { node, depth }. -->\n\t\t\t\t\t<slot name=\"actions\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t\t<template v-if=\"$slots.label\" #label=\"scope\">\n\t\t\t\t\t<!-- @slot label Replaces the label text of every row. Scope:\n\t\t\t\t\t { node, depth, expanded }. Unused, the row shows\n\t\t\t\t\t `node[labelKey]`. -->\n\t\t\t\t\t<slot name=\"label\" v-bind=\"scope\" />\n\t\t\t\t</template>\n\t\t\t</CnTreeNode>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport CnTreeNode from './CnTreeNode.vue'\n\n/**\n * CnTreeView — Recursive hierarchical tree widget. Renders nested\n * nodes with click-to-expand carets, optional badges + icons,\n * inline per-row actions slot, and select-on-click semantics.\n *\n * Drag-drop reorder is intentionally a follow-up (issue #278).\n * The widget's public contract (props, events, selection model)\n * is forward-compatible — adding `draggable: true` later won't\n * touch existing v-model bindings.\n *\n * ```vue\n * <CnTreeView\n * :nodes=\"[\n * { id: 1, label: 'Knowledge base', children: [\n * { id: 2, label: 'How-tos', children: [\n * { id: 3, label: 'Reset password' },\n * ] },\n * { id: 4, label: 'Reference' },\n * ] },\n * ]\"\n * v-model:expanded-ids=\"expanded\"\n * v-model:selected-id=\"selected\"\n * @select=\"onSelect\" />\n * ```\n *\n * Slots:\n * - `#actions` — inline per-row actions (e.g. edit / delete\n * buttons). Scope: `{ node, depth }`.\n * - `#label` — the label of every row, for an icon, a marker or a test id\n * next to the text. Scope: `{ node, depth, expanded }`. Unused, the row\n * shows `node[labelKey]`.\n *\n * Per-node hooks, all off by default:\n * - `expandLabel` / `collapseLabel` take a function `(node) => string` for a\n * name per row, e.g. \"Expand {name}\".\n * - `toggleAttrs` and `rowAttrs` add attributes per node to the expand button\n * and the row (test ids, `data-*`, an active class, a role).\n * - `focusableRows` lets keyboard users reach a row and select it with\n * Enter or Space.\n */\nexport default {\n\tname: 'CnTreeView',\n\tcomponents: { CnTreeNode },\n\tprops: {\n\t\t/**\n\t\t * Tree nodes (root level). Each node:\n\t\t * `{ id, label, children?, icon?, badge? }`. The keys\n\t\t * `id`, `label`, `children` are configurable via the\n\t\t * `*Key` props.\n\t\t *\n\t\t * Defaults to an empty array and is null-guarded (see `safeNodes`)\n\t\t * so a parent that hasn't loaded its data yet — passing `undefined`\n\t\t * or `null` — renders the empty state instead of throwing on\n\t\t * `nodes.length` during render (ADR-062: never crash a detail page).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tnodes: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Set of currently-expanded node ids. Pass with `.sync`\n\t\t * (or `:expanded-ids` + `@update:expanded-ids`) to control\n\t\t * expansion state from the parent.\n\t\t *\n\t\t * @type {Array<string|number>}\n\t\t */\n\t\texpandedIds: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Currently-selected node id (or null). Node ids are read off\n\t\t * `node[idKey]`, so the same `string | number` domain as `expandedIds`.\n\t\t * Pass with `.sync`.\n\t\t *\n\t\t * @type {string|number|null}\n\t\t */\n\t\tselectedId: { type: [String, Number], default: null },\n\t\t/** Override the `id` key on node objects. */\n\t\tidKey: { type: String, default: 'id' },\n\t\t/** Override the `label` key. */\n\t\tlabelKey: { type: String, default: 'label' },\n\t\t/** Override the `children` key. */\n\t\tchildrenKey: { type: String, default: 'children' },\n\t\t/** Indent per depth (px). */\n\t\tindent: { type: Number, default: 18 },\n\t\t/** Optional title rendered above the tree. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description rendered under the title. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when nodes[] is empty. */\n\t\temptyLabel: { type: String, default: 'No items.' },\n\t\t/** A11y label for the expand button, or `(node) => string` for a name per row. */\n\t\texpandLabel: { type: [String, Function], default: 'Expand' },\n\t\t/** A11y label for the collapse button, or `(node) => string` for a name per row. */\n\t\tcollapseLabel: { type: [String, Function], default: 'Collapse' },\n\t\t/**\n\t\t * Extra attributes for each row's expand button, as `(node, depth) => object`,\n\t\t * e.g. a test id per node. Null adds none.\n\t\t */\n\t\ttoggleAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Extra attributes for each row, as `(node, depth) => object`: a class,\n\t\t * `data-*` attributes, or a `role` and `aria-label`. `class` and `style`\n\t\t * merge with the row's own. Null adds none.\n\t\t */\n\t\trowAttrs: { type: Function, default: null },\n\t\t/**\n\t\t * Makes each row reachable with Tab (`tabindex=\"0\"`); Enter or Space on\n\t\t * the row selects its node, like a click. Off, rows are click-only.\n\t\t */\n\t\tfocusableRows: { type: Boolean, default: false },\n\t\t/** Expand all nodes on mount. */\n\t\texpandAllOnMount: { type: Boolean, default: false },\n\t},\n\n\temits: ['select', 'update:expanded-ids', 'update:selected-id'],\n\tcomputed: {\n\t\t/**\n\t\t * The `nodes` prop coerced to a real array. Guards against a parent\n\t\t * that passes `null` / `undefined` (or a non-array) while its data is\n\t\t * still loading — Vue only applies the prop default for `undefined`,\n\t\t * so an explicit `null` would otherwise reach `nodes.length` and throw\n\t\t * during render.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\tsafeNodes() {\n\t\t\treturn Array.isArray(this.nodes) ? this.nodes : []\n\t\t},\n\n\t\t/**\n\t\t * `expandedIds[]` lifted to an object map for O(1) lookups\n\t\t * inside the recursive node.\n\t\t *\n\t\t * @return {Record<string,true>}\n\t\t */\n\t\texpandedMap() {\n\t\t\tconst out = {}\n\t\t\tfor (const id of this.expandedIds) {\n\t\t\t\tout[id] = true\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.expandAllOnMount) {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Toggle a node's expanded state by id. Emits\n\t\t * `update:expanded-ids` with the new array.\n\t\t *\n\t\t * @param {string|number} id Node id.\n\t\t * @return {void}\n\t\t */\n\t\ttoggleNode(id) {\n\t\t\tconst next = [...this.expandedIds]\n\t\t\tconst idx = next.indexOf(id)\n\t\t\tif (idx >= 0) {\n\t\t\t\tnext.splice(idx, 1)\n\t\t\t} else {\n\t\t\t\tnext.push(id)\n\t\t\t}\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', next)\n\t\t},\n\n\t\t/**\n\t\t * Select a node. Emits `@select` + `update:selected-id`.\n\t\t *\n\t\t * @param {object} node The node.\n\t\t * @return {void}\n\t\t */\n\t\tselectNode(node) {\n\t\t\t// Description above the tag — see the note on `update:expanded-ids`.\n\t\t\t/**\n\t\t\t * `v-model:selected-id` counterpart. Payload is the new id (or null).\n\t\t\t *\n\t\t\t * @event update:selected-id\n\t\t\t */\n\t\t\tthis.$emit('update:selected-id', node[this.idKey])\n\t\t\t/**\n\t\t\t * @event select Emitted on row click. Payload is the\n\t\t\t * selected node object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select', node)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically expand every node in the tree.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\texpandAll() {\n\t\t\tconst ids = []\n\t\t\tconst walk = (n) => {\n\t\t\t\tids.push(n[this.idKey])\n\t\t\t\tconst cs = n[this.childrenKey]\n\t\t\t\tif (Array.isArray(cs)) {\n\t\t\t\t\tcs.forEach(walk)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.safeNodes.forEach(walk)\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', ids)\n\t\t},\n\n\t\t/**\n\t\t * Programmatically collapse every node.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcollapseAll() {\n\t\t\t// Description goes ABOVE `@event`, not inline after it:\n\t\t\t// vue-docgen-api's event-name splitter stops at the first `:`, so\n\t\t\t// `@event update:expanded-ids <description>` is read as one long\n\t\t\t// event NAME and the generated docs show an empty description.\n\t\t\t/**\n\t\t\t * `v-model:expanded-ids` counterpart. Payload is the new full set.\n\t\t\t *\n\t\t\t * @event update:expanded-ids\n\t\t\t */\n\t\t\tthis.$emit('update:expanded-ids', [])\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-tree-view {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-tree-view__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-tree-view__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-tree-view__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n\n.cn-tree-view__root {\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_Fragment","_renderList","_createBlock","_withCtx","_renderSlot","_mergeProps"],"mappings":";;;AACM,EAAA,KAAK,EAAC,cAAe;AAAA,EAAA,aAAW,EAAC,cAAc;;;;AACf,EAAA,KAAK,EAAC,sBAAsB;;;;AAC9C,EAAA,KAAK,EAAC,qBAAqB;;;;AAGtB,EAAA,KAAK,EAAC,2BAA2B;;;;AAKvB,EAAA,KAAK,EAAC,qBAAqB;;;;AAIjD,EAAA,KAAK,EAAC,oBAAmB;AAAE,EAAA,IAAI,EAAC,MAAM;;;;;;AAdlD,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,CA6CK,OA7CL,UA6CK,EAAA;AA5CU,IAAA,CAAA,MAAA,CAAA,KAAI,IAAK,MAAW,CAAA,WAAA;AAAlC,SAAAD,SAAA,EAAA,EAAAC,kBAAA,CAOQ,UAPR,UAOQ,EAAA;WANG,MAAK,CAAA,KAAA;4BAAfA,kBAEI,CAAA,IAAA,EAFJ,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AHb,KAAA;gBAGxBC,UAAqC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAArCC,UAAqC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;AAEnB,cAAA,CAAA,IAAA,CAAA,MAAM,CAAC,KAAK;;0BAAG,OAAK;AAInC,oBAAA,EAAA,EAAAF,OAAA,CAAA,CAJqC,KAAK,KAAA;sBAI1CC,UAAmC,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAnCC,UAAmC,CAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAR,KAAK,CAAA,CAAA;;;;;;;;;;;;;"}
@@ -108,6 +108,18 @@ function conversationsUrl(appId) {
108
108
  return `${chatApiBase(appId)}/conversations`
109
109
  }
110
110
 
111
+ /**
112
+ * Session list endpoint (`GET`). Takes `subject=<objectUuid>` to list only the
113
+ * caller's sessions about one record, most recent activity first.
114
+ *
115
+ * @param {string} [appId] Backend app id.
116
+ * @return {string}
117
+ * @spec openspec/changes/ai-chat-opens-the-subject-session/specs/ai-companion/spec.md#requirement-an-embedded-chat-may-open-the-users-session-about-the-pages-record
118
+ */
119
+ function sessionsUrl(appId) {
120
+ return `${chatApiBase(appId)}/sessions`
121
+ }
122
+
111
123
  /**
112
124
  * Messages of a single conversation (`GET`).
113
125
  *
@@ -215,5 +227,5 @@ function normalizeConversation(raw) {
215
227
  }
216
228
  }
217
229
 
218
- export { DEFAULT_CHAT_APP_ID, agentsUrl, attachmentsUrl, chatApiBase, chatHealthUrl, chatSendUrl, chatStreamUrl, conversationMessagesUrl, conversationUrl, conversationsUrl, normalizeConversation, speechCapabilitiesUrl, speechSynthesisUrl, speechTranscriptionsUrl };
230
+ export { DEFAULT_CHAT_APP_ID, agentsUrl, attachmentsUrl, chatApiBase, chatHealthUrl, chatSendUrl, chatStreamUrl, conversationMessagesUrl, conversationUrl, conversationsUrl, normalizeConversation, sessionsUrl, speechCapabilitiesUrl, speechSynthesisUrl, speechTranscriptionsUrl };
219
231
  //# sourceMappingURL=aiChatConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiChatConfig.js","sources":["../../../src/composables/aiChatConfig.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: AGPL-3.0-or-later\n *\n * aiChatConfig — single configuration point for the AI Chat Companion backend.\n *\n * The `CnAiCompanion` widget talks to a Nextcloud app that owns the chat/agent\n * engine over HTTP (`/index.php/apps/{chatAppId}/api/...`). Historically the\n * backend app id was hardcoded as `openregister` in four call sites across\n * three files (`useAiChatStream.js`, `CnAiCompanion.vue`, `CnAiHistoryDialog.vue`).\n * Per hydra ADR-034 \"Amendment 2026-07-05\" the agent engine is moving out of\n * OpenRegister and into Hermiq, so the backend the widget targets must become a\n * single configurable point rather than four hardcoded strings.\n *\n * This module is that point:\n * - `DEFAULT_CHAT_APP_ID` is the default backend app id.\n * - The `chatXxxUrl(appId)` builders derive every widget HTTP path from an app\n * id, so switching backends is a single value change (a prop, or this default).\n *\n * DEFAULT VALUE — `hermiq`, the agent engine's canonical home (ADR-034 §Amendment\n * 2026-07-05 \"Default flip\" + SPECTR-NEXTCLOUD-PLAN.md §7.4 step 5, executed by\n * the `chat-appid-default-flip` change):\n * Both flip prerequisites have shipped — Hermiq's engine port is merged on\n * hermiq `development` (gated on the `hermiq`.`engine.enabled` app config),\n * and OpenRegister keeps `/api/chat/*` + `/api/agents` answering through a\n * compat window with deprecation headers and an optional proxy-to-hermiq\n * (openregister#305).\n *\n * Deployments still riding the OR compat window can keep the widget on the\n * old backend by passing `:chat-app-id=\"'openregister'\"` to `CnAppRoot`.\n * Note the widget fails closed either way: if the configured backend's\n * `/api/chat/health` probe does not answer 2xx (e.g. Hermiq not installed or\n * no LLM provider configured), the AI icon simply does not render.\n */\n\nimport { prefixUrl } from '../utils/headers.js'\n\n/**\n * Default chat/agent backend app id the AI Chat Companion targets.\n *\n * @type {string}\n */\nexport const DEFAULT_CHAT_APP_ID = 'hermiq'\n\n/**\n * Base API path for a chat backend app.\n *\n * @param {string} [appId] Backend app id. Falls back to {@link DEFAULT_CHAT_APP_ID}\n * when empty/nullish so a mis-wired prop never produces `/apps//api`.\n * @return {string} e.g. `/index.php/apps/hermiq/api` (or `/apps/hermiq/api` with pretty URLs)\n */\nexport function chatApiBase(appId = DEFAULT_CHAT_APP_ID) {\n\treturn prefixUrl(`/apps/${appId || DEFAULT_CHAT_APP_ID}/api`)\n}\n\n/**\n * SSE streaming endpoint (`POST`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatStreamUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/stream`\n}\n\n/**\n * Non-streaming fallback endpoint (`POST`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatSendUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/send`\n}\n\n/**\n * Health probe endpoint (`GET`). The widget renders nothing on non-2xx.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatHealthUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/health`\n}\n\n/**\n * File attachment upload endpoint (`POST`, multipart/form-data, field `file`).\n * Returns `{ path, name }` on success (200); rejects with 400 + `{ error }`\n * for oversized (>20000 bytes) or non-UTF-8-decodable files. The returned\n * `{ path, name }` is what the chat send/stream request body's `attachments`\n * array carries — see `useAiChatStream.js`.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function attachmentsUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/attachments`\n}\n\n/**\n * Conversation list endpoint (`GET`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function conversationsUrl(appId) {\n\treturn `${chatApiBase(appId)}/conversations`\n}\n\n/**\n * Messages of a single conversation (`GET`).\n *\n * @param {string} [appId] Backend app id.\n * @param {string} conversationUuid Conversation UUID to load.\n * @return {string}\n */\nexport function conversationMessagesUrl(appId, conversationUuid) {\n\treturn `${chatApiBase(appId)}/conversations/${conversationUuid}/messages`\n}\n\n/**\n * Single conversation endpoint (`GET`/`PATCH`/`DELETE`) — used by the History\n * UI to rename a conversation and set its description (both backends' Conversation\n * controller accept `title` and `metadata` on PATCH; `metadata.description` is\n * where the free-text description is stored since the conversation schema has\n * no dedicated description column).\n *\n * @param {string} [appId] Backend app id.\n * @param {string} conversationUuid Conversation UUID.\n * @return {string}\n */\nexport function conversationUrl(appId, conversationUuid) {\n\treturn `${chatApiBase(appId)}/conversations/${conversationUuid}`\n}\n\n/**\n * Agent list endpoint (`GET`) — used by the agent picker shown when starting\n * a new conversation.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function agentsUrl(appId) {\n\treturn `${chatApiBase(appId)}/agents`\n}\n\n/**\n * On-instance transcription (`POST`, multipart `audio`).\n *\n * ⚠️ NOT Nextcloud's `core:audio2text` TaskProcessing endpoint, and the\n * difference is not stylistic: that one takes a FILE ID, so a dictated sentence\n * would first have to be written into the user's Files and then polled for.\n * That leaves three-second audio clips in somebody's Documents folder and pays\n * plumbing latency on every utterance. The backend app answers this\n * synchronously with the transcript, and both paths meet at the same speech\n * service underneath.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechTranscriptionsUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/transcriptions`\n}\n\n/**\n * On-instance synthesis (`POST`), returning audio bytes.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechSynthesisUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/speech`\n}\n\n/**\n * Whether on-instance speech can actually be performed (`GET`).\n *\n * 🔴 ASKED, NEVER ASSUMED. A backend can advertise speech it cannot perform —\n * Nextcloud offered `core:audio2text` for months on an instance whose speech\n * service was unreachable, and nobody found out until one was attempted. Here\n * the stakes are higher than a failed transcription: the alternative engine is\n * the browser's, which in Chrome means Google's servers, so believing a wrong\n * answer can send audio off-instance for an agent configured never to do that.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechCapabilitiesUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/capabilities`\n}\n\n/**\n * Normalize a raw conversation object (the shape returned by the\n * `conversationsUrl()` / `conversationUrl()` endpoints) into the flat shape the\n * AI Chat Companion's recent-sessions and history UI consume: a `title`, a\n * `description` read from `metadata.description` (the free-text field the\n * History UI's rename/describe control writes), the raw `metadata` object\n * (preserved so a rename PATCH never drops unrelated metadata keys, e.g. the\n * archive marker), and both timestamp fields.\n *\n * @param {object} raw Raw conversation object from the conversations API.\n * @return {{uuid: string, title: string, description: string, metadata: object, updatedAt: (string|undefined), createdAt: (string|undefined)}}\n */\nexport function normalizeConversation(raw) {\n\tconst source = raw || {}\n\tconst metadata = (source.metadata && typeof source.metadata === 'object') ? source.metadata : {}\n\treturn {\n\t\tuuid: source.uuid || source.id,\n\t\ttitle: source.title || '',\n\t\tdescription: (typeof metadata.description === 'string') ? metadata.description : '',\n\t\tmetadata,\n\t\tupdatedAt: source.updatedAt || source.updated || source.created,\n\t\tcreatedAt: source.createdAt || source.created,\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;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,SAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,KAAK,GAAG,mBAAmB,EAAE;AACzD,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,EAAE,KAAK,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,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MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,OAAO;AAC/C,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"aiChatConfig.js","sources":["../../../src/composables/aiChatConfig.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: AGPL-3.0-or-later\n *\n * aiChatConfig — single configuration point for the AI Chat Companion backend.\n *\n * The `CnAiCompanion` widget talks to a Nextcloud app that owns the chat/agent\n * engine over HTTP (`/index.php/apps/{chatAppId}/api/...`). Historically the\n * backend app id was hardcoded as `openregister` in four call sites across\n * three files (`useAiChatStream.js`, `CnAiCompanion.vue`, `CnAiHistoryDialog.vue`).\n * Per hydra ADR-034 \"Amendment 2026-07-05\" the agent engine is moving out of\n * OpenRegister and into Hermiq, so the backend the widget targets must become a\n * single configurable point rather than four hardcoded strings.\n *\n * This module is that point:\n * - `DEFAULT_CHAT_APP_ID` is the default backend app id.\n * - The `chatXxxUrl(appId)` builders derive every widget HTTP path from an app\n * id, so switching backends is a single value change (a prop, or this default).\n *\n * DEFAULT VALUE — `hermiq`, the agent engine's canonical home (ADR-034 §Amendment\n * 2026-07-05 \"Default flip\" + SPECTR-NEXTCLOUD-PLAN.md §7.4 step 5, executed by\n * the `chat-appid-default-flip` change):\n * Both flip prerequisites have shipped — Hermiq's engine port is merged on\n * hermiq `development` (gated on the `hermiq`.`engine.enabled` app config),\n * and OpenRegister keeps `/api/chat/*` + `/api/agents` answering through a\n * compat window with deprecation headers and an optional proxy-to-hermiq\n * (openregister#305).\n *\n * Deployments still riding the OR compat window can keep the widget on the\n * old backend by passing `:chat-app-id=\"'openregister'\"` to `CnAppRoot`.\n * Note the widget fails closed either way: if the configured backend's\n * `/api/chat/health` probe does not answer 2xx (e.g. Hermiq not installed or\n * no LLM provider configured), the AI icon simply does not render.\n */\n\nimport { prefixUrl } from '../utils/headers.js'\n\n/**\n * Default chat/agent backend app id the AI Chat Companion targets.\n *\n * @type {string}\n */\nexport const DEFAULT_CHAT_APP_ID = 'hermiq'\n\n/**\n * Base API path for a chat backend app.\n *\n * @param {string} [appId] Backend app id. Falls back to {@link DEFAULT_CHAT_APP_ID}\n * when empty/nullish so a mis-wired prop never produces `/apps//api`.\n * @return {string} e.g. `/index.php/apps/hermiq/api` (or `/apps/hermiq/api` with pretty URLs)\n */\nexport function chatApiBase(appId = DEFAULT_CHAT_APP_ID) {\n\treturn prefixUrl(`/apps/${appId || DEFAULT_CHAT_APP_ID}/api`)\n}\n\n/**\n * SSE streaming endpoint (`POST`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatStreamUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/stream`\n}\n\n/**\n * Non-streaming fallback endpoint (`POST`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatSendUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/send`\n}\n\n/**\n * Health probe endpoint (`GET`). The widget renders nothing on non-2xx.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function chatHealthUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/health`\n}\n\n/**\n * File attachment upload endpoint (`POST`, multipart/form-data, field `file`).\n * Returns `{ path, name }` on success (200); rejects with 400 + `{ error }`\n * for oversized (>20000 bytes) or non-UTF-8-decodable files. The returned\n * `{ path, name }` is what the chat send/stream request body's `attachments`\n * array carries — see `useAiChatStream.js`.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function attachmentsUrl(appId) {\n\treturn `${chatApiBase(appId)}/chat/attachments`\n}\n\n/**\n * Conversation list endpoint (`GET`).\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function conversationsUrl(appId) {\n\treturn `${chatApiBase(appId)}/conversations`\n}\n\n/**\n * Session list endpoint (`GET`). Takes `subject=<objectUuid>` to list only the\n * caller's sessions about one record, most recent activity first.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n * @spec openspec/changes/ai-chat-opens-the-subject-session/specs/ai-companion/spec.md#requirement-an-embedded-chat-may-open-the-users-session-about-the-pages-record\n */\nexport function sessionsUrl(appId) {\n\treturn `${chatApiBase(appId)}/sessions`\n}\n\n/**\n * Messages of a single conversation (`GET`).\n *\n * @param {string} [appId] Backend app id.\n * @param {string} conversationUuid Conversation UUID to load.\n * @return {string}\n */\nexport function conversationMessagesUrl(appId, conversationUuid) {\n\treturn `${chatApiBase(appId)}/conversations/${conversationUuid}/messages`\n}\n\n/**\n * Single conversation endpoint (`GET`/`PATCH`/`DELETE`) — used by the History\n * UI to rename a conversation and set its description (both backends' Conversation\n * controller accept `title` and `metadata` on PATCH; `metadata.description` is\n * where the free-text description is stored since the conversation schema has\n * no dedicated description column).\n *\n * @param {string} [appId] Backend app id.\n * @param {string} conversationUuid Conversation UUID.\n * @return {string}\n */\nexport function conversationUrl(appId, conversationUuid) {\n\treturn `${chatApiBase(appId)}/conversations/${conversationUuid}`\n}\n\n/**\n * Agent list endpoint (`GET`) — used by the agent picker shown when starting\n * a new conversation.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function agentsUrl(appId) {\n\treturn `${chatApiBase(appId)}/agents`\n}\n\n/**\n * On-instance transcription (`POST`, multipart `audio`).\n *\n * ⚠️ NOT Nextcloud's `core:audio2text` TaskProcessing endpoint, and the\n * difference is not stylistic: that one takes a FILE ID, so a dictated sentence\n * would first have to be written into the user's Files and then polled for.\n * That leaves three-second audio clips in somebody's Documents folder and pays\n * plumbing latency on every utterance. The backend app answers this\n * synchronously with the transcript, and both paths meet at the same speech\n * service underneath.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechTranscriptionsUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/transcriptions`\n}\n\n/**\n * On-instance synthesis (`POST`), returning audio bytes.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechSynthesisUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/speech`\n}\n\n/**\n * Whether on-instance speech can actually be performed (`GET`).\n *\n * 🔴 ASKED, NEVER ASSUMED. A backend can advertise speech it cannot perform —\n * Nextcloud offered `core:audio2text` for months on an instance whose speech\n * service was unreachable, and nobody found out until one was attempted. Here\n * the stakes are higher than a failed transcription: the alternative engine is\n * the browser's, which in Chrome means Google's servers, so believing a wrong\n * answer can send audio off-instance for an agent configured never to do that.\n *\n * @param {string} [appId] Backend app id.\n * @return {string}\n */\nexport function speechCapabilitiesUrl(appId) {\n\treturn `${chatApiBase(appId)}/speech/capabilities`\n}\n\n/**\n * Normalize a raw conversation object (the shape returned by the\n * `conversationsUrl()` / `conversationUrl()` endpoints) into the flat shape the\n * AI Chat Companion's recent-sessions and history UI consume: a `title`, a\n * `description` read from `metadata.description` (the free-text field the\n * History UI's rename/describe control writes), the raw `metadata` object\n * (preserved so a rename PATCH never drops unrelated metadata keys, e.g. the\n * archive marker), and both timestamp fields.\n *\n * @param {object} raw Raw conversation object from the conversations API.\n * @return {{uuid: string, title: string, description: string, metadata: object, updatedAt: (string|undefined), createdAt: (string|undefined)}}\n */\nexport function normalizeConversation(raw) {\n\tconst source = raw || {}\n\tconst metadata = (source.metadata && typeof source.metadata === 'object') ? source.metadata : {}\n\treturn {\n\t\tuuid: source.uuid || source.id,\n\t\ttitle: source.title || '',\n\t\tdescription: (typeof metadata.description === 'string') ? metadata.description : '',\n\t\tmetadata,\n\t\tupdatedAt: source.updatedAt || source.updated || source.created,\n\t\tcreatedAt: source.createdAt || source.created,\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;AAEA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,mBAAmB,GAAG,SAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO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