@orion-studios/payload-studio 0.6.0-beta.111 → 0.6.0-beta.113

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.
@@ -1361,6 +1361,40 @@ var canvasSelectionCss = `
1361
1361
  [data-gjs-highlightable].gjs-hovered {
1362
1362
  outline-color: #c7643d !important;
1363
1363
  }
1364
+
1365
+ .xo-builder-preview-grid {
1366
+ display: grid;
1367
+ gap: 22px;
1368
+ grid-template-columns: 1fr;
1369
+ }
1370
+
1371
+ .xo-builder-preview-grid.is-catalog,
1372
+ .xo-builder-preview-grid.is-contact,
1373
+ .xo-builder-preview-grid.is-stacked-image-cards {
1374
+ grid-template-columns: 1fr;
1375
+ }
1376
+
1377
+ @media (min-width: 768px) {
1378
+ .xo-builder-preview-grid,
1379
+ .xo-builder-preview-grid.is-image-tiles,
1380
+ .xo-builder-preview-grid.is-stacked-image-cards {
1381
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1382
+ }
1383
+
1384
+ .xo-builder-preview-grid.is-catalog {
1385
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1386
+ }
1387
+
1388
+ .xo-builder-preview-grid.is-contact {
1389
+ grid-template-columns: 1fr;
1390
+ }
1391
+ }
1392
+
1393
+ @media (min-width: 1280px) {
1394
+ .xo-builder-preview-grid.is-catalog {
1395
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1396
+ }
1397
+ }
1364
1398
  `;
1365
1399
  var isQuickHorizontalAlign = (value) => value === "center" || value === "left" || value === "right";
1366
1400
  var isQuickVerticalAlign = (value) => value === "bottom" || value === "middle" || value === "top";
@@ -1477,6 +1511,37 @@ var readStylePanelColor = (property) => {
1477
1511
  return swatchColor;
1478
1512
  };
1479
1513
  var readStylePanelRadio = (property) => (readStylePanelValue(property)?.querySelector("input:checked")?.value || "").trim();
