@cssints/apg-specs 0.5.1 → 0.6.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssints/apg-specs",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "APG widget specs: Quint sources, generated models, scenario bridges and ported scenario sets, the test oracle of headless widgets",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,6 +36,13 @@
36
36
  "default": "./dist/canvas/*.bridge.mjs"
37
37
  },
38
38
  "./canvas/*.model.json": "./dist/canvas/*.model.json",
39
+ "./patterns/*.bridge": {
40
+ "types": "./dist/patterns/*.bridge.d.mts",
41
+ "default": "./dist/patterns/*.bridge.mjs"
42
+ },
43
+ "./patterns/*.model.json": "./dist/patterns/*.model.json",
44
+ "./scenarios/patterns/*.json": "./scenarios/patterns/*.json",
45
+ "./specs/patterns/*.qnt": "./specs/patterns/*.qnt",
39
46
  "./scenarios/apg/*.json": "./scenarios/apg/*.json",
40
47
  "./scenarios/canvas/*.json": "./scenarios/canvas/*.json",
41
48
  "./scenarios/parts.json": "./scenarios/parts.json",
@@ -0,0 +1,12 @@
1
+ # Pattern scenarios — our own non-APG patterns
2
+
3
+ One file per pattern: `<pattern>.spec.json`, in the format of
4
+ [`../apg/README.md`](../apg/README.md) (same envelope, steps and expectations;
5
+ `src/scenario.ts` decodes it, so a step outside the documented vocabulary is
6
+ `unsupported` rather than silently dropped).
7
+
8
+ There is no upstream test to port here: a scenario is written from the pattern's
9
+ own spec, so `source` is `spec`, `commit` is `null` and the file says which spec
10
+ it came from in `notes`. `skipped` names the behaviours the spec deliberately
11
+ does not model, with the reason. `resizable-panels` is the first one: a group of
12
+ window splitters, `specs/patterns/resizable-panels.qnt`.
@@ -0,0 +1,539 @@
1
+ {
2
+ "pattern": "resizable-panels",
3
+ "source": "spec",
4
+ "commit": null,
5
+ "license": "MIT",
6
+ "notes": "Not an APG pattern (bean cssints-pyit): a group of APG window splitters. Written from specs/patterns/resizable-panels.qnt (the layout, the drag and the request/commit contract) with the keyboard from specs/apg/windowsplitter.qnt. Config is the three-pane instance: 10/80 bounds, 10% steps, pane 0 collapsible at 0. The drag is its own vocabulary: dragStart on a separator, dragBy with a +/-10 delta, dragEnd.",
7
+ "skipped": [
8
+ {
9
+ "id": "resizable-panels.spec.drag-through-min-collapses",
10
+ "reason": "react-resizable-panels collapses a pane when a drag crosses its minSize; this spec collapses only on Enter or a host write, so a drag stops at MIN"
11
+ },
12
+ {
13
+ "id": "resizable-panels.spec.f6-cycles-panes",
14
+ "reason": "the group has no F6 cycle: with three panes it buys nothing a Tab does not, and the spec leaves it out"
15
+ }
16
+ ],
17
+ "scenarios": [
18
+ {
19
+ "id": "resizable-panels.spec.initial-layout",
20
+ "apg": "extension",
21
+ "config": {},
22
+ "steps": [
23
+ {
24
+ "expect": {
25
+ "focus": null,
26
+ "value": [
27
+ 20,
28
+ 40,
29
+ 40
30
+ ],
31
+ "attrs": {
32
+ "separator:0": {
33
+ "role": "separator",
34
+ "aria-orientation": "vertical",
35
+ "aria-valuenow": "20",
36
+ "aria-valuemin": "10",
37
+ "aria-valuemax": "80",
38
+ "tabindex": "0"
39
+ },
40
+ "separator:1": {
41
+ "role": "separator",
42
+ "aria-valuenow": "40"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "resizable-panels.spec.arrow-moves-the-pair",
51
+ "apg": "keyboard",
52
+ "config": {},
53
+ "steps": [
54
+ {
55
+ "event": "focus",
56
+ "target": "separator:0"
57
+ },
58
+ {
59
+ "expect": {
60
+ "focus": "separator:0"
61
+ }
62
+ },
63
+ {
64
+ "event": "key",
65
+ "key": "ArrowRight",
66
+ "target": "separator:0"
67
+ },
68
+ {
69
+ "expect": {
70
+ "value": [
71
+ 30,
72
+ 30,
73
+ 40
74
+ ],
75
+ "attrs": {
76
+ "separator:0": {
77
+ "aria-valuenow": "30"
78
+ }
79
+ },
80
+ "events": {
81
+ "onSizesChange": [
82
+ [
83
+ 30,
84
+ 30,
85
+ 40
86
+ ]
87
+ ]
88
+ }
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "id": "resizable-panels.spec.arrow-stops-at-the-neighbours-min",
95
+ "apg": "keyboard",
96
+ "config": {},
97
+ "steps": [
98
+ {
99
+ "event": "focus",
100
+ "target": "separator:0"
101
+ },
102
+ {
103
+ "event": "key",
104
+ "key": "ArrowLeft",
105
+ "target": "separator:0"
106
+ },
107
+ {
108
+ "expect": {
109
+ "value": [
110
+ 10,
111
+ 50,
112
+ 40
113
+ ]
114
+ }
115
+ },
116
+ {
117
+ "event": "key",
118
+ "key": "ArrowLeft",
119
+ "target": "separator:0"
120
+ },
121
+ {
122
+ "expect": {
123
+ "value": [
124
+ 10,
125
+ 50,
126
+ 40
127
+ ],
128
+ "events": {
129
+ "onSizesChange": [
130
+ [
131
+ 10,
132
+ 50,
133
+ 40
134
+ ]
135
+ ]
136
+ }
137
+ }
138
+ }
139
+ ]
140
+ },
141
+ {
142
+ "id": "resizable-panels.spec.home-and-end-jump-the-pair",
143
+ "apg": "keyboard",
144
+ "config": {},
145
+ "steps": [
146
+ {
147
+ "event": "focus",
148
+ "target": "separator:1"
149
+ },
150
+ {
151
+ "event": "key",
152
+ "key": "End",
153
+ "target": "separator:1"
154
+ },
155
+ {
156
+ "expect": {
157
+ "value": [
158
+ 20,
159
+ 70,
160
+ 10
161
+ ]
162
+ }
163
+ },
164
+ {
165
+ "event": "key",
166
+ "key": "Home",
167
+ "target": "separator:1"
168
+ },
169
+ {
170
+ "expect": {
171
+ "value": [
172
+ 20,
173
+ 10,
174
+ 70
175
+ ]
176
+ }
177
+ }
178
+ ]
179
+ },
180
+ {
181
+ "id": "resizable-panels.spec.enter-collapses-and-restores",
182
+ "apg": "keyboard",
183
+ "config": {},
184
+ "steps": [
185
+ {
186
+ "event": "focus",
187
+ "target": "separator:0"
188
+ },
189
+ {
190
+ "event": "key",
191
+ "key": "Enter",
192
+ "target": "separator:0"
193
+ },
194
+ {
195
+ "expect": {
196
+ "value": [
197
+ 0,
198
+ 60,
199
+ 40
200
+ ],
201
+ "attrs": {
202
+ "separator:0": {
203
+ "aria-valuenow": "0"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ {
209
+ "event": "key",
210
+ "key": "Enter",
211
+ "target": "separator:0"
212
+ },
213
+ {
214
+ "expect": {
215
+ "value": [
216
+ 20,
217
+ 40,
218
+ 40
219
+ ]
220
+ }
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ "id": "resizable-panels.spec.drag-stops-at-min-and-keeps-the-snapshot",
226
+ "apg": "extension",
227
+ "config": {},
228
+ "steps": [
229
+ {
230
+ "event": "dragStart",
231
+ "target": "separator:0"
232
+ },
233
+ {
234
+ "expect": {
235
+ "focus": "separator:0"
236
+ }
237
+ },
238
+ {
239
+ "event": "dragBy",
240
+ "value": 10
241
+ },
242
+ {
243
+ "expect": {
244
+ "value": [
245
+ 30,
246
+ 30,
247
+ 40
248
+ ]
249
+ }
250
+ },
251
+ {
252
+ "event": "dragBy",
253
+ "value": -10
254
+ },
255
+ {
256
+ "expect": {
257
+ "value": [
258
+ 20,
259
+ 40,
260
+ 40
261
+ ]
262
+ }
263
+ },
264
+ {
265
+ "event": "dragBy",
266
+ "value": -10
267
+ },
268
+ {
269
+ "expect": {
270
+ "value": [
271
+ 10,
272
+ 50,
273
+ 40
274
+ ]
275
+ }
276
+ },
277
+ {
278
+ "event": "dragBy",
279
+ "value": -10
280
+ },
281
+ {
282
+ "event": "dragEnd"
283
+ },
284
+ {
285
+ "expect": {
286
+ "value": [
287
+ 10,
288
+ 50,
289
+ 40
290
+ ],
291
+ "events": {
292
+ "onSizesChange": [
293
+ [
294
+ 30,
295
+ 30,
296
+ 40
297
+ ],
298
+ [
299
+ 20,
300
+ 40,
301
+ 40
302
+ ],
303
+ [
304
+ 10,
305
+ 50,
306
+ 40
307
+ ]
308
+ ]
309
+ }
310
+ }
311
+ }
312
+ ]
313
+ },
314
+ {
315
+ "id": "resizable-panels.spec.drag-moves-only-the-neighbours",
316
+ "apg": "extension",
317
+ "config": {},
318
+ "steps": [
319
+ {
320
+ "event": "dragStart",
321
+ "target": "separator:1"
322
+ },
323
+ {
324
+ "event": "dragBy",
325
+ "value": 10
326
+ },
327
+ {
328
+ "expect": {
329
+ "value": [
330
+ 20,
331
+ 50,
332
+ 30
333
+ ]
334
+ }
335
+ },
336
+ {
337
+ "event": "dragEnd"
338
+ },
339
+ {
340
+ "expect": {
341
+ "value": [
342
+ 20,
343
+ 50,
344
+ 30
345
+ ]
346
+ }
347
+ }
348
+ ]
349
+ },
350
+ {
351
+ "id": "resizable-panels.spec.collapsed-separator-is-immovable",
352
+ "apg": "keyboard",
353
+ "config": {},
354
+ "steps": [
355
+ {
356
+ "event": "focus",
357
+ "target": "separator:0"
358
+ },
359
+ {
360
+ "event": "key",
361
+ "key": "Enter",
362
+ "target": "separator:0"
363
+ },
364
+ {
365
+ "expect": {
366
+ "value": [
367
+ 0,
368
+ 60,
369
+ 40
370
+ ]
371
+ }
372
+ },
373
+ {
374
+ "event": "key",
375
+ "key": "ArrowRight",
376
+ "target": "separator:0"
377
+ },
378
+ {
379
+ "event": "key",
380
+ "key": "Home",
381
+ "target": "separator:0"
382
+ },
383
+ {
384
+ "expect": {
385
+ "value": [
386
+ 0,
387
+ 60,
388
+ 40
389
+ ],
390
+ "events": {
391
+ "onSizesChange": [
392
+ [
393
+ 0,
394
+ 60,
395
+ 40
396
+ ]
397
+ ]
398
+ }
399
+ }
400
+ },
401
+ {
402
+ "event": "key",
403
+ "key": "Enter",
404
+ "target": "separator:0"
405
+ },
406
+ {
407
+ "expect": {
408
+ "value": [
409
+ 20,
410
+ 40,
411
+ 40
412
+ ]
413
+ }
414
+ }
415
+ ],
416
+ "notes": "collapsed by Enter (an uncontrolled group), so arrows and Home are inert and Enter restores the remembered size"
417
+ },
418
+ {
419
+ "id": "resizable-panels.spec.controlled-hold-ignores-the-request",
420
+ "apg": "extension",
421
+ "config": {
422
+ "controlled": true,
423
+ "accepts": false
424
+ },
425
+ "steps": [
426
+ {
427
+ "event": "focus",
428
+ "target": "separator:0"
429
+ },
430
+ {
431
+ "event": "key",
432
+ "key": "ArrowRight",
433
+ "target": "separator:0"
434
+ },
435
+ {
436
+ "expect": {
437
+ "value": [
438
+ 20,
439
+ 40,
440
+ 40
441
+ ],
442
+ "attrs": {
443
+ "separator:0": {
444
+ "aria-valuenow": "20"
445
+ }
446
+ },
447
+ "events": {
448
+ "onSizesChange": [
449
+ [
450
+ 30,
451
+ 30,
452
+ 40
453
+ ]
454
+ ]
455
+ }
456
+ }
457
+ }
458
+ ]
459
+ },
460
+ {
461
+ "id": "resizable-panels.spec.controlled-host-writes-the-layout",
462
+ "apg": "extension",
463
+ "config": {
464
+ "controlled": true,
465
+ "accepts": false,
466
+ "layout": "wide"
467
+ },
468
+ "steps": [
469
+ {
470
+ "expect": {
471
+ "value": [
472
+ 50,
473
+ 30,
474
+ 20
475
+ ],
476
+ "attrs": {
477
+ "separator:0": {
478
+ "aria-valuenow": "50"
479
+ },
480
+ "separator:1": {
481
+ "aria-valuenow": "30"
482
+ }
483
+ }
484
+ }
485
+ },
486
+ {
487
+ "event": "prop",
488
+ "prop": "hostLayout",
489
+ "value": "narrow"
490
+ },
491
+ {
492
+ "expect": {
493
+ "value": [
494
+ 10,
495
+ 40,
496
+ 50
497
+ ]
498
+ }
499
+ }
500
+ ]
501
+ },
502
+ {
503
+ "id": "resizable-panels.spec.controlled-accepting-host-commits",
504
+ "apg": "extension",
505
+ "config": {
506
+ "controlled": true
507
+ },
508
+ "steps": [
509
+ {
510
+ "event": "focus",
511
+ "target": "separator:1"
512
+ },
513
+ {
514
+ "event": "key",
515
+ "key": "ArrowLeft",
516
+ "target": "separator:1"
517
+ },
518
+ {
519
+ "expect": {
520
+ "value": [
521
+ 20,
522
+ 30,
523
+ 50
524
+ ],
525
+ "events": {
526
+ "onSizesChange": [
527
+ [
528
+ 20,
529
+ 30,
530
+ 50
531
+ ]
532
+ ]
533
+ }
534
+ }
535
+ }
536
+ ]
537
+ }
538
+ ]
539
+ }