mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-13 09:12:19 +00:00
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.
28 lines
518 B
TypeScript
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();
|