@protoyard/core 1.1.3 → 1.2.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 CHANGED
@@ -9,7 +9,7 @@ Nothing here imports Svelte, Dexie or Node APIs.
9
9
 
10
10
  | File | What it defines |
11
11
  | --- | --- |
12
- | `manifest.ts` | `PrototypeManifestSchema` for `protoyard.json` (id, slug, kind, platform, `preview` (viewport, `shell`, `device`, `orientation`, `chrome` with fictional-only origins, optional `layout`), storage namespace + schemaVersion, build flags, scenario ids), `ShellSchema`, `resolveShell` (`auto` → `phone` for mobile, else `none`), the optional marketplace `catalog` block (`CatalogSchema`, `CATALOG_CATEGORIES`), `parseManifest`, `MANIFEST_FILENAME` |
12
+ | `manifest.ts` | `PrototypeManifestSchema` for `protoyard.json` (id, slug, kind, platform, `preview`, storage namespace + schemaVersion, build flags, scenario ids), `DevtoolsOptionsSchema` (`launcher.hidden`, pixel `offset`, `tone`), `DemoBadgeSchema` (legacy booleans or `{ layer, avoid, phone }`), `ShellSchema`, `resolveShell`, marketplace catalog metadata, `parseManifest`, `MANIFEST_FILENAME` |
13
13
  | `slug.ts` | `checkSlug` / `isValidSlug` / `slugify`, reserved slugs. This is the path-safety gate for the CLI. |
14
14
  | `prototype.ts` | `definePrototype` and `PrototypeDefinition` (manifest, `DatabaseDefinition` versions/migrations, scenarios, `generate`, optional context-free `generateWorld(scenario)` used for scenario loads, `generatorVersion`, `policy`, `integrity`, `themes`, `timeline`, `applyEvent`), `WorldSeed`, `GenerateContext`, `RESERVED_TABLES` |
15
15
  | `scenario.ts` | `ScenarioSchema` and its independent axes (organization, actor, density, activity, environment, appearance, generator knobs), `defineScenario`, `parseScenarioLink` / `buildScenarioLink` for safe reproducible links (including `?shell=` and `?layout=`) |
@@ -158,6 +158,46 @@ export declare const PreviewSchema: z.ZodObject<{
158
158
  }, z.core.$strict>>;
159
159
  }, z.core.$strip>;
160
160
  export type PreviewSettings = z.infer<typeof PreviewSchema>;
