Changes
3 changed files (+19/-3)
-
-
@@ -26,7 +26,6 @@ "./src/index.ts","./{cjs,esm}/*/index.js" ], "dependencies": { "copy-to-clipboard": "^3.0.0", "lit": "^2.1.3" }, "devDependencies": {
-
-
-
@@ -1,5 +1,4 @@import { css, html } from "lit"; import * as copy from "copy-to-clipboard"; import { HorizontalPaddingIcon,
-
@@ -9,6 +8,24 @@ CopyIcon,} from "../Icons"; import { FigmaNode, getStyleRule, NodeStyles } from "./utils"; import type { CSSRule } from "./utils"; const copy = async (text: string) => { // workaround for Firefox & Safari which do not need clipboard-write permission let status = { state: "granted" }; try { status = await navigator.permissions.query({ name: "clipboard-write" as unknown as PermissionName, }); } catch (e) { // Firefox throws because it doesn't support clipboard-write allowed // by default in secure environments. Safari throws because it does not have // or need navigator.permissions. } if (status.state === "granted") { await navigator.clipboard.writeText(text); } }; export type InspectorViewProps = { node: FigmaNode;
-
-
-
@@ -4463,7 +4463,7 @@ version "0.1.1"resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= copy-to-clipboard@^3.0.0, copy-to-clipboard@^3.3.1: copy-to-clipboard@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.1.tgz#115aa1a9998ffab6196f93076ad6da3b913662ae" integrity sha512-i13qo6kIHTTpCm8/Wup+0b1mVWETvu2kIMzKoK8FpkLkFxlt0znUAHcMzox+T8sPlqtZXq3CulEjQHsYiGFJUw==
-