@rogatio/cli 5.12.0 → 5.13.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.
@@ -329,18 +329,47 @@
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.85rem;
340
+ }
341
+ .rogatio-editor [data-editor-check-group-label] {
342
+ margin: 0 0 0.35rem;
343
+ font-weight: 700;
344
+ font-family: var(--rogatio-font-mono);
345
+ font-size: 0.75rem;
346
+ text-transform: uppercase;
347
+ letter-spacing: 0.06em;
348
+ color: var(--rogatio-muted);
349
+ }
332
350
  .rogatio-editor [data-editor-checks] {
333
351
  display: grid;
334
- grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
335
- gap: 0.35rem 0.7rem;
352
+ grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
353
+ gap: 0.45rem 0.7rem;
336
354
  }
337
355
  .rogatio-editor [data-editor-checks] label {
338
356
  display: flex;
339
357
  gap: 0.4rem;
340
- align-items: center;
358
+ align-items: flex-start;
341
359
  font-weight: 500;
342
360
  color: var(--rogatio-muted);
343
361
  }
362
+ .rogatio-editor [data-editor-check-text] {
363
+ display: grid;
364
+ gap: 0.1rem;
365
+ min-width: 0;
366
+ }
367
+ .rogatio-editor [data-editor-check-text] small {
368
+ font-weight: 400;
369
+ font-size: 0.75rem;
370
+ line-height: 1.25;
371
+ color: var(--rogatio-muted);
372
+ }
344
373
  .rogatio-editor [data-group-heading],
345
374
  .rogatio-editor [data-section-heading],
346
375
  .rogatio-editor [data-rule-heading] {
@@ -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.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.",