@rogatio/cli 5.11.1 → 5.12.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/dist/editor/index.css +137 -15
- package/dist/editor/index.js +113 -66
- package/package.json +4 -4
package/dist/editor/index.css
CHANGED
|
@@ -39,8 +39,12 @@
|
|
|
39
39
|
--rogatio-surface: #161b22;
|
|
40
40
|
--rogatio-surface-raised: #1c222c;
|
|
41
41
|
--rogatio-surface-inset: #10131a;
|
|
42
|
-
--rogatio-
|
|
43
|
-
--rogatio-
|
|
42
|
+
--rogatio-card-group: #171d28;
|
|
43
|
+
--rogatio-card-rule: #1a222e;
|
|
44
|
+
--rogatio-card-rule-edge: #2ec4b6;
|
|
45
|
+
--rogatio-primary: #3b9eff;
|
|
46
|
+
--rogatio-primary-strong: #1f87f0;
|
|
47
|
+
--rogatio-primary-bg: rgba(59, 158, 255, 0.16);
|
|
44
48
|
--rogatio-secondary: #64748b;
|
|
45
49
|
--rogatio-tertiary: #0f172a;
|
|
46
50
|
--rogatio-neutral: #1e293b;
|
|
@@ -48,8 +52,9 @@
|
|
|
48
52
|
--rogatio-muted: #94a3b8;
|
|
49
53
|
--rogatio-faint: #64748b;
|
|
50
54
|
--rogatio-border: rgba(148, 163, 184, 0.16);
|
|
51
|
-
--rogatio-danger: #
|
|
52
|
-
--rogatio-danger-
|
|
55
|
+
--rogatio-danger: #f07178;
|
|
56
|
+
--rogatio-danger-strong: #e2555d;
|
|
57
|
+
--rogatio-danger-bg: rgba(240, 113, 120, 0.12);
|
|
53
58
|
--rogatio-success: #4ade80;
|
|
54
59
|
--rogatio-success-bg: rgba(74, 222, 128, 0.12);
|
|
55
60
|
--rogatio-warning: #fbbf24;
|
|
@@ -100,7 +105,8 @@
|
|
|
100
105
|
transition:
|
|
101
106
|
background-color 120ms ease,
|
|
102
107
|
border-color 120ms ease,
|
|
103
|
-
color 120ms ease
|
|
108
|
+
color 120ms ease,
|
|
109
|
+
box-shadow 120ms ease;
|
|
104
110
|
}
|
|
105
111
|
.rogatio-editor button:hover:not(:disabled) {
|
|
106
112
|
background: var(--rogatio-surface-raised);
|
|
@@ -110,6 +116,37 @@
|
|
|
110
116
|
cursor: not-allowed;
|
|
111
117
|
opacity: 0.55;
|
|
112
118
|
}
|
|
119
|
+
.rogatio-editor button[data-btn=primary] {
|
|
120
|
+
border-color: transparent;
|
|
121
|
+
background: var(--rogatio-primary);
|
|
122
|
+
color: #061018;
|
|
123
|
+
font-weight: 700;
|
|
124
|
+
}
|
|
125
|
+
.rogatio-editor button[data-btn=primary]:hover:not(:disabled) {
|
|
126
|
+
background: var(--rogatio-primary-strong);
|
|
127
|
+
border-color: transparent;
|
|
128
|
+
color: #061018;
|
|
129
|
+
box-shadow: 0 0 0 3px var(--rogatio-primary-bg);
|
|
130
|
+
}
|
|
131
|
+
.rogatio-editor button[data-btn=secondary] {
|
|
132
|
+
border-color: rgba(148, 163, 184, 0.28);
|
|
133
|
+
background: transparent;
|
|
134
|
+
color: var(--rogatio-text);
|
|
135
|
+
}
|
|
136
|
+
.rogatio-editor button[data-btn=secondary]:hover:not(:disabled) {
|
|
137
|
+
background: var(--rogatio-surface-raised);
|
|
138
|
+
border-color: rgba(148, 163, 184, 0.4);
|
|
139
|
+
}
|
|
140
|
+
.rogatio-editor button[data-btn=danger] {
|
|
141
|
+
border-color: rgba(240, 113, 120, 0.35);
|
|
142
|
+
background: var(--rogatio-danger-bg);
|
|
143
|
+
color: var(--rogatio-danger);
|
|
144
|
+
}
|
|
145
|
+
.rogatio-editor button[data-btn=danger]:hover:not(:disabled) {
|
|
146
|
+
border-color: var(--rogatio-danger);
|
|
147
|
+
background: rgba(240, 113, 120, 0.22);
|
|
148
|
+
color: #fecaca;
|
|
149
|
+
}
|
|
113
150
|
.rogatio-editor :focus-visible {
|
|
114
151
|
outline: 3px solid var(--rogatio-primary);
|
|
115
152
|
outline-offset: 2px;
|
|
@@ -128,8 +165,9 @@
|
|
|
128
165
|
align-items: center;
|
|
129
166
|
gap: 0.35rem;
|
|
130
167
|
border-bottom: 1px solid var(--rogatio-border);
|
|
131
|
-
background: var(--rogatio-surface);
|
|
168
|
+
background: color-mix(in srgb, var(--rogatio-surface) 92%, #000);
|
|
132
169
|
padding: 0.6rem 1rem;
|
|
170
|
+
backdrop-filter: blur(8px);
|
|
133
171
|
}
|
|
134
172
|
.rogatio-editor [data-desktop-route-rail] button {
|
|
135
173
|
border: 1px solid transparent;
|
|
@@ -143,8 +181,8 @@
|
|
|
143
181
|
color: var(--rogatio-text);
|
|
144
182
|
}
|
|
145
183
|
.rogatio-editor [data-desktop-route-rail] button[aria-current=page] {
|
|
146
|
-
border-color: rgba(
|
|
147
|
-
background:
|
|
184
|
+
border-color: rgba(59, 158, 255, 0.45);
|
|
185
|
+
background: var(--rogatio-primary-bg);
|
|
148
186
|
color: var(--rogatio-text);
|
|
149
187
|
font-weight: 700;
|
|
150
188
|
}
|
|
@@ -240,6 +278,10 @@
|
|
|
240
278
|
flex-wrap: wrap;
|
|
241
279
|
gap: 0.5rem;
|
|
242
280
|
margin-block: 1rem;
|
|
281
|
+
padding: 0.65rem 0.75rem;
|
|
282
|
+
border: 1px solid var(--rogatio-border);
|
|
283
|
+
border-radius: var(--rogatio-radius);
|
|
284
|
+
background: var(--rogatio-surface-raised);
|
|
243
285
|
}
|
|
244
286
|
.rogatio-editor [data-editor-form] {
|
|
245
287
|
display: grid;
|
|
@@ -249,7 +291,7 @@
|
|
|
249
291
|
min-width: 0;
|
|
250
292
|
border: 1px solid var(--rogatio-border);
|
|
251
293
|
border-radius: var(--rogatio-radius);
|
|
252
|
-
background: var(--rogatio-
|
|
294
|
+
background: var(--rogatio-card-group);
|
|
253
295
|
padding: 1rem;
|
|
254
296
|
}
|
|
255
297
|
.rogatio-editor legend {
|
|
@@ -299,22 +341,90 @@
|
|
|
299
341
|
font-weight: 500;
|
|
300
342
|
color: var(--rogatio-muted);
|
|
301
343
|
}
|
|
344
|
+
.rogatio-editor [data-group-heading],
|
|
345
|
+
.rogatio-editor [data-section-heading],
|
|
346
|
+
.rogatio-editor [data-rule-heading] {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-wrap: wrap;
|
|
349
|
+
align-items: center;
|
|
350
|
+
justify-content: space-between;
|
|
351
|
+
gap: 0.65rem;
|
|
352
|
+
}
|
|
353
|
+
.rogatio-editor [data-group-heading] h2,
|
|
354
|
+
.rogatio-editor [data-section-heading] h2,
|
|
355
|
+
.rogatio-editor [data-rule-heading] h3 {
|
|
356
|
+
margin: 0;
|
|
357
|
+
min-width: 0;
|
|
358
|
+
}
|
|
359
|
+
.rogatio-editor [data-group-list] {
|
|
360
|
+
list-style: none;
|
|
361
|
+
margin: 0;
|
|
362
|
+
padding: 0;
|
|
363
|
+
display: grid;
|
|
364
|
+
gap: 0.5rem;
|
|
365
|
+
}
|
|
366
|
+
.rogatio-editor [data-group-row] {
|
|
367
|
+
display: flex;
|
|
368
|
+
flex-wrap: wrap;
|
|
369
|
+
align-items: center;
|
|
370
|
+
justify-content: space-between;
|
|
371
|
+
gap: 0.5rem;
|
|
372
|
+
border: 1px solid var(--rogatio-border);
|
|
373
|
+
border-radius: var(--rogatio-radius);
|
|
374
|
+
background: var(--rogatio-card-group);
|
|
375
|
+
padding: 0.65rem 0.85rem;
|
|
376
|
+
}
|
|
377
|
+
.rogatio-editor [data-group-card] {
|
|
378
|
+
background: var(--rogatio-card-group);
|
|
379
|
+
border-color: rgba(148, 163, 184, 0.2);
|
|
380
|
+
}
|
|
381
|
+
.rogatio-editor [data-rules-section] {
|
|
382
|
+
display: grid;
|
|
383
|
+
gap: 0.85rem;
|
|
384
|
+
}
|
|
385
|
+
.rogatio-editor [data-rule-list] {
|
|
386
|
+
display: grid;
|
|
387
|
+
gap: 1rem;
|
|
388
|
+
}
|
|
389
|
+
.rogatio-editor [data-empty-rules] {
|
|
390
|
+
margin: 0;
|
|
391
|
+
color: var(--rogatio-muted);
|
|
392
|
+
border: 1px dashed var(--rogatio-border);
|
|
393
|
+
border-radius: var(--rogatio-radius);
|
|
394
|
+
padding: 1rem;
|
|
395
|
+
background: var(--rogatio-surface-inset);
|
|
396
|
+
}
|
|
302
397
|
.rogatio-editor [data-rule-card] {
|
|
303
398
|
display: grid;
|
|
304
399
|
gap: 1rem;
|
|
305
|
-
border: 1px solid
|
|
400
|
+
border: 1px solid rgba(46, 196, 182, 0.22);
|
|
401
|
+
border-left: 3px solid var(--rogatio-card-rule-edge);
|
|
306
402
|
border-radius: var(--rogatio-radius);
|
|
307
|
-
background:
|
|
403
|
+
background:
|
|
404
|
+
linear-gradient(
|
|
405
|
+
180deg,
|
|
406
|
+
color-mix(in srgb, var(--rogatio-card-rule) 92%, #2ec4b6) 0%,
|
|
407
|
+
var(--rogatio-card-rule) 2.5rem);
|
|
308
408
|
padding: 1rem;
|
|
409
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
|
|
309
410
|
}
|
|
310
411
|
.rogatio-editor [data-rule-card] h3 {
|
|
311
412
|
margin: 0;
|
|
312
413
|
font-weight: 700;
|
|
313
414
|
}
|
|
415
|
+
.rogatio-editor [data-rule-card] > fieldset {
|
|
416
|
+
background: color-mix(in srgb, var(--rogatio-surface-inset) 55%, transparent);
|
|
417
|
+
border-color: rgba(148, 163, 184, 0.14);
|
|
418
|
+
}
|
|
314
419
|
.rogatio-editor [data-rule-actions] {
|
|
315
420
|
display: flex;
|
|
316
421
|
flex-wrap: wrap;
|
|
317
|
-
gap: 0.
|
|
422
|
+
gap: 0.4rem;
|
|
423
|
+
justify-content: flex-end;
|
|
424
|
+
}
|
|
425
|
+
.rogatio-editor [data-rule-actions] button {
|
|
426
|
+
font-size: 0.8125rem;
|
|
427
|
+
padding: 0.35rem 0.55rem;
|
|
318
428
|
}
|
|
319
429
|
.rogatio-editor [data-search-results] {
|
|
320
430
|
margin-block: 1rem;
|
|
@@ -352,7 +462,7 @@
|
|
|
352
462
|
width: min(32rem, 100%);
|
|
353
463
|
border: 1px solid var(--rogatio-border);
|
|
354
464
|
border-radius: var(--rogatio-radius);
|
|
355
|
-
background: var(--rogatio-surface);
|
|
465
|
+
background: var(--rogatio-surface-raised);
|
|
356
466
|
box-shadow: 0 20px 50px rgb(0 0 0 / 45%);
|
|
357
467
|
padding: 1rem;
|
|
358
468
|
}
|
|
@@ -433,6 +543,15 @@
|
|
|
433
543
|
.rogatio-editor [data-editor-header] {
|
|
434
544
|
grid-template-columns: 1fr;
|
|
435
545
|
}
|
|
546
|
+
.rogatio-editor [data-rule-heading],
|
|
547
|
+
.rogatio-editor [data-group-heading],
|
|
548
|
+
.rogatio-editor [data-section-heading] {
|
|
549
|
+
align-items: flex-start;
|
|
550
|
+
}
|
|
551
|
+
.rogatio-editor [data-rule-actions] {
|
|
552
|
+
justify-content: flex-start;
|
|
553
|
+
width: 100%;
|
|
554
|
+
}
|
|
436
555
|
}
|
|
437
556
|
@media (forced-colors: active) {
|
|
438
557
|
.rogatio-editor {
|
|
@@ -443,6 +562,7 @@
|
|
|
443
562
|
--rogatio-danger: Mark;
|
|
444
563
|
--rogatio-success: ButtonText;
|
|
445
564
|
--rogatio-warning: ButtonText;
|
|
565
|
+
--rogatio-card-rule-edge: Highlight;
|
|
446
566
|
color: CanvasText;
|
|
447
567
|
background: Canvas;
|
|
448
568
|
}
|
|
@@ -451,7 +571,8 @@
|
|
|
451
571
|
.rogatio-editor select,
|
|
452
572
|
.rogatio-editor textarea,
|
|
453
573
|
.rogatio-editor fieldset,
|
|
454
|
-
.rogatio-editor [data-rule-card]
|
|
574
|
+
.rogatio-editor [data-rule-card],
|
|
575
|
+
.rogatio-editor [data-group-row] {
|
|
455
576
|
border-color: ButtonText;
|
|
456
577
|
background: Canvas;
|
|
457
578
|
}
|
|
@@ -488,7 +609,7 @@
|
|
|
488
609
|
gap: 0.5rem;
|
|
489
610
|
border: 1px solid var(--rogatio-border);
|
|
490
611
|
border-radius: var(--rogatio-radius);
|
|
491
|
-
background: var(--rogatio-
|
|
612
|
+
background: var(--rogatio-card-group);
|
|
492
613
|
padding: 0.75rem;
|
|
493
614
|
margin-bottom: 0.75rem;
|
|
494
615
|
}
|
|
@@ -506,6 +627,7 @@
|
|
|
506
627
|
padding: 0.5rem;
|
|
507
628
|
border-radius: var(--rogatio-radius-sm);
|
|
508
629
|
background: var(--rogatio-surface-inset);
|
|
630
|
+
border-left: 2px solid var(--rogatio-card-rule-edge);
|
|
509
631
|
}
|
|
510
632
|
.rogatio-editor [data-test-rule-header] {
|
|
511
633
|
display: flex;
|
package/dist/editor/index.js
CHANGED
|
@@ -3171,7 +3171,7 @@ var EditorControllerImpl = class {
|
|
|
3171
3171
|
}
|
|
3172
3172
|
const testOption = this.document.createElement("option");
|
|
3173
3173
|
testOption.value = "test";
|
|
3174
|
-
testOption.textContent = "Test
|
|
3174
|
+
testOption.textContent = "Test console";
|
|
3175
3175
|
select.append(testOption);
|
|
3176
3176
|
if (this.route.kind === "project") {
|
|
3177
3177
|
select.value = "project";
|
|
@@ -3212,7 +3212,7 @@ var EditorControllerImpl = class {
|
|
|
3212
3212
|
}
|
|
3213
3213
|
this.rail.append(button);
|
|
3214
3214
|
}
|
|
3215
|
-
const testBtn = this.createButton("Test
|
|
3215
|
+
const testBtn = this.createButton("Test console", "route:test");
|
|
3216
3216
|
testBtn.dataset.route = "test";
|
|
3217
3217
|
testBtn.dataset.editorKey = "route:test";
|
|
3218
3218
|
if (this.route.kind === "test")
|
|
@@ -3248,44 +3248,38 @@ var EditorControllerImpl = class {
|
|
|
3248
3248
|
}
|
|
3249
3249
|
this.commandBar.append(
|
|
3250
3250
|
this.createCommandButton("Validate", "validate", this.saving),
|
|
3251
|
-
this.createCommandButton(
|
|
3251
|
+
this.createCommandButton(
|
|
3252
|
+
"Save",
|
|
3253
|
+
"save",
|
|
3254
|
+
this.saving || !this.isDirty(),
|
|
3255
|
+
{},
|
|
3256
|
+
"primary"
|
|
3257
|
+
),
|
|
3252
3258
|
this.createCommandButton("Cancel", "cancel", this.saving)
|
|
3253
3259
|
);
|
|
3254
3260
|
if (this.route.kind === "project") {
|
|
3255
3261
|
this.commandBar.append(
|
|
3256
|
-
this.createCommandButton(
|
|
3262
|
+
this.createCommandButton(
|
|
3263
|
+
"Add group",
|
|
3264
|
+
"add-group",
|
|
3265
|
+
this.saving,
|
|
3266
|
+
{},
|
|
3267
|
+
"primary"
|
|
3268
|
+
)
|
|
3257
3269
|
);
|
|
3258
3270
|
return;
|
|
3259
3271
|
}
|
|
3260
3272
|
if (this.route.kind === "test") {
|
|
3261
3273
|
this.commandBar.append(
|
|
3262
|
-
this.createCommandButton(
|
|
3274
|
+
this.createCommandButton(
|
|
3275
|
+
"Run test",
|
|
3276
|
+
"test:run",
|
|
3277
|
+
this.saving,
|
|
3278
|
+
{},
|
|
3279
|
+
"primary"
|
|
3280
|
+
)
|
|
3263
3281
|
);
|
|
3264
|
-
return;
|
|
3265
3282
|
}
|
|
3266
|
-
const group = this.groupById(this.route.groupId);
|
|
3267
|
-
if (!group) return;
|
|
3268
|
-
const index = this.groupIndex(this.route.groupId);
|
|
3269
|
-
this.commandBar.append(
|
|
3270
|
-
this.createCommandButton("Add rule", "add-rule", this.saving, {
|
|
3271
|
-
groupId: this.route.groupId
|
|
3272
|
-
}),
|
|
3273
|
-
this.createCommandButton(
|
|
3274
|
-
"Move group up",
|
|
3275
|
-
"move-group-up",
|
|
3276
|
-
this.saving || index <= 0,
|
|
3277
|
-
{ groupId: this.route.groupId }
|
|
3278
|
-
),
|
|
3279
|
-
this.createCommandButton(
|
|
3280
|
-
"Move group down",
|
|
3281
|
-
"move-group-down",
|
|
3282
|
-
this.saving || index >= this.draft.groups.length - 1,
|
|
3283
|
-
{ groupId: this.route.groupId }
|
|
3284
|
-
),
|
|
3285
|
-
this.createCommandButton("Remove group", "remove-group", this.saving, {
|
|
3286
|
-
groupId: this.route.groupId
|
|
3287
|
-
})
|
|
3288
|
-
);
|
|
3289
3283
|
}
|
|
3290
3284
|
renderProject() {
|
|
3291
3285
|
const heading = this.document.createElement("h2");
|
|
@@ -3314,6 +3308,7 @@ var EditorControllerImpl = class {
|
|
|
3314
3308
|
fields.append(fieldGrid);
|
|
3315
3309
|
this.form.append(fields);
|
|
3316
3310
|
const groups = this.document.createElement("section");
|
|
3311
|
+
groups.dataset.groupListSection = "true";
|
|
3317
3312
|
const groupsHeading = this.document.createElement("h2");
|
|
3318
3313
|
groupsHeading.textContent = "Groups";
|
|
3319
3314
|
groups.append(groupsHeading);
|
|
@@ -3323,15 +3318,28 @@ var EditorControllerImpl = class {
|
|
|
3323
3318
|
groups.append(empty);
|
|
3324
3319
|
} else {
|
|
3325
3320
|
const list = this.document.createElement("ul");
|
|
3321
|
+
list.dataset.groupList = "true";
|
|
3326
3322
|
for (const group of this.draft.groups) {
|
|
3323
|
+
const groupId = safeText(group.id);
|
|
3324
|
+
const groupName = displayName(group.name, "Unnamed group");
|
|
3327
3325
|
const item = this.document.createElement("li");
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
`
|
|
3326
|
+
item.dataset.groupRow = "true";
|
|
3327
|
+
const open = this.createButton(
|
|
3328
|
+
`Edit group ${groupName}`,
|
|
3329
|
+
`route:group:${groupId}`
|
|
3330
|
+
);
|
|
3331
|
+
open.dataset.route = "group";
|
|
3332
|
+
open.dataset.groupId = groupId;
|
|
3333
|
+
open.dataset.btn = "secondary";
|
|
3334
|
+
const remove = this.createCommandButton(
|
|
3335
|
+
"Remove group",
|
|
3336
|
+
"remove-group",
|
|
3337
|
+
this.saving,
|
|
3338
|
+
{ groupId },
|
|
3339
|
+
"danger"
|
|
3331
3340
|
);
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
item.append(button);
|
|
3341
|
+
remove.setAttribute("aria-label", `Remove group ${groupName}`);
|
|
3342
|
+
item.append(open, remove);
|
|
3335
3343
|
list.append(item);
|
|
3336
3344
|
}
|
|
3337
3345
|
groups.append(list);
|
|
@@ -3342,10 +3350,22 @@ var EditorControllerImpl = class {
|
|
|
3342
3350
|
const group = this.groupById(groupId);
|
|
3343
3351
|
if (!group) return;
|
|
3344
3352
|
const groupIndex = this.groupIndex(groupId);
|
|
3353
|
+
const groupName = displayName(group.name, "Unnamed group");
|
|
3354
|
+
const headingRow = this.document.createElement("div");
|
|
3355
|
+
headingRow.dataset.groupHeading = "true";
|
|
3345
3356
|
const heading = this.document.createElement("h2");
|
|
3346
|
-
heading.textContent =
|
|
3347
|
-
this.
|
|
3357
|
+
heading.textContent = groupName;
|
|
3358
|
+
const removeGroup = this.createCommandButton(
|
|
3359
|
+
"Remove group",
|
|
3360
|
+
"remove-group",
|
|
3361
|
+
this.saving,
|
|
3362
|
+
{ groupId },
|
|
3363
|
+
"danger"
|
|
3364
|
+
);
|
|
3365
|
+
headingRow.append(heading, removeGroup);
|
|
3366
|
+
this.form.append(headingRow);
|
|
3348
3367
|
const settings = this.document.createElement("fieldset");
|
|
3368
|
+
settings.dataset.groupCard = "true";
|
|
3349
3369
|
const legend = this.document.createElement("legend");
|
|
3350
3370
|
legend.textContent = "Group details";
|
|
3351
3371
|
settings.append(legend);
|
|
@@ -3383,9 +3403,20 @@ var EditorControllerImpl = class {
|
|
|
3383
3403
|
groupIndex
|
|
3384
3404
|
);
|
|
3385
3405
|
const rulesSection = this.document.createElement("section");
|
|
3406
|
+
rulesSection.dataset.rulesSection = "true";
|
|
3407
|
+
const rulesHeadingRow = this.document.createElement("div");
|
|
3408
|
+
rulesHeadingRow.dataset.sectionHeading = "true";
|
|
3386
3409
|
const rulesHeading = this.document.createElement("h2");
|
|
3387
3410
|
rulesHeading.textContent = "Rules";
|
|
3388
|
-
|
|
3411
|
+
const addRule = this.createCommandButton(
|
|
3412
|
+
"Add rule",
|
|
3413
|
+
"add-rule",
|
|
3414
|
+
this.saving,
|
|
3415
|
+
{ groupId },
|
|
3416
|
+
"primary"
|
|
3417
|
+
);
|
|
3418
|
+
rulesHeadingRow.append(rulesHeading, addRule);
|
|
3419
|
+
rulesSection.append(rulesHeadingRow);
|
|
3389
3420
|
const list = this.document.createElement("div");
|
|
3390
3421
|
list.dataset.ruleList = groupId;
|
|
3391
3422
|
for (let ruleIndex = 0; ruleIndex < group.rules.length; ruleIndex += 1) {
|
|
@@ -3395,7 +3426,8 @@ var EditorControllerImpl = class {
|
|
|
3395
3426
|
}
|
|
3396
3427
|
if (group.rules.length === 0) {
|
|
3397
3428
|
const empty = this.document.createElement("p");
|
|
3398
|
-
empty.
|
|
3429
|
+
empty.dataset.emptyRules = "true";
|
|
3430
|
+
empty.textContent = "No rules yet. Add a rule to start matching requests.";
|
|
3399
3431
|
list.append(empty);
|
|
3400
3432
|
}
|
|
3401
3433
|
rulesSection.append(list);
|
|
@@ -3403,7 +3435,7 @@ var EditorControllerImpl = class {
|
|
|
3403
3435
|
}
|
|
3404
3436
|
renderTest() {
|
|
3405
3437
|
const heading = this.document.createElement("h2");
|
|
3406
|
-
heading.textContent = "Test
|
|
3438
|
+
heading.textContent = "Test console";
|
|
3407
3439
|
this.form.append(heading);
|
|
3408
3440
|
const description = this.document.createElement("p");
|
|
3409
3441
|
description.dataset.testDescription = "true";
|
|
@@ -3492,6 +3524,8 @@ var EditorControllerImpl = class {
|
|
|
3492
3524
|
const runBtn = this.createButton("Run test", "test:run");
|
|
3493
3525
|
runBtn.type = "button";
|
|
3494
3526
|
runBtn.dataset.testRun = "true";
|
|
3527
|
+
runBtn.dataset.command = "test:run";
|
|
3528
|
+
runBtn.dataset.btn = "primary";
|
|
3495
3529
|
runBtn.disabled = this.saving || this.testRunning;
|
|
3496
3530
|
panel.append(runBtn);
|
|
3497
3531
|
this.form.append(panel);
|
|
@@ -3517,11 +3551,37 @@ var EditorControllerImpl = class {
|
|
|
3517
3551
|
card.dataset.ruleId = ruleId;
|
|
3518
3552
|
card.id = `rogatio-rule-${groupId}-${ruleId}`;
|
|
3519
3553
|
card.tabIndex = -1;
|
|
3554
|
+
const headingRow = this.document.createElement("div");
|
|
3555
|
+
headingRow.dataset.ruleHeading = "true";
|
|
3520
3556
|
const heading = this.document.createElement("h3");
|
|
3521
3557
|
heading.id = `${this.instanceId}-rule-title-${groupIndex}-${ruleIndex}`;
|
|
3522
3558
|
heading.textContent = ruleName;
|
|
3523
3559
|
card.setAttribute("aria-labelledby", heading.id);
|
|
3524
|
-
|
|
3560
|
+
const actions = this.document.createElement("div");
|
|
3561
|
+
actions.dataset.ruleActions = "true";
|
|
3562
|
+
actions.append(
|
|
3563
|
+
this.createCommandButton(
|
|
3564
|
+
"Move rule up",
|
|
3565
|
+
"move-rule-up",
|
|
3566
|
+
this.saving || ruleIndex <= 0,
|
|
3567
|
+
{ groupId, ruleId }
|
|
3568
|
+
),
|
|
3569
|
+
this.createCommandButton(
|
|
3570
|
+
"Move rule down",
|
|
3571
|
+
"move-rule-down",
|
|
3572
|
+
this.saving || ruleIndex >= group.rules.length - 1,
|
|
3573
|
+
{ groupId, ruleId }
|
|
3574
|
+
),
|
|
3575
|
+
this.createCommandButton(
|
|
3576
|
+
"Remove rule",
|
|
3577
|
+
"remove-rule",
|
|
3578
|
+
this.saving,
|
|
3579
|
+
{ groupId, ruleId },
|
|
3580
|
+
"danger"
|
|
3581
|
+
)
|
|
3582
|
+
);
|
|
3583
|
+
headingRow.append(heading, actions);
|
|
3584
|
+
card.append(headingRow);
|
|
3525
3585
|
const fields = this.document.createElement("fieldset");
|
|
3526
3586
|
const legend = this.document.createElement("legend");
|
|
3527
3587
|
legend.textContent = "Common rule matcher";
|
|
@@ -3551,7 +3611,8 @@ var EditorControllerImpl = class {
|
|
|
3551
3611
|
"Convert to regex",
|
|
3552
3612
|
"convert-url",
|
|
3553
3613
|
this.saving,
|
|
3554
|
-
{ groupId, ruleId }
|
|
3614
|
+
{ groupId, ruleId },
|
|
3615
|
+
"secondary"
|
|
3555
3616
|
);
|
|
3556
3617
|
grid.append(convert);
|
|
3557
3618
|
fields.append(grid);
|
|
@@ -3654,27 +3715,6 @@ var EditorControllerImpl = class {
|
|
|
3654
3715
|
extensionError.textContent = match.error.message;
|
|
3655
3716
|
card.append(extensionError);
|
|
3656
3717
|
}
|
|
3657
|
-
const actions = this.document.createElement("div");
|
|
3658
|
-
actions.dataset.ruleActions = "true";
|
|
3659
|
-
actions.append(
|
|
3660
|
-
this.createCommandButton(
|
|
3661
|
-
"Move rule up",
|
|
3662
|
-
"move-rule-up",
|
|
3663
|
-
this.saving || ruleIndex <= 0,
|
|
3664
|
-
{ groupId, ruleId }
|
|
3665
|
-
),
|
|
3666
|
-
this.createCommandButton(
|
|
3667
|
-
"Move rule down",
|
|
3668
|
-
"move-rule-down",
|
|
3669
|
-
this.saving || ruleIndex >= group.rules.length - 1,
|
|
3670
|
-
{ groupId, ruleId }
|
|
3671
|
-
),
|
|
3672
|
-
this.createCommandButton("Remove rule", "remove-rule", this.saving, {
|
|
3673
|
-
groupId,
|
|
3674
|
-
ruleId
|
|
3675
|
-
})
|
|
3676
|
-
);
|
|
3677
|
-
card.append(actions);
|
|
3678
3718
|
return card;
|
|
3679
3719
|
}
|
|
3680
3720
|
renderOrigins(parent, label, values, owner, groupId, ruleId, groupIndex, ruleIndex) {
|
|
@@ -3703,7 +3743,8 @@ var EditorControllerImpl = class {
|
|
|
3703
3743
|
`Remove ${owner} origin ${index + 1}`,
|
|
3704
3744
|
owner === "group" ? "remove-group-origin" : "remove-rule-origin",
|
|
3705
3745
|
this.saving,
|
|
3706
|
-
{ groupId, ruleId, index: String(index) }
|
|
3746
|
+
{ groupId, ruleId, index: String(index) },
|
|
3747
|
+
"danger"
|
|
3707
3748
|
);
|
|
3708
3749
|
row.append(remove);
|
|
3709
3750
|
fieldset.append(row);
|
|
@@ -3713,7 +3754,8 @@ var EditorControllerImpl = class {
|
|
|
3713
3754
|
"Add origin",
|
|
3714
3755
|
owner === "group" ? "add-group-origin" : "add-rule-origin",
|
|
3715
3756
|
this.saving,
|
|
3716
|
-
{ groupId, ruleId }
|
|
3757
|
+
{ groupId, ruleId },
|
|
3758
|
+
"secondary"
|
|
3717
3759
|
)
|
|
3718
3760
|
);
|
|
3719
3761
|
parent.append(fieldset);
|
|
@@ -4005,6 +4047,7 @@ var EditorControllerImpl = class {
|
|
|
4005
4047
|
cancel.type = "button";
|
|
4006
4048
|
cancel.dataset.command = this.confirmation.kind === "cancel" ? "cancel-confirmation" : "remove-confirmation";
|
|
4007
4049
|
cancel.dataset.editorKey = "confirm-cancel";
|
|
4050
|
+
cancel.dataset.btn = "secondary";
|
|
4008
4051
|
cancel.textContent = this.confirmation.kind === "cancel" ? "Keep editing" : "Cancel removal";
|
|
4009
4052
|
const confirm = this.document.createElement("button");
|
|
4010
4053
|
confirm.type = "button";
|
|
@@ -4014,14 +4057,17 @@ var EditorControllerImpl = class {
|
|
|
4014
4057
|
title.textContent = "Discard unsaved changes?";
|
|
4015
4058
|
message.textContent = "Your current edits will be replaced by the last saved project.";
|
|
4016
4059
|
confirm.textContent = "Discard changes";
|
|
4060
|
+
confirm.dataset.btn = "danger";
|
|
4017
4061
|
} else if (this.confirmation.kind === "remove-group") {
|
|
4018
4062
|
title.textContent = "Remove group?";
|
|
4019
4063
|
message.textContent = `Remove group ${this.confirmation.name} and its rules?`;
|
|
4020
4064
|
confirm.textContent = "Remove group";
|
|
4065
|
+
confirm.dataset.btn = "danger";
|
|
4021
4066
|
} else {
|
|
4022
4067
|
title.textContent = "Remove rule?";
|
|
4023
4068
|
message.textContent = `Remove rule ${this.confirmation.name}?`;
|
|
4024
4069
|
confirm.textContent = "Remove rule";
|
|
4070
|
+
confirm.dataset.btn = "danger";
|
|
4025
4071
|
}
|
|
4026
4072
|
dialog.setAttribute("aria-labelledby", title.id);
|
|
4027
4073
|
actions.append(cancel, confirm);
|
|
@@ -4036,12 +4082,13 @@ var EditorControllerImpl = class {
|
|
|
4036
4082
|
button.dataset.editorKey = `button:${key}`;
|
|
4037
4083
|
return button;
|
|
4038
4084
|
}
|
|
4039
|
-
createCommandButton(label, command, disabled, data = {}) {
|
|
4085
|
+
createCommandButton(label, command, disabled, data = {}, tone = "secondary") {
|
|
4040
4086
|
const button = this.createButton(
|
|
4041
4087
|
label,
|
|
4042
4088
|
`command:${command}:${Object.values(data).join(":")}`
|
|
4043
4089
|
);
|
|
4044
4090
|
button.dataset.command = command;
|
|
4091
|
+
button.dataset.btn = tone;
|
|
4045
4092
|
button.disabled = disabled;
|
|
4046
4093
|
for (const [key, value] of Object.entries(data)) {
|
|
4047
4094
|
if (value !== void 0) button.dataset[key] = value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rogatio/cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local-first browser request and response rules — editor host, file verification, test runner, and runtime dispatch.",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build": "node ../../scripts/build.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"ajv": "8.
|
|
40
|
+
"ajv": "8.20.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@rogatio/compiler": "workspace:*",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@rogatio/editor": "workspace:*",
|
|
46
46
|
"@rogatio/runtime": "workspace:*",
|
|
47
47
|
"@rogatio/schema": "workspace:*",
|
|
48
|
-
"@types/node": "26.
|
|
48
|
+
"@types/node": "26.6.1",
|
|
49
49
|
"typescript": "7.0.2",
|
|
50
|
-
"vitest": "
|
|
50
|
+
"vitest": "5.0.1"
|
|
51
51
|
}
|
|
52
52
|
}
|