@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 +1 -1
- package/src/design-tokens-v2-css.js +22 -4
- package/src/template-evaluator.js +11 -0
package/package.json
CHANGED
|
@@ -1164,10 +1164,28 @@ function generateSpacingStyles(t) {
|
|
|
1164
1164
|
css += '\n margin-top: var(--spacing-component);';
|
|
1165
1165
|
css += '\n}';
|
|
1166
1166
|
|
|
1167
|
-
// Spacing-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
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 || '';
|