@oddkin/workbench 0.0.0-stage → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -2
  3. package/dist/app/copy.d.ts +43 -0
  4. package/dist/app/copy.d.ts.map +1 -0
  5. package/dist/app/copy.js +47 -0
  6. package/dist/app/copy.js.map +1 -0
  7. package/dist/app/define.d.ts +3 -0
  8. package/dist/app/define.d.ts.map +1 -0
  9. package/dist/app/define.js +10 -0
  10. package/dist/app/define.js.map +1 -0
  11. package/dist/app/details.d.ts +22 -0
  12. package/dist/app/details.d.ts.map +1 -0
  13. package/dist/app/details.js +16 -0
  14. package/dist/app/details.js.map +1 -0
  15. package/dist/app/index.d.ts +12 -0
  16. package/dist/app/index.d.ts.map +1 -0
  17. package/dist/app/index.js +9 -0
  18. package/dist/app/index.js.map +1 -0
  19. package/dist/app/routes.d.ts +26 -0
  20. package/dist/app/routes.d.ts.map +1 -0
  21. package/dist/app/routes.js +94 -0
  22. package/dist/app/routes.js.map +1 -0
  23. package/dist/app/search.d.ts +17 -0
  24. package/dist/app/search.d.ts.map +1 -0
  25. package/dist/app/search.js +52 -0
  26. package/dist/app/search.js.map +1 -0
  27. package/dist/app/shell.d.ts +29 -0
  28. package/dist/app/shell.d.ts.map +1 -0
  29. package/dist/app/shell.js +435 -0
  30. package/dist/app/shell.js.map +1 -0
  31. package/dist/app/styles.d.ts +2 -0
  32. package/dist/app/styles.d.ts.map +1 -0
  33. package/dist/app/styles.js +373 -0
  34. package/dist/app/styles.js.map +1 -0
  35. package/dist/app/theme-studio.d.ts +12 -0
  36. package/dist/app/theme-studio.d.ts.map +1 -0
  37. package/dist/app/theme-studio.js +14 -0
  38. package/dist/app/theme-studio.js.map +1 -0
  39. package/dist/app/views.d.ts +34 -0
  40. package/dist/app/views.d.ts.map +1 -0
  41. package/dist/app/views.js +230 -0
  42. package/dist/app/views.js.map +1 -0
  43. package/dist/config/index.d.ts +170 -0
  44. package/dist/config/index.d.ts.map +1 -0
  45. package/dist/config/index.js +148 -0
  46. package/dist/config/index.js.map +1 -0
  47. package/dist/conformance/button.d.ts +2 -0
  48. package/dist/conformance/button.d.ts.map +1 -0
  49. package/dist/conformance/button.js +233 -0
  50. package/dist/conformance/button.js.map +1 -0
  51. package/dist/conformance/index.d.ts +107 -0
  52. package/dist/conformance/index.d.ts.map +1 -0
  53. package/dist/conformance/index.js +60 -0
  54. package/dist/conformance/index.js.map +1 -0
  55. package/dist/data/build.d.ts +36 -0
  56. package/dist/data/build.d.ts.map +1 -0
  57. package/dist/data/build.js +248 -0
  58. package/dist/data/build.js.map +1 -0
  59. package/dist/data/import-map.d.ts +53 -0
  60. package/dist/data/import-map.d.ts.map +1 -0
  61. package/dist/data/import-map.js +160 -0
  62. package/dist/data/import-map.js.map +1 -0
  63. package/dist/data/index.d.ts +14 -0
  64. package/dist/data/index.d.ts.map +1 -0
  65. package/dist/data/index.js +10 -0
  66. package/dist/data/index.js.map +1 -0
  67. package/dist/data/theme-studio.d.ts +21 -0
  68. package/dist/data/theme-studio.d.ts.map +1 -0
  69. package/dist/data/theme-studio.js +116 -0
  70. package/dist/data/theme-studio.js.map +1 -0
  71. package/dist/data/types.d.ts +169 -0
  72. package/dist/data/types.d.ts.map +1 -0
  73. package/dist/data/types.js +4 -0
  74. package/dist/data/types.js.map +1 -0
  75. package/dist/examples/index.d.ts +101 -0
  76. package/dist/examples/index.d.ts.map +1 -0
  77. package/dist/examples/index.js +106 -0
  78. package/dist/examples/index.js.map +1 -0
  79. package/dist/frame/index.d.ts +9 -0
  80. package/dist/frame/index.d.ts.map +1 -0
  81. package/dist/frame/index.js +468 -0
  82. package/dist/frame/index.js.map +1 -0
  83. package/dist/internal/diagnostics.d.ts +17 -0
  84. package/dist/internal/diagnostics.d.ts.map +1 -0
  85. package/dist/internal/diagnostics.js +19 -0
  86. package/dist/internal/diagnostics.js.map +1 -0
  87. package/dist/node/bin.d.ts +3 -0
  88. package/dist/node/bin.d.ts.map +1 -0
  89. package/dist/node/bin.js +12 -0
  90. package/dist/node/bin.js.map +1 -0
  91. package/dist/node/cli.d.ts +17 -0
  92. package/dist/node/cli.d.ts.map +1 -0
  93. package/dist/node/cli.js +198 -0
  94. package/dist/node/cli.js.map +1 -0
  95. package/dist/node/config.d.ts +28 -0
  96. package/dist/node/config.d.ts.map +1 -0
  97. package/dist/node/config.js +80 -0
  98. package/dist/node/config.js.map +1 -0
  99. package/dist/node/generated.d.ts +19 -0
  100. package/dist/node/generated.d.ts.map +1 -0
  101. package/dist/node/generated.js +109 -0
  102. package/dist/node/generated.js.map +1 -0
  103. package/dist/node/html.d.ts +35 -0
  104. package/dist/node/html.d.ts.map +1 -0
  105. package/dist/node/html.js +51 -0
  106. package/dist/node/html.js.map +1 -0
  107. package/dist/node/index.d.ts +24 -0
  108. package/dist/node/index.d.ts.map +1 -0
  109. package/dist/node/index.js +15 -0
  110. package/dist/node/index.js.map +1 -0
  111. package/dist/node/inputs.d.ts +24 -0
  112. package/dist/node/inputs.d.ts.map +1 -0
  113. package/dist/node/inputs.js +259 -0
  114. package/dist/node/inputs.js.map +1 -0
  115. package/dist/node/packages.d.ts +35 -0
  116. package/dist/node/packages.d.ts.map +1 -0
  117. package/dist/node/packages.js +87 -0
  118. package/dist/node/packages.js.map +1 -0
  119. package/dist/node/preload.d.ts +10 -0
  120. package/dist/node/preload.d.ts.map +1 -0
  121. package/dist/node/preload.js +61 -0
  122. package/dist/node/preload.js.map +1 -0
  123. package/dist/node/server.d.ts +42 -0
  124. package/dist/node/server.d.ts.map +1 -0
  125. package/dist/node/server.js +369 -0
  126. package/dist/node/server.js.map +1 -0
  127. package/dist/node/static.d.ts +33 -0
  128. package/dist/node/static.d.ts.map +1 -0
  129. package/dist/node/static.js +141 -0
  130. package/dist/node/static.js.map +1 -0
  131. package/dist/node/workbench.d.ts +43 -0
  132. package/dist/node/workbench.d.ts.map +1 -0
  133. package/dist/node/workbench.js +183 -0
  134. package/dist/node/workbench.js.map +1 -0
  135. package/dist/pages/build.d.ts +22 -0
  136. package/dist/pages/build.d.ts.map +1 -0
  137. package/dist/pages/build.js +363 -0
  138. package/dist/pages/build.js.map +1 -0
  139. package/dist/pages/defaults.d.ts +16 -0
  140. package/dist/pages/defaults.d.ts.map +1 -0
  141. package/dist/pages/defaults.js +88 -0
  142. package/dist/pages/defaults.js.map +1 -0
  143. package/dist/pages/index.d.ts +14 -0
  144. package/dist/pages/index.d.ts.map +1 -0
  145. package/dist/pages/index.js +10 -0
  146. package/dist/pages/index.js.map +1 -0
  147. package/dist/pages/navigation.d.ts +48 -0
  148. package/dist/pages/navigation.d.ts.map +1 -0
  149. package/dist/pages/navigation.js +83 -0
  150. package/dist/pages/navigation.js.map +1 -0
  151. package/dist/pages/types.d.ts +143 -0
  152. package/dist/pages/types.d.ts.map +1 -0
  153. package/dist/pages/types.js +3 -0
  154. package/dist/pages/types.js.map +1 -0
  155. package/dist/panels/catalog-define.d.ts +3 -0
  156. package/dist/panels/catalog-define.d.ts.map +1 -0
  157. package/dist/panels/catalog-define.js +7 -0
  158. package/dist/panels/catalog-define.js.map +1 -0
  159. package/dist/panels/catalog.d.ts +33 -0
  160. package/dist/panels/catalog.d.ts.map +1 -0
  161. package/dist/panels/catalog.js +54 -0
  162. package/dist/panels/catalog.js.map +1 -0
  163. package/dist/panels/component-define.d.ts +3 -0
  164. package/dist/panels/component-define.d.ts.map +1 -0
  165. package/dist/panels/component-define.js +6 -0
  166. package/dist/panels/component-define.js.map +1 -0
  167. package/dist/panels/component-detail.d.ts +46 -0
  168. package/dist/panels/component-detail.d.ts.map +1 -0
  169. package/dist/panels/component-detail.js +1120 -0
  170. package/dist/panels/component-detail.js.map +1 -0
  171. package/dist/panels/component.d.ts +17 -0
  172. package/dist/panels/component.d.ts.map +1 -0
  173. package/dist/panels/component.js +10 -0
  174. package/dist/panels/component.js.map +1 -0
  175. package/dist/panels/foundation-define.d.ts +3 -0
  176. package/dist/panels/foundation-define.d.ts.map +1 -0
  177. package/dist/panels/foundation-define.js +6 -0
  178. package/dist/panels/foundation-define.js.map +1 -0
  179. package/dist/panels/foundation-detail.d.ts +23 -0
  180. package/dist/panels/foundation-detail.d.ts.map +1 -0
  181. package/dist/panels/foundation-detail.js +216 -0
  182. package/dist/panels/foundation-detail.js.map +1 -0
  183. package/dist/panels/foundation.d.ts +15 -0
  184. package/dist/panels/foundation.d.ts.map +1 -0
  185. package/dist/panels/foundation.js +9 -0
  186. package/dist/panels/foundation.js.map +1 -0
  187. package/dist/panels/model.d.ts +173 -0
  188. package/dist/panels/model.d.ts.map +1 -0
  189. package/dist/panels/model.js +462 -0
  190. package/dist/panels/model.js.map +1 -0
  191. package/dist/panels/styles.d.ts +3 -0
  192. package/dist/panels/styles.d.ts.map +1 -0
  193. package/dist/panels/styles.js +316 -0
  194. package/dist/panels/styles.js.map +1 -0
  195. package/dist/panels/theme-model.d.ts +49 -0
  196. package/dist/panels/theme-model.d.ts.map +1 -0
  197. package/dist/panels/theme-model.js +146 -0
  198. package/dist/panels/theme-model.js.map +1 -0
  199. package/dist/panels/theme-studio.d.ts +32 -0
  200. package/dist/panels/theme-studio.d.ts.map +1 -0
  201. package/dist/panels/theme-studio.js +312 -0
  202. package/dist/panels/theme-studio.js.map +1 -0
  203. package/dist/preview/frame.d.ts +44 -0
  204. package/dist/preview/frame.d.ts.map +1 -0
  205. package/dist/preview/frame.js +250 -0
  206. package/dist/preview/frame.js.map +1 -0
  207. package/dist/preview/index.d.ts +26 -0
  208. package/dist/preview/index.d.ts.map +1 -0
  209. package/dist/preview/index.js +58 -0
  210. package/dist/preview/index.js.map +1 -0
  211. package/dist/preview/theme-generation.d.ts +33 -0
  212. package/dist/preview/theme-generation.d.ts.map +1 -0
  213. package/dist/preview/theme-generation.js +48 -0
  214. package/dist/preview/theme-generation.js.map +1 -0
  215. package/dist/protocol/index.d.ts +207 -0
  216. package/dist/protocol/index.d.ts.map +1 -0
  217. package/dist/protocol/index.js +261 -0
  218. package/dist/protocol/index.js.map +1 -0
  219. package/dist/testing/index.d.ts +47 -0
  220. package/dist/testing/index.d.ts.map +1 -0
  221. package/dist/testing/index.js +145 -0
  222. package/dist/testing/index.js.map +1 -0
  223. package/package.json +118 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Brian Brady
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,37 @@
1
- # Temporary Holding Version
1
+ # @oddkin/workbench
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Metadata-driven documentation tooling for any custom-element library. **Status:** the DOM-free contract entries, the data files, the shell, panels, isolated previews, Theme Studio, and the Node tooling (`oddkin analyze`, `oddkin workbench dev`, `oddkin workbench build`) exist (design: [workbench.md](../../docs/architecture/workbench.md) §2.1 and §5.1).
4
+
5
+ | Entry | Contents |
6
+ | --- | --- |
7
+ | `@oddkin/workbench/examples` | `defineExamples(tag, examples)`, typed from `HTMLElementTagNameMap` (unknown property keys and wrong value types are compile errors); `toExamplesJSON` (the `examples.v1` serializable layer, with fixtures reduced to `hasFixture`); `checkExamples(set, contract)` for plain-JavaScript authors; `exampleId` |
8
+ | `@oddkin/workbench/config` | `defineWorkbenchConfig`, `resolveWorkbenchConfig` (defaults and diagnostics matching `workbench-config.v1`), `defineDocs` (`docs-content.v1`) |
9
+ | `@oddkin/workbench/pages` | `buildPageRegistry({ config, cem, metadata?, docs? })` producing `page-registry.v1`, plus the projections every navigation surface uses: `primaryNavigation`, `sidebar`, `cards`, `searchEntries`, `onThisPage`, `href`, `resolveLegacyRoute`, `staticRedirects` |
10
+ | `@oddkin/workbench/data` | `buildWorkbenchData({ config, libraries, docs?, tokens?, diagnostics? })`: one or more packages' CEM and enrichment, authored content, and a token inspection → a small index (registry, branding, libraries, diagnostics) and one data file per visible page (`pageFile(id)`), serialized byte-stably with `serializeData`; `createImportMap(packages, { base, versioned?, conditions? })` builds import maps from package `exports`, and `resolveExport` resolves one subpath to its file |
11
+ | `@oddkin/workbench/node` | Node only. `buildWorkbench({ config?, events? })` loads `oddkin.config.*` (TypeScript through Node's type stripping), the documented packages and their dependencies, their manifests, enrichment, and referenced token inspection, and authored `oddkin.docs.*`, and returns the data files, both import maps, and the shell page; `buildStatic` (`workbench build`), `shellPaths`, `startDevServer`, `writeGenerated` (the marked `.oddkin/workbench/`), `loadWorkbenchConfig`, `loadInputs`, `packageGraph`, and `run` (the command) |
12
+ | `@oddkin/workbench/testing` | `mountExample(set, name, container?)` runs an authored example and its fixture in a browser test; `runConformance` runs a conformance suite with the project's own `expect` |
13
+
14
+ The examples, config, pages, and data entries import without a DOM and have no runtime dependencies (`@oddkin/core` is used for types only). Shipped component code never imports them; colocated `*.examples.ts` files may, because they are development-only sources excluded from the package build (ADR 0021).
15
+
16
+ ## The `oddkin` command
17
+
18
+ ```sh
19
+ oddkin analyze <tsconfig.json> [options] # @oddkin/analyzer's own command, same options and exit codes
20
+ oddkin workbench dev [--config <file or directory>] [--port <number>] [--host <name>] [--no-watch]
21
+ oddkin workbench build [--config <file or directory>] [--out <directory>] [--base <path>] [--routing history|hash]
22
+ ```
23
+
24
+ `workbench dev` serves the Workbench at `http://localhost:4175/` (the configured base path): the shell for page paths (history mode; in hash mode only at the entry, like a static host without rewrites), the data under `_oddkin/`, and package files under `_oddkin/m/<name>@<version>/`. It writes the same data into `.oddkin/workbench/`, a directory it marks and owns, watches the configuration, content, manifests, metadata, and the packages' files, and pushes an `update` event over Server-Sent Events (`_oddkin/events`) after each rebuild. An invalid edit keeps the last valid data and reports diagnostics. Exit codes: 0 success, 1 errors, 2 usage.
25
+
26
+ `workbench build` writes the same layout as files for a static host, by default into `.oddkin/workbench-build/` (marked and owned like the dev directory; an unmarked directory is refused): the shell, `_oddkin/` data and frame document, and each package's published browser files (no type declarations, sources, or source maps). `--base` and `--routing` replace the configuration's `hosting` values. In history mode every page path and legacy path is a copy of the shell, so deep links and refreshes load on a host without rewrites, and `404.html` is the shell for hosts that serve it; legacy paths redirect in the app, keeping their query. Hash mode writes the shell once. Nothing is written when the configuration or metadata has errors; an import-map target that a package does not publish is a `node.build.unpublished` warning. Output is deterministic, and a rebuild rewrites only changed files and removes stale ones. Theme Studio generates in the browser, so the result needs no Node or analyzer backend.
27
+
28
+ ## Registry rules
29
+
30
+ - **Inputs:** standard CEM is enough for the Components baseline. `oddkin.metadata.json` enrichment adds foundations, categories, examples, products, and `docs` facts. Authored content (`defineDocs`) overrides prose and presentation only; generated facts win.
31
+ - **Stable ids:** `foundations/<slug>`, `components/<tag>`, `theme-studio`, `products`. Routes and the base path can change without changing ids.
32
+ - **Honest absence:** a foundation page appears only when enrichment declares it and at least one section has data. Foundations stays as a destination with `availability: 'unavailable'` when no foundation data exists. Components without enrichment are `partial`. Authored `visible: true` cannot show a page or section whose data is missing.
33
+ - **Theme Studio** is a primary destination and never a Foundations card or sidebar entry. **Products and modes** is absent unless enabled, and hidden with `pages.products.empty` when no products resolve.
34
+ - **Dates** come only from authored content or enrichment facts (authored or source history); unknown dates are omitted and build time is never used.
35
+ - **Legacy routes:** `/playground` → `/components` (or `/components/<tag>` from `?component=`, keeping other parameters); `/foundations/theme-studio` → Theme Studio; `/foundations/products` → Products, or a `products.disabled` notice.
36
+
37
+ Tests: `test/pages.test.ts` (real analyzer output for `examples/core-counter` plus an independent fixture library, validated against `page-registry.v1` and `oddkin-metadata.v1`), `test/data.test.ts` (the published outputs of `@oddkin/components` and `@oddkin/ai`, the default theme's token inspection, the Acme fixture, and import maps from real package `exports`), `test/node-*.test.ts` (throwaway projects with an Acme library, the real components through `tests/fixtures/workbench-oddkin`, the dev server over HTTP and Server-Sent Events, and the built command in a real Node process), `test/config.test.ts`, `test/examples.test.ts`, and the type-level `test/examples.types.ts`.
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Built-in shell copy (English). Generic and conditional: it never states facts about the
3
+ * library, which come from generated data. Moves to the localizable `./content` catalog (item 818).
4
+ */
5
+ export declare const COPY: {
6
+ readonly skip: 'Skip to main content';
7
+ readonly loading: 'Loading the Workbench…';
8
+ readonly indexFailed: 'The Workbench index could not be loaded';
9
+ readonly indexIncompatible: 'This index was written by a different Workbench version';
10
+ readonly primaryNavigation: 'Primary';
11
+ readonly search: 'Search';
12
+ readonly searchPlaceholder: 'Search pages';
13
+ readonly componentSearch: 'Search components';
14
+ readonly categoryFilter: 'Category';
15
+ readonly allCategories: 'All categories';
16
+ readonly componentResults: (shown: number, total: number) => string;
17
+ readonly noComponentResults: 'No components match these filters.';
18
+ readonly searchResults: (shown: number, total: number) => string;
19
+ readonly appearance: 'Appearance';
20
+ readonly appearances: {
21
+ readonly system: 'System';
22
+ readonly light: 'Light';
23
+ readonly dark: 'Dark';
24
+ };
25
+ readonly overviewEyebrow: 'Design system';
26
+ readonly summaries: Readonly<Record<string, string>>;
27
+ readonly allPages: (title: string) => string;
28
+ readonly showSection: (title: string) => string;
29
+ readonly hideSection: (title: string) => string;
30
+ readonly onThisPage: 'On this page';
31
+ readonly updated: 'Updated';
32
+ readonly sectionPending: 'This Workbench build does not display this section yet.';
33
+ readonly toolPending: 'This Workbench build does not include Theme Studio yet.';
34
+ readonly noFoundations: 'No foundation data supplied';
35
+ readonly noFoundationsHelp: 'Foundation pages appear when the library publishes Oddkin metadata with foundations, generated from a theme configuration.';
36
+ readonly noComponents: 'No components were found in the library’s Custom Elements Manifest.';
37
+ readonly notFound: 'Page not found';
38
+ readonly notFoundText: (path: string) => string;
39
+ readonly pageFailed: 'This page could not be loaded';
40
+ readonly productsDisabled: 'Products and modes is not enabled in this Workbench.';
41
+ readonly stale: (errors: number) => string;
42
+ };
43
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/app/copy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,IAAI;aACf,IAAI,EAAE,sBAAsB;aAC5B,OAAO,EAAE,wBAAwB;aACjC,WAAW,EAAE,yCAAyC;aACtD,iBAAiB,EAAE,yDAAyD;aAC5E,iBAAiB,EAAE,SAAS;aAC5B,MAAM,EAAE,QAAQ;aAChB,iBAAiB,EAAE,cAAc;aACjC,eAAe,EAAE,mBAAmB;aACpC,cAAc,EAAE,UAAU;aAC1B,aAAa,EAAE,gBAAgB;aAC/B,gBAAgB,UAAU,MAAM,SAAS,MAAM;aAE/C,kBAAkB,EAAE,oCAAoC;aACxD,aAAa,UAAU,MAAM,SAAS,MAAM;aAM5C,UAAU,EAAE,YAAY;aACxB,WAAW;iBAAI,MAAM,EAAE,QAAQ;iBAAE,KAAK,EAAE,OAAO;iBAAE,IAAI,EAAE,MAAM;;aAC7D,eAAe,EAAE,eAAe;aAChC,SAAS,EAIJ,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aACrC,QAAQ,UAAU,MAAM;aACxB,WAAW,UAAU,MAAM;aAC3B,WAAW,UAAU,MAAM;aAC3B,UAAU,EAAE,cAAc;aAC1B,OAAO,EAAE,SAAS;aAClB,cAAc,EAAE,yDAAyD;aACzE,WAAW,EAAE,yDAAyD;aACtE,aAAa,EAAE,6BAA6B;aAC5C,iBAAiB,EACf,4HAA4H;aAC9H,YAAY,EAAE,qEAAqE;aACnF,QAAQ,EAAE,gBAAgB;aAC1B,YAAY,SAAS,MAAM;aAC3B,UAAU,EAAE,+BAA+B;aAC3C,gBAAgB,EAAE,sDAAsD;aACxE,KAAK,WAAW,MAAM;CAEd,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Built-in shell copy (English). Generic and conditional: it never states facts about the
3
+ * library, which come from generated data. Moves to the localizable `./content` catalog (item 818).
4
+ */
5
+ export const COPY = {
6
+ skip: 'Skip to main content',
7
+ loading: 'Loading the Workbench…',
8
+ indexFailed: 'The Workbench index could not be loaded',
9
+ indexIncompatible: 'This index was written by a different Workbench version',
10
+ primaryNavigation: 'Primary',
11
+ search: 'Search',
12
+ searchPlaceholder: 'Search pages',
13
+ componentSearch: 'Search components',
14
+ categoryFilter: 'Category',
15
+ allCategories: 'All categories',
16
+ componentResults: (shown, total) => `Showing ${shown} of ${total} ${total === 1 ? 'component' : 'components'}`,
17
+ noComponentResults: 'No components match these filters.',
18
+ searchResults: (shown, total) => total === 0
19
+ ? 'No results'
20
+ : shown < total
21
+ ? `Showing ${shown} of ${total} results`
22
+ : `${total} ${total === 1 ? 'result' : 'results'}`,
23
+ appearance: 'Appearance',
24
+ appearances: { system: 'System', light: 'Light', dark: 'Dark' },
25
+ overviewEyebrow: 'Design system',
26
+ summaries: {
27
+ foundations: 'The shared values and rules that components are built on.',
28
+ components: 'Every documented component, grouped by category.',
29
+ 'theme-studio': 'Edit the theme configuration and preview it on real components.',
30
+ },
31
+ allPages: (title) => `All ${title.toLowerCase()}`,
32
+ showSection: (title) => `Show ${title.toLowerCase()}`,
33
+ hideSection: (title) => `Hide ${title.toLowerCase()}`,
34
+ onThisPage: 'On this page',
35
+ updated: 'Updated',
36
+ sectionPending: 'This Workbench build does not display this section yet.',
37
+ toolPending: 'This Workbench build does not include Theme Studio yet.',
38
+ noFoundations: 'No foundation data supplied',
39
+ noFoundationsHelp: 'Foundation pages appear when the library publishes Oddkin metadata with foundations, generated from a theme configuration.',
40
+ noComponents: 'No components were found in the library’s Custom Elements Manifest.',
41
+ notFound: 'Page not found',
42
+ notFoundText: (path) => `There is no page at ${path}.`,
43
+ pageFailed: 'This page could not be loaded',
44
+ productsDisabled: 'Products and modes is not enabled in this Workbench.',
45
+ stale: (errors) => `The latest changes could not be applied (${errors} ${errors === 1 ? 'error' : 'errors'}); the last valid version is shown.`,
46
+ };
47
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/app/copy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,wBAAwB;IACjC,WAAW,EAAE,yCAAyC;IACtD,iBAAiB,EAAE,yDAAyD;IAC5E,iBAAiB,EAAE,SAAS;IAC5B,MAAM,EAAE,QAAQ;IAChB,iBAAiB,EAAE,cAAc;IACjC,eAAe,EAAE,mBAAmB;IACpC,cAAc,EAAE,UAAU;IAC1B,aAAa,EAAE,gBAAgB;IAC/B,gBAAgB,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CACjD,WAAW,KAAK,OAAO,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAAE;IAC5E,kBAAkB,EAAE,oCAAoC;IACxD,aAAa,EAAE,CAAC,KAAa,EAAE,KAAa,EAAE,EAAE,CAC9C,KAAK,KAAK,CAAC;QACT,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,KAAK,GA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import '@oddkin/components/define/card';
3
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../src/app/define.ts"],"names":[],"mappings":";AAEA,OAAO,gCAAgC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference path="./shell.ts" preserve="true" />
2
+ // Registers <oddkin-workbench>, its detail-content elements, and the components the shell renders.
3
+ import '@oddkin/components/define/card';
4
+ import { define } from '@oddkin/core/element';
5
+ import { WorkbenchComponentDetail, WorkbenchFoundationDetail } from './details.js';
6
+ import { OddkinWorkbench } from './shell.js';
7
+ define('oddkin-workbench', OddkinWorkbench);
8
+ define('oddkin-workbench-component', WorkbenchComponentDetail);
9
+ define('oddkin-workbench-foundation', WorkbenchFoundationDetail);
10
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../src/app/define.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,mGAAmG;AACnG,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;AAC5C,MAAM,CAAC,4BAA4B,EAAE,wBAAwB,CAAC,CAAC;AAC/D,MAAM,CAAC,6BAA6B,EAAE,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The shell's detail content: the public panels' renderers in the light DOM, so the shell's
3
+ * "On this page" links and URL fragments reach the section headings.
4
+ */
5
+ import { ComponentDetailElement } from '../panels/component-detail.js';
6
+ import { FoundationDetailElement } from '../panels/foundation-detail.js';
7
+ import type { StyleInput } from '@oddkin/core/styles';
8
+ export declare class WorkbenchComponentDetail extends ComponentDetailElement {
9
+ static shadowRootOptions: null;
10
+ static styles: StyleInput;
11
+ }
12
+ export declare class WorkbenchFoundationDetail extends FoundationDetailElement {
13
+ static shadowRootOptions: null;
14
+ static styles: StyleInput;
15
+ }
16
+ declare global {
17
+ interface HTMLElementTagNameMap {
18
+ 'oddkin-workbench-component': WorkbenchComponentDetail;
19
+ 'oddkin-workbench-foundation': WorkbenchFoundationDetail;
20
+ }
21
+ }
22
+ //# sourceMappingURL=details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../src/app/details.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,qBAAa,wBAAyB,SAAQ,sBAAsB;IAClE,OAAgB,iBAAiB,OAAQ;IACzC,OAAgB,MAAM,EAAE,UAAU,CAAiB;CACpD;AAED,qBAAa,yBAA0B,SAAQ,uBAAuB;IACpE,OAAgB,iBAAiB,OAAQ;IACzC,OAAgB,MAAM,EAAE,UAAU,CAAiB;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,4BAA4B,EAAE,wBAAwB,CAAC;QACvD,6BAA6B,EAAE,yBAAyB,CAAC;KAC1D;CACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The shell's detail content: the public panels' renderers in the light DOM, so the shell's
3
+ * "On this page" links and URL fragments reach the section headings.
4
+ */
5
+ import { ComponentDetailElement } from '../panels/component-detail.js';
6
+ import { FoundationDetailElement } from '../panels/foundation-detail.js';
7
+ import { contentStyles } from '../panels/styles.js';
8
+ export class WorkbenchComponentDetail extends ComponentDetailElement {
9
+ static shadowRootOptions = null;
10
+ static styles = contentStyles;
11
+ }
12
+ export class WorkbenchFoundationDetail extends FoundationDetailElement {
13
+ static shadowRootOptions = null;
14
+ static styles = contentStyles;
15
+ }
16
+ //# sourceMappingURL=details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"details.js","sourceRoot":"","sources":["../../src/app/details.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,OAAO,wBAAyB,SAAQ,sBAAsB;IAClE,MAAM,CAAU,iBAAiB,GAAG,IAAI,CAAC;IACzC,MAAM,CAAU,MAAM,GAAe,aAAa,CAAC;CACpD;AAED,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IACpE,MAAM,CAAU,iBAAiB,GAAG,IAAI,CAAC;IACzC,MAAM,CAAU,MAAM,GAAe,aAAa,CAAC;CACpD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `@oddkin/workbench/app` — the Workbench shell (workbench.md §2.1): `<oddkin-workbench>` and the
3
+ * DOM-free pieces it is built from (registry routes, search). Registration is the separate,
4
+ * side-effecting `@oddkin/workbench/app/define`.
5
+ */
6
+ export { OddkinWorkbench } from './shell.js';
7
+ export type { WorkbenchSource } from './shell.js';
8
+ export { shellRoutes } from './routes.js';
9
+ export type { PageLoader, ShellView } from './routes.js';
10
+ export { search, searchItems } from './search.js';
11
+ export type { SearchItem } from './search.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `@oddkin/workbench/app` — the Workbench shell (workbench.md §2.1): `<oddkin-workbench>` and the
3
+ * DOM-free pieces it is built from (registry routes, search). Registration is the separate,
4
+ * side-effecting `@oddkin/workbench/app/define`.
5
+ */
6
+ export { OddkinWorkbench } from './shell.js';
7
+ export { shellRoutes } from './routes.js';
8
+ export { search, searchItems } from './search.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The shell's routes, generated from the page registry (workbench-pages.md §2): every visible
3
+ * page, legacy routes as redirects, and the Products notice. DOM-free, so it can be tested
4
+ * with `matchRoutes` in Node.
5
+ */
6
+ import { type AnyRoute, type RouteContext } from '@oddkin/app/router';
7
+ import type { PageEntry, PageRegistry } from '../pages/types.js';
8
+ /** What a route level shows: a registry page with the data its loader returned, or a notice. */
9
+ export type ShellView = {
10
+ readonly kind: 'page';
11
+ readonly page: PageEntry;
12
+ readonly data: unknown;
13
+ } | {
14
+ readonly kind: 'notice';
15
+ readonly code: 'products.disabled';
16
+ };
17
+ /** Loads a page's data (and anything its view needs) for one navigation. */
18
+ export type PageLoader = (page: PageEntry, context: RouteContext<unknown, unknown>) => unknown | PromiseLike<unknown>;
19
+ /**
20
+ * Routes for every visible page (nested by path segment), each legacy route of a visible page
21
+ * as a redirect resolved like `resolveLegacyRoute`, `/foundations/products` as a notice when
22
+ * Products and modes is not shown, and, without a home page, `/` redirecting to the first
23
+ * primary destination.
24
+ */
25
+ export declare function shellRoutes(registry: PageRegistry, load: PageLoader): AnyRoute[];
26
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/app/routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAS,KAAK,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,gGAAgG;AAChG,MAAM,MAAM,SAAS,GACjB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC3E;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEpE,4EAA4E;AAC5E,MAAM,MAAM,UAAU,GAAG,CACvB,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,KACpC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AA6DpC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,QAAQ,EAAE,CA4BhF"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The shell's routes, generated from the page registry (workbench-pages.md §2): every visible
3
+ * page, legacy routes as redirects, and the Products notice. DOM-free, so it can be tested
4
+ * with `matchRoutes` in Node.
5
+ */
6
+ import { route } from '@oddkin/app/router';
7
+ import { resolveLegacyRoute } from '../pages/navigation.js';
8
+ function level(registry, node, load) {
9
+ const { page, redirect, notice } = node;
10
+ if (page) {
11
+ return {
12
+ name: page.id,
13
+ title: page.title,
14
+ load: async (context) => ({
15
+ kind: 'page',
16
+ page,
17
+ data: await load(page, context),
18
+ }),
19
+ };
20
+ }
21
+ if (redirect) {
22
+ const from = redirect;
23
+ return {
24
+ redirect: ({ location }) => {
25
+ const result = resolveLegacyRoute(registry, from, location.search);
26
+ return result?.kind === 'redirect' ? result.to : '/';
27
+ },
28
+ };
29
+ }
30
+ if (notice) {
31
+ return {
32
+ title: 'Products and modes',
33
+ load: () => ({ kind: 'notice', code: notice }),
34
+ };
35
+ }
36
+ return undefined;
37
+ }
38
+ function toRoutes(registry, node, load) {
39
+ const routes = [];
40
+ for (const [segment, child] of node.children) {
41
+ const own = level(registry, child, load);
42
+ const children = toRoutes(registry, child, load);
43
+ if (children.length)
44
+ routes.push(route({
45
+ path: segment,
46
+ children: own ? [route({ ...own, path: '' }), ...children] : children,
47
+ }));
48
+ else if (own)
49
+ routes.push(route({ ...own, path: segment }));
50
+ }
51
+ return routes;
52
+ }
53
+ /**
54
+ * Routes for every visible page (nested by path segment), each legacy route of a visible page
55
+ * as a redirect resolved like `resolveLegacyRoute`, `/foundations/products` as a notice when
56
+ * Products and modes is not shown, and, without a home page, `/` redirecting to the first
57
+ * primary destination.
58
+ */
59
+ export function shellRoutes(registry, load) {
60
+ const root = { children: new Map() };
61
+ const at = (path) => {
62
+ let node = root;
63
+ for (const segment of path.split('/').filter(Boolean)) {
64
+ let child = node.children.get(segment);
65
+ if (!child)
66
+ node.children.set(segment, (child = { children: new Map() }));
67
+ node = child;
68
+ }
69
+ return node;
70
+ };
71
+ for (const page of registry.pages)
72
+ if (page.visible)
73
+ at(page.route).page = page;
74
+ for (const page of registry.pages) {
75
+ if (!page.visible)
76
+ continue;
77
+ for (const legacy of page.legacyRoutes ?? []) {
78
+ const node = at(legacy);
79
+ if (!node.page)
80
+ node.redirect = legacy;
81
+ }
82
+ }
83
+ if (!registry.pages.some((p) => p.id === 'products' && p.visible)) {
84
+ const node = at('/foundations/products');
85
+ if (!node.page)
86
+ node.notice = 'products.disabled';
87
+ }
88
+ const own = level(registry, root, load);
89
+ // Without a home page, the base URL goes to the first primary destination.
90
+ const first = registry.pages.find((p) => p.id === registry.primaryNav[0] && p.visible);
91
+ const entry = own ?? (first && first.route !== '/' ? { redirect: first.route } : undefined);
92
+ return [...(entry ? [route({ ...entry, path: '' })] : []), ...toRoutes(registry, root, load)];
93
+ }
94
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../src/app/routes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAoC,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAqB5D,SAAS,KAAK,CACZ,QAAsB,EACtB,IAAU,EACV,IAAgB;IAEhB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxC,IAAI,IAAI,EAAE,CAAC;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,EAAE;YACb,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,KAAK,EAAE,OAAuC,EAAsB,EAAE,CAAC,CAAC;gBAC5E,IAAI,EAAE,MAAM;gBACZ,IAAI;gBACJ,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;aAChC,CAAC;SACH,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,OAAO;YACL,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;gBACzB,MAAM,MAAM,GAAG,kBAAkB,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACnE,OAAO,MAAM,EAAE,IAAI,KAA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AG,EAAE,CAAC,uBAAuB,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,IAAI,CAAC,MAAM,GAAG,mBAAmB,CAAC;IACpD,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxC,2EAA2E;IAC3E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IACvF,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAChG,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { PageKind, PageRegistry } from '../pages/types.js';
2
+ export interface SearchItem {
3
+ readonly id: string;
4
+ readonly kind: PageKind;
5
+ readonly title: string;
6
+ readonly summary?: string;
7
+ readonly tags: readonly string[];
8
+ readonly route: string;
9
+ }
10
+ /** Search entries of the registry, with each page's kind (component, foundation, …). */
11
+ export declare function searchItems(registry: PageRegistry): SearchItem[];
12
+ /** Items matching every word of `query`, best first, at most `limit`; `total` counts them all. */
13
+ export declare function search(items: readonly SearchItem[], query: string, limit?: number): {
14
+ results: SearchItem[];
15
+ total: number;
16
+ };
17
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/app/search.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,UAAU,EAAE,CAMhE;AA6BD,kGAAkG;AAClG,wBAAgB,MAAM,CACpB,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,KAAK,EAAE,MAAM,EACb,KAAK,SAAK,GACT;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQ1C"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Searchable navigation (workbench-pages.md §2): entries are projected from the page registry,
3
+ * so search can never list a page that navigation does not have. DOM-free.
4
+ */
5
+ import { searchEntries } from '../pages/navigation.js';
6
+ /** Search entries of the registry, with each page's kind (component, foundation, …). */
7
+ export function searchItems(registry) {
8
+ const kinds = new Map(registry.pages.map((p) => [p.id, p.kind]));
9
+ return searchEntries(registry).map((entry) => ({
10
+ ...entry,
11
+ kind: kinds.get(entry.id),
12
+ }));
13
+ }
14
+ /** Most relevant first: title, then the id (a tag name), then tags, then the summary. */
15
+ function score(item, words) {
16
+ const title = item.title.toLowerCase();
17
+ const id = item.id.toLowerCase();
18
+ const tags = item.tags.map((t) => t.toLowerCase());
19
+ const summary = (item.summary ?? '').toLowerCase();
20
+ let total = 0;
21
+ for (const word of words) {
22
+ const points = title.startsWith(word)
23
+ ? 8
24
+ : title.split(/\s+/).some((w) => w.startsWith(word))
25
+ ? 6
26
+ : title.includes(word)
27
+ ? 5
28
+ : id.includes(word)
29
+ ? 4
30
+ : tags.some((t) => t.includes(word))
31
+ ? 3
32
+ : summary.includes(word)
33
+ ? 1
34
+ : 0;
35
+ if (points === 0)
36
+ return 0;
37
+ total += points;
38
+ }
39
+ return total;
40
+ }
41
+ /** Items matching every word of `query`, best first, at most `limit`; `total` counts them all. */
42
+ export function search(items, query, limit = 20) {
43
+ const words = query.toLowerCase().split(/\s+/).filter(Boolean);
44
+ if (words.length === 0)
45
+ return { results: [], total: 0 };
46
+ const ranked = items
47
+ .map((item) => ({ item, points: score(item, words) }))
48
+ .filter((r) => r.points > 0)
49
+ .sort((a, b) => b.points - a.points || a.item.title.localeCompare(b.item.title));
50
+ return { results: ranked.slice(0, limit).map((r) => r.item), total: ranked.length };
51
+ }
52
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/app/search.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAYvD,wFAAwF;AACxF,MAAM,UAAU,WAAW,CAAC,QAAsB;IAChD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAU,CAAC,CAAC,CAAC;IAC1E,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC7C,GAAG,KAAK;QACR,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAa;KACtC,CAAC,C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AC3B,KAAK,IAAI,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,MAAM,CACpB,KAA4B,EAC5B,KAAa,EACb,KAAK,GAAG,EAAE;IAEV,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACzD,MAAM,MAAM,GAAG,KAAK;SACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;SACrD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACnF,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;AACtF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { OddkinElement } from '@oddkin/core/element';
2
+ import type { Scope } from '@oddkin/core/scope';
3
+ /** Where the shell reads its data; the default fetches the index and page files over HTTP. */
4
+ export interface WorkbenchSource {
5
+ index(signal: AbortSignal): Promise<unknown>;
6
+ page(file: string, signal: AbortSignal): Promise<unknown>;
7
+ /** Optional frame document URL for injected sources; HTTP sources derive this from `index`. */
8
+ readonly previewFrameUrl?: string;
9
+ }
10
+ declare const OddkinWorkbench_base: import("@oddkin/core/element").WithProps<typeof OddkinElement, {
11
+ readonly index: import("@oddkin/core/element").PropDefinition<string>;
12
+ readonly events: import("@oddkin/core/element").PropDefinition<string>;
13
+ }>;
14
+ export declare class OddkinWorkbench extends OddkinWorkbench_base {
15
+ #private;
16
+ static shadowRootOptions: null;
17
+ static styles: import("@oddkin/core").CSSResult;
18
+ /** Replaces HTTP loading, for embedding and tests. Read when the element connects. */
19
+ source: WorkbenchSource | undefined;
20
+ protected connected(scope: Scope): void;
21
+ protected render(): import("@oddkin/core/template").TemplateResult;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ 'oddkin-workbench': OddkinWorkbench;
26
+ }
27
+ }
28
+ export {};
29
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/app/shell.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAQ,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AA+BhD,8FAA8F;AAC9F,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,+FAA+F;IAC/F,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;;;;;AA+ED,qBAAa,eAAgB,SAAQ,oBAMnC;;IACA,OAAgB,iBAAiB,OAAQ;IACzC,OAAgB,MAAM,mCAAe;IAErC,sFAAsF;IACtF,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;IAsBpC,UAAmB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAoC/C;IAuOD,UAAmB,MAAM,mDAoExB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}