@gtkx/components 1.0.0-rc.4 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +5 -5
  2. package/dist/column-view.d.ts +2 -2
  3. package/dist/column-view.d.ts.map +1 -1
  4. package/dist/column-view.js +14 -12
  5. package/dist/column-view.js.map +1 -1
  6. package/dist/grid-view.js +1 -1
  7. package/dist/grid-view.js.map +1 -1
  8. package/dist/index.d.ts +1 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/internal/cells.d.ts +31 -23
  12. package/dist/internal/cells.d.ts.map +1 -1
  13. package/dist/internal/cells.js +168 -77
  14. package/dist/internal/cells.js.map +1 -1
  15. package/dist/internal/collection-index.d.ts +6 -10
  16. package/dist/internal/collection-index.d.ts.map +1 -1
  17. package/dist/internal/collection-index.js +32 -69
  18. package/dist/internal/collection-index.js.map +1 -1
  19. package/dist/internal/collection-model.d.ts +23 -2
  20. package/dist/internal/collection-model.d.ts.map +1 -1
  21. package/dist/internal/collection-model.js +210 -95
  22. package/dist/internal/collection-model.js.map +1 -1
  23. package/dist/internal/collection.d.ts +8 -11
  24. package/dist/internal/collection.d.ts.map +1 -1
  25. package/dist/internal/collection.js +38 -49
  26. package/dist/internal/collection.js.map +1 -1
  27. package/dist/internal/controlled-sync.d.ts +11 -0
  28. package/dist/internal/controlled-sync.d.ts.map +1 -0
  29. package/dist/internal/controlled-sync.js +19 -0
  30. package/dist/internal/controlled-sync.js.map +1 -0
  31. package/dist/internal/drop-down.d.ts.map +1 -1
  32. package/dist/internal/drop-down.js +27 -15
  33. package/dist/internal/drop-down.js.map +1 -1
  34. package/dist/internal/expansion.d.ts +3 -2
  35. package/dist/internal/expansion.d.ts.map +1 -1
  36. package/dist/internal/expansion.js +80 -47
  37. package/dist/internal/expansion.js.map +1 -1
  38. package/dist/internal/keys.d.ts +5 -0
  39. package/dist/internal/keys.d.ts.map +1 -0
  40. package/dist/internal/keys.js +13 -0
  41. package/dist/internal/keys.js.map +1 -0
  42. package/dist/internal/selection.d.ts +3 -2
  43. package/dist/internal/selection.d.ts.map +1 -1
  44. package/dist/internal/selection.js +68 -35
  45. package/dist/internal/selection.js.map +1 -1
  46. package/dist/internal/slots.d.ts +10 -0
  47. package/dist/internal/slots.d.ts.map +1 -0
  48. package/dist/internal/slots.js +43 -0
  49. package/dist/internal/slots.js.map +1 -0
  50. package/dist/internal/tree-expansion.d.ts +20 -0
  51. package/dist/internal/tree-expansion.d.ts.map +1 -0
  52. package/dist/internal/tree-expansion.js +68 -0
  53. package/dist/internal/tree-expansion.js.map +1 -0
  54. package/dist/internal/tree-order.d.ts +27 -0
  55. package/dist/internal/tree-order.d.ts.map +1 -0
  56. package/dist/internal/tree-order.js +71 -0
  57. package/dist/internal/tree-order.js.map +1 -0
  58. package/dist/internal/use-collection.d.ts +1 -1
  59. package/dist/internal/use-collection.d.ts.map +1 -1
  60. package/dist/internal/use-collection.js +4 -4
  61. package/dist/internal/use-collection.js.map +1 -1
  62. package/dist/list-view.d.ts.map +1 -1
  63. package/dist/list-view.js +6 -6
  64. package/dist/list-view.js.map +1 -1
  65. package/dist/types.d.ts +70 -21
  66. package/dist/types.d.ts.map +1 -1
  67. package/dist/types.js.map +1 -1
  68. package/package.json +7 -7
  69. package/src/column-view.tsx +28 -25
  70. package/src/grid-view.tsx +1 -1
  71. package/src/index.ts +3 -0
  72. package/src/internal/cells.tsx +339 -117
  73. package/src/internal/collection-index.ts +44 -92
  74. package/src/internal/collection-model.ts +259 -107
  75. package/src/internal/collection.ts +45 -67
  76. package/src/internal/controlled-sync.ts +34 -0
  77. package/src/internal/drop-down.tsx +41 -20
  78. package/src/internal/expansion.ts +104 -67
  79. package/src/internal/keys.ts +18 -0
  80. package/src/internal/selection.tsx +100 -51
  81. package/src/internal/slots.ts +67 -0
  82. package/src/internal/tree-expansion.ts +110 -0
  83. package/src/internal/tree-order.ts +138 -0
  84. package/src/internal/use-collection.tsx +5 -5
  85. package/src/list-view.tsx +14 -10
  86. package/src/types.ts +76 -19
