@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.
Files changed (100) hide show
  1. package/README.md +112 -2
  2. package/SECURITY.md +6 -6
  3. package/dist/agent/export-manager.js +125 -125
  4. package/dist/assets/repositories/fontawesome.d.ts.map +1 -1
  5. package/dist/assets/repositories/fontawesome.js +2 -1
  6. package/dist/assets/repositories/fontawesome.js.map +1 -1
  7. package/dist/assets/repositories/iconify.d.ts.map +1 -1
  8. package/dist/assets/repositories/iconify.js +4 -3
  9. package/dist/assets/repositories/iconify.js.map +1 -1
  10. package/dist/browser/puppeteer-controller.js +38 -23
  11. package/dist/build-info.json +2 -2
  12. package/dist/cli.js +54 -54
  13. package/dist/execution/canvas-state.js +25 -25
  14. package/dist/i18n/locales/en.js +22 -22
  15. package/dist/i18n/locales/fil.js +44 -44
  16. package/dist/i18n/locales/is.js +22 -22
  17. package/dist/i18n/locales/ur.js +22 -22
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +5563 -5560
  20. package/dist/index.js.map +1 -1
  21. package/dist/ontology/upstream-vocabulary.d.ts +2 -2
  22. package/dist/ontology/upstream-vocabulary.js +6 -6
  23. package/dist/tools/choreograph.d.ts.map +1 -1
  24. package/dist/tools/choreograph.js +7 -0
  25. package/dist/tools/choreograph.js.map +1 -1
  26. package/dist/tools/craft-tools.js +18 -18
  27. package/dist/tools/definitions.d.ts.map +1 -1
  28. package/dist/tools/definitions.js +2830 -2812
  29. package/dist/tools/definitions.js.map +1 -1
  30. package/dist/tools/effect-check.js +68 -68
  31. package/dist/tools/engine-lists.d.ts +11 -4
  32. package/dist/tools/engine-lists.d.ts.map +1 -1
  33. package/dist/tools/engine-lists.js +49 -4
  34. package/dist/tools/engine-lists.js.map +1 -1
  35. package/dist/tools/engine-methods.d.ts.map +1 -1
  36. package/dist/tools/engine-methods.js +2 -1
  37. package/dist/tools/engine-methods.js.map +1 -1
  38. package/dist/tools/engine-surface.d.ts +1 -1
  39. package/dist/tools/engine-surface.d.ts.map +1 -1
  40. package/dist/tools/engine-surface.js +16 -4
  41. package/dist/tools/engine-surface.js.map +1 -1
  42. package/dist/tools/export-file-receipt.d.ts +21 -0
  43. package/dist/tools/export-file-receipt.d.ts.map +1 -1
  44. package/dist/tools/export-file-receipt.js +36 -13
  45. package/dist/tools/export-file-receipt.js.map +1 -1
  46. package/dist/tools/handlers/export.d.ts.map +1 -1
  47. package/dist/tools/handlers/export.js +6 -2
  48. package/dist/tools/handlers/export.js.map +1 -1
  49. package/dist/tools/handlers/font.js +22 -22
  50. package/dist/tools/handlers/generate.d.ts.map +1 -1
  51. package/dist/tools/handlers/generate.js +4 -3
  52. package/dist/tools/handlers/generate.js.map +1 -1
  53. package/dist/tools/handlers.d.ts +5 -0
  54. package/dist/tools/handlers.d.ts.map +1 -1
  55. package/dist/tools/handlers.js +29 -16
  56. package/dist/tools/handlers.js.map +1 -1
  57. package/dist/tools/lane.d.ts +7 -3
  58. package/dist/tools/lane.d.ts.map +1 -1
  59. package/dist/tools/lane.js +82 -67
  60. package/dist/tools/lane.js.map +1 -1
  61. package/dist/tools/p5-compat/p5-helpers.js +341 -341
  62. package/dist/tools/scene-cache-export.d.ts.map +1 -1
  63. package/dist/tools/scene-cache-export.js +8 -4
  64. package/dist/tools/scene-cache-export.js.map +1 -1
  65. package/dist/tools/shape-params.d.ts +2 -2
  66. package/dist/tools/shape-params.js +2 -2
  67. package/dist/tools/stick-vocabulary.d.ts +1 -1
  68. package/dist/tools/stick-vocabulary.js +1 -1
  69. package/dist/tools/timeline.js +82 -82
  70. package/dist/tools/toolkits.d.ts +1 -1
  71. package/dist/tools/toolkits.d.ts.map +1 -1
  72. package/dist/tools/toolkits.js +8 -2
  73. package/dist/tools/toolkits.js.map +1 -1
  74. package/dist/types/code-generator.d.ts.map +1 -1
  75. package/dist/types/code-generator.js +6682 -5832
  76. package/dist/types/code-generator.js.map +1 -1
  77. package/dist/types/schemas.d.ts +29 -2
  78. package/dist/types/schemas.d.ts.map +1 -1
  79. package/dist/types/schemas.js +9 -23
  80. package/dist/types/schemas.js.map +1 -1
  81. package/dist/utils/asset-paths.d.ts.map +1 -1
  82. package/dist/utils/asset-paths.js +11 -0
  83. package/dist/utils/asset-paths.js.map +1 -1
  84. package/dist/utils/capabilities.d.ts +15 -0
  85. package/dist/utils/capabilities.d.ts.map +1 -0
  86. package/dist/utils/capabilities.js +63 -0
  87. package/dist/utils/capabilities.js.map +1 -0
  88. package/dist/utils/env.d.ts.map +1 -1
  89. package/dist/utils/env.js +2 -1
  90. package/dist/utils/env.js.map +1 -1
  91. package/dist/utils/safe-fetch.d.ts +8 -0
  92. package/dist/utils/safe-fetch.d.ts.map +1 -1
  93. package/dist/utils/safe-fetch.js +125 -34
  94. package/dist/utils/safe-fetch.js.map +1 -1
  95. package/dist/vendor/design/device-mockup-generator.js +167 -150
  96. package/dist/vendor/design/recursive-subdivision-generator.js +107 -107
  97. package/dist/vendor/design/textile-weave-generator.js +429 -429
  98. package/dist/vendor/design/ui-kit-runtime.js +674 -674
  99. package/manifest.json +18 -2
  100. 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
