@evotecit/canopyx 0.3.16 → 0.3.20

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 (150) hide show
  1. package/CanopyX.Html/Assets/canopyx-board.css +50 -0
  2. package/CanopyX.Html/Assets/canopyx-board.js +39 -0
  3. package/CanopyX.Html/Assets/canopyx-buckets.js +15 -0
  4. package/CanopyX.Html/Assets/canopyx-calculations.css +7 -0
  5. package/CanopyX.Html/Assets/canopyx-calculations.js +52 -0
  6. package/CanopyX.Html/Assets/canopyx-calendar-edit.js +3 -3
  7. package/CanopyX.Html/Assets/canopyx-calendar.css +74 -80
  8. package/CanopyX.Html/Assets/canopyx-calendar.js +26 -31
  9. package/CanopyX.Html/Assets/canopyx-cell-range.css +4 -4
  10. package/CanopyX.Html/Assets/canopyx-cell-range.js +16 -14
  11. package/CanopyX.Html/Assets/canopyx-changes.css +61 -79
  12. package/CanopyX.Html/Assets/canopyx-changes.js +18 -15
  13. package/CanopyX.Html/Assets/canopyx-column-groups.css +5 -1
  14. package/CanopyX.Html/Assets/canopyx-column-groups.js +15 -9
  15. package/CanopyX.Html/Assets/canopyx-compare.css +37 -0
  16. package/CanopyX.Html/Assets/canopyx-compare.js +12 -0
  17. package/CanopyX.Html/Assets/canopyx-data.js +3 -3
  18. package/CanopyX.Html/Assets/canopyx-detail-rows.css +4 -4
  19. package/CanopyX.Html/Assets/canopyx-detail-rows.js +1 -1
  20. package/CanopyX.Html/Assets/canopyx-editing.css +5 -5
  21. package/CanopyX.Html/Assets/canopyx-editing.js +2 -2
  22. package/CanopyX.Html/Assets/canopyx-enhance.js +5 -5
  23. package/CanopyX.Html/Assets/canopyx-export.js +54 -13
  24. package/CanopyX.Html/Assets/canopyx-facets.css +32 -22
  25. package/CanopyX.Html/Assets/canopyx-facets.js +19 -15
  26. package/CanopyX.Html/Assets/canopyx-filter-editor.css +75 -89
  27. package/CanopyX.Html/Assets/canopyx-filter-editor.js +20 -16
  28. package/CanopyX.Html/Assets/canopyx-flow-checks.css +3 -3
  29. package/CanopyX.Html/Assets/canopyx-flow-checks.js +1 -1
  30. package/CanopyX.Html/Assets/canopyx-flow-command.css +3 -3
  31. package/CanopyX.Html/Assets/canopyx-flow-command.js +1 -1
  32. package/CanopyX.Html/Assets/canopyx-flow-dialog.css +4 -4
  33. package/CanopyX.Html/Assets/canopyx-flow-dialog.js +1 -1
  34. package/CanopyX.Html/Assets/canopyx-flow-drafts.css +2 -2
  35. package/CanopyX.Html/Assets/canopyx-flow-drafts.js +1 -1
  36. package/CanopyX.Html/Assets/canopyx-flow-entry.css +142 -17
  37. package/CanopyX.Html/Assets/canopyx-flow-entry.js +5 -5
  38. package/CanopyX.Html/Assets/canopyx-flow-host.css +2 -2
  39. package/CanopyX.Html/Assets/canopyx-flow-host.js +1 -1
  40. package/CanopyX.Html/Assets/canopyx-flow-module.mjs +5 -5
  41. package/CanopyX.Html/Assets/canopyx-flow-pick.css +4 -4
  42. package/CanopyX.Html/Assets/canopyx-flow-pick.js +1 -1
  43. package/CanopyX.Html/Assets/canopyx-flow-preview.css +1 -1
  44. package/CanopyX.Html/Assets/canopyx-flow-preview.js +1 -1
  45. package/CanopyX.Html/Assets/canopyx-flow-records.css +2 -2
  46. package/CanopyX.Html/Assets/canopyx-flow-records.js +1 -1
  47. package/CanopyX.Html/Assets/canopyx-flow-tasks.css +4 -4
  48. package/CanopyX.Html/Assets/canopyx-flow-tasks.js +1 -1
  49. package/CanopyX.Html/Assets/canopyx-flow.css +41 -41
  50. package/CanopyX.Html/Assets/canopyx-flow.js +1 -1
  51. package/CanopyX.Html/Assets/canopyx-format-editor.css +9 -9
  52. package/CanopyX.Html/Assets/canopyx-format-editor.js +2 -2
  53. package/CanopyX.Html/Assets/canopyx-formatting.css +13 -13
  54. package/CanopyX.Html/Assets/canopyx-formatting.js +12 -11
  55. package/CanopyX.Html/Assets/canopyx-forms.css +3 -3
  56. package/CanopyX.Html/Assets/canopyx-forms.js +1 -1
  57. package/CanopyX.Html/Assets/canopyx-grid-module.mjs +220 -155
  58. package/CanopyX.Html/Assets/canopyx-grid-options.css +8 -8
  59. package/CanopyX.Html/Assets/canopyx-grid-options.js +9 -2
  60. package/CanopyX.Html/Assets/canopyx-grid.css +285 -150
  61. package/CanopyX.Html/Assets/canopyx-grid.js +220 -155
  62. package/CanopyX.Html/Assets/canopyx-grouping.css +23 -16
  63. package/CanopyX.Html/Assets/canopyx-grouping.js +24 -17
  64. package/CanopyX.Html/Assets/canopyx-highlight.css +10 -10
  65. package/CanopyX.Html/Assets/canopyx-highlight.js +1 -1
  66. package/CanopyX.Html/Assets/canopyx-interactive.css +215 -91
  67. package/CanopyX.Html/Assets/canopyx-interactive.js +47 -52
  68. package/CanopyX.Html/Assets/canopyx-labels-de.js +177 -9
  69. package/CanopyX.Html/Assets/canopyx-labels-es.js +177 -9
  70. package/CanopyX.Html/Assets/canopyx-labels-fr.js +176 -8
  71. package/CanopyX.Html/Assets/canopyx-labels-it.js +176 -8
  72. package/CanopyX.Html/Assets/canopyx-labels-pl.js +176 -8
  73. package/CanopyX.Html/Assets/canopyx-layouts.css +49 -21
  74. package/CanopyX.Html/Assets/canopyx-layouts.js +36 -14
  75. package/CanopyX.Html/Assets/canopyx-link.css +3 -3
  76. package/CanopyX.Html/Assets/canopyx-link.js +4 -4
  77. package/CanopyX.Html/Assets/canopyx-links.js +2 -2
  78. package/CanopyX.Html/Assets/canopyx-live.css +3 -5
  79. package/CanopyX.Html/Assets/canopyx-live.js +3 -3
  80. package/CanopyX.Html/Assets/canopyx-matrix.css +32 -39
  81. package/CanopyX.Html/Assets/canopyx-matrix.js +11 -11
  82. package/CanopyX.Html/Assets/canopyx-module.mjs +47 -52
  83. package/CanopyX.Html/Assets/canopyx-office-export.js +2936 -0
  84. package/CanopyX.Html/Assets/canopyx-pager.css +1 -1
  85. package/CanopyX.Html/Assets/canopyx-pager.js +1 -1
  86. package/CanopyX.Html/Assets/canopyx-path.css +45 -0
  87. package/CanopyX.Html/Assets/canopyx-path.js +28 -0
  88. package/CanopyX.Html/Assets/canopyx-pivot.css +75 -0
  89. package/CanopyX.Html/Assets/canopyx-pivot.js +72 -0
  90. package/CanopyX.Html/Assets/canopyx-plan.css +63 -0
  91. package/CanopyX.Html/Assets/canopyx-plan.js +71 -0
  92. package/CanopyX.Html/Assets/canopyx-presenters.js +2 -2
  93. package/CanopyX.Html/Assets/canopyx-record-panel.css +51 -45
  94. package/CanopyX.Html/Assets/canopyx-record-panel.js +30 -22
  95. package/CanopyX.Html/Assets/canopyx-reporting-module.mjs +262 -197
  96. package/CanopyX.Html/Assets/canopyx-reporting.css +300 -164
  97. package/CanopyX.Html/Assets/canopyx-reporting.js +262 -197
  98. package/CanopyX.Html/Assets/canopyx-stack.css +35 -0
  99. package/CanopyX.Html/Assets/canopyx-stack.js +24 -0
  100. package/CanopyX.Html/Assets/canopyx-time-slider.css +18 -0
  101. package/CanopyX.Html/Assets/canopyx-time-slider.js +27 -0
  102. package/CanopyX.Html/Assets/canopyx-timeline.css +19 -19
  103. package/CanopyX.Html/Assets/canopyx-timeline.js +6 -5
  104. package/CanopyX.Html/Assets/canopyx-tree-tools.css +47 -46
  105. package/CanopyX.Html/Assets/canopyx-tree-tools.js +15 -12
  106. package/CanopyX.Html/Assets/canopyx-ui-menu.css +41 -0
  107. package/CanopyX.Html/Assets/canopyx-ui-menu.js +64 -0
  108. package/CanopyX.Html/Assets/canopyx-ui-navigation.css +73 -0
  109. package/CanopyX.Html/Assets/canopyx-ui-navigation.js +39 -0
  110. package/CanopyX.Html/Assets/canopyx-ui-overlays.css +79 -0
  111. package/CanopyX.Html/Assets/canopyx-ui-overlays.js +45 -0
  112. package/CanopyX.Html/Assets/canopyx-ui-picker.css +12 -0
  113. package/CanopyX.Html/Assets/canopyx-ui-picker.js +6 -0
  114. package/CanopyX.Html/Assets/canopyx-ui-stepper.css +174 -0
  115. package/CanopyX.Html/Assets/canopyx-ui-stepper.js +48 -0
  116. package/CanopyX.Html/Assets/canopyx-ui-tabs.css +153 -0
  117. package/CanopyX.Html/Assets/canopyx-ui-tabs.js +47 -0
  118. package/CanopyX.Html/Assets/canopyx-values.css +5 -0
  119. package/CanopyX.Html/Assets/canopyx-values.js +13 -0
  120. package/CanopyX.Html/Assets/canopyx-view-intents.css +12 -0
  121. package/CanopyX.Html/Assets/canopyx-view-intents.js +56 -0
  122. package/CanopyX.Html/Assets/canopyx.css +212 -85
  123. package/CanopyX.Html/Assets/canopyx.js +38 -26
  124. package/JavaScript/board.d.ts +30 -0
  125. package/JavaScript/changes.d.ts +4 -1
  126. package/JavaScript/column-groups.d.ts +24 -4
  127. package/JavaScript/facets.d.ts +5 -3
  128. package/JavaScript/grid.d.ts +161 -17
  129. package/JavaScript/hosts.d.ts +16 -1
  130. package/JavaScript/index.d.ts +4 -2
  131. package/JavaScript/locales/de.mjs +177 -9
  132. package/JavaScript/locales/es.mjs +177 -9
  133. package/JavaScript/locales/fr.mjs +176 -8
  134. package/JavaScript/locales/it.mjs +176 -8
  135. package/JavaScript/locales/pl.mjs +176 -8
  136. package/JavaScript/matrix.d.ts +4 -1
  137. package/JavaScript/path.d.ts +33 -0
  138. package/JavaScript/pivot.d.ts +135 -0
  139. package/JavaScript/plan.d.ts +23 -0
  140. package/JavaScript/protocol.d.ts +18 -3
  141. package/JavaScript/records.d.ts +4 -0
  142. package/JavaScript/stack.d.ts +28 -0
  143. package/JavaScript/time-slider.d.ts +58 -0
  144. package/JavaScript/ui.d.ts +261 -0
  145. package/JavaScript/view-intents.d.ts +45 -0
  146. package/README.md +76 -187
  147. package/README.nuget.md +63 -87
  148. package/ThirdParty/OfficeIMO/LICENSE +21 -0
  149. package/ThirdParty/OfficeIMO/README.md +13 -0
  150. package/package.json +76 -3
