@gtkx/components 2.0.0-beta.11 → 2.0.0-beta.12
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.
- package/README.md +4 -4
- package/dist/column-view.js +1 -1
- package/dist/grid-view.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/cells.d.ts +3 -7
- package/dist/internal/cells.d.ts.map +1 -1
- package/dist/internal/cells.js +15 -43
- package/dist/internal/cells.js.map +1 -1
- package/dist/internal/collection-model.d.ts.map +1 -1
- package/dist/internal/drop-down.d.ts.map +1 -1
- package/dist/internal/drop-down.js +1 -1
- package/dist/internal/drop-down.js.map +1 -1
- package/dist/internal/keys.d.ts.map +1 -1
- package/dist/internal/tree-expansion.d.ts +1 -1
- package/dist/internal/tree-expansion.d.ts.map +1 -1
- package/dist/internal/tree-expansion.js +1 -1
- package/dist/internal/tree-expansion.js.map +1 -1
- package/dist/internal/tree-order.d.ts +1 -1
- package/dist/internal/tree-order.d.ts.map +1 -1
- package/dist/internal/tree-order.js +1 -1
- package/dist/internal/tree-order.js.map +1 -1
- package/dist/internal/use-widget-ref.d.ts.map +1 -1
- package/dist/list-item-factory.js +1 -1
- package/dist/list-view.js +1 -1
- package/dist/tab-collection.d.ts +9 -0
- package/dist/tab-collection.d.ts.map +1 -0
- package/dist/tab-collection.js +114 -0
- package/dist/tab-collection.js.map +1 -0
- package/dist/types.d.ts +35 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +10 -20
- package/src/index.ts +4 -0
- package/src/internal/cells.tsx +44 -109
- package/src/internal/drop-down.tsx +1 -5
- package/src/internal/tree-expansion.ts +1 -9
- package/src/internal/tree-order.ts +1 -9
- package/src/tab-collection.tsx +124 -0
- package/src/types.ts +56 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-expansion.js","sourceR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AAC,IAAI,CAAC,CAAC;QACnB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IAED,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AAC3B,CAAC;AAED,SAAS,YAAY,CAAC,SAAwB,EAAE,IAAY,EAAE,UAAmB;IAC7E,IAAI,UAAU,EAAE,CAAC;QACb,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7B,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACjC,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;QAEvB,OAAO;IACX,CAAC;IAED,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,UAAU,CAAC,SAAwB,EAAE,KAAsB;IAChE,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACxB,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;AAC3B,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAsB,CAAC","sourcesContent":["import type { CollectionIndex } from \"./collection-index.js\";\nimport type { SlotMap } from \"./slots.js\";\nimport type { VisibleOrder } from \"./tree-order.js\";\nimport { encodePart } from \"./keys.js\";\nimport { getSlotKey, trackPath, trackPaths } from \"./slots.js\";\nimport { walkVisible } from \"./tree-order.js\";\n\ntype TreeExpansion = {\n index: CollectionIndex;\n expanded: Set<string>;\n slots: SlotMap;\n order: VisibleOrder | null;\n isApplying: boolean;\n isSyncing: boolean;\n};\n\nfunction dropSubtree(expansion: TreeExpansion, path: string): void {\n expansion.expanded.delete(path);\n const level = expansion.slots.get(path);\n\n if (level === undefined) {\n return;\n }\n\n expansion.slots.delete(path);\n\n for (const slot of level) {\n dropSubtree(expansion, path + encodePart(String(slot)));\n }\n}\n\nfunction createTreeExpansion(index: CollectionIndex): TreeExpansion {\n return { index, expanded: new Set(), slots: new Map(), order: null, isApplying: false, isSyncing: false };\n}\n\nfunction orderFor(expansion: TreeExpansion): VisibleOrder {\n expansion.order ??= walkVisible({ index: expansion.index, slots: expansion.slots });\n\n return expansion.order;\n}\n\nfunction adoptOrder(expansion: TreeExpansion, order: VisibleOrder): void {\n expansion.expanded = new Set(order.expandedPaths);\n expansion.slots = trackPaths(order.expandedPaths);\n expansion.order = order;\n}\n\nfunction prunePath(expansion: TreeExpansion, path: string): void {\n const key = getSlotKey(path);\n\n if (key !== null) {\n expansion.slots.get(key.levelPath)?.delete(key.slot);\n }\n\n dropSubtree(expansion, path);\n expansion.order = null;\n}\n\nfunction pruneSlots(expansion: TreeExpansion, levelPath: string, isPruned: (slot: number) => boolean): void {\n const level = expansion.slots.get(levelPath);\n\n if (level === undefined) {\n return;\n }\n\n for (const slot of level) {\n if (!isPruned(slot)) {\n continue;\n }\n\n level.delete(slot);\n dropSubtree(expansion, levelPath + encodePart(String(slot)));\n }\n\n expansion.order = null;\n}\n\nfunction markExpanded(expansion: TreeExpansion, path: string, isExpanded: boolean): void {\n if (isExpanded) {\n expansion.expanded.add(path);\n trackPath(expansion.slots, path);\n expansion.order = null;\n\n return;\n }\n\n prunePath(expansion, path);\n}\n\nfunction adoptIndex(expansion: TreeExpansion, index: CollectionIndex): void {\n expansion.index = index;\n expansion.order = null;\n}\n\nexport { adoptIndex, adoptOrder, createTreeExpansion, markExpanded, orderFor, pruneSlots, type TreeExpansion };\n"]}
|
|
@@ -26,5 +26,5 @@ declare function walkVisible(options: WalkOptions): VisibleOrder;
|
|
|
26
26
|
declare function expandedPathsFor(index: CollectionIndex, ids: Set<string>): Set<string>;
|
|
27
27
|
declare function findRows(index: CollectionIndex, slots: SlotMap, ids: Set<string>): MatchedRows;
|
|
28
28
|
declare function findIds(index: CollectionIndex, slots: SlotMap, positions: Set<number>): string[];
|
|
29
|
-
export { expandedPathsFor, findIds, findRows, walkVisible, type MatchedRows, type VisibleOrder, type WalkOptions
|
|
29
|
+
export { expandedPathsFor, findIds, findRows, walkVisible, type MatchedRows, type VisibleOrder, type WalkOptions };
|
|
30
30
|
//# sourceMappingURL=tree-order.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-order.d.ts","sourceRoot":"","sources":["../../src/internal/tree-order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAS,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,KAAK,UAAU,GAAG;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,YAAY,GAAG;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,WAAW,GAAG;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;AAE5C,KAAK,WAAW,GAAG;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAClC,CAAC;AA8BF,iBAAS,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,YAAY,CAQvD;AAiBD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,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K,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC;KACJ,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAyD,CAAC","sourcesContent":["import type { ListItem } from \"../types.js\";\nimport type { CollectionIndex, Level } from \"./collection-index.js\";\nimport type { SlotMap } from \"./slots.js\";\n\ntype VisibleRow = {\n item: ListItem;\n position: number;\n isOpen: boolean;\n isMarked: boolean;\n};\n\ntype VisibleOrder = {\n expandedPaths: string[];\n expandedIds: string[];\n};\n\ntype MatchedRows = {\n positions: number[];\n ids: string[];\n};\n\ntype RowVisitor = (row: VisibleRow) => void;\n\ntype WalkOptions = {\n index: CollectionIndex;\n slots: SlotMap;\n marks?: SlotMap | undefined;\n visit?: RowVisitor | undefined;\n};\n\ntype WalkState = {\n position: number;\n order: VisibleOrder;\n};\n\nfunction walkLevel(options: WalkOptions, level: Level, state: WalkState): void {\n const open = options.slots.get(level.path);\n const marked = options.marks?.get(level.path);\n\n for (const [slot, item] of level.items.entries()) {\n const isOpen = open?.has(slot) ?? false;\n options.visit?.({ item, position: state.position, isOpen, isMarked: marked?.has(slot) ?? false });\n state.position += 1;\n\n if (!isOpen) {\n continue;\n }\n\n const child = options.index.childLevel(level, slot);\n\n if (child !== undefined) {\n state.order.expandedPaths.push(child.path);\n state.order.expandedIds.push(item.id);\n walkLevel(options, child, state);\n }\n }\n}\n\nfunction walkVisible(options: WalkOptions): VisibleOrder {\n const state: WalkState = { position: 0, order: { expandedPaths: [], expandedIds: [] } };\n\n for (const level of options.index.groups) {\n walkLevel(options, level, state);\n }\n\n return state.order;\n}\n\nfunction expandLevel(index: CollectionIndex, level: Level, ids: Set<string>, paths: Set<string>): void {\n for (const [slot, item] of level.items.entries()) {\n if (!ids.has(item.id)) {\n continue;\n }\n\n const child = index.childLevel(level, slot);\n\n if (child !== undefined) {\n paths.add(child.path);\n expandLevel(index, child, ids, paths);\n }\n }\n}\n\nfunction expandedPathsFor(index: CollectionIndex, ids: Set<string>): Set<string> {\n const paths: Set<string> = new Set();\n\n if (ids.size === 0 || !index.isTree) {\n return paths;\n }\n\n for (const level of index.groups) {\n expandLevel(index, level, ids, paths);\n }\n\n return paths;\n}\n\nfunction findRows(index: CollectionIndex, slots: SlotMap, ids: Set<string>): MatchedRows {\n const positions: number[] = [];\n const found: string[] = [];\n\n walkVisible({\n index,\n slots,\n visit: (row) => {\n if (!ids.has(row.item.id)) {\n return;\n }\n\n positions.push(row.position);\n found.push(row.item.id);\n },\n });\n\n return { positions, ids: found };\n}\n\nfunction findIds(index: CollectionIndex, slots: SlotMap, positions: Set<number>): string[] {\n const found: string[] = [];\n\n walkVisible({\n index,\n slots,\n visit: (row) => {\n if (!positions.has(row.position)) {\n return;\n }\n\n found.push(row.item.id);\n },\n });\n\n return found;\n}\n\nexport { expandedPathsFor, findIds, findRows, walkVisible, type MatchedRows, type VisibleOrder, type WalkOptions };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-widget-ref.d.ts","sourceRoot":"","sources":["../../src/internal/use-widget-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,QAAA,MAAM,YAAY,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"use-widget-ref.d.ts","sourceRoot":"","sources":["../../src/internal/use-widget-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,QAAA,MAAM,YAAY,GAAI,CAAC,YAAY,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAI7F,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GtkSignalListItemFactory } from "@gtkx/jsx/gtk";
|
|
3
3
|
import { NativeItemPortals, useItemCells } from "./internal/cells.js";
|
|
4
4
|
/**
|
package/dist/list-view.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { GtkListView, GtkSignalListItemFactory } from "@gtkx/jsx/gtk";
|
|
3
3
|
import { omit } from "@gtkx/utils";
|
|
4
4
|
import { ItemPortals, useItemCells, useSectionHeader } from "./internal/cells.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TabCollection, TabCollectionOptions } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a collection of JSX pages whose React state survives native transfers and source-window
|
|
4
|
+
* closure. Call append from an event handler because it commits synchronously. Page content lives in
|
|
5
|
+
* independent roots: pass context-dependent values through the item or wrap the content in providers.
|
|
6
|
+
*/
|
|
7
|
+
declare const createTabCollection: <T>(options: TabCollectionOptions<T>) => TabCollection<T>;
|
|
8
|
+
export { createTabCollection };
|
|
9
|
+
//# sourceMappingURL=tab-collection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-collection.d.ts","sourceRoot":"","sources":["../src/tab-collection.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AA6BtE;;;;GAIG;AACH,QAAA,MAAM,mBAAmB,GAAI,CAAC,WAAY,oBAAoB,CAAC,CAAC,CAAC,KAAG,aAAa,CAAC,CAAC,CAkFlF,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as Adw from "@gtkx/gi/adw";
|
|
3
|
+
import { AdwTabPage } from "@gtkx/jsx/adw";
|
|
4
|
+
import { createRoot, flushSync } from "@gtkx/react";
|
|
5
|
+
import { getClassType } from "@gtkx/runtime";
|
|
6
|
+
import { createRef, useEffect } from "react";
|
|
7
|
+
const ManagedTab = ({ handle, item, options, forget }) => {
|
|
8
|
+
const { page: pageRef, parent, getPage } = handle;
|
|
9
|
+
useEffect(() => () => forget(handle), [handle, forget]);
|
|
10
|
+
return _jsx(AdwTabPage, { ...options.pageProps(item, getPage), ref: pageRef, parent: parent });
|
|
11
|
+
};
|
|
12
|
+
const ownerOf = (page) => {
|
|
13
|
+
const owner = page.getChild().getAncestor(getClassType(Adw.TabView));
|
|
14
|
+
if (!(owner instanceof Adw.TabView))
|
|
15
|
+
throw new Error("The tab has no native view");
|
|
16
|
+
return owner;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Creates a collection of JSX pages whose React state survives native transfers and source-window
|
|
20
|
+
* closure. Call append from an event handler because it commits synchronously. Page content lives in
|
|
21
|
+
* independent roots: pass context-dependent values through the item or wrap the content in providers.
|
|
22
|
+
*/
|
|
23
|
+
const createTabCollection = (options) => {
|
|
24
|
+
const handles = new Set();
|
|
25
|
+
const forget = (handle) => {
|
|
26
|
+
handles.delete(handle);
|
|
27
|
+
};
|
|
28
|
+
const find = (page) => [...handles].find((handle) => handle.page.current === page);
|
|
29
|
+
const render = (handle) => {
|
|
30
|
+
handle.root.render(_jsx(ManagedTab, { handle: handle, item: handle.item, options: options, forget: forget }));
|
|
31
|
+
};
|
|
32
|
+
const remove = (handle) => {
|
|
33
|
+
handles.delete(handle);
|
|
34
|
+
handle.root.unmount();
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
append: (view, item, appendOptions = {}) => {
|
|
38
|
+
if (appendOptions.parent && ownerOf(appendOptions.parent) !== view) {
|
|
39
|
+
throw new RangeError("The parent page belongs to another tab view");
|
|
40
|
+
}
|
|
41
|
+
const pageRef = createRef();
|
|
42
|
+
const handle = {
|
|
43
|
+
root: createRoot(view),
|
|
44
|
+
page: pageRef,
|
|
45
|
+
getPage: () => pageRef.current,
|
|
46
|
+
parent: appendOptions.parent,
|
|
47
|
+
item,
|
|
48
|
+
};
|
|
49
|
+
handles.add(handle);
|
|
50
|
+
try {
|
|
51
|
+
flushSync(() => render(handle));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
remove(handle);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
const page = handle.page.current;
|
|
58
|
+
if (page === null) {
|
|
59
|
+
remove(handle);
|
|
60
|
+
throw new Error("The tab page did not render");
|
|
61
|
+
}
|
|
62
|
+
if (appendOptions.parent === undefined) {
|
|
63
|
+
view.reorderPage(page, page.getPinned() ? view.getNPinnedPages() - 1 : view.getNPages() - 1);
|
|
64
|
+
}
|
|
65
|
+
if (appendOptions.select !== false)
|
|
66
|
+
view.setSelectedPage(page);
|
|
67
|
+
return page;
|
|
68
|
+
},
|
|
69
|
+
get: (page) => find(page)?.item,
|
|
70
|
+
update: (page, item) => {
|
|
71
|
+
const handle = find(page);
|
|
72
|
+
if (handle === undefined)
|
|
73
|
+
throw new Error("The tab is not managed by this collection");
|
|
74
|
+
handle.item = item;
|
|
75
|
+
render(handle);
|
|
76
|
+
},
|
|
77
|
+
remove: (page) => {
|
|
78
|
+
const handle = find(page);
|
|
79
|
+
if (handle)
|
|
80
|
+
remove(handle);
|
|
81
|
+
},
|
|
82
|
+
removeView: (view) => {
|
|
83
|
+
const pages = Array.from({ length: view.getNPages() }, (_, index) => view.getNthPage(index));
|
|
84
|
+
for (const page of pages) {
|
|
85
|
+
const handle = find(page);
|
|
86
|
+
if (handle)
|
|
87
|
+
remove(handle);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
transfer: (page, target, position) => {
|
|
91
|
+
if (find(page) === undefined)
|
|
92
|
+
throw new Error("The tab is not managed by this collection");
|
|
93
|
+
const source = ownerOf(page);
|
|
94
|
+
const minimum = page.getPinned() ? 0 : target.getNPinnedPages();
|
|
95
|
+
const maximum = page.getPinned() ? target.getNPinnedPages() : target.getNPages();
|
|
96
|
+
const index = position ?? maximum;
|
|
97
|
+
if (!Number.isInteger(index) || index < minimum || index > maximum) {
|
|
98
|
+
throw new RangeError("The position is outside the tab's pinned or unpinned group");
|
|
99
|
+
}
|
|
100
|
+
if (source === target) {
|
|
101
|
+
target.reorderPage(page, Math.min(index, maximum - 1));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
source.transferPage(page, target, index);
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
dispose: () => {
|
|
108
|
+
for (const handle of [...handles])
|
|
109
|
+
remove(handle);
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
export { createTabCollection };
|
|
114
|
+
//# sourceMappingURL=tab-collection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tab-collection.js","sourceRoot":"","sources":["../src/tab-collection.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAa,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAkB,SAAS,EAAE,MAAM,OAAO,CAAC;AAkB7D,MAAM,UAAU,GAAG,CAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAsB,EAAE,EAAE;IAC7E,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC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Root, flushSync, type Root } from \"@gtkx/react\";\nimport { getClassType } from \"@gtkx/runtime\";\nimport { createRef, type RefObject, useEffect } from \"react\";\nimport type { TabCollection, TabCollectionOptions } from \"./types.js\";\n\ntype TabHandle<T> = {\n root: Root;\n page: RefObject<Adw.TabPage | null>;\n getPage: () => Adw.TabPage | null;\n parent: Adw.TabPage | undefined;\n item: T;\n};\n\ntype ManagedTabProps<T> = {\n handle: TabHandle<T>;\n item: T;\n options: TabCollectionOptions<T>;\n forget: (handle: TabHandle<T>) => void;\n};\n\nconst ManagedTab = <T,>({ handle, item, options, forget }: ManagedTabProps<T>) => {\n const { page: pageRef, parent, getPage } = handle;\n useEffect(() => () => forget(handle), [handle, forget]);\n return <AdwTabPage {...options.pageProps(item, getPage)} ref={pageRef} parent={parent} />;\n};\n\nconst ownerOf = (page: Adw.TabPage): Adw.TabView => {\n const owner = page.getChild().getAncestor(getClassType(Adw.TabView));\n if (!(owner instanceof Adw.TabView)) throw new Error(\"The tab has no native view\");\n return owner;\n};\n\n/**\n * Creates a collection of JSX pages whose React state survives native transfers and source-window\n * closure. Call append from an event handler because it commits synchronously. Page content lives in\n * independent roots: pass context-dependent values through the item or wrap the content in providers.\n */\nconst createTabCollection = <T,>(options: TabCollectionOptions<T>): TabCollection<T> => {\n const handles = new Set<TabHandle<T>>();\n const forget = (handle: TabHandle<T>) => {\n handles.delete(handle);\n };\n const find = (page: Adw.TabPage) => [...handles].find((handle) => handle.page.current === page);\n const render = (handle: TabHandle<T>) => {\n handle.root.render(<ManagedTab handle={handle} item={handle.item} options={options} forget={forget} />);\n };\n const remove = (handle: TabHandle<T>) => {\n handles.delete(handle);\n handle.root.unmount();\n };\n\n return {\n append: (view, item, appendOptions = {}) => {\n if (appendOptions.parent && ownerOf(appendOptions.parent) !== view) {\n throw new RangeError(\"The parent page belongs to another tab view\");\n }\n const pageRef = createRef<Adw.TabPage>();\n const handle: TabHandle<T> = {\n root: createRoot(view),\n page: pageRef,\n getPage: () => pageRef.current,\n parent: appendOptions.parent,\n item,\n };\n handles.add(handle);\n try {\n flushSync(() => render(handle));\n } catch (error) {\n remove(handle);\n throw error;\n }\n const page = handle.page.current;\n if (page === null) {\n remove(handle);\n throw new Error(\"The tab page did not render\");\n }\n if (appendOptions.parent === undefined) {\n view.reorderPage(page, page.getPinned() ? view.getNPinnedPages() - 1 : view.getNPages() - 1);\n }\n if (appendOptions.select !== false) view.setSelectedPage(page);\n return page;\n },\n get: (page) => find(page)?.item,\n update: (page, item) => {\n const handle = find(page);\n if (handle === undefined) throw new Error(\"The tab is not managed by this collection\");\n handle.item = item;\n render(handle);\n },\n remove: (page) => {\n const handle = find(page);\n if (handle) remove(handle);\n },\n removeView: (view) => {\n const pages = Array.from({ length: view.getNPages() }, (_, index) => view.getNthPage(index));\n for (const page of pages) {\n const handle = find(page);\n if (handle) remove(handle);\n }\n },\n transfer: (page, target, position) => {\n if (find(page) === undefined) throw new Error(\"The tab is not managed by this collection\");\n const source = ownerOf(page);\n const minimum = page.getPinned() ? 0 : target.getNPinnedPages();\n const maximum = page.getPinned() ? target.getNPinnedPages() : target.getNPages();\n const index = position ?? maximum;\n if (!Number.isInteger(index) || index < minimum || index > maximum) {\n throw new RangeError(\"The position is outside the tab's pinned or unpinned group\");\n }\n if (source === target) {\n target.reorderPage(page, Math.min(index, maximum - 1));\n } else {\n source.transferPage(page, target, index);\n }\n },\n dispose: () => {\n for (const handle of [...handles]) remove(handle);\n },\n };\n};\n\nexport { createTabCollection };\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as Adw from "@gtkx/gi/adw";
|
|
2
2
|
import type * as GObject from "@gtkx/gi/gobject";
|
|
3
3
|
import type * as Gtk from "@gtkx/gi/gtk";
|
|
4
|
-
import type { AdwComboRowProps, AdwToastProps } from "@gtkx/jsx/adw";
|
|
4
|
+
import type { AdwComboRowProps, AdwTabPageProps, AdwToastProps } from "@gtkx/jsx/adw";
|
|
5
5
|
import type { GtkColumnViewColumnProps, GtkColumnViewProps, GtkDropDownProps, GtkGridViewProps, GtkListViewProps } from "@gtkx/jsx/gtk";
|
|
6
6
|
import type { Primitive } from "@gtkx/utils";
|
|
7
7
|
import type { ReactNode, RefObject } from "react";
|
|
@@ -233,5 +233,38 @@ type ToastProviderProps = {
|
|
|
233
233
|
/** Subtree whose `useToast` calls target that overlay. */
|
|
234
234
|
children?: ReactNode | undefined;
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
/** Describes the JSX page rendered for each value in a {@link TabCollection}. */
|
|
237
|
+
type TabCollectionOptions<T> = {
|
|
238
|
+
/** Native page props and JSX content. Call getPage in event handlers to access the mounted page. The collection owns its ref and parent relationship. */
|
|
239
|
+
pageProps: (item: T, getPage: () => Adw.TabPage | null) => Omit<AdwTabPageProps, "ref" | "parent">;
|
|
240
|
+
};
|
|
241
|
+
/** Options for adding a page to a {@link TabCollection}. */
|
|
242
|
+
type TabAppendOptions = {
|
|
243
|
+
/** Inserts a related page after this parent and its descendants, using native tab ancestry. */
|
|
244
|
+
parent?: Adw.TabPage | undefined;
|
|
245
|
+
/** Selects the new page by default. */
|
|
246
|
+
select?: boolean | undefined;
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Owns independent JSX tab roots across native view transfers. Its lifetime can span several windows.
|
|
250
|
+
* Remove a page after accepting its native close request, remove a view's pages before destroying that
|
|
251
|
+
* view, and dispose the collection when its owner is finished.
|
|
252
|
+
*/
|
|
253
|
+
type TabCollection<T> = {
|
|
254
|
+
/** Renders synchronously and returns the native page, including from an overview's create-tab handler. */
|
|
255
|
+
append: (view: Adw.TabView, item: T, options?: TabAppendOptions) => Adw.TabPage;
|
|
256
|
+
/** Returns a managed page's current value, or undefined for an unmanaged page. */
|
|
257
|
+
get: (page: Adw.TabPage) => T | undefined;
|
|
258
|
+
/** Updates the value and rerenders the existing JSX root, preserving component state and native identity. */
|
|
259
|
+
update: (page: Adw.TabPage, item: T) => void;
|
|
260
|
+
/** Unmounts a managed page from its current native owner; already removed pages are ignored. */
|
|
261
|
+
remove: (page: Adw.TabPage) => void;
|
|
262
|
+
/** Unmounts this collection's pages currently belonging to the given view, including transferred pages. */
|
|
263
|
+
removeView: (view: Adw.TabView) => void;
|
|
264
|
+
/** Moves a managed page to another view, appending within its pinned or unpinned group by default. */
|
|
265
|
+
transfer: (page: Adw.TabPage, target: Adw.TabView, position?: number) => void;
|
|
266
|
+
/** Unmounts every managed page. The collection may subsequently be reused. */
|
|
267
|
+
dispose: () => void;
|
|
268
|
+
};
|
|
269
|
+
export { type SelectionProps, type ExpanderDescriptions, type ExpansionProps, type SortProps, type DropDownOwnProps, type ListItem, type ListSection, type ListItemRenderArgs, type ListRowProps, type ListSectionRenderArgs, type ListItemRenderer, type ListItemFactoryProps, type ListRowPropsResolver, type ListSectionRenderer, type ColumnViewColumn, type ColumnViewProps, type DropDownProps, type GridViewProps, type ListViewProps, type ComboRowProps, type ToastOptions, type ToastController, type ToastProviderProps, type TabAppendOptions, type TabCollection, type TabCollectionOptions, };
|
|
237
270
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
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,KAAK,OAAO,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc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|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAqSA,OAAO,EAwBN,CAAC","sourcesContent":["import type * as Adw from \"@gtkx/gi/adw\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { AdwComboRowProps, AdwToastProps } from \"@gtkx/jsx/adw\";\nimport type {\n GtkColumnViewColumnProps,\n GtkColumnViewProps,\n GtkDropDownProps,\n GtkGridViewProps,\n GtkListViewProps,\n} from \"@gtkx/jsx/gtk\";\nimport type { Primitive } from \"@gtkx/utils\";\nimport type { ReactNode, RefObject } 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, unique across the collection, used to preserve identity across updates and selection. */\n id: string;\n /** Payload handed to the cell renderer as `ListItemRenderArgs.item`. */\n value: T;\n /** Child items in an acyclic tree, read only as rows are drawn. */\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, unique among sections, 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\ntype ListItemFactoryProps<T extends GObject.Object> = ItemSizeProps & {\n renderItem: ListItemRenderer<T>;\n};\n\n/** The flat-collection hint shared by {@link ListView} and {@link ColumnView}. */\ntype FlatnessProps = {\n /**\n * Declares every item a leaf, so the view skips tree discovery when synchronising a large collection\n * instead of scanning each item for `children`. Must not be set when any item has children: those\n * items would render as plain rows that never expand.\n */\n isFlat?: boolean | 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.\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.\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. */\n items?: ListItem<T>[] | undefined;\n} & Partial<Record<\"sections\", undefined>> & Partial<Record<\"renderHeader\", null | undefined>>) | ({\n /** Items grouped under section headers. */\n sections: ListSection<S, T>[];\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n} & Partial<Record<\"items\", undefined>>);\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 FlatnessProps &\n Omit<ItemSizeProps, \"estimatedItemWidth\"> & {\n /** Columns to render, in order; each carries its own cell renderer. */\n columns: ColumnViewColumn<T>[];\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 * Native `Gtk.ColumnView` props with declarative columns and collections, controlled selection, expansion, and sorting.\n */\ntype ColumnViewProps<T = unknown, S = unknown> = Omit<\n GtkColumnViewProps,\n \"children\" | \"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 | undefined;\n /** Called with the selected id, or `null` when the model becomes empty. */\n onSelectionChanged?: ((id: string | null) => void) | null | undefined;\n /** Renders the collapsed display and, unless overridden, the popup rows. Required for non-primitive values. */\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};\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(SourceProps<T & Primitive, S> | Record<\"renderItem\", ListItemRenderer<T>>);\n\n/**\n * Native `Gtk.DropDown` props with declarative collections, controlled selection, and display/popup renderers.\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 * Native `Gtk.GridView` props with declarative cells, controlled selection, and estimated 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 FlatnessProps & {\n /** Renders the contents of one row. */\n renderItem: ListItemRenderer<T>;\n };\n\n/**\n * Native `Gtk.ListView` props with declarative rows and sections, controlled selection and expansion,\n * and estimated sizing.\n */\ntype ListViewProps<T = unknown, S = unknown> = Omit<\n GtkListViewProps,\n \"model\" | \"factory\" | \"headerFactory\" | keyof ListViewOwnProps<T, S>\n> &\nListViewOwnProps<T, S>;\n\n/**\n * Native `Adw.ComboRow` props with declarative collections, controlled selection, and display/popup renderers.\n */\ntype ComboRowProps<T = unknown, S = unknown> = DropDownWidgetProps<AdwComboRowProps, T, S>;\n/**\n * Describes a toast raised through {@link useToast}: the construct-time properties of an\n * `Adw.Toast` plus its `button-clicked` and `dismissed` handlers.\n */\ntype ToastOptions = Adw.ToastConstructorProps & Pick<AdwToastProps, \"onButtonClicked\" | \"onDismissed\">;\n\n/** Imperative controls for toasts, returned by {@link useToast}. */\ntype ToastController = {\n /** Builds a toast, shows it through the overlay, and returns it. */\n show: (options?: ToastOptions) => Adw.Toast;\n /** Dismisses the shown toast and every queued one. */\n dismissAll: () => void;\n};\n\n/** Props for {@link ToastProvider}. */\ntype ToastProviderProps = {\n /** Ref also given to the `AdwToastOverlay` the toasts appear over. */\n overlayRef: RefObject<Adw.ToastOverlay | null>;\n /** Subtree whose `useToast` calls target that overlay. */\n children?: ReactNode | undefined;\n};\n\nexport {\n type SelectionProps,\n type ExpanderDescriptions,\n type ExpansionProps,\n type SortProps,\n type DropDownOwnProps,\n type ListItem,\n type ListSection,\n type ListItemRenderArgs,\n type ListRowProps,\n type ListSectionRenderArgs,\n type ListItemRenderer,\n type ListItemFactoryProps,\n type ListRowPropsResolver,\n type ListSectionRenderer,\n type ColumnViewColumn,\n type ColumnViewProps,\n type DropDownProps,\n type GridViewProps,\n type ListViewProps,\n type ComboRowProps,\n type ToastOptions,\n type ToastController,\n type ToastProviderProps,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA4UA,OAAO,EA2BN,CAAC","sourcesContent":["import type * as Adw from \"@gtkx/gi/adw\";\nimport type * as GObject from \"@gtkx/gi/gobject\";\nimport type * as Gtk from \"@gtkx/gi/gtk\";\nimport type { AdwComboRowProps, AdwTabPageProps, AdwToastProps } from \"@gtkx/jsx/adw\";\nimport type {\n GtkColumnViewColumnProps,\n GtkColumnViewProps,\n GtkDropDownProps,\n GtkGridViewProps,\n GtkListViewProps,\n} from \"@gtkx/jsx/gtk\";\nimport type { Primitive } from \"@gtkx/utils\";\nimport type { ReactNode, RefObject } 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, unique across the collection, used to preserve identity across updates and selection. */\n id: string;\n /** Payload handed to the cell renderer as `ListItemRenderArgs.item`. */\n value: T;\n /** Child items in an acyclic tree, read only as rows are drawn. */\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, unique among sections, 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\ntype ListItemFactoryProps<T extends GObject.Object> = ItemSizeProps & {\n renderItem: ListItemRenderer<T>;\n};\n\n/** The flat-collection hint shared by {@link ListView} and {@link ColumnView}. */\ntype FlatnessProps = {\n /**\n * Declares every item a leaf, so the view skips tree discovery when synchronising a large collection\n * instead of scanning each item for `children`. Must not be set when any item has children: those\n * items would render as plain rows that never expand.\n */\n isFlat?: boolean | 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.\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.\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 | ({\n /** Items to render, nesting through `ListItem.children` for a tree. */\n items?: ListItem<T>[] | undefined;\n } & Partial<Record<\"sections\", undefined>> &\n Partial<Record<\"renderHeader\", null | undefined>>)\n | ({\n /** Items grouped under section headers. */\n sections: ListSection<S, T>[];\n /** Renders the header shown above each section. */\n renderHeader?: ListSectionRenderer<S> | null | undefined;\n } & Partial<Record<\"items\", undefined>>);\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 FlatnessProps &\n Omit<ItemSizeProps, \"estimatedItemWidth\"> & {\n /** Columns to render, in order; each carries its own cell renderer. */\n columns: ColumnViewColumn<T>[];\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 * Native `Gtk.ColumnView` props with declarative columns and collections, controlled selection, expansion, and sorting.\n */\ntype ColumnViewProps<T = unknown, S = unknown> = Omit<\n GtkColumnViewProps,\n \"children\" | \"columns\" | \"model\" | \"headerFactory\" | \"rowFactory\" | keyof ColumnViewOwnProps<T, S>\n> &\n ColumnViewOwnProps<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 | undefined;\n /** Called with the selected id, or `null` when the model becomes empty. */\n onSelectionChanged?: ((id: string | null) => void) | null | undefined;\n /** Renders the collapsed display and, unless overridden, the popup rows. Required for non-primitive values. */\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};\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> &\n DropDownOwnProps<T, S> &\n (SourceProps<T & Primitive, S> | Record<\"renderItem\", ListItemRenderer<T>>);\n\n/**\n * Native `Gtk.DropDown` props with declarative collections, controlled selection, and display/popup renderers.\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 * Native `Gtk.GridView` props with declarative cells, controlled selection, and estimated 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 FlatnessProps & {\n /** Renders the contents of one row. */\n renderItem: ListItemRenderer<T>;\n };\n\n/**\n * Native `Gtk.ListView` props with declarative rows and sections, controlled selection and expansion,\n * and estimated sizing.\n */\ntype ListViewProps<T = unknown, S = unknown> = Omit<\n GtkListViewProps,\n \"model\" | \"factory\" | \"headerFactory\" | keyof ListViewOwnProps<T, S>\n> &\n ListViewOwnProps<T, S>;\n\n/**\n * Native `Adw.ComboRow` props with declarative collections, controlled selection, and display/popup renderers.\n */\ntype ComboRowProps<T = unknown, S = unknown> = DropDownWidgetProps<AdwComboRowProps, T, S>;\n/**\n * Describes a toast raised through {@link useToast}: the construct-time properties of an\n * `Adw.Toast` plus its `button-clicked` and `dismissed` handlers.\n */\ntype ToastOptions = Adw.ToastConstructorProps & Pick<AdwToastProps, \"onButtonClicked\" | \"onDismissed\">;\n\n/** Imperative controls for toasts, returned by {@link useToast}. */\ntype ToastController = {\n /** Builds a toast, shows it through the overlay, and returns it. */\n show: (options?: ToastOptions) => Adw.Toast;\n /** Dismisses the shown toast and every queued one. */\n dismissAll: () => void;\n};\n\n/** Props for {@link ToastProvider}. */\ntype ToastProviderProps = {\n /** Ref also given to the `AdwToastOverlay` the toasts appear over. */\n overlayRef: RefObject<Adw.ToastOverlay | null>;\n /** Subtree whose `useToast` calls target that overlay. */\n children?: ReactNode | undefined;\n};\n\n/** Describes the JSX page rendered for each value in a {@link TabCollection}. */\ntype TabCollectionOptions<T> = {\n /** Native page props and JSX content. Call getPage in event handlers to access the mounted page. The collection owns its ref and parent relationship. */\n pageProps: (item: T, getPage: () => Adw.TabPage | null) => Omit<AdwTabPageProps, \"ref\" | \"parent\">;\n};\n\n/** Options for adding a page to a {@link TabCollection}. */\ntype TabAppendOptions = {\n /** Inserts a related page after this parent and its descendants, using native tab ancestry. */\n parent?: Adw.TabPage | undefined;\n /** Selects the new page by default. */\n select?: boolean | undefined;\n};\n\n/**\n * Owns independent JSX tab roots across native view transfers. Its lifetime can span several windows.\n * Remove a page after accepting its native close request, remove a view's pages before destroying that\n * view, and dispose the collection when its owner is finished.\n */\ntype TabCollection<T> = {\n /** Renders synchronously and returns the native page, including from an overview's create-tab handler. */\n append: (view: Adw.TabView, item: T, options?: TabAppendOptions) => Adw.TabPage;\n /** Returns a managed page's current value, or undefined for an unmanaged page. */\n get: (page: Adw.TabPage) => T | undefined;\n /** Updates the value and rerenders the existing JSX root, preserving component state and native identity. */\n update: (page: Adw.TabPage, item: T) => void;\n /** Unmounts a managed page from its current native owner; already removed pages are ignored. */\n remove: (page: Adw.TabPage) => void;\n /** Unmounts this collection's pages currently belonging to the given view, including transferred pages. */\n removeView: (view: Adw.TabView) => void;\n /** Moves a managed page to another view, appending within its pinned or unpinned group by default. */\n transfer: (page: Adw.TabPage, target: Adw.TabView, position?: number) => void;\n /** Unmounts every managed page. The collection may subsequently be reused. */\n dispose: () => void;\n};\n\nexport {\n type SelectionProps,\n type ExpanderDescriptions,\n type ExpansionProps,\n type SortProps,\n type DropDownOwnProps,\n type ListItem,\n type ListSection,\n type ListItemRenderArgs,\n type ListRowProps,\n type ListSectionRenderArgs,\n type ListItemRenderer,\n type ListItemFactoryProps,\n type ListRowPropsResolver,\n type ListSectionRenderer,\n type ColumnViewColumn,\n type ColumnViewProps,\n type DropDownProps,\n type GridViewProps,\n type ListViewProps,\n type ComboRowProps,\n type ToastOptions,\n type ToastController,\n type ToastProviderProps,\n type TabAppendOptions,\n type TabCollection,\n type TabCollectionOptions,\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/components",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
4
|
-
"description": "Collection views, selection controls, and toasts for GTKX.",
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
4
|
+
"description": "Collection views, selection controls, tabs, and toasts for GTKX.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
7
7
|
"gtk",
|
|
@@ -39,36 +39,26 @@
|
|
|
39
39
|
"dist",
|
|
40
40
|
"src"
|
|
41
41
|
],
|
|
42
|
-
"nx": {
|
|
43
|
-
"targets": {
|
|
44
|
-
"lint": {
|
|
45
|
-
"options": {
|
|
46
|
-
"cwd": ".",
|
|
47
|
-
"command": "eslint {projectRoot}"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
42
|
"engines": {
|
|
53
43
|
"node": ">=26.7.0"
|
|
54
44
|
},
|
|
55
45
|
"dependencies": {
|
|
56
|
-
"@gtkx/react": "2.0.0-beta.
|
|
57
|
-
"@gtkx/runtime": "2.0.0-beta.
|
|
58
|
-
"@gtkx/utils": "2.0.0-beta.
|
|
46
|
+
"@gtkx/react": "2.0.0-beta.12",
|
|
47
|
+
"@gtkx/runtime": "2.0.0-beta.12",
|
|
48
|
+
"@gtkx/utils": "2.0.0-beta.12"
|
|
59
49
|
},
|
|
60
50
|
"peerDependencies": {
|
|
61
51
|
"@types/react": "^19.3",
|
|
62
52
|
"react": "^19.3"
|
|
63
53
|
},
|
|
64
54
|
"devDependencies": {
|
|
65
|
-
"@gtkx/config": "2.0.0-beta.
|
|
66
|
-
"@gtkx/testing": "2.0.0-beta.
|
|
67
|
-
"@gtkx/vitest": "2.0.0-beta.
|
|
55
|
+
"@gtkx/config": "2.0.0-beta.12",
|
|
56
|
+
"@gtkx/testing": "2.0.0-beta.12",
|
|
57
|
+
"@gtkx/vitest": "2.0.0-beta.12",
|
|
68
58
|
"@types/react": "^19.3.0",
|
|
69
|
-
"vitest": "
|
|
59
|
+
"vitest": "5.0.5"
|
|
70
60
|
},
|
|
71
61
|
"scripts": {
|
|
72
|
-
"release": "
|
|
62
|
+
"release": "node ../../scripts/release/publish-package.ts"
|
|
73
63
|
}
|
|
74
64
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { GridView } from "./grid-view.js";
|
|
|
5
5
|
export { ListItemFactory } from "./list-item-factory.js";
|
|
6
6
|
export { ListView } from "./list-view.js";
|
|
7
7
|
export { ToastProvider, useToast } from "./toast.js";
|
|
8
|
+
export { createTabCollection } from "./tab-collection.js";
|
|
8
9
|
export type {
|
|
9
10
|
ColumnViewColumn,
|
|
10
11
|
ColumnViewProps,
|
|
@@ -25,4 +26,7 @@ export type {
|
|
|
25
26
|
ToastController,
|
|
26
27
|
ToastOptions,
|
|
27
28
|
ToastProviderProps,
|
|
29
|
+
TabAppendOptions,
|
|
30
|
+
TabCollection,
|
|
31
|
+
TabCollectionOptions,
|
|
28
32
|
} from "./types.js";
|