161
+ export declare const DevtoolsLauncherSchema: z.ZodObject<{
162
+ hidden: z.ZodOptional<z.ZodBoolean>;
163
+ offset: z.ZodOptional<z.ZodObject<{
164
+ x: z.ZodOptional<z.ZodNumber>;
165
+ y: z.ZodOptional<z.ZodNumber>;
166
+ }, z.core.$strict>>;
167
+ tone: z.ZodOptional<z.ZodEnum<{
168
+ default: "default";
169
+ subtle: "subtle";
170
+ contrast: "contrast";
171
+ }>>;
172
+ }, z.core.$strict>;
173
+ export declare const DevtoolsOptionsSchema: z.ZodObject<{
174
+ launcher: z.ZodOptional<z.ZodObject<{
175
+ hidden: z.ZodOptional<z.ZodBoolean>;
176
+ offset: z.ZodOptional<z.ZodObject<{
177
+ x: z.ZodOptional<z.ZodNumber>;
178
+ y: z.ZodOptional<z.ZodNumber>;
179
+ }, z.core.$strict>>;
180
+ tone: z.ZodOptional<z.ZodEnum<{
181
+ default: "default";
182
+ subtle: "subtle";
183
+ contrast: "contrast";
184
+ }>>;
185
+ }, z.core.$strict>>;
186
+ }, z.core.$strict>;
187
+ export type DevtoolsOptions = z.infer<typeof DevtoolsOptionsSchema>;
188
+ export declare const DemoBadgeSchema: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
189
+ layer: z.ZodOptional<z.ZodEnum<{
190
+ "above-app": "above-app";
191
+ "below-overlays": "below-overlays";
192
+ }>>;
193
+ avoid: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ phone: z.ZodOptional<z.ZodEnum<{
195
+ hidden: "hidden";
196
+ compact: "compact";
197
+ corner: "corner";
198
+ }>>;
199
+ }, z.core.$strict>]>;
200
+ export type DemoBadgeOptions = z.infer<typeof DemoBadgeSchema>;
161
201
  /**
162
202
  * Marketplace categories: one shared list, so the gallery never shows two
163
203
  * spellings of the same shelf. Add a value here instead of free-form text.
@@ -462,13 +502,38 @@ export declare const PrototypeManifestSchema: z.ZodObject<{
462
502
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
463
503
  }, z.core.$strict>>;
464
504
  }, z.core.$strip>>;
505
+ devtools: z.ZodOptional<z.ZodObject<{
506
+ launcher: z.ZodOptional<z.ZodObject<{
507
+ hidden: z.ZodOptional<z.ZodBoolean>;
508
+ offset: z.ZodOptional<z.ZodObject<{
509
+ x: z.ZodOptional<z.ZodNumber>;
510
+ y: z.ZodOptional<z.ZodNumber>;
511
+ }, z.core.$strict>>;
512
+ tone: z.ZodOptional<z.ZodEnum<{
513
+ default: "default";
514
+ subtle: "subtle";
515
+ contrast: "contrast";
516
+ }>>;
517
+ }, z.core.$strict>>;
518
+ }, z.core.$strict>>;
465
519
  storage: z.ZodObject<{
466
520
  namespace: z.ZodString;
467
521
  schemaVersion: z.ZodNumber;
468
522
  }, z.core.$strip>;
469
523
  build: z.ZodDefault<z.ZodObject<{
470
524
  includeDevtools: z.ZodDefault<z.ZodBoolean>;
471
- demoBadge: z.ZodDefault<z.ZodBoolean>;
525
+ demoBadge: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
526
+ layer: z.ZodOptional<z.ZodEnum<{
527
+ "above-app": "above-app";
528
+ "below-overlays": "below-overlays";
529
+ }>>;
530
+ avoid: z.ZodOptional<z.ZodArray<z.ZodString>>;
531
+ phone: z.ZodOptional<z.ZodEnum<{
532
+ hidden: "hidden";
533
+ compact: "compact";
534
+ corner: "corner";
535
+ }>>;
536
+ }, z.core.$strict>]>>;
472
537
  base: z.ZodDefault<z.ZodString>;
473
538
  offline: z.ZodDefault<z.ZodBoolean>;
474
539
  frameWhenEmbedded: z.ZodDefault<z.ZodBoolean>;
@@ -585,7 +650,11 @@ export declare function safeParseManifest(input: unknown): z.ZodSafeParseResult<
585
650
  };
586
651
  build: {
587
652
  includeDevtools: boolean;
588
- demoBadge: boolean;
653
+ demoBadge: boolean | {
654
+ layer?: "above-app" | "below-overlays" | undefined;
655
+ avoid?: string[] | undefined;
656
+ phone?: "hidden" | "compact" | "corner" | undefined;
657
+ };
589
658
  base: string;
590
659
  offline: boolean;
591
660
  frameWhenEmbedded: boolean;
@@ -603,6 +672,16 @@ export declare function safeParseManifest(input: unknown): z.ZodSafeParseResult<
603
672
  icon?: string | undefined;
604
673
  thumbnail?: string | undefined;
605
674
  defaultScenario?: string | undefined;
675
+ devtools?: {
676
+ launcher?: {
677
+ hidden?: boolean | undefined;
678
+ offset?: {
679
+ x?: number | undefined;
680
+ y?: number | undefined;
681
+ } | undefined;
682
+ tone?: "default" | "subtle" | "contrast" | undefined;
683
+ } | undefined;
684
+ } | undefined;
606
685
  catalog?: {
607
686
  category: "marketing" | "starter" | "productivity" | "communication" | "sales" | "support" | "finance" | "commerce" | "marketplace" | "ai" | "analytics" | "developer-tools" | "design" | "education" | "health" | "hr" | "operations" | "media" | "social" | "travel" | "real-estate" | "internal-tools";
608
687
  platforms: ("desktop" | "mobile" | "tablet" | "web" | "widget" | "extension" | "plugin")[];
package/dist/manifest.js CHANGED
@@ -70,6 +70,29 @@ export const PreviewSchema = z.object({
70
70
  /** App layout (ADR-023); absent: `custom`, the prototype renders its own. */
71
71
  layout: LayoutSettingsSchema.optional(),
