@pixel-point/toolcraft 0.0.12 → 0.0.14
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 +4 -2
- package/package.json +1 -1
- package/src/cli.mjs +18 -45
- package/src/cli.test.mjs +141 -6
- package/src/command-runner.mjs +71 -0
- package/src/dependency-install.mjs +87 -0
- package/src/generate.mjs +32 -4
- package/src/generate.test.mjs +116 -15
- package/src/package-json.mjs +11 -2
- package/src/package-json.test.mjs +27 -0
- package/src/package-manager.mjs +123 -0
- package/src/package-manager.test.mjs +80 -0
- package/templates/runtime/contracts/component-contracts.test.ts +1 -1
- package/templates/runtime/contracts/component-contracts.ts +1 -1
- package/templates/starter/AGENTS.md +4 -3
- package/templates/starter/docs/toolcraft/README.md +15 -0
- package/templates/starter/docs/toolcraft/acceptance-testing.md +2 -0
- package/templates/starter/docs/toolcraft/assembly-workflow.md +35 -171
- package/templates/starter/docs/toolcraft/component-rules.md +12 -188
- package/templates/starter/docs/toolcraft/core/control-selection.md +93 -0
- package/templates/starter/docs/toolcraft/core/layout.md +104 -0
- package/templates/starter/docs/toolcraft/core/media-upload.md +85 -0
- package/templates/starter/docs/toolcraft/core/performance.md +83 -0
- package/templates/starter/docs/toolcraft/core/reference-study.md +115 -0
- package/templates/starter/docs/toolcraft/core/runtime-boundary.md +53 -0
- package/templates/starter/docs/toolcraft/core/setup-export.md +86 -0
- package/templates/starter/docs/toolcraft/core/timeline-animation.md +67 -0
- package/templates/starter/docs/toolcraft/custom-controls.md +2 -0
- package/templates/starter/docs/toolcraft/performance.md +2 -0
- package/templates/starter/docs/toolcraft/renderer-technique.md +2 -0
- package/templates/starter/docs/toolcraft/schema-reference.md +117 -367
- package/templates/starter/docs/toolcraft/workflow.md +12 -10
- package/templates/starter/package.json +1 -0
- package/templates/starter/scripts/check-toolcraft-docs.mjs +28 -6
- package/templates/starter/scripts/run-vite-on-free-port.mjs +25 -6
- package/templates/starter/src/app/starter-acceptance.test.ts +24 -15
- package/templates/starter/src/app/starter-performance.test.ts +17 -7
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Timeline And Animation
|
|
2
|
+
|
|
3
|
+
Read this module before changing animation, timeline, keyframes, playback, loop duration, video export, or animated renderer timing.
|
|
4
|
+
|
|
5
|
+
## Animation Intent Inventory
|
|
6
|
+
|
|
7
|
+
Before adding animation controls, write an Animation Intent Inventory. Classify the animation as one of:
|
|
8
|
+
|
|
9
|
+
- playback timeline;
|
|
10
|
+
- keyframes timeline;
|
|
11
|
+
- custom reference timeline;
|
|
12
|
+
- autonomous decorative output.
|
|
13
|
+
|
|
14
|
+
Use no timeline only when the motion is explicitly autonomous decoration with no user-facing play/pause, scrub, duration, loop, restart, progress, export-at-time behavior, product animation, or video export.
|
|
15
|
+
|
|
16
|
+
## Timeline Requirement
|
|
17
|
+
|
|
18
|
+
- Product animation uses the top playback timeline by default.
|
|
19
|
+
- Any app with `Export Video` must enable the top Toolcraft timeline.
|
|
20
|
+
- Do not add right-panel Play, Pause, Animate, Restart, or app-wide transport controls. Use the top timeline.
|
|
21
|
+
- Do not replace `TimelinePanel` with app-level playback, transport, or timeline UI to work around performance.
|
|
22
|
+
- Custom timeline UI is allowed only when a reference app has non-Toolcraft timeline behavior and the reference timeline inventory proves it.
|
|
23
|
+
|
|
24
|
+
## Compact And Extended Timeline
|
|
25
|
+
|
|
26
|
+
- When `panels.timeline` is enabled, runtime Setup appends a `Timeline` switch.
|
|
27
|
+
- Off shows compact Play-only transport.
|
|
28
|
+
- On shows the extended timeline with scrubber, duration, loop, and keyframe UI.
|
|
29
|
+
- The switch is runtime UI state only. It does not pause playback, change keyframes, alter export, write product values, or reset with `Reset controls`.
|
|
30
|
+
|
|
31
|
+
## Seamless Forward Loops
|
|
32
|
+
|
|
33
|
+
- Product loops are seamless forward-only cycles by default.
|
|
34
|
+
- First and last frames stitch.
|
|
35
|
+
- Direction does not reverse.
|
|
36
|
+
- Mirror, yoyo, ping-pong, or back-and-forth behavior requires explicit user intent.
|
|
37
|
+
- Use `getToolcraftTimelineLoopTime` or `getToolcraftTimelineLoopProgress` in playback renderers instead of local wall-clock or fixed-duration phase math.
|
|
38
|
+
- When the loop period is known or product-derived, set `panels.timeline.defaultDurationSeconds` to that period and record the evidence in animation or reference timeline metadata.
|
|
39
|
+
- Runtime/template fallback `8s` is not evidence for loop duration.
|
|
40
|
+
|
|
41
|
+
## Duration Changes
|
|
42
|
+
|
|
43
|
+
- Editing timeline duration changes the loop length, not the scene design.
|
|
44
|
+
- The app must keep animation settings stable when duration changes.
|
|
45
|
+
- The loop remains seamless and forward-only after duration changes.
|
|
46
|
+
- Export duration follows runtime timeline duration.
|
|
47
|
+
|
|
48
|
+
## Keyframes
|
|
49
|
+
|
|
50
|
+
- Use keyframes timeline when users edit property animation over time.
|
|
51
|
+
- Keyframe renderers consume Toolcraft evaluated-value helpers/hooks.
|
|
52
|
+
- Do not parse timeline `valueLabel` strings.
|
|
53
|
+
- Do not read raw `state.values` for keyframed targets when evaluated keyframe helpers are available.
|
|
54
|
+
- When a keyframe point is selected and a parameter is edited, update the selected point instead of creating a new point unless the user explicitly adds one.
|
|
55
|
+
|
|
56
|
+
## Viewport Interaction Performance
|
|
57
|
+
|
|
58
|
+
- Animated preview renderers suspend or coalesce non-essential animation work during canvas drag, pan, pinch, zoom, and radar/center interactions.
|
|
59
|
+
- Resume from the correct timeline or autonomous time without changing play/pause state.
|
|
60
|
+
- Do not sacrifice selected render scale or visible quality to pass performance budgets without measured evidence.
|
|
61
|
+
|
|
62
|
+
## Video Export Timing
|
|
63
|
+
|
|
64
|
+
- Video export uses runtime timeline time.
|
|
65
|
+
- Offline rendered-frame video export must encode frame timestamps from timeline time.
|
|
66
|
+
- Real-time `canvas.captureStream()` plus `MediaRecorder` is not enough when renderer work can be slower than playback.
|
|
67
|
+
- Browser acceptance verifies exported video metadata duration against edited timeline duration.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Custom Controls
|
|
2
2
|
|
|
3
|
+
> Reading route: start with `workflow.md`. Core generated-app rules live in `core/*`; this file is a focused custom-control reference for the topic below.
|
|
4
|
+
|
|
3
5
|
Use a custom control only when no built-in Toolcraft control represents the product interaction.
|
|
4
6
|
|
|
5
7
|
Built-ins come first: `slider`, `rangeSlider`, `select`, `segmented`, `switch`, `checkbox`, `color`, `colorOpacity`, `vector`, `gradient`, `curves`, `fontPicker`, `imagePicker`, `fileDrop`, `text`, `code`, `rangeInput`, `palette`, `actions`, `collectionActions`, and `panelActions`.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Performance
|
|
2
2
|
|
|
3
|
+
> Reading route: start with `workflow.md`. Core generated-app rules live in `core/*`; this file is a focused performance reference for the topic below.
|
|
4
|
+
|
|
3
5
|
Every visible non-action control needs a `performanceRole` and `performanceReason`.
|
|
4
6
|
|
|
5
7
|
Performance coverage has two levels:
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Renderer Technique
|
|
2
2
|
|
|
3
|
+
> Reading route: start with `workflow.md`. Core generated-app rules live in `core/*`; this file is a focused renderer reference for the topic below.
|
|
4
|
+
|
|
3
5
|
Choose render technology per product layer. Do not choose a renderer because it is convenient; choose it from product output semantics, reference behavior, fidelity, and workload.
|
|
4
6
|
|
|
5
7
|
The initial renderer choice is provisional. It becomes accepted only after the app passes performance checks with the largest useful product canvas and the heaviest useful values for its own controls. If those checks show frame gaps, long tasks, viewport shaking, slow export, or interaction jank, revise the renderer strategy from that evidence before delivery. Do not make a renderer look fast by silently reducing the selected preview scale, backing pixels, source media quality, or export fidelity.
|