@cssints/placeholder 0.6.0 → 0.6.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.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CSSImageValue } from "cssints";
2
- //#region src/index.d.ts
3
2
  /** How the placeholder is drawn: a gradient of the colours (the default), or the thumbhash as a PNG data URL. */
4
3
  export type Mode = "gradient" | "thumbhash";
5
4
  declare const placeholders: import("cssints/plugin").Scope<"placeholder", {
@@ -18,4 +17,4 @@ declare const placeholders: import("cssints/plugin").Scope<"placeholder", {
18
17
  * and PNG; another format or a missing file is a build error at the call.
19
18
  */
20
19
  export declare const placeholder: ReturnType<typeof placeholders.export>["placeholder"];
21
- //#endregion
20
+ export {};
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { arg, dependsOn, fn, scope } from "cssints/plugin";
6
6
  import jpeg from "jpeg-js";
7
7
  import { PNG } from "pngjs";
8
8
  import { rgbaToThumbHash, thumbHashToRGBA } from "thumbhash";
9
- //#region src/pixels.ts
9
+ // src/pixels.ts
10
10
  const starts = (bytes, sig, at = 0) => sig.every((b, i) => bytes[at + i] === b);
11
11
  const ascii = (s) => [...s].map((c) => c.charCodeAt(0));
12
12
  const kind = (bytes) => starts(bytes, [
@@ -151,8 +151,7 @@ const thumbhash = (img) => {
151
151
  png.data = Buffer.from(out.data);
152
152
  return `data:image/png;base64,${PNG.sync.write(png, { deflateLevel: 9 }).toString("base64")}`;
153
153
  };
154
- //#endregion
155
- //#region src/index.ts
154
+ // src/index.ts
156
155
  const g = globalThis;
157
156
  const fail = (message, cause) => {
158
157
  throw new Error(`cssints: placeholder: ${message}`, { cause });
@@ -190,5 +189,4 @@ const placeholder = scope("placeholder", { placeholder: fn({
190
189
  args: [arg(), { "mode?": "gradient | thumbhash" }],
191
190
  value: ([path, { mode = "gradient" }]) => new CSSImageValue(compute(path, mode))
192
191
  }) }).export().placeholder;
193
- //#endregion
194
192
  export { placeholder };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cssints/placeholder",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Image placeholders for cssints: a gradient of the dominant colours, or a thumbhash data URL, read from the image at build time",
5
5
  "license": "MIT",
6
6
  "repository": {