slint/tools/figma-inspector
dependabot[bot] 2f90d10f4f
build(deps): bump the npm-patch-updates group with 13 updates (#10104)
* build(deps): bump the npm-patch-updates group with 13 updates

Bumps the npm-patch-updates group with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [html-react-parser](https://github.com/remarkablemark/html-react-parser) | `5.2.8` | `5.2.10` |
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) | `19.2.2` | `19.2.6` |
| [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) | `19.2.2` | `19.2.3` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `5.1.0` | `5.1.1` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `4.0.8` | `4.0.10` |
| [@lumino/default-theme](https://github.com/jupyterlab/lumino) | `2.1.10` | `2.1.11` |
| [@lumino/widgets](https://github.com/jupyterlab/lumino) | `2.7.1` | `2.7.2` |
| [@astrojs/markdown-remark](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark) | `6.3.8` | `6.3.9` |
| [@astrojs/mdx](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx) | `4.3.10` | `4.3.11` |
| [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) | `2.3.4` | `2.3.6` |
| [astro-embed](https://github.com/delucis/astro-embed/tree/HEAD/packages/astro-embed) | `0.9.1` | `0.9.2` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `5.15.6` | `5.15.9` |
| [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) | `9.3.0` | `9.3.2` |


Updates `html-react-parser` from 5.2.8 to 5.2.10
- [Release notes](https://github.com/remarkablemark/html-react-parser/releases)
- [Changelog](https://github.com/remarkablemark/html-react-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/remarkablemark/html-react-parser/compare/v5.2.8...v5.2.10)

Updates `@types/react` from 19.2.2 to 19.2.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

Updates `@types/react-dom` from 19.2.2 to 19.2.3
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom)

Updates `@vitejs/plugin-react` from 5.1.0 to 5.1.1
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@5.1.1/packages/plugin-react)

Updates `vitest` from 4.0.8 to 4.0.10
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.10/packages/vitest)

Updates `@lumino/default-theme` from 2.1.10 to 2.1.11
- [Release notes](https://github.com/jupyterlab/lumino/releases)
- [Changelog](https://github.com/jupyterlab/lumino/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/lumino/compare/@lumino/default-theme@2.1.10...@lumino/default-theme@2.1.11)

Updates `@lumino/widgets` from 2.7.1 to 2.7.2
- [Release notes](https://github.com/jupyterlab/lumino/releases)
- [Changelog](https://github.com/jupyterlab/lumino/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyterlab/lumino/compare/@lumino/widgets@2.7.1...@lumino/widgets@2.7.2)

Updates `@astrojs/markdown-remark` from 6.3.8 to 6.3.9
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/markdown/remark/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/markdown-remark@6.3.9/packages/markdown/remark)

Updates `@astrojs/mdx` from 4.3.10 to 4.3.11
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/mdx/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/mdx@4.3.11/packages/integrations/mdx)

Updates `@biomejs/biome` from 2.3.4 to 2.3.6
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.3.6/packages/@biomejs/biome)

Updates `astro-embed` from 0.9.1 to 0.9.2
- [Release notes](https://github.com/delucis/astro-embed/releases)
- [Changelog](https://github.com/delucis/astro-embed/blob/main/packages/astro-embed/CHANGELOG.md)
- [Commits](https://github.com/delucis/astro-embed/commits/astro-embed@0.9.2/packages/astro-embed)

Updates `astro` from 5.15.6 to 5.15.9
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.15.9/packages/astro)

Updates `cspell` from 9.3.0 to 9.3.2
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.3.2/packages/cspell)

---
updated-dependencies:
- dependency-name: html-react-parser
  dependency-version: 5.2.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@types/react"
  dependency-version: 19.2.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@types/react-dom"
  dependency-version: 19.2.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 5.1.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: vitest
  dependency-version: 4.0.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@lumino/default-theme"
  dependency-version: 2.1.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@lumino/widgets"
  dependency-version: 2.7.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@astrojs/markdown-remark"
  dependency-version: 6.3.9
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@astrojs/mdx"
  dependency-version: 4.3.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@biomejs/biome"
  dependency-version: 2.3.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: astro-embed
  dependency-version: 0.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: astro
  dependency-version: 5.15.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: cspell
  dependency-version: 9.3.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>

* [autofix.ci] apply automated fixes

* Fix glob security alert

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nigel Breslaw <nigel.breslaw@slint.dev>
2025-11-18 14:50:36 +02:00
..
backend Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
public-zip Make the Figma plugin available via the nightly snapshot tag page (#7655) 2025-02-18 11:40:33 +02:00
shared Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
src Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
tests Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
.gitignore Fix tailwind config issues due to .gitignore (#8324) 2025-05-01 02:24:42 +03:00
biome.json build(deps): bump @biomejs/biome from 2.2.6 to 2.3.2 (#9926) 2025-11-03 10:47:12 +02:00
figma.config.ts (figma) dev-mode snippet can now toggle using variables (#8372) 2025-05-05 18:18:01 +03:00
index.html Figma plugin update for non dev mode (#7698) 2025-02-25 10:41:11 +02:00
package.json build(deps): bump the npm-patch-updates group with 13 updates (#10104) 2025-11-18 14:50:36 +02:00
PUBLISH.md Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
README.md Run cargo xtask check_license_headers --fix-it 2025-10-21 17:53:39 +02:00
tsconfig.json Make figma project stricter (#8461) 2025-05-19 17:21:05 +03:00
vite.config.code.ts Convert Figma project to Vite + React (#7453) 2025-01-27 12:54:09 +02:00
vite.config.ts figma: remove tailwind (#8355) 2025-05-05 14:23:22 +03:00

Figma to Slint property inspector

Installing the plugin from Figma

The latest release of the Figma Inspector can be installed directly from the Figma website at

https://www.figma.com/community/plugin/1474418299182276871/figma-to-slint

or in Figma by searching for the "Figma To Slint" plugin.

Installing the plugin via nightly snapshot.

Download the nightly snapshot figma-plugin.zip.

The prerequisites are either the Figma Desktop App or the Figma VSCode extension. A valid Figma subscription with at least 'Team Professional' is needed.

In Figma Desktop or the VScode extension have a file open and right click on it. Select Plugins > Development > Import Plugin From Manifest.. and point it at the manifest.json file that you just unzipped.

The Slint properties will now show in the Dev mode inspector in the same place the standard CSS properties would have been shown.

Build

Figma is a web app (Chromium) and the plugin is just javascript. As with other web apps in the repo the prerequisite software needed to develop the plugin are:

You need to install the following components:

You also MUST have a valid Figma developer subscription as the plugin works in the Dev mode and/or Figma VS Code extension.

To try it out locally type this in this directory:

## only need to run this once
pnpm install

pnpm build

Then in Figma on an open file right click and select Plugins > Development > Import Plugin From Manifest.. and point it at the dist/manifest.json file that has now been created inside this project.

You should also ensure Plugins > Development > Hot Reload Plugin is ticked.

To develop in hot reload mode:

pnpm dev

As you save code changes the plugin is automatically recompiled and reloaded in Figma for Desktop and/or the Figma VS Code extension.

Testing

As of writing Figma has real test support. Testing is limited to unit testing some of the functions via Vitest.

You can find the test files under /tests. This folder also includes the JSON export of a real Figma file to test against. The easiest way to update the file is to to edit it in Figma and then use a personal access token to get a JSON version.

To get an access Token in Figma go to the home screen. Then top right click the logged in user name. Then Settings and then the Security tab. Scroll to the bottom and choose Generate new token. Then save the token in a secure private place.

You then need to get the file ID. Open figma.com, login and open the file. You will then have a url like https://www.figma.com/design/njC6jSUbrYpqLRJ2dyV6NT/energy-test-file?node-id=113-2294&p=f&t=5IDwrGIFUnri3Z17-0. The ID is the part of the URL after /design/ so in this example njC6jSUbrYpqLRJ2dyV6NT.

You can then use curl to download the JSON with

curl -H 'X-Figma-Token: <YOUR_ACCESS_TOKEN>' \
'https://api.figma.com/v1/files/<FIGMA_FILE_ID>' \
-o figma_output.json

Vitest can then be run in hot reload mode for ease of test development with:

pnpm test