@rogatio/cli 5.12.0 → 5.13.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.
@@ -329,18 +329,53 @@
329
329
  align-items: end;
330
330
  margin-bottom: 0.5rem;
331
331
  }
332
+ .rogatio-editor [data-editor-hint] {
333
+ margin: 0 0 0.75rem;
334
+ color: var(--rogatio-muted);
335
+ font-size: 0.8125rem;
336
+ }
337
+ .rogatio-editor [data-editor-check-groups] {
338
+ display: grid;
339
+ gap: 0.65rem;
340
+ }
341
+ .rogatio-editor [data-editor-check-group] {
342
+ padding: 0.65rem 0.75rem;
343
+ border: 1px solid var(--rogatio-border);
344
+ border-radius: var(--rogatio-radius-sm);
345
+ background: var(--rogatio-surface-inset);
346
+ }
347
+ .rogatio-editor [data-editor-check-group-label] {
348
+ margin: 0 0 0.45rem;
349
+ font-weight: 700;
350
+ font-family: var(--rogatio-font-mono);
351
+ font-size: 0.75rem;
352
+ text-transform: uppercase;
353
+ letter-spacing: 0.06em;
354
+ color: var(--rogatio-muted);
355
+ }
332
356
  .rogatio-editor [data-editor-checks] {
333
357
  display: grid;
334
- grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
335
- gap: 0.35rem 0.7rem;
358
+ grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
359
+ gap: 0.45rem 0.7rem;
336
360
  }
337
361
  .rogatio-editor [data-editor-checks] label {
338
362
  display: flex;
339
363
  gap: 0.4rem;
340
- align-items: center;
364
+ align-items: flex-start;
341
365
  font-weight: 500;
342
366
  color: var(--rogatio-muted);
343
367
  }
368
+ .rogatio-editor [data-editor-check-text] {
369
+ display: grid;
370
+ gap: 0.1rem;
371
+ min-width: 0;
372
+ }
373
+ .rogatio-editor [data-editor-check-text] small {
374
+ font-weight: 400;
375
+ font-size: 0.75rem;
376
+ line-height: 1.25;
377
+ color: var(--rogatio-muted);
378
+ }
344
379
  .rogatio-editor [data-group-heading],
345
380
  .rogatio-editor [data-section-heading],
