@orion-studios/payload-studio 0.6.0-beta.156 → 0.6.0-beta.157

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.
@@ -1412,6 +1412,27 @@ var decorateBuilderNumericSteppers = (root = document) => {
1412
1412
  input.addEventListener(
1413
1413
  "keydown",
1414
1414
  (event) => {
1415
+ if (property.startsWith("padding-")) {
1416
+ const selectionStart2 = input.selectionStart ?? 0;
1417
+ const selectionEnd2 = input.selectionEnd ?? selectionStart2;
1418
+ const value2 = input.value || "";
1419
+ const isReplacingAll = selectionStart2 === 0 && selectionEnd2 === value2.length;
1420
+ const isNegativeEntry = value2.startsWith("-") || event.key === "-";
1421
+ if (isNegativeEntry && event.key.length === 1 && /^[-.\d]$/.test(event.key)) {
1422
+ event.preventDefault();
1423
+ event.stopImmediatePropagation();
1424
+ const inserted = event.key === "-" ? "-" : event.key;
1425
+ const rawValue = value2.startsWith("-") && event.key === "-" && selectionStart2 === 0 && selectionEnd2 <= 1 ? value2.slice(1) : isReplacingAll ? inserted : `${value2.slice(0, selectionStart2)}${inserted}${value2.slice(selectionEnd2)}`;
1426
+ const nextValue2 = rawValue.replace(/(?!^)-/g, "").replace(/^(-?[^.]*\.).*\./, "$1");
1427
+ input.value = nextValue2;
1428
+ const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
1429
+ input.setSelectionRange(nextCursor2, nextCursor2);
1430
+ return;
1431
+ }
1432
+ if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
1433
+ return;
1434
+ }
1435
+ }
1415
1436
  if (event.key !== "-" || event.metaKey || event.ctrlKey || event.altKey) {
1416
1437
  return;
1417
1438
  }
@@ -1288,6 +1288,27 @@ var decorateBuilderNumericSteppers = (root = document) => {
1288
1288
  input.addEventListener(
1289
1289
  "keydown",
1290
1290
  (event) => {
1291
+ if (property.startsWith("padding-")) {
1292
+ const selectionStart2 = input.selectionStart ?? 0;
1293
+ const selectionEnd2 = input.selectionEnd ?? selectionStart2;
1294
+ const value2 = input.value || "";
1295
+ const isReplacingAll = selectionStart2 === 0 && selectionEnd2 === value2.length;
1296
+ const isNegativeEntry = value2.startsWith("-") || event.key === "-";
1297
+ if (isNegativeEntry && event.key.length === 1 && /^[-.\d]$/.test(event.key)) {
1298
+ event.preventDefault();
1299
+ event.stopImmediatePropagation();
1300
+ const inserted = event.key === "-" ? "-" : event.key;
1301
+ const rawValue = value2.startsWith("-") && event.key === "-" && selectionStart2 === 0 && selectionEnd2 <= 1 ? value2.slice(1) : isReplacingAll ? inserted : `${value2.slice(0, selectionStart2)}${inserted}${value2.slice(selectionEnd2)}`;
1302
+ const nextValue2 = rawValue.replace(/(?!^)-/g, "").replace(/^(-?[^.]*\.).*\./, "$1");
1303
+ input.value = nextValue2;
1304
+ const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
1305
+ input.setSelectionRange(nextCursor2, nextCursor2);
1306
+ return;
1307
+ }
1308
+ if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
1309
+ return;
1310
+ }
1311
+ }
1291
1312
  if (event.key !== "-" || event.metaKey || event.ctrlKey || event.altKey) {
1292
1313
  return;
1293
1314
  }
package/dist/index.mjs CHANGED
@@ -10,12 +10,12 @@ import {
10
10
  } from "./chunk-JQAHXYAM.mjs";
11
11
  import {
12
12
  studio_pages_exports
13
- } from "./chunk-276KAPGM.mjs";
13
+ } from "./chunk-7HME6R2V.mjs";
14
14
  import "./chunk-7ZMXZRBP.mjs";
15
- import "./chunk-OQSEJXC4.mjs";
16
15
  import {
17
16
  studio_exports
18
17
  } from "./chunk-ADIIWIYL.mjs";
18
+ import "./chunk-OQSEJXC4.mjs";
19
19
  import {
20
20
  admin_app_exports
21
21
  } from "./chunk-RKTIFEUY.mjs";
@@ -7,15 +7,15 @@ import {
7
7
  pageStudioModuleManifest,
8
8
  resolveBuilderThemeTokens,
9
9
  toEditorInitialDoc
10
- } from "../chunk-276KAPGM.mjs";
10
+ } from "../chunk-7HME6R2V.mjs";
11
11
  import {
12
12
  createDefaultStudioDocument,
13
13
  defaultBuilderThemeTokens,
14
14
  layoutToStudioDocument,
15
15
  studioDocumentToLayout
16
16
  } from "../chunk-7ZMXZRBP.mjs";
17
- import "../chunk-OQSEJXC4.mjs";
18
17
  import "../chunk-ADIIWIYL.mjs";
18
+ import "../chunk-OQSEJXC4.mjs";
19
19
  import "../chunk-6BWS3CLP.mjs";
20
20
  export {
21
21
  createDefaultStudioDocument,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.156",
3
+ "version": "0.6.0-beta.157",
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",
@@ -5,15 +5,15 @@ import {
5
5
  migrateBlockToSettingsV2,
6
6
  studioDocumentToLayout
7
7
  } from "./chunk-7ZMXZRBP.mjs";
8
- import {
9
- sectionStyleDefaults
10
- } from "./chunk-OQSEJXC4.mjs";
11
8
  import {
12
9
  assertStudioDocumentV1,
13
10
  compileStudioDocument,
14
11
  createEmptyStudioDocument,
15
12
  validateStudioDocument
16
13
  } from "./chunk-ADIIWIYL.mjs";
14
+ import {
15
+ sectionStyleDefaults
16
+ } from "./chunk-OQSEJXC4.mjs";
17
17
  import {
18
18
  __export
19
19
  } from "./chunk-6BWS3CLP.mjs";