- // Browser Window Mockup Frame
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
- // Window Main Body
68
- var windowBody = new paper.Path.Rectangle({
69
- point: [${cx - w / 2}, ${cy - h / 2}],
70
- size: [${w}, ${h}],
71
- radius: ${radius},
72
- fillColor: '${bgWindow}',
73
- strokeColor: '${borderColor}',
74
- strokeWidth: 1.5
75
- });
76
- frameGroup.addChild(windowBody);
77
-
78
- // Header Titlebar
79
- var header = new paper.Path.Rectangle({
80
- point: [${cx - w / 2}, ${cy - h / 2}],
81
- size: [${w}, ${headerHeight}],
82
- radius: ${radius},
83
- fillColor: '${bgHeader}'
84
- });
85
- // Clip header bottom corners to keep top rounded
86
- var headerCut = new paper.Path.Rectangle({
87
- point: [${cx - w / 2}, ${cy - h / 2 + headerHeight - radius}],
88
- size: [${w}, ${radius}],
89
- fillColor: '${bgHeader}'
90
- });
91
- var fullHeader = header.unite(headerCut);
92
- fullHeader.strokeColor = '${borderColor}';
93
- fullHeader.strokeWidth = 1;
94
- frameGroup.addChild(fullHeader);
95
-
96
- // Traffic Light Window Controls
97
- var closeDot = new paper.Path.Circle({ center: [${dotStartX}, ${dotY}], radius: ${dotR}, fillColor: '#ff5f56' });
98
- var minDot = new paper.Path.Circle({ center: [${dotStartX + 14}, ${dotY}], radius: ${dotR}, fillColor: '#ffbd2e' });
99
- var maxDot = new paper.Path.Circle({ center: [${dotStartX + 28}, ${dotY}], radius: ${dotR}, fillColor: '#27c93f' });
100
-
101
- frameGroup.addChild(closeDot);
102
- frameGroup.addChild(minDot);
103
- frameGroup.addChild(maxDot);
104
-
105
- // Address Bar Pill
106
- var urlPill = new paper.Path.Rectangle({
107
- point: [${pillX}, ${pillY}],
108
- size: [${pillW}, ${pillH}],
109
- radius: ${pillH / 2},
110
- fillColor: '${bgUrlBar}',
111
- strokeColor: '${borderColor}',
112
- strokeWidth: 1
113
- });
114
- frameGroup.addChild(urlPill);
115
-
116
- // SSL Lock Icon
117
- var lockIcon = new paper.PointText({
118
- point: [${pillX + 12}, ${pillY + pillH / 2 + 4}],
119
- content: '🔒',
120
- fontSize: 10,
121
- fillColor: '${textUrl}'
122
- });
123
- frameGroup.addChild(lockIcon);
124
-
125
- // Address Bar Text
126
- var urlText = new paper.PointText({
127
- point: [${pillX + 28}, ${pillY + pillH / 2 + 4}],
128
- content: ${lit(urlDisplay)},
129
- fontFamily: 'Inter, system-ui, sans-serif',
130
- fontSize: 12,
131
- fontWeight: 'normal',
132
- fillColor: '${textUrl}'
133
- });
134
- frameGroup.addChild(urlText);
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
- // Simulated Interactive Prompt Bar
155
- var promptGroup = new paper.Group();
156
-
157
- // Outer glowing aura
158
- var glow = new paper.Path.Rectangle({
159
- point: [${x - 2}, ${y - 2}],
160
- size: [${w + 4}, ${h + 4}],
161
- radius: ${Math.round(h * 0.35) + 2},
162
- fillColor: '${accent}22',
163
- strokeColor: '${accent}55',
164
- strokeWidth: 1.5
165
- });
166
- promptGroup.addChild(glow);
167
-
168
- // Input background container
169
- var inputBg = new paper.Path.Rectangle({
170
- point: [${x}, ${y}],
171
- size: [${w}, ${h}],
172
- radius: ${Math.round(h * 0.35)},
173
- fillColor: '#090d13',
174
- strokeColor: '${accent}',
175
- strokeWidth: 1.5
176
- });
177
- promptGroup.addChild(inputBg);
178
-
179
- // Prompt Prefix Icon
180
- var sparkleIcon = new paper.PointText({
181
- point: [${x + 18}, ${y + h / 2 + 5}],
182
- content: '✦',
183
- fontFamily: 'system-ui',
184
- fontSize: ${Math.max(14, Math.round(h * 0.32))},
185
- fillColor: '${accent}'
186
- });
187
- promptGroup.addChild(sparkleIcon);
188
-
189
- // Prompt Text Content
190
- var promptContent = new paper.PointText({
191
- point: [${x + 44}, ${y + h / 2 + 5}],
192
- content: ${lit(text)},
193
- fontFamily: 'Inter, -apple-system, sans-serif',
194
- fontSize: ${Math.max(13, Math.round(h * 0.28))},
195
- fontWeight: '500',
196
- fillColor: '${textColor}'
197
- });
198
- promptGroup.addChild(promptContent);
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
- var btnLabel = new paper.PointText({
227
- point: [btnX + btnW / 2, btnY + btnH / 2 + 4],
228
- content: ${lit(btnText)},
229
- fontFamily: 'Inter, system-ui, sans-serif',
230
- fontSize: ${btnFontSize},
231
- fontWeight: 'bold',
232
- fillColor: '#090d13',
233
- justification: 'center'
234
- });
235
- promptGroup.addChild(btnLabel);
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 `// Recursive Quadtree Subdivision Vector Generator (${presetName})
211
- (function() {
212
- const items = [];
213
- const prefix = "${prefix}";
214
- const cellInset = ${cellInset};
215
- const dividerWidth = ${dividerWidth};
216
- const dividerColor = "${dividerColor}";
217
- const groundColor = "${ground}";
218
-
219
- // 1. Solid Ground Backdrop
220
- const bg = new paper.Path.Rectangle({
221
- point: [${x}, ${y}],
222
- size: [${w}, ${h}],
223
- fillColor: groundColor,
224
- strokeColor: null
225
- });
226
- if (typeof app.registerItem === "function") {
227
- app.registerItem(bg, prefix + "_backdrop", { source: "recursive_subdivision", role: "backdrop" });
228
- }
229
- items.push(bg);
230
-
231
- // 2. Leaf Color Blocks & Nested Accents
232
- const cells = ${serializedCells};
233
- for (let i = 0; i < cells.length; i++) {
234
- const c = cells[i];
235
- const ix = c.x + cellInset;
236
- const iy = c.y + cellInset;
237
- const iw = Math.max(1, c.width - cellInset * 2);
238
- const ih = Math.max(1, c.height - cellInset * 2);
239
-
240
- if (c.color && c.color !== groundColor) {
241
- const rect = new paper.Path.Rectangle({
242
- point: [ix, iy],
243
- size: [iw, ih],
244
- fillColor: c.color,
245
- strokeColor: null
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
- // Outer border frame
295
- const frame = new paper.Path.Rectangle({
296
- point: [${x}, ${y}],
297
- size: [${w}, ${h}],
298
- fillColor: null,
299
- strokeColor: dividerColor,
300
- strokeWidth: dividerWidth * 1.5
301
- });
302
- if (typeof app.registerItem === "function") {
303
- app.registerItem(frame, prefix + "_frame", { source: "recursive_subdivision", role: "frame" });
304
- }
305
- items.push(frame);
306
- }
307
-
308
- const group = new paper.Group(items);
309
- if (typeof app.registerItem === "function") {
310
- app.registerItem(group, prefix + "_group", {
311
- source: "recursive_subdivision",
312
- cellCount: cells.length,
313
- preset: "${presetName}"
314
- });
315
- }
316
- return group;
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