1514
+ var writeStylePanelLength = (property, value) => {
1515
+ const control = readStylePanelValue(property);
1516
+ const input = control?.querySelector("input");
1517
+ if (!input) {
1518
+ return;
1519
+ }
1520
+ const match = value.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);
1521
+ if (!match) {
1522
+ return;
1523
+ }
1524
+ const [, amount, unit = "px"] = match;
1525
+ const unitSelect = control?.querySelector("select");
1526
+ input.value = amount;
1527
+ if (unitSelect) {
1528
+ unitSelect.value = unit || "px";
1529
+ }
1530
+ };
1531
+ var spacingProperties = [
1532
+ "margin-top",
1533
+ "margin-bottom",
1534
+ "margin-left",
1535
+ "margin-right",
1536
+ "padding-top",
1537
+ "padding-bottom",
1538
+ "padding-left",
1539
+ "padding-right"
1540
+ ];
1541
+ var spacingTargetForComponent = (component) => {
1542
+ const element = component?.getEl?.();
1543
+ return element?.querySelector?.(".xo-builder-preview") || element || null;
1544
+ };
1480
1545
  var hasExplicitHorizontalAlign = (block) => {
1481
1546
  const settings = readNestedRecord(block, "settings");
1482
1547
  const typography = readNestedRecord(settings, "typography");
@@ -2230,6 +2295,16 @@ function GrapesPageEditor({
2230
2295
  hydrateSelectedTypographyStyleFromOrionBlock(component);
2231
2296
  rememberComponentSnapshot(component);
2232
2297
  refreshSelectedState(component);
2298
+ window.requestAnimationFrame(() => {
2299
+ const element = spacingTargetForComponent(component);
2300
+ if (!element) {
2301
+ return;
2302
+ }
2303
+ const computed = window.getComputedStyle(element);
2304
+ spacingProperties.forEach((property) => {
2305
+ writeStylePanelLength(property, computed.getPropertyValue(property));
2306
+ });
2307
+ });
2233
2308
  };
2234
2309
  const applyQuickLayout = (layout) => {
2235
2310
  const nextStyle = quickLayoutStyles[layout];
@@ -1237,6 +1237,40 @@ var canvasSelectionCss = `
1237
1237
  [data-gjs-highlightable].gjs-hovered {
1238
1238
  outline-color: #c7643d !important;
1239
1239
  }
1240
+
1241
+ .xo-builder-preview-grid {
1242
+ display: grid;
1243
+ gap: 22px;
1244
+ grid-template-columns: 1fr;
1245
+ }
1246
+
1247
+ .xo-builder-preview-grid.is-catalog,
1248
+ .xo-builder-preview-grid.is-contact,
1249
+ .xo-builder-preview-grid.is-stacked-image-cards {
1250
+ grid-template-columns: 1fr;
1251
+ }
1252
+
1253
+ @media (min-width: 768px) {
1254
+ .xo-builder-preview-grid,
1255
+ .xo-builder-preview-grid.is-image-tiles,
1256
+ .xo-builder-preview-grid.is-stacked-image-cards {
1257
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1258
+ }
1259
+
1260
+ .xo-builder-preview-grid.is-catalog {
1261
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1262
+ }
1263
+
1264
+ .xo-builder-preview-grid.is-contact {
1265
+ grid-template-columns: 1fr;
1266
+ }
1267
+ }
1268
+
1269
+ @media (min-width: 1280px) {
1270
+ .xo-builder-preview-grid.is-catalog {
1271
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1272
+ }
1273
+ }
1240
1274
  `;
1241
1275
  var isQuickHorizontalAlign = (value) => value === "center" || value === "left" || value === "right";
1242
1276
  var isQuickVerticalAlign = (value) => value === "bottom" || value === "middle" || value === "top";
@@ -1353,6 +1387,37 @@ var readStylePanelColor = (property) => {
1353
1387
  return swatchColor;
1354
1388
  };
1355
1389
  var readStylePanelRadio = (property) => (readStylePanelValue(property)?.querySelector("input:checked")?.value || "").trim();
1390
+ var writeStylePanelLength = (property, value) => {
1391
+ const control = readStylePanelValue(property);
1392
+ const input = control?.querySelector("input");
1393
+ if (!input) {
1394
+ return;
1395
+ }
1396
+ const match = value.trim().match(/^(-?\d*\.?\d+)([a-z%]*)$/i);
1397
+ if (!match) {
1398
+ return;
1399
+ }
1400
+ const [, amount, unit = "px"] = match;
1401
+ const unitSelect = control?.querySelector("select");
1402
+ input.value = amount;
1403
+ if (unitSelect) {
1404
+ unitSelect.value = unit || "px";
1405
+ }
1406
+ };
1407
+ var spacingProperties = [
1408
+ "margin-top",
1409
+ "margin-bottom",
1410
+ "margin-left",
1411
+ "margin-right",
1412
+ "padding-top",
1413
+ "padding-bottom",
1414
+ "padding-left",
1415
+ "padding-right"
1416
+ ];
1417
+ var spacingTargetForComponent = (component) => {
1418
+ const element = component?.getEl?.();
1419
+ return element?.querySelector?.(".xo-builder-preview") || element || null;
1420
+ };
1356
1421
  var hasExplicitHorizontalAlign = (block) => {
1357
1422
  const settings = readNestedRecord(block, "settings");
1358
1423
  const typography = readNestedRecord(settings, "typography");
@@ -2106,6 +2171,16 @@ function GrapesPageEditor({
2106
2171
  hydrateSelectedTypographyStyleFromOrionBlock(component);
2107
2172
  rememberComponentSnapshot(component);
2108
2173
  refreshSelectedState(component);
2174
+ window.requestAnimationFrame(() => {
2175
+ const element = spacingTargetForComponent(component);
2176
+ if (!element) {
2177
+ return;
2178
+ }
2179
+ const computed = window.getComputedStyle(element);
2180
+ spacingProperties.forEach((property) => {
2181
+ writeStylePanelLength(property, computed.getPropertyValue(property));
2182
+ });
2183
+ });
2109
2184
  };
2110
2185
  const applyQuickLayout = (layout) => {
2111
2186
  const nextStyle = quickLayoutStyles[layout];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.111",
3
+ "version": "0.6.0-beta.113",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",