72
72
  });
73
+ export const DevtoolsLauncherSchema = z
74
+ .object({
75
+ hidden: z.boolean().optional(),
76
+ offset: z
77
+ .object({ x: z.number().finite().optional(), y: z.number().finite().optional() })
78
+ .strict()
79
+ .optional(),
80
+ tone: z.enum(['default', 'subtle', 'contrast']).optional(),
81
+ })
82
+ .strict();
83
+ export const DevtoolsOptionsSchema = z
84
+ .object({ launcher: DevtoolsLauncherSchema.optional() })
85
+ .strict();
86
+ export const DemoBadgeSchema = z.union([
87
+ z.boolean(),
88
+ z
89
+ .object({
90
+ layer: z.enum(['above-app', 'below-overlays']).optional(),
91
+ avoid: z.array(z.string().min(1)).optional(),
92
+ phone: z.enum(['compact', 'hidden', 'corner']).optional(),
93
+ })
94
+ .strict(),
95
+ ]);
73
96
  /**
74
97
  * Marketplace categories: one shared list, so the gallery never shows two
75
98
  * spellings of the same shelf. Add a value here instead of free-form text.
@@ -253,6 +276,8 @@ export const PrototypeManifestSchema = z
253
276
  defaultTheme: ThemeIdRefSchema.default('violet'),
254
277
  defaultMode: ColorModeSchema.default('system'),
255
278
  preview: PreviewSchema.default({ viewport: 'desktop', shell: 'auto' }),
279
+ /** Optional presentation controls for Protoyard's runtime DevTools launcher. */
280
+ devtools: DevtoolsOptionsSchema.optional(),
256
281
  storage: z.object({
257
282
  namespace: NamespaceSchema,
258
283
  schemaVersion: z.number().int().positive(),
@@ -262,7 +287,7 @@ export const PrototypeManifestSchema = z
262
287
  /** Include the floating DevTools panel in standalone builds. */
263
288
  includeDevtools: z.boolean().default(false),
264
289
  /** Show a small "Prototype" badge in standalone builds. */
265
- demoBadge: z.boolean().default(true),
290
+ demoBadge: DemoBadgeSchema.default(true),
266
291
  /** Public base path. `./` produces relocatable output. */
267
292
  base: z.string().default('./'),
268
293
  /**
@@ -107,8 +107,8 @@ export declare const OverridesSchema: z.ZodObject<{
107
107
  }>>;
108
108
  motion: z.ZodOptional<z.ZodEnum<{
109
109
  none: "none";
110
- standard: "standard";
111
110
  subtle: "subtle";
111
+ standard: "standard";
112
112
  expressive: "expressive";
113
113
  }>>;
114
114
  actorId: z.ZodOptional<z.ZodString>;
@@ -78,8 +78,8 @@ export declare const ScenarioAppearanceSchema: z.ZodObject<{
78
78
  }>>;
79
79
  motion: z.ZodOptional<z.ZodEnum<{
80
80
  none: "none";
81
- standard: "standard";
82
81
  subtle: "subtle";
82
+ standard: "standard";
83
83
  expressive: "expressive";
84
84
  }>>;
85
85
  themeId: z.ZodOptional<z.ZodString>;
@@ -235,8 +235,8 @@ export declare const ScenarioSchema: z.ZodObject<{
235
235
  }>>;
236
236
  motion: z.ZodOptional<z.ZodEnum<{
237
237
  none: "none";
238
- standard: "standard";
239
238
  subtle: "subtle";
239
+ standard: "standard";
240
240
  expressive: "expressive";
241
241
  }>>;
242
242
  themeId: z.ZodOptional<z.ZodString>;
package/dist/theme.d.ts CHANGED
@@ -98,8 +98,8 @@ export declare const StylePresetOverridesSchema: z.ZodObject<{
98
98
  }>>;
99
99
  motion: z.ZodOptional<z.ZodEnum<{
100
100
  none: "none";
101
- standard: "standard";
102
101
  subtle: "subtle";
102
+ standard: "standard";
103
103
  expressive: "expressive";
104
104
  }>>;
105
105
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protoyard/core",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Framework-agnostic contracts for Protoyard: manifests, scenarios, personas, permissions, simulation clock, environment, snapshots and themes.",
5
5
  "license": "MIT",
6
6
  "type": "module",