@digo-labs/common 0.1.19 → 0.1.20

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.
@@ -1,4 +1,4 @@
1
- import { AwsBlockContact, AwsBlockGroupFit, AwsBlockPlacement, AwsBlockPose, AwsGlyphFamily, AwsGlyphStage, AwsPaletteColor, AwsPoseLayout, AwsShapeAnimation } from './types';
1
+ import { AwsBlockContact, AwsBlockEntry, AwsBlockGroupFit, AwsBlockPlacement, AwsBlockPose, AwsGlyphFamily, AwsGlyphStage, AwsPaletteColor, AwsPoseLayout, AwsShapeAnimation } from './types';
2
2
  import { Bounds, Position, Size } from '../types/common-types';
3
3
  export declare class AwsHelpers {
4
4
  static getGlyphPath(family: AwsGlyphFamily, stage: AwsGlyphStage): string;
@@ -8,7 +8,8 @@ export declare class AwsHelpers {
8
8
  static isCrossed(frame: number, previous: number, current: number): boolean;
9
9
  static getBounds(blocks: AwsBlockPlacement[]): Bounds;
10
10
  static getLayout(poses: AwsBlockPose[], pose: AwsBlockPose, stage: Size, fit: AwsBlockGroupFit): AwsPoseLayout;
11
- static getContact(block: AwsBlockPlacement, pose: AwsBlockPose): AwsBlockContact | null;
11
+ static getContact(block: AwsBlockPlacement, pose: AwsBlockPose, preferred?: string[]): AwsBlockContact | null;
12
12
  static getBlockOrigin(block: AwsBlockPlacement, pose: AwsBlockPose): string;
13
13
  static projectContact(contact: AwsBlockContact, from: AwsBlockPose, to: AwsBlockPose): Position | null;
14
+ static getEntry(poses: AwsBlockPose[], id: string): AwsBlockEntry;
14
15
  }
@@ -1,4 +1,4 @@
1
- import { AwsBlockSize, AwsGlyph, AwsGlyphFamily, AwsGlyphStage } from './types';
1
+ import { AwsGlyph, AwsGlyphFamily, AwsGlyphStage } from './types';
2
2
  export declare const AWS_PALETTE: {
3
3
  white: string;
4
4
  black: string;
@@ -18,9 +18,7 @@ export declare const AWS_EASINGS: {
18
18
  };
19
19
  export declare const AWS_DURATIONS: {
20
20
  enter: number;
21
- move: number;
22
- resize: number;
21
+ beat: number;
23
22
  hold: number;
24
23
  };
25
24
  export declare const AWS_UNIT = 48;
26
- export declare const AWS_BLOCK_SIZES: AwsBlockSize[];
@@ -1,5 +1,7 @@
1
1
  export declare const AWS_BLOCK_GROUPS: {
2
2
  stair: {
3
+ beat: number;
4
+ hold: number;
3
5
  blocks: {
4
6
  a: {
5
7
  color: "black";
@@ -19,13 +21,13 @@ export declare const AWS_BLOCK_GROUPS: {
19
21
  id: string;
20
22
  x: number;
21
23
  y: number;
22
- size: 1;
24
+ size: number;
23
25
  stage: 1;
24
26
  } | {
25
27
  id: string;
26
28
  x: number;
27
29
  y: number;
28
- size: 2;
30
+ size: number;
29
31
  stage: 2;
30
32
  })[];
31
33
  hold?: undefined;
@@ -34,171 +36,154 @@ export declare const AWS_BLOCK_GROUPS: {
34
36
  id: string;
35
37
  x: number;
36
38
  y: number;
37
- size: 1;
39
+ size: number;
38
40
  stage: 1;
39
41
  } | {
40
42
  id: string;
41
43
  x: number;
42
44
  y: number;
43
- size: 2;
45
+ size: number;
44
46
  stage: 2;
45
47
  } | {
46
48
  id: string;
47
49
  x: number;
48
50
  y: number;
49
- size: 4;
51
+ size: number;
50
52
  stage: 3;
51
53
  })[];
52
54
  hold: number;
53
55
  })[];
54
56
  };
55
57
  trade: {
58
+ beat: number;
59
+ hold: number;
56
60
  blocks: {
57
61
  a: {
58
62
  color: "orange";
63
+ family: "pivot";
59
64
  };
60
65
  b: {
61
66
  color: "blue";
67
+ family: "scale";
62
68
  };
63
69
  };
64
70
  poses: {
65
- blocks: ({
66
- id: string;
67
- x: number;
68
- y: number;
69
- size: 1;
70
- } | {
71
+ blocks: {
71
72
  id: string;
72
73
  x: number;
73
74
  y: number;
74
- size: 2;
75
- })[];
75
+ size: number;
76
+ }[];
76
77
  }[];
77
78
  };
78
79
  column: {
79
80
  fit: "pose";
81
+ beat: number;
82
+ hold: number;
80
83
  blocks: {
81
84
  a: {
82
85
  color: "orange";
86
+ family: "pivot";
83
87
  };
84
88
  b: {
85
89
  color: "blue";
90
+ family: "connect";
86
91
  };
87
92
  c: {
88
93
  color: "yellow";
94
+ family: "spark";
89
95
  };
90
96
  };
91
97
  poses: ({
92
- blocks: ({
93
- id: string;
94
- x: number;
95
- y: number;
96
- size: 4;
97
- } | {
98
+ blocks: {
98
99
  id: string;
99
100
  x: number;
100
101
  y: number;
101
- size: 2;
102
- })[];
102
+ size: number;
103
+ }[];
103
104
  hold?: undefined;
104
105
  } | {
105
- blocks: ({
106
- id: string;
107
- x: number;
108
- y: number;
109
- size: 4;
110
- } | {
111
- id: string;
112
- x: number;
113
- y: number;
114
- size: 2;
115
- } | {
106
+ blocks: {
116
107
  id: string;
117
108
  x: number;
118
109
  y: number;
119
- size: 1;
120
- })[];
110
+ size: number;
111
+ }[];
121
112
  hold: number;
122
113
  })[];
123
114
  };
124
115
  satellites: {
116
+ beat: number;
117
+ hold: number;
125
118
  blocks: {
126
119
  core: {
127
120
  color: "orange";
121
+ family: "scale";
128
122
  };
129
123
  light: {
130
124
  color: "yellow";
125
+ family: "spark";
131
126
  };
132
127
  dark: {
133
128
  color: "blue";
129
+ family: "connect";
134
130
  };
135
131
  };
136
132
  poses: ({
137
- blocks: ({
138
- id: string;
139
- x: number;
140
- y: number;
141
- size: 2;
142
- } | {
133
+ blocks: {
143
134
  id: string;
144
135
  x: number;
145
136
  y: number;
146
- size: 1;
147
- })[];
137
+ size: number;
138
+ }[];
148
139
  hold: number;
149
140
  } | {
150
- blocks: ({
151
- id: string;
152
- x: number;
153
- y: number;
154
- size: 2;
155
- } | {
141
+ blocks: {
156
142
  id: string;
157
143
  x: number;
158
144
  y: number;
159
- size: 1;
160
- })[];
145
+ size: number;
146
+ }[];
161
147
  hold?: undefined;
162
148
  })[];
163
149
  };
164
150
  swap: {
151
+ beat: number;
152
+ hold: number;
165
153
  blocks: {
166
154
  core: {
167
155
  color: "orange";
156
+ family: "pivot";
168
157
  };
169
158
  medium: {
170
159
  color: "blue";
160
+ family: "scale";
171
161
  };
172
162
  light: {
173
163
  color: "yellow";
164
+ family: "spark";
174
165
  };
175
166
  };
176
167
  poses: {
177
- blocks: ({
178
- id: string;
179
- x: number;
180
- y: number;
181
- size: 4;
182
- } | {
183
- id: string;
184
- x: number;
185
- y: number;
186
- size: 2;
187
- } | {
168
+ blocks: {
188
169
  id: string;
189
170
  x: number;
190
171
  y: number;
191
- size: 1;
192
- })[];
172
+ size: number;
173
+ }[];
193
174
  }[];
194
175
  };
195
176
  orbit: {
177
+ beat: number;
178
+ hold: number;
196
179
  blocks: {
197
180
  a: {
198
181
  color: "orange";
182
+ family: "connect";
199
183
  };
200
184
  b: {
201
185
  color: "blue";
186
+ family: "pivot";
202
187
  };
203
188
  };
204
189
  poses: {
@@ -206,12 +191,13 @@ export declare const AWS_BLOCK_GROUPS: {
206
191
  id: string;
207
192
  x: number;
208
193
  y: number;
209
- size: 1;
194
+ size: number;
210
195
  }[];
211
- hold: number;
212
196
  }[];
213
197
  };
214
198
  cluster: {
199
+ beat: number;
200
+ hold: number;
215
201
  blocks: {
216
202
  orange: {
217
203
  color: "orange";
@@ -221,6 +207,10 @@ export declare const AWS_BLOCK_GROUPS: {
221
207
  color: "blue";
222
208
  family: "spark";
223
209
  };
210
+ olive: {
211
+ color: "yellowMuted";
212
+ family: "spark";
213
+ };
224
214
  pink: {
225
215
  color: "pink";
226
216
  family: "connect";
@@ -229,86 +219,160 @@ export declare const AWS_BLOCK_GROUPS: {
229
219
  color: "yellowLight";
230
220
  family: "scale";
231
221
  };
232
- olive: {
222
+ tiny: {
233
223
  color: "yellowMuted";
234
224
  family: "spark";
235
225
  };
226
+ black: {
227
+ color: "black";
228
+ family: "scale";
229
+ };
236
230
  };
237
231
  poses: ({
238
232
  blocks: {
239
233
  id: string;
240
234
  x: number;
241
235
  y: number;
242
- size: 2;
236
+ size: number;
243
237
  stage: 1;
238
+ enter: "center";
244
239
  }[];
245
- hold: number;
240
+ beat: number;
241
+ hold?: undefined;
246
242
  } | {
247
- blocks: ({
243
+ blocks: {
248
244
  id: string;
249
245
  x: number;
250
246
  y: number;
251
- size: 2;
247
+ size: number;
252
248
  stage: 1;
249
+ }[];
250
+ beat: number;
251
+ hold?: undefined;
252
+ } | {
253
+ blocks: ({
254
+ id: string;
255
+ x: number;
256
+ y: number;
257
+ size: number;
258
+ stage: 2;
253
259
  } | {
254
260
  id: string;
255
261
  x: number;
256
262
  y: number;
257
- size: 1;
263
+ size: number;
258
264
  stage: 1;
259
265
  })[];
266
+ beat?: undefined;
260
267
  hold?: undefined;
261
268
  } | {
262
269
  blocks: ({
263
270
  id: string;
264
271
  x: number;
265
272
  y: number;
266
- size: 2;
273
+ size: number;
267
274
  stage: 2;
268
275
  } | {
269
276
  id: string;
270
277
  x: number;
271
278
  y: number;
272
- size: 1;
273
- stage: 1;
279
+ size: number;
280
+ stage?: undefined;
274
281
  })[];
275
- hold: number;
282
+ beat: number;
283
+ hold?: undefined;
276
284
  } | {
277
285
  blocks: ({
278
286
  id: string;
279
287
  x: number;
280
288
  y: number;
281
- size: 2;
289
+ size: number;
290
+ stage: 3;
291
+ } | {
292
+ id: string;
293
+ x: number;
294
+ y: number;
295
+ size: number;
282
296
  stage: 2;
283
297
  } | {
284
298
  id: string;
285
299
  x: number;
286
300
  y: number;
287
- size: 1;
301
+ size: number;
302
+ stage?: undefined;
303
+ })[];
304
+ beat: number;
305
+ hold: number;
306
+ })[];
307
+ };
308
+ spark: {
309
+ beat: number;
310
+ hold: number;
311
+ blocks: {
312
+ orange: {
313
+ color: "orange";
314
+ family: "spark";
315
+ };
316
+ yellow: {
317
+ color: "yellow";
318
+ family: "spark";
319
+ };
320
+ purple: {
321
+ color: "purple";
322
+ family: "spark";
323
+ };
324
+ };
325
+ poses: ({
326
+ blocks: {
327
+ id: string;
328
+ x: number;
329
+ y: number;
330
+ size: number;
331
+ stage: 2;
332
+ enter: "center";
333
+ }[];
334
+ beat: number;
335
+ hold?: undefined;
336
+ } | {
337
+ blocks: ({
338
+ id: string;
339
+ x: number;
340
+ y: number;
341
+ size: number;
288
342
  stage: 2;
343
+ enter?: undefined;
344
+ } | {
345
+ id: string;
346
+ x: number;
347
+ y: number;
348
+ size: number;
349
+ stage: 1;
350
+ enter: "split";
289
351
  })[];
352
+ beat?: undefined;
290
353
  hold?: undefined;
291
354
  } | {
292
355
  blocks: ({
293
356
  id: string;
294
357
  x: number;
295
358
  y: number;
296
- size: 2;
297
- stage: 3;
359
+ size: number;
360
+ stage: 1;
298
361
  } | {
299
362
  id: string;
300
363
  x: number;
301
364
  y: number;
302
- size: 1;
365
+ size: number;
303
366
  stage: 3;
304
367
  } | {
305
368
  id: string;
306
369
  x: number;
307
370
  y: number;
308
- size: 1;
371
+ size: number;
309
372
  stage: 2;
310
373
  })[];
311
374
  hold: number;
375
+ beat?: undefined;
312
376
  })[];
313
377
  };
314
378
  };
@@ -8,7 +8,6 @@ export type AwsGlyph = keyof typeof AWS_GLYPHS;
8
8
  export type AwsPaletteColor = keyof typeof AWS_PALETTE;
9
9
  export type AwsEasing = keyof typeof AWS_EASINGS;
10
10
  export type AwsDuration = keyof typeof AWS_DURATIONS;
11
- export type AwsBlockSize = 0.25 | 0.5 | 1 | 2 | 4;
12
11
  export interface AwsShapeMarker {
13
12
  payload: {
14
13
  name: string;
@@ -23,15 +22,18 @@ export interface AwsBlockIdentity {
23
22
  color: AwsPaletteColor;
24
23
  family?: AwsGlyphFamily;
25
24
  }
25
+ export type AwsBlockEntry = 'contact' | 'center' | 'split';
26
26
  export interface AwsBlockPlacement {
27
27
  id: string;
28
28
  x: number;
29
29
  y: number;
30
- size: AwsBlockSize;
30
+ size: number;
31
31
  stage?: AwsGlyphStage;
32
+ enter?: AwsBlockEntry;
32
33
  }
33
34
  export interface AwsBlockPose {
34
35
  blocks: AwsBlockPlacement[];
36
+ beat?: number;
35
37
  hold?: number;
36
38
  }
37
39
  export type AwsBlockGroupFit = 'all' | 'pose' | false;
@@ -39,6 +41,8 @@ export interface AwsBlockGroupData {
39
41
  blocks: Record<string, AwsBlockIdentity>;
40
42
  poses: AwsBlockPose[];
41
43
  fit?: AwsBlockGroupFit;
44
+ beat?: number;
45
+ hold?: number;
42
46
  }
43
47
  export interface AwsBlockContact {
44
48
  id: string;