@evotecit/canopyx 0.3.15 → 0.3.16

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.
@@ -110,11 +110,19 @@ export interface RecordSectionContext {
110
110
  /** Draws a drawer section's content (a chart, for example) into element. */
111
111
  export type RecordSectionRenderer = (record: Readonly<{ id: string; cells?: Readonly<Record<string, Cell>>; fields?: Readonly<Record<string, Cell>>; label?: string }>,
112
112
  element: HTMLElement, context: RecordSectionContext) => void | PromiseLike<void>;
113
- /** An action of the record panel's actions menu. */
113
+ /** A detached snapshot of the selected record and its loaded details. */
114
+ export interface RecordActionContext {
115
+ readonly record: Readonly<{ id: string; cells?: Readonly<Record<string, Cell>>; fields?: Readonly<Record<string, Cell>> }>;
116
+ readonly view: string; readonly api: unknown; readonly payload: GridRecord | null; readonly signal: AbortSignal;
117
+ }
118
+ /** An action of the record panel's actions menu. Hosts must enforce authorization again when executing it. */
114
119
  export interface RecordAction {
120
+ /** Evaluated after each record paint, including loaded details. Hidden actions cannot run through a stale control. */
121
+ readonly visible?: boolean | ((context: RecordActionContext) => boolean);
122
+ /** Also renders this action as a visible footer button. Menu access is retained. */
123
+ readonly prominent?: boolean | ((context: RecordActionContext) => boolean);
115
124
  readonly label: string;
116
- run(context: { readonly record: Readonly<{ id: string; cells?: Readonly<Record<string, Cell>>; fields?: Readonly<Record<string, Cell>> }>; readonly view: string; readonly api: unknown;
117
- readonly payload: GridRecord | null; readonly signal: AbortSignal }): void | PromiseLike<void>;
125
+ run(context: RecordActionContext): void | PromiseLike<void>;
118
126
  }
119
127
  /** The canopyx:openAll event's detail (and onOpenAll's argument): cancel it to filter the target grid yourself. */
120
128
  export interface RecordOpenAll {
@@ -122,9 +130,15 @@ export interface RecordOpenAll {
122
130
  readonly filters: readonly { readonly column: string; readonly operator: string; readonly values: readonly CellValue[] }[] | null;
123
131
  }
124
132
  /** Options that open a record (openRecord). */
125
- export interface OpenRecordOptions { readonly returnFocus?: Element | null; readonly path?: readonly string[]; readonly tab?: string; }
133
+ export interface OpenRecordOptions {
134
+ readonly returnFocus?: Element | null; readonly path?: readonly string[]; readonly tab?: string;
135
+ /** Read this record's details again after a host mutation, even when the grid's row/revision has not changed. */
136
+ readonly reload?: boolean;
137
+ }
126
138
  /** Host options of the record panel, on grids and trees. */
127
139
  export interface RecordPanelOptions {
140
+ /** Plain-text heading projection. The record is a detached read-only snapshot; title and subtitle are bounded. */
141
+ recordHeading?: (record: Readonly<{id:string; cells?:Readonly<Record<string,Cell>>; fields?:Readonly<Record<string,Cell>>}>) => {title:string;subtitle?:string};
128
142
  /** Loads a record's details when its drawer opens; used whatever the declared source. */
129
143
  loadRecord?: RecordLoader;
130
144
  /** Section renderers by name, beside the plugins' drawerSections. */
package/README.md CHANGED
@@ -24,13 +24,13 @@ Turn application data into searchable trees, sortable tables and standalone HTML
24
24
  - **Change views**: a text diff (inline or side by side, word marks, folded regions, windowed rows), a change list with kind badges, folders, hashes and risk flags, and how a change reached its replicas ([docs/changes.md](docs/changes.md)).
25
25
  - **Guided flows** for setup and edit tasks: steps with typed fields, conditions as data, validation, a review page with change links, secrets that never echo, and one proposal to the host ([docs/flow.md](docs/flow.md)).
26
26
 
27
- ![File explorer in the light theme, with sizes, dates, owners and an expanded detail row](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.15/docs/images/tree-grid-light.png)
27
+ ![File explorer in the light theme, with sizes, dates, owners and an expanded detail row](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.16/docs/images/tree-grid-light.png)
28
28
 
29
29
  The same explorer in the dark theme, alongside its script-free output for email and print:
30
30
 
31
31
  | Dark theme | Static outline |
32
32
  | --- | --- |
33
- | ![File explorer in the dark theme](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.15/docs/images/tree-grid-dark.png) | ![Static outline table](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.15/docs/images/static-outline.png) |
33
+ | ![File explorer in the dark theme](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.16/docs/images/tree-grid-dark.png) | ![Static outline table](https://cdn.jsdelivr.net/npm/@evotecit/canopyx@0.3.16/docs/images/static-outline.png) |
34
34
 
35
35
  ## Features
36
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evotecit/canopyx",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "Interactive tree grids and data tables with virtual rows, search, filters and offline HTML reports.",
5
5
  "type": "module",
6
6
  "license": "MIT",