@@ -1 +1 @@
1
- {"version":3,"file":"list-view.js","sourceRoot":"","sources":["../src/list-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,eAAe,GAAG;IACpB,OAAO;IACP,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;IACb,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;CACoB,CAAC;AAE7C;;;GAGG;AACH,SAAS,QAAQ,CAA2B,KAA0B;IAClE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IACjG,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,kBAAkB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,IAAI,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAEzC,OAAO,CACH,8BACI,KAAC,WAAW,IACR,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,KAAC,wBAAwB,OAAK,SAAS,CAAC,QAAQ,GAAI,KACzD,CAAC,YAAY,IAAI,IAAI,IAAI;oBACzB,aAAa,EAAE,KAAC,wBAAwB,OAAK,WAAW,CAAC,QAAQ,GAAI;iBACxE,CAAC,KACE,IAAI,GACV,EACF,KAAC,WAAW,IAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAI,EACtG,YAAY,IAAI,IAAI,IAAI,CACrB,KAAC,aAAa,IAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,GAAI,CACtF,IACF,CACN,CAAC;AACN,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { GtkListView, GtkSignalListItemFactory } from \"@gtkx/jsx/gtk\";\nimport { omit } from \"@gtkx/utils\";\nimport type { ListViewProps } from \"./types.js\";\nimport { HeaderPortals, ItemPortals, useHeaderCells, useItemCells } from \"./internal/cells.js\";\nimport { useCollection } from \"./internal/use-collection.js\";\n\nconst LIST_VIEW_PROPS = [\n \"items\",\n \"sections\",\n \"renderItem\",\n \"renderHeader\",\n \"selectedIds\",\n \"onSelectionChanged\",\n \"selectionMode\",\n \"expandedIds\",\n \"onExpandedChange\",\n \"estimatedItemHeight\",\n \"estimatedItemWidth\",\n] as const satisfies (keyof ListViewProps)[];\n\n/**\n * Renders a Gtk.ListView from declarative items or sections, with per-row rendering,\n * controlled selection, controlled tree expansion, and estimated item sizing.\n */\nfunction ListView<T = unknown, S = unknown>(props: ListViewProps<T, S>): ReactNode {\n const { renderItem, renderHeader, expandedIds, estimatedItemHeight, estimatedItemWidth } = props;\n const rest = omit(props, LIST_VIEW_PROPS);\n const size = { width: estimatedItemWidth ?? -1, height: estimatedItemHeight ?? -1 };\n const { collection, selection } = useCollection(props);\n const itemCells = useItemCells(size);\n const headerCells = useHeaderCells(size);\n\n return (\n <>\n <GtkListView\n model={selection}\n factory={<GtkSignalListItemFactory {...itemCells.handlers} />}\n {...(renderHeader != null && {\n headerFactory: <GtkSignalListItemFactory {...headerCells.handlers} />,\n })}\n {...rest}\n />\n <ItemPortals store={itemCells} render={renderItem} collection={collection} expandedIds={expandedIds} />\n {renderHeader != null && (\n <HeaderPortals store={headerCells} render={renderHeader} collection={collection} />\n )}\n </>\n );\n}\n\nexport { ListView };\n"]}
1
+ {"version":3,"file":"list-view.js","sourceRoot":"","sources":["../src/list-view.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,eAAe,GAAG;IACpB,OAAO;IACP,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;IACb,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,oBAAoB;CACoB,CAAC;AAE7C;;;GAGG;AACH,SAAS,QAAQ,CAA2B,KAA0B;IAClE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAC1D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,kBAAkB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,IAAI,CAAC,CAAC,EAAE,CAAC;IACpF,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,gBAAgB,CAAC,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAEhE,OAAO,CACH,8BACI,KAAC,WAAW,IACR,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,KAAC,wBAAwB,OAAK,SAAS,CAAC,QAAQ,GAAI,KACzD,MAAM,CAAC,YAAY,KACnB,IAAI,GACV,EACF,KAAC,WAAW,IACR,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,oBAAoB,GAC5C,EACD,MAAM,CAAC,OAAO,IAChB,CACN,CAAC;AACN,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { GtkListView, GtkSignalListItemFactory } from \"@gtkx/jsx/gtk\";\nimport { omit } from \"@gtkx/utils\";\nimport type { ListViewProps } from \"./types.js\";\nimport { ItemPortals, useItemCells, useSectionHeader } from \"./internal/cells.js\";\nimport { useCollection } from \"./internal/use-collection.js\";\n\nconst LIST_VIEW_PROPS = [\n \"items\",\n \"sections\",\n \"renderItem\",\n \"renderHeader\",\n \"selectedIds\",\n \"onSelectionChanged\",\n \"selectionMode\",\n \"expandedIds\",\n \"onExpandedChange\",\n \"expanderDescriptions\",\n \"estimatedItemHeight\",\n \"estimatedItemWidth\",\n] as const satisfies (keyof ListViewProps)[];\n\n/**\n * Renders a Gtk.ListView from declarative items or sections, with per-row rendering,\n * controlled selection, controlled tree expansion, and estimated item sizing.\n */\nfunction ListView<T = unknown, S = unknown>(props: ListViewProps<T, S>): ReactNode {\n const { renderItem, renderHeader, expandedIds, expanderDescriptions } = props;\n const { estimatedItemHeight, estimatedItemWidth } = props;\n const rest = omit(props, LIST_VIEW_PROPS);\n const size = { width: estimatedItemWidth ?? -1, height: estimatedItemHeight ?? -1 };\n const { collection, selection } = useCollection(props);\n const itemCells = useItemCells(size);\n const header = useSectionHeader(renderHeader, collection, size);\n\n return (\n <>\n <GtkListView\n model={selection}\n factory={<GtkSignalListItemFactory {...itemCells.handlers} />}\n {...header.factoryProps}\n {...rest}\n />\n <ItemPortals\n registry={itemCells}\n render={renderItem}\n collection={collection}\n expandedIds={expandedIds}\n expanderDescriptions={expanderDescriptions}\n />\n {header.portals}\n </>\n );\n}\n\nexport { ListView };\n"]}
package/dist/types.d.ts CHANGED
@@ -6,18 +6,18 @@ import type { ReactNode } from "react";
6
6
  * arbitrary value. Nested items form a tree.
7
7
  */
8
8
  type ListItem<T = unknown> = {
9
- /** Stable identifier used to track the item across updates and selection. */
9
+ /** Stable identifier used to track the item across updates and selection, naming every row that carries it. */
10
10
  id: string;
11
11
  /** Payload handed to the cell renderer as `ListItemRenderArgs.item`. */
12
12
  value: T;
13
13
  /** Child items nested under this one, which turn a plain item list into a tree. */
14
14
  children?: ListItem<T>[] | undefined;
15
- /** Hides the tree expander arrow even when the item has children. */
16
- hideExpander?: boolean | undefined;
17
- /** Adds indentation matching the item's depth in the tree. */
18
- indentForDepth?: boolean | undefined;
19
- /** Reserves indentation space for an expander icon. */
20
- indentForIcon?: boolean | undefined;
15
+ /** Hides the tree expander arrow even when the item has children, through `hide-expander`. */
16
+ shouldHideExpander?: boolean | undefined;
17
+ /** Adds indentation matching the item's depth in the tree, through `indent-for-depth`. */
18
+ shouldIndentForDepth?: boolean | undefined;
19
+ /** Reserves indentation space for an expander icon, through `indent-for-icon`. */
20
+ shouldIndentForIcon?: boolean | undefined;
21
21
  };
22
22
  /** A group of items rendered under a shared section header. */
