@gtkx/components 1.0.0 → 1.1.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.
- package/README.md +1 -1
- package/dist/internal/cells.js +1 -1
- package/dist/internal/cells.js.map +1 -1
- package/dist/internal/collection-index.d.ts +4 -3
- package/dist/internal/collection-index.d.ts.map +1 -1
- package/dist/internal/collection-index.js +50 -33
- package/dist/internal/collection-index.js.map +1 -1
- package/dist/internal/collection-model.d.ts +3 -4
- package/dist/internal/collection-model.d.ts.map +1 -1
- package/dist/internal/collection-model.js +110 -74
- package/dist/internal/collection-model.js.map +1 -1
- package/dist/internal/collection.d.ts +2 -1
- package/dist/internal/collection.d.ts.map +1 -1
- package/dist/internal/collection.js +7 -6
- package/dist/internal/collection.js.map +1 -1
- package/dist/internal/expansion.d.ts.map +1 -1
- package/dist/internal/expansion.js +11 -19
- package/dist/internal/expansion.js.map +1 -1
- package/dist/internal/tree-expansion.d.ts +1 -2
- package/dist/internal/tree-expansion.d.ts.map +1 -1
- package/dist/internal/tree-expansion.js +12 -8
- package/dist/internal/tree-expansion.js.map +1 -1
- package/dist/internal/tree-order.d.ts +3 -4
- package/dist/internal/tree-order.d.ts.map +1 -1
- package/dist/internal/tree-order.js +61 -23
- package/dist/internal/tree-order.js.map +1 -1
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +17 -9
- package/src/internal/cells.tsx +1 -1
- package/src/internal/collection-index.ts +63 -39
- package/src/internal/collection-model.ts +148 -85
- package/src/internal/collection.ts +10 -8
- package/src/internal/expansion.ts +12 -24
- package/src/internal/tree-expansion.ts +14 -9
- package/src/internal/tree-order.ts +98 -28
- package/src/types.ts +3 -2
package/README.md
CHANGED
package/dist/internal/cells.js
CHANGED
|
@@ -242,7 +242,7 @@ function HeaderCellImpl({ entry, render, collection }) {
|
|
|
242
242
|
const item = useSyncExternalStore(entry.subscribe, entry.getItem);
|
|
243
243
|
const ref = slotRefFor(item);
|
|
244
244
|
const renderHeader = render;
|
|
245
|
-
const body = ref === null ? null : renderHeader({ section: collection.sectionFor(ref.store.path) });
|
|
245
|
+
const body = ref === null ? null : renderHeader({ section: collection.sectionFor(ref.store.level.path) });
|
|
246
246
|
return createPortal(body, entry.host, entry.key);
|
|
247
247
|
}
|
|
248
248
|
function usePortalEntries(registry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cells.js","sourceRoot":"","sources":["../../src/internal/cells.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAW9E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoInD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;AAClC,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;AACxC,MAAM,YAAY,GAAsC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AACrG,MAAM,cAAc,GAAwC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AAC3G,MAAM,WAAW,GAA2C,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;AACxF,MAAM,OAAO,GAAa,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;AACpD,MAAM,YAAY,GAAiB,E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OAAO,EAAE,CACL,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAI,CAC3G;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EACH,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,GAEd,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { GtkSignalListItemFactory, GtkTreeExpander } from \"@gtkx/jsx/gtk\";\nimport { createPortal, useProperty } from \"@gtkx/react\";\nimport { setObjectProperty, t } from \"@gtkx/runtime\";\nimport { memo, useLayoutEffect, useState, useSyncExternalStore } from \"react\";\nimport type {\n ExpanderDescriptions,\n ListItem,\n ListItemRenderArgs,\n ListItemRenderer,\n ListRowProps,\n ListRowPropsResolver,\n ListSectionRenderer,\n} from \"../types.js\";\nimport type { Collection } from \"./collection.js\";\nimport { slotRefFor } from \"./collection-model.js\";\n\ntype CellSize = {\n width: number;\n height: number;\n};\n\ntype FactoryHost = GObject.Object & {\n getItem: () => GObject.Object | null;\n};\n\ntype CellHost = FactoryHost & {\n getChild: () => Gtk.Widget | null;\n setChild: (child: Gtk.Widget | null) => void;\n};\n\ntype CellEntry<H extends FactoryHost> = {\n key: string;\n host: H;\n item: GObject.Object | null;\n listeners: Set<() => void>;\n subscribe: (onChange: () => void) => () => void;\n getItem: () => GObject.Object | null;\n};\n\ntype FactoryHandlers = {\n onSetup: (host: GObject.Object) => void;\n onBind: (host: GObject.Object) => void;\n onUnbind: (host: GObject.Object) => void;\n onTeardown: (host: GObject.Object) => void;\n};\n\ntype CellRegistry<H extends FactoryHost> = {\n handlers: FactoryHandlers;\n setSize: (size: CellSize) => void;\n subscribe: (onChange: () => void) => () => void;\n getVersion: () => number;\n getEntries: () => CellEntry<H>[];\n};\n\ntype HostGuard<H extends FactoryHost> = (value: GObject.Object) => value is H;\n\ntype CellRegistryOptions<H extends FactoryHost> = {\n isHost: HostGuard<H>;\n prepare?: ((host: H, size: CellSize) => void) | undefined;\n};\n\ntype CellRegistryState<H extends FactoryHost> = CellRegistryOptions<H> & {\n size: CellSize;\n entries: Map<H, CellEntry<H>>;\n snapshot: CellEntry<H>[] | null;\n listeners: Set<() => void>;\n serial: number;\n version: number;\n};\n\ntype ResolvedRowProps = {\n accessibleLabel: string | null;\n accessibleDescription: string | null;\n isActivatable: boolean;\n isFocusable: boolean;\n isSelectable: boolean;\n};\n\ntype ItemSlotOptions = {\n item: GObject.Object | null;\n position: number | undefined;\n row: Gtk.TreeListRow | null;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype PositionedHost = Gtk.ListItem | Gtk.ColumnViewRow;\n\ntype ItemSlot = {\n item: ListItem;\n row: Gtk.TreeListRow | null;\n args: ListItemRenderArgs<unknown>;\n};\n\ntype ItemCellProps = {\n entry: CellEntry<Gtk.ListItem>;\n render: ListItemRenderer<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n expanderDescriptions: ExpanderDescriptions | null | undefined;\n};\n\ntype ItemPortalsProps = {\n registry: CellRegistry<Gtk.ListItem>;\n render: ListItemRenderer<never>;\n collection: Collection;\n expandedIds?: string[] | null | undefined;\n expanderDescriptions?: ExpanderDescriptions | null | undefined;\n};\n\ntype ItemRowProps = {\n entry: CellEntry<Gtk.ColumnViewRow>;\n rowProps: ListRowPropsResolver<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype RowPortalsProps = {\n registry: CellRegistry<Gtk.ColumnViewRow>;\n rowProps: ListRowPropsResolver<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype HeaderCellProps = {\n entry: CellEntry<Gtk.ListHeader>;\n render: ListSectionRenderer<never>;\n collection: Collection;\n};\n\ntype HeaderPortalsProps = {\n registry: CellRegistry<Gtk.ListHeader>;\n render: ListSectionRenderer<never>;\n collection: Collection;\n};\n\ntype SectionHeaderSlot = {\n factoryProps: { headerFactory?: ReactElement };\n portals: ReactNode;\n};\n\ntype RowSlot = {\n factoryProps: { rowFactory?: ReactElement };\n portals: ReactNode;\n};\n\nconst ItemCell = memo(ItemCellImpl);\nconst ItemRow = memo(ItemRowImpl);\nconst HeaderCell = memo(HeaderCellImpl);\nconst CELL_OPTIONS: CellRegistryOptions<Gtk.ListItem> = { isHost: isListItem, prepare: prepareCell };\nconst HEADER_OPTIONS: CellRegistryOptions<Gtk.ListHeader> = { isHost: isListHeader, prepare: prepareCell };\nconst ROW_OPTIONS: CellRegistryOptions<Gtk.ColumnViewRow> = { isHost: isColumnViewRow };\nconst NO_SIZE: CellSize = { width: -1, height: -1 };\nconst NO_ROW_PROPS: ListRowProps = {};\nconst ROW_TEXT_DESCRIPTOR = t.string(\"borrowed\");\n\nconst placeholder = (size: CellSize): Gtk.Widget =>\n new Gtk.Box({ widthRequest: size.width, heightRequest: size.height });\n\nfunction isListItem(value: GObject.Object): value is Gtk.ListItem {\n return value instanceof Gtk.ListItem;\n}\n\nfunction isListHeader(value: GObject.Object): value is Gtk.ListHeader {\n return value instanceof Gtk.ListHeader;\n}\n\nfunction isColumnViewRow(value: GObject.Object): value is Gtk.ColumnViewRow {\n return value instanceof Gtk.ColumnViewRow;\n}\n\nfunction prepareCell(host: CellHost, size: CellSize): void {\n if (host.getChild() === null) {\n host.setChild(placeholder(size));\n }\n}\n\nfunction notifyEntry<H extends FactoryHost>(entry: CellEntry<H>): void {\n for (const listener of entry.listeners) {\n listener();\n }\n}\n\nfunction notifyRegistry<H extends FactoryHost>(state: CellRegistryState<H>): void {\n state.snapshot = null;\n state.version += 1;\n\n for (const listener of state.listeners) {\n listener();\n }\n}\n\nfunction createEntry<H extends FactoryHost>(state: CellRegistryState<H>, host: H): CellEntry<H> {\n state.serial += 1;\n\n const entry: CellEntry<H> = {\n key: `gtkx-cell-${String(state.serial)}`,\n host,\n item: null,\n listeners: new Set(),\n subscribe: (onChange) => {\n entry.listeners.add(onChange);\n\n return () => {\n entry.listeners.delete(onChange);\n };\n },\n getItem: () => entry.item,\n };\n\n return entry;\n}\n\nfunction setupHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n state.prepare?.(host, state.size);\n state.entries.set(host, createEntry(state, host));\n notifyRegistry(state);\n}\n\nfunction teardownHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n if (state.entries.delete(host)) {\n notifyRegistry(state);\n }\n}\n\nfunction writeBinding<H extends FactoryHost>(state: CellRegistryState<H>, host: H, item: GObject.Object | null): void {\n const entry = state.entries.get(host);\n\n if (entry === undefined) {\n return;\n }\n\n entry.item = item;\n notifyEntry(entry);\n}\n\nfunction bindHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n state.prepare?.(host, state.size);\n writeBinding(state, host, host.getItem());\n}\n\nfunction subscribeRegistry<H extends FactoryHost>(state: CellRegistryState<H>, onChange: () => void): () => void {\n state.listeners.add(onChange);\n\n return () => {\n state.listeners.delete(onChange);\n };\n}\n\nfunction getRegistryEntries<H extends FactoryHost>(state: CellRegistryState<H>): CellEntry<H>[] {\n state.snapshot ??= state.entries.values().toArray();\n\n return state.snapshot;\n}\n\nfunction guarded<H extends FactoryHost>(isHost: HostGuard<H>, run: (host: H) => void): (host: GObject.Object) => void {\n return (host) => {\n if (isHost(host)) {\n run(host);\n }\n };\n}\n\nfunction createHandlers<H extends FactoryHost>(state: CellRegistryState<H>): FactoryHandlers {\n const { isHost } = state;\n\n return {\n onSetup: guarded(isHost, (host) => {\n setupHost(state, host);\n }),\n onBind: guarded(isHost, (host) => {\n bindHost(state, host);\n }),\n onUnbind: guarded(isHost, (host) => {\n writeBinding(state, host, null);\n }),\n onTeardown: guarded(isHost, (host) => {\n teardownHost(state, host);\n }),\n };\n}\n\nfunction createCellRegistry<H extends FactoryHost>(options: CellRegistryOptions<H>, size: CellSize): CellRegistry<H> {\n const state: CellRegistryState<H> = {\n ...options,\n size,\n entries: new Map(),\n snapshot: null,\n listeners: new Set(),\n serial: 0,\n version: 0,\n };\n\n return {\n handlers: createHandlers(state),\n setSize: (next) => {\n state.size = next;\n },\n subscribe: (onChange) => subscribeRegistry(state, onChange),\n getVersion: () => state.version,\n getEntries: () => getRegistryEntries(state),\n };\n}\n\nfunction useCellRegistry<H extends FactoryHost>(options: CellRegistryOptions<H>, size: CellSize): CellRegistry<H> {\n const [registry] = useState(() => createCellRegistry(options, size));\n\n useLayoutEffect(() => {\n registry.setSize(size);\n });\n\n return registry;\n}\n\nfunction useItemCells(size: CellSize): CellRegistry<Gtk.ListItem> {\n return useCellRegistry(CELL_OPTIONS, size);\n}\n\nfunction useHeaderCells(size: CellSize): CellRegistry<Gtk.ListHeader> {\n return useCellRegistry(HEADER_OPTIONS, size);\n}\n\nfunction isRowWanted(options: ItemSlotOptions, item: ListItem): boolean {\n return options.expandedIds?.includes(item.id) ?? false;\n}\n\nfunction itemArgs(item: ListItem, options: ItemSlotOptions): ListItemRenderArgs<unknown> {\n const args: ListItemRenderArgs<unknown> = { item: item.value, index: options.position ?? 0 };\n const row = options.row;\n\n if (row === null) {\n return args;\n }\n\n args.depth = row.getDepth();\n\n if (row.isExpandable()) {\n args.isExpanded = isRowWanted(options, item);\n }\n\n return args;\n}\n\nfunction slotFor(options: ItemSlotOptions): ItemSlot | null {\n const ref = slotRefFor(options.item);\n const item = ref === null ? undefined : options.collection.itemAt(ref);\n\n if (item === undefined) {\n return null;\n }\n\n return { item, row: options.row, args: itemArgs(item, options) };\n}\n\nfunction useItemSlot(\n entry: CellEntry<PositionedHost>,\n collection: Collection,\n expandedIds: string[] | null | undefined,\n): ItemSlot | null {\n const position = useProperty(entry.host, \"position\");\n const item = useSyncExternalStore(entry.subscribe, entry.getItem);\n const row = item instanceof Gtk.TreeListRow ? item : null;\n\n return slotFor({ item, position, row, collection, expandedIds });\n}\n\nfunction expanderDescriptionFor(\n slot: ItemSlot,\n descriptions: ExpanderDescriptions | null | undefined,\n): string | undefined {\n const { isExpanded } = slot.args;\n\n if (isExpanded === undefined || descriptions == null) {\n return undefined;\n }\n\n return isExpanded ? descriptions.collapse : descriptions.expand;\n}\n\nfunction wrapExpander(\n slot: ItemSlot,\n content: ReactNode,\n descriptions: ExpanderDescriptions | null | undefined,\n): ReactNode {\n const { item, row } = slot;\n\n const expander: ReactNode =\n row === null\n ? (\n content\n )\n : (\n <GtkTreeExpander\n listRow={row}\n hideExpander={item.shouldHideExpander ?? false}\n indentForDepth={item.shouldIndentForDepth ?? true}\n indentForIcon={item.shouldIndentForIcon ?? true}\n accessibleDescription={expanderDescriptionFor(slot, descriptions)}\n >\n {content}\n </GtkTreeExpander>\n );\n\n return expander;\n}\n\nfunction itemBody(\n slot: ItemSlot | null,\n render: ListItemRenderer<never>,\n descriptions: ExpanderDescriptions | null | undefined,\n): ReactNode {\n if (slot === null) {\n return null;\n }\n\n const renderItem = render as ListItemRenderer<unknown>;\n\n return wrapExpander(slot, renderItem(slot.args), descriptions);\n}\n\nfunction rowText(value: string | undefined): string | null {\n return value ?? null;\n}\n\n/* eslint-disable-next-line unicorn/consistent-boolean-name -- reads the flag off a row, paired with rowText */\nfunction rowFlag(value: boolean | undefined): boolean {\n return value ?? true;\n}\n\nfunction rowPropsFor(slot: ItemSlot | null, rowProps: ListRowPropsResolver<never>): ResolvedRowProps {\n const resolve = rowProps as ListRowPropsResolver<unknown>;\n const props = slot === null ? NO_ROW_PROPS : resolve(slot.args);\n\n return {\n accessibleLabel: rowText(props.accessibleLabel),\n accessibleDescription: rowText(props.accessibleDescription),\n isActivatable: rowFlag(props.isActivatable),\n isFocusable: rowFlag(props.isFocusable),\n isSelectable: rowFlag(props.isSelectable),\n };\n}\n\nfunction setRowText(host: Gtk.ColumnViewRow, name: string, value: string | null): void {\n setObjectProperty(host, name, ROW_TEXT_DESCRIPTOR, value);\n}\n\nfunction applyRowProps(host: Gtk.ColumnViewRow, props: ResolvedRowProps): void {\n setRowText(host, \"accessible-label\", props.accessibleLabel);\n setRowText(host, \"accessible-description\", props.accessibleDescription);\n host.setActivatable(props.isActivatable);\n host.setFocusable(props.isFocusable);\n host.setSelectable(props.isSelectable);\n}\n\nfunction ItemCellImpl({ entry, render, collection, expandedIds, expanderDescriptions }: ItemCellProps): ReactNode {\n const slot = useItemSlot(entry, collection, expandedIds);\n const body = itemBody(slot, render, expanderDescriptions);\n\n return createPortal(body, entry.host, entry.key);\n}\n\nfunction ItemRowImpl({ entry, rowProps, collection, expandedIds }: ItemRowProps): ReactNode {\n const slot = useItemSlot(entry, collection, expandedIds);\n const props = rowPropsFor(slot, rowProps);\n\n useLayoutEffect(() => {\n applyRowProps(entry.host, props);\n });\n\n return null;\n}\n\nfunction HeaderCellImpl({ entry, render, collection }: HeaderCellProps): ReactNode {\n const item = useSyncExternalStore(entry.subscribe, entry.getItem);\n const ref = slotRefFor(item);\n const renderHeader = render as ListSectionRenderer<unknown>;\n const body = ref === null ? null : renderHeader({ section: collection.sectionFor(ref.store.path) });\n\n return createPortal(body, entry.host, entry.key);\n}\n\nfunction usePortalEntries<H extends FactoryHost>(registry: CellRegistry<H>): CellEntry<H>[] {\n useSyncExternalStore(registry.subscribe, registry.getVersion);\n\n return registry.getEntries();\n}\n\nconst ItemPortals = ({\n registry,\n render,\n collection,\n expandedIds,\n expanderDescriptions,\n}: ItemPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <ItemCell\n key={entry.key}\n entry={entry}\n render={render}\n collection={collection}\n expandedIds={expandedIds}\n expanderDescriptions={expanderDescriptions}\n />\n ));\n\nconst RowPortals = ({ registry, rowProps, collection, expandedIds }: RowPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <ItemRow\n key={entry.key}\n entry={entry}\n rowProps={rowProps}\n collection={collection}\n expandedIds={expandedIds}\n />\n ));\n\nconst HeaderPortals = ({ registry, render, collection }: HeaderPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <HeaderCell key={entry.key} entry={entry} render={render} collection={collection} />\n ));\n\nconst useSectionHeader = (\n render: ListSectionRenderer<never> | null | undefined,\n collection: Collection,\n size: CellSize,\n): SectionHeaderSlot => {\n const registry = useHeaderCells(size);\n\n if (render == null) {\n return { factoryProps: {}, portals: null };\n }\n\n return {\n factoryProps: { headerFactory: <GtkSignalListItemFactory {...registry.handlers} /> },\n portals: <HeaderPortals registry={registry} render={render} collection={collection} />,\n };\n};\n\nconst useRowProps = (\n rowProps: ListRowPropsResolver<never> | null | undefined,\n collection: Collection,\n expandedIds: string[] | null | undefined,\n): RowSlot => {\n const registry = useCellRegistry(ROW_OPTIONS, NO_SIZE);\n\n if (rowProps == null) {\n return { factoryProps: {}, portals: null };\n }\n\n return {\n factoryProps: { rowFactory: <GtkSignalListItemFactory {...registry.handlers} /> },\n portals: (\n <RowPortals registry={registry} rowProps={rowProps} collection={collection} expandedIds={expandedIds} />\n ),\n };\n};\n\nexport {\n useItemCells,\n useRowProps,\n useSectionHeader,\n ItemPortals,\n type CellSize,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"cells.js","sourceRoot":"","sources":["../../src/internal/cells.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAW9E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAoInD,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;AACpC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;AAClC,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,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AC;AAEF,MAAM,WAAW,GAAG,CAChB,QAAwD,EACxD,UAAsB,EACtB,WAAwC,EACjC,EAAE;IACT,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAEvD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO;QACH,YAAY,EAAE,EAAE,UAAU,EAAE,KAAC,wBAAwB,OAAK,QAAQ,CAAC,QAAQ,GAAI,EAAE;QACjF,OAAO,EAAE,CACL,KAAC,UAAU,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,GAAI,CAC3G;KACJ,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EACH,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,GAEd,CAAC","sourcesContent":["import type * as GObject from \"@gtkx/gi/gobject\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { GtkSignalListItemFactory, GtkTreeExpander } from \"@gtkx/jsx/gtk\";\nimport { createPortal, useProperty } from \"@gtkx/react\";\nimport { setObjectProperty, t } from \"@gtkx/runtime\";\nimport { memo, useLayoutEffect, useState, useSyncExternalStore } from \"react\";\nimport type {\n ExpanderDescriptions,\n ListItem,\n ListItemRenderArgs,\n ListItemRenderer,\n ListRowProps,\n ListRowPropsResolver,\n ListSectionRenderer,\n} from \"../types.js\";\nimport type { Collection } from \"./collection.js\";\nimport { slotRefFor } from \"./collection-model.js\";\n\ntype CellSize = {\n width: number;\n height: number;\n};\n\ntype FactoryHost = GObject.Object & {\n getItem: () => GObject.Object | null;\n};\n\ntype CellHost = FactoryHost & {\n getChild: () => Gtk.Widget | null;\n setChild: (child: Gtk.Widget | null) => void;\n};\n\ntype CellEntry<H extends FactoryHost> = {\n key: string;\n host: H;\n item: GObject.Object | null;\n listeners: Set<() => void>;\n subscribe: (onChange: () => void) => () => void;\n getItem: () => GObject.Object | null;\n};\n\ntype FactoryHandlers = {\n onSetup: (host: GObject.Object) => void;\n onBind: (host: GObject.Object) => void;\n onUnbind: (host: GObject.Object) => void;\n onTeardown: (host: GObject.Object) => void;\n};\n\ntype CellRegistry<H extends FactoryHost> = {\n handlers: FactoryHandlers;\n setSize: (size: CellSize) => void;\n subscribe: (onChange: () => void) => () => void;\n getVersion: () => number;\n getEntries: () => CellEntry<H>[];\n};\n\ntype HostGuard<H extends FactoryHost> = (value: GObject.Object) => value is H;\n\ntype CellRegistryOptions<H extends FactoryHost> = {\n isHost: HostGuard<H>;\n prepare?: ((host: H, size: CellSize) => void) | undefined;\n};\n\ntype CellRegistryState<H extends FactoryHost> = CellRegistryOptions<H> & {\n size: CellSize;\n entries: Map<H, CellEntry<H>>;\n snapshot: CellEntry<H>[] | null;\n listeners: Set<() => void>;\n serial: number;\n version: number;\n};\n\ntype ResolvedRowProps = {\n accessibleLabel: string | null;\n accessibleDescription: string | null;\n isActivatable: boolean;\n isFocusable: boolean;\n isSelectable: boolean;\n};\n\ntype ItemSlotOptions = {\n item: GObject.Object | null;\n position: number | undefined;\n row: Gtk.TreeListRow | null;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype PositionedHost = Gtk.ListItem | Gtk.ColumnViewRow;\n\ntype ItemSlot = {\n item: ListItem;\n row: Gtk.TreeListRow | null;\n args: ListItemRenderArgs<unknown>;\n};\n\ntype ItemCellProps = {\n entry: CellEntry<Gtk.ListItem>;\n render: ListItemRenderer<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n expanderDescriptions: ExpanderDescriptions | null | undefined;\n};\n\ntype ItemPortalsProps = {\n registry: CellRegistry<Gtk.ListItem>;\n render: ListItemRenderer<never>;\n collection: Collection;\n expandedIds?: string[] | null | undefined;\n expanderDescriptions?: ExpanderDescriptions | null | undefined;\n};\n\ntype ItemRowProps = {\n entry: CellEntry<Gtk.ColumnViewRow>;\n rowProps: ListRowPropsResolver<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype RowPortalsProps = {\n registry: CellRegistry<Gtk.ColumnViewRow>;\n rowProps: ListRowPropsResolver<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n};\n\ntype HeaderCellProps = {\n entry: CellEntry<Gtk.ListHeader>;\n render: ListSectionRenderer<never>;\n collection: Collection;\n};\n\ntype HeaderPortalsProps = {\n registry: CellRegistry<Gtk.ListHeader>;\n render: ListSectionRenderer<never>;\n collection: Collection;\n};\n\ntype SectionHeaderSlot = {\n factoryProps: { headerFactory?: ReactElement };\n portals: ReactNode;\n};\n\ntype RowSlot = {\n factoryProps: { rowFactory?: ReactElement };\n portals: ReactNode;\n};\n\nconst ItemCell = memo(ItemCellImpl);\nconst ItemRow = memo(ItemRowImpl);\nconst HeaderCell = memo(HeaderCellImpl);\nconst CELL_OPTIONS: CellRegistryOptions<Gtk.ListItem> = { isHost: isListItem, prepare: prepareCell };\nconst HEADER_OPTIONS: CellRegistryOptions<Gtk.ListHeader> = { isHost: isListHeader, prepare: prepareCell };\nconst ROW_OPTIONS: CellRegistryOptions<Gtk.ColumnViewRow> = { isHost: isColumnViewRow };\nconst NO_SIZE: CellSize = { width: -1, height: -1 };\nconst NO_ROW_PROPS: ListRowProps = {};\nconst ROW_TEXT_DESCRIPTOR = t.string(\"borrowed\");\n\nconst placeholder = (size: CellSize): Gtk.Widget =>\n new Gtk.Box({ widthRequest: size.width, heightRequest: size.height });\n\nfunction isListItem(value: GObject.Object): value is Gtk.ListItem {\n return value instanceof Gtk.ListItem;\n}\n\nfunction isListHeader(value: GObject.Object): value is Gtk.ListHeader {\n return value instanceof Gtk.ListHeader;\n}\n\nfunction isColumnViewRow(value: GObject.Object): value is Gtk.ColumnViewRow {\n return value instanceof Gtk.ColumnViewRow;\n}\n\nfunction prepareCell(host: CellHost, size: CellSize): void {\n if (host.getChild() === null) {\n host.setChild(placeholder(size));\n }\n}\n\nfunction notifyEntry<H extends FactoryHost>(entry: CellEntry<H>): void {\n for (const listener of entry.listeners) {\n listener();\n }\n}\n\nfunction notifyRegistry<H extends FactoryHost>(state: CellRegistryState<H>): void {\n state.snapshot = null;\n state.version += 1;\n\n for (const listener of state.listeners) {\n listener();\n }\n}\n\nfunction createEntry<H extends FactoryHost>(state: CellRegistryState<H>, host: H): CellEntry<H> {\n state.serial += 1;\n\n const entry: CellEntry<H> = {\n key: `gtkx-cell-${String(state.serial)}`,\n host,\n item: null,\n listeners: new Set(),\n subscribe: (onChange) => {\n entry.listeners.add(onChange);\n\n return () => {\n entry.listeners.delete(onChange);\n };\n },\n getItem: () => entry.item,\n };\n\n return entry;\n}\n\nfunction setupHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n state.prepare?.(host, state.size);\n state.entries.set(host, createEntry(state, host));\n notifyRegistry(state);\n}\n\nfunction teardownHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n if (state.entries.delete(host)) {\n notifyRegistry(state);\n }\n}\n\nfunction writeBinding<H extends FactoryHost>(state: CellRegistryState<H>, host: H, item: GObject.Object | null): void {\n const entry = state.entries.get(host);\n\n if (entry === undefined) {\n return;\n }\n\n entry.item = item;\n notifyEntry(entry);\n}\n\nfunction bindHost<H extends FactoryHost>(state: CellRegistryState<H>, host: H): void {\n state.prepare?.(host, state.size);\n writeBinding(state, host, host.getItem());\n}\n\nfunction subscribeRegistry<H extends FactoryHost>(state: CellRegistryState<H>, onChange: () => void): () => void {\n state.listeners.add(onChange);\n\n return () => {\n state.listeners.delete(onChange);\n };\n}\n\nfunction getRegistryEntries<H extends FactoryHost>(state: CellRegistryState<H>): CellEntry<H>[] {\n state.snapshot ??= state.entries.values().toArray();\n\n return state.snapshot;\n}\n\nfunction guarded<H extends FactoryHost>(isHost: HostGuard<H>, run: (host: H) => void): (host: GObject.Object) => void {\n return (host) => {\n if (isHost(host)) {\n run(host);\n }\n };\n}\n\nfunction createHandlers<H extends FactoryHost>(state: CellRegistryState<H>): FactoryHandlers {\n const { isHost } = state;\n\n return {\n onSetup: guarded(isHost, (host) => {\n setupHost(state, host);\n }),\n onBind: guarded(isHost, (host) => {\n bindHost(state, host);\n }),\n onUnbind: guarded(isHost, (host) => {\n writeBinding(state, host, null);\n }),\n onTeardown: guarded(isHost, (host) => {\n teardownHost(state, host);\n }),\n };\n}\n\nfunction createCellRegistry<H extends FactoryHost>(options: CellRegistryOptions<H>, size: CellSize): CellRegistry<H> {\n const state: CellRegistryState<H> = {\n ...options,\n size,\n entries: new Map(),\n snapshot: null,\n listeners: new Set(),\n serial: 0,\n version: 0,\n };\n\n return {\n handlers: createHandlers(state),\n setSize: (next) => {\n state.size = next;\n },\n subscribe: (onChange) => subscribeRegistry(state, onChange),\n getVersion: () => state.version,\n getEntries: () => getRegistryEntries(state),\n };\n}\n\nfunction useCellRegistry<H extends FactoryHost>(options: CellRegistryOptions<H>, size: CellSize): CellRegistry<H> {\n const [registry] = useState(() => createCellRegistry(options, size));\n\n useLayoutEffect(() => {\n registry.setSize(size);\n });\n\n return registry;\n}\n\nfunction useItemCells(size: CellSize): CellRegistry<Gtk.ListItem> {\n return useCellRegistry(CELL_OPTIONS, size);\n}\n\nfunction useHeaderCells(size: CellSize): CellRegistry<Gtk.ListHeader> {\n return useCellRegistry(HEADER_OPTIONS, size);\n}\n\nfunction isRowWanted(options: ItemSlotOptions, item: ListItem): boolean {\n return options.expandedIds?.includes(item.id) ?? false;\n}\n\nfunction itemArgs(item: ListItem, options: ItemSlotOptions): ListItemRenderArgs<unknown> {\n const args: ListItemRenderArgs<unknown> = { item: item.value, index: options.position ?? 0 };\n const row = options.row;\n\n if (row === null) {\n return args;\n }\n\n args.depth = row.getDepth();\n\n if (row.isExpandable()) {\n args.isExpanded = isRowWanted(options, item);\n }\n\n return args;\n}\n\nfunction slotFor(options: ItemSlotOptions): ItemSlot | null {\n const ref = slotRefFor(options.item);\n const item = ref === null ? undefined : options.collection.itemAt(ref);\n\n if (item === undefined) {\n return null;\n }\n\n return { item, row: options.row, args: itemArgs(item, options) };\n}\n\nfunction useItemSlot(\n entry: CellEntry<PositionedHost>,\n collection: Collection,\n expandedIds: string[] | null | undefined,\n): ItemSlot | null {\n const position = useProperty(entry.host, \"position\");\n const item = useSyncExternalStore(entry.subscribe, entry.getItem);\n const row = item instanceof Gtk.TreeListRow ? item : null;\n\n return slotFor({ item, position, row, collection, expandedIds });\n}\n\nfunction expanderDescriptionFor(\n slot: ItemSlot,\n descriptions: ExpanderDescriptions | null | undefined,\n): string | undefined {\n const { isExpanded } = slot.args;\n\n if (isExpanded === undefined || descriptions == null) {\n return undefined;\n }\n\n return isExpanded ? descriptions.collapse : descriptions.expand;\n}\n\nfunction wrapExpander(\n slot: ItemSlot,\n content: ReactNode,\n descriptions: ExpanderDescriptions | null | undefined,\n): ReactNode {\n const { item, row } = slot;\n\n const expander: ReactNode =\n row === null\n ? (\n content\n )\n : (\n <GtkTreeExpander\n listRow={row}\n hideExpander={item.shouldHideExpander ?? false}\n indentForDepth={item.shouldIndentForDepth ?? true}\n indentForIcon={item.shouldIndentForIcon ?? true}\n accessibleDescription={expanderDescriptionFor(slot, descriptions)}\n >\n {content}\n </GtkTreeExpander>\n );\n\n return expander;\n}\n\nfunction itemBody(\n slot: ItemSlot | null,\n render: ListItemRenderer<never>,\n descriptions: ExpanderDescriptions | null | undefined,\n): ReactNode {\n if (slot === null) {\n return null;\n }\n\n const renderItem = render as ListItemRenderer<unknown>;\n\n return wrapExpander(slot, renderItem(slot.args), descriptions);\n}\n\nfunction rowText(value: string | undefined): string | null {\n return value ?? null;\n}\n\n/* eslint-disable-next-line unicorn/consistent-boolean-name -- reads the flag off a row, paired with rowText */\nfunction rowFlag(value: boolean | undefined): boolean {\n return value ?? true;\n}\n\nfunction rowPropsFor(slot: ItemSlot | null, rowProps: ListRowPropsResolver<never>): ResolvedRowProps {\n const resolve = rowProps as ListRowPropsResolver<unknown>;\n const props = slot === null ? NO_ROW_PROPS : resolve(slot.args);\n\n return {\n accessibleLabel: rowText(props.accessibleLabel),\n accessibleDescription: rowText(props.accessibleDescription),\n isActivatable: rowFlag(props.isActivatable),\n isFocusable: rowFlag(props.isFocusable),\n isSelectable: rowFlag(props.isSelectable),\n };\n}\n\nfunction setRowText(host: Gtk.ColumnViewRow, name: string, value: string | null): void {\n setObjectProperty(host, name, ROW_TEXT_DESCRIPTOR, value);\n}\n\nfunction applyRowProps(host: Gtk.ColumnViewRow, props: ResolvedRowProps): void {\n setRowText(host, \"accessible-label\", props.accessibleLabel);\n setRowText(host, \"accessible-description\", props.accessibleDescription);\n host.setActivatable(props.isActivatable);\n host.setFocusable(props.isFocusable);\n host.setSelectable(props.isSelectable);\n}\n\nfunction ItemCellImpl({ entry, render, collection, expandedIds, expanderDescriptions }: ItemCellProps): ReactNode {\n const slot = useItemSlot(entry, collection, expandedIds);\n const body = itemBody(slot, render, expanderDescriptions);\n\n return createPortal(body, entry.host, entry.key);\n}\n\nfunction ItemRowImpl({ entry, rowProps, collection, expandedIds }: ItemRowProps): ReactNode {\n const slot = useItemSlot(entry, collection, expandedIds);\n const props = rowPropsFor(slot, rowProps);\n\n useLayoutEffect(() => {\n applyRowProps(entry.host, props);\n });\n\n return null;\n}\n\nfunction HeaderCellImpl({ entry, render, collection }: HeaderCellProps): ReactNode {\n const item = useSyncExternalStore(entry.subscribe, entry.getItem);\n const ref = slotRefFor(item);\n const renderHeader = render as ListSectionRenderer<unknown>;\n const body = ref === null ? null : renderHeader({ section: collection.sectionFor(ref.store.level.path) });\n\n return createPortal(body, entry.host, entry.key);\n}\n\nfunction usePortalEntries<H extends FactoryHost>(registry: CellRegistry<H>): CellEntry<H>[] {\n useSyncExternalStore(registry.subscribe, registry.getVersion);\n\n return registry.getEntries();\n}\n\nconst ItemPortals = ({\n registry,\n render,\n collection,\n expandedIds,\n expanderDescriptions,\n}: ItemPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <ItemCell\n key={entry.key}\n entry={entry}\n render={render}\n collection={collection}\n expandedIds={expandedIds}\n expanderDescriptions={expanderDescriptions}\n />\n ));\n\nconst RowPortals = ({ registry, rowProps, collection, expandedIds }: RowPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <ItemRow\n key={entry.key}\n entry={entry}\n rowProps={rowProps}\n collection={collection}\n expandedIds={expandedIds}\n />\n ));\n\nconst HeaderPortals = ({ registry, render, collection }: HeaderPortalsProps): ReactNode =>\n usePortalEntries(registry).map((entry) => (\n <HeaderCell key={entry.key} entry={entry} render={render} collection={collection} />\n ));\n\nconst useSectionHeader = (\n render: ListSectionRenderer<never> | null | undefined,\n collection: Collection,\n size: CellSize,\n): SectionHeaderSlot => {\n const registry = useHeaderCells(size);\n\n if (render == null) {\n return { factoryProps: {}, portals: null };\n }\n\n return {\n factoryProps: { headerFactory: <GtkSignalListItemFactory {...registry.handlers} /> },\n portals: <HeaderPortals registry={registry} render={render} collection={collection} />,\n };\n};\n\nconst useRowProps = (\n rowProps: ListRowPropsResolver<never> | null | undefined,\n collection: Collection,\n expandedIds: string[] | null | undefined,\n): RowSlot => {\n const registry = useCellRegistry(ROW_OPTIONS, NO_SIZE);\n\n if (rowProps == null) {\n return { factoryProps: {}, portals: null };\n }\n\n return {\n factoryProps: { rowFactory: <GtkSignalListItemFactory {...registry.handlers} /> },\n portals: (\n <RowPortals registry={registry} rowProps={rowProps} collection={collection} expandedIds={expandedIds} />\n ),\n };\n};\n\nexport {\n useItemCells,\n useRowProps,\n useSectionHeader,\n ItemPortals,\n type CellSize,\n};\n"]}
|
|
@@ -7,11 +7,12 @@ type Level = {
|
|
|
7
7
|
type CollectionIndex = {
|
|
8
8
|
isTree: boolean;
|
|
9
9
|
groups: Level[];
|
|
10
|
-
|
|
10
|
+
childLevel: (level: Level, slot: number) => Level | undefined;
|
|
11
|
+
levelFor: (levelPath: string) => Level | undefined;
|
|
11
12
|
itemAt: (levelPath: string, slot: number) => ListItem | undefined;
|
|
12
13
|
sectionFor: (levelPath: string) => unknown;
|
|
13
|
-
expandablePathsFor: (id: string) => string[];
|
|
14
14
|
};
|
|
15
|
+
declare const emptyLevel: () => Level;
|
|
15
16
|
declare function createCollectionIndex(items: ListItem[] | undefined, sections: ListSection[] | undefined, isFlat: boolean): CollectionIndex;
|
|
16
|
-
export { createCollectionIndex, type CollectionIndex, type Level };
|
|
17
|
+
export { createCollectionIndex, emptyLevel, type CollectionIndex, type Level };
|
|
17
18
|
//# sourceMappingURL=collection-index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-index.d.ts","sourceRoot":"","sources":["../../src/internal/collection-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzD,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,eAAe,EAAE,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"collection-index.d.ts","sourceRoot":"","sources":["../../src/internal/collection-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGzD,KAAK,KAAK,GAAG;IACT,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,eAAe,EAAE,OAAO,EAAE,CAAC;CAC9B,CAAC;AAEF,KAAK,eAAe,GAAG;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,KAAK,KAAK,GAAG,SAAS,CAAC;IAC9D,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,KAAK,GAAG,SAAS,CAAC;IACnD,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAClE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC9C,CAAC;AAWF,QAAA,MAAM,UAAU,QAAO,KAAuD,CAAC;AA0F/E,iBAAS,qBAAqB,CAC1B,KAAK,EAAE,QAAQ,EAAE,GAAG,SAAS,EAC7B,QAAQ,EAAE,WAAW,EAAE,GAAG,SAAS,EACnC,MAAM,EAAE,OAAO,GAChB,eAAe,CAoBjB;AAED,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,KAAK,EAAE,CAAC"}
|
|
@@ -1,69 +1,86 @@
|
|
|
1
|
-
import { encodePart } from "./keys.js";
|
|
2
|
-
const
|
|
1
|
+
import { decodePartAt, encodePart } from "./keys.js";
|
|
2
|
+
const emptyLevel = () => ({ path: "", items: [], expandableFlags: [] });
|
|
3
3
|
const hasChildren = (item) => item.children !== undefined && item.children.length > 0;
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
existing.push(path);
|
|
4
|
+
function newLevel(state, path, items) {
|
|
5
|
+
const expandableFlags = state.isTree ? items.map((item) => hasChildren(item)) : [];
|
|
6
|
+
const level = { path, items, expandableFlags };
|
|
7
|
+
state.levels.set(path, level);
|
|
8
|
+
return level;
|
|
11
9
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
pushPath(state.expandablePaths, item.id, slotPath);
|
|
19
|
-
state.children.set(slotPath, collectLevel(state, slotPath, item.children ?? []));
|
|
10
|
+
function slotItems(state, parent, slot) {
|
|
11
|
+
const owner = state.levels.get(parent.path) === parent ? parent : levelFor(state, parent.path);
|
|
12
|
+
const item = owner?.items[slot];
|
|
13
|
+
return item !== undefined && hasChildren(item) ? item.children : undefined;
|
|
20
14
|
}
|
|
21
|
-
function
|
|
22
|
-
const level = { path, items, expandableFlags: [] };
|
|
23
|
-
state.levels.set(path, level);
|
|
15
|
+
function childLevel(state, parent, slot) {
|
|
24
16
|
if (!state.isTree) {
|
|
25
|
-
return
|
|
17
|
+
return undefined;
|
|
26
18
|
}
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
const path = parent.path + encodePart(String(slot));
|
|
20
|
+
const cached = state.levels.get(path);
|
|
21
|
+
if (cached !== undefined) {
|
|
22
|
+
return cached;
|
|
23
|
+
}
|
|
24
|
+
const items = slotItems(state, parent, slot);
|
|
25
|
+
return items === undefined ? undefined : newLevel(state, path, items);
|
|
26
|
+
}
|
|
27
|
+
function descendPath(state, levelPath, group) {
|
|
28
|
+
let level = state.levels.get(encodePart(group));
|
|
29
|
+
let offset = encodePart(group).length;
|
|
30
|
+
while (level !== undefined && offset < levelPath.length) {
|
|
31
|
+
const part = decodePartAt(levelPath, offset);
|
|
32
|
+
if (part === null) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
level = childLevel(state, level, Number(part));
|
|
36
|
+
offset += encodePart(part).length;
|
|
29
37
|
}
|
|
30
38
|
return level;
|
|
31
39
|
}
|
|
40
|
+
function levelFor(state, levelPath) {
|
|
41
|
+
const cached = state.levels.get(levelPath);
|
|
42
|
+
if (cached !== undefined) {
|
|
43
|
+
return cached;
|
|
44
|
+
}
|
|
45
|
+
const group = decodePartAt(levelPath, 0);
|
|
46
|
+
return group === null ? undefined : descendPath(state, levelPath, group);
|
|
47
|
+
}
|
|
32
48
|
function buildGroups(state, source, sections) {
|
|
33
49
|
if (sections === undefined) {
|
|
34
|
-
return [
|
|
50
|
+
return [newLevel(state, encodePart("0"), source)];
|
|
35
51
|
}
|
|
36
52
|
return sections.map((section, group) => {
|
|
37
53
|
const path = encodePart(String(group));
|
|
38
54
|
state.sectionValues.set(path, section.value);
|
|
39
|
-
return
|
|
55
|
+
return newLevel(state, path, section.data);
|
|
40
56
|
});
|
|
41
57
|
}
|
|
42
58
|
function isTreeSource(source, sections, isFlat) {
|
|
43
|
-
if (
|
|
59
|
+
if (isFlat) {
|
|
44
60
|
return false;
|
|
45
61
|
}
|
|
46
|
-
|
|
62
|
+
if (sections === undefined) {
|
|
63
|
+
return source.some((item) => hasChildren(item));
|
|
64
|
+
}
|
|
65
|
+
return sections.some((section) => section.data.some((item) => hasChildren(item)));
|
|
47
66
|
}
|
|
48
67
|
function createCollectionIndex(items, sections, isFlat) {
|
|
49
68
|
const source = items ?? [];
|
|
50
69
|
const state = {
|
|
51
70
|
isTree: isTreeSource(source, sections, isFlat),
|
|
52
71
|
groups: [],
|
|
53
|
-
children: new Map(),
|
|
54
72
|
levels: new Map(),
|
|
55
|
-
expandablePaths: new Map(),
|
|
56
73
|
sectionValues: new Map(),
|
|
57
74
|
};
|
|
58
75
|
state.groups = buildGroups(state, source, sections);
|
|
59
76
|
return {
|
|
60
77
|
isTree: state.isTree,
|
|
61
78
|
groups: state.groups,
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
childLevel: (level, slot) => childLevel(state, level, slot),
|
|
80
|
+
levelFor: (levelPath) => levelFor(state, levelPath),
|
|
81
|
+
itemAt: (levelPath, slot) => levelFor(state, levelPath)?.items[slot],
|
|
64
82
|
sectionFor: (levelPath) => state.sectionValues.get(levelPath),
|
|
65
|
-
expandablePathsFor: (id) => state.expandablePaths.get(id) ?? NO_PATHS,
|
|
66
83
|
};
|
|
67
84
|
}
|
|
68
|
-
export { createCollectionIndex };
|
|
85
|
+
export { createCollectionIndex, emptyLevel };
|
|
69
86
|
//# sourceMappingURL=collection-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-index.js","sourceRoot":"","sources":["../../src/internal/coll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,CAAC,SAAS,CAAC;KAChE,CAAC;AACN,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAoC,CAAC","sourcesContent":["import type { ListItem, ListSection } from \"../types.js\";\nimport { decodePartAt, encodePart } from \"./keys.js\";\n\ntype Level = {\n path: string;\n items: ListItem[];\n expandableFlags: boolean[];\n};\n\ntype CollectionIndex = {\n isTree: boolean;\n groups: Level[];\n childLevel: (level: Level, slot: number) => Level | undefined;\n levelFor: (levelPath: string) => Level | undefined;\n itemAt: (levelPath: string, slot: number) => ListItem | undefined;\n sectionFor: (levelPath: string) => unknown;\n};\n\ntype IndexState = {\n isTree: boolean;\n groups: Level[];\n levels: Map<string, Level>;\n sectionValues: Map<string, unknown>;\n};\n\ntype ParentItem = ListItem & { children: ListItem[] };\n\nconst emptyLevel = (): Level => ({ path: \"\", items: [], expandableFlags: [] });\nconst hasChildren = (item: ListItem): item is ParentItem => item.children !== undefined && item.children.length > 0;\n\nfunction newLevel(state: IndexState, path: string, items: ListItem[]): Level {\n const expandableFlags = state.isTree ? items.map((item) => hasChildren(item)) : [];\n const level: Level = { path, items, expandableFlags };\n state.levels.set(path, level);\n\n return level;\n}\n\nfunction slotItems(state: IndexState, parent: Level, slot: number): ListItem[] | undefined {\n const owner = state.levels.get(parent.path) === parent ? parent : levelFor(state, parent.path);\n const item = owner?.items[slot];\n\n return item !== undefined && hasChildren(item) ? item.children : undefined;\n}\n\nfunction childLevel(state: IndexState, parent: Level, slot: number): Level | undefined {\n if (!state.isTree) {\n return undefined;\n }\n\n const path = parent.path + encodePart(String(slot));\n const cached = state.levels.get(path);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const items = slotItems(state, parent, slot);\n\n return items === undefined ? undefined : newLevel(state, path, items);\n}\n\nfunction descendPath(state: IndexState, levelPath: string, group: string): Level | undefined {\n let level = state.levels.get(encodePart(group));\n let offset = encodePart(group).length;\n\n while (level !== undefined && offset < levelPath.length) {\n const part = decodePartAt(levelPath, offset);\n\n if (part === null) {\n return undefined;\n }\n\n level = childLevel(state, level, Number(part));\n offset += encodePart(part).length;\n }\n\n return level;\n}\n\nfunction levelFor(state: IndexState, levelPath: string): Level | undefined {\n const cached = state.levels.get(levelPath);\n\n if (cached !== undefined) {\n return cached;\n }\n\n const group = decodePartAt(levelPath, 0);\n\n return group === null ? undefined : descendPath(state, levelPath, group);\n}\n\nfunction buildGroups(state: IndexState, source: ListItem[], sections: ListSection[] | undefined): Level[] {\n if (sections === undefined) {\n return [newLevel(state, encodePart(\"0\"), source)];\n }\n\n return sections.map((section, group) => {\n const path = encodePart(String(group));\n state.sectionValues.set(path, section.value);\n\n return newLevel(state, path, section.data);\n });\n}\n\nfunction isTreeSource(source: ListItem[], sections: ListSection[] | undefined, isFlat: boolean): boolean {\n if (isFlat) {\n return false;\n }\n\n if (sections === undefined) {\n return source.some((item) => hasChildren(item));\n }\n\n return sections.some((section) => section.data.some((item) => hasChildren(item)));\n}\n\nfunction createCollectionIndex(\n items: ListItem[] | undefined,\n sections: ListSection[] | undefined,\n isFlat: boolean,\n): CollectionIndex {\n const source = items ?? [];\n\n const state: IndexState = {\n isTree: isTreeSource(source, sections, isFlat),\n groups: [],\n levels: new Map(),\n sectionValues: new Map(),\n };\n\n state.groups = buildGroups(state, source, sections);\n\n return {\n isTree: state.isTree,\n groups: state.groups,\n childLevel: (level, slot) => childLevel(state, level, slot),\n levelFor: (levelPath) => levelFor(state, levelPath),\n itemAt: (levelPath, slot) => levelFor(state, levelPath)?.items[slot],\n sectionFor: (levelPath) => state.sectionValues.get(levelPath),\n };\n}\n\nexport { createCollectionIndex, emptyLevel, type CollectionIndex, type Level };\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Gio from "@gtkx/gi/gio";
|
|
2
2
|
import * as GObject from "@gtkx/gi/gobject";
|
|
3
3
|
import * as Gtk from "@gtkx/gi/gtk";
|
|
4
|
-
import type { CollectionIndex } from "./collection-index.js";
|
|
4
|
+
import type { CollectionIndex, Level } from "./collection-index.js";
|
|
5
5
|
import type { TreeExpansion } from "./tree-expansion.js";
|
|
6
6
|
type LevelStore = Gio.ListModel & LazyLevelStore;
|
|
7
7
|
type SlotRef = {
|
|
@@ -11,7 +11,7 @@ type SlotRef = {
|
|
|
11
11
|
type CollectionModel = {
|
|
12
12
|
model: Gtk.FlattenListModel;
|
|
13
13
|
expansion: TreeExpansion;
|
|
14
|
-
|
|
14
|
+
rowAt: (position: number) => Gtk.TreeListRow | null;
|
|
15
15
|
sync: (index: CollectionIndex) => void;
|
|
16
16
|
};
|
|
17
17
|
declare function slotRefFor(value: GObject.Object | null): SlotRef | null;
|
|
@@ -19,11 +19,10 @@ declare function slotPathAt(store: LevelStore, slot: number): string;
|
|
|
19
19
|
declare function createCollectionModel(): CollectionModel;
|
|
20
20
|
declare class LazyLevelStore extends GObject.Object implements Gio.ListModelImpl {
|
|
21
21
|
itemsChanged: Gio.ListModel["itemsChanged"];
|
|
22
|
-
|
|
22
|
+
level: Level;
|
|
23
23
|
refs: SlotRef[];
|
|
24
24
|
objects: (Gtk.StringObject | null)[];
|
|
25
25
|
childStores: (LevelStore | null)[];
|
|
26
|
-
expandableFlags: boolean[];
|
|
27
26
|
private createItem;
|
|
28
27
|
vfuncGetItemType(): bigint;
|
|
29
28
|
vfuncGetNItems(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-model.d.ts","sourceRoot":"","sources":["../../src/internal/collection-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"collection-model.d.ts","sourceRoot":"","sources":["../../src/internal/collection-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,OAAO,MAA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