Skip to content

Commit

Permalink
Merge pull request #21 from author-more/fix/penpot-api-update
Browse files Browse the repository at this point in the history
fix: plugin to use the new api
  • Loading branch information
Belar authored Oct 20, 2024
2 parents 40f1ea1 + 620e395 commit 0b8d7b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@coreui/icons": "^3.0.1",
"@material-design-icons/svg": "^0.14.13",
"@penpot/plugin-styles": "^0.10.0",
"@penpot/plugin-styles": "^0.12.0",
"@phosphor-icons/core": "^2.1.1",
"@tabler/icons": "^3.19.0",
"bootstrap-icons": "^1.11.3",
Expand All @@ -30,7 +30,7 @@
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@penpot/plugin-types": "^0.10.0",
"@penpot/plugin-types": "^0.12.0",
"@playwright/test": "^1.47.2",
"@types/node": "^22.7.2",
"@types/react": "^18.3.9",
Expand Down
10 changes: 5 additions & 5 deletions src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PenpotTheme } from "@penpot/plugin-types";
import { Theme } from "@penpot/plugin-types";

export type PluginMessageEvent = ThemePluginEvent | DataPluginEvent;

type ThemePluginEvent = {
type: "theme";
content: PenpotTheme;
content: Theme;
};

type DataPluginEvent = {
Expand Down Expand Up @@ -43,7 +43,7 @@ type PluginData = {
data: unknown;
};

penpot.ui.open("All Icons", `?theme=${penpot.getTheme()}`, {
penpot.ui.open("All Icons", `?theme=${penpot.theme}`, {
width: 500,
height: 600,
});
Expand Down Expand Up @@ -89,11 +89,11 @@ function insertIcon({
}

function setPluginData(key: string, data: unknown) {
penpot.currentPage.setPluginData(key, JSON.stringify(data));
penpot.currentPage?.setPluginData(key, JSON.stringify(data));
}

function getPluginData(key: string) {
const data = penpot.currentPage.getPluginData(key);
const data = penpot.currentPage?.getPluginData(key);
if (!data || data === "null" || data === "") {
return;
}
Expand Down

0 comments on commit 0b8d7b3

Please sign in to comment.