@octane-xplat/workshop 0.1.0 → 0.15.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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/MOBILE.md +143 -0
  3. package/README.md +305 -1
  4. package/dist/node/index.js +50 -0
  5. package/package.json +118 -5
  6. package/src/catalog.ts +58 -0
  7. package/src/contract.ts +257 -0
  8. package/src/controls.ts +159 -0
  9. package/src/discover.mjs +584 -0
  10. package/src/errors.ts +47 -0
  11. package/src/fixture.ts +158 -0
  12. package/src/index.ts +6 -0
  13. package/src/macos/controller.ts +170 -0
  14. package/src/macos/index.macos.ts +2 -0
  15. package/src/macos/shell.macos.mjs +673 -0
  16. package/src/macos/stage.macos.ts +182 -0
  17. package/src/macos-node.mjs +95 -0
  18. package/src/macos-vite.mjs +47 -0
  19. package/src/mobile/controller.ts +134 -0
  20. package/src/mobile/entry.mobile.ts +607 -0
  21. package/src/mobile/index.mobile.ts +3 -0
  22. package/src/mobile/mount.mobile.ts +60 -0
  23. package/src/mobile/tree.mobile.tsrx +17 -0
  24. package/src/mobile-node.mjs +126 -0
  25. package/src/mobile-regex.mjs +60 -0
  26. package/src/node.d.ts +65 -0
  27. package/src/node.mjs +536 -0
  28. package/src/session.ts +520 -0
  29. package/src/vite-mobile.d.ts +21 -0
  30. package/src/vite-mobile.mjs +101 -0
  31. package/src/vite.d.ts +11 -0
  32. package/src/vite.mjs +315 -0
  33. package/src/web/entry.web.ts +270 -0
  34. package/src/web/index.web.ts +7 -0
  35. package/src/web/mount.web.ts +86 -0
  36. package/src/web/shell.css +449 -0
  37. package/src/web/shell.web.tsrx +759 -0
  38. package/src/windows/preflight.mjs +113 -0
  39. package/types/generated/.tsrx-typegen-manifest.json +24 -0
  40. package/types/generated/catalog.d.ts +30 -0
  41. package/types/generated/contract.d.ts +145 -0
  42. package/types/generated/controls.d.ts +28 -0
  43. package/types/generated/errors.d.ts +13 -0
  44. package/types/generated/fixture.d.ts +53 -0
  45. package/types/generated/index.d.ts +6 -0
  46. package/types/generated/macos/controller.d.ts +52 -0
  47. package/types/generated/macos/index.macos.d.ts +2 -0
  48. package/types/generated/macos/stage.macos.d.ts +10 -0
  49. package/types/generated/mobile/controller.d.ts +31 -0
  50. package/types/generated/mobile/entry.mobile.d.ts +22 -0
  51. package/types/generated/mobile/index.mobile.d.ts +3 -0
  52. package/types/generated/mobile/mount.mobile.d.ts +4 -0
  53. package/types/generated/mobile/tree.mobile.d.ts +4 -0
  54. package/types/generated/session.d.ts +84 -0
  55. package/types/generated/web/entry.web.d.ts +53 -0
  56. package/types/generated/web/index.web.d.ts +7 -0
  57. package/types/generated/web/mount.web.d.ts +2 -0
  58. package/types/generated/web/shell.web.d.ts +4 -0
@@ -0,0 +1,53 @@
1
+ import { createStore } from '@octane-xplat/ui/data';
2
+ import type { CatalogEntry } from '../catalog.js';
3
+ import type { WorkshopTarget } from '../contract.js';
4
+ import type { SessionSnapshot } from '../session.js';
5
+ import { WorkshopSession } from '../session.js';
6
+ export interface ShellState {
7
+ mode: 'wide' | 'compact' | 'phone';
8
+ query: string;
9
+ selectedId: string | null;
10
+ expanded: ReadonlySet<string>;
11
+ catalogCollapsed: boolean;
12
+ controlsCollapsed: boolean;
13
+ auxPanel: 'stories' | 'controls' | null;
14
+ stageOnly: boolean;
15
+ stageBackground: 'default' | 'light' | 'dark';
16
+ stageBounds: 'available' | 'small' | 'medium';
17
+ catalog: CatalogEntry[];
18
+ catalogError: string | undefined;
19
+ missingId: string | null;
20
+ session: SessionSnapshot;
21
+ drafts: Record<string, string>;
22
+ fieldErrors: Record<string, string>;
23
+ unsetKeys: ReadonlySet<string>;
24
+ }
25
+ export interface WorkshopRuntime {
26
+ store: ReturnType<typeof createStore<ShellState>>;
27
+ session: WorkshopSession;
28
+ mountHost: HTMLElement;
29
+ selectEntry(entry: CatalogEntry): Promise<void>;
30
+ updateCatalog(entries: CatalogEntry[], diagnostics?: readonly {
31
+ message: string;
32
+ }[]): void;
33
+ loadGeneration: number;
34
+ }
35
+ /** Called by the generated catalog module on load and on every HMR re-execution. */
36
+ export declare function catalogDidUpdate(entries: CatalogEntry[], diagnostics?: readonly {
37
+ message: string;
38
+ }[]): void;
39
+ export interface WorkshopBootOptions {
40
+ catalog: CatalogEntry[];
41
+ diagnostics?: readonly {
42
+ message: string;
43
+ }[];
44
+ target: WorkshopTarget;
45
+ initialStoryId?: string | null;
46
+ globalProviders?: readonly unknown[];
47
+ /** Vite HMR handle — passed by the generated entry because lib builds
48
+ * fold `import.meta.hot` to undefined. */
49
+ hot?: {
50
+ on?: (event: string, cb: (payload?: unknown) => void) => void;
51
+ };
52
+ }
53
+ export declare function startWorkshop(options: WorkshopBootOptions): WorkshopRuntime;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Web runtime entry — the catalog virtual module and the generated workshop
3
+ * entry import this. Exposes startWorkshop plus the catalog-update seam the
4
+ * virtual catalog calls back into after HMR re-execution.
5
+ */
6
+ export { createWebStageHost } from './mount.web.js';
7
+ export { startWorkshop, catalogDidUpdate } from './entry.web.js';
@@ -0,0 +1,2 @@
1
+ import type { StageHost } from '../session.js';
2
+ export declare function createWebStageHost(stageElement: HTMLElement): StageHost;
@@ -0,0 +1,4 @@
1
+ import type { WorkshopRuntime } from './entry.web.js';
2
+ export declare function WorkshopApp(props: {
3
+ runtime: WorkshopRuntime;
4
+ }): import("octane/jsx-runtime").JSX.Element;