@daugasauron/dolly-host-save 0.1.5 → 0.1.6

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/download.mjs CHANGED
@@ -25,12 +25,15 @@ export function browser({ mount, keyboard, indicators }) {
25
25
  panel.setAttribute("aria-label", "Files Dolly offers to save");
26
26
  panel.hidden = true;
27
27
  mount.append(panel);
28
- const look = document.head.appendChild(Object.assign(document.createElement("style"), { textContent: `
28
+ // An adopted style sheet, which a page's style-src without 'unsafe-inline' allows.
29
+ const look = new CSSStyleSheet();
30
+ look.replaceSync(`
29
31
  #downloads { position: absolute; left: 0.6rem; bottom: 0.6rem; z-index: 7; margin: 0; padding: 0.5rem; list-style: none;
30
- max-width: calc(100% - 1.2rem); color: #e8e3d7; background: #262626; border: 1px solid #f2d45c; font-size: 14px; }
32
+ max-width: calc(100% - 1.2rem); color: var(--dolly-ui-color); background: var(--dolly-ui-background); border: 1px solid var(--dolly-ui-accent); font-size: 14px; }
31
33
  #downloads[hidden] { display: none; } #downloads li + li { margin-top: 0.4rem; }
32
- #downloads button { margin-right: 0.4rem; color: inherit; background: #333; border: 1px solid #77736c;
33
- font: inherit; cursor: pointer; }` }));
34
+ #downloads button { margin-right: 0.4rem; color: inherit; background: var(--dolly-ui-raised); border: 1px solid var(--dolly-ui-quiet);
35
+ font: inherit; cursor: pointer; }`);
36
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, look];
34
37
  const urls = [];
35
38
  // The item of the stream the Worker is still receiving.
36
39
  let preparing = null;
@@ -101,7 +104,7 @@ export function browser({ mount, keyboard, indicators }) {
101
104
  },
102
105
  },
103
106
  claimsKey: event => panel.contains(event.target),
104
- dispose() { panel.remove(); look.remove(); for (const url of [...urls]) revoke(url); },
107
+ dispose() { panel.remove(); document.adoptedStyleSheets = document.adoptedStyleSheets.filter(sheet => sheet !== look); for (const url of [...urls]) revoke(url); },
105
108
  };
106
109
  }
107
110
 
package/module.json CHANGED
@@ -9,5 +9,6 @@
9
9
  "process": [],
10
10
  "headers": ["download.h", "download-abi.h"],
11
11
  "kernel": ["kernel.c"],
12
- "client": ["client.c"]
12
+ "client": ["client.c"],
13
+ "package": "libdolly-download"
13
14
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.1.5",
2
+ "version": "0.1.6",
3
3
  "type": "module",
4
4
  "name": "@daugasauron/dolly-host-save",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "@daugasauron/dolly": "0.1.5"
7
+ "@daugasauron/dolly": "0.1.6"
8
8
  },
9
9
  "description": "Dolly's download@0 host module: offer a file to save; the user clicks.",
10
10
  "repository": {