@vp-tw/dirwell 0.0.0-stage → 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +182 -2
  4. package/THEME_PACKAGE_CONTRACT.md +64 -0
  5. package/THEMING.md +88 -0
  6. package/THIRD_PARTY_NOTICES.md +14 -0
  7. package/dist/bin.d.mts +1 -0
  8. package/dist/bin.mjs +306 -0
  9. package/dist/bin.mjs.map +1 -0
  10. package/dist/bun.d.mts +7 -0
  11. package/dist/bun.mjs +7 -0
  12. package/dist/bun.mjs.map +1 -0
  13. package/dist/config-BJG2Zc3Q.d.mts +34 -0
  14. package/dist/dev-server-Q7NC1wiB.mjs +132 -0
  15. package/dist/dev-server-Q7NC1wiB.mjs.map +1 -0
  16. package/dist/esbuild.d.mts +7 -0
  17. package/dist/esbuild.mjs +7 -0
  18. package/dist/esbuild.mjs.map +1 -0
  19. package/dist/farm.d.mts +7 -0
  20. package/dist/farm.mjs +7 -0
  21. package/dist/farm.mjs.map +1 -0
  22. package/dist/generator-CtX3iHhK.mjs +1783 -0
  23. package/dist/generator-CtX3iHhK.mjs.map +1 -0
  24. package/dist/index.d.mts +47 -0
  25. package/dist/index.mjs +74 -0
  26. package/dist/index.mjs.map +1 -0
  27. package/dist/model-CWjYM17j.d.mts +100 -0
  28. package/dist/rolldown.d.mts +7 -0
  29. package/dist/rolldown.mjs +7 -0
  30. package/dist/rolldown.mjs.map +1 -0
  31. package/dist/rollup.d.mts +7 -0
  32. package/dist/rollup.mjs +7 -0
  33. package/dist/rollup.mjs.map +1 -0
  34. package/dist/rsbuild.d.mts +7 -0
  35. package/dist/rsbuild.mjs +7 -0
  36. package/dist/rsbuild.mjs.map +1 -0
  37. package/dist/rspack.d.mts +7 -0
  38. package/dist/rspack.mjs +7 -0
  39. package/dist/rspack.mjs.map +1 -0
  40. package/dist/theme-components-CXzvdQY-.mjs +8 -0
  41. package/dist/theme-components-CXzvdQY-.mjs.map +1 -0
  42. package/dist/theme-components-DW0fv9_C.d.mts +141 -0
  43. package/dist/theme-components.d.mts +2 -0
  44. package/dist/theme-components.mjs +2 -0
  45. package/dist/theme-runtime.js +1128 -0
  46. package/dist/theme-worker.js +27 -0
  47. package/dist/unplugin-CKRUCTgW.d.mts +16 -0
  48. package/dist/unplugin-p6AXhL4F.mjs +421 -0
  49. package/dist/unplugin-p6AXhL4F.mjs.map +1 -0
  50. package/dist/unplugin.d.mts +2 -0
  51. package/dist/unplugin.mjs +2 -0
  52. package/dist/vite-JBsvRvuW.mjs +282 -0
  53. package/dist/vite-JBsvRvuW.mjs.map +1 -0
  54. package/dist/vite.d.mts +12 -0
  55. package/dist/vite.mjs +2 -0
  56. package/dist/vscode-icons/NOTICE.txt +16 -0
  57. package/dist/vscode-icons/default_file.svg +1 -0
  58. package/dist/vscode-icons/default_folder.svg +1 -0
  59. package/dist/vscode-icons/file_type_css.svg +1 -0
  60. package/dist/vscode-icons/file_type_html.svg +1 -0
  61. package/dist/vscode-icons/file_type_image.svg +1 -0
  62. package/dist/vscode-icons/file_type_js.svg +1 -0
  63. package/dist/vscode-icons/file_type_json.svg +1 -0
  64. package/dist/vscode-icons/file_type_markdown.svg +1 -0
  65. package/dist/vscode-icons/file_type_pdf2.svg +1 -0
  66. package/dist/vscode-icons/file_type_shell.svg +1 -0
  67. package/dist/vscode-icons/file_type_text.svg +1 -0
  68. package/dist/vscode-icons/file_type_typescript.svg +1 -0
  69. package/dist/vscode-icons/file_type_yaml.svg +1 -0
  70. package/dist/vscode-icons/file_type_zip.svg +1 -0
  71. package/dist/webpack.d.mts +7 -0
  72. package/dist/webpack.mjs +7 -0
  73. package/dist/webpack.mjs.map +1 -0
  74. package/package.json +133 -4
