meno-core 1.1.7 → 1.1.8
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/dist/bin/cli.js +1 -1
- package/dist/chunks/{chunk-XTKNX4FW.js → chunk-AMNAKQAI.js} +25 -11
- package/dist/chunks/{chunk-XTKNX4FW.js.map → chunk-AMNAKQAI.js.map} +2 -2
- package/dist/chunks/{chunk-YMBUSHII.js → chunk-CG3O7H5V.js} +9 -4
- package/dist/chunks/chunk-CG3O7H5V.js.map +7 -0
- package/dist/chunks/{chunk-4ZRU52J2.js → chunk-EJ6QOX7C.js} +14 -10
- package/dist/chunks/chunk-EJ6QOX7C.js.map +7 -0
- package/dist/chunks/{chunk-KX2LPIZZ.js → chunk-EKB7GGQK.js} +223 -38
- package/dist/chunks/chunk-EKB7GGQK.js.map +7 -0
- package/dist/chunks/{chunk-WOJS25K3.js → chunk-G6OXV2IV.js} +2 -2
- package/dist/lib/client/index.js +9 -5
- package/dist/lib/client/index.js.map +2 -2
- package/dist/lib/server/index.js +14 -5
- package/dist/lib/server/index.js.map +2 -2
- package/dist/lib/shared/index.js +18 -6
- package/dist/lib/shared/index.js.map +2 -2
- package/lib/client/core/ComponentBuilder.test.ts +40 -0
- package/lib/client/core/ComponentBuilder.ts +8 -1
- package/lib/server/routes/static.test.ts +67 -0
- package/lib/server/routes/static.ts +9 -1
- package/lib/server/ssr/htmlGenerator.ts +7 -0
- package/lib/server/ssr/ssrRenderer.test.ts +31 -0
- package/lib/server/ssr/ssrRenderer.ts +8 -1
- package/lib/shared/cssGeneration.test.ts +150 -9
- package/lib/shared/cssGeneration.ts +116 -31
- package/lib/shared/cssProperties.ts +40 -14
- package/lib/shared/i18n.test.ts +21 -0
- package/lib/shared/i18n.ts +24 -10
- package/lib/shared/nodeUtils.test.ts +22 -0
- package/lib/shared/nodeUtils.ts +39 -4
- package/lib/shared/permissions.test.ts +46 -6
- package/lib/shared/permissions.ts +14 -2
- package/lib/shared/pxToRem.ts +2 -0
- package/lib/shared/responsiveScaling.test.ts +19 -0
- package/lib/shared/responsiveScaling.ts +8 -3
- package/lib/shared/styleUtils.ts +53 -0
- package/lib/shared/tailwindThemeScale.ts +91 -0
- package/lib/shared/types/components.ts +45 -7
- package/lib/shared/types/index.ts +1 -0
- package/lib/shared/types/permissions.ts +27 -11
- package/lib/shared/utilityClassMapper.test.ts +105 -0
- package/lib/shared/utilityClassMapper.ts +43 -5
- package/lib/shared/utilityClassNames.ts +14 -1
- package/lib/shared/validation/propValidator.test.ts +47 -0
- package/lib/shared/validation/propValidator.ts +8 -0
- package/lib/shared/validation/schemas.test.ts +149 -16
- package/lib/shared/validation/schemas.ts +101 -5
- package/package.json +1 -1
- package/dist/chunks/chunk-4ZRU52J2.js.map +0 -7
- package/dist/chunks/chunk-KX2LPIZZ.js.map +0 -7
- package/dist/chunks/chunk-YMBUSHII.js.map +0 -7
- /package/dist/chunks/{chunk-WOJS25K3.js.map → chunk-G6OXV2IV.js.map} +0 -0
package/dist/lib/shared/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
COMMENT_STATUSES,
|
|
4
4
|
CONFIG_AREAS,
|
|
5
5
|
CURRENT_PERMISSIONS_VERSION,
|
|
6
|
+
LEGACY_CONFIG_AREA_ALIASES,
|
|
6
7
|
PERMISSION_ROLES,
|
|
7
8
|
PathTraversalError,
|
|
8
9
|
RESOURCE_KINDS,
|
|
@@ -51,7 +52,7 @@ import {
|
|
|
51
52
|
setLogSink,
|
|
52
53
|
slugify,
|
|
53
54
|
translatePath
|
|
54
|
-
} from "../../chunks/chunk-
|
|
55
|
+
} from "../../chunks/chunk-CG3O7H5V.js";
|
|
55
56
|
import {
|
|
56
57
|
NETLIFY_LOCALE_404_BEGIN,
|
|
57
58
|
NETLIFY_LOCALE_404_END,
|
|
@@ -73,7 +74,7 @@ import {
|
|
|
73
74
|
getPropertyValues,
|
|
74
75
|
isVisualModeProperty,
|
|
75
76
|
isVisualModeRowVisible
|
|
76
|
-
} from "../../chunks/chunk-
|
|
77
|
+
} from "../../chunks/chunk-AMNAKQAI.js";
|
|
77
78
|
import {
|
|
78
79
|
BaseComponentRegistry,
|
|
79
80
|
BaseNodeTypeRegistry,
|
|
@@ -247,6 +248,7 @@ import {
|
|
|
247
248
|
pathToLegacyString,
|
|
248
249
|
pathToString,
|
|
249
250
|
pathsEqual,
|
|
251
|
+
physicalizeBoxSpacing,
|
|
250
252
|
presetClassReverse,
|
|
251
253
|
processItemPropsTemplate,
|
|
252
254
|
processItemTemplate,
|
|
@@ -256,6 +258,7 @@ import {
|
|
|
256
258
|
registerStyleValue,
|
|
257
259
|
resetGlobalTemplateContext,
|
|
258
260
|
resolveExtractedMappings,
|
|
261
|
+
resolveIfI18n,
|
|
259
262
|
resolveItemsTemplate,
|
|
260
263
|
resolvePropsFromDefinition,
|
|
261
264
|
resolveTemplateRawValue,
|
|
@@ -297,7 +300,7 @@ import {
|
|
|
297
300
|
validatePath,
|
|
298
301
|
validatePropDefinition,
|
|
299
302
|
validateStructuredComponentDefinition
|
|
300
|
-
} from "../../chunks/chunk-
|
|
303
|
+
} from "../../chunks/chunk-EKB7GGQK.js";
|
|
301
304
|
import {
|
|
302
305
|
DEFAULT_I18N_CONFIG,
|
|
303
306
|
buildLocalizedPath,
|
|
@@ -314,7 +317,7 @@ import {
|
|
|
314
317
|
resolveI18nValue,
|
|
315
318
|
resolveTranslation,
|
|
316
319
|
setStoredLocale
|
|
317
|
-
} from "../../chunks/chunk-
|
|
320
|
+
} from "../../chunks/chunk-EJ6QOX7C.js";
|
|
318
321
|
import {
|
|
319
322
|
RICH_TEXT_ALLOWED_ATTRS,
|
|
320
323
|
RICH_TEXT_ALLOWED_TAGS,
|
|
@@ -907,6 +910,9 @@ function grantRole(grant) {
|
|
|
907
910
|
if (grant.role) return grant.role;
|
|
908
911
|
return grant.allow ? "editor" : "viewer";
|
|
909
912
|
}
|
|
913
|
+
function normalizeConfigArea(area) {
|
|
914
|
+
return LEGACY_CONFIG_AREA_ALIASES[area] ?? area;
|
|
915
|
+
}
|
|
910
916
|
function mergeAllow(grants) {
|
|
911
917
|
const merged = emptyAllow();
|
|
912
918
|
for (const grant of grants) {
|
|
@@ -914,7 +920,8 @@ function mergeAllow(grants) {
|
|
|
914
920
|
if (!allow) continue;
|
|
915
921
|
for (const kind of Object.keys(merged)) {
|
|
916
922
|
const patterns = allow[kind];
|
|
917
|
-
if (patterns)
|
|
923
|
+
if (!patterns) continue;
|
|
924
|
+
merged[kind].push(...kind === "config" ? patterns.map(normalizeConfigArea) : patterns);
|
|
918
925
|
}
|
|
919
926
|
}
|
|
920
927
|
for (const kind of Object.keys(merged)) {
|
|
@@ -971,7 +978,8 @@ function resolvePermissions(policy, identity) {
|
|
|
971
978
|
function canEdit(resolved, ref) {
|
|
972
979
|
if (resolved.isAdmin) return true;
|
|
973
980
|
if (resolved.role === "viewer") return false;
|
|
974
|
-
|
|
981
|
+
const id = ref.kind === "config" ? normalizeConfigArea(ref.id) : ref.id;
|
|
982
|
+
return matchesAnyPermissionPattern(resolved.allow[RULE_KEY[ref.kind]], id);
|
|
975
983
|
}
|
|
976
984
|
|
|
977
985
|
// lib/shared/utils.ts
|
|
@@ -1657,6 +1665,7 @@ export {
|
|
|
1657
1665
|
InteractiveStyleRuleSchema,
|
|
1658
1666
|
InteractiveStylesSchema,
|
|
1659
1667
|
InvalidPathError,
|
|
1668
|
+
LEGACY_CONFIG_AREA_ALIASES,
|
|
1660
1669
|
LIGHT_PROPS_PANEL_COLORS,
|
|
1661
1670
|
LinkNodeType,
|
|
1662
1671
|
LocaleListNodeType,
|
|
@@ -1916,6 +1925,7 @@ export {
|
|
|
1916
1925
|
normalizeBreakpointConfig,
|
|
1917
1926
|
normalizeBreakpointVariant,
|
|
1918
1927
|
normalizeChildrenArray,
|
|
1928
|
+
normalizeConfigArea,
|
|
1919
1929
|
normalizePath,
|
|
1920
1930
|
normalizePathInput,
|
|
1921
1931
|
normalizeStyle,
|
|
@@ -1932,6 +1942,7 @@ export {
|
|
|
1932
1942
|
pathToLegacyString,
|
|
1933
1943
|
pathToString,
|
|
1934
1944
|
pathsEqual,
|
|
1945
|
+
physicalizeBoxSpacing,
|
|
1935
1946
|
presetClassReverse,
|
|
1936
1947
|
processItemPropsTemplate,
|
|
1937
1948
|
processItemTemplate,
|
|
@@ -1945,6 +1956,7 @@ export {
|
|
|
1945
1956
|
resolveExtractedMappings,
|
|
1946
1957
|
resolveI18nInProps,
|
|
1947
1958
|
resolveI18nValue,
|
|
1959
|
+
resolveIfI18n,
|
|
1948
1960
|
resolveItemsTemplate,
|
|
1949
1961
|
resolvePaletteColor,
|
|
1950
1962
|
resolvePermissions,
|