@craftile/types 0.1.6 → 0.2.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +21 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@craftile/types",
3
- "version": "0.1.6",
3
+ "version": "0.2.1",
4
4
  "description": "Shared TypeScript type definitions for Craftile Editor",
5
5
  "keywords": [
6
6
  "craftile",
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export interface BlockProperties {
6
6
  export interface Block {
7
7
  type: string;
8
8
  id: string;
9
+ semanticId?: string;
9
10
  properties: BlockProperties;
10
11
  disabled?: boolean;
11
12
  static?: boolean; // Block cannot be moved or removed
@@ -22,10 +23,28 @@ export interface PropertyField {
22
23
  [key: string]: any;
23
24
  }
24
25
 
26
+ export interface PresetChild {
27
+ type: string;
28
+ id?: string;
29
+ properties?: Record<string, any>;
30
+ children?: PresetChild[];
31
+ }
32
+
33
+ export interface BlockPreset {
34
+ name: string;
35
+ properties?: Record<string, any>;
36
+ children?: PresetChild[];
37
+ icon?: string;
38
+ category?: string;
39
+ description?: string;
40
+ previewImageUrl?: string;
41
+ }
42
+
25
43
  export interface BlockSchema {
26
- type: string; // Unique identifier for the block type
44
+ type: string;
27
45
  properties: PropertyField[];
28
- accepts?: string[]; // Allowed children types
46
+ accepts?: string[];
47
+ presets?: BlockPreset[];
29
48
  meta?: Record<string, any>; // UI-specific metadata for editors
30
49
  }
31
50