@@ -1,7 +1,7 @@
1
- (function(global){"use strict";const installed=new WeakSet();const part={version:"4337e3756b443220",install(context){if(installed.has(context.GRID_PRESENTER_IMPL))return;const{GRID_PRESENTER_IMPL,h,setText,fill,cellValue,cellText,isCellObject,columnNumericTone,columnValueTone,gridPresenterTone,gridPresenterLink,numberFormat,toneColors,toneOf,applyTone,gridIcon,badgeElement,GRID_HISTORY_KINDS,GRID_HISTORY_IMPL,RECORD_IMPL}=context;function gridRenderPresenter(grid,column,options,record,complete){return(row,element)=>{const cell=row.cells[column.id],raw=cellValue(cell),text=cellText(cell,column,grid.fmt),object=isCellObject(cell);const rule=columnNumericTone(column,raw),declaredTone=columnValueTone(column,cell),tone=declaredTone||gridPresenterTone(options,raw,object?cell.tone:null);element.classList.add("cx-presented-cell");if(rule||object&&cell.title)element.title=rule?.label||cell.title;if(declaredTone)applyTone(element,element.className,toneOf(declaredTone));if(rule)element.setAttribute("aria-description",rule.label);const add=(value,cls="cx-presenter-text",tag="span")=>{const item=h(tag,cls),textItem=/^(cx-presenter-text|p-mono|p-link|cx-wrapped-text|p-muted)\b/.test(cls);setText(item,value);
1
+ (function(global){"use strict";const installed=new WeakSet();const part={version:"d5f9d61bb730974b",install(context){if(installed.has(context.GRID_PRESENTER_IMPL))return;const{GRID_PRESENTER_IMPL,h,setText,fill,cellValue,cellText,changeCellText,isCellObject,columnNumericTone,columnValueTone,gridPresenterTone,gridPresenterLink,numberFormat,toneColors,toneOf,applyTone,gridIcon,badgeElement,GRID_HISTORY_KINDS,GRID_HISTORY_IMPL,RECORD_IMPL}=context;function gridRenderPresenter(grid,column,options,record,complete){return(row,element)=>{const cell=row.cells[column.id],raw=cellValue(cell),text=cellText(cell,column,grid.fmt),object=isCellObject(cell);const rule=columnNumericTone(column,raw),declaredTone=columnValueTone(column,cell),tone=declaredTone||gridPresenterTone(options,raw,object?cell.tone:null);element.classList.add("cx-presented-cell");if(rule||object&&cell.title)element.title=rule?.label||cell.title;if(declaredTone)applyTone(element,element.className,toneOf(declaredTone));if(rule)element.setAttribute("aria-description",rule.label);const add=(value,cls="cx-presenter-text",tag="span")=>{const item=h(tag,cls),textItem=/^(cx-presenter-text|p-mono|p-link|cx-wrapped-text|p-muted)\b/.test(cls);setText(item,value);
2
2
  if(declaredTone&&textItem)item.style.color="inherit";if(column.wrap&&textItem){item.classList.add("cx-wrapped-text");item.style.maxWidth="100%";item.style.flex="none";item.title=rule?.label||String(value);if(complete){item.style.webkitLineClamp="unset";item.style.maxHeight="none"}
3
3
  else{const lines=record?column.maxLines??2:grid.layoutMode==="cards"?Math.min(column.maxLines??2,2):grid.autoRows?column.maxLines??2:1;item.style.webkitLineClamp=String(lines);item.style.maxHeight=lines*1.4+"em"}}
4
- element.appendChild(item);return item};const more=(value,label=grid.labels.gridShowMore)=>{const button=add(label,"cx-link cx-presenter-expand","button");button.type="button";button.setAttribute("aria-haspopup","dialog");button.setAttribute("aria-label",fill(grid.labels.gridExpandCell,{column:column.title}));button.addEventListener("click",()=>grid.showReportingText(column,value,button,row.id,options.mono));return button};if(GRID_HISTORY_KINDS.includes(options.kind)){if(GRID_HISTORY_IMPL.render)GRID_HISTORY_IMPL.render(grid,column,options,cell,element,text);else grid.loadHistory()}else if(options.kind==="structured"){if(RECORD_IMPL.summary)RECORD_IMPL.summary(grid,column,options,row,element,text);else{add(text);grid.loadRecordPanel()}}else if(raw==null&&object&&cell.text==="")add("");else if(raw==null&&(!object||cell.text===undefined)||text==="")add("—","p-missing");else if(options.kind==="link"){const href=gridPresenterLink(cellValue(options.hrefColumn?row.cells[options.hrefColumn]:cell));const link=add(text,"p-link",href?"a":"span");if(href){link.href=href;if(options.newWindow){link.target="_blank";link.rel="noopener noreferrer"}}}else if(options.kind==="icon"){add(options.glyph,"cx-presenter-icon").setAttribute("aria-hidden","true");add(text)}
4
+ element.appendChild(item);return item};const more=(value,label=grid.labels.gridShowMore)=>{const button=add(label,"cx-link cx-presenter-expand","button");button.type="button";button.setAttribute("aria-haspopup","dialog");button.setAttribute("aria-label",fill(grid.labels.gridExpandCell,{column:column.title}));button.addEventListener("click",()=>grid.showReportingText(column,value,button,row.id,options.mono));return button};if(GRID_HISTORY_KINDS.includes(options.kind)){if(GRID_HISTORY_IMPL.render)GRID_HISTORY_IMPL.render(grid,column,options,cell,element,text);else grid.loadHistory()}else if(options.kind==="structured"){if(RECORD_IMPL.summary)RECORD_IMPL.summary(grid,column,options,row,element,text);else{add(text);grid.loadRecordPanel()}}else if(options.kind==="change"&&options.beforeAfter&&object&&cell.changes?.length){const change=cell.changes[0],wrap=h("span","cx-before-after"),before=h("del"),arrow=h("span"),after=h("ins");const kind={...column,kind:change.kind||column.kind};setText(before,changeCellText(change.before,kind,grid.fmt));setText(arrow,"→");arrow.setAttribute("aria-hidden","true");setText(after,changeCellText(change.after,kind,grid.fmt));if(grid.view.compare&&cellValue(row.cells[grid.view.compare.statusColumn])==="removed")wrap.append(before);else wrap.append(before,arrow,after);element.append(wrap)}else if(raw==null&&object&&cell.text==="")add("");else if(raw==null&&(!object||cell.text===undefined)||text==="")add("—","p-missing");else if(options.kind==="link"){const href=gridPresenterLink(cellValue(options.hrefColumn?row.cells[options.hrefColumn]:cell));const link=add(text,"p-link",href?"a":"span");if(href){link.href=href;if(options.newWindow){link.target="_blank";link.rel="noopener noreferrer"}}}else if(options.kind==="icon"){add(options.glyph,"cx-presenter-icon").setAttribute("aria-hidden","true");add(text)}
5
5
  else if(options.kind==="boolean"&&typeof raw==="boolean"){const value=add(raw?"":"—",raw?"p-bool-yes"+(options.inverted?" cx-bool-bad":""):"p-bool-no");value.setAttribute("role","img");value.setAttribute("aria-label",raw?grid.labels.yes:grid.labels.no);if(raw)value.appendChild(gridIcon("check"))}else if(options.kind==="state"||options.kind==="enum"){if(options.quietTones?.includes(tone))add(text,(options.quietStyle==="plain"?"cx-presenter-text":"p-muted")+(options.kind==="enum"?" p-inset":""));else if(options.kind==="state"){const state=add("","p-state"+(tone==="success"?" quiet":""));const dot=h("span","p-dot "+(tone==="success"?"quiet":tone));toneColors(dot,toneOf(tone));state.append(dot,document.createTextNode(text))}else{const pill=add(text,"p-pill "+tone);applyTone(pill,pill.className,toneOf(tone))}}else if(options.kind==="change"){const delta=cellValue(row.cells[options.deltaColumn]);if(typeof delta==="number")add((delta===0?"":delta>0?"↑ ":"↓ ")+numberFormat(grid.lang).format(Math.abs(delta)),"p-delta "+(delta===0?"flat":(delta>0)===!!options.higherIsGood?"good":"bad"));add(text)}else if(options.kind==="progress"&&typeof raw==="number"){const box=add("","p-progress"),track=h("span","track"),bar=h("span","fill "+tone),maximum=options.maximum||100;track.setAttribute("role","progressbar");track.setAttribute("aria-label",column.title);track.setAttribute("aria-valuemin","0");track.setAttribute("aria-valuemax",String(maximum));track.setAttribute("aria-valuenow",String(Math.min(maximum,Math.max(0,raw))));track.setAttribute("aria-valuetext",text);bar.style.width=Math.min(100,Math.max(0,raw/maximum*100))+"%";toneColors(bar,toneOf(tone));track.appendChild(bar);box.append(track,document.createTextNode(text));
6
6
  }else if(options.kind==="identifier"){add(text,options.mono?"p-mono":"cx-presenter-text");const secondary=options.secondaryColumn?cellText(row.cells[options.secondaryColumn],grid.columns.find(item=>item.id===options.secondaryColumn),grid.fmt):object&&cell.secondary;if(secondary)add(secondary,"p-sub")}else if(options.kind==="tags"||options.kind==="list"){const values=text.split(options.separator).map(item=>item.trim()).filter(Boolean),limit=options.kind==="tags"?3:options.limit||3;const preview=add("","cx-tag-list");element.classList.add("cx-list-cell");for(const value of values.slice(0,limit)){const tag=h("span","p-tag");setText(tag,value);preview.appendChild(tag)}
7
7
  if(values.length>limit||options.kind==="list")more(text,values.length>limit?"+"+(values.length-limit):grid.labels.gridShowMore)}else if(options.kind==="longText"){if(column.wrap){add(text,"cx-wrapped-text"+(options.mono?" p-mono":""))}else{const budget=Math.max(256,Math.ceil((column.renderWidth||column.width)/7*5));
@@ -6,87 +6,88 @@ body .cx-host.cx-drawer.cx-record-drawer{max-width:var(--cx-size-640px);}
6
6
  .cx-record-btn .cx-ico{width:var(--cx-size-16px);height:var(--cx-size-16px);flex:none;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
7
7
  .cx-drawer .cx-record-link{min-height:0;padding:0;border:0;color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));text-decoration:underline;text-underline-offset:var(--cx-size-2px);overflow-wrap:anywhere;}
8
8
  .cx-drawer .cx-record-link:hover{background:transparent;text-decoration-thickness:var(--cx-size-2px);}
9
- .cx-record-trail{display:flex;align-items:center;gap:var(--cx-size-8px);min-width:0;margin:0 0 var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
9
+ .cx-record-trail{display:flex;align-items:center;gap:var(--cx-size-8px);min-width:0;margin:0 0 var(--cx-size-4px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
10
10
  .cx-drawer .cx-record-back{min-height:0;padding:0 var(--cx-size-4px) 0 0;color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));font-weight:600;}
11
11
  .cx-record-crumbs{display:flex;align-items:center;gap:var(--cx-size-4px);min-width:0;margin:0;padding:0;list-style:none;overflow:hidden;}
12
12
  .cx-record-crumbs li{display:flex;align-items:center;gap:var(--cx-size-4px);min-width:0;}
13
13
  .cx-record-crumbs li::before{content:"›";}
14
- .cx-drawer .cx-record-crumb{display:block;max-width:var(--cx-size-160px);min-height:0;padding:0 var(--cx-size-2px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
15
- .cx-record-summary{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-8px) var(--cx-size-20px);padding:var(--cx-size-10px) var(--cx-size-16px);border-bottom:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
14
+ .cx-drawer .cx-record-crumb{display:block;max-width:var(--cx-size-160px);min-height:0;padding:0 var(--cx-size-2px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
15
+ .cx-record-summary{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-8px) var(--cx-size-20px);padding:var(--cx-size-10px) var(--cx-size-16px);border-bottom:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));}
16
16
  .cx-record-status{display:flex;align-items:center;gap:var(--cx-size-6px);}
17
17
  .cx-record-facts{display:flex;flex-wrap:wrap;gap:var(--cx-size-6px) var(--cx-size-20px);margin:0;}
18
18
  .cx-record-fact{min-width:0;}
19
- .cx-record-fact dt{font-size:var(--cx-size-11d5px);letter-spacing:var(--cx-size-d04em);text-transform:uppercase;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
19
+ .cx-record-fact dt{font-size:var(--cx-size-11d5px);letter-spacing:var(--cx-size-d04em);text-transform:uppercase;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
20
20
  .cx-record-fact dd{margin:0;font-weight:600;overflow-wrap:anywhere;}
21
21
  .cx-drawer .cx-drawer-h > .cx-record-menu{position:relative;flex:none;}
22
22
  .cx-drawer .cx-record-menu-btn{justify-content:center;width:var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px));height:var(--hfx-control-height-md,calc(36px - var(--cx-compact,0) * 8px));padding:0;}
23
- .cx-record-menu-list{position:absolute;right:0;top:calc(100% + var(--cx-size-4px));z-index:5;display:flex;flex-direction:column;min-width:var(--cx-size-180px);padding:var(--cx-size-4px);background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-overlay,var(--hfx-radius-lg,10px));box-shadow:var(--hfx-elevation-2,0 1px 2px rgba(22,24,28,.05),0 6px 18px -10px rgba(22,24,28,.18));}
23
+ .cx-record-menu-list{position:absolute;right:0;top:calc(100% + var(--cx-size-4px));z-index:5;display:flex;flex-direction:column;min-width:var(--cx-size-180px);padding:var(--cx-size-4px);background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-overlay,var(--hfx-radius-lg,10px));box-shadow:var(--hfx-elevation-2,0 1px 2px rgba(22,24,28,.05),0 6px 18px -10px rgba(22,24,28,.18));}
24
24
  .cx-record-menu-item{justify-content:flex-start;min-height:var(--cx-size-32px);white-space:nowrap;}
25
- .cx-record-tools{position:sticky;top:0;z-index:3;background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));border-bottom:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
25
+ .cx-record-tools{position:sticky;top:0;z-index:3;background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border-bottom:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
26
26
  .cx-record-tabs{display:flex;gap:var(--cx-size-2px);padding:0 var(--cx-size-10px);overflow-x:auto;scrollbar-width:thin;}
27
- .cx-record-tab{flex:none;padding:var(--cx-size-10px) var(--cx-size-10px) var(--cx-size-8px);border:0;border-bottom:var(--cx-size-2px) solid transparent;background:transparent;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font:inherit;font-weight:600;white-space:nowrap;cursor:pointer;}
28
- .cx-record-tab:hover{color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));}
29
- .cx-record-tab[aria-selected="true"]{color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));border-bottom-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
27
+ .cx-record-tab{flex:none;padding:var(--cx-size-10px) var(--cx-size-10px) var(--cx-size-8px);border:0;border-bottom:var(--cx-size-2px) solid transparent;background:transparent;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font:inherit;font-weight:600;white-space:nowrap;cursor:pointer;}
28
+ .cx-record-tab:hover{color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));}
29
+ .cx-record-tab[aria-selected="true"]{color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));border-bottom-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
30
30
  .cx-record-subtools{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-4px) var(--cx-size-12px);padding:var(--cx-size-6px) var(--cx-size-12px);}
31
- .cx-record-tabs + .cx-record-subtools{border-top:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
31
+ .cx-record-tabs + .cx-record-subtools{border-top:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
32
32
  .cx-record-jump{display:flex;flex-wrap:wrap;gap:var(--cx-size-4px);flex:1;min-width:0;}
33
- .cx-drawer .cx-record-jump-link{min-height:var(--cx-size-24px);padding:0 var(--cx-size-10px);border-color:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));font-size:var(--cx-size-13px);color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
34
- .cx-drawer .cx-record-empty{margin-inline-start:auto;min-height:var(--cx-size-24px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
35
- .cx-record-section{border-bottom:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
33
+ .cx-drawer .cx-record-jump-link{min-height:var(--cx-size-24px);padding:0 var(--cx-size-10px);border-color:var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));font-size:var(--cx-size-13px);color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
34
+ .cx-drawer .cx-record-empty{margin-inline-start:auto;min-height:var(--cx-size-24px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
35
+ .cx-record-section{border-bottom:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
36
36
  .cx-record-section:last-child{border-bottom:0;}
37
- .cx-record-section .cx-record-section{border-bottom:0;margin:0 var(--cx-size-16px) var(--cx-size-4px);border-inline-start:var(--cx-size-2px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
37
+ .cx-record-section .cx-record-section{border-bottom:0;margin:0 var(--cx-size-16px) var(--cx-size-4px);border-inline-start:var(--cx-size-2px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
38
38
  .cx-record-section-h{margin:0;font:inherit;}
39
- .cx-drawer .cx-record-toggle{width:100%;padding:var(--cx-size-10px) var(--cx-size-16px) var(--cx-size-4px);border-radius:var(--hfx-radius-none,0);font-size:var(--cx-size-11d5px);font-weight:700;letter-spacing:var(--cx-size-d06em);text-transform:uppercase;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
40
- .cx-record-toggle .cx-ico{width:var(--cx-size-14px);height:var(--cx-size-14px);transform:rotate(90deg);transition:transform .12s;}
39
+ .cx-drawer .cx-record-toggle{width:100%;padding:calc(var(--hfx-space-1,0.25rem)*2.5) 0 var(--hfx-space-1,0.25rem);border:0;border-radius:var(--hfx-radius-none,0);font-size:var(--hfx-type-small-size,0.8125rem);font-weight:var(--hfx-weight-semibold,600);letter-spacing:0;text-transform:none;color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));}
40
+ .cx-record-toggle > .cx-record-btn-label{flex:1;min-width:0;text-align:start;order:0;}
41
+ .cx-record-toggle .cx-ico{width:var(--cx-size-14px);height:var(--cx-size-14px);order:1;margin-inline-start:auto;transform:rotate(90deg);transition:transform .12s;}
41
42
  .cx-record-toggle[aria-expanded="false"] .cx-ico{transform:none;}
42
- .cx-drawer .cx-record-section .cx-record-section .cx-record-toggle{padding:var(--cx-size-6px) var(--cx-size-10px) var(--cx-size-2px);font-size:var(--cx-size-13px);letter-spacing:0;text-transform:none;color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));}
43
+ .cx-drawer .cx-record-section .cx-record-section .cx-record-toggle{padding:var(--cx-size-6px) var(--cx-size-10px) var(--cx-size-2px);font-size:var(--cx-size-13px);letter-spacing:0;text-transform:none;color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));}
43
44
  .cx-record-section .cx-record-section .cx-dl{padding:var(--cx-size-4px) var(--cx-size-10px) var(--cx-size-6px);}
44
45
  .cx-record-section-b{padding-bottom:var(--cx-size-6px);}
45
46
  .cx-record-section-b > .cx-dl{padding-top:var(--cx-size-6px);padding-bottom:var(--cx-size-6px);}
46
- .cx-record-object{grid-template-columns:minmax(var(--cx-size-92px),max-content) 1fr;gap:var(--cx-size-2px) var(--cx-size-12px);padding:var(--cx-size-2px) 0 var(--cx-size-2px) var(--cx-size-10px);border-inline-start:var(--cx-size-2px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
47
+ .cx-record-object{grid-template-columns:minmax(var(--cx-size-92px),max-content) 1fr;gap:var(--cx-size-2px) var(--cx-size-12px);padding:var(--cx-size-2px) 0 var(--cx-size-2px) var(--cx-size-10px);border-inline-start:var(--cx-size-2px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
47
48
  .cx-drawer .cx-record-object dd{margin-bottom:0;}
48
49
  .cx-record-section-b,.cx-record-object-value{container-type:inline-size;min-width:0;}
49
50
  @container (max-width:400px){
50
51
  .cx-record-object,.cx-record-section-b > .cx-dl{grid-template-columns:minmax(0,1fr);gap:var(--cx-size-2px) 0;}
51
52
  }
52
53
  .cx-record-block{padding:var(--cx-size-6px) var(--cx-size-16px) var(--cx-size-10px);}
53
- .cx-record-block-h{margin-bottom:var(--cx-size-6px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
54
+ .cx-record-block-h{margin-bottom:var(--cx-size-6px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
54
55
  .cx-record-custom{padding:var(--cx-size-6px) var(--cx-size-16px);}
55
56
  .cx-record-custom:empty{display:none;}
56
57
  .cx-record-chips{display:flex;flex-wrap:wrap;gap:var(--cx-size-4px);}
57
58
  .cx-drawer .cx-record-chip{display:inline-flex;align-items:center;max-width:100%;min-height:var(--cx-size-22px);padding:0 var(--cx-size-8px);border:var(--cx-size-1px) solid var(--hfx-color-border-strong,light-dark(#cdd0d5,#363a42));border-radius:var(--hfx-radius-status,999px);font-size:var(--cx-size-13px);overflow-wrap:anywhere;text-decoration:none;}
58
- .cx-drawer .cx-record-chip:is(.cx-tone-info,.cx-tone-success,.cx-tone-warning,.cx-tone-danger,.cx-toned){background:color-mix(in srgb,currentColor 9%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));border-color:color-mix(in srgb,currentColor 38%,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
59
+ .cx-drawer .cx-record-chip:is(.cx-tone-info,.cx-tone-success,.cx-tone-warning,.cx-tone-danger,.cx-toned){background:color-mix(in srgb,currentColor 9%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));border-color:color-mix(in srgb,currentColor 38%,var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c))));}
59
60
  .cx-drawer .cx-record-chip.cx-record-link{color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
60
- .cx-drawer .cx-diff-removed{text-decoration:line-through;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
61
+ .cx-drawer .cx-diff-removed{text-decoration:line-through;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
61
62
  .cx-drawer .cx-diff-added{font-weight:600;border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
62
- .cx-record-more-count{margin-inline-start:var(--cx-size-4px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-size:var(--cx-size-12d5px);}
63
- .cx-drawer :is(.cx-record-more,.cx-record-load-more,.cx-record-retry){margin-top:var(--cx-size-6px);border-color:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
63
+ .cx-record-more-count{margin-inline-start:var(--cx-size-4px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-size:var(--cx-size-12d5px);}
64
+ .cx-drawer :is(.cx-record-more,.cx-record-load-more,.cx-record-retry){margin-top:var(--cx-size-6px);border-color:var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));}
64
65
  :is(.cx-record-diff,.cx-record-table){width:100%;border-collapse:collapse;font-size:var(--cx-size-13px);}
65
- :is(.cx-record-diff,.cx-record-table) :is(th,td){padding:var(--cx-size-4px) var(--cx-size-8px);border-bottom:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));text-align:start;vertical-align:top;overflow-wrap:anywhere;}
66
- :is(.cx-record-diff,.cx-record-table) thead th{font-size:var(--cx-size-12px);font-weight:600;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
66
+ :is(.cx-record-diff,.cx-record-table) :is(th,td){padding:var(--cx-size-4px) var(--cx-size-8px);border-bottom:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));text-align:start;vertical-align:top;overflow-wrap:anywhere;}
67
+ :is(.cx-record-diff,.cx-record-table) thead th{font-size:var(--cx-size-12px);font-weight:600;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
67
68
  .cx-record-diff tbody th{width:30%;font-weight:600;}
68
- .cx-record-diff .cx-diff-before{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
69
+ .cx-record-diff .cx-diff-before{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
69
70
  .cx-record-diff-compact{margin-top:var(--cx-size-6px);}
70
71
  .cx-record-diff-compact thead{display:none;}
71
- .cx-record-collection-h{display:flex;align-items:center;gap:var(--cx-size-8px);margin-bottom:var(--cx-size-6px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
72
+ .cx-record-collection-h{display:flex;align-items:center;gap:var(--cx-size-8px);margin-bottom:var(--cx-size-6px);font-size:var(--cx-size-13px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
72
73
  .cx-drawer .cx-record-open-all{margin-inline-start:auto;color:var(--hfx-color-accent-text,light-dark(#02726a,#37c9b8));font-weight:600;}
73
- .cx-record-nested{height:var(--cx-size-360px);border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
74
+ .cx-record-nested{height:var(--cx-size-360px);border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
74
75
  .cx-record-nested.cx-host{padding:0;}
75
- .cx-record-card{margin-bottom:var(--cx-size-8px);padding:var(--cx-size-8px) var(--cx-size-12px);border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));}
76
+ .cx-record-card{margin-bottom:var(--cx-size-8px);padding:var(--cx-size-8px) var(--cx-size-12px);border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));border-radius:var(--hfx-radius-control,var(--hfx-radius-md,6px));}
76
77
  .cx-record-card-title{font-weight:600;}
77
78
  .cx-drawer .cx-record-card .cx-dl{grid-template-columns:1fr;gap:0;padding:var(--cx-size-4px) 0 0;}
78
- .cx-record-card dt{font-size:var(--cx-size-12px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
79
+ .cx-record-card dt{font-size:var(--cx-size-12px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
79
80
  .cx-drawer .cx-record-card dd{margin-bottom:var(--cx-size-4px);}
80
81
  .cx-timeline{position:relative;margin:0;padding:0;list-style:none;}
81
- .cx-timeline-day{padding:var(--cx-size-8px) 0 var(--cx-size-2px);font-size:var(--cx-size-11d5px);font-weight:700;letter-spacing:var(--cx-size-d04em);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
82
+ .cx-timeline-day{padding:var(--cx-size-8px) 0 var(--cx-size-2px);font-size:var(--cx-size-11d5px);font-weight:700;letter-spacing:var(--cx-size-d04em);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
82
83
  .cx-timeline-item{position:relative;display:grid;grid-template-columns:var(--cx-size-16px) 1fr;gap:var(--cx-size-8px);padding:var(--cx-size-4px) 0 var(--cx-size-8px);}
83
- .cx-timeline-item::before{content:"";position:absolute;left:calc(var(--cx-size-8px) - var(--cx-size-1px));top:var(--cx-size-20px);bottom:0;width:var(--cx-size-2px);background:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));}
84
+ .cx-timeline-item::before{content:"";position:absolute;left:calc(var(--cx-size-8px) - var(--cx-size-1px));top:var(--cx-size-20px);bottom:0;width:var(--cx-size-2px);background:var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));}
84
85
  .cx-timeline-item:last-child::before{display:none;}
85
- .cx-timeline-dot{width:var(--cx-size-10px);height:var(--cx-size-10px);margin:var(--cx-size-5px) auto 0;border-radius:50%;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));background:currentColor;}
86
+ .cx-timeline-dot{width:var(--cx-size-10px);height:var(--cx-size-10px);margin:var(--cx-size-5px) auto 0;border-radius:50%;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));background:currentColor;}
86
87
  .cx-timeline-dot:is(.cx-tone-info,.cx-tone-success,.cx-tone-warning,.cx-tone-danger,.cx-toned){color:var(--cx-t,inherit);}
87
- .cx-timeline-meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-6px);font-size:var(--cx-size-12d5px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
88
+ .cx-timeline-meta{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-6px);font-size:var(--cx-size-12d5px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
88
89
  .cx-timeline-summary{margin-top:var(--cx-size-2px);overflow-wrap:anywhere;}
89
- .cx-record-note{margin:var(--cx-size-8px) var(--cx-size-16px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-style:italic;}
90
+ .cx-record-note{margin:var(--cx-size-8px) var(--cx-size-16px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-style:italic;}
90
91
  .cx-record-error{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cx-size-8px);color:var(--hfx-color-status-bad-fg,light-dark(#b8292a,#f47171));font-style:normal;}
91
92
  .cx-drawer.cx-phone :is(.cx-record-btn,.cx-record-tab){min-height:var(--cx-size-44px);}
92
93
  .cx-drawer.cx-phone .cx-record-menu-btn{width:var(--cx-size-44px);height:var(--cx-size-44px);}
@@ -94,26 +95,31 @@ body .cx-host.cx-drawer.cx-record-drawer{max-width:var(--cx-size-640px);}
94
95
  .cx-drawer.cx-phone :is(.cx-record-link,.cx-record-crumb){min-height:var(--cx-size-24px);}
95
96
  .cx-drawer.cx-phone .cx-record-nested{height:var(--cx-size-280px);}
96
97
  .cx-drawer.cx-phone .cx-record-section .cx-record-section{margin-inline:var(--cx-size-10px);}
98
+ .cx-drawer.cx-phone .cx-record-subtools{flex-direction:column;align-items:stretch;}
99
+ .cx-drawer.cx-phone .cx-record-jump{flex:none;flex-wrap:nowrap;width:100%;box-sizing:border-box;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:thin;padding-block:var(--hfx-space-0-5,2px);padding-inline-end:var(--hfx-space-4,1rem);mask-image:linear-gradient(to right,var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5))) calc(100% - var(--hfx-space-4,1rem)),transparent);}
100
+ .cx-drawer.cx-phone .cx-record-jump:dir(rtl){mask-image:linear-gradient(to left,var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5))) calc(100% - var(--hfx-space-4,1rem)),transparent);}
101
+ .cx-drawer.cx-phone .cx-record-jump-link{flex:none;white-space:nowrap;scroll-snap-align:start;}
102
+ .cx-drawer.cx-phone .cx-record-empty{align-self:flex-start;margin-inline-start:0;}
97
103
  .cx-record-print{display:none;}
98
104
  @media print{
99
105
  html.cx-record-printing body > :not(.cx-record-print){display:none !important;}
100
- html.cx-record-printing .cx-record-print{display:block;padding:0;font:var(--cx-size-12px)/1.4 var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);color:var(--hfx-color-text,light-dark(#16181c,#f2f3f5));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
106
+ html.cx-record-printing .cx-record-print{display:block;padding:0;font:var(--cx-size-12px)/1.4 var(--hfx-font-sans,"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,"Helvetica Neue",Arial,sans-serif);color:var(--hfx-color-text-primary,var(--hfx-color-text,light-dark(#16181c,#f2f3f5)));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
101
107
  .cx-record-print h1{margin:0 0 var(--cx-size-4px);font-size:var(--cx-size-20px);}
102
108
  .cx-record-print h2{margin:var(--cx-size-16px) 0 var(--cx-size-4px);font-size:var(--cx-size-16px);}
103
109
  .cx-record-print .cx-record-section{break-inside:avoid;border:0;}
104
- .cx-record-print .cx-record-section-h{margin:var(--cx-size-10px) 0 var(--cx-size-2px);font-size:var(--cx-size-11d5px);font-weight:700;text-transform:uppercase;color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
110
+ .cx-record-print .cx-record-section-h{margin:var(--cx-size-10px) 0 var(--cx-size-2px);font-size:var(--cx-size-11d5px);font-weight:700;text-transform:uppercase;color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
105
111
  .cx-record-print .cx-dl{display:grid;grid-template-columns:var(--cx-size-180px) 1fr;gap:var(--cx-size-2px) var(--cx-size-12px);margin:0;padding:0;}
106
112
  .cx-record-print dd{margin:0;}
107
- .cx-record-print .p-sub{margin-inline-start:var(--cx-size-6px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
108
- .cx-record-print .cx-record-summary{border:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
113
+ .cx-record-print .p-sub{margin-inline-start:var(--cx-size-6px);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
114
+ .cx-record-print .cx-record-summary{border:var(--cx-size-1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
109
115
  }
110
116
  @media (prefers-reduced-motion:reduce){.cx-record-toggle .cx-ico{transition:none;}}
111
117
  @media (forced-colors:active){.cx-record-tab[aria-selected="true"]{border-bottom-color:Highlight;}.cx-timeline-dot{forced-color-adjust:none;background:CanvasText;}}
112
- .cx-record-footer{flex:none;display:flex;justify-content:flex-end;gap:var(--cx-size-8px);padding:var(--cx-size-12px) var(--cx-size-16px);border-top:var(--cx-size-1px) solid var(--hfx-color-border,light-dark(#e2e4e7,#272a30));background:var(--hfx-color-surface,light-dark(#ffffff,#16181c));}
118
+ .cx-record-footer{flex:none;display:flex;justify-content:flex-end;gap:var(--hfx-space-2,0.5rem);padding:var(--hfx-space-3,0.75rem) var(--hfx-space-4,1rem);border-top:var(--hfx-border-width,1px) solid var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));background:var(--hfx-color-surface-card,var(--hfx-color-surface,light-dark(#ffffff,#16181c)));}
113
119
  .cx-record-footer .cx-record-primary{color:var(--hfx-color-accent-contrast,light-dark(#ffffff,#0c0d10));background:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));border-color:var(--hfx-color-accent,light-dark(#11776f,#37c9b8));}
114
- .cx-record-footer .cx-record-primary:disabled{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));border-color:var(--hfx-color-border,light-dark(#e2e4e7,#272a30));cursor:wait;}
115
- .cx-record-subtitle{margin:var(--cx-size-4px) 0 0;font-size:var(--cx-size-13px);color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));}
116
- .cx-record-drawer .cx-dl dt{color:var(--hfx-color-text-muted,light-dark(#626770,#8f949d));font-size:var(--cx-size-12px);font-weight:normal;}
117
- .cx-record-drawer .cx-dl dd{font-size:var(--cx-size-14px);}
120
+ .cx-record-footer .cx-record-primary:disabled{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));background:var(--hfx-color-surface-sunken,light-dark(#f7f8f9,#111317));border-color:var(--hfx-color-surface-line,var(--hfx-color-border,light-dark(#e2e4e7,#272a30)));cursor:wait;}
121
+ .cx-record-subtitle{margin:var(--hfx-space-1,0.25rem) 0 0;font-size:var(--hfx-type-small-size,0.8125rem);color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));}
122
+ .cx-record-drawer .cx-dl dt{color:var(--hfx-color-text-secondary,var(--hfx-color-text-muted,light-dark(#626770,#8f949d)));font-size:var(--hfx-type-caption-size,0.75rem);font-weight:normal;}
123
+ .cx-record-drawer .cx-dl dd{font-size:var(--hfx-type-body-size,0.875rem);}
118
124
  .cx-drawer.cx-record-drawer .cx-drawer-h h4{width:auto;max-width:100%;overflow-wrap:anywhere;}
119
- .cx-drawer.cx-record-drawer .cx-drawer-h > :not(:first-child){flex:none;}
125
+ .cx-drawer.cx-record-drawer .cx-drawer-h > :not(:first-child){flex:none;margin-inline:0;}
@@ -1,4 +1,5 @@
1
- (function(global){"use strict";const installed=new WeakSet();const part={version:"82aa828bc880087b",install(context){if(installed.has(context.RECORD_IMPL))return;const{RECORD_IMPL,TreeGrid,h,setText,fill,cellText,cellValue,isCellObject,formatValue,toneOf,applyTone,toneColors,validateGridRows,badgeElement,loadSidecar,requireIdentifier,PROTOCOL,foldText,createTreeGrid,svgIcon,gridExportField,columnNumericTone,columnValueTone,validateColumnValues}=context;const RECORD_KINDS=["items","fields","records","events","changes"],RECORD_LINK_KEY=/^[A-Za-z][\w.-]{0,31}$/, RECORD_MAX_STRUCTURE_DEPTH = 8;
1
+ (function(global){"use strict";const installed=new WeakSet();const part={version:"cb6bcd1baf644a51",requires:["ui-menu"],install(context){if(installed.has(context.RECORD_IMPL))return;const{RECORD_IMPL,UI_IMPL,TreeGrid,h,setText,fill,cellText,cellValue,isCellObject,formatValue,toneOf,applyTone,toneColors,validateGridRows,badgeElement,loadSidecar,requireIdentifier,PROTOCOL,foldText,createTreeGrid,svgIcon,gridExportField,columnNumericTone,columnValueTone,validateColumnValues}=context;function changeCellText(cell,column,fmt){if(cell==null)return "—";const structured=isCellObject(cell)&&["items","fields","records","events","changes"].some(name=>cell[name]);if(isCellObject(cell)&&cellValue(cell)==null&&!cell.text&&!structured)return "null";const text=cellText(cell,column,fmt);return text.length?text:'""'}
2
+ const RECORD_KINDS=["items","fields","records","events","changes"],RECORD_LINK_KEY=/^[A-Za-z][\w.-]{0,31}$/, RECORD_MAX_STRUCTURE_DEPTH = 8;
2
3
  const recordKind=cell=>{const kinds=isCellObject(cell)&&!Array.isArray(cell)?RECORD_KINDS.filter(name=>cell[name]!==undefined):[];if(kinds.length>1)recordFail("a cell carries at most one structured value.");return kinds[0]||null};const recordFail=message=>{throw new Error("CanopyX: "+message)};const recordText=(value,max=256)=>typeof value==="string"&&!!value.trim()&&value.length<=max;const recordGridHelpers=()=>RECORD_IMPL.grid||{};function recordCheckValue(cell,depth=0){if(cell==null)return;if(depth>RECORD_MAX_STRUCTURE_DEPTH)recordFail("structured values nest at most "+RECORD_MAX_STRUCTURE_DEPTH+" levels.");const kind=recordKind(cell);if(kind==="items")for(const item of cell.items||[])recordCheckValue(item,depth+1);if(kind==="fields")for(const field of cell.fields||[])recordCheckValue(field.value,depth+1);if(kind==="changes")for(const change of cell.changes||[]){recordCheckValue(change.before,depth+1);recordCheckValue(change.after,depth+1)}
3
4
  if(kind==="events")for(const event of cell.events||[])for(const change of event.changes||[]){recordCheckValue(change.before,depth+1);recordCheckValue(change.after,depth+1)}
4
5
  if(kind==="records")recordCheckRows(cell.records.rows||cell.records.roots,depth+1)}
@@ -36,7 +37,8 @@ return pack.then(records=>recordPayload(view,id,records.get(id)||null,revision))
36
37
  const request={protocol:PROTOCOL,type:"gridRecordQuery",view:view.view.id,id,...(revision!=null?{revision}:{}),...extra};const run=signal=>Promise.resolve(loader(request,{signal}));return(view.runGridHook?view.runGridHook(run,signal||view.dataLifetime?.signal):run(signal||view.lifetime.signal)).then(doc=>recordPayload(view,id,doc,revision))}
37
38
  function recordEnsure(view,id){const cache=view._recordPayloads||=new Map(),key=recordCacheKey(view,id);let entry=cache.get(key);if(entry)return entry;if(!recordLoader(view))return null;entry={state:"loading"};cache.set(key,entry);if(cache.size>64)cache.delete(cache.keys().next().value);entry.promise=recordFetch(view,id,{}).then(payload=>{entry.state="ready";entry.payload=payload;return payload},error=>{entry.state="error";entry.error=error;if(error.name!=="AbortError")view.emit("error",{error});throw error});entry.promise.catch(()=>{});return entry}
38
39
  const RECORD_ICONS={back:'<path d="m14 7-5 5 5 5"/>',print:'<path d="M7 9V4h10v5M7 17H5v-6h14v6h-2M8 14h8v6H8z"/>',link:'<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>',more:'<circle cx="5" cy="12" r="1.2"/><circle cx="12" cy="12" r="1.2"/><circle cx="19" cy="12" r="1.2"/>',open:'<path d="M14 5h5v5M19 5l-8 8M17 14v5H5V7h5"/>',chevron:'<path d="m9 6 6 6-6 6"/>'};function recordIcon(name){return svgIcon(RECORD_ICONS[name])}
39
- function recordButton(text,run,className,icon){const button=h("button","cx-record-btn" +(className?" "+className:""));button.type="button";if(icon)button.appendChild(recordIcon(icon));if(text)button.appendChild(document.createTextNode(text));button.addEventListener("click",event=>{event.stopPropagation();run(event)});return button}
40
+ function recordButton(text,run,className,icon){const button=h("button","cx-record-btn" +(className?" "+className:""));button.type="button";if(icon)button.appendChild(recordIcon(icon));if(text){const label=h("span","cx-record-btn-label");setText(label,text);button.appendChild(label)}
41
+ button.addEventListener("click",event=>{event.stopPropagation();run(event)});return button}
40
42
  const recordCount=(ctx,count)=>formatValue(count,"number",ctx.fmt);const recordRefValid=ref=>!!ref&&typeof ref==="object"&&typeof ref.id==="string"&&!!ref.id&&(ref.view===undefined||typeof ref.view==="string"&&!!ref.view);function recordPlain(ctx,field,cell,element){const text=cellText(cell,field.column||field,ctx.fmt),object=isCellObject(cell),blank=object&&cellValue(cell)==null&&cell.text==="",span=h("span");const column=field.column||field,rule=columnNumericTone(column,cellValue(cell));applyTone(span,"cx-drawer-text" +(text||blank?"":" p-missing"),toneOf(columnValueTone(column,cell)||(object?cell.tone:null)));setText(span,text||blank?text:"—");if(object&&cell.title)span.title=cell.title;element.appendChild(span);if(rule){span.title=rule.label;const label=h("span","p-sub");setText(label,rule.label);element.appendChild(label)}
41
43
  if(object)for(const badge of cell.badges||[])element.appendChild(badgeElement(badge))}
42
44
  function recordLink(ctx,cell,field,element,className){const text=cellText(cell,field,ctx.fmt)||cell.ref.id;if(ctx.print||!recordRefValid(cell.ref)){recordPlain(ctx,field,cell,element);return null}
@@ -93,11 +95,13 @@ function recordTokens(ctx,field,items,other,cell,mark,word){const keys=new Set(o
93
95
  box.appendChild(chip)}
94
96
  cell.appendChild(box)}
95
97
  function recordChanges(ctx,field,changes,element,compact){const table=h("table","cx-record-diff" +(compact?" cx-record-diff-compact":"")),caption=h("caption","cx-sr-only"),head=h("tr"),body=h("tbody"),labels=ctx.labels;setText(caption,fill(labels.recordChanged,{count:recordCount(ctx,changes.length)}));for(const text of[labels.recordField,labels.recordBefore,labels.recordAfter]){const cell=h("th");cell.scope="col";setText(cell,text);head.appendChild(cell)}
96
- for(const change of changes){if(!change||!recordText(change.name,4096))recordFail("a change names its field.");const line=h("tr"),name=h("th"),before=h("td","cx-diff-before"),after=h("td","cx-diff-after"),spec={id:field.id,title:change.name,kind:change.kind||"text",nested:true};name.scope="row";setText(name,change.name);if(recordKind(change.before)==="items"&&recordKind(change.after)==="items"){recordTokens(ctx,spec,change.before.items,change.after.items,before,"cx-diff-removed",labels.recordRemoved);recordTokens(ctx,spec,change.after.items,change.before.items,after,"cx-diff-added",labels.recordAdded)}else{recordValue(ctx,spec,change.before??null,before,1);recordValue(ctx,spec,change.after??null,after,1)}
98
+ for(const change of changes){if(!change||!recordText(change.name,4096))recordFail("a change names its field.");const line=h("tr"),name=h("th"),before=h("td","cx-diff-before"),after=h("td","cx-diff-after"),spec={id:field.id,title:change.name,kind:change.kind||"text",nested:true};name.scope="row";setText(name,change.name);if(recordKind(change.before)==="items"&&recordKind(change.after)==="items"){recordTokens(ctx,spec,change.before.items,change.after.items,before,"cx-diff-removed",labels.recordRemoved);recordTokens(ctx,spec,change.after.items,change.before.items,after,"cx-diff-added",labels.recordAdded)}else{const paint=(value,element)=>recordValue(ctx,spec,recordKind(value)?value:
99
+ {...(isCellObject(value)?value:{value}),text:changeCellText(value,spec,ctx.fmt)},element,1);paint(change.before,before);paint(change.after,after)}
97
100
  line.append(name,before,after);body.appendChild(line)}
98
101
  const thead=h("thead");thead.appendChild(head);table.append(caption,thead,body);element.appendChild(table)}
99
102
  let RECORD_SHOW_EMPTY=false;const recordId=(dialog,kind,id)=>dialog.id+"-"+kind+"-"+String(id).replace(/[^\w-]/g, "_");
100
- const recordOnDispose=(signal,cleanup)=>{const dispose=()=>{try{cleanup()}catch(error){console.error(error)}};if(signal.aborted)dispose();else signal.addEventListener("abort",dispose,{once:true})};function recordContext(view,record,dialog,context,payload){const ctx={view,record,payload,dialog,labels:view.labels,fmt:view.fmt,signal:context.signal,index:context.index,origins:0,pending:[],phone:view.host.clientWidth<=640,print:!!context.print,width:context.print?520:view.host.clientWidth<=640?300:380,row:{id:record.id,cells:recordMerge(record.cells,payload?.cells,record.fields,payload?.fields)},node:view.kind==="tree"?{...record,cells:recordMerge(record.cells,payload?.cells)}:null};ctx.navigate=(ref,origin)=>recordNavigate(ctx,ref,origin);ctx.repaint=()=>{if(!context.signal.aborted&&dialog._cxRecord===record&&dialog.isConnected)recordRepaint(view,dialog,record,context.index)};return ctx}
103
+ const recordOnDispose=(signal,cleanup)=>{const dispose=()=>{try{cleanup()}catch(error){console.error(error)}};if(signal.aborted)dispose();else signal.addEventListener("abort",dispose,{once:true})};const recordJump=(body,tools,section,instant)=>{const top=section.getBoundingClientRect().top-body.getBoundingClientRect().top+body.scrollTop -(tools.isConnected?tools.offsetHeight:0);const reduce=global.matchMedia?.("(prefers-reduced-motion: reduce)").matches;body.scrollTo({top:Math.max(0,Math.round(top)),behavior:reduce||instant?"instant":"smooth"})};const recordTrail=(sections,id)=>{for(const section of sections){if(section.id===id)return[id];const inner=recordTrail(section.sections,id);if(inner)return[section.id,...inner]}
104
+ return null};function recordContext(view,record,dialog,context,payload){const ctx={view,record,payload,dialog,labels:view.labels,fmt:view.fmt,signal:context.signal,index:context.index,origins:0,pending:[],phone:view.host.clientWidth<=640,print:!!context.print,width:context.print?520:view.host.clientWidth<=640?300:380,row:{id:record.id,cells:recordMerge(record.cells,payload?.cells,record.fields,payload?.fields)},node:view.kind==="tree"?{...record,cells:recordMerge(record.cells,payload?.cells)}:null};ctx.navigate=(ref,origin)=>recordNavigate(ctx,ref,origin);ctx.repaint=()=>{if(!context.signal.aborted&&dialog._cxRecord===record&&dialog.isConnected)recordRepaint(view,dialog,record,context.index)};return ctx}
101
105
  function recordMerge(...sources){const cells=Object.create(null);for(const source of sources)if(source)for(const key of Object.keys(source))if(key!=="__proto__")cells[key]=source[key];return cells}
102
106
  function recordRepaint(view,dialog,record,index){const body=dialog.querySelector(".cx-drawer-body"),scroll=body?.scrollTop||0,active=document.activeElement,inside=body?.contains(active);const section=inside&&active.closest("[data-cx-section]")?.getAttribute("data-cx-section"),field=inside&&active.closest("[data-cx-field]")?.getAttribute("data-cx-field");const kind=inside&&[...active.classList].find(name=>name.startsWith("cx-record-")),id=inside&&active.id;dialog._cxPaint(record,index);if(body)body.scrollTop=scroll;if(!inside||body.contains(document.activeElement))return;const scope=field?body.querySelector('[data-cx-field="'+CSS.escape(field)+ '"]'):section?body.querySelector('[data-cx-section="'+CSS.escape(section)+ '"]'):body;const title=dialog.querySelector(".cx-drawer-h h4"),target=id&&body.querySelector("#"+CSS.escape(id))||kind&&scope?.querySelector("."+kind)||title;if(target===title)view.focusRing(title);else target?.focus({preventScroll:true})}
103
107
  const recordVisible=(ctx,field,cell,showEmpty)=>showEmpty||!recordEmpty(cell,field,ctx.fmt)||ctx.view.recordKeepField?.(field.id,ctx.record)===true;function recordHasContent(ctx,section,showEmpty){return!!section.renderer||section.fields.some(field=>recordVisible(ctx,field,recordCell(ctx.view,ctx.record,ctx.payload,field),showEmpty))||
@@ -119,12 +123,14 @@ RECORD_IMPL.paint=(view,record,body,dialog,context)=>{const state=dialog._cxPane
119
123
  state.index=context.index;let layout;try{layout=recordLayout(view,recordFields(view))}
120
124
  catch(error){view.emit("error",{error});return view.paintDrawerBody.call(Object.create(view,{recordNeeded:{value:()=>false}}),record,body,dialog,context)}
121
125
  const entry=recordEnsure(view,record.id),payload=entry?.state==="ready"?entry.payload:null,ctx=recordContext(view,record,dialog,context,payload);if(view.loadHistory&&!view._recordHistory&&(view.view.record?.fields||[]).some(field=>["statusStrip","sparklineBars","sparklineLine"].includes(field.presenter?.kind)))
122
- view._recordHistory=Promise.resolve(view.loadHistory()).then(()=>{if(dialog.isConnected&&dialog._cxRecord)recordRepaint(view,dialog,dialog._cxRecord,dialog._cxPanel?.index)},()=>{});const showEmpty=RECORD_SHOW_EMPTY||!layout.hideEmpty;const tabs=layout.tabs.filter(tab=>tab.sections.some(section=>recordHasContent(ctx,section,showEmpty)));if(!tabs.length)tabs.push(layout.tabs[0]);if(!tabs.some(tab=>tab.id===state.tab))state.tab=tabs[0].id;recordSummary(ctx,layout,dialog);body.replaceChildren();const tools=h("div","cx-record-tools"),panel=h("div","cx-record-panel"),sub=h("div","cx-record-subtools");let tabLifetime,tabContext;const paintTab=()=>{tabLifetime?.abort();tabLifetime=new AbortController();tabContext=recordContext(view,record,dialog,{...context,signal:AbortSignal.any([context.signal,tabLifetime.signal])},payload);const tab=tabs.find(item=>item.id===state.tab),sections=tab.sections.map(section=>recordSection(tabContext,section,state,showEmpty)).filter(Boolean);panel.replaceChildren(...sections);sub.replaceChildren();if(tabs.length>1){panel.setAttribute("role","tabpanel");panel.id=recordId(dialog,"p",tab.id);panel.setAttribute("aria-labelledby",recordId(dialog,"t",tab.id));panel.tabIndex=0}
123
- if(layout.jump!==false&&sections.length>=(layout.jump?2:4)){const jump=h("nav","cx-record-jump");jump.setAttribute("aria-label",ctx.labels.recordSections);for(const element of sections){const target=element.querySelector(".cx-record-toggle");jump.appendChild(recordButton(target.textContent,()=>{element.scrollIntoView({block:"start"});target.focus({preventScroll:true})},"cx-record-jump-link"))}
126
+ view._recordHistory=Promise.resolve(view.loadHistory()).then(()=>{if(dialog.isConnected&&dialog._cxRecord)recordRepaint(view,dialog,dialog._cxRecord,dialog._cxPanel?.index)},()=>{});const showEmpty=RECORD_SHOW_EMPTY||!layout.hideEmpty;const tabs=layout.tabs.filter(tab=>tab.sections.some(section=>recordHasContent(ctx,section,showEmpty)));if(!tabs.length)tabs.push(layout.tabs[0]);const owner=state.jump&&tabs.find(tab=>recordTrail(tab.sections,state.jump));if(owner){state.tab=owner.id;for(const id of recordTrail(owner.sections,state.jump))state.collapsed.set(id,false)}
127
+ if(!tabs.some(tab=>tab.id===state.tab))state.tab=tabs[0].id;recordSummary(ctx,layout,dialog);body.replaceChildren();const tools=h("div","cx-record-tools"),panel=h("div","cx-record-panel"),sub=h("div","cx-record-subtools");let tabLifetime,tabContext;const paintTab=()=>{tabLifetime?.abort();tabLifetime=new AbortController();tabContext=recordContext(view,record,dialog,{...context,signal:AbortSignal.any([context.signal,tabLifetime.signal])},payload);const tab=tabs.find(item=>item.id===state.tab),sections=tab.sections.map(section=>recordSection(tabContext,section,state,showEmpty)).filter(Boolean);panel.replaceChildren(...sections);sub.replaceChildren();if(tabs.length>1){panel.setAttribute("role","tabpanel");panel.id=recordId(dialog,"p",tab.id);panel.setAttribute("aria-labelledby",recordId(dialog,"t",tab.id));panel.tabIndex=0}
128
+ if(layout.jump!==false&&sections.length>=(layout.jump?2:4)){const jump=h("nav","cx-record-jump");jump.setAttribute("aria-label",ctx.labels.recordSections);for(const element of sections){const target=element.querySelector(".cx-record-toggle");jump.appendChild(recordButton(target.textContent,()=>{recordJump(body,tools,element);target.focus({preventScroll:true})},"cx-record-jump-link"))}
124
129
  sub.appendChild(jump)}
125
130
  const hidden=layout.hideEmpty?recordEmptyCount(ctx,layout.tabs.flatMap(item=>item.sections)):0;if(hidden||RECORD_SHOW_EMPTY&&layout.hideEmpty){const toggle=recordButton(RECORD_SHOW_EMPTY?ctx.labels.recordHideEmpty:fill(ctx.labels.recordShowEmpty,{count:recordCount(ctx,hidden)}),()=>{RECORD_SHOW_EMPTY=!RECORD_SHOW_EMPTY;recordRepaint(view,dialog,record,context.index);dialog.querySelector(".cx-record-empty")?.focus()},"cx-record-empty");toggle.setAttribute("aria-pressed",String(RECORD_SHOW_EMPTY));sub.appendChild(toggle)}
126
131
  sub.hidden=!sub.firstChild};const select=(id,focus)=>{state.tab=id;for(const button of tools.querySelectorAll("[role=tab]")){const on=button.id===recordId(dialog,"t",id);button.setAttribute("aria-selected",String(on));button.tabIndex=on?0:-1;if(on)button.setAttribute("aria-controls",recordId(dialog,"p",id));else button.removeAttribute("aria-controls")}
127
- paintTab();recordMount(tabContext,panel);dialog.dispatchEvent(new CustomEvent("cx-drawer-paint",{detail:{id:record.id,index:context.index??null}}));if(focus)tools.querySelector("[aria-selected=true]")?.focus()};if(tabs.length>1)tools.appendChild(recordTabs(ctx,layout,state,tabs,select));tools.appendChild(sub);paintTab();body.append(tools,panel);tools.hidden=tabs.length<2&&sub.hidden;if(entry?.state==="loading"){const note=h("p","cx-record-note");setText(note,ctx.labels.loading);panel.prepend(note);entry.promise.then(()=>ctx.repaint(),()=>ctx.repaint())}else if(entry?.state==="error"){const note=h("p","cx-record-note cx-record-error");setText(note,fill(ctx.labels.recordLoadFailed,{error:entry.error.message}));note.setAttribute("role","alert");note.appendChild(recordButton(ctx.labels.recordRetry,()=>{view._recordPayloads.delete(recordCacheKey(view,record.id));ctx.repaint()},"cx-record-retry"));panel.prepend(note)}
132
+ paintTab();recordMount(tabContext,panel);dialog.dispatchEvent(new CustomEvent("cx-drawer-paint",{detail:{id:record.id,index:context.index??null}}));if(focus)tools.querySelector("[aria-selected=true]")?.focus()};if(tabs.length>1)tools.appendChild(recordTabs(ctx,layout,state,tabs,select));tools.appendChild(sub);paintTab();body.append(tools,panel);body.style.paddingBlockStart="0px";tools.hidden=tabs.length<2&&sub.hidden;if(state.jump&&entry?.state!=="loading"){const jump=state.jump,find=()=>body.querySelector('[data-cx-section="'+CSS.escape(jump)+ '"]');if(find())global.requestAnimationFrame(()=>{const target=find();if(state.jump!==jump||!target)return;state.jump=null;recordJump(body,body.querySelector(".cx-record-tools")||tools,target,true)});else state.jump=null}
133
+ if(entry?.state==="loading"){const note=h("p","cx-record-note");setText(note,ctx.labels.loading);panel.prepend(note);entry.promise.then(()=>ctx.repaint(),()=>ctx.repaint())}else if(entry?.state==="error"){const note=h("p","cx-record-note cx-record-error");setText(note,fill(ctx.labels.recordLoadFailed,{error:entry.error.message}));note.setAttribute("role","alert");note.appendChild(recordButton(ctx.labels.recordRetry,()=>{view._recordPayloads.delete(recordCacheKey(view,record.id));ctx.repaint()},"cx-record-retry"));panel.prepend(note)}
128
134
  recordLinkWrite(view,record,dialog)};function recordSummary(ctx,layout,dialog){const box=dialog.querySelector(".cx-record-summary");if(!box)return;box.replaceChildren();const header=layout.header,value=id=>{const field=layout.byId.get(id);return field&&[field,recordCell(ctx.view,ctx.record,ctx.payload,field)]};if(header?.status){const[field,cell]=value(header.status)||[];if(field&&!recordEmpty(cell,field,ctx.fmt)){const status=h("div","cx-record-status");status.setAttribute("data-cx-fact",field.id);recordValue(ctx,field,cell,status);box.appendChild(status)}}
129
135
  const facts=h("dl","cx-record-facts");for(const id of header?.facts||[]){const[field,cell]=value(id)||[];if(!field||recordEmpty(cell,field,ctx.fmt))continue;const item=h("div","cx-record-fact"),term=h("dt"),detail=h("dd");item.setAttribute("data-cx-fact",field.id);setText(term,field.title);recordValue(ctx,field,cell,detail);item.append(term,detail);facts.appendChild(item)}
130
136
  if(facts.firstChild)box.appendChild(facts);box.hidden=!box.firstChild}
@@ -135,38 +141,40 @@ return api.openRecord(ref.id,{stack:[...state.stack,entry].slice(-20),returnFocu
135
141
  .then(()=>recordRetire(dialog),error=>{recordAnnounce(dialog,fill(ctx.labels.recordUnavailable,{id:ref.id}));view.emit("error",{error})})}
136
142
  function recordBack(view,dialog,steps=1){const stack=dialog._cxPanel?.stack||[],entry=stack[stack.length-steps],api=entry&&recordApi(entry.view);if(!api)return;api.openRecord(entry.id,{stack:stack.slice(0,stack.length-steps),tab:entry.tab,origin:entry.origin,back:true,returnFocus:dialog._returnFocus})
137
143
  .then(()=>recordRetire(dialog),error=>{recordAnnounce(dialog,fill(view.labels.recordUnavailable,{id:entry.id}));view.emit("error",{error})})}
138
- function recordRetire(dialog){if(dialog.isConnected&&dialog.open&&document.querySelectorAll("dialog.cx-drawer[open]").length>1){dialog._replaced=true;dialog.close();dialog.remove()}}
139
- RECORD_IMPL.open=async(view,id,options={})=>{requireIdentifier(id,"record ID");if(view.destroyed)recordFail("the view was destroyed.");await view.ready;if(options.reload===true)RECORD_IMPL.invalidate(view,id);const dialog=view.kind==="tree"?await recordOpenNode(view,id,options):await recordOpenRow(view,id,options);if(!dialog)return;const origin=options.origin&&dialog.querySelector('[data-cx-origin="'+CSS.escape(options.origin)+ '"]');if(origin)origin.focus({preventScroll:false});if(options.stack)recordAnnounce(dialog,fill(options.back?view.labels.recordBackTo:view.labels.recordShowing,{record:recordTitle(dialog)}))};async function recordOpenRow(view,id,options){await view.requirePart("filter-editor");let index=null,row=null;const loaded=[...view.rowCache.values()].find(item=>!item.status&&item.key===id);if(loaded){row=loaded.h;index=loaded._ri;if(!view.pendingQuery)await view.focusResult(index,false).catch(()=>{})}
140
- else if(view.acceptedQuery&&!view.pendingQuery&&typeof view.source.position==="function"){const position=await view.runGridHook(signal=>view.source.position(view.acceptedQuery,id,{signal}));if(Number.isInteger(position)&&position>=0&&position<view.rowCount()){await view.focusResult(position,false);const item=view.rowCache.get(position);if(item&&!item.status&&item.key===id){row=item.h;index=position}}}
144
+ function recordRetire(dialog){if(dialog.isConnected&&dialog.open&&document.querySelectorAll("dialog.cx-drawer[open]").length>1){dialog._replaced=true;dialog._cxOverlay.close("replace",false,true);dialog.remove()}}
145
+ RECORD_IMPL.open=async(view,id,options={})=>{requireIdentifier(id,"record ID");if(view.destroyed)recordFail("the view was destroyed.");await view.ready;if(options.reload===true)RECORD_IMPL.invalidate(view,id);const dialog=view.kind==="tree"?await recordOpenNode(view,id,options):await recordOpenRow(view,id,options);if(!dialog)return;const origin=options.origin&&dialog.querySelector('[data-cx-origin="'+CSS.escape(options.origin)+ '"]');if(origin)origin.focus({preventScroll:false});if(options.stack)recordAnnounce(dialog,fill(options.back?view.labels.recordBackTo:view.labels.recordShowing,{record:recordTitle(dialog)}))};async function recordOpenRow(view,id,options){await view.requirePart("filter-editor");let index=null,row=view.board?.rows.find(row=>row.id===id)||view.path?.rows.find(row=>row.id===id)||view.stack?.settings.records.get(id)||null;const loaded=[...view.rowCache.values()].find(item=>!item.status&&item.key===id);if(loaded){row=loaded.h;index=loaded._ri;if(!view.grid.hidden&&!view.pendingQuery)await view.focusResult(index,false).catch(()=>{})}
146
+ else if(!row&&view.acceptedQuery&&!view.pendingQuery&&typeof view.source.position==="function"){const position=await view.runGridHook(signal=>view.source.position(view.acceptedQuery,id,{signal}));if(Number.isInteger(position)&&position>=0&&position<view.rowCount()){await view.focusResult(position,false);const item=view.rowCache.get(position);if(item&&!item.status&&item.key===id){row=item.h;index=position}}}
141
147
  if(!row&&typeof view.source.row==="function")row=view.source.row(id);if(!row&&recordLoader(view)){const key=recordCacheKey(view,id);const payload=await recordFetch(view,id,{row:true});if(payload?.row){row=payload.row;(view._recordPayloads||=new Map()).set(key,{state:"ready",payload,promise:Promise.resolve(payload)})}}
142
148
  if(!row)recordFail("record "+id+" is not available.");const returnFocus=options.returnFocus||document.activeElement;if(typeof view.opts.onDetails==="function"){const record=recordGridHelpers().gridFreeze(JSON.parse(JSON.stringify(row)));await view.runGridHook(signal=>view.opts.onDetails({row:record,query:view.acceptedQuery,signal,returnFocus}));return null}
143
149
  return view.openGridDrawer(row,index,returnFocus,options)}
144
150
  async function recordOpenNode(view,id,options){await view.requirePart("tree-tools");let w=view.keyMap.get(id);if(!w&&Array.isArray(options.path)&&options.path.length){await view.expandPath(options.path,{focus:false});w=view.keyMap.get(id)}
145
151
  if(!w)recordFail("record "+id+" is not available.");return view.showDetails(id,{...options,node:w.h})}
146
- const recordLinkKey=view=>view.view.record?.deepLink?.key||"record";const recordLinkParams=()=>(global.location.hash||"").replace(/^#/, "").split("&").filter(Boolean);
152
+ const recordLinkKey=view=>view.view.record?.deepLink?.key||"record";const recordSectionPrefix=view=>recordLinkKey(view)+ "Section="+encodeURIComponent(view.view.id)+ ":";function recordLinkSection(view){const prefix=recordSectionPrefix(view),param=recordLinkParams().find(item=>item.startsWith(prefix));try{return param&&decodeURIComponent(param.slice(prefix.length))||null}
153
+ catch(error){return null}}
154
+ const recordLinkParams=()=>(global.location.hash||"").replace(/^#/, "").split("&").filter(Boolean);
147
155
  const recordLinkPath=ids=>ids.map(encodeURIComponent).join("/");function recordLinkRead(view){const prefix=recordLinkKey(view)+ "=";for(const param of recordLinkParams()){const value=param.startsWith(prefix)?param.slice(prefix.length):"",at=value.indexOf(":");if(at<1)continue;try{if(decodeURIComponent(value.slice(0,at))!==view.view.id)continue;const rest=value.slice(at+1),ids=(view.kind==="tree"?rest.split("/"):[rest]).map(decodeURIComponent);if(ids.every(id=>id))return ids}catch(error){}}
148
156
  return null}
149
157
  function recordLinkFor(view,record){const ids=[];if(view.kind==="tree")for(let w=view.keyMap.get(record.id);w&&w!==view.root&&w.key!=null;w=w.parent)ids.unshift(w.key);return recordLinkKey(view)+ "="+encodeURIComponent(view.view.id)+ ":"+recordLinkPath(ids.length?ids:[record.id])}
150
158
  const recordLinkPrefix=view=>recordLinkKey(view)+ "="+encodeURIComponent(view.view.id)+ ":";function recordAddress(view,record){const prefix=recordLinkPrefix(view),params=recordLinkParams().filter(param=>!param.startsWith(prefix));params.push(recordLinkFor(view,record));return global.location.href.replace(/#.*$/, "") + "#" + params.join("&");
151
159
  }
152
- function recordLinkWrite(view,record,dialog){if(!view.view.record?.deepLink)return;const link=record&&recordLinkFor(view,record);view._recordLinkOwner=record?{dialog,link}:null;const prefix=recordLinkPrefix(view),params=recordLinkParams().filter(param=>!param.startsWith(prefix));if(record)params.push(link);const hash=params.length?"#"+params.join("&"):"";if((global.location.hash||"")===hash)return;try{global.history.replaceState(global.history.state,"",hash||global.location.pathname+global.location.search)}
160
+ function recordLinkWrite(view,record,dialog){if(!view.view.record?.deepLink)return;const link=record&&recordLinkFor(view,record);view._recordLinkOwner=record?{dialog,link}:null;const prefix=recordLinkPrefix(view),section=recordSectionPrefix(view),params=recordLinkParams().filter(param=>!param.startsWith(prefix)&&!param.startsWith(section));if(record)params.push(link);const hash=params.length?"#"+params.join("&"):"";if((global.location.hash||"")===hash)return;try{global.history.replaceState(global.history.state,"",hash||global.location.pathname+global.location.search)}
153
161
  catch(error){}
154
162
  view._recordLinkOpen=record?recordLinkPath(recordLinkRead(view)||[]):null}
155
163
  RECORD_IMPL.start=view=>{if(view._recordStarted||!view.view.record?.deepLink)return;view._recordStarted=true;const read=()=>{const ids=recordLinkRead(view),key=ids?recordLinkPath(ids):null,owner=view._recordLinkOwner?.dialog;if(!ids){view._recordLinkOpen=null;view._recordLinkOwner=null;return}
156
- if(key===view._recordLinkOpen&&(!owner||owner.open||owner._replaced))return;view._recordLinkOwner=null;view._recordLinkOpen=key;RECORD_IMPL.open(view,ids[ids.length-1],{path:ids}).catch(error=>view.emit("error",{error}))};global.addEventListener("hashchange",read,{signal:view.lifetime.signal});view.lifetime.signal.addEventListener("abort",()=>{view._recordLinkOwner=null;view._recordLinkOpen=null},{once:true});Promise.resolve(view.ready).then(read,()=>{})};RECORD_IMPL.decorate=(view,dialog,{head,identity,options})=>{if(!view.view.record)return;try{recordSpec(view)}catch(error){return}
157
- dialog.id||=view.id+"-record";dialog.classList.add("cx-record-drawer");const state=dialog._cxPanel={stack:Array.isArray(options.stack)?options.stack:[],tab:options.tab||null,collapsed:new Map()},labels=view.labels;const live=h("div","cx-record-live cx-sr-only");live.setAttribute("aria-live","polite");dialog.appendChild(live);if(state.stack.length){const trail=h("nav","cx-record-trail"),crumbs=h("ol","cx-record-crumbs"),last=state.stack[state.stack.length-1];trail.setAttribute("aria-label",labels.recordTrail);const back=recordButton(labels.recordBack,()=>recordBack(view,dialog),"cx-record-back","back");back.setAttribute("aria-label",fill(labels.recordBackTo,{record:last.title||last.id}));state.stack.slice(-3).forEach((entry,at,list)=>{const item=h("li");item.appendChild(recordButton(entry.title||entry.id,()=>recordBack(view,dialog,list.length-at),"cx-record-crumb"));crumbs.appendChild(item)});trail.append(back,crumbs);identity.prepend(trail)}
164
+ if(key===view._recordLinkOpen&&(!owner||owner.open||owner._replaced)){const section=recordLinkSection(view);if(section&&owner?.open&&owner._cxPanel&&owner._cxRecord){owner._cxPanel.jump=section;recordRepaint(view,owner,owner._cxRecord,owner._cxPanel.index);recordLinkWrite(view,owner._cxRecord,owner)}
165
+ return}
166
+ view._recordLinkOwner=null;view._recordLinkOpen=key;const section=recordLinkSection(view);RECORD_IMPL.open(view,ids[ids.length-1],section?{path:ids,section}:{path:ids}).catch(error=>view.emit("error",{error}))};global.addEventListener("hashchange",read,{signal:view.lifetime.signal});view.lifetime.signal.addEventListener("abort",()=>{view._recordLinkOwner=null;view._recordLinkOpen=null},{once:true});Promise.resolve(view.ready).then(read,()=>{})};RECORD_IMPL.decorate=(view,dialog,{head,identity,options})=>{if(!view.view.record)return;try{recordSpec(view)}catch(error){return}
167
+ dialog.id||=view.id+"-record";dialog.classList.add("cx-record-drawer");const state=dialog._cxPanel={stack:Array.isArray(options.stack)?options.stack:[],tab:options.tab||null,jump:typeof options.section==="string"&&options.section||null,collapsed:new Map()},labels=view.labels;const live=h("div","cx-record-live cx-sr-only");live.setAttribute("aria-live","polite");dialog.appendChild(live);if(state.stack.length){const trail=h("nav","cx-record-trail"),crumbs=h("ol","cx-record-crumbs"),last=state.stack[state.stack.length-1];trail.setAttribute("aria-label",labels.recordTrail);const back=recordButton(labels.recordBack,()=>recordBack(view,dialog),"cx-record-back","back");back.setAttribute("aria-label",fill(labels.recordBackTo,{record:last.title||last.id}));state.stack.slice(-3).forEach((entry,at,list)=>{const item=h("li");item.appendChild(recordButton(entry.title||entry.id,()=>recordBack(view,dialog,list.length-at),"cx-record-crumb"));crumbs.appendChild(item)});trail.append(back,crumbs);identity.prepend(trail)}
158
168
  const summary=h("div","cx-record-summary");summary.hidden=true;head.after(summary);let projectedSubtitle;if(typeof view.opts.recordHeading==="function")dialog.addEventListener("cx-drawer-paint",()=>{if(projectedSubtitle){setText(projectedSubtitle,"");projectedSubtitle.hidden=true}
159
169
  try{const heading=view.opts.recordHeading(Object.freeze(JSON.parse(JSON.stringify(dialog._cxRecord))));if(heading&&typeof heading.title==="string"&&heading.title.length<=512)setText(identity.querySelector("h4"),heading.title);if(heading&&typeof heading.subtitle==="string"&&heading.subtitle.length<=2000){let subtitle=identity.querySelector("p");if(!subtitle){subtitle=projectedSubtitle=h("p");identity.appendChild(subtitle)}
160
170
  subtitle.classList.add("cx-record-subtitle");setText(subtitle,heading.subtitle);subtitle.hidden=!heading.subtitle}}catch(error){view.emit("error",{error})}});recordActionsMenu(view,dialog,identity);dialog.addEventListener("keydown",event=>{if(event.altKey&&event.key==="ArrowLeft"&&state.stack.length){event.preventDefault();recordBack(view,dialog)}});dialog.addEventListener("close",()=>{if(view.destroyed)return;const owner=view._recordLinkOwner;if(owner?.dialog!==dialog)return;if(dialog._replaced){view._recordLinkOwner=null;return}
161
- const ids=recordLinkRead(view);if(ids&&owner.link===recordLinkPrefix(view)+ recordLinkPath(ids))recordLinkWrite(view,null);view._recordLinkOwner=null;view._recordLinkOpen=null},{once:true})};function recordActionsMenu(view,dialog,identity){dialog.querySelector(".cx-record-footer")?.remove();const spec=recordSpec(view),switches=spec.actions||{},labels=view.labels,items=[];const failed=error=>{recordAnnounce(dialog,error?.message??String(error));view.emit("error",{error})};const add=(label,task,prominent=false,visible=()=>true)=>{let running=false,button;const run=async()=>{if(running||!visible())return;running=true;if(button)button.disabled=true;try{return await task()}
162
- finally{running=false;if(button)button.disabled=false}};const item={label,task:run,visible,primary:typeof prominent==="function"?prominent:()=>prominent===true};items.push(item);if(prominent){let footer=dialog.querySelector(".cx-record-footer");if(!footer){footer=h("footer","cx-record-footer");dialog.appendChild(footer)}
163
- button=recordButton(label,()=>{Promise.resolve().then(run).catch(failed)},"cx-record-btn cx-record-primary");item.footer=button;footer.appendChild(button)}};if(switches.link!==false&&spec.deepLink)add(labels.recordCopyLink,()=>recordCopy(view,dialog,recordAddress(view,dialog._cxRecord)));if(switches.copy!==false){add(labels.recordCopyValues,()=>recordCopy(view,dialog,recordExport(view,dialog,"text")));add(labels.recordCopyJson,()=>recordCopy(view,dialog,recordExport(view,dialog,"json")))}
171
+ const ids=recordLinkRead(view);if(ids&&owner.link===recordLinkPrefix(view)+ recordLinkPath(ids))recordLinkWrite(view,null);view._recordLinkOwner=null;view._recordLinkOpen=null},{once:true})};function recordActionsMenu(view,dialog,identity){dialog.querySelector(".cx-record-footer")?.remove();const spec=recordSpec(view),switches=spec.actions||{},labels=view.labels,items=[];const failed=error=>{recordAnnounce(dialog,error?.message??String(error));view.emit("error",{error})};const add=(label,task,prominent=false,visible=()=>true,disabled=false)=>{let running=false,button;const run=async()=>{if(running||disabled||!visible())return;running=true;if(button)button.disabled=true;try{return await task()}
172
+ finally{running=false;if(button)button.disabled=disabled}};const item={label,task:run,visible,disabled,primary:typeof prominent==="function"?prominent:()=>prominent===true};items.push(item);if(prominent){let footer=dialog.querySelector(".cx-record-footer");if(!footer){footer=h("footer","cx-record-footer");dialog.appendChild(footer)}
173
+ button=recordButton(label,()=>{Promise.resolve().then(run).catch(failed)},"cx-record-btn cx-record-primary");button.disabled=disabled;item.footer=button;footer.appendChild(button)}};if(switches.link!==false&&spec.deepLink)add(labels.recordCopyLink,()=>recordCopy(view,dialog,recordAddress(view,dialog._cxRecord)));if(switches.copy!==false){add(labels.recordCopyValues,()=>recordCopy(view,dialog,recordExport(view,dialog,"text")));add(labels.recordCopyJson,()=>recordCopy(view,dialog,recordExport(view,dialog,"json")))}
164
174
  if(switches.export!==false){add(labels.recordExportCsv,()=>recordDownload(view,dialog,"csv"));add(labels.recordExportJson,()=>recordDownload(view,dialog,"json"))}
165
- if(switches.print!==false)add(labels.recordPrint,()=>recordPrint(view,dialog));for(const action of[...(Array.isArray(view.opts.recordActions)?view.opts.recordActions:[]),...view.plugins.flatMap(item=>item.recordActions||[])]){if(!action||typeof action.label!=="string"||typeof action.run!=="function")continue;const context=()=>{const record=dialog._cxRecord,entry=record&&recordEntry(view,record.id);return Object.freeze({record:record?JSON.parse(JSON.stringify(record)):{id:""},view:view.view.id,api:view.host.canopyx,payload:entry?.state==="ready"?JSON.parse(JSON.stringify(entry.payload)):null,signal:view.lifetime.signal})};const condition=(value,fallback)=>{if(typeof value!=="function")return value===undefined?fallback:value===true;try{return value(context())===true}catch(error){failed(error);return false}};add(action.label,()=>action.run(context()),()=>condition(action.prominent,false),()=>condition(action.visible,true))}
166
- if(!items.length)return;const menu=h("div","cx-record-menu"),toggle=recordButton("",()=>show(list.hidden),"cx-record-menu-btn","more"),list=h("div","cx-record-menu-list");list.id=dialog.id+"-actions";list.setAttribute("role","menu");list.setAttribute("aria-label",labels.recordActions);list.hidden=true;toggle.setAttribute("aria-label",labels.recordActions);toggle.title=labels.recordActions;toggle.setAttribute("aria-haspopup","menu");toggle.setAttribute("aria-expanded","false");toggle.setAttribute("aria-controls",list.id);const show=open=>{list.hidden=!open;toggle.setAttribute("aria-expanded",String(open));if(open)buttons.find(button=>!button.hidden)?.focus()};const buttons=items.map(item=>{const button=recordButton(item.label,()=>{show(false);toggle.focus();Promise.resolve().then(item.task).catch(failed)},"cx-record-menu-item");button.setAttribute("role","menuitem");button.tabIndex=-1;item.button=button;return button});list.append(...buttons);menu.append(toggle,list);identity.after(menu);menu.addEventListener("keydown",event=>{if(list.hidden)return;if(event.key==="Escape"){event.preventDefault();event.stopPropagation();show(false);toggle.focus();return}
167
- if(event.key==="Tab"){show(false);return}
168
- const visible=buttons.filter(button=>!button.hidden),at=visible.indexOf(document.activeElement);if(at<0||!["ArrowDown","ArrowUp","Home","End"].includes(event.key))return;event.preventDefault();event.stopPropagation();visible[{ArrowDown:(at+1)%visible.length,ArrowUp:(at-1+visible.length)%visible.length,Home:0,End:visible.length-1}[event.key]].focus()});menu.addEventListener("focusout",event=>{if(!menu.contains(event.relatedTarget)&&event.relatedTarget)show(false)});dialog.addEventListener("pointerdown",event=>{if(!menu.contains(event.target))show(false)});const paint=()=>{for(const item of items){const visible=item.visible();item.button.hidden=!visible;if(item.footer)item.footer.hidden=!visible||!item.primary()}
169
- menu.hidden=!items.some(item=>!item.button.hidden);const footer=dialog.querySelector(".cx-record-footer");if(footer)footer.hidden=!items.some(item=>item.footer&&!item.footer.hidden);if(menu.hidden)show(false)};dialog.addEventListener("cx-drawer-paint",paint);paint()}
175
+ if(switches.print!==false)add(labels.recordPrint,()=>recordPrint(view,dialog));for(const action of[...(Array.isArray(view.opts.recordActions)?view.opts.recordActions:[]),...view.plugins.flatMap(item=>item.recordActions||[])]){if(!action||typeof action.label!=="string"||typeof action.run!=="function")continue;const context=()=>{const record=dialog._cxRecord,entry=record&&recordEntry(view,record.id);return Object.freeze({record:record?JSON.parse(JSON.stringify(record)):{id:""},view:view.view.id,api:view.host.canopyx,payload:entry?.state==="ready"?JSON.parse(JSON.stringify(entry.payload)):null,signal:view.lifetime.signal})};const condition=(value,fallback)=>{if(typeof value!=="function")return value===undefined?fallback:value===true;try{return value(context())===true}catch(error){failed(error);return false}};add(action.label,()=>action.run(context()),()=>condition(action.prominent,false),()=>condition(action.visible,true),action.disabled===true)}
176
+ if(!items.length)return;const menu=h("div","cx-record-menu"),toggle=h("button","cx-record-btn cx-record-menu-btn"),list=h("div","cx-menu"),actions=new Map();toggle.type="button";toggle.appendChild(recordIcon("more"));list.id=dialog.id+"-actions";list.setAttribute("role","menu");list.setAttribute("aria-label",labels.recordActions);list.hidden=true;toggle.setAttribute("aria-label",labels.recordActions);toggle.title=labels.recordActions;for(const item of items){const button=h("button","cx-record-btn cx-record-menu-item");button.type="button";setText(button,item.label);button.setAttribute("role","menuitem");button.disabled=item.disabled;button.dataset.itemId=String(actions.size);actions.set(button.dataset.itemId,item.task);item.button=button}
177
+ menu.append(toggle,list);identity.after(menu);const controller=UI_IMPL.menu(list,{host:view.host,trigger:toggle,label:labels.recordActions,placement:"bottom-end",onSelect:item=>Promise.resolve().then(actions.get(item.id)).catch(failed)});dialog.addEventListener("close",()=>controller.destroy(),{once:true});const paint=()=>{const shown=items.filter(item=>item.visible());for(const item of items)if(item.footer)item.footer.hidden=!shown.includes(item)||!item.primary();list.replaceChildren(...shown.map(item=>item.button));controller.refresh();menu.hidden=!shown.length;const footer=dialog.querySelector(".cx-record-footer");if(footer)footer.hidden=!items.some(item=>item.footer&&!item.footer.hidden);if(menu.hidden)controller.close("hidden",false,true)};dialog.addEventListener("cx-drawer-paint",paint);paint()}
170
178
  async function recordCopy(view,dialog,text){if(!global.navigator.clipboard?.writeText)recordFail("the clipboard is not available.");await global.navigator.clipboard.writeText(text);recordAnnounce(dialog,view.labels.recordCopied)}
171
179
  function recordFlat(cell,field,fmt){const kind=recordKind(cell),text=(value,spec=field)=>recordFlat(value,spec,fmt);if(kind==="items")return cell.items.map(item=>text(item)).join(", ");if(kind==="fields")return cell.fields.map(entry=>entry.name+": "+text(entry.value,{kind:entry.kind||"text"})).join("; ");if(kind==="records")return(cell.records.rows||cell.records.roots||[]).map(row=>cell.records.columns.map(column=>text(row.cells?.[column.id]??null,column)).filter(Boolean).join(" · ")).join("\n");if(kind==="events")return cell.events.map(event=>[event.time?formatValue(event.time,"datetime",fmt):"",event.kind,event.actor,event.summary].filter(Boolean).join(" · ")).join("\n");if(kind==="changes")return cell.changes.map(change=>change.name+": "+text(change.before??null)+ " → "+text(change.after??null)).join("\n");return cellText(cell,field.column||field,fmt)}
172
180
  function recordData(view,dialog){const record=dialog._cxRecord,entry=recordEntry(view,record.id),payload=entry?.state==="ready"?entry.payload:null;const fields=recordFields(view),layout=recordLayout(view,fields),items=[],seen=new Set();const walk=(sections,path)=>{for(const section of sections){const name=path?path+" / "+section.label:section.label;for(const field of section.fields)if(!seen.has(field.id)){seen.add(field.id);items.push({section:name,field,cell:recordCell(view,record,payload,field)})}