@orion-studios/payload-studio 0.6.0-beta.157 → 0.6.0-beta.158
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.
|
@@ -1402,9 +1402,10 @@ var decorateBuilderNumericSteppers = (root = document) => {
|
|
|
1402
1402
|
if (property.startsWith("padding-")) {
|
|
1403
1403
|
const keepNegativePaddingValue = (event) => {
|
|
1404
1404
|
if (!input.value.trim().startsWith("-")) {
|
|
1405
|
+
delete input.dataset.orionRawValue;
|
|
1405
1406
|
return;
|
|
1406
1407
|
}
|
|
1407
|
-
|
|
1408
|
+
input.dataset.orionRawValue = input.value.trim();
|
|
1408
1409
|
};
|
|
1409
1410
|
input.addEventListener("input", keepNegativePaddingValue, true);
|
|
1410
1411
|
input.addEventListener("change", keepNegativePaddingValue, true);
|
|
@@ -1425,8 +1426,10 @@ var decorateBuilderNumericSteppers = (root = document) => {
|
|
|
1425
1426
|
const rawValue = value2.startsWith("-") && event.key === "-" && selectionStart2 === 0 && selectionEnd2 <= 1 ? value2.slice(1) : isReplacingAll ? inserted : `${value2.slice(0, selectionStart2)}${inserted}${value2.slice(selectionEnd2)}`;
|
|
1426
1427
|
const nextValue2 = rawValue.replace(/(?!^)-/g, "").replace(/^(-?[^.]*\.).*\./, "$1");
|
|
1427
1428
|
input.value = nextValue2;
|
|
1429
|
+
input.dataset.orionRawValue = nextValue2;
|
|
1428
1430
|
const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
|
|
1429
1431
|
input.setSelectionRange(nextCursor2, nextCursor2);
|
|
1432
|
+
input.dispatchEvent(new InputEvent("input", { bubbles: true, inputType: "insertText" }));
|
|
1430
1433
|
return;
|
|
1431
1434
|
}
|
|
1432
1435
|
if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
|
|
@@ -1903,7 +1906,8 @@ var readStylePanelValue = (property) => {
|
|
|
1903
1906
|
};
|
|
1904
1907
|
var readStylePanelLength = (property) => {
|
|
1905
1908
|
const control = readStylePanelValue(property);
|
|
1906
|
-
const
|
|
1909
|
+
const input = control?.querySelector("input");
|
|
1910
|
+
const value = (input?.dataset.orionRawValue || input?.value || "").trim();
|
|
1907
1911
|
const unit = control?.querySelector("select")?.value.trim() || "";
|
|
1908
1912
|
if (!value) {
|
|
1909
1913
|
return "";
|
|
@@ -1925,6 +1929,7 @@ var readStylePanelColor = (property) => {
|
|
|
1925
1929
|
return swatchColor;
|
|
1926
1930
|
};
|
|
1927
1931
|
var readStylePanelRadio = (property) => (readStylePanelValue(property)?.querySelector("input:checked")?.value || "").trim();
|
|
1932
|
+
var negativePaddingMarginProperty = (property) => property === "padding-top" ? "margin-top" : property === "padding-right" ? "margin-right" : property === "padding-bottom" ? "margin-bottom" : property === "padding-left" ? "margin-left" : "";
|
|
1928
1933
|
var propertyNameFromStyleControl = (element) => {
|
|
1929
1934
|
const property = element?.closest(".gjs-sm-property");
|
|
1930
1935
|
const className = Array.from(property?.classList || []).find((name) => name.startsWith("gjs-sm-property__"));
|
|
@@ -2540,7 +2545,10 @@ function GrapesPageEditor({
|
|
|
2540
2545
|
const value = property === "font-weight" ? normalizeFontWeightValue(readStylePanelSelect(property)) || readStylePanelInput(property) : property === "opacity" ? readStylePanelInput(property) : readStylePanelLength(property) || readStylePanelInput(property) || readStylePanelSelect(property) || readStylePanelRadio(property);
|
|
2541
2546
|
selectedComponentRef.current = selected;
|
|
2542
2547
|
lastSelectedComponentRef.current = selected;
|
|
2543
|
-
|
|
2548
|
+
const negativePaddingMargin = value.startsWith("-") ? negativePaddingMarginProperty(property) : "";
|
|
2549
|
+
selected.addStyle?.(
|
|
2550
|
+
negativePaddingMargin ? { [property]: "0px", [negativePaddingMargin]: value } : { [property]: value }
|
|
2551
|
+
);
|
|
2544
2552
|
editorRef.current?.select?.(selected);
|
|
2545
2553
|
};
|
|
2546
2554
|
const updateSelectedOrionBlock = (updates) => {
|
|
@@ -1278,9 +1278,10 @@ var decorateBuilderNumericSteppers = (root = document) => {
|
|
|
1278
1278
|
if (property.startsWith("padding-")) {
|
|
1279
1279
|
const keepNegativePaddingValue = (event) => {
|
|
1280
1280
|
if (!input.value.trim().startsWith("-")) {
|
|
1281
|
+
delete input.dataset.orionRawValue;
|
|
1281
1282
|
return;
|
|
1282
1283
|
}
|
|
1283
|
-
|
|
1284
|
+
input.dataset.orionRawValue = input.value.trim();
|
|
1284
1285
|
};
|
|
1285
1286
|
input.addEventListener("input", keepNegativePaddingValue, true);
|
|
1286
1287
|
input.addEventListener("change", keepNegativePaddingValue, true);
|
|
@@ -1301,8 +1302,10 @@ var decorateBuilderNumericSteppers = (root = document) => {
|
|
|
1301
1302
|
const rawValue = value2.startsWith("-") && event.key === "-" && selectionStart2 === 0 && selectionEnd2 <= 1 ? value2.slice(1) : isReplacingAll ? inserted : `${value2.slice(0, selectionStart2)}${inserted}${value2.slice(selectionEnd2)}`;
|
|
1302
1303
|
const nextValue2 = rawValue.replace(/(?!^)-/g, "").replace(/^(-?[^.]*\.).*\./, "$1");
|
|
1303
1304
|
input.value = nextValue2;
|
|
1305
|
+
input.dataset.orionRawValue = nextValue2;
|
|
1304
1306
|
const nextCursor2 = Math.min((isReplacingAll ? 0 : selectionStart2) + inserted.length, nextValue2.length);
|
|
1305
1307
|
input.setSelectionRange(nextCursor2, nextCursor2);
|
|
1308
|
+
input.dispatchEvent(new InputEvent("input", { bubbles: true, inputType: "insertText" }));
|
|
1306
1309
|
return;
|
|
1307
1310
|
}
|
|
1308
1311
|
if (value2.startsWith("-") && (event.key === "Backspace" || event.key === "Delete")) {
|
|
@@ -1779,7 +1782,8 @@ var readStylePanelValue = (property) => {
|
|
|
1779
1782
|
};
|
|
1780
1783
|
var readStylePanelLength = (property) => {
|
|
1781
1784
|
const control = readStylePanelValue(property);
|
|
1782
|
-
const
|
|
1785
|
+
const input = control?.querySelector("input");
|
|
1786
|
+
const value = (input?.dataset.orionRawValue || input?.value || "").trim();
|
|
1783
1787
|
const unit = control?.querySelector("select")?.value.trim() || "";
|
|
1784
1788
|
if (!value) {
|
|
1785
1789
|
return "";
|
|
@@ -1801,6 +1805,7 @@ var readStylePanelColor = (property) => {
|
|
|
1801
1805
|
return swatchColor;
|
|
1802
1806
|
};
|
|
1803
1807
|
var readStylePanelRadio = (property) => (readStylePanelValue(property)?.querySelector("input:checked")?.value || "").trim();
|
|
1808
|
+
var negativePaddingMarginProperty = (property) => property === "padding-top" ? "margin-top" : property === "padding-right" ? "margin-right" : property === "padding-bottom" ? "margin-bottom" : property === "padding-left" ? "margin-left" : "";
|
|
1804
1809
|
var propertyNameFromStyleControl = (element) => {
|
|
1805
1810
|
const property = element?.closest(".gjs-sm-property");
|
|
1806
1811
|
const className = Array.from(property?.classList || []).find((name) => name.startsWith("gjs-sm-property__"));
|
|
@@ -2416,7 +2421,10 @@ function GrapesPageEditor({
|
|
|
2416
2421
|
const value = property === "font-weight" ? normalizeFontWeightValue(readStylePanelSelect(property)) || readStylePanelInput(property) : property === "opacity" ? readStylePanelInput(property) : readStylePanelLength(property) || readStylePanelInput(property) || readStylePanelSelect(property) || readStylePanelRadio(property);
|
|
2417
2422
|
selectedComponentRef.current = selected;
|
|
2418
2423
|
lastSelectedComponentRef.current = selected;
|
|
2419
|
-
|
|
2424
|
+
const negativePaddingMargin = value.startsWith("-") ? negativePaddingMarginProperty(property) : "";
|
|
2425
|
+
selected.addStyle?.(
|
|
2426
|
+
negativePaddingMargin ? { [property]: "0px", [negativePaddingMargin]: value } : { [property]: value }
|
|
2427
|
+
);
|
|
2420
2428
|
editorRef.current?.select?.(selected);
|
|
2421
2429
|
};
|
|
2422
2430
|
const updateSelectedOrionBlock = (updates) => {
|
package/dist/index.mjs
CHANGED
|
@@ -8,18 +8,18 @@ import "./chunk-ZTXJG4K5.mjs";
|
|
|
8
8
|
import {
|
|
9
9
|
blocks_exports
|
|
10
10
|
} from "./chunk-JQAHXYAM.mjs";
|
|
11
|
+
import {
|
|
12
|
+
admin_app_exports
|
|
13
|
+
} from "./chunk-RKTIFEUY.mjs";
|
|
14
|
+
import "./chunk-W2UOCJDX.mjs";
|
|
11
15
|
import {
|
|
12
16
|
studio_pages_exports
|
|
13
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-276KAPGM.mjs";
|
|
14
18
|
import "./chunk-7ZMXZRBP.mjs";
|
|
19
|
+
import "./chunk-OQSEJXC4.mjs";
|
|
15
20
|
import {
|
|
16
21
|
studio_exports
|
|
17
22
|
} from "./chunk-ADIIWIYL.mjs";
|
|
18
|
-
import "./chunk-OQSEJXC4.mjs";
|
|
19
|
-
import {
|
|
20
|
-
admin_app_exports
|
|
21
|
-
} from "./chunk-RKTIFEUY.mjs";
|
|
22
|
-
import "./chunk-W2UOCJDX.mjs";
|
|
23
23
|
import "./chunk-6BWS3CLP.mjs";
|
|
24
24
|
export {
|
|
25
25
|
admin_exports as admin,
|
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
pageStudioModuleManifest,
|
|
8
8
|
resolveBuilderThemeTokens,
|
|
9
9
|
toEditorInitialDoc
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-276KAPGM.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-ADIIWIYL.mjs";
|
|
18
17
|
import "../chunk-OQSEJXC4.mjs";
|
|
18
|
+
import "../chunk-ADIIWIYL.mjs";
|
|
19
19
|
import "../chunk-6BWS3CLP.mjs";
|
|
20
20
|
export {
|
|
21
21
|
createDefaultStudioDocument,
|
package/package.json
CHANGED
|
@@ -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";
|
|
8
11
|
import {
|
|
9
12
|
assertStudioDocumentV1,
|
|
10
13
|
compileStudioDocument,
|
|
11
14
|
createEmptyStudioDocument,
|
|
12
15
|
validateStudioDocument
|
|
13
16
|
} 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";
|