@petercoxhatesbridges/extension-ui 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@petercoxhatesbridges/extension-ui`
2
2
 
3
- Reusable React UI components for browser extensions. Version `0.2.0`.
3
+ Reusable React UI components for browser extensions. Version `0.2.2`.
4
4
 
5
5
  ## Install
6
6
 
@@ -103,3 +103,5 @@ The consumer validates its own data and owns storage, save serialization and sid
103
103
  The import callback must reject on failure; it runs only after the user confirms restore.
104
104
  An optional `parseLegacy` callback supports existing app-specific backup files. Chrome
105
105
  runtime IDs, live sessions and storage implementations do not belong in the shared package.
106
+
107
+ The shared About me link uses the bundled Peter Cox avatar. It does not fetch an image from LinkedIn or require per-extension assets.
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionFooter.d.ts","sourceRoot":"","sources":["../src/ExtensionFooter.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEjE,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BA8ClE"}
1
+ {"version":3,"file":"ExtensionFooter.d.ts","sourceRoot":"","sources":["../src/ExtensionFooter.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,oBAAoB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEjE,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,EAAE,SAAS,EAAE,EAAE,oBAAoB,+BA+ClE"}
@@ -1,8 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import authorAvatar from "./assets/author-avatar.png";
2
3
  import { PreferencesFooter } from "./Preferences.js";
3
4
  /** The creator destination and presentation are shared by every extension. */
4
5
  export function ExtensionFooter({ reviewUrl }) {
5
6
  const star = (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m12 3 2.8 5.7 6.2.9-4.5 4.4 1.1 6.2-5.6-3-5.6 3 1.1-6.2L3 9.6l6.2-.9Z" }) }));
6
- return (_jsxs(PreferencesFooter, { className: "ext-extension-footer", children: [reviewUrl ? (_jsxs("a", { href: reviewUrl, target: "_blank", rel: "noreferrer", children: [star, "Review"] })) : (_jsxs("span", { className: "extension-review-unavailable", role: "link", "aria-disabled": "true", title: "Available after this extension is published to the Chrome Web Store", children: [star, "Review"] })), _jsxs("a", { href: "https://www.linkedin.com/in/peter-w-cox", target: "_blank", rel: "noreferrer", children: [_jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: [_jsx("rect", { x: "1", y: "1", width: "22", height: "22", rx: "3" }), _jsx("path", { fill: "#fff", d: "M5 9h3v10H5zm1.5-4.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3ZM10 9h3v1.4c.6-1 1.5-1.7 3-1.7 2.4 0 3.5 1.4 3.5 4.3v6h-3v-5.3c0-1.4-.4-2.2-1.6-2.2-1.3 0-1.9.9-1.9 2.4V19h-3Z" })] }), "About me"] })] }));
7
+ return (_jsxs(PreferencesFooter, { className: "ext-extension-footer", children: [reviewUrl ? (_jsxs("a", { href: reviewUrl, target: "_blank", rel: "noreferrer", children: [star, "Review"] })) : (_jsxs("span", { className: "extension-review-unavailable", role: "link", "aria-disabled": "true", title: "Available after this extension is published to the Chrome Web Store", children: [star, "Review"] })), _jsxs("a", { href: "https://www.linkedin.com/in/peter-w-cox", target: "_blank", rel: "noreferrer", children: [_jsx("span", { className: "extension-author-avatar", "aria-hidden": "true", children: _jsx("img", { src: authorAvatar, alt: "", width: 48, height: 48 }) }), "About me"] })] }));
7
8
  }
8
9
  //# sourceMappingURL=ExtensionFooter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionFooter.js","sourceRoot":"","sources":["../src/ExtensionFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAwB;IACjE,MAAM,IAAI,GAAG,CACX,cACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,uEAAuE,GAAG,GAC9E,CACP,CAAC;IACF,OAAO,CACL,MAAC,iBAAiB,IAAC,SAAS,EAAC,sBAAsB,aAChD,SAAS,CAAC,CAAC,CAAC,CACX,aAAG,IAAI,EAAE,SAAS,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,aACjD,IAAI,cACH,CACL,CAAC,CAAC,CAAC,CACF,gBACE,SAAS,EAAC,8BAA8B,EACxC,IAAI,EAAC,MAAM,mBACG,MAAM,EACpB,KAAK,EAAC,qEAAqE,aAE1E,IAAI,cACA,CACR,EACD,aACE,IAAI,EAAC,yCAAyC,EAC9C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,aAEhB,eAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,iBAAa,MAAM,aAC7D,eAAM,CAAC,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG,EAClD,eACE,IAAI,EAAC,MAAM,EACX,CAAC,EAAC,yKAAyK,GAC3K,IACE,gBAEJ,IACc,CACrB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ExtensionFooter.js","sourceRoot":"","sources":["../src/ExtensionFooter.tsx"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIrD,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAAC,EAAE,SAAS,EAAwB;IACjE,MAAM,IAAI,GAAG,CACX,cACE,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,uEAAuE,GAAG,GAC9E,CACP,CAAC;IACF,OAAO,CACL,MAAC,iBAAiB,IAAC,SAAS,EAAC,sBAAsB,aAChD,SAAS,CAAC,CAAC,CAAC,CACX,aAAG,IAAI,EAAE,SAAS,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,aACjD,IAAI,cACH,CACL,CAAC,CAAC,CAAC,CACF,gBACE,SAAS,EAAC,8BAA8B,EACxC,IAAI,EAAC,MAAM,mBACG,MAAM,EACpB,KAAK,EAAC,qEAAqE,aAE1E,IAAI,cACA,CACR,EACD,aACE,IAAI,EAAC,yCAAyC,EAC9C,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,aAEhB,eAAM,SAAS,EAAC,yBAAyB,iBAAa,MAAM,YAC1D,cACE,GAAG,EAAE,YAAY,EACjB,GAAG,EAAC,EAAE,EACN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,GACV,GACG,gBAEL,IACc,CACrB,CAAC;AACJ,CAAC"}
Binary file
package/dist/styles.css CHANGED
@@ -760,6 +760,22 @@
760
760
  flex-shrink: 0;
761
761
  }
762
762
 
763
+ .ext-extension-footer .extension-author-avatar {
764
+ display: block;
765
+ flex: 0 0 24px;
766
+ width: 24px;
767
+ height: 24px;
768
+ overflow: hidden;
769
+ border-radius: 50%;
770
+ }
771
+ .ext-extension-footer .extension-author-avatar img {
772
+ display: block;
773
+ width: 200%;
774
+ height: 200%;
775
+ max-width: none;
776
+ transform: translate(-38%, -8%);
777
+ }
778
+
763
779
  /* Opt-in document sizing for extension-owned popup, panel and page surfaces. */
764
780
  html[data-extension-surface="popup"],
765
781
  html[data-extension-surface="popup"] body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petercoxhatesbridges/extension-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Shared React controls and preferences UI for Chrome extensions",
5
5
  "type": "module",
6
6
  "files": [
@@ -45,7 +45,7 @@
45
45
  "happy-dom": "^20.11.1"
46
46
  },
47
47
  "scripts": {
48
- "build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css",
48
+ "build": "tsc -p tsconfig.build.json && cp src/styles.css dist/styles.css && mkdir -p dist/assets && cp src/assets/author-avatar.png dist/assets/author-avatar.png",
49
49
  "typecheck": "tsc --noEmit",
50
50
  "test": "bun test"
51
51
  }
@@ -1,5 +1,6 @@
1
+ import * as React from "react";
1
2
  import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { expect } from "storybook/test";
3
+ import { expect, waitFor } from "storybook/test";
3
4
  import { ExtensionFooter } from "../dist/index.js";
4
5
  import "../dist/styles.css";
5
6
 
@@ -32,6 +33,15 @@ export const Published: Story = {
32
33
  await expect(
33
34
  canvas.getByRole("link", { name: "About me" }),
34
35
  ).toHaveAttribute("href", "https://www.linkedin.com/in/peter-w-cox");
36
+ const creator = canvas.getByRole("link", { name: "About me" });
37
+ await expect(creator.querySelector("img")).toHaveAttribute(
38
+ "src",
39
+ expect.stringContaining("author-avatar"),
40
+ );
41
+ await waitFor(() => {
42
+ const image = creator.querySelector("img");
43
+ expect(image?.complete && image.naturalWidth > 0).toBe(true);
44
+ });
35
45
  },
36
46
  };
37
47
  export const Unpublished: Story = {