You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/figma-studio-runner.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
1
# Figma to WordPress Studio
2
2
3
-
`plugins/figma-to-wordpress-studio` moves a Figma file into WordPress by posting a Studio import source to the local WordPress Studio app. Studio creates the site and imports the result with Static Site Importer and Blocks Engine.
3
+
`plugins/figma-to-wordpress-studio` moves a Figma file into WordPress by posting a Figma source payload to the local WordPress Studio app. Studio creates the site and imports the result with Static Site Importer and Blocks Engine.
4
4
5
5
## Architecture
6
6
7
7
```text
8
8
Figma plugin UI
9
-
-> Figma document scene data
10
-
-> Studio import artifact JSON
9
+
-> current-page scenegraph + selected-node intent
10
+
-> Studio Figma source payload
11
11
-> local WordPress Studio handoff endpoint
12
12
-> WordPress Studio site
13
13
-> Static Site Importer / Blocks Engine inside WordPress
14
14
```
15
15
16
-
The TypeScript boundary stops at artifact construction and a local handoff request. WordPress, PHP, Static Site Importer, Blocks Engine, and Studio site orchestration remain Studio runtime concerns.
16
+
The TypeScript boundary stops at source capture and a local handoff request. WordPress, PHP, Static Site Importer, Blocks Engine, and Studio site orchestration remain Studio runtime concerns.
17
17
18
18
## Figma Iframe Limits
19
19
@@ -27,11 +27,11 @@ Practical constraints for this browser-based flow:
27
27
- Clipboard access can require user activation.
28
28
- Local file URLs can behave differently between desktop Figma, browser Figma, and development builds.
29
29
30
-
Because of those constraints, the integration shape is a local Studio handoff: the plugin posts an artifact JSON source to Studio's loopback endpoint. If Studio is not running, the plugin surfaces the connection error.
30
+
Because of those constraints, the integration shape is a local Studio handoff: the plugin posts Figma source data to Studio's loopback endpoint. If Studio is not running, the plugin surfaces the connection error.
31
31
32
32
## Studio And PHP Role
33
33
34
-
WordPress Studio is the correct place to run WordPress and PHP plugin logic. It provides the WordPress runtime and accepts flexible `studio create --from <source>` inputs, including artifact JSON, `.fig`, file, directory, zip, and URL shapes.
34
+
WordPress Studio is the correct place to run WordPress and PHP plugin logic. It provides the WordPress runtime and accepts flexible `studio create --from <source>` inputs, including Figma source, artifact JSON, `.fig`, file, directory, zip, and URL shapes.
35
35
36
36
Static Site Importer and Blocks Engine should run in that WordPress runtime because they are WordPress/PHP import systems. The Figma plugin should not reimplement them in TypeScript. The plugin's job is to hand off design data with enough metadata for Studio to route through Static Site Importer and clean up importer dependencies after a successful import.
37
37
@@ -40,8 +40,9 @@ Static Site Importer and Blocks Engine should run in that WordPress runtime beca
40
40
Implemented now:
41
41
42
42
-`GeneratedWebsiteArtifact` for static generated files from Figma.
43
-
-`blocks-engine/php-transformer/site-artifact/v1` for the Studio CLI artifact handoff.
44
-
- A Figma UI client that posts the artifact JSON to local Studio.
43
+
-`wordpress-studio/figma-source/v1` for the primary Studio Figma handoff.
44
+
-`blocks-engine/php-transformer/site-artifact/v1` retained as debug/diagnostic context.
45
+
- A Figma UI client that posts the source payload to local Studio.
45
46
46
47
Not implemented yet:
47
48
@@ -68,4 +69,4 @@ Figma development test:
68
69
69
70
## Next Integration Step
70
71
71
-
The next meaningful step is richer Studio-side progress/error reporting around CLI imports and post-import block/visual validation. That should remain in the Studio layer, not by porting PHP importer behavior into the Figma plugin.
72
+
The next meaningful step is Studio-side routing for `wordpress-studio/figma-source/v1`, plus richer progress/error reporting around imports and post-import block/visual validation. That should remain in the Studio layer, not by porting PHP importer behavior into the Figma plugin.
Copy file name to clipboardExpand all lines: plugins/figma-to-wordpress-studio/README.md
+60-8Lines changed: 60 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,24 @@
1
1
# Figma to WordPress Studio
2
2
3
-
This plugin moves a Figma file into WordPress by sending a Studio import payload to the local WordPress Studio app.
3
+
This plugin moves a Figma file into WordPress by sending a Figma source payload to the local WordPress Studio app.
4
4
5
-
It does not port Static Site Importer, Blocks Engine, WordPress, PHP, or Studio internals to TypeScript. The TypeScript code extracts Figma scene data, prepares an artifact JSON source, and posts it to Studio's local handoff endpoint. Studio owns site creation, import through Static Site Importer, and cleanup after a successful import. If Studio is not running, the plugin surfaces the connection error.
5
+
It does not port Static Site Importer, Blocks Engine, WordPress, PHP, or Studio internals to TypeScript. The TypeScript code extracts Figma scene data, captures the user's page/frame selection intent, and posts that source payload to Studio's local handoff endpoint. Studio owns site creation, Figma-to-WordPress transform/import through Static Site Importer and Blocks Engine, and cleanup after a successful import. If Studio is not running, the plugin surfaces the connection error.
6
6
7
7
## Flow
8
8
9
9
```text
10
10
Figma plugin controller + UI
11
-
-> whole Figma document scene data
12
-
-> Studio import artifact JSON
11
+
-> current-page scenegraph + selected-node intent
12
+
-> Studio Figma source payload
13
13
-> local WordPress Studio handoff endpoint
14
14
-> WordPress Studio site
15
15
-> Static Site Importer imports through Blocks Engine
16
16
```
17
17
18
18
## Boundaries
19
19
20
-
- Implemented: a Figma Desktop-loadable plugin shell with whole-file export.
21
-
- Implemented: a reusable scene-to-HTML/CSS artifact generator with diagnostics and tests for the current local handoff.
20
+
- Implemented: a Figma Desktop-loadable plugin shell with current-page scenegraph and selected-frame intent export.
21
+
- Implemented: a reusable scene-to-HTML/CSS artifact generator retained as debug/diagnostic context.
22
22
- Implemented: a Studio local handoff request.
23
23
- Not implemented: running Static Site Importer from TypeScript.
24
24
- Not implemented: automated visual parity/block validation after import.
@@ -29,7 +29,7 @@ Figma plugin controller + UI
29
29
-`src/code.ts` is the Figma plugin main thread entry.
30
30
-`src/ui.ts` is the Figma UI-side handoff logic.
31
31
-`src/index.ts` contains the reusable Figma-scene-to-website-artifact generator.
32
-
-`src/payload.ts` contains the reusable TypeScript interfaces for the Studio CLI artifact handoff.
32
+
-`src/payload.ts` contains the reusable TypeScript interfaces for the Studio Figma source handoff and debug artifact bundle.
33
33
-`src/ui.html` is the Figma UI shell bundled into `dist/ui.html`.
34
34
35
35
## Local Test
@@ -50,6 +50,58 @@ npm test --prefix plugins/figma-to-wordpress-studio
50
50
51
51
## Studio Handoff Boundary
52
52
53
-
Figma plugin UIs run in a constrained iframe-like environment and cannot spawn local shell commands. The supported boundary is a local Studio handoff: the plugin posts the import artifact to Studio's loopback endpoint. Studio accepts the artifact source, creates the site, runs Static Site Importer, and removes SSI after a successful import.
53
+
Figma plugin UIs run in a constrained iframe-like environment and cannot spawn local shell commands. The supported boundary is a local Studio handoff: the plugin posts a Figma source payload to Studio's loopback endpoint. Studio accepts the source, creates the site, runs the Figma import route through Static Site Importer and Blocks Engine, and removes importer dependencies after a successful import.
54
+
55
+
The `Open in WordPress Studio` request body is source-first:
56
+
57
+
```json
58
+
{
59
+
"source": {
60
+
"schema": "wordpress-studio/figma-source/v1",
61
+
"source": {
62
+
"type": "figma",
63
+
"metadata": {
64
+
"provider": "figma",
65
+
"plugin": "figma-to-wordpress-studio",
66
+
"fileKey": "...",
67
+
"fileName": "Marketing site",
68
+
"editorType": "figma",
69
+
"currentPage": { "id": "0:1", "name": "Landing" }
70
+
},
71
+
"exportedAt": "2026-01-01T00:00:00.000Z"
72
+
},
73
+
"intent": {
74
+
"scope": "selected-nodes",
75
+
"pageId": "0:1",
76
+
"pageName": "Landing",
77
+
"selectedNodeIds": ["1:2"],
78
+
"rootNodeIds": ["1:2"]
79
+
},
80
+
"scenegraph": {
81
+
"currentPage": {},
82
+
"selectedNodes": []
83
+
},
84
+
"assets": [],
85
+
"transform": {
86
+
"target": "wordpress",
87
+
"route": "static-site-importer/figma",
88
+
"options": {
89
+
"selectionScope": "selected-nodes",
90
+
"pageId": "0:1",
91
+
"selectedNodeIds": ["1:2"],
92
+
"preserveSourceScenegraph": true,
93
+
"importAssets": true
94
+
}
95
+
},
96
+
"debug": {
97
+
"generatedArtifact": {},
98
+
"diagnostics": []
99
+
}
100
+
},
101
+
"siteName": "Marketing site"
102
+
}
103
+
```
104
+
105
+
`debug.generatedArtifact` is diagnostic context only. Studio should route from `source`, `scenegraph`, and `transform`, not from a pre-rendered website artifact bundle.
54
106
55
107
See [`../../docs/figma-studio-runner.md`](../../docs/figma-studio-runner.md) for the integration notes.
0 commit comments