@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.
Files changed (48) hide show
  1. package/package.json +1 -1
  2. package/src/generate.test.mjs +1 -1
  3. package/templates/runtime/contracts/component-contracts.test.ts +123 -15
  4. package/templates/runtime/contracts/component-contracts.ts +93 -19
  5. package/templates/runtime/contracts/decision-contracts.test.ts +3 -2
  6. package/templates/runtime/contracts/decision-contracts.ts +2 -2
  7. package/templates/runtime/export/export.test.ts +31 -0
  8. package/templates/runtime/export/export.ts +41 -0
  9. package/templates/runtime/react/canvas-shell.test.tsx +77 -1
  10. package/templates/runtime/react/canvas-shell.tsx +178 -23
  11. package/templates/runtime/react/control-conditions.ts +166 -0
  12. package/templates/runtime/react/controls-panel-filedrop-reorder.test.tsx +176 -0
  13. package/templates/runtime/react/controls-panel.test.tsx +590 -9
  14. package/templates/runtime/react/controls-panel.tsx +472 -10
  15. package/templates/runtime/react/media-file.ts +19 -0
  16. package/templates/runtime/schema/define-toolcraft.test.ts +2 -0
  17. package/templates/runtime/schema/define-toolcraft.ts +11 -3
  18. package/templates/runtime/schema/types.ts +27 -0
  19. package/templates/runtime/state/reducer.test.ts +357 -0
  20. package/templates/runtime/state/reducer.ts +195 -9
  21. package/templates/runtime/state/types.ts +12 -2
  22. package/templates/runtime/testing/performance.test.ts +1282 -48
  23. package/templates/runtime/testing/performance.ts +676 -39
  24. package/templates/starter/AGENTS.md +13 -12
  25. package/templates/starter/docs/toolcraft/README.md +4 -3
  26. package/templates/starter/docs/toolcraft/acceptance-testing.md +17 -7
  27. package/templates/starter/docs/toolcraft/assembly-workflow.md +9 -7
  28. package/templates/starter/docs/toolcraft/component-rules.md +20 -7
  29. package/templates/starter/docs/toolcraft/custom-controls.md +9 -5
  30. package/templates/starter/docs/toolcraft/performance.md +51 -13
  31. package/templates/starter/docs/toolcraft/renderer-technique.md +4 -0
  32. package/templates/starter/docs/toolcraft/schema-reference.md +11 -6
  33. package/templates/starter/docs/toolcraft/workflow.md +7 -10
  34. package/templates/starter/e2e/app-performance.spec.ts +136 -3
  35. package/templates/starter/e2e/performance-helpers.ts +197 -0
  36. package/templates/starter/package.json +4 -1
  37. package/templates/starter/src/app/starter-acceptance.test.ts +529 -19
  38. package/templates/starter/src/app/starter-acceptance.ts +269 -12
  39. package/templates/starter/src/app/starter-performance.test.ts +67 -6
  40. package/templates/ui/components/controls/actions/actions-control.tsx +3 -5
  41. package/templates/ui/components/controls/collection-actions/collection-actions-control.tsx +60 -0
  42. package/templates/ui/components/controls/collection-actions/index.ts +4 -0
  43. package/templates/ui/components/controls/file-drop/file-drop-control.tsx +340 -44
  44. package/templates/ui/components/controls/file-drop/index.ts +1 -1
  45. package/templates/ui/components/controls/font-picker/font-picker-control.tsx +1 -6
  46. package/templates/ui/components/controls/index.ts +9 -0
  47. package/templates/ui/components/panel/panel-section.tsx +53 -1
  48. package/templates/ui/index.ts +1 -0
@@ -1,4 +1,8 @@
1
- import type { ToolcraftCanvasSize, ResolvedToolcraftAppSchema } from "../schema/types";
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: ToolcraftCanvasSize;
172
+ size?: ToolcraftCanvasSize;
173
+ sourceTarget?: string;
164
174
  };
165
175
 
166
176
  export type ToolcraftHistoryPatch = {