@pygmalionjs/pygmalion 0.26.0 → 0.28.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.
@@ -36,6 +36,7 @@ export { createLegacyModeAdapter } from './workspace/legacyModeAdapter.js';
36
36
  export type * from './workspace/contracts.js';
37
37
  export { canEditWorkspaceTarget, createWorkspaceTargetResolver, resolveWorkspaceTarget } from './workspace/configuration.js';
38
38
  export { screenStateGroup, screenStateLabel } from './workspace/screenStates.js';
39
+ export { matchingScreenPreset, screenSize } from './workspace/view/ScreenSizeControl.js';
39
40
  export type { ScreenStateGroup, ScreenStateMember } from './workspace/screenStates.js';
40
41
  export type { WorkspaceConfiguration, WorkspaceTargetConfiguration, WorkspaceTargetResolverOptions } from './workspace/configuration.js';
41
42
  export { capturedScreenMetadata, screenDocumentFromImport } from './document/screenImport.js';
@@ -7,7 +7,11 @@ export interface CapturedScreenConfigurationDependencies {
7
7
  createLoader?(runtime: EditorRuntime, options: CapturedScreenDocumentOptions): CapturedScreenDocumentLoader;
8
8
  }
9
9
  /** Drafts live per screen and source revision; a new revision starts from a fresh import. */
10
- export declare const capturedScreenDraftKey: (target: WorkspaceTarget) => string;
10
+ /** Drafts are keyed per screen and revision, and per size once the screen leaves its declared one: geometry measured at 480px is not the same draft. */
11
+ export declare const capturedScreenDraftKey: (target: WorkspaceTarget, size?: {
12
+ width: number;
13
+ height: number;
14
+ }) => string;
11
15
  /**
12
16
  * Wraps a host configuration so any routed screen the host does not resolve opens as an imported design
13
17
  * document. Host-resolved targets always win; the fallback only fills targets the host leaves without a loader.
@@ -0,0 +1,19 @@
1
+ import type { EditorRuntime } from '../../core/runtime.js';
2
+ import type { PageModel } from '../../editor/store.js';
3
+ import { type ViewportPresetDef } from '../../editor/viewportPresets.js';
4
+ export declare const screenSize: (page: PageModel) => {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ /** The preset a screen currently sits at, so a run can carry its name instead of a bare number. */
9
+ export declare const matchingScreenPreset: (presets: readonly ViewportPresetDef[], page: PageModel) => ViewportPresetDef | undefined;
10
+ /**
11
+ * One size per screen, shared by every mode: the storyboard card is captured at
12
+ * it, Edit imports the screen at it, and a run opens at it. The host names the
13
+ * widths that are a product contract; the boxes still take any size, and the
14
+ * authored size stays one click away.
15
+ */
16
+ export declare const ScreenSizeControl: import("react").FunctionComponent<{
17
+ runtime: EditorRuntime;
18
+ page: PageModel;
19
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pygmalionjs/pygmalion",
3
- "version": "0.26.0",
3
+ "version": "0.28.0",
4
4
  "description": "Code-backed DOM design sandbox and visual QA editor",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {