@pinepaper.studio/mcp-server 1.6.27 → 1.6.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -2
- package/SECURITY.md +6 -6
- package/dist/agent/export-manager.js +125 -125
- package/dist/assets/repositories/fontawesome.d.ts.map +1 -1
- package/dist/assets/repositories/fontawesome.js +2 -1
- package/dist/assets/repositories/fontawesome.js.map +1 -1
- package/dist/assets/repositories/iconify.d.ts.map +1 -1
- package/dist/assets/repositories/iconify.js +4 -3
- package/dist/assets/repositories/iconify.js.map +1 -1
- package/dist/browser/puppeteer-controller.js +38 -23
- package/dist/build-info.json +2 -2
- package/dist/cli.js +54 -54
- package/dist/execution/canvas-state.js +25 -25
- package/dist/i18n/locales/en.js +22 -22
- package/dist/i18n/locales/fil.js +44 -44
- package/dist/i18n/locales/is.js +22 -22
- package/dist/i18n/locales/ur.js +22 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5563 -5560
- package/dist/index.js.map +1 -1
- package/dist/ontology/upstream-vocabulary.d.ts +2 -2
- package/dist/ontology/upstream-vocabulary.js +6 -6
- package/dist/tools/choreograph.d.ts.map +1 -1
- package/dist/tools/choreograph.js +7 -0
- package/dist/tools/choreograph.js.map +1 -1
- package/dist/tools/craft-tools.js +18 -18
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +2830 -2812
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/effect-check.js +68 -68
- package/dist/tools/engine-lists.d.ts +11 -4
- package/dist/tools/engine-lists.d.ts.map +1 -1
- package/dist/tools/engine-lists.js +49 -4
- package/dist/tools/engine-lists.js.map +1 -1
- package/dist/tools/engine-methods.d.ts.map +1 -1
- package/dist/tools/engine-methods.js +2 -1
- package/dist/tools/engine-methods.js.map +1 -1
- package/dist/tools/engine-surface.d.ts +1 -1
- package/dist/tools/engine-surface.d.ts.map +1 -1
- package/dist/tools/engine-surface.js +16 -4
- package/dist/tools/engine-surface.js.map +1 -1
- package/dist/tools/export-file-receipt.d.ts +21 -0
- package/dist/tools/export-file-receipt.d.ts.map +1 -1
- package/dist/tools/export-file-receipt.js +36 -13
- package/dist/tools/export-file-receipt.js.map +1 -1
- package/dist/tools/handlers/export.d.ts.map +1 -1
- package/dist/tools/handlers/export.js +6 -2
- package/dist/tools/handlers/export.js.map +1 -1
- package/dist/tools/handlers/font.js +22 -22
- package/dist/tools/handlers/generate.d.ts.map +1 -1
- package/dist/tools/handlers/generate.js +4 -3
- package/dist/tools/handlers/generate.js.map +1 -1
- package/dist/tools/handlers.d.ts +5 -0
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +29 -16
- package/dist/tools/handlers.js.map +1 -1
- package/dist/tools/lane.d.ts +7 -3
- package/dist/tools/lane.d.ts.map +1 -1
- package/dist/tools/lane.js +82 -67
- package/dist/tools/lane.js.map +1 -1
- package/dist/tools/p5-compat/p5-helpers.js +341 -341
- package/dist/tools/scene-cache-export.d.ts.map +1 -1
- package/dist/tools/scene-cache-export.js +8 -4
- package/dist/tools/scene-cache-export.js.map +1 -1
- package/dist/tools/shape-params.d.ts +2 -2
- package/dist/tools/shape-params.js +2 -2
- package/dist/tools/stick-vocabulary.d.ts +1 -1
- package/dist/tools/stick-vocabulary.js +1 -1
- package/dist/tools/timeline.js +82 -82
- package/dist/tools/toolkits.d.ts +1 -1
- package/dist/tools/toolkits.d.ts.map +1 -1
- package/dist/tools/toolkits.js +8 -2
- package/dist/tools/toolkits.js.map +1 -1
- package/dist/types/code-generator.d.ts.map +1 -1
- package/dist/types/code-generator.js +6682 -5832
- package/dist/types/code-generator.js.map +1 -1
- package/dist/types/schemas.d.ts +29 -2
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +9 -23
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/asset-paths.d.ts.map +1 -1
- package/dist/utils/asset-paths.js +11 -0
- package/dist/utils/asset-paths.js.map +1 -1
- package/dist/utils/capabilities.d.ts +15 -0
- package/dist/utils/capabilities.d.ts.map +1 -0
- package/dist/utils/capabilities.js +63 -0
- package/dist/utils/capabilities.js.map +1 -0
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/env.js +2 -1
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/safe-fetch.d.ts +8 -0
- package/dist/utils/safe-fetch.d.ts.map +1 -1
- package/dist/utils/safe-fetch.js +125 -34
- package/dist/utils/safe-fetch.js.map +1 -1
- package/dist/vendor/design/device-mockup-generator.js +167 -150
- package/dist/vendor/design/recursive-subdivision-generator.js +107 -107
- package/dist/vendor/design/textile-weave-generator.js +429 -429
- package/dist/vendor/design/ui-kit-runtime.js +674 -674
- package/manifest.json +18 -2
- package/package.json +7 -4
|
@@ -49,12 +49,8 @@ export function generateBrowserWindowCode(opts) {
|
|
|
49
49
|
const pillH = Math.round(headerHeight * 0.65);
|
|
50
50
|
const pillX = Math.round(cx - pillW / 2);
|
|
51
51
|
const pillY = Math.round(cy - h / 2 + (headerHeight - pillH) / 2);
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
var frameGroup = new paper.Group();
|
|
55
|
-
|
|
56
|
-
// Outer ambient shadow
|
|
57
|
-
${opts.dropShadow !== false ? `
|
|
52
|
+
return ("\n // Browser Window Mockup Frame\n var frameGroup = new paper.Group();\n \n // Outer ambient shadow\n " +
|
|
53
|
+
String(opts.dropShadow !== false ? `
|
|
58
54
|
var shadow = new paper.Path.Rectangle({
|
|
59
55
|
point: [${cx - w / 2 + 6}, ${cy - h / 2 + 10}],
|
|
60
56
|
size: [${w}, ${h}],
|
|
@@ -62,77 +58,89 @@ export function generateBrowserWindowCode(opts) {
|
|
|
62
58
|
fillColor: '${isDark ? "rgba(0,0,0,0.6)" : "rgba(0,0,0,0.15)"}'
|
|
63
59
|
});
|
|
64
60
|
frameGroup.addChild(shadow);
|
|
65
|
-
` : ""
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
size: [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
fillColor: '
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
61
|
+
` : "") +
|
|
62
|
+
"\n\n // Window Main Body\n var windowBody = new paper.Path.Rectangle({\n point: [" +
|
|
63
|
+
String(cx - w / 2) +
|
|
64
|
+
", " +
|
|
65
|
+
String(cy - h / 2) +
|
|
66
|
+
"],\n size: [" +
|
|
67
|
+
String(w) +
|
|
68
|
+
", " +
|
|
69
|
+
String(h) +
|
|
70
|
+
"],\n radius: " +
|
|
71
|
+
String(radius) +
|
|
72
|
+
",\n fillColor: '" +
|
|
73
|
+
String(bgWindow) +
|
|
74
|
+
"',\n strokeColor: '" +
|
|
75
|
+
String(borderColor) +
|
|
76
|
+
"',\n strokeWidth: 1.5\n });\n frameGroup.addChild(windowBody);\n\n // Header Titlebar\n var header = new paper.Path.Rectangle({\n point: [" +
|
|
77
|
+
String(cx - w / 2) +
|
|
78
|
+
", " +
|
|
79
|
+
String(cy - h / 2) +
|
|
80
|
+
"],\n size: [" +
|
|
81
|
+
String(w) +
|
|
82
|
+
", " +
|
|
83
|
+
String(headerHeight) +
|
|
84
|
+
"],\n radius: " +
|
|
85
|
+
String(radius) +
|
|
86
|
+
",\n fillColor: '" +
|
|
87
|
+
String(bgHeader) +
|
|
88
|
+
"'\n });\n // Clip header bottom corners to keep top rounded\n var headerCut = new paper.Path.Rectangle({\n point: [" +
|
|
89
|
+
String(cx - w / 2) +
|
|
90
|
+
", " +
|
|
91
|
+
String(cy - h / 2 + headerHeight - radius) +
|
|
92
|
+
"],\n size: [" +
|
|
93
|
+
String(w) +
|
|
94
|
+
", " +
|
|
95
|
+
String(radius) +
|
|
96
|
+
"],\n fillColor: '" +
|
|
97
|
+
String(bgHeader) +
|
|
98
|
+
"'\n });\n var fullHeader = header.unite(headerCut);\n fullHeader.strokeColor = '" +
|
|
99
|
+
String(borderColor) +
|
|
100
|
+
"';\n fullHeader.strokeWidth = 1;\n frameGroup.addChild(fullHeader);\n\n // Traffic Light Window Controls\n var closeDot = new paper.Path.Circle({ center: [" +
|
|
101
|
+
String(dotStartX) +
|
|
102
|
+
", " +
|
|
103
|
+
String(dotY) +
|
|
104
|
+
"], radius: " +
|
|
105
|
+
String(dotR) +
|
|
106
|
+
", fillColor: '#ff5f56' });\n var minDot = new paper.Path.Circle({ center: [" +
|
|
107
|
+
String(dotStartX + 14) +
|
|
108
|
+
", " +
|
|
109
|
+
String(dotY) +
|
|
110
|
+
"], radius: " +
|
|
111
|
+
String(dotR) +
|
|
112
|
+
", fillColor: '#ffbd2e' });\n var maxDot = new paper.Path.Circle({ center: [" +
|
|
113
|
+
String(dotStartX + 28) +
|
|
114
|
+
", " +
|
|
115
|
+
String(dotY) +
|
|
116
|
+
"], radius: " +
|
|
117
|
+
String(dotR) +
|
|
118
|
+
", fillColor: '#27c93f' });\n \n frameGroup.addChild(closeDot);\n frameGroup.addChild(minDot);\n frameGroup.addChild(maxDot);\n\n // Address Bar Pill\n var urlPill = new paper.Path.Rectangle({\n point: [" +
|
|
119
|
+
String(pillX) +
|
|
120
|
+
", " +
|
|
121
|
+
String(pillY) +
|
|
122
|
+
"],\n size: [" +
|
|
123
|
+
String(pillW) +
|
|
124
|
+
", " +
|
|
125
|
+
String(pillH) +
|
|
126
|
+
"],\n radius: " +
|
|
127
|
+
String(pillH / 2) +
|
|
128
|
+
",\n fillColor: '" +
|
|
129
|
+
String(bgUrlBar) +
|
|
130
|
+
"',\n strokeColor: '" +
|
|
131
|
+
String(borderColor) +
|
|
132
|
+
"',\n strokeWidth: 1\n });\n frameGroup.addChild(urlPill);\n\n // SSL Lock Icon\n var lockIcon = new paper.PointText({\n point: [" +
|
|
133
|
+
String(pillX + 12) +
|
|
134
|
+
", " +
|
|
135
|
+
String(pillY + pillH / 2 + 4) +
|
|
136
|
+
"],\n content: '🔒',\n fontSize: 10,\n fillColor: '" +
|
|
137
|
+
String(textUrl) +
|
|
138
|
+
"'\n });\n frameGroup.addChild(lockIcon);\n\n // Address Bar Text\n var urlText = new paper.PointText({\n point: [" +
|
|
139
|
+
String(pillX + 28) +
|
|
140
|
+
", " +
|
|
141
|
+
String(pillY + pillH / 2 + 4) +
|
|
142
|
+
"],\n content: " +
|
|
143
|
+
String(lit(urlDisplay)) + ",\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: 12,\n fontWeight: 'normal',\n fillColor: '" + String(textUrl) + "'\n });\n frameGroup.addChild(urlText);\n ");
|
|
136
144
|
}
|
|
137
145
|
/**
|
|
138
146
|
* Generates Paper.js code for a simulated interactive prompt input box.
|
|
@@ -150,55 +158,52 @@ export function generateSimulatedPromptInputCode(opts) {
|
|
|
150
158
|
// Submit / Generate Button Pill
|
|
151
159
|
const btnH = Math.round(h * 0.72);
|
|
152
160
|
const btnFontSize = Math.max(12, Math.round(btnH * 0.38));
|
|
153
|
-
return
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
radius:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
size: [
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
// Prompt Prefix Icon
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
fontFamily: 'system-ui'
|
|
184
|
-
|
|
185
|
-
fillColor: '
|
|
186
|
-
|
|
187
|
-
promptGroup.addChild(sparkleIcon)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
fontFamily: 'Inter, -apple-system, sans-serif'
|
|
194
|
-
|
|
195
|
-
fontWeight: '500'
|
|
196
|
-
|
|
197
|
-
})
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// Blinking Caret Cursor
|
|
201
|
-
${opts.showCursor !== false ? `
|
|
161
|
+
return ("\n // Simulated Interactive Prompt Bar\n var promptGroup = new paper.Group();\n\n // Outer glowing aura\n var glow = new paper.Path.Rectangle({\n point: [" +
|
|
162
|
+
String(x - 2) +
|
|
163
|
+
", " +
|
|
164
|
+
String(y - 2) +
|
|
165
|
+
"],\n size: [" +
|
|
166
|
+
String(w + 4) +
|
|
167
|
+
", " +
|
|
168
|
+
String(h + 4) +
|
|
169
|
+
"],\n radius: " +
|
|
170
|
+
String(Math.round(h * 0.35) + 2) +
|
|
171
|
+
",\n fillColor: '" +
|
|
172
|
+
String(accent) +
|
|
173
|
+
"22',\n strokeColor: '" +
|
|
174
|
+
String(accent) +
|
|
175
|
+
"55',\n strokeWidth: 1.5\n });\n promptGroup.addChild(glow);\n\n // Input background container\n var inputBg = new paper.Path.Rectangle({\n point: [" +
|
|
176
|
+
String(x) +
|
|
177
|
+
", " +
|
|
178
|
+
String(y) +
|
|
179
|
+
"],\n size: [" +
|
|
180
|
+
String(w) +
|
|
181
|
+
", " +
|
|
182
|
+
String(h) +
|
|
183
|
+
"],\n radius: " +
|
|
184
|
+
String(Math.round(h * 0.35)) +
|
|
185
|
+
",\n fillColor: '#090d13',\n strokeColor: '" +
|
|
186
|
+
String(accent) +
|
|
187
|
+
"',\n strokeWidth: 1.5\n });\n promptGroup.addChild(inputBg);\n\n // Prompt Prefix Icon\n var sparkleIcon = new paper.PointText({\n point: [" +
|
|
188
|
+
String(x + 18) +
|
|
189
|
+
", " +
|
|
190
|
+
String(y + h / 2 + 5) +
|
|
191
|
+
"],\n content: '✦',\n fontFamily: 'system-ui',\n fontSize: " +
|
|
192
|
+
String(Math.max(14, Math.round(h * 0.32))) +
|
|
193
|
+
",\n fillColor: '" +
|
|
194
|
+
String(accent) +
|
|
195
|
+
"'\n });\n promptGroup.addChild(sparkleIcon);\n\n // Prompt Text Content\n var promptContent = new paper.PointText({\n point: [" +
|
|
196
|
+
String(x + 44) +
|
|
197
|
+
", " +
|
|
198
|
+
String(y + h / 2 + 5) +
|
|
199
|
+
"],\n content: " +
|
|
200
|
+
String(lit(text)) +
|
|
201
|
+
",\n fontFamily: 'Inter, -apple-system, sans-serif',\n fontSize: " +
|
|
202
|
+
String(Math.max(13, Math.round(h * 0.28))) +
|
|
203
|
+
",\n fontWeight: '500',\n fillColor: '" +
|
|
204
|
+
String(textColor) +
|
|
205
|
+
"'\n });\n promptGroup.addChild(promptContent);\n\n // Blinking Caret Cursor\n " +
|
|
206
|
+
String(opts.showCursor !== false ? `
|
|
202
207
|
var textBounds = promptContent.bounds;
|
|
203
208
|
var caret = new paper.Path.Line({
|
|
204
209
|
from: [textBounds.right + 3, ${y + h * 0.25}],
|
|
@@ -207,33 +212,45 @@ export function generateSimulatedPromptInputCode(opts) {
|
|
|
207
212
|
strokeWidth: 2
|
|
208
213
|
});
|
|
209
214
|
promptGroup.addChild(caret);
|
|
210
|
-
` : ""
|
|
215
|
+
` : "") +
|
|
216
|
+
"\n\n // Submit / Generate Button Pill\n var btnW = " +
|
|
217
|
+
String(Math.max(90, Math.round(w * 0.18))) +
|
|
218
|
+
";\n var btnH = " +
|
|
219
|
+
String(btnH) +
|
|
220
|
+
";\n var btnX = " +
|
|
221
|
+
String(x + w) +
|
|
222
|
+
" - btnW - " +
|
|
223
|
+
String(Math.round(h * 0.14)) +
|
|
224
|
+
";\n var btnY = " +
|
|
225
|
+
String(y) +
|
|
226
|
+
" + (" +
|
|
227
|
+
String(h) +
|
|
228
|
+
" - btnH) / 2;\n\n var submitBtn = new paper.Path.Rectangle({\n point: [btnX, btnY],\n size: [btnW, btnH],\n radius: btnH / 2,\n fillColor: '" +
|
|
229
|
+
String(accent) +
|
|
230
|
+
"'\n });\n promptGroup.addChild(submitBtn);\n\n var btnLabel = new paper.PointText({\n point: [btnX + btnW / 2, btnY + btnH / 2 + 4],\n content: " +
|
|
231
|
+
String(lit(btnText)) +
|
|
232
|
+
",\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: " +
|
|
233
|
+
String(btnFontSize) +
|
|
234
|
+
",\n fontWeight: 'bold',\n fillColor: '#090d13',\n justification: 'center'\n });\n promptGroup.addChild(btnLabel);\n "
|
|
211
235
|
|
|
212
|
-
// Submit / Generate Button Pill
|
|
213
|
-
var btnW = ${Math.max(90, Math.round(w * 0.18))};
|
|
214
|
-
var btnH = ${btnH};
|
|
215
|
-
var btnX = ${x + w} - btnW - ${Math.round(h * 0.14)};
|
|
216
|
-
var btnY = ${y} + (${h} - btnH) / 2;
|
|
217
236
|
|
|
218
|
-
var submitBtn = new paper.Path.Rectangle({
|
|
219
|
-
point: [btnX, btnY],
|
|
220
|
-
size: [btnW, btnH],
|
|
221
|
-
radius: btnH / 2,
|
|
222
|
-
fillColor: '${accent}'
|
|
223
|
-
});
|
|
224
|
-
promptGroup.addChild(submitBtn);
|
|
225
237
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
);
|
|
237
254
|
}
|
|
238
255
|
/**
|
|
239
256
|
* Generates Paper.js code for an animated cursor with optional click pulse.
|
|
@@ -207,113 +207,113 @@ export function generateRecursiveSubdivisionCode(opts = {}) {
|
|
|
207
207
|
const { cells, dividers } = partitionSubdivision(opts);
|
|
208
208
|
const serializedCells = JSON.stringify(cells);
|
|
209
209
|
const serializedDividers = JSON.stringify(dividers);
|
|
210
|
-
return
|
|
211
|
-
(
|
|
212
|
-
const items = []
|
|
213
|
-
|
|
214
|
-
const cellInset =
|
|
215
|
-
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const cells =
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const cellId = prefix + "_cell_" + i;
|
|
248
|
-
if (typeof app.registerItem === "function") {
|
|
249
|
-
app.registerItem(rect, cellId, {
|
|
250
|
-
source: "recursive_subdivision",
|
|
251
|
-
depth: c.depth,
|
|
252
|
-
isRestCell: Boolean(c.isRestCell)
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
items.push(rect);
|
|
256
|
-
|
|
257
|
-
// Optional nested accent box
|
|
258
|
-
if (c.hasNested && c.nestedColor && iw > 24 && ih > 24) {
|
|
259
|
-
const nestInset = Math.min(iw, ih) * 0.22;
|
|
260
|
-
const nestRect = new paper.Path.Rectangle({
|
|
261
|
-
point: [ix + nestInset, iy + nestInset],
|
|
262
|
-
size: [iw - nestInset * 2, ih - nestInset * 2],
|
|
263
|
-
fillColor: c.nestedColor,
|
|
264
|
-
strokeColor: null
|
|
265
|
-
});
|
|
266
|
-
const nestId = prefix + "_cell_" + i + "_nested";
|
|
267
|
-
if (typeof app.registerItem === "function") {
|
|
268
|
-
app.registerItem(nestRect, nestId, { source: "recursive_subdivision", role: "nested" });
|
|
269
|
-
}
|
|
270
|
-
items.push(nestRect);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// 3. Orthogonal Divider Grid Lines
|
|
276
|
-
if (dividerWidth > 0) {
|
|
277
|
-
const dividers = ${serializedDividers};
|
|
278
|
-
for (let j = 0; j < dividers.length; j++) {
|
|
279
|
-
const d = dividers[j];
|
|
280
|
-
const line = new paper.Path.Line({
|
|
281
|
-
from: [d.x0, d.y0],
|
|
282
|
-
to: [d.x1, d.y1],
|
|
283
|
-
strokeColor: dividerColor,
|
|
284
|
-
strokeWidth: dividerWidth,
|
|
285
|
-
strokeCap: "square"
|
|
286
|
-
});
|
|
287
|
-
const divId = prefix + "_divider_" + j;
|
|
288
|
-
if (typeof app.registerItem === "function") {
|
|
289
|
-
app.registerItem(line, divId, { source: "recursive_subdivision", role: "divider" });
|
|
290
|
-
}
|
|
291
|
-
items.push(line);
|
|
292
|
-
}
|
|
210
|
+
return ("// Recursive Quadtree Subdivision Vector Generator (" +
|
|
211
|
+
String(presetName) +
|
|
212
|
+
")\n(function() {\n const items = [];\n const prefix = \"" +
|
|
213
|
+
String(prefix) +
|
|
214
|
+
"\";\n const cellInset = " +
|
|
215
|
+
String(cellInset) +
|
|
216
|
+
";\n const dividerWidth = " +
|
|
217
|
+
String(dividerWidth) +
|
|
218
|
+
";\n const dividerColor = \"" +
|
|
219
|
+
String(dividerColor) +
|
|
220
|
+
"\";\n const groundColor = \"" +
|
|
221
|
+
String(ground) +
|
|
222
|
+
"\";\n\n // 1. Solid Ground Backdrop\n const bg = new paper.Path.Rectangle({\n point: [" +
|
|
223
|
+
String(x) +
|
|
224
|
+
", " +
|
|
225
|
+
String(y) +
|
|
226
|
+
"],\n size: [" +
|
|
227
|
+
String(w) +
|
|
228
|
+
", " +
|
|
229
|
+
String(h) +
|
|
230
|
+
"],\n fillColor: groundColor,\n strokeColor: null\n });\n if (typeof app.registerItem === \"function\") {\n app.registerItem(bg, prefix + \"_backdrop\", { source: \"recursive_subdivision\", role: \"backdrop\" });\n }\n items.push(bg);\n\n // 2. Leaf Color Blocks & Nested Accents\n const cells = " +
|
|
231
|
+
String(serializedCells) +
|
|
232
|
+
";\n for (let i = 0; i < cells.length; i++) {\n const c = cells[i];\n const ix = c.x + cellInset;\n const iy = c.y + cellInset;\n const iw = Math.max(1, c.width - cellInset * 2);\n const ih = Math.max(1, c.height - cellInset * 2);\n\n if (c.color && c.color !== groundColor) {\n const rect = new paper.Path.Rectangle({\n point: [ix, iy],\n size: [iw, ih],\n fillColor: c.color,\n strokeColor: null\n });\n const cellId = prefix + \"_cell_\" + i;\n if (typeof app.registerItem === \"function\") {\n app.registerItem(rect, cellId, {\n source: \"recursive_subdivision\",\n depth: c.depth,\n isRestCell" +
|
|
233
|
+
": Boolean(c.isRestCell)\n });\n }\n items.push(rect);\n\n // Optional nested accent box\n if (c.hasNested && c.nestedColor && iw > 24 && ih > 24) {\n const nestInset = Math.min(iw, ih) * 0.22;\n const nestRect = new paper.Path.Rectangle({\n point: [ix + nestInset, iy + nestInset],\n size: [iw - nestInset * 2, ih - nestInset * 2],\n fillColor: c.nestedColor,\n strokeColor: null\n });\n const nestId = prefix + \"_cell_\" + i + \"_nested\";\n if (typeof app.registerItem === \"function\") {\n app.registerItem(nestRect, nestId, { source: \"recursive_subdivision\", role: \"nested\" });\n " +
|
|
234
|
+
" }\n items.push(nestRect);\n }\n }\n }\n\n // 3. Orthogonal Divider Grid Lines\n if (dividerWidth > 0) {\n const dividers = " +
|
|
235
|
+
String(serializedDividers) +
|
|
236
|
+
";\n for (let j = 0; j < dividers.length; j++) {\n const d = dividers[j];\n const line = new paper.Path.Line({\n from: [d.x0, d.y0],\n to: [d.x1, d.y1],\n strokeColor: dividerColor,\n strokeWidth: dividerWidth,\n strokeCap: \"square\"\n });\n const divId = prefix + \"_divider_\" + j;\n if (typeof app.registerItem === \"function\") {\n app.registerItem(line, divId, { source: \"recursive_subdivision\", role: \"divider\" });\n }\n items.push(line);\n }\n\n // Outer border frame\n const frame = new paper.Path.Rectangle({\n point: [" +
|
|
237
|
+
String(x) +
|
|
238
|
+
", " +
|
|
239
|
+
String(y) +
|
|
240
|
+
"],\n size: [" +
|
|
241
|
+
String(w) +
|
|
242
|
+
", " +
|
|
243
|
+
String(h) +
|
|
244
|
+
"],\n fillColor: null,\n strokeColor: dividerColor,\n strokeWidth: dividerWidth * 1.5\n });\n if (typeof app.registerItem === \"function\") {\n app.registerItem(frame, prefix + \"_frame\", { source: \"recursive_subdivision\", role: \"frame\" });\n }\n items.push(frame);\n }\n\n const group = new paper.Group(items);\n if (typeof app.registerItem === \"function\") {\n app.registerItem(group, prefix + \"_group\", {\n source: \"recursive_subdivision\",\n cellCount: cells.length,\n preset: \"" +
|
|
245
|
+
String(presetName) +
|
|
246
|
+
"\"\n });\n }\n return group;\n})();"
|
|
293
247
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
);
|
|
318
318
|
}
|
|
319
319
|
//# sourceMappingURL=recursive-subdivision-generator.js.map
|