@webmate-studio/builder 0.2.108 → 0.2.110

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.108",
3
+ "version": "0.2.110",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -995,6 +995,7 @@ body {
995
995
  display: inline-flex;
996
996
  align-items: center;
997
997
  justify-content: center;
998
+ text-align: center;
998
999
  font-weight: 500;
999
1000
  border-width: 1px;
1000
1001
  border-style: solid;
@@ -1600,6 +1601,7 @@ export function generateCSSFromTokens(tokens) {
1600
1601
  lines.push(' display: inline-flex;');
1601
1602
  lines.push(' align-items: center;');
1602
1603
  lines.push(' justify-content: center;');
1604
+ lines.push(' text-align: center;');
1603
1605
  lines.push(' font-weight: 500;');
1604
1606
  lines.push(' border-style: solid;');
1605
1607
  lines.push(' transition: all 0.15s ease-in-out;');
@@ -299,8 +299,9 @@ class TemplateProcessor {
299
299
  loopContext[arrayName] = arrayValue;
300
300
  itemHtml = this.processClassConditionals(itemHtml, loopContext);
301
301
 
302
- // First: Replace attribute expressions with quoted values (e.g., alt={item.image.alt} → alt="value")
303
- itemHtml = itemHtml.replace(new RegExp(`(\\w+)=\\{\\s*${loopVar}\\.([a-zA-Z0-9_.]+)\\s*\\}`, 'g'), (m, attrName, path) => {
302
+ // First: Replace attribute expressions with quoted values (e.g., alt={item.image.alt} or alt="{item.image.alt}" → alt="value")
303
+ // Pattern matches both: attr={expr} and attr="{expr}"
304
+ itemHtml = itemHtml.replace(new RegExp(`(\\w+)=["']?\\{\\s*${loopVar}\\.([a-zA-Z0-9_.]+)\\s*\\}["']?`, 'g'), (m, attrName, path) => {
304
305
  // Navigate through nested path (e.g., "image.src")
305
306
  const pathParts = path.split('.');
306
307
  let value = item;
@@ -312,8 +313,13 @@ class TemplateProcessor {
312
313
  value = value[part];
313
314
  }
314
315
 
316
+ // Handle link objects (from LinkField) - extract path for preview/production
317
+ if (typeof value === 'object' && value !== null && value.type === 'page' && value.pageUuid) {
318
+ // In preview mode: use /preview/{pageUuid}
319
+ value = `/preview/${value.pageUuid}`;
320
+ }
315
321
  // Handle image objects - extract URL
316
- if (typeof value === 'object' && value !== null && (value.src || value.filename)) {
322
+ else if (typeof value === 'object' && value !== null && (value.src || value.filename)) {
317
323
  value = value.src || value.filename || '';
318
324
  }
319
325
 
@@ -343,6 +349,11 @@ class TemplateProcessor {
343
349
  value = value[part];
344
350
  }
345
351
 
352
+ // Handle link objects (from LinkField) - extract path for preview
353
+ if (typeof value === 'object' && value !== null && value.type === 'page' && value.pageUuid) {
354
+ return `/preview/${value.pageUuid}`;
355
+ }
356
+
346
357
  // Handle image objects - extract URL
347
358
  if (typeof value === 'object' && value !== null && (value.src || value.filename)) {
348
359
  return value.src || value.filename || '';
@@ -412,6 +423,10 @@ class TemplateProcessor {
412
423
  if (result === undefined || result === null) {
413
424
  return '';
414
425
  }
426
+ // Handle link objects (from LinkField) - extract path for preview
427
+ if (typeof result === 'object' && result !== null && result.type === 'page' && result.pageUuid) {
428
+ return `/preview/${result.pageUuid}`;
429
+ }
415
430
  // Handle image objects
416
431
  if (typeof result === 'object' && result !== null && (result.src || result.filename)) {
417
432
  return result.src || result.filename || '';