@veolab/discoverylab 1.2.1 → 1.3.0

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 (160) hide show
  1. package/.mcp.json +2 -2
  2. package/README.md +182 -0
  3. package/dist/{chunk-TAODYZ52.js → chunk-3QRQEDWR.js} +510 -213
  4. package/dist/{chunk-L4SA5F5W.js → chunk-4L76GPRC.js} +1162 -58
  5. package/dist/chunk-6EGBXRDK.js +30 -0
  6. package/dist/{chunk-I6YD3QFM.js → chunk-FIL7IWEL.js} +5 -3
  7. package/dist/{chunk-4KLG6DDE.js → chunk-FNUN7EPB.js} +6 -6
  8. package/dist/chunk-GAKEFJ5T.js +481 -0
  9. package/dist/chunk-LB3RNE3O.js +109 -0
  10. package/dist/chunk-N6JJ2RGV.js +2680 -0
  11. package/dist/{chunk-XUKWS2CE.js → chunk-VRM42PML.js} +3546 -926
  12. package/dist/{chunk-TJ3H23LL.js → chunk-VVIOB362.js} +3 -1
  13. package/dist/{chunk-W3WJGYR6.js → chunk-XFVDP332.js} +8 -2
  14. package/dist/{chunk-QJXXHOV7.js → chunk-XKX6NBHF.js} +5 -1
  15. package/dist/cli.js +405 -11
  16. package/dist/{db-ADBEBNH6.js → db-6WLEVKUV.js} +3 -1
  17. package/dist/esvp-GSISVXLC.js +52 -0
  18. package/dist/esvp-mobile-GC7MAGMI.js +20 -0
  19. package/dist/index.d.ts +123 -1
  20. package/dist/index.html +11689 -8690
  21. package/dist/index.js +67 -11
  22. package/dist/{ocr-UTWC7537.js → ocr-QDYNCSPE.js} +1 -1
  23. package/dist/{playwright-R7Y5HREH.js → playwright-VZ7PXDC5.js} +2 -2
  24. package/dist/runtime/esvp-host-runtime/darwin-arm64/esvp-host-runtime +0 -0
  25. package/dist/runtime/esvp-host-runtime/manifest.json +10 -0
  26. package/dist/{server-3FBHBA7L.js → server-6N3KIEGP.js} +2 -1
  27. package/dist/server-FO3UVUZU.js +22 -0
  28. package/dist/{setup-27CQAX6K.js → setup-2SQC5UHJ.js} +4 -3
  29. package/dist/{tools-L6PKKQPY.js → tools-OCRMOQ4U.js} +63 -8
  30. package/package.json +36 -5
  31. package/dist/chunk-22OCFYHG.js +0 -6283
  32. package/dist/chunk-24VARQVO.js +0 -7818
  33. package/dist/chunk-2OGZX6C4.js +0 -588
  34. package/dist/chunk-2WCNIFRO.js +0 -6191
  35. package/dist/chunk-43U6UYV7.js +0 -590
  36. package/dist/chunk-4H2E3K2G.js +0 -7638
  37. package/dist/chunk-4MS6YW2B.js +0 -6490
  38. package/dist/chunk-4NNTRJOI.js +0 -7791
  39. package/dist/chunk-5F76VWME.js +0 -6397
  40. package/dist/chunk-5NEFN42O.js +0 -7791
  41. package/dist/chunk-63MEQ6UH.js +0 -7673
  42. package/dist/chunk-6H3NXFX3.js +0 -6861
  43. package/dist/chunk-7IDQLLBW.js +0 -311
  44. package/dist/chunk-7NP64TGJ.js +0 -6822
  45. package/dist/chunk-AATLY4KT.js +0 -6505
  46. package/dist/chunk-C7QUR7XX.js +0 -6397
  47. package/dist/chunk-CGKCE6MC.js +0 -6279
  48. package/dist/chunk-D25V6IWE.js +0 -6487
  49. package/dist/chunk-EQOZSXAT.js +0 -6822
  50. package/dist/chunk-FPHD7HSQ.js +0 -6812
  51. package/dist/chunk-GGJJUCFK.js +0 -7160
  52. package/dist/chunk-GLHOY3NN.js +0 -7805
  53. package/dist/chunk-GML5MKQA.js +0 -6398
  54. package/dist/chunk-GOL6FUJL.js +0 -6045
  55. package/dist/chunk-GSWHWEYC.js +0 -1346
  56. package/dist/chunk-HDKEQOF5.js +0 -7788
  57. package/dist/chunk-HZGSWVVS.js +0 -7111
  58. package/dist/chunk-IGZ5TICZ.js +0 -334
  59. package/dist/chunk-IRKQG33A.js +0 -7054
  60. package/dist/chunk-JFTBF4JR.js +0 -6040
  61. package/dist/chunk-JVLVBPUJ.js +0 -6180
  62. package/dist/chunk-JY3KC67R.js +0 -6504
  63. package/dist/chunk-KUFBCBNJ.js +0 -6815
  64. package/dist/chunk-KV7KDJ43.js +0 -7639
  65. package/dist/chunk-L5IJZV5F.js +0 -6822
  66. package/dist/chunk-MFFPQLU4.js +0 -7102
  67. package/dist/chunk-MJS2YKNR.js +0 -6397
  68. package/dist/chunk-MN6LCZHZ.js +0 -1320
  69. package/dist/chunk-NBAUZ7X2.js +0 -1336
  70. package/dist/chunk-NDBW6ELQ.js +0 -7638
  71. package/dist/chunk-O2HBSDI2.js +0 -6175
  72. package/dist/chunk-OFFIUYMG.js +0 -6341
  73. package/dist/chunk-OVCQGF2J.js +0 -1321
  74. package/dist/chunk-P4S7ZY6G.js +0 -7638
  75. package/dist/chunk-PBHUHSC3.js +0 -6002
  76. package/dist/chunk-PC4LR4ZI.js +0 -6359
  77. package/dist/chunk-PMTGGZ7R.js +0 -6397
  78. package/dist/chunk-PTXSB3UV.js +0 -497
  79. package/dist/chunk-PYUCY3U6.js +0 -1340
  80. package/dist/chunk-RDZDSOAL.js +0 -7750
  81. package/dist/chunk-RLW2OI2L.js +0 -6383
  82. package/dist/chunk-RUGHHO4K.js +0 -6395
  83. package/dist/chunk-SIOQVM2E.js +0 -6819
  84. package/dist/chunk-SR67SRIT.js +0 -1336
  85. package/dist/chunk-SSRXIO2V.js +0 -6822
  86. package/dist/chunk-SWSEKFON.js +0 -6487
  87. package/dist/chunk-TBG76CYG.js +0 -6395
  88. package/dist/chunk-V3CBINLD.js +0 -6812
  89. package/dist/chunk-VPYSLEGM.js +0 -6710
  90. package/dist/chunk-VY3BLXBW.js +0 -329
  91. package/dist/chunk-WTFOGVJQ.js +0 -6365
  92. package/dist/chunk-X64SFUT5.js +0 -6099
  93. package/dist/chunk-XIBF5LBD.js +0 -6395
  94. package/dist/chunk-Y5VDMSYC.js +0 -6701
  95. package/dist/chunk-YUBL36H4.js +0 -6605
  96. package/dist/chunk-YWVXFVSW.js +0 -6456
  97. package/dist/chunk-ZXZACOLD.js +0 -6822
  98. package/dist/db-IWIL65EX.js +0 -33
  99. package/dist/gridCompositor-ENKLFPWR.js +0 -409
  100. package/dist/playwright-A3OGSDRG.js +0 -38
  101. package/dist/playwright-ATDC4NYW.js +0 -38
  102. package/dist/playwright-E6EUFIJG.js +0 -38
  103. package/dist/server-2DXLKLFM.js +0 -13
  104. package/dist/server-2ICEWJVK.js +0 -13
  105. package/dist/server-2MQV3FNY.js +0 -13
  106. package/dist/server-2NGD7GE3.js +0 -13
  107. package/dist/server-2VKO76UK.js +0 -14
  108. package/dist/server-3BK2VFU7.js +0 -13
  109. package/dist/server-4LDOB3NX.js +0 -13
  110. package/dist/server-4YI44KDR.js +0 -13
  111. package/dist/server-64XMXA5P.js +0 -13
  112. package/dist/server-6IPHVUYT.js +0 -14
  113. package/dist/server-73ORHMJN.js +0 -13
  114. package/dist/server-73P7M3QB.js +0 -14
  115. package/dist/server-BPVRW5LJ.js +0 -14
  116. package/dist/server-BW4RKZIX.js +0 -13
  117. package/dist/server-CFS5SM5K.js +0 -13
  118. package/dist/server-DX7VYHHM.js +0 -13
  119. package/dist/server-F3YPX6ET.js +0 -13
  120. package/dist/server-FUXTR33I.js +0 -13
  121. package/dist/server-G2SY3DOS.js +0 -13
  122. package/dist/server-G32U7VOQ.js +0 -13
  123. package/dist/server-IOOZK4NP.js +0 -14
  124. package/dist/server-J52LMTBT.js +0 -13
  125. package/dist/server-JG7UKFGK.js +0 -14
  126. package/dist/server-JSCHEBOD.js +0 -13
  127. package/dist/server-K6KC4ZOM.js +0 -13
  128. package/dist/server-KJVRGWFE.js +0 -13
  129. package/dist/server-LCPB2L4U.js +0 -13
  130. package/dist/server-M7LDYKAJ.js +0 -13
  131. package/dist/server-MKVK6ZQQ.js +0 -13
  132. package/dist/server-MU52LCXT.js +0 -13
  133. package/dist/server-NM5CKDUU.js +0 -13
  134. package/dist/server-NPZN3FWO.js +0 -14
  135. package/dist/server-O5FIAHSY.js +0 -14
  136. package/dist/server-OESJUEYC.js +0 -13
  137. package/dist/server-ONSKQO4W.js +0 -13
  138. package/dist/server-P27BZXBL.js +0 -14
  139. package/dist/server-Q4FBWQUA.js +0 -13
  140. package/dist/server-RNQ7VUAL.js +0 -13
  141. package/dist/server-S6B5WUBT.js +0 -14
  142. package/dist/server-SRYNSGSP.js +0 -14
  143. package/dist/server-SUN3W2YK.js +0 -13
  144. package/dist/server-UA62LHZB.js +0 -13
  145. package/dist/server-UJB44EW5.js +0 -13
  146. package/dist/server-X3TLP6DX.js +0 -14
  147. package/dist/server-YT2UGEZK.js +0 -13
  148. package/dist/server-ZBPQ33V6.js +0 -14
  149. package/dist/setup-AQX4JQVR.js +0 -17
  150. package/dist/setup-EQTU7FI6.js +0 -17
  151. package/dist/tools-2KPB37GK.js +0 -178
  152. package/dist/tools-3H6IOWXV.js +0 -178
  153. package/dist/tools-3KYHPDCJ.js +0 -178
  154. package/dist/tools-75BAPCUM.js +0 -177
  155. package/dist/tools-BUVCUCRL.js +0 -178
  156. package/dist/tools-HDNODRS6.js +0 -178
  157. package/dist/tools-HP5MNY3D.js +0 -177
  158. package/dist/tools-N5N2IO7V.js +0 -178
  159. package/dist/tools-NFJEZ2FF.js +0 -177
  160. package/dist/tools-TLCKABUW.js +0 -178
