slint/tools/figma-inspector/backend/code.ts
Nigel Breslaw facd460037
Convert Figma project to Vite + React (#7453)
A Figma plugin is just a single javascript file which means no out of the box way to split files, import helper libraries and scale the project. It's also a vanilla web site for making the UI.

The PR updates the project to use Vite. It allows normal project spliting for typescript and css files. It provides a simpler way for the plugin and backend code to communicate. React is used to then build the plugin interface.
2025-01-27 12:54:09 +02:00

28 lines
518 B
TypeScript

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
import {
getStore,
setStore,
listenTS,
dispatchTS,
getStatus,
updateUI,
} from "./utils/code-utils";
figma.showUI(__html__, {
themeColors: true,
width: 400,
height: 320,
});
listenTS("copyToClipboard", () => {
figma.notify("Copied!");
});
figma.on("selectionchange", () => {
updateUI();
});
// init
updateUI();