@webmate-studio/builder 0.2.176 → 0.2.178

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.176",
3
+ "version": "0.2.178",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -1164,10 +1164,28 @@ function generateSpacingStyles(t) {
1164
1164
  css += '\n margin-top: var(--spacing-component);';
1165
1165
  css += '\n}';
1166
1166
 
1167
- // Spacing-Modi
1168
- css += '\n[data-spacing="none"] { margin-top: 0 !important; }';
1169
- css += '\n[data-spacing="half"] { margin-top: calc(var(--spacing-component) / 2) !important; }';
1170
- css += '\n[data-spacing="double"] { margin-top: calc(var(--spacing-component) * 2) !important; }';
1167
+ // Spacing presets (factor × design-system spacing)
1168
+ const factors = [
1169
+ { attr: 'none', factor: '0' },
1170
+ { attr: '0.25', factor: '0.25' },
1171
+ { attr: '0.5', factor: '0.5' },
1172
+ { attr: '0.75', factor: '0.75' },
1173
+ // 'standard' = no attribute, uses default margin-top
1174
+ { attr: '1.25', factor: '1.25' },
1175
+ { attr: '1.5', factor: '1.5' },
1176
+ { attr: '1.75', factor: '1.75' },
1177
+ { attr: '2', factor: '2' },
1178
+ // Legacy aliases
1179
+ { attr: 'half', factor: '0.5' },
1180
+ { attr: 'double', factor: '2' }
1181
+ ];
1182
+ for (const { attr, factor } of factors) {
1183
+ if (factor === '0') {
1184
+ css += `\n[data-spacing="${attr}"] { margin-top: 0 !important; }`;
1185
+ } else {
1186
+ css += `\n[data-spacing="${attr}"] { margin-top: calc(var(--spacing-component) * ${factor}) !important; }`;
1187
+ }
1188
+ }
1171
1189
 
1172
1190
  // Responsive Overrides
1173
1191
  for (const [bp, minWidth] of Object.entries(breakpoints)) {
@@ -321,6 +321,12 @@ class TemplateEvaluator {
321
321
  return value.path || `/preview/${value.pageUuid}`;
322
322
  }
323
323
 
324
+ // Document objects (from DocumentSelect) — extract URL
325
+ // Must be checked before images because documents also have `filename`
326
+ if (value.url && value.mimeType) {
327
+ return value.url;
328
+ }
329
+
324
330
  // Image objects — extract URL
325
331
  if (value.src || value.filename) {
326
332
  return value.src || value.filename || '';
@@ -349,6 +355,11 @@ class TemplateEvaluator {
349
355
  return value.path || `/preview/${value.pageUuid}`;
350
356
  }
351
357
 
358
+ // Document objects (from DocumentSelect) — extract URL
359
+ if (value.url && value.mimeType) {
360
+ return value.url;
361
+ }
362
+
352
363
  // Image objects
353
364
  if (value.src || value.filename) {
354
365
  return value.src || value.filename || '';