@@ -1,33 +0,0 @@
1
- import {
2
- DATA_DIR,
3
- DB_PATH,
4
- EXPORTS_DIR,
5
- FRAMES_DIR,
6
- PROJECTS_DIR,
7
- closeDatabase,
8
- exportDestinations,
9
- exportRules,
10
- frames,
11
- getDatabase,
12
- getSqlite,
13
- projectExports,
14
- projects,
15
- settings
16
- } from "./chunk-VY3BLXBW.js";
17
- import "./chunk-MLKGABMK.js";
18
- export {
19
- DATA_DIR,
20
- DB_PATH,
21
- EXPORTS_DIR,
22
- FRAMES_DIR,
23
- PROJECTS_DIR,
24
- closeDatabase,
25
- exportDestinations,
26
- exportRules,
27
- frames,
28
- getDatabase,
29
- getSqlite,
30
- projectExports,
31
- projects,
32
- settings
33
- };
@@ -1,409 +0,0 @@
1
- import "./chunk-MLKGABMK.js";
2
-
3
- // src/core/canvas/gridCompositor.ts
4
- import { createCanvas, loadImage } from "canvas";
5
- import { existsSync, writeFileSync, mkdirSync, readdirSync } from "fs";
6
- import { join } from "path";
7
- var ASPECT_RATIOS = {
8
- "9:16": { width: 1080, height: 1920 },
9
- "1:1": { width: 1080, height: 1080 },
10
- "16:9": { width: 1920, height: 1080 }
11
- };
12
- var DEFAULT_CONFIG = {
13
- aspectRatio: "9:16",
14
- layout: "quad",
15
- background: {
16
- type: "gradient",
17
- gradientStart: "#1a1a2e",
18
- gradientEnd: "#16213e",
19
- gradientAngle: 135
20
- },
21
- padding: 40,
22
- cellPadding: 16,
23
- cornerRadius: 16,
24
- shadowEnabled: true,
25
- shadowBlur: 20,
26
- outputWidth: 1080,
27
- imageFit: "cover"
28
- };
29
- function calculateCells(layout, canvasWidth, canvasHeight, padding, cellPadding, imageCount) {
30
- const contentWidth = canvasWidth - padding * 2;
31
- const contentHeight = canvasHeight - padding * 2;
32
- const cells = [];
33
- switch (layout) {
34
- case "single": {
35
- cells.push({
36
- x: padding,
37
- y: padding,
38
- width: contentWidth,
39
- height: contentHeight
40
- });
41
- break;
42
- }
43
- case "duo-h": {
44
- const cellWidth = (contentWidth - cellPadding) / 2;
45
- cells.push(
46
- { x: padding, y: padding, width: cellWidth, height: contentHeight },
47
- { x: padding + cellWidth + cellPadding, y: padding, width: cellWidth, height: contentHeight }
48
- );
49
- break;
50
- }
51
- case "duo-v": {
52
- const cellHeight = (contentHeight - cellPadding) / 2;
53
- cells.push(
54
- { x: padding, y: padding, width: contentWidth, height: cellHeight },
55
- { x: padding, y: padding + cellHeight + cellPadding, width: contentWidth, height: cellHeight }
56
- );
57
- break;
58
- }
59
- case "trio-h": {
60
- const cellWidth = (contentWidth - cellPadding * 2) / 3;
61
- for (let i = 0; i < 3; i++) {
62
- cells.push({
63
- x: padding + i * (cellWidth + cellPadding),
64
- y: padding,
65
- width: cellWidth,
66
- height: contentHeight
67
- });
68
- }
69
- break;
70
- }
71
- case "trio-v": {
72
- const cellHeight = (contentHeight - cellPadding * 2) / 3;
73
- for (let i = 0; i < 3; i++) {
74
- cells.push({
75
- x: padding,
76
- y: padding + i * (cellHeight + cellPadding),
77
- width: contentWidth,
78
- height: cellHeight
79
- });
80
- }
81
- break;
82
- }
83
- case "quad": {
84
- const cellWidth = (contentWidth - cellPadding) / 2;
85
- const cellHeight = (contentHeight - cellPadding) / 2;
86
- for (let row = 0; row < 2; row++) {
87
- for (let col = 0; col < 2; col++) {
88
- cells.push({
89
- x: padding + col * (cellWidth + cellPadding),
90
- y: padding + row * (cellHeight + cellPadding),
91
- width: cellWidth,
92
- height: cellHeight
93
- });
94
- }
95
- }
96
- break;
97
- }
98
- case "featured": {
99
- const leftWidth = contentWidth * 0.6 - cellPadding / 2;
100
- const rightWidth = contentWidth * 0.4 - cellPadding / 2;
101
- const rightHeight = (contentHeight - cellPadding) / 2;
102
- cells.push(
103
- { x: padding, y: padding, width: leftWidth, height: contentHeight },
104
- { x: padding + leftWidth + cellPadding, y: padding, width: rightWidth, height: rightHeight },
105
- { x: padding + leftWidth + cellPadding, y: padding + rightHeight + cellPadding, width: rightWidth, height: rightHeight }
106
- );
107
- break;
108
- }
109
- case "masonry": {
110
- const colWidth = (contentWidth - cellPadding * 2) / 3;
111
- const heights = [0, 0, 0];
112
- const count = Math.min(imageCount, 6);
113
- for (let i = 0; i < count; i++) {
114
- const col = i % 3;
115
- const cellHeight = i < 3 ? contentHeight * 0.55 : contentHeight * 0.45 - cellPadding;
116
- cells.push({
117
- x: padding + col * (colWidth + cellPadding),
118
- y: padding + heights[col],
119
- width: colWidth,
120
- height: cellHeight
121
- });
122
- heights[col] += cellHeight + cellPadding;
123
- }
124
- break;
125
- }
126
- case "carousel": {
127
- const cardWidth = contentWidth * 0.7;
128
- const cardHeight = contentHeight * 0.85;
129
- const overlap = cardWidth * 0.3;
130
- const count = Math.min(imageCount, 3);
131
- for (let i = 0; i < count; i++) {
132
- const scale = 1 - i * 0.05;
133
- const w = cardWidth * scale;
134
- const h = cardHeight * scale;
135
- cells.push({
136
- x: padding + (contentWidth - w) / 2 + (i - 1) * overlap,
137
- y: padding + (contentHeight - h) / 2 + i * 10,
138
- width: w,
139
- height: h
140
- });
141
- }
142
- break;
143
- }
144
- case "stacked": {
145
- const cardWidth = contentWidth * 0.8;
146
- const cardHeight = contentHeight * 0.7;
147
- const count = Math.min(imageCount, 4);
148
- const offsetY = 30;
149
- const offsetX = 15;
150
- for (let i = count - 1; i >= 0; i--) {
151
- cells.push({
152
- x: padding + (contentWidth - cardWidth) / 2 + i * offsetX,
153
- y: padding + (contentHeight - cardHeight) / 2 - i * offsetY,
154
- width: cardWidth,
155
- height: cardHeight
156
- });
157
- }
158
- break;
159
- }
160
- default:
161
- cells.push({
162
- x: padding,
163
- y: padding,
164
- width: contentWidth,
165
- height: contentHeight
166
- });
167
- }
168
- return cells;
169
- }
170
- function drawRoundedRect(ctx, x, y, width, height, radius) {
171
- ctx.beginPath();
172
- ctx.moveTo(x + radius, y);
173
- ctx.lineTo(x + width - radius, y);
174
- ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
175
- ctx.lineTo(x + width, y + height - radius);
176
- ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
177
- ctx.lineTo(x + radius, y + height);
178
- ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
179
- ctx.lineTo(x, y + radius);
180
- ctx.quadraticCurveTo(x, y, x + radius, y);
181
- ctx.closePath();
182
- }
183
- function drawBackground(ctx, width, height, config, bgImage) {
184
- if (config.type === "image" && bgImage) {
185
- const scale = Math.max(width / bgImage.width, height / bgImage.height);
186
- const scaledWidth = bgImage.width * scale;
187
- const scaledHeight = bgImage.height * scale;
188
- const offsetX = (width - scaledWidth) / 2;
189
- const offsetY = (height - scaledHeight) / 2;
190
- ctx.drawImage(bgImage, offsetX, offsetY, scaledWidth, scaledHeight);
191
- } else if (config.type === "gradient") {
192
- const angle = (config.gradientAngle || 135) * Math.PI / 180;
193
- const length = Math.sqrt(width * width + height * height);
194
- const x1 = width / 2 - Math.cos(angle) * length / 2;
195
- const y1 = height / 2 - Math.sin(angle) * length / 2;
196
- const x2 = width / 2 + Math.cos(angle) * length / 2;
197
- const y2 = height / 2 + Math.sin(angle) * length / 2;
198
- const gradient = ctx.createLinearGradient(x1, y1, x2, y2);
199
- gradient.addColorStop(0, config.gradientStart || "#1a1a2e");
200
- gradient.addColorStop(1, config.gradientEnd || "#16213e");
201
- ctx.fillStyle = gradient;
202
- ctx.fillRect(0, 0, width, height);
203
- } else {
204
- ctx.fillStyle = config.color || "#1a1a2e";
205
- ctx.fillRect(0, 0, width, height);
206
- }
207
- }
208
- function drawShadow(ctx, x, y, width, height, radius, blur) {
209
- ctx.save();
210
- ctx.shadowColor = "rgba(0, 0, 0, 0.4)";
211
- ctx.shadowBlur = blur;
212
- ctx.shadowOffsetX = 0;
213
- ctx.shadowOffsetY = blur / 3;
214
- ctx.fillStyle = "white";
215
- drawRoundedRect(ctx, x, y, width, height, radius);
216
- ctx.fill();
217
- ctx.restore();
218
- }
219
- function calculateImageBounds(image, cell, imageFit) {
220
- const imageAspect = image.width / image.height;
221
- const cellAspect = cell.width / cell.height;
222
- let drawWidth;
223
- let drawHeight;
224
- let offsetX;
225
- let offsetY;
226
- if (imageFit === "cover") {
227
- if (imageAspect > cellAspect) {
228
- drawHeight = cell.height;
229
- drawWidth = cell.height * imageAspect;
230
- offsetX = (cell.width - drawWidth) / 2;
231
- offsetY = 0;
232
- } else {
233
- drawWidth = cell.width;
234
- drawHeight = cell.width / imageAspect;
235
- offsetX = 0;
236
- offsetY = (cell.height - drawHeight) / 2;
237
- }
238
- return {
239
- x: cell.x,
240
- y: cell.y,
241
- width: cell.width,
242
- height: cell.height,
243
- drawWidth,
244
- drawHeight,
245
- offsetX,
246
- offsetY
247
- };
248
- } else {
249
- if (imageAspect > cellAspect) {
250
- drawWidth = cell.width;
251
- drawHeight = cell.width / imageAspect;
252
- offsetX = 0;
253
- offsetY = (cell.height - drawHeight) / 2;
254
- } else {
255
- drawHeight = cell.height;
256
- drawWidth = cell.height * imageAspect;
257
- offsetX = (cell.width - drawWidth) / 2;
258
- offsetY = 0;
259
- }
260
- return {
261
- x: cell.x + offsetX,
262
- y: cell.y + offsetY,
263
- width: drawWidth,
264
- height: drawHeight,
265
- drawWidth,
266
- drawHeight,
267
- offsetX,
268
- offsetY
269
- };
270
- }
271
- }
272
- function drawImageInCell(ctx, image, cell, cornerRadius, imageFit = "cover", shadowEnabled = false, shadowBlur = 20) {
273
- const bounds = calculateImageBounds(image, cell, imageFit);
274
- if (shadowEnabled && imageFit === "contain") {
275
- drawShadow(ctx, bounds.x, bounds.y, bounds.width, bounds.height, cornerRadius, shadowBlur);
276
- }
277
- ctx.save();
278
- if (imageFit === "cover") {
279
- drawRoundedRect(ctx, cell.x, cell.y, cell.width, cell.height, cornerRadius);
280
- } else {
281
- drawRoundedRect(ctx, bounds.x, bounds.y, bounds.width, bounds.height, cornerRadius);
282
- }
283
- ctx.clip();
284
- ctx.drawImage(
285
- image,
286
- cell.x + bounds.offsetX,
287
- cell.y + bounds.offsetY,
288
- bounds.drawWidth,
289
- bounds.drawHeight
290
- );
291
- ctx.restore();
292
- }
293
- async function composeGrid(images, config = {}, outputPath) {
294
- try {
295
- const cfg = { ...DEFAULT_CONFIG, ...config };
296
- const aspectDef = ASPECT_RATIOS[cfg.aspectRatio];
297
- const scale = cfg.outputWidth / aspectDef.width;
298
- const canvasWidth = Math.round(aspectDef.width * scale);
299
- const canvasHeight = Math.round(aspectDef.height * scale);
300
- const canvas = createCanvas(canvasWidth, canvasHeight);
301
- const ctx = canvas.getContext("2d");
302
- let bgImage;
303
- if (cfg.background.type === "image" && cfg.background.imagePath && existsSync(cfg.background.imagePath)) {
304
- bgImage = await loadImage(cfg.background.imagePath);
305
- }
306
- drawBackground(ctx, canvasWidth, canvasHeight, cfg.background, bgImage);
307
- const cells = calculateCells(
308
- cfg.layout,
309
- canvasWidth,
310
- canvasHeight,
311
- cfg.padding,
312
- cfg.cellPadding,
313
- images.length
314
- );
315
- for (let i = 0; i < Math.min(images.length, cells.length); i++) {
316
- const cell = cells[i];
317
- const imageCell = images[i];
318
- if (!existsSync(imageCell.imagePath)) {
319
- continue;
320
- }
321
- const image = await loadImage(imageCell.imagePath);
322
- if (cfg.shadowEnabled && cfg.imageFit === "cover") {
323
- drawShadow(ctx, cell.x, cell.y, cell.width, cell.height, cfg.cornerRadius, cfg.shadowBlur);
324
- }
325
- drawImageInCell(ctx, image, cell, cfg.cornerRadius, cfg.imageFit, cfg.shadowEnabled, cfg.shadowBlur);
326
- }
327
- const buffer = canvas.toBuffer("image/png");
328
- const outputDir = outputPath.substring(0, outputPath.lastIndexOf("/"));
329
- if (outputDir && !existsSync(outputDir)) {
330
- mkdirSync(outputDir, { recursive: true });
331
- }
332
- writeFileSync(outputPath, buffer);
333
- return {
334
- success: true,
335
- outputPath,
336
- width: canvasWidth,
337
- height: canvasHeight
338
- };
339
- } catch (error) {
340
- const message = error instanceof Error ? error.message : "Grid composition failed";
341
- return {
342
- success: false,
343
- error: message
344
- };
345
- }
346
- }
347
- function recommendLayout(imageCount, aspectRatio) {
348
- if (imageCount === 1) return "single";
349
- if (imageCount === 2) return aspectRatio === "16:9" ? "duo-h" : "duo-v";
350
- if (imageCount === 3) return aspectRatio === "9:16" ? "trio-v" : "featured";
351
- if (imageCount === 4) return "quad";
352
- if (imageCount >= 5) return "masonry";
353
- return "quad";
354
- }
355
- function getLayoutInfo(layout) {
356
- const layouts = {
357
- "single": { name: "Single", maxImages: 1, description: "One large image" },
358
- "duo-h": { name: "Side by Side", maxImages: 2, description: "Two images horizontally" },
359
- "duo-v": { name: "Stacked", maxImages: 2, description: "Two images vertically" },
360
- "trio-h": { name: "3 Across", maxImages: 3, description: "Three images in a row" },
361
- "trio-v": { name: "3 Down", maxImages: 3, description: "Three images in a column" },
362
- "quad": { name: "Grid 2x2", maxImages: 4, description: "Four images in a grid" },
363
- "featured": { name: "Featured", maxImages: 3, description: "One large + two small" },
364
- "masonry": { name: "Masonry", maxImages: 6, description: "Pinterest-style columns" },
365
- "carousel": { name: "Carousel", maxImages: 3, description: "Overlapping cards" },
366
- "stacked": { name: "3D Stack", maxImages: 4, description: "Perspective stack effect" }
367
- };
368
- return layouts[layout];
369
- }
370
- function getAllLayouts() {
371
- return ["single", "duo-h", "duo-v", "trio-h", "trio-v", "quad", "featured", "masonry", "carousel", "stacked"];
372
- }
373
- function getAvailableBackgrounds(backgroundsDir) {
374
- if (!existsSync(backgroundsDir)) {
375
- return [];
376
- }
377
- const files = readdirSync(backgroundsDir).filter((f) => /\.(jpg|jpeg|png|webp)$/i.test(f));
378
- return files.map((f) => ({
379
- id: f.replace(/\.[^.]+$/, ""),
380
- name: f.replace(/[-_]/g, " ").replace(/\.[^.]+$/, ""),
381
- path: join(backgroundsDir, f)
382
- }));
383
- }
384
- var PRESET_GRADIENTS = [
385
- { id: "dark-blue", name: "Dark Blue", start: "#1a1a2e", end: "#16213e" },
386
- { id: "midnight", name: "Midnight", start: "#0f0c29", end: "#302b63" },
387
- { id: "ocean", name: "Ocean", start: "#2193b0", end: "#6dd5ed" },
388
- { id: "sunset", name: "Sunset", start: "#ff7e5f", end: "#feb47b" },
389
- { id: "aurora", name: "Aurora", start: "#00c6ff", end: "#0072ff" },
390
- { id: "forest", name: "Forest", start: "#134e5e", end: "#71b280" },
391
- { id: "berry", name: "Berry", start: "#8e2de2", end: "#4a00e0" },
392
- { id: "noir", name: "Noir", start: "#0a0a0a", end: "#1a1a1a" }
393
- ];
394
- var PRESET_SOLID_COLORS = [
395
- { id: "black", name: "Black", color: "#000000" },
396
- { id: "dark-gray", name: "Dark Gray", color: "#1a1a1a" },
397
- { id: "navy", name: "Navy", color: "#0a1628" },
398
- { id: "charcoal", name: "Charcoal", color: "#2d2d2d" },
399
- { id: "white", name: "White", color: "#ffffff" }
400
- ];
401
- export {
402
- PRESET_GRADIENTS,
403
- PRESET_SOLID_COLORS,
404
- composeGrid,
405
- getAllLayouts,
406
- getAvailableBackgrounds,
407
- getLayoutInfo,
408
- recommendLayout
409
- };
@@ -1,38 +0,0 @@
1
- import {
2
- BrowserDevices,
3
- PlaywrightActions,
4
- createFormSubmissionScript,
5
- createLoginScript,
6
- createNavigationScript,
7
- generatePlaywrightScript,
8
- getBrowserDevice,
9
- getPlaywrightVersion,
10
- installPlaywrightBrowsers,
11
- isPlaywrightInstalled,
12
- listBrowserDevices,
13
- runPlaywrightScript,
14
- runPlaywrightTest,
15
- savePlaywrightScript,
16
- showPlaywrightReport,
17
- startPlaywrightCodegen
18
- } from "./chunk-PTXSB3UV.js";
19
- import "./chunk-VY3BLXBW.js";
20
- import "./chunk-MLKGABMK.js";
21
- export {
22
- BrowserDevices,
23
- PlaywrightActions,
24
- createFormSubmissionScript,
25
- createLoginScript,
26
- createNavigationScript,
27
- generatePlaywrightScript,
28
- getBrowserDevice,
29
- getPlaywrightVersion,
30
- installPlaywrightBrowsers,
31
- isPlaywrightInstalled,
32
- listBrowserDevices,
33
- runPlaywrightScript,
34
- runPlaywrightTest,
35
- savePlaywrightScript,
36
- showPlaywrightReport,
37
- startPlaywrightCodegen
38
- };
@@ -1,38 +0,0 @@
1
- import {
2
- BrowserDevices,
3
- PlaywrightActions,
4
- createFormSubmissionScript,
5
- createLoginScript,
6
- createNavigationScript,
7
- generatePlaywrightScript,
8
- getBrowserDevice,
9
- getPlaywrightVersion,
10
- installPlaywrightBrowsers,
11
- isPlaywrightInstalled,
12
- listBrowserDevices,
13
- runPlaywrightScript,
14
- runPlaywrightTest,
15
- savePlaywrightScript,
16
- showPlaywrightReport,
17
- startPlaywrightCodegen
18
- } from "./chunk-43U6UYV7.js";
19
- import "./chunk-TJ3H23LL.js";
20
- import "./chunk-MLKGABMK.js";
21
- export {
22
- BrowserDevices,
23
- PlaywrightActions,
24
- createFormSubmissionScript,
25
- createLoginScript,
26
- createNavigationScript,
27
- generatePlaywrightScript,
28
- getBrowserDevice,
29
- getPlaywrightVersion,
30
- installPlaywrightBrowsers,
31
- isPlaywrightInstalled,
32
- listBrowserDevices,
33
- runPlaywrightScript,
34
- runPlaywrightTest,
35
- savePlaywrightScript,
36
- showPlaywrightReport,
37
- startPlaywrightCodegen
38
- };
@@ -1,38 +0,0 @@
1
- import {
2
- BrowserDevices,
3
- PlaywrightActions,
4
- createFormSubmissionScript,
5
- createLoginScript,
6
- createNavigationScript,
7
- generatePlaywrightScript,
8
- getBrowserDevice,
9
- getPlaywrightVersion,
10
- installPlaywrightBrowsers,
11
- isPlaywrightInstalled,
12
- listBrowserDevices,
13
- runPlaywrightScript,
14
- runPlaywrightTest,
15
- savePlaywrightScript,
16
- showPlaywrightReport,
17
- startPlaywrightCodegen
18
- } from "./chunk-2OGZX6C4.js";
19
- import "./chunk-TJ3H23LL.js";
20
- import "./chunk-MLKGABMK.js";
21
- export {
22
- BrowserDevices,
23
- PlaywrightActions,
24
- createFormSubmissionScript,
25
- createLoginScript,
26
- createNavigationScript,
27
- generatePlaywrightScript,
28
- getBrowserDevice,
29
- getPlaywrightVersion,
30
- installPlaywrightBrowsers,
31
- isPlaywrightInstalled,
32
- listBrowserDevices,
33
- runPlaywrightScript,
34
- runPlaywrightTest,
35
- savePlaywrightScript,
36
- showPlaywrightReport,
37
- startPlaywrightCodegen
38
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-JFTBF4JR.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-WTFOGVJQ.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-PC4LR4ZI.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-YWVXFVSW.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,14 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-KV7KDJ43.js";
6
- import "./chunk-SR67SRIT.js";
7
- import "./chunk-43U6UYV7.js";
8
- import "./chunk-TJ3H23LL.js";
9
- import "./chunk-MLKGABMK.js";
10
- export {
11
- app,
12
- startServer,
13
- stopServer
14
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-HZGSWVVS.js";
6
- import "./chunk-NBAUZ7X2.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-JY3KC67R.js";
6
- import "./chunk-NBAUZ7X2.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-OFFIUYMG.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };
@@ -1,13 +0,0 @@
1
- import {
2
- app,
3
- startServer,
4
- stopServer
5
- } from "./chunk-RLW2OI2L.js";
6
- import "./chunk-MN6LCZHZ.js";
7
- import "./chunk-VY3BLXBW.js";
8
- import "./chunk-MLKGABMK.js";
9
- export {
10
- app,
11
- startServer,
12
- stopServer
13
- };