@pixel-point/toolcraft 0.0.6 → 0.0.8
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/package.json +1 -1
- package/src/generate.test.mjs +1 -1
- package/templates/runtime/contracts/component-contracts.test.ts +123 -15
- package/templates/runtime/contracts/component-contracts.ts +93 -19
- package/templates/runtime/contracts/decision-contracts.test.ts +3 -2
- package/templates/runtime/contracts/decision-contracts.ts +2 -2
- package/templates/runtime/export/export.test.ts +31 -0
- package/templates/runtime/export/export.ts +41 -0
- package/templates/runtime/react/canvas-shell.test.tsx +77 -1
- package/templates/runtime/react/canvas-shell.tsx +178 -23
- package/templates/runtime/react/control-conditions.ts +166 -0
- package/templates/runtime/react/controls-panel-filedrop-reorder.test.tsx +176 -0
- package/templates/runtime/react/controls-panel.test.tsx +590 -9
- package/templates/runtime/react/controls-panel.tsx +472 -10
- package/templates/runtime/react/media-file.ts +19 -0
- package/templates/runtime/schema/define-toolcraft.test.ts +2 -0
- package/templates/runtime/schema/define-toolcraft.ts +11 -3
- package/templates/runtime/schema/types.ts +27 -0
- package/templates/runtime/state/reducer.test.ts +357 -0
- package/templates/runtime/state/reducer.ts +195 -9
- package/templates/runtime/state/types.ts +12 -2
- package/templates/runtime/testing/performance.test.ts +1282 -48
- package/templates/runtime/testing/performance.ts +676 -39
- package/templates/starter/AGENTS.md +13 -12
- package/templates/starter/docs/toolcraft/README.md +4 -3
- package/templates/starter/docs/toolcraft/acceptance-testing.md +17 -7
- package/templates/starter/docs/toolcraft/assembly-workflow.md +9 -7
- package/templates/starter/docs/toolcraft/component-rules.md +20 -7
- package/templates/starter/docs/toolcraft/custom-controls.md +9 -5
- package/templates/starter/docs/toolcraft/performance.md +51 -13
- package/templates/starter/docs/toolcraft/renderer-technique.md +4 -0
- package/templates/starter/docs/toolcraft/schema-reference.md +11 -6
- package/templates/starter/docs/toolcraft/workflow.md +7 -10
- package/templates/starter/e2e/app-performance.spec.ts +136 -3
- package/templates/starter/e2e/performance-helpers.ts +197 -0
- package/templates/starter/package.json +4 -1
- package/templates/starter/src/app/starter-acceptance.test.ts +529 -19
- package/templates/starter/src/app/starter-acceptance.ts +269 -12
- package/templates/starter/src/app/starter-performance.test.ts +67 -6
- package/templates/ui/components/controls/actions/actions-control.tsx +3 -5
- package/templates/ui/components/controls/collection-actions/collection-actions-control.tsx +60 -0
- package/templates/ui/components/controls/collection-actions/index.ts +4 -0
- package/templates/ui/components/controls/file-drop/file-drop-control.tsx +340 -44
- package/templates/ui/components/controls/file-drop/index.ts +1 -1
- package/templates/ui/components/controls/font-picker/font-picker-control.tsx +1 -6
- package/templates/ui/components/controls/index.ts +9 -0
- package/templates/ui/components/panel/panel-section.tsx +53 -1
- package/templates/ui/index.ts +1 -0
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
ToolcraftCanvasSize,
|
|
3
|
+
ToolcraftFileDropAssetKind,
|
|
4
|
+
ResolvedToolcraftAppSchema,
|
|
5
|
+
} from "../schema/types";
|
|
2
6
|
|
|
3
7
|
export type ToolcraftCommand =
|
|
4
8
|
| {
|
|
@@ -11,6 +15,7 @@ export type ToolcraftCommand =
|
|
|
11
15
|
}
|
|
12
16
|
| { type: "controls.apply" }
|
|
13
17
|
| { type: "controls.reset" }
|
|
18
|
+
| { label?: string; targets: string[]; type: "controls.resetTargets" }
|
|
14
19
|
| { insertIndex?: number; layer?: ToolcraftLayerDraft; type: "layers.add" }
|
|
15
20
|
| { layerId: string; type: "layers.delete" }
|
|
16
21
|
| { layerIds: string[]; parentGroupId: string | null; type: "layers.moveToGroup" }
|
|
@@ -43,6 +48,7 @@ export type ToolcraftCommand =
|
|
|
43
48
|
type: "media.import";
|
|
44
49
|
}
|
|
45
50
|
| { mediaId: string; type: "media.delete" }
|
|
51
|
+
| { mediaIds: string[]; type: "media.reorder" }
|
|
46
52
|
| { currentTimeSeconds: number; type: "timeline.setCurrentTime" }
|
|
47
53
|
| { durationSeconds: number; type: "timeline.setDuration" }
|
|
48
54
|
| { expanded: boolean; type: "timeline.setExpanded" }
|
|
@@ -82,6 +88,7 @@ export const toolcraftRuntimeCommandTypes = [
|
|
|
82
88
|
"controls.setValue",
|
|
83
89
|
"controls.apply",
|
|
84
90
|
"controls.reset",
|
|
91
|
+
"controls.resetTargets",
|
|
85
92
|
"layers.add",
|
|
86
93
|
"layers.delete",
|
|
87
94
|
"layers.moveToGroup",
|
|
@@ -102,6 +109,7 @@ export const toolcraftRuntimeCommandTypes = [
|
|
|
102
109
|
"panels.resetOffset",
|
|
103
110
|
"media.import",
|
|
104
111
|
"media.delete",
|
|
112
|
+
"media.reorder",
|
|
105
113
|
"timeline.setCurrentTime",
|
|
106
114
|
"timeline.setDuration",
|
|
107
115
|
"timeline.setExpanded",
|
|
@@ -154,13 +162,15 @@ export type ToolcraftLayerDraft = {
|
|
|
154
162
|
};
|
|
155
163
|
|
|
156
164
|
export type ToolcraftMediaAsset = {
|
|
165
|
+
assetKind?: ToolcraftFileDropAssetKind;
|
|
157
166
|
dataUrl: string;
|
|
158
167
|
fileName: string;
|
|
159
168
|
id: string;
|
|
160
169
|
layerId: string;
|
|
161
170
|
mimeType: string;
|
|
162
171
|
position: ToolcraftPoint;
|
|
163
|
-
size
|
|
172
|
+
size?: ToolcraftCanvasSize;
|
|
173
|
+
sourceTarget?: string;
|
|
164
174
|
};
|
|
165
175
|
|
|
166
176
|
export type ToolcraftHistoryPatch = {
|