346
381
  .rogatio-editor [data-rule-heading] {
@@ -572,7 +607,8 @@
572
607
  .rogatio-editor textarea,
573
608
  .rogatio-editor fieldset,
574
609
  .rogatio-editor [data-rule-card],
575
- .rogatio-editor [data-group-row] {
610
+ .rogatio-editor [data-group-row],
611
+ .rogatio-editor [data-editor-check-group] {
576
612
  border-color: ButtonText;
577
613
  background: Canvas;
578
614
  }
@@ -1621,6 +1621,42 @@ var RESOURCE_TYPES2 = [
1621
1621
  "webbundle",
1622
1622
  "other"
1623
1623
  ];
1624
+ var RESOURCE_TYPE_GLOSS = {
1625
+ main_frame: "Top-level page navigation",
1626
+ sub_frame: "iframe / embedded frame",
1627
+ stylesheet: "CSS stylesheet",
1628
+ script: "JavaScript file",
1629
+ image: "Image",
1630
+ font: "Web font",
1631
+ object: "Plugin / <object> / <embed>",
1632
+ media: "Audio / video",
1633
+ xmlhttprequest: "XHR and fetch",
1634
+ ping: "Hyperlink ping / beacon",
1635
+ csp_report: "CSP violation report",
1636
+ websocket: "WebSocket",
1637
+ webtransport: "WebTransport",
1638
+ webbundle: "Web Bundle",
1639
+ other: "Anything else"
1640
+ };
1641
+ var RESOURCE_TYPE_GROUPS = [
1642
+ { label: "Page", types: ["main_frame", "sub_frame"] },
1643
+ {
1644
+ label: "Assets",
1645
+ types: ["stylesheet", "script", "image", "font", "media", "object"]
1646
+ },
1647
+ {
1648
+ label: "Network",
1649
+ types: [
1650
+ "xmlhttprequest",
1651
+ "websocket",
1652
+ "webtransport",
1653
+ "ping",
1654
+ "csp_report",
1655
+ "webbundle"
1656
+ ]
1657
+ },
1658
+ { label: "Other", types: ["other"] }
1659
+ ];
1624
1660
  var HTTP_METHODS2 = [
1625
1661
  "GET",
1626
1662
  "POST",
@@ -3765,20 +3801,50 @@ var EditorControllerImpl = class {
3765
3801
  const legend = this.document.createElement("legend");
3766
3802
  legend.textContent = "Resource types";
3767
3803
  fieldset.append(legend);
3768
- const checks = this.document.createElement("div");
3769
- checks.dataset.editorChecks = "true";
3770
- for (const resourceType of RESOURCE_TYPES2) {
3771
- const label = this.document.createElement("label");
3772
- const input = this.document.createElement("input");
3773
- input.type = "checkbox";
3774
- input.dataset.resourcePath = `${rulePath}/resourceTypes`;
3775
- input.dataset.resourceType = resourceType;
3776
- input.checked = rule.resourceTypes.includes(resourceType);
3777
- input.disabled = this.saving;
3778
- label.append(input, this.document.createTextNode(resourceType));
3779
- checks.append(label);
3804
+ const hint = this.document.createElement("p");
3805
+ hint.dataset.editorHint = "true";
3806
+ hint.textContent = "Chrome request categories this rule can match.";
3807
+ fieldset.append(hint);
3808
+ const groups = this.document.createElement("div");
3809
+ groups.dataset.editorCheckGroups = "true";
3810
+ for (const group of RESOURCE_TYPE_GROUPS) {
3811
+ const groupEl = this.document.createElement("div");
3812
+ groupEl.dataset.editorCheckGroup = "true";
3813
+ groupEl.setAttribute("role", "group");
3814
+ const groupLabel = this.document.createElement("p");
3815
+ groupLabel.dataset.editorCheckGroupLabel = "true";
3816
+ groupLabel.id = `${this.instanceId}-resource-type-group-${group.label.toLowerCase()}-${safeText(rule.id)}`;
3817
+ groupLabel.textContent = group.label;
3818
+ groupEl.setAttribute("aria-labelledby", groupLabel.id);
3819
+ groupEl.append(groupLabel);
3820
+ const checks = this.document.createElement("div");
3821
+ checks.dataset.editorChecks = "true";
3822
+ for (const resourceType of group.types) {
3823
+ const gloss = RESOURCE_TYPE_GLOSS[resourceType];
3824
+ const label = this.document.createElement("label");
3825
+ label.title = gloss;
3826
+ const input = this.document.createElement("input");
3827
+ input.type = "checkbox";
3828
+ input.dataset.resourcePath = `${rulePath}/resourceTypes`;
3829
+ input.dataset.resourceType = resourceType;
3830
+ input.checked = rule.resourceTypes.includes(resourceType);
3831
+ input.disabled = this.saving;
3832
+ input.title = gloss;
3833
+ const text = this.document.createElement("span");
3834
+ text.dataset.editorCheckText = "true";
3835
+ const idSpan = this.document.createElement("span");
3836
+ idSpan.dataset.editorCheckId = "true";
3837
+ idSpan.textContent = resourceType;
3838
+ const glossEl = this.document.createElement("small");
3839
+ glossEl.textContent = gloss;
3840
+ text.append(idSpan, glossEl);
3841
+ label.append(input, text);
3842
+ checks.append(label);
3843
+ }
3844
+ groupEl.append(checks);
3845
+ groups.append(groupEl);
3780
3846
  }
3781
- fieldset.append(checks);
3847
+ fieldset.append(groups);
3782
3848
  parent.append(fieldset);
3783
3849
  }
3784
3850
  mountExtension(parent, extension, groupId, ruleId, rulePath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogatio/cli",
3
- "version": "5.12.0",
3
+ "version": "5.13.1",
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.",