@@ -0,0 +1,7 @@
1
+ import { t as unplugin } from "./unplugin-p6AXhL4F.mjs";
2
+ //#region src/rspack.ts
3
+ const plugin = unplugin.rspack;
4
+ //#endregion
5
+ export { plugin as default };
6
+
7
+ //# sourceMappingURL=rspack.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rspack.mjs","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import type { UnpluginInstance } from \"unplugin\";\nimport unplugin, { type DirwellPluginInput } from \"./unplugin.ts\";\nexport type { DirwellPluginOptions } from \"./unplugin.ts\";\nconst plugin: UnpluginInstance<DirwellPluginInput, true>[\"rspack\"] = unplugin.rspack;\nexport default plugin;\n"],"mappings":";;AAGA,MAAM,SAA+D,SAAS"}
@@ -0,0 +1,8 @@
1
+ //#region src/theme-components.ts
2
+ function resolveThemeComponents(defaults, ...layers) {
3
+ return Object.assign({}, defaults, ...layers);
4
+ }
5
+ //#endregion
6
+ export { resolveThemeComponents as t };
7
+
8
+ //# sourceMappingURL=theme-components-CXzvdQY-.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-components-CXzvdQY-.mjs","names":[],"sources":["../src/theme-components.ts"],"sourcesContent":["import type {\n DirectoryData,\n FileSystemEntry,\n NameSortMode,\n SortDirection,\n SortField,\n} from \"./model.ts\";\nimport type { ThemeProject } from \"./theme-project.ts\";\nimport type { ResolvedIconSet } from \"./theme-default/icon-set.ts\";\n\nexport interface DefaultThemeRuntimeConfig {\n readonly colorScheme: boolean;\n readonly fuzzySearch: boolean;\n readonly globalSearch: boolean;\n readonly keyboardNavigation: boolean;\n readonly icons: ResolvedIconSet;\n readonly searchIndexHref: string;\n readonly entriesHref?: string;\n readonly workerHref?: string;\n readonly sorting: boolean;\n readonly sort: Readonly<{\n direction: SortDirection;\n directoriesFirst: boolean;\n field: SortField;\n nameMode: NameSortMode;\n }>;\n}\n\nexport type ThemeComponent<Props> = (props: Props) => string;\n\nexport interface BreadcrumbItem {\n readonly href: string | null;\n readonly label: string;\n readonly isCurrent: boolean;\n}\n\nexport interface EntryNavigation {\n readonly exitsExplorer: boolean;\n readonly href: string | null;\n}\n\nexport interface PageShellProps {\n readonly assets: string;\n readonly breadcrumbs: string;\n readonly directory: DirectoryData;\n readonly documentBaseHref: string | null;\n readonly emptyState: string;\n readonly entryList: string;\n readonly footer: string;\n readonly parentHref: string | null;\n readonly runtimeConfig: DefaultThemeRuntimeConfig;\n readonly styles: string;\n readonly toolbar: string;\n readonly visiblePath: string;\n}\n\nexport interface BreadcrumbsProps {\n readonly items: readonly BreadcrumbItem[];\n}\n\nexport interface ToolbarProps {\n readonly colorScheme: boolean;\n readonly fuzzySearch: boolean;\n readonly globalSearch: boolean;\n readonly keyboardNavigation: boolean;\n readonly searchIcon: string;\n readonly sorting: boolean;\n}\n\nexport interface EntryListItem {\n readonly entry: FileSystemEntry;\n readonly index: number;\n readonly navigation: EntryNavigation;\n}\n\nexport interface EntryListProps {\n readonly directory: DirectoryData;\n readonly parentHref: string | null;\n readonly rows: string;\n readonly sorting: boolean;\n}\n\nexport interface EntryRowProps extends EntryListItem {\n readonly icon: string;\n}\n\nexport interface EmptyStateProps {\n readonly message: string;\n}\n\nexport interface FooterProps {\n readonly iconNoticeHref?: string;\n /** Built-in icon attribution is linked through the Ledger README. */\n readonly iconNoticeKind?: \"built-in\" | \"custom\";\n readonly keyboardNavigation: boolean;\n readonly parentHref: string | null;\n readonly project: ThemeProject;\n}\n\nexport type IconName =\n | \"arrow-up\"\n | \"chevron-right\"\n | \"file\"\n | \"folder\"\n | \"link\"\n | \"moon\"\n | \"search\"\n | \"sun\";\n\nexport interface IconProps {\n readonly label?: string;\n readonly name: IconName;\n readonly size?: number;\n /** Source of a file-type image. Control icons continue to use the named SVG. */\n readonly src?: string;\n /** Image source used by the dark color scheme. */\n readonly darkSrc?: string;\n}\n\nexport interface DirwellThemeComponents {\n readonly PageShell: ThemeComponent<PageShellProps>;\n readonly Breadcrumbs: ThemeComponent<BreadcrumbsProps>;\n readonly Toolbar: ThemeComponent<ToolbarProps>;\n readonly EntryList: ThemeComponent<EntryListProps>;\n readonly EntryRow: ThemeComponent<EntryRowProps>;\n readonly EmptyState: ThemeComponent<EmptyStateProps>;\n readonly Footer: ThemeComponent<FooterProps>;\n readonly Icon: ThemeComponent<IconProps>;\n}\n\nexport type DirwellThemeComponentOverrides = Partial<DirwellThemeComponents>;\n\nexport function resolveThemeComponents(\n defaults: DirwellThemeComponents,\n ...layers: readonly DirwellThemeComponentOverrides[]\n): DirwellThemeComponents {\n return Object.assign({}, defaults, ...layers);\n}\n"],"mappings":";AAoIA,SAAgB,uBACd,UACA,GAAG,QACqB;CACxB,OAAO,OAAO,OAAO,CAAC,GAAG,UAAU,GAAG,MAAM;AAC9C"}
@@ -0,0 +1,141 @@
1
+ import { a as FileSystemEntry, c as NameSortMode, d as SortDirection, f as SortField, t as DirectoryData } from "./model-CWjYM17j.mjs";
2
+ //#region src/theme-project.d.ts
3
+ interface ThemeProject {
4
+ readonly author: string;
5
+ readonly authorUrl?: string;
6
+ readonly license: string;
7
+ readonly licenseUrl: string;
8
+ readonly name: string;
9
+ readonly repositoryUrl: string;
10
+ }
11
+ type ThemeProjectOptions = Readonly<Partial<ThemeProject>>;
12
+ //#endregion
13
+ //#region src/theme-default/icon-set.d.ts
14
+ interface DefaultThemeIconVariant {
15
+ /** SVG markup for entries without a matching extension. */
16
+ readonly file: string;
17
+ /** SVG markup for directories. */
18
+ readonly folder: string;
19
+ /** SVG markup keyed by lowercase file extension, without the leading dot. */
20
+ readonly byExtension?: Readonly<Record<string, string>>;
21
+ }
22
+ interface DefaultThemeIconSet {
23
+ readonly light: DefaultThemeIconVariant;
24
+ /** Omit to use the light icons in both color schemes. */
25
+ readonly dark?: DefaultThemeIconVariant;
26
+ /** Optional attribution included in generated sites and linked as Notices. */
27
+ readonly notice?: string;
28
+ }
29
+ interface ResolvedIconVariant {
30
+ readonly file: string;
31
+ readonly folder: string;
32
+ readonly byExtension: Readonly<Record<string, string>>;
33
+ }
34
+ interface ResolvedIconSet {
35
+ readonly light: ResolvedIconVariant;
36
+ readonly dark?: ResolvedIconVariant;
37
+ }
38
+ //#endregion
39
+ //#region src/theme-components.d.ts
40
+ interface DefaultThemeRuntimeConfig {
41
+ readonly colorScheme: boolean;
42
+ readonly fuzzySearch: boolean;
43
+ readonly globalSearch: boolean;
44
+ readonly keyboardNavigation: boolean;
45
+ readonly icons: ResolvedIconSet;
46
+ readonly searchIndexHref: string;
47
+ readonly entriesHref?: string;
48
+ readonly workerHref?: string;
49
+ readonly sorting: boolean;
50
+ readonly sort: Readonly<{
51
+ direction: SortDirection;
52
+ directoriesFirst: boolean;
53
+ field: SortField;
54
+ nameMode: NameSortMode;
55
+ }>;
56
+ }
57
+ type ThemeComponent<Props> = (props: Props) => string;
58
+ interface BreadcrumbItem {
59
+ readonly href: string | null;
60
+ readonly label: string;
61
+ readonly isCurrent: boolean;
62
+ }
63
+ interface EntryNavigation {
64
+ readonly exitsExplorer: boolean;
65
+ readonly href: string | null;
66
+ }
67
+ interface PageShellProps {
68
+ readonly assets: string;
69
+ readonly breadcrumbs: string;
70
+ readonly directory: DirectoryData;
71
+ readonly documentBaseHref: string | null;
72
+ readonly emptyState: string;
73
+ readonly entryList: string;
74
+ readonly footer: string;
75
+ readonly parentHref: string | null;
76
+ readonly runtimeConfig: DefaultThemeRuntimeConfig;
77
+ readonly styles: string;
78
+ readonly toolbar: string;
79
+ readonly visiblePath: string;
80
+ }
81
+ interface BreadcrumbsProps {
82
+ readonly items: readonly BreadcrumbItem[];
83
+ }
84
+ interface ToolbarProps {
85
+ readonly colorScheme: boolean;
86
+ readonly fuzzySearch: boolean;
87
+ readonly globalSearch: boolean;
88
+ readonly keyboardNavigation: boolean;
89
+ readonly searchIcon: string;
90
+ readonly sorting: boolean;
91
+ }
92
+ interface EntryListItem {
93
+ readonly entry: FileSystemEntry;
94
+ readonly index: number;
95
+ readonly navigation: EntryNavigation;
96
+ }
97
+ interface EntryListProps {
98
+ readonly directory: DirectoryData;
99
+ readonly parentHref: string | null;
100
+ readonly rows: string;
101
+ readonly sorting: boolean;
102
+ }
103
+ interface EntryRowProps extends EntryListItem {
104
+ readonly icon: string;
105
+ }
106
+ interface EmptyStateProps {
107
+ readonly message: string;
108
+ }
109
+ interface FooterProps {
110
+ readonly iconNoticeHref?: string;
111
+ /** Built-in icon attribution is linked through the Ledger README. */
112
+ readonly iconNoticeKind?: "built-in" | "custom";
113
+ readonly keyboardNavigation: boolean;
114
+ readonly parentHref: string | null;
115
+ readonly project: ThemeProject;
116
+ }
117
+ type IconName = "arrow-up" | "chevron-right" | "file" | "folder" | "link" | "moon" | "search" | "sun";
118
+ interface IconProps {
119
+ readonly label?: string;
120
+ readonly name: IconName;
121
+ readonly size?: number;
122
+ /** Source of a file-type image. Control icons continue to use the named SVG. */
123
+ readonly src?: string;
124
+ /** Image source used by the dark color scheme. */
125
+ readonly darkSrc?: string;
126
+ }
127
+ interface DirwellThemeComponents {
128
+ readonly PageShell: ThemeComponent<PageShellProps>;
129
+ readonly Breadcrumbs: ThemeComponent<BreadcrumbsProps>;
130
+ readonly Toolbar: ThemeComponent<ToolbarProps>;
131
+ readonly EntryList: ThemeComponent<EntryListProps>;
132
+ readonly EntryRow: ThemeComponent<EntryRowProps>;
133
+ readonly EmptyState: ThemeComponent<EmptyStateProps>;
134
+ readonly Footer: ThemeComponent<FooterProps>;
135
+ readonly Icon: ThemeComponent<IconProps>;
136
+ }
137
+ type DirwellThemeComponentOverrides = Partial<DirwellThemeComponents>;
138
+ declare function resolveThemeComponents(defaults: DirwellThemeComponents, ...layers: readonly DirwellThemeComponentOverrides[]): DirwellThemeComponents;
139
+ //#endregion
140
+ export { resolveThemeComponents as _, DirwellThemeComponents as a, ThemeProjectOptions as b, EntryListProps as c, FooterProps as d, IconName as f, ToolbarProps as g, ThemeComponent as h, DirwellThemeComponentOverrides as i, EntryNavigation as l, PageShellProps as m, BreadcrumbsProps as n, EmptyStateProps as o, IconProps as p, DefaultThemeRuntimeConfig as r, EntryListItem as s, BreadcrumbItem as t, EntryRowProps as u, DefaultThemeIconSet as v, DefaultThemeIconVariant as y };
141
+ //# sourceMappingURL=theme-components-DW0fv9_C.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { _ as resolveThemeComponents, a as DirwellThemeComponents, c as EntryListProps, d as FooterProps, f as IconName, g as ToolbarProps, h as ThemeComponent, i as DirwellThemeComponentOverrides, l as EntryNavigation, m as PageShellProps, n as BreadcrumbsProps, o as EmptyStateProps, p as IconProps, r as DefaultThemeRuntimeConfig, s as EntryListItem, t as BreadcrumbItem, u as EntryRowProps } from "./theme-components-DW0fv9_C.mjs";
2
+ export { BreadcrumbItem, BreadcrumbsProps, DefaultThemeRuntimeConfig, DirwellThemeComponentOverrides, DirwellThemeComponents, EmptyStateProps, EntryListItem, EntryListProps, EntryNavigation, EntryRowProps, FooterProps, IconName, IconProps, PageShellProps, ThemeComponent, ToolbarProps, resolveThemeComponents };
@@ -0,0 +1,2 @@
1
+ import { t as resolveThemeComponents } from "./theme-components-CXzvdQY-.mjs";
2
+ export { resolveThemeComponents };