@pygmalionjs/pygmalion 0.18.0 → 0.20.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 +81 -4
- package/dist-lib/{CameraLayer-Clqgdcjb.js → CameraLayer-DXeRJvoy.js} +1 -1
- package/dist-lib/pygmalion.js +16601 -15855
- package/dist-lib/{runtime-B8Qu1ung.js → runtime-DcPbR8PS.js} +3391 -3224
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +5 -5
- package/dist-lib/types/editor/conditionAxes.d.ts +60 -0
- package/dist-lib/types/editor/declarations.d.ts +22 -5
- package/dist-lib/types/editor/designImport.d.ts +12 -0
- package/dist-lib/types/editor/revisionCatalog.d.ts +3 -0
- package/dist-lib/types/editor/revisionCatalogInstall.d.ts +2 -0
- package/dist-lib/types/editor/store.d.ts +6 -0
- package/dist-lib/types/editor/storyboardEnvironment.d.ts +5 -0
- package/dist-lib/types/lib.d.ts +9 -0
- package/dist-lib/types/token-library/bindings.d.ts +44 -0
- package/dist-lib/types/workspace/WorkspaceConditions.d.ts +1 -1
- package/dist-lib/types/workspace/edit/ArrangeLayers.d.ts +5 -1
- package/dist-lib/types/workspace/edit/CanvasGuides.d.ts +5 -1
- package/dist-lib/types/workspace/edit/PrototypeWiring.d.ts +4 -0
- package/dist-lib/types/workspace/edit/SelectionHandles.d.ts +10 -2
- package/dist-lib/types/workspace/edit/VectorEditor.d.ts +12 -1
- package/dist-lib/types/workspace/edit/editorCanvas.d.ts +6 -1
- package/dist-lib/types/workspace/edit/geometryHandles.d.ts +13 -1
- package/dist-lib/types/workspace/edit/layerArrangement.d.ts +4 -1
- package/dist-lib/types/workspace/edit/projection.d.ts +23 -1
- package/dist-lib/types/workspace/edit/prototypeWiringModel.d.ts +2 -1
- package/dist-lib/types/workspace/edit/textLayoutProjection.d.ts +28 -0
- package/dist-lib/types/workspace/edit/useTextLayout.d.ts +19 -0
- package/dist-lib/types/workspace/edit/vectorTools.d.ts +9 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -396,6 +396,62 @@ identity. Selecting an already visible frame in the sidebar preserves the
|
|
|
396
396
|
camera; an offscreen frame is revealed with the smallest pan possible and never
|
|
397
397
|
changes the user's zoom.
|
|
398
398
|
|
|
399
|
+
### Declare catalog conditions
|
|
400
|
+
|
|
401
|
+
A product is often several products at once: a color scheme, an account level
|
|
402
|
+
or a feature entitlement decides which screens exist and how every one of them
|
|
403
|
+
looks. A session preset is one runtime choice for the whole catalog, and a
|
|
404
|
+
preview environment control only dresses the live preview. Independent flags
|
|
405
|
+
are condition axes:
|
|
406
|
+
|
|
407
|
+
```tsx
|
|
408
|
+
const conditionAxes = [
|
|
409
|
+
{
|
|
410
|
+
id: 'theme',
|
|
411
|
+
label: 'Theme',
|
|
412
|
+
defaultValue: 'authored',
|
|
413
|
+
options: [
|
|
414
|
+
{ value: 'authored', label: 'Auto' },
|
|
415
|
+
{ value: 'dark', label: 'Dark', environment: { localStorage: { 'app:theme': 'dark' } } },
|
|
416
|
+
],
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
id: 'tier',
|
|
420
|
+
label: 'Plan tier',
|
|
421
|
+
options: [{ value: 'basic', label: 'Basic' }, { value: 'plus', label: 'Plus' }],
|
|
422
|
+
},
|
|
423
|
+
];
|
|
424
|
+
|
|
425
|
+
<PygmalionEditor conditionAxes={conditionAxes} />
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
The Conditions panel lists every axis. The effective value is the explicit
|
|
429
|
+
choice, then `defaultValue`, then nothing: an axis without a default constrains
|
|
430
|
+
nothing until chosen, the same way the Default session shows every runtime.
|
|
431
|
+
|
|
432
|
+
Each option's `environment` joins the storyboard baseline underneath every
|
|
433
|
+
frame's own declared environment, in declared axis order and on top of the
|
|
434
|
+
selected session preset. Capture fingerprints, flow sessions and Application
|
|
435
|
+
runs already derive from that baseline, so choosing a value re-resolves the
|
|
436
|
+
catalog under it instead of reusing frames captured under the previous one. An
|
|
437
|
+
option without an environment is a pure catalog choice and leaves existing
|
|
438
|
+
capture identities intact; a default with an environment participates from the
|
|
439
|
+
start.
|
|
440
|
+
|
|
441
|
+
A screen names the values it exists under with `conditions`; an axis it does
|
|
442
|
+
not name means every value:
|
|
443
|
+
|
|
444
|
+
```tsx
|
|
445
|
+
{ id: 'billing', route: '/billing', conditions: { tier: ['plus'] } }
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
Unknown axis ids or values never widen the catalog: the revision catalog
|
|
449
|
+
validator rejects them, and at runtime such a screen is hidden and reported by
|
|
450
|
+
`conditionDeclarationIssues`. Frame-level condition axes from
|
|
451
|
+
`screenStateAxes` stay frame states and are not promoted to catalog filters. The
|
|
452
|
+
core evaluates the declarations; which product screens exist under which values,
|
|
453
|
+
and what each value means to the application, remain host declarations.
|
|
454
|
+
|
|
399
455
|
## Capture artifact lifecycle
|
|
400
456
|
|
|
401
457
|
Import the reusable capture primitives from
|
|
@@ -574,10 +630,31 @@ entries use a bounded cache. Dispose the runtime when its font environment ends.
|
|
|
574
630
|
Mixed text, bidi, connected/repeated content, unresolved typography and
|
|
575
631
|
source-rendered text return named diagnostics in this first measurement API.
|
|
576
632
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
633
|
+
When both font capabilities are supplied, Workspace shares a disposable measured
|
|
634
|
+
scene between the canvas, selection handles, snapping, guides, alignment and
|
|
635
|
+
prototype wiring. Auto-height text keeps its authored minimum height when its
|
|
636
|
+
width changes; auto-width text owns both dimensions. Inspector sizes follow the
|
|
637
|
+
measured scene and derived dimensions cannot be overwritten by resize controls.
|
|
638
|
+
Pending or unavailable derived bounds stay unavailable to geometry commands.
|
|
639
|
+
Changing the document, page, source, mode or font registration cancels stale
|
|
640
|
+
geometry work and gestures. Late measurements never reset a camera the user moved.
|
|
641
|
+
|
|
642
|
+
This integration supports plain text under the existing bounded layout solver.
|
|
643
|
+
Non-start constraints under text-resized ancestors, mixed text and dynamic
|
|
644
|
+
prototype playback still need additional geometry integration. The built-in
|
|
645
|
+
multiline exporter is also separate work. Measurement never rewrites canonical
|
|
646
|
+
width/height, adds an undo entry or changes source files.
|
|
647
|
+
|
|
648
|
+
### Inspect an existing variable binding
|
|
649
|
+
|
|
650
|
+
`resolveVariableModeForNode` and `resolveVariableModeForInstance` return the
|
|
651
|
+
requested collection mode and the scope that supplied it. Instance addresses
|
|
652
|
+
use the existing opaque override address; consumers do not reconstruct paths.
|
|
653
|
+
`planVariableOccurrence` captures one actual bound occurrence, its token
|
|
654
|
+
resolution (including the authored mode), scalar value and literal patch without
|
|
655
|
+
refreshing unrelated nodes. `projectVariableScalar` exposes the same validation
|
|
656
|
+
and own-node or sparse-override projection used by refresh. These reads do not
|
|
657
|
+
write either document or enable variable-library clipboard transfer.
|
|
581
658
|
|
|
582
659
|
## Local development
|
|
583
660
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-
|
|
2
|
+
import { n as C, R as g, aM as P, ck as R, cl as k, Y as E, cm as I, a7 as m, a4 as b } from "./runtime-DcPbR8PS.js";
|
|
3
3
|
import { useRef as L, useLayoutEffect as h } from "react";
|
|
4
4
|
function v(n) {
|
|
5
5
|
return `translate(${n.panX}px, ${n.panY}px) scale(${n.zoom})`;
|