23
23
  type ListSection<S = unknown, T = unknown> = {
@@ -39,6 +39,23 @@ type ListItemRenderArgs<T> = {
39
39
  /** Whether the item is currently expanded in a tree view. */
40
40
  isExpanded?: boolean | undefined;
41
41
  };
42
+ /**
43
+ * Properties applied to the row that carries one item's cells. A Gtk.ColumnViewRow is not a widget, so
44
+ * these are the only handles it offers; anything omitted falls back to the row's own default, which
45
+ * leaves the accessibility strings unset rather than setting them to an empty string.
46
+ */
47
+ type ListRowProps = {
48
+ /** Name a screen reader announces for the row, through `accessible-label`. */
49
+ accessibleLabel?: string | undefined;
50
+ /** Longer description a screen reader announces for the row, through `accessible-description`. */
51
+ accessibleDescription?: string | undefined;
52
+ /** Whether activating the row emits the view's `activate` signal; rows are activatable by default. */
53
+ isActivatable?: boolean | undefined;
54
+ /** Whether the row takes keyboard focus; rows are focusable by default. */
55
+ isFocusable?: boolean | undefined;
56
+ /** Whether clicking or keying the row tries to select it; rows are selectable by default. */
57
+ isSelectable?: boolean | undefined;
58
+ };
42
59
  /** Arguments passed to a {@link ListSectionRenderer} when rendering one section header. */
43
60
  type ListSectionRenderArgs<S> = {
44
61
  /** Value of the `ListSection` whose header is being rendered. */
@@ -48,6 +65,8 @@ type ListSectionRenderArgs<S> = {
48
65
  type ListItemRenderer<T> = (args: ListItemRenderArgs<T>) => ReactNode;
49
66
  /** Renders the contents of one section header of a collection view. */
50
67
  type ListSectionRenderer<S> = (args: ListSectionRenderArgs<S>) => ReactNode;
68
+ /** Returns the {@link ListRowProps} to apply to the row displaying one item, re-run whenever the item renders. */
69
+ type ListRowPropsResolver<T> = (args: ListItemRenderArgs<T>) => ListRowProps;
51
70
  /** Size a collection view requests for each cell before its contents render, keeping scroll estimates steady. */
52
71
  type ItemSizeProps = {
53
72
  /** Height in pixels every cell asks for until its contents render; unset lets each cell size itself. */
@@ -57,19 +76,53 @@ type ItemSizeProps = {
57
76
  };
58
77
  /** Controlled selection shared by the multi-item collection views. */
59
78
  type SelectionProps = {
60
- /** Ids of the items to keep selected; omitting it leaves the view's own selection alone. */
79
+ /**
80
+ * Ids of the items to keep selected; omitting it keeps nothing selected, and `onSelectionChanged` is how a
81
+ * user's selection is adopted into it. An id repeated in several branches of a tree names every matching row,
82
+ * and a single-selection view takes the first of them.
83
+ */
61
84
  selectedIds?: string[] | null | undefined;
62
- /** Called with the ids of every selected item whenever the selection changes, and once on mount. */
85
+ /** Called with one id per selected row whenever the selection changes, and once on mount. */
63
86
  onSelectionChanged?: ((ids: string[]) => void) | null | undefined;
64
87
  /** How much the user may select, one item at a time unless `MULTIPLE` or `NONE` is given. */
65
88
  selectionMode?: Gtk.SelectionMode | null | undefined;
66
89
  };
90
+ /**
91
+ * Wording a screen reader announces for the control that expands and collapses a row. GTK names that control
92
+ * after the row's own content and reports whether it is expanded, but says nothing about what activating it
93
+ * does, so these strings supply that and belong in the application's own language.
94
+ */
95
+ type ExpanderDescriptions = {
96
+ /** Announced while the row is collapsed, such as "Expand". */
97
+ expand: string;
98
+ /** Announced while the row is expanded, such as "Collapse". */
99
+ collapse: string;
100
+ };
67
101
  /** Controlled expansion for the views that turn nested `ListItem.children` into a tree. */
68
102
  type ExpansionProps = {
69
- /** Ids of the items to keep expanded; omitting it leaves the rows' own expanded state alone. */
103
+ /**
104
+ * Ids of the items to keep expanded; omitting it keeps every row collapsed, and `onExpandedChange` is how a
105
+ * user's expansion is adopted into it. An id repeated in several branches names every matching row, so all of
106
+ * them expand together.
107
+ */
70
108
  expandedIds?: string[] | null | undefined;
71
- /** Called with the ids of every expanded row whenever expansion changes. */
109
+ /** Called with one id per expanded row, in visible order, whenever expansion changes. */
72
110
  onExpandedChange?: ((ids: string[]) => void) | null | undefined;
111
+ /**
112
+ * Wording announced for the expander of every row that can expand, describing what activating it does.
113
+ * Omitting it leaves those expanders described only by the row they carry, and rows that cannot expand or
114
+ * that hide their expander are never described.
115
+ */
116
+ expanderDescriptions?: ExpanderDescriptions | null | undefined;
117
+ };
118
+ /** Controlled sorting for the views whose headers can sort the collection. */
119
+ type SortProps = {
120
+ /** Id of the column the view is sorted by, making sorting controlled. */
121
+ sortColumn?: string | null | undefined;
122
+ /** Direction `sortColumn` is sorted in, defaulting to ascending. */
123
+ sortOrder?: Gtk.SortType | null | undefined;
124
+ /** Called when the user sorts from a header, with the primary column's id, or null, and its order. */
125
+ onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;
73
126
  };
74
127
  /** The data a collection view renders, either as a plain item list or grouped into sections. */
75
128
  type SourceProps<T, S> = {
@@ -92,25 +145,21 @@ type ColumnViewColumn<T = unknown> = Omit<GtkColumnViewColumnProps, "factory" |
92
145
  headerMenu?: ReactNode;
93
146
  };
94
147
  /** The declarative collection props {@link ColumnView} adds on top of Gtk.ColumnView's own. */
95
- type ColumnViewOwnProps<T, S> = SelectionProps & ExpansionProps & SourceProps<T, S> & Omit<ItemSizeProps, "estimatedItemWidth"> & {
148
+ type ColumnViewOwnProps<T, S> = SelectionProps & ExpansionProps & SortProps & SourceProps<T, S> & Omit<ItemSizeProps, "estimatedItemWidth"> & {
96
149
  /** Columns to render, in order; each carries its own cell renderer. */
97
150
  columns: ColumnViewColumn<T>[];
98
151
  /** Renders the header shown above each section. */
99
152
  renderHeader?: ListSectionRenderer<S> | null | undefined;
100
- /** Id of the column the view is sorted by, making sorting controlled. */
101
- sortColumn?: string | null | undefined;
102
- /** Direction `sortColumn` is sorted in, defaulting to ascending. */
103
- sortOrder?: Gtk.SortType | null | undefined;
104
- /** Called when the user sorts from a header, with the primary column's id, or null, and its order. */
105
- onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;
153
+ /** Resolves the props of the row carrying one item's cells, such as its screen-reader label. */
154
+ rowProps?: ListRowPropsResolver<T> | null | undefined;
106
155
  };
107
156
  /**
108
157
  * Props for {@link ColumnView}. Combines the underlying Gtk.ColumnView props with
109
158
  * declarative collection props: flat items or grouped sections, controlled selection
110
159
  * and expansion, sorting (sortColumn, sortOrder, onSortChanged), an optional section
111
- * header renderer, and the columns to render.
160
+ * header renderer, per-row props, and the columns to render.
112
161
  */
113
- type ColumnViewProps<T = unknown, S = unknown> = Omit<GtkColumnViewProps, "columns" | "model" | "headerFactory" | keyof ColumnViewOwnProps<T, S>> & ColumnViewOwnProps<T, S>;
162
+ type ColumnViewProps<T = unknown, S = unknown> = Omit<GtkColumnViewProps, "columns" | "model" | "headerFactory" | "rowFactory" | keyof ColumnViewOwnProps<T, S>> & ColumnViewOwnProps<T, S>;
114
163
  /** The declarative collection props {@link DropDown} and `ComboRow` add on top of their widget's own. */
115
164
  type DropDownOwnProps<T, S> = SourceProps<T, S> & {
116
165
  /** Id of the currently selected item, making the selection controlled. */
@@ -159,5 +208,5 @@ type ListViewOwnProps<T, S> = ItemSizeProps & SelectionProps & ExpansionProps &
159
208
  * estimated item sizing.
160
209
  */
161
210
  type ListViewProps<T = unknown, S = unknown> = Omit<GtkListViewProps, "model" | "factory" | "headerFactory" | keyof ListViewOwnProps<T, S>> & ListViewOwnProps<T, S>;
162
- export { type SelectionProps, type ExpansionProps, type DropDownOwnProps, type DropDownWidgetProps, type ListItem, type ListSection, type ListItemRenderArgs, type ListSectionRenderArgs, type ListItemRenderer, type ListSectionRenderer, type ColumnViewColumn, type ColumnViewProps, type DropDownProps, type GridViewProps, type ListViewProps, };
211
+ export { type SelectionProps, type ExpanderDescriptions, type ExpansionProps, type SortProps, type DropDownOwnProps, type DropDownWidgetProps, type ListItem, type ListSection, type ListItemRenderArgs, type ListRowProps, type ListSectionRenderArgs, type ListItemRenderer, type ListRowPropsResolver, type ListSectionRenderer, type ColumnViewColumn, type ColumnViewProps, type DropDownProps, type GridViewProps, type ListViewProps, };
163
212
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EACR,wBAAwB,EACxB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;GAGG;AACH,KAAK,QAAQ,CAAC,CAAC,GAAG,OAAO,IAAI;IACzB,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CA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F,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,aAAa,GACvC,cAAc,GACd,cAAc,GACd,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAChB,uCAAuC;IACvC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAChC,mDAAmD;IACnD,YAAY,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5D,CAAC;AAEN;;;;;GAKG;AACH,KAAK,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI,IAAI,CAC/C,gBAAgB,EAChB,OAAO,GAAG,SAAS,GAAG,eAAe,GAAG,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CACvE,GACD,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEvB,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,GACrB,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA+MA,OAAO,EAgBN,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n GtkColumnViewColumnProps,\n GtkColumnViewProps,\n GtkDropDownProps,\n GtkGridViewProps,\n GtkListViewProps,\n} from \"@gtkx/jsx/gtk\";\nimport type { ReactNode } from \"react\";\n\n/**\n * A single item in a collection model, identified by a stable id and holding an\n * arbitrary value. Nested items form a tree.\n */\ntype ListItem<T = unknown> = {\n /** Stable identifier used to track the item across updates and selection. */\n id: string;\n /** Payload handed to the cell renderer as `ListItemRenderArgs.item`. */\n value: T;\n /** Child items nested under this one, which turn a plain item list into a tree. */\n children?: ListItem<T>[] | undefined;\n /** Hides the tree expander arrow even when the item has children. */\n hideExpander?: boolean | undefined;\n /** Adds indentation matching the item's depth in the tree. */\n indentForDepth?: boolean | undefined;\n /** Reserves indentation space for an expander icon. */\n indentForIcon?: boolean | undefined;\n};\n\n/** A group of items rendered under a shared section header. */\ntype ListSection<S = unknown, T = unknown> = {\n /** Stable identifier used to track the section across updates. */\n id: string;\n /** Payload handed to the section header renderer as `ListSectionRenderArgs.section`. */\n value: S;\n /** Items belonging to this section. */\n data: ListItem<T>[];\n};\n\n/** Arguments passed to a {@link ListItemRenderer} when rendering one cell. */\ntype ListItemRenderArgs<T> = {\n /** Value of the `ListItem` being rendered. */\n item: T;\n /** Position of the item in the flattened item list, which excludes section headers and collapsed tree rows. */\n index: number;\n /** Depth of the item within a tree, starting at zero for top-level items. */\n depth?: number | undefined;\n /** Whether the item is currently expanded in a tree view. */\n isExpanded?: boolean | undefined;\n};\n\n/** Arguments passed to a {@link ListSectionRenderer} when rendering one section header. */\ntype ListSectionRenderArgs<S> = {\n /** Value of the `ListSection` whose header is being rendered. */\n section: S;\n};\n\n/** Renders the contents of one cell of a collection view. */\ntype ListItemRenderer<T> = (args: ListItemRenderArgs<T>) => ReactNode;\n/** Renders the contents of one section header of a collection view. */\ntype ListSectionRenderer<S> = (args: ListSectionRenderArgs<S>) => ReactNode;\n\n/** Size a collection view requests for each cell before its contents render, keeping scroll estimates steady. */\ntype ItemSizeProps = {\n /** Height in pixels every cell asks for until its contents render; unset lets each cell size itself. */\n estimatedItemHeight?: number | undefined;\n /** Width in pixels every cell asks for until its contents render; unset lets each cell size itself. */\n estimatedItemWidth?: number | undefined;\n};\n\n/** Controlled selection shared by the multi-item collection views. */\ntype SelectionProps = {\n /** Ids of the items to keep selected; omitting it leaves the view's own selection alone. */\n selectedIds?: string[] | null | undefined;\n /** Called with the ids of every selected item whenever the selection changes, and once on mount. */\n onSelectionChanged?: ((ids: string[]) => void) | null | undefined;\n /** How much the user may select, one item at a time unless `MULTIPLE` or `NONE` is given. */\n selectionMode?: Gtk.SelectionMode | null | undefined;\n};\n\n/** Controlled expansion for the views that turn nested `ListItem.children` into a tree. */\ntype ExpansionProps = {\n /** Ids of the items to keep expanded; omitting it leaves the rows' own expanded state alone. */\n expandedIds?: string[] | null | undefined;\n /** Called with the ids of every expanded row whenever expansion changes. */\n onExpandedChange?: ((ids: string[]) => void) | null | undefined;\n};\n\n/** The data a collection view renders, either as a plain item list or grouped into sections. */\ntype SourceProps<T, S> = {\n /** Items to render, nesting through `ListItem.children` for a tree; ignored once `sections` is given. */\n items?: ListItem<T>[] | undefined;\n /** Items grouped under section headers, rendered in place of `items`. */\n sections?: ListSection<S, T>[] | undefined;\n};\n\n/** One column of a {@link ColumnView}, pairing Gtk.ColumnViewColumn props with a cell renderer. */\ntype ColumnViewColumn<T = unknown> = Omit<GtkColumnViewColumnProps, \"factory\" | \"sorter\" | \"id\" | \"title\"> & {\n /** Stable identifier, also used to address the column through sorting props. */\n id: string;\n /** Text shown in the column header. */\n title: string;\n /** Renders the contents of this column's cell for one item. */\n renderCell: ListItemRenderer<T>;\n /** Makes the column header clickable, reporting the choice through `onSortChanged`. */\n isSortable?: boolean | undefined;\n /** Menu element popped up as the column header's context menu, on a right-click. */\n headerMenu?: ReactNode;\n};\n\n/** The declarative collection props {@link ColumnView} adds on top of Gtk.ColumnView's own. */\ntype ColumnViewOwnProps<T, S> = SelectionProps &\n ExpansionProps &\n SourceProps<T, S> &\n Omit<ItemSizeProps, \"estimatedItemWidth\"> & {\n /** Columns to render, in order; each carries its own cell renderer. */\n columns: ColumnViewColumn<T>[];\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n /** Id of the column the view is sorted by, making sorting controlled. */\n sortColumn?: string | null | undefined;\n /** Direction `sortColumn` is sorted in, defaulting to ascending. */\n sortOrder?: Gtk.SortType | null | undefined;\n /** Called when the user sorts from a header, with the primary column's id, or null, and its order. */\n onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;\n };\n\n/**\n * Props for {@link ColumnView}. Combines the underlying Gtk.ColumnView props with\n * declarative collection props: flat items or grouped sections, controlled selection\n * and expansion, sorting (sortColumn, sortOrder, onSortChanged), an optional section\n * header renderer, and the columns to render.\n */\ntype ColumnViewProps<T = unknown, S = unknown> = Omit<\n GtkColumnViewProps,\n \"columns\" | \"model\" | \"headerFactory\" | keyof ColumnViewOwnProps<T, S>\n> &\nColumnViewOwnProps<T, S>;\n\n/** The declarative collection props {@link DropDown} and `ComboRow` add on top of their widget's own. */\ntype DropDownOwnProps<T, S> = SourceProps<T, S> & {\n /** Id of the currently selected item, making the selection controlled. */\n selectedId?: string | null | undefined;\n /** Called with the id of the item that became selected. */\n onSelectionChanged?: ((id: string) => void) | null | undefined;\n /** Renders the collapsed display, and the popup rows too unless `renderListItem` is given. */\n renderItem?: ListItemRenderer<T> | null | undefined;\n /** Renderer for items in the open popup list, falling back to renderItem when omitted. */\n renderListItem?: ListItemRenderer<T> | null | undefined;\n /** Renderer for section headers in the popup list. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n};\n\n/** A drop-down-shaped widget's props with its model and factories swapped for the declarative collection props. */\ntype DropDownWidgetProps<Widget, T, S> = Omit<\n Widget,\n \"model\" | \"factory\" | \"listFactory\" | \"headerFactory\" | keyof DropDownOwnProps<T, S>\n> &\nDropDownOwnProps<T, S>;\n\n/**\n * Props for {@link DropDown}. Combines the underlying Gtk.DropDown props with the declarative\n * collection props: flat items or grouped sections, controlled single selection, and renderers\n * for the collapsed display, popup rows, and popup section headers.\n */\ntype DropDownProps<T = unknown, S = unknown> = DropDownWidgetProps<GtkDropDownProps, T, S>;\n\n/** The declarative collection props {@link GridView} adds on top of Gtk.GridView's own. */\ntype GridViewOwnProps<T> = ItemSizeProps &\n SelectionProps & {\n /** Items to render as cells; a grid is always flat, so `ListItem.children` is ignored. */\n items?: ListItem<T>[] | undefined;\n /** Renders the contents of one cell. */\n renderItem: ListItemRenderer<T>;\n };\n\n/**\n * Props for {@link GridView}. Combines the underlying Gtk.GridView props with\n * declarative collection props: items, a per-cell renderItem, controlled selection,\n * and estimated item sizing.\n */\ntype GridViewProps<T = unknown> = Omit<GtkGridViewProps, \"model\" | \"factory\" | keyof GridViewOwnProps<T>> &\n GridViewOwnProps<T>;\n\n/** The declarative collection props {@link ListView} adds on top of Gtk.ListView's own. */\ntype ListViewOwnProps<T, S> = ItemSizeProps &\n SelectionProps &\n ExpansionProps &\n SourceProps<T, S> & {\n /** Renders the contents of one row. */\n renderItem: ListItemRenderer<T>;\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n };\n\n/**\n * Props for {@link ListView}. Combines the underlying Gtk.ListView props with\n * declarative collection props: flat items or grouped sections, a per-row renderItem,\n * an optional section header renderer, controlled selection and expansion, and\n * estimated item sizing.\n */\ntype ListViewProps<T = unknown, S = unknown> = Omit<\n GtkListViewProps,\n \"model\" | \"factory\" | \"headerFactory\" | keyof ListViewOwnProps<T, S>\n> &\nListViewOwnProps<T, S>;\n\nexport {\n type SelectionProps,\n type ExpansionProps,\n type DropDownOwnProps,\n type DropDownWidgetProps,\n type ListItem,\n type ListSection,\n type ListItemRenderArgs,\n type ListSectionRenderArgs,\n type ListItemRenderer,\n type ListSectionRenderer,\n type ColumnViewColumn,\n type ColumnViewProps,\n type DropDownProps,\n type GridViewProps,\n type ListViewProps,\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoQA,OAAO,EAoBN,CAAC","sourcesContent":["import type * as Gtk from \"@gtkx/gi/gtk\";\nimport type {\n GtkColumnViewColumnProps,\n GtkColumnViewProps,\n GtkDropDownProps,\n GtkGridViewProps,\n GtkListViewProps,\n} from \"@gtkx/jsx/gtk\";\nimport type { ReactNode } from \"react\";\n\n/**\n * A single item in a collection model, identified by a stable id and holding an\n * arbitrary value. Nested items form a tree.\n */\ntype ListItem<T = unknown> = {\n /** Stable identifier used to track the item across updates and selection, naming every row that carries it. */\n id: string;\n /** Payload handed to the cell renderer as `ListItemRenderArgs.item`. */\n value: T;\n /** Child items nested under this one, which turn a plain item list into a tree. */\n children?: ListItem<T>[] | undefined;\n /** Hides the tree expander arrow even when the item has children, through `hide-expander`. */\n shouldHideExpander?: boolean | undefined;\n /** Adds indentation matching the item's depth in the tree, through `indent-for-depth`. */\n shouldIndentForDepth?: boolean | undefined;\n /** Reserves indentation space for an expander icon, through `indent-for-icon`. */\n shouldIndentForIcon?: boolean | undefined;\n};\n\n/** A group of items rendered under a shared section header. */\ntype ListSection<S = unknown, T = unknown> = {\n /** Stable identifier used to track the section across updates. */\n id: string;\n /** Payload handed to the section header renderer as `ListSectionRenderArgs.section`. */\n value: S;\n /** Items belonging to this section. */\n data: ListItem<T>[];\n};\n\n/** Arguments passed to a {@link ListItemRenderer} when rendering one cell. */\ntype ListItemRenderArgs<T> = {\n /** Value of the `ListItem` being rendered. */\n item: T;\n /** Position of the item in the flattened item list, which excludes section headers and collapsed tree rows. */\n index: number;\n /** Depth of the item within a tree, starting at zero for top-level items. */\n depth?: number | undefined;\n /** Whether the item is currently expanded in a tree view. */\n isExpanded?: boolean | undefined;\n};\n\n/**\n * Properties applied to the row that carries one item's cells. A Gtk.ColumnViewRow is not a widget, so\n * these are the only handles it offers; anything omitted falls back to the row's own default, which\n * leaves the accessibility strings unset rather than setting them to an empty string.\n */\ntype ListRowProps = {\n /** Name a screen reader announces for the row, through `accessible-label`. */\n accessibleLabel?: string | undefined;\n /** Longer description a screen reader announces for the row, through `accessible-description`. */\n accessibleDescription?: string | undefined;\n /** Whether activating the row emits the view's `activate` signal; rows are activatable by default. */\n isActivatable?: boolean | undefined;\n /** Whether the row takes keyboard focus; rows are focusable by default. */\n isFocusable?: boolean | undefined;\n /** Whether clicking or keying the row tries to select it; rows are selectable by default. */\n isSelectable?: boolean | undefined;\n};\n\n/** Arguments passed to a {@link ListSectionRenderer} when rendering one section header. */\ntype ListSectionRenderArgs<S> = {\n /** Value of the `ListSection` whose header is being rendered. */\n section: S;\n};\n\n/** Renders the contents of one cell of a collection view. */\ntype ListItemRenderer<T> = (args: ListItemRenderArgs<T>) => ReactNode;\n/** Renders the contents of one section header of a collection view. */\ntype ListSectionRenderer<S> = (args: ListSectionRenderArgs<S>) => ReactNode;\n/** Returns the {@link ListRowProps} to apply to the row displaying one item, re-run whenever the item renders. */\ntype ListRowPropsResolver<T> = (args: ListItemRenderArgs<T>) => ListRowProps;\n\n/** Size a collection view requests for each cell before its contents render, keeping scroll estimates steady. */\ntype ItemSizeProps = {\n /** Height in pixels every cell asks for until its contents render; unset lets each cell size itself. */\n estimatedItemHeight?: number | undefined;\n /** Width in pixels every cell asks for until its contents render; unset lets each cell size itself. */\n estimatedItemWidth?: number | undefined;\n};\n\n/** Controlled selection shared by the multi-item collection views. */\ntype SelectionProps = {\n /**\n * Ids of the items to keep selected; omitting it keeps nothing selected, and `onSelectionChanged` is how a\n * user's selection is adopted into it. An id repeated in several branches of a tree names every matching row,\n * and a single-selection view takes the first of them.\n */\n selectedIds?: string[] | null | undefined;\n /** Called with one id per selected row whenever the selection changes, and once on mount. */\n onSelectionChanged?: ((ids: string[]) => void) | null | undefined;\n /** How much the user may select, one item at a time unless `MULTIPLE` or `NONE` is given. */\n selectionMode?: Gtk.SelectionMode | null | undefined;\n};\n\n/**\n * Wording a screen reader announces for the control that expands and collapses a row. GTK names that control\n * after the row's own content and reports whether it is expanded, but says nothing about what activating it\n * does, so these strings supply that and belong in the application's own language.\n */\ntype ExpanderDescriptions = {\n /** Announced while the row is collapsed, such as \"Expand\". */\n expand: string;\n /** Announced while the row is expanded, such as \"Collapse\". */\n collapse: string;\n};\n\n/** Controlled expansion for the views that turn nested `ListItem.children` into a tree. */\ntype ExpansionProps = {\n /**\n * Ids of the items to keep expanded; omitting it keeps every row collapsed, and `onExpandedChange` is how a\n * user's expansion is adopted into it. An id repeated in several branches names every matching row, so all of\n * them expand together.\n */\n expandedIds?: string[] | null | undefined;\n /** Called with one id per expanded row, in visible order, whenever expansion changes. */\n onExpandedChange?: ((ids: string[]) => void) | null | undefined;\n /**\n * Wording announced for the expander of every row that can expand, describing what activating it does.\n * Omitting it leaves those expanders described only by the row they carry, and rows that cannot expand or\n * that hide their expander are never described.\n */\n expanderDescriptions?: ExpanderDescriptions | null | undefined;\n};\n\n/** Controlled sorting for the views whose headers can sort the collection. */\ntype SortProps = {\n /** Id of the column the view is sorted by, making sorting controlled. */\n sortColumn?: string | null | undefined;\n /** Direction `sortColumn` is sorted in, defaulting to ascending. */\n sortOrder?: Gtk.SortType | null | undefined;\n /** Called when the user sorts from a header, with the primary column's id, or null, and its order. */\n onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;\n};\n\n/** The data a collection view renders, either as a plain item list or grouped into sections. */\ntype SourceProps<T, S> = {\n /** Items to render, nesting through `ListItem.children` for a tree; ignored once `sections` is given. */\n items?: ListItem<T>[] | undefined;\n /** Items grouped under section headers, rendered in place of `items`. */\n sections?: ListSection<S, T>[] | undefined;\n};\n\n/** One column of a {@link ColumnView}, pairing Gtk.ColumnViewColumn props with a cell renderer. */\ntype ColumnViewColumn<T = unknown> = Omit<GtkColumnViewColumnProps, \"factory\" | \"sorter\" | \"id\" | \"title\"> & {\n /** Stable identifier, also used to address the column through sorting props. */\n id: string;\n /** Text shown in the column header. */\n title: string;\n /** Renders the contents of this column's cell for one item. */\n renderCell: ListItemRenderer<T>;\n /** Makes the column header clickable, reporting the choice through `onSortChanged`. */\n isSortable?: boolean | undefined;\n /** Menu element popped up as the column header's context menu, on a right-click. */\n headerMenu?: ReactNode;\n};\n\n/** The declarative collection props {@link ColumnView} adds on top of Gtk.ColumnView's own. */\ntype ColumnViewOwnProps<T, S> = SelectionProps &\n ExpansionProps &\n SortProps &\n SourceProps<T, S> &\n Omit<ItemSizeProps, \"estimatedItemWidth\"> & {\n /** Columns to render, in order; each carries its own cell renderer. */\n columns: ColumnViewColumn<T>[];\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n /** Resolves the props of the row carrying one item's cells, such as its screen-reader label. */\n rowProps?: ListRowPropsResolver<T> | null | undefined;\n };\n\n/**\n * Props for {@link ColumnView}. Combines the underlying Gtk.ColumnView props with\n * declarative collection props: flat items or grouped sections, controlled selection\n * and expansion, sorting (sortColumn, sortOrder, onSortChanged), an optional section\n * header renderer, per-row props, and the columns to render.\n */\ntype ColumnViewProps<T = unknown, S = unknown> = Omit<\n GtkColumnViewProps,\n \"columns\" | \"model\" | \"headerFactory\" | \"rowFactory\" | keyof ColumnViewOwnProps<T, S>\n> &\nColumnViewOwnProps<T, S>;\n\n/** The declarative collection props {@link DropDown} and `ComboRow` add on top of their widget's own. */\ntype DropDownOwnProps<T, S> = SourceProps<T, S> & {\n /** Id of the currently selected item, making the selection controlled. */\n selectedId?: string | null | undefined;\n /** Called with the id of the item that became selected. */\n onSelectionChanged?: ((id: string) => void) | null | undefined;\n /** Renders the collapsed display, and the popup rows too unless `renderListItem` is given. */\n renderItem?: ListItemRenderer<T> | null | undefined;\n /** Renderer for items in the open popup list, falling back to renderItem when omitted. */\n renderListItem?: ListItemRenderer<T> | null | undefined;\n /** Renderer for section headers in the popup list. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n};\n\n/** A drop-down-shaped widget's props with its model and factories swapped for the declarative collection props. */\ntype DropDownWidgetProps<Widget, T, S> = Omit<\n Widget,\n \"model\" | \"factory\" | \"listFactory\" | \"headerFactory\" | keyof DropDownOwnProps<T, S>\n> &\nDropDownOwnProps<T, S>;\n\n/**\n * Props for {@link DropDown}. Combines the underlying Gtk.DropDown props with the declarative\n * collection props: flat items or grouped sections, controlled single selection, and renderers\n * for the collapsed display, popup rows, and popup section headers.\n */\ntype DropDownProps<T = unknown, S = unknown> = DropDownWidgetProps<GtkDropDownProps, T, S>;\n\n/** The declarative collection props {@link GridView} adds on top of Gtk.GridView's own. */\ntype GridViewOwnProps<T> = ItemSizeProps &\n SelectionProps & {\n /** Items to render as cells; a grid is always flat, so `ListItem.children` is ignored. */\n items?: ListItem<T>[] | undefined;\n /** Renders the contents of one cell. */\n renderItem: ListItemRenderer<T>;\n };\n\n/**\n * Props for {@link GridView}. Combines the underlying Gtk.GridView props with\n * declarative collection props: items, a per-cell renderItem, controlled selection,\n * and estimated item sizing.\n */\ntype GridViewProps<T = unknown> = Omit<GtkGridViewProps, \"model\" | \"factory\" | keyof GridViewOwnProps<T>> &\n GridViewOwnProps<T>;\n\n/** The declarative collection props {@link ListView} adds on top of Gtk.ListView's own. */\ntype ListViewOwnProps<T, S> = ItemSizeProps &\n SelectionProps &\n ExpansionProps &\n SourceProps<T, S> & {\n /** Renders the contents of one row. */\n renderItem: ListItemRenderer<T>;\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n };\n\n/**\n * Props for {@link ListView}. Combines the underlying Gtk.ListView props with\n * declarative collection props: flat items or grouped sections, a per-row renderItem,\n * an optional section header renderer, controlled selection and expansion, and\n * estimated item sizing.\n */\ntype ListViewProps<T = unknown, S = unknown> = Omit<\n GtkListViewProps,\n \"model\" | \"factory\" | \"headerFactory\" | keyof ListViewOwnProps<T, S>\n> &\nListViewOwnProps<T, S>;\n\nexport {\n type SelectionProps,\n type ExpanderDescriptions,\n type ExpansionProps,\n type SortProps,\n type DropDownOwnProps,\n type DropDownWidgetProps,\n type ListItem,\n type ListSection,\n type ListItemRenderArgs,\n type ListRowProps,\n type ListSectionRenderArgs,\n type ListItemRenderer,\n type ListRowPropsResolver,\n type ListSectionRenderer,\n type ColumnViewColumn,\n type ColumnViewProps,\n type DropDownProps,\n type GridViewProps,\n type ListViewProps,\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/components",
3
- "version": "1.0.0-rc.4",
3
+ "version": "1.0.0",
4
4
  "description": "High-level GTKX components for declarative collection views, menus, and containers with attach-time placement",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -44,8 +44,9 @@
44
44
  "node": ">=24"
45
45
  },
46
46
  "dependencies": {
47
- "@gtkx/react": "1.0.0-rc.4",
48
- "@gtkx/utils": "1.0.0-rc.4"
47
+ "@gtkx/react": "1.0.0",
48
+ "@gtkx/utils": "1.0.0",
49
+ "@gtkx/runtime": "1.0.0"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "react": "^19.2"
@@ -53,10 +54,9 @@
53
54
  "devDependencies": {
54
55
  "@codspeed/vitest-plugin": "^5.7.1",
55
56
  "vitest": "^4.1.10",
56
- "@gtkx/config": "1.0.0-rc.4",
57
- "@gtkx/runtime": "1.0.0-rc.4",
58
- "@gtkx/testing": "1.0.0-rc.4",
59
- "@gtkx/vitest": "1.0.0-rc.4"
57
+ "@gtkx/config": "1.0.0",
58
+ "@gtkx/testing": "1.0.0",
59
+ "@gtkx/vitest": "1.0.0"
60
60
  },
61
61
  "scripts": {
62
62
  "bench": "NODE_ENV=production vitest bench --run --config vitest.bench.config.ts",
@@ -6,23 +6,18 @@ import { omit } from "@gtkx/utils";
6
6
  import { useLayoutEffect, useRef } from "react";
7
7
  import type { CellSize } from "./internal/cells.js";
8
8
  import type { Collection } from "./internal/collection.js";
9
- import type { ColumnViewColumn, ColumnViewProps } from "./types.js";
10
- import { HeaderPortals, ItemPortals, useHeaderCells, useItemCells } from "./internal/cells.js";
9
+ import type { ColumnViewColumn, ColumnViewProps, ExpanderDescriptions, SortProps } from "./types.js";
10
+ import { ItemPortals, useItemCells, useRowProps, useSectionHeader } from "./internal/cells.js";
11
11
  import { useCollection } from "./internal/use-collection.js";
12
12
  import { useWidgetRef } from "./internal/use-widget-ref.js";
13
13
 
14
- type SortProps = {
15
- sortColumn?: string | null | undefined;
16
- sortOrder?: Gtk.SortType | null | undefined;
17
- onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;
18
- };
19
-
20
14
  type SortTarget = { view: Gtk.ColumnView; column: Gtk.ColumnViewColumn | null };
21
15
 
22
16
  type ColumnCellsProps = {
23
17
  column: ColumnViewColumn<never>;
24
18
  collection: Collection;
25
19
  expandedIds: string[] | null | undefined;
20
+ expanderDescriptions: ExpanderDescriptions | null | undefined;
26
21
  size: CellSize;
27
22
  };
28
23
 
@@ -34,12 +29,14 @@ const COLUMN_VIEW_PROPS = [
34
29
  "items",
35
30
  "sections",
36
31
  "renderHeader",
32
+ "rowProps",
37
33
  "columns",
38
34
  "selectedIds",
39
35
  "onSelectionChanged",
40
36
  "selectionMode",
41
37
  "expandedIds",
42
38
  "onExpandedChange",
39
+ "expanderDescriptions",
43
40
  "sortColumn",
44
41
  "sortOrder",
45
42
  "onSortChanged",
@@ -134,7 +131,7 @@ const useColumnSorting = (view: Gtk.ColumnView | null, sort: SortProps, columns:
134
131
  }, [view, sortColumn, sortOrder, columns]);
135
132
  };
136
133
 
137
- const ColumnCells = ({ column, collection, expandedIds, size }: ColumnCellsProps): ReactNode => {
134
+ const ColumnCells = ({ column, collection, expandedIds, expanderDescriptions, size }: ColumnCellsProps): ReactNode => {
138
135
  const cells = useItemCells(size);
139
136
  const rest = omit(column, ["id", "renderCell", "isSortable"]);
140
137
 
@@ -147,40 +144,42 @@ const ColumnCells = ({ column, collection, expandedIds, size }: ColumnCellsProps
147
144
  {...rest}
148
145
  />
149
146
  <ItemPortals
150
- store={cells}
147
+ registry={cells}
151
148
  render={column.renderCell}
152
149
  collection={collection}
153
150
  expandedIds={expandedIds}
151
+ expanderDescriptions={expanderDescriptions}
154
152
  />
155
153
  </>
156
154
  );
157
155
  };
158
156
 
159
- const ColumnList = ({ columns, collection, expandedIds, size }: ColumnListProps): ReactNode =>
157
+ const ColumnList = ({ columns, collection, expandedIds, expanderDescriptions, size }: ColumnListProps): ReactNode =>
160
158
  columns.map((column) => (
161
159
  <ColumnCells
162
160
  key={column.id}
163
161
  column={column}
164
162
  collection={collection}
165
163
  expandedIds={expandedIds}
164
+ expanderDescriptions={expanderDescriptions}
166
165
  size={size}
167
166
  />
168
167
  ));
169
168
 
170
169
  /**
171
170
  * Renders a Gtk.ColumnView from declarative items or sections and a columns array,
172
- * with controlled selection, expansion, and sorting, per-column header menus, and
173
- * section header rendering.
171
+ * with controlled selection, expansion, and sorting, per-column header menus,
172
+ * section header rendering, and per-row props such as a screen-reader label.
174
173
  */
175
174
  function ColumnView<T = unknown, S = unknown>(props: ColumnViewProps<T, S>): ReactNode {
176
- const { renderHeader, columns, expandedIds, sortColumn, sortOrder, onSortChanged, estimatedItemHeight, ref } =
177
- props;
178
-
175
+ const { renderHeader, rowProps, columns, expandedIds, expanderDescriptions } = props;
176
+ const { sortColumn, sortOrder, onSortChanged, ref } = props;
179
177
  const rest = omit(props, COLUMN_VIEW_PROPS);
178
+ const size = { width: -1, height: props.estimatedItemHeight ?? -1 };
180
179
  const [view, refCallback] = useWidgetRef<Gtk.ColumnView>(ref);
181
- const size = { width: -1, height: estimatedItemHeight ?? -1 };
182
180
  const { collection, selection } = useCollection(props);
183
- const headerCells = useHeaderCells(size);
181
+ const header = useSectionHeader(renderHeader, collection, size);
182
+ const rows = useRowProps(rowProps, collection, expandedIds);
184
183
  const columnList = columns as ColumnViewColumn<never>[];
185
184
  useColumnSorting(view, { sortColumn, sortOrder, onSortChanged }, columnList);
186
185
 
@@ -189,16 +188,20 @@ function ColumnView<T = unknown, S = unknown>(props: ColumnViewProps<T, S>): Rea
189
188
  <GtkColumnView
190
189
  ref={refCallback}
191
190
  model={selection}
192
- {...(renderHeader != null && {
193
- headerFactory: <GtkSignalListItemFactory {...headerCells.handlers} />,
194
- })}
191
+ {...header.factoryProps}
192
+ {...rows.factoryProps}
195
193
  {...rest}
196
194
  >
197
- <ColumnList columns={columnList} collection={collection} expandedIds={expandedIds} size={size} />
195
+ <ColumnList
196
+ columns={columnList}
197
+ collection={collection}
198
+ expandedIds={expandedIds}
199
+ expanderDescriptions={expanderDescriptions}
200
+ size={size}
201
+ />
198
202
  </GtkColumnView>
199
- {renderHeader != null && (
200
- <HeaderPortals store={headerCells} render={renderHeader} collection={collection} />
201
- )}
203
+ {header.portals}
204
+ {rows.portals}
202
205
  </>
203
206
  );
204
207
  }
package/src/grid-view.tsx CHANGED
@@ -29,7 +29,7 @@ function GridView<T = unknown>(props: GridViewProps<T>): ReactNode {
29
29
  return (
30
30
  <>
31
31
  <GtkGridView model={selection} factory={<GtkSignalListItemFactory {...itemCells.handlers} />} {...rest} />
32
- <ItemPortals store={itemCells} render={renderItem} collection={collection} />
32
+ <ItemPortals registry={itemCells} render={renderItem} collection={collection} />
33
33
  </>
34
34
  );
35
35
  }
package/src/index.ts CHANGED
@@ -6,10 +6,13 @@ export type {
6
6
  ColumnViewColumn,
7
7
  ColumnViewProps,
8
8
  DropDownProps,
9
+ ExpanderDescriptions,
9
10
  GridViewProps,
10
11
  ListItem,
11
12
  ListItemRenderArgs,
12
13
  ListItemRenderer,
14
+ ListRowProps,
15
+ ListRowPropsResolver,
13
16
  ListSection,
14
17
  ListSectionRenderArgs,
15
18
  ListSectionRenderer,