@kerfjs/ui 5.0.0-beta.126 → 5.0.0-beta.127
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/ai/component-props.json +20 -0
- package/ai/public-api-signatures-v1.md +7 -5
- package/ai/webawesome-jsx-signatures-v1.md +1 -1
- package/dist/browser/editor.js +3 -1
- package/dist/{chunk-NR3ZO4LK.js → chunk-7U65KLDL.js} +1 -1
- package/dist/chunk-7U65KLDL.js.map +1 -0
- package/dist/chunk-BMOZSNDU.js +133 -0
- package/dist/chunk-BMOZSNDU.js.map +1 -0
- package/dist/chunk-GHV36C6I.js +94 -0
- package/dist/chunk-GHV36C6I.js.map +1 -0
- package/dist/{chunk-Z3BT2SZE.js → chunk-GQUDCWOD.js} +8 -2
- package/dist/chunk-GQUDCWOD.js.map +1 -0
- package/dist/{chunk-3SCGTP5O.js → chunk-HD7ZLISK.js} +137 -11
- package/dist/chunk-HD7ZLISK.js.map +1 -0
- package/dist/column-explorer.d.ts +1 -1
- package/dist/column-explorer.js +16 -138
- package/dist/column-explorer.js.map +1 -1
- package/dist/editor.js +838 -115
- package/dist/editor.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/list-detail-dialog.js +1 -1
- package/dist/styles/components/surfaces/editor-frame/editor-frame.css +8 -1
- package/dist/styles/components/surfaces/surface-scaffold/surface-scaffold.css +32 -0
- package/dist/styles/editor/editor.css +23 -0
- package/dist/styles/editor-frame.css +8 -1
- package/dist/styles/surface-scaffold.css +32 -0
- package/dist/surface-scaffold.d.ts +3 -1
- package/dist/surface-scaffold.js +1 -1
- package/dist/tree-list.d.ts +2 -2
- package/dist/tree-list.js +2 -2
- package/dist/{tree-rows-eHnnGLGM.d.ts → tree-rows-Bms5QJvG.d.ts} +3 -0
- package/dist/wire-column-explorer.js +1 -92
- package/dist/wire-column-explorer.js.map +1 -1
- package/dist/workbench-dialog.js +1 -1
- package/docs/view.md +19 -0
- package/package.json +4 -2
- package/ux-demo/recipes/app-shell.tsx +48 -141
- package/ux-demo/recipes/collapsible-sidebar.tsx +43 -169
- package/ux-demo/recipes/compact-toolbar.tsx +22 -114
- package/ux-demo/recipes/composer-form.tsx +14 -104
- package/ux-demo/recipes/list-detail-dialog.tsx +38 -84
- package/ux-demo/recipes/list-workspace-states.tsx +29 -152
- package/ux-demo/recipes/loading-inspector.tsx +30 -174
- package/ux-demo/recipes/media-detail.tsx +29 -146
- package/ux-demo/recipes/navigation-sidebar.tsx +24 -113
- package/ux-demo/recipes/navigation-stack.tsx +7 -43
- package/ux-demo/recipes/workspace-header.tsx +2 -66
- package/view/generate.mjs +34 -14
- package/dist/chunk-3SCGTP5O.js.map +0 -1
- package/dist/chunk-NR3ZO4LK.js.map +0 -1
- package/dist/chunk-Z3BT2SZE.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/collections/column-explorer/model/columns.ts","../src/components/collections/column-explorer/column-explorer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAuBO,SAAS,eAAA,CACd,OACA,IAAA,EACkB;AAClB,EAAA,MAAM,UAA4B,EAAC;AACnC,EAAA,IAAI,QAAA,GAAoC,KAAA;AACxC,EAAA,IAAI,MAAA;AACJ,EAAA,KAAA,IAAS,KAAA,GAAQ,CAAA,IAAK,KAAA,IAAS,CAAA,EAAG;AAChC,IAAA,MAAM,MAAA,GAAS,SAAS,IAAA,CAAK,CAAC,SAAS,IAAA,CAAK,EAAA,KAAO,IAAA,CAAK,KAAK,CAAC,CAAA;AAC9D,IAAA,OAAA,CAAQ,IAAA,CAAK;AAAA,MACX,KAAA;AAAA,MACA,GAAI,MAAA,GAAS,EAAE,MAAA,KAAW,EAAC;AAAA,MAC3B,KAAA,EAAO,QAAA;AAAA,MACP,GAAI,MAAA,GAAS,EAAE,QAAQ,MAAA,CAAO,EAAA,KAAO;AAAC,KACvC,CAAA;AACD,IAAA,IAAI,CAAC,MAAA,IAAU,CAAC,YAAA,CA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AAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAK,QAAA;AAAA,oBACL;AAAA,mBAAA,EACH,IAEA,IAAA,CAAK,QAAA;AAAA,kBAGT,QAAA,EAAU,IAAA,CAAK,EAAA,KAAO,MAAA,CAAO,MAAA;AAAA,kBAC7B,UAAU,IAAA,CAAK,QAAA;AAAA,kBACf,OAAA;AAAA,kBACA,QAAA,EAAU,IAAA,CAAK,EAAA,KAAO,IAAA,GAAO,CAAA,GAAI,EAAA;AAAA,kBACjC,cAAA,EAAgB;AAAA,oBACd,YAAY,IAAA,CAAK,EAAA;AAAA,oBACjB,4BAAA,EAA8B,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA;AAAA,oBACjD,iBAAA,EAAmB,YAAA,CAAa,IAAI,CAAA,GAAI,MAAA,GAAS;AAAA;AACnD;AAAA,eAEH;AAAA;AAAA,WACH;AAAA,QAEJ,CAAC,CAAA;AAAA,QACA,WAAA,mBACC,GAAA;AAAA,UAAC,IAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAU,IAAA;AAAA,YACV,IAAA,EAAI,IAAA;AAAA,YACJ,cAAA,EAAgB;AAAA,cACd,IAAA,EAAM,OAAA;AAAA,cACN,YAAA,EAAc,CAAA,EAAG,MAAA,CAAO,MAAA,CAAO,KAAK,CAAC,CAAA,QAAA,CAAA;AAAA,cACrC,8BAAA,EAAgC;AAAA,aAClC;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA,SACH,GACE;AAAA,OAAA,EACN;AAAA;AAAA,GACF;AAEJ","file":"column-explorer.js","sourcesContent":["// KF-JY68DQ: the columns a column explorer shows for a chosen path through a\n// hierarchy. It walks the same TreeListNode model as TreeList, DOM-free.\nimport {\n isExpandable,\n type TreeListNode,\n} from '../../tree-list/model/tree-rows.js';\n\n/** One column: the children of the node chosen in the column before it. */\nexport interface ExplorerColumn {\n /** 0 for the top level. */\n readonly level: number;\n /** The node whose children this column lists, or undefined at the top. */\n readonly parent?: TreeListNode;\n readonly nodes: readonly TreeListNode[];\n /** The id chosen in this column, when the path reaches it. */\n readonly chosen?: string;\n}\n\n/**\n * The columns for `path` (ids from the top level down): the top level, then\n * the children of each chosen node that can expand. A path id that is not a\n * child of the column before it ends the walk there.\n */\nexport function explorerColumns(\n nodes: readonly TreeListNode[],\n path: readonly string[],\n): ExplorerColumn[] {\n const columns: ExplorerColumn[] = [];\n let siblings: readonly TreeListNode[] = nodes;\n let parent: TreeListNode | undefined;\n for (let level = 0; ; level += 1) {\n const chosen = siblings.find((node) => node.id === path[level]);\n columns.push({\n level,\n ...(parent ? { parent } : {}),\n nodes: siblings,\n ...(chosen ? { chosen: chosen.id } : {}),\n });\n if (!chosen || !isExpandable(chosen)) return columns;\n parent = chosen;\n siblings = chosen.children ?? [];\n }\n}\n\n/** The node at the end of `path`, when the whole path resolves. */\nexport function explorerChosen(\n nodes: readonly TreeListNode[],\n path: readonly string[],\n): TreeListNode | undefined {\n let siblings: readonly TreeListNode[] = nodes;\n let node: TreeListNode | undefined;\n for (const id of path) {\n node = siblings.find((candidate) => candidate.id === id);\n if (!node) return undefined;\n siblings = node.children ?? [];\n }\n return node;\n}\n","import type { SafeHtml } from 'kerfjs';\nimport { ChevronRight } from 'lucide';\n\nimport {\n filterDataAttributes,\n type RootDataAttributes,\n} from '../../../shared/dom/extension-attributes.js';\nimport type { CssLength } from '../../../shared/styles/css-values.js';\nimport { ColumnTrack } from '../../layout/column-track/column-track.js';\nimport { LucideIcon } from '../../media/lucide-icon/lucide-icon.js';\nimport { List } from '../list/list.js';\nimport { ListItem } from '../list-item/list-item.js';\nimport {\n isExpandable,\n type TreeListNode,\n} from '../tree-list/model/tree-rows.js';\nimport { explorerChosen, explorerColumns } from './model/columns.js';\n\nexport {\n explorerChosen,\n type ExplorerColumn,\n explorerColumns,\n} from './model/columns.js';\n\nconst COLUMN_EXPLORER_PROTECTED = new Set([\n 'data-component',\n 'data-column-explorer-id',\n]);\n\nexport interface ColumnExplorerProps {\n /** Identifies the explorer for `wireColumnExplorer` and in tests. */\n id: string;\n /** The explorer's accessible name, such as \"Files\". */\n label: string;\n /** The hierarchy, as TreeList's nodes. The application owns it. */\n nodes: readonly TreeListNode[];\n /**\n * The chosen ids from the top level down, one per column. The application\n * owns it: set it to `treeListPath(nodes, id)` when `action` reports a row.\n */\n path: readonly string[];\n /** Delegated action for choosing a row; the row's `data-item-id` names it. */\n action: string;\n /**\n * Content for a last column when the chosen node is a leaf, such as a\n * file's details.\n */\n preview?: SafeHtml;\n /** ColumnTrack's layout: `scroll` (default) or `paged` for a phone. */\n layout?: 'scroll' | 'paged';\n /** Each column's minimum width (ColumnTrack's default 250px). */\n minColumnWidth?: CssLength;\n /** How much of the next column a paged layout shows. */\n peek?: CssLength;\n /** Row density: `default` or `compact`. */\n density?: 'default' | 'compact' | /** @deprecated Use default. */ 'standard';\n className?: string;\n /** Safe `data-*` metadata for the explorer element. */\n rootAttributes?: RootDataAttributes;\n /** Native named-slot assignment when composed inside a web component. */\n slot?: string;\n}\n\nconst chevron = LucideIcon({ icon: ChevronRight, name: 'chevron-right' });\n\n/**\n * A macOS-style column explorer for a hierarchy: one column per level in a\n * ColumnTrack, where choosing a row with children opens the next column of\n * its children. The application owns the nodes and the chosen path and\n * handles `action`; wire the keyboard with `wireColumnExplorer`.\n */\nexport function ColumnExplorer({\n id,\n label,\n nodes,\n path,\n action,\n preview,\n layout,\n minColumnWidth,\n peek,\n density = 'default',\n className = '',\n rootAttributes = {},\n slot,\n}: ColumnExplorerProps) {\n const columns = explorerColumns(nodes, path);\n const chosen = explorerChosen(nodes, path);\n const showPreview =\n preview !== undefined && chosen !== undefined && !isExpandable(chosen);\n return (\n <div\n {...filterDataAttributes(rootAttributes, COLUMN_EXPLORER_PROTECTED)}\n id={id}\n role=\"region\"\n class={`kui-column-explorer ${className}`.trim()}\n aria-label={label}\n data-component=\"column-explorer\"\n data-column-explorer-id={id}\n slot={slot}\n >\n <ColumnTrack layout={layout} minColumnWidth={minColumnWidth} peek={peek}>\n {columns.map((column) => {\n // One Tab stop per column: its chosen row, else its first.\n const stop = column.chosen ?? column.nodes[0]?.id;\n return (\n <List\n scrollable\n fill\n rootAttributes={{\n role: 'group',\n 'aria-label': column.parent\n ? String(column.parent.label)\n : label,\n 'data-column-explorer-level': String(column.level),\n }}\n >\n {column.nodes.map((node) => (\n <ListItem\n action={action}\n itemId={node.id}\n label={node.label}\n description={node.description}\n icon={node.icon}\n trailing={\n isExpandable(node) ? (\n <>\n {node.trailing}\n {chevron}\n </>\n ) : (\n node.trailing\n )\n }\n selected={node.id === column.chosen}\n disabled={node.disabled}\n density={density}\n tabIndex={node.id === stop ? 0 : -1}\n rootAttributes={{\n 'data-key': node.id,\n 'data-column-explorer-level': String(column.level),\n 'data-expandable': isExpandable(node) ? 'true' : undefined,\n }}\n />\n ))}\n </List>\n );\n })}\n {showPreview ? (\n <List\n scrollable\n fill\n rootAttributes={{\n role: 'group',\n 'aria-label': `${String(chosen.label)} preview`,\n 'data-column-explorer-preview': 'true',\n }}\n >\n {preview}\n </List>\n ) : null}\n </ColumnTrack>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"column-explorer.js"}
|