@elementor/editor-props 4.1.0-824 → 4.1.0-825
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/index.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +37 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +8 -1
- package/src/utils/is-overridable.ts +26 -0
- package/src/utils/prop-dependency-utils.ts +34 -6
package/dist/index.d.mts
CHANGED
|
@@ -7017,6 +7017,14 @@ declare const filterEmptyValues: <TValue extends PropValue>(value: TValue) => TV
|
|
|
7017
7017
|
type Nullish = null | undefined | '';
|
|
7018
7018
|
declare const isEmpty: (value: PropValue) => value is Nullish;
|
|
7019
7019
|
|
|
7020
|
+
type OverridableInner = {
|
|
7021
|
+
override_key: string;
|
|
7022
|
+
origin_value: TransformablePropValue$1<string>;
|
|
7023
|
+
};
|
|
7024
|
+
type OverridableTransformable = TransformablePropValue$1<'overridable', OverridableInner>;
|
|
7025
|
+
declare function isOverridable(value: unknown): value is OverridableTransformable;
|
|
7026
|
+
declare function rewrapOverridableValue(existing: OverridableTransformable, newInner: TransformablePropValue$1<string>): OverridableTransformable;
|
|
7027
|
+
|
|
7020
7028
|
declare const transformableSchema: z.ZodObject<{
|
|
7021
7029
|
$$type: z.ZodString;
|
|
7022
7030
|
value: z.ZodAny;
|
|
@@ -7042,7 +7050,10 @@ declare function isDependencyMet(dependency: Dependency | undefined, values: Pro
|
|
|
7042
7050
|
failingDependencies: (DependencyTerm | Dependency)[];
|
|
7043
7051
|
};
|
|
7044
7052
|
declare function evaluateTerm(term: DependencyTerm, actualValue: unknown): boolean;
|
|
7045
|
-
|
|
7053
|
+
type ExtractValueOptions = {
|
|
7054
|
+
unwrapOverridableLeaf?: boolean;
|
|
7055
|
+
};
|
|
7056
|
+
declare function extractValue(path: string[], elementValues: PropValue, nestedPath?: string[], options?: ExtractValueOptions): TransformablePropValue$1<string>;
|
|
7046
7057
|
declare function isDependency(term: DependencyTerm | Dependency): term is Dependency;
|
|
7047
7058
|
|
|
7048
7059
|
interface ParseResult {
|
|
@@ -7076,4 +7087,4 @@ declare const Schema: {
|
|
|
7076
7087
|
removeIntention: typeof removeIntention;
|
|
7077
7088
|
};
|
|
7078
7089
|
|
|
7079
|
-
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackdropFilterItemPropValue, type BackdropFilterPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ChildElement, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DateRangePropValue, type DateStringPropValue, DateTimePropTypeUtil, type DateTimePropValue, type Dependency, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type DropShadowFilterPropValue, type EmailPropValue, type FilterItemPropValue, type FilterPropValue, type FlexPropValue, type GradientColorStopPropValue, type HtmlPropValue, type HtmlV2PropValue, type HtmlV2Value, type HtmlV3PropValue, type HtmlV3Value, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type JsonSchema7, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type MoveTransformPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type ParseResult, type PerspectiveOriginPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type QueryPropValue, type RotateTransformPropValue, type ScaleTransformPropValue, Schema, type SelectionSizePropValue, type ShadowPropValue, type SizePropValue, type SkewTransformPropValue, type SpanPropValue, type StringArrayPropValue, type StringPropValue, type StrokePropValue, type SvgSrcPropValue, type TransformFunctionsItemPropValue, type TransformFunctionsPropValue, type TransformOriginPropValue, type TransformPropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, type VideoAttachmentIdPropValue, type VideoSrcPropValue, backdropFilterPropTypeUtil, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayItem, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, colorToneFilterPropTypeUtil, createArrayPropUtils, createPropUtils, cssFilterFunctionPropUtil, dateRangePropTypeUtil, dateStringPropTypeUtil, dimensionsPropTypeUtil, dropShadowFilterPropTypeUtil, emailPropTypeUtil, evaluateTerm, extractValue, filterEmptyValues, filterPropTypeUtil, flexPropTypeUtil, getPropSchemaFromCache, gradientColorStopPropTypeUtil, htmlPropTypeUtil, htmlV2PropTypeUtil, htmlV3PropTypeUtil, hueRotateFilterPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, intensityFilterPropTypeUtil, isDependency, isDependencyMet, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, moveTransformPropTypeUtil, numberPropTypeUtil, parseHtmlChildren, perspectiveOriginPropTypeUtil, positionPropTypeUtil, queryPropTypeUtil, rotateTransformPropTypeUtil, scaleTransformPropTypeUtil, selectionSizePropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, skewTransformPropTypeUtil, spanPropTypeUtil, stringArrayPropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, svgSrcPropTypeUtil, transformFunctionsPropTypeUtil, transformOriginPropTypeUtil, transformPropTypeUtil, urlPropTypeUtil, videoAttachmentIdPropType, videoSrcPropTypeUtil };
|
|
7090
|
+
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackdropFilterItemPropValue, type BackdropFilterPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ChildElement, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DateRangePropValue, type DateStringPropValue, DateTimePropTypeUtil, type DateTimePropValue, type Dependency, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type DropShadowFilterPropValue, type EmailPropValue, type ExtractValueOptions, type FilterItemPropValue, type FilterPropValue, type FlexPropValue, type GradientColorStopPropValue, type HtmlPropValue, type HtmlV2PropValue, type HtmlV2Value, type HtmlV3PropValue, type HtmlV3Value, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type JsonSchema7, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type MoveTransformPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type OverridableTransformable, type ParseResult, type PerspectiveOriginPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type QueryPropValue, type RotateTransformPropValue, type ScaleTransformPropValue, Schema, type SelectionSizePropValue, type ShadowPropValue, type SizePropValue, type SkewTransformPropValue, type SpanPropValue, type StringArrayPropValue, type StringPropValue, type StrokePropValue, type SvgSrcPropValue, type TransformFunctionsItemPropValue, type TransformFunctionsPropValue, type TransformOriginPropValue, type TransformPropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, type VideoAttachmentIdPropValue, type VideoSrcPropValue, backdropFilterPropTypeUtil, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayItem, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, colorToneFilterPropTypeUtil, createArrayPropUtils, createPropUtils, cssFilterFunctionPropUtil, dateRangePropTypeUtil, dateStringPropTypeUtil, dimensionsPropTypeUtil, dropShadowFilterPropTypeUtil, emailPropTypeUtil, evaluateTerm, extractValue, filterEmptyValues, filterPropTypeUtil, flexPropTypeUtil, getPropSchemaFromCache, gradientColorStopPropTypeUtil, htmlPropTypeUtil, htmlV2PropTypeUtil, htmlV3PropTypeUtil, hueRotateFilterPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, intensityFilterPropTypeUtil, isDependency, isDependencyMet, isEmpty, isOverridable, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, moveTransformPropTypeUtil, numberPropTypeUtil, parseHtmlChildren, perspectiveOriginPropTypeUtil, positionPropTypeUtil, queryPropTypeUtil, rewrapOverridableValue, rotateTransformPropTypeUtil, scaleTransformPropTypeUtil, selectionSizePropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, skewTransformPropTypeUtil, spanPropTypeUtil, stringArrayPropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, svgSrcPropTypeUtil, transformFunctionsPropTypeUtil, transformOriginPropTypeUtil, transformPropTypeUtil, urlPropTypeUtil, videoAttachmentIdPropType, videoSrcPropTypeUtil };
|
package/dist/index.d.ts
CHANGED
|
@@ -7017,6 +7017,14 @@ declare const filterEmptyValues: <TValue extends PropValue>(value: TValue) => TV
|
|
|
7017
7017
|
type Nullish = null | undefined | '';
|
|
7018
7018
|
declare const isEmpty: (value: PropValue) => value is Nullish;
|
|
7019
7019
|
|
|
7020
|
+
type OverridableInner = {
|
|
7021
|
+
override_key: string;
|
|
7022
|
+
origin_value: TransformablePropValue$1<string>;
|
|
7023
|
+
};
|
|
7024
|
+
type OverridableTransformable = TransformablePropValue$1<'overridable', OverridableInner>;
|
|
7025
|
+
declare function isOverridable(value: unknown): value is OverridableTransformable;
|
|
7026
|
+
declare function rewrapOverridableValue(existing: OverridableTransformable, newInner: TransformablePropValue$1<string>): OverridableTransformable;
|
|
7027
|
+
|
|
7020
7028
|
declare const transformableSchema: z.ZodObject<{
|
|
7021
7029
|
$$type: z.ZodString;
|
|
7022
7030
|
value: z.ZodAny;
|
|
@@ -7042,7 +7050,10 @@ declare function isDependencyMet(dependency: Dependency | undefined, values: Pro
|
|
|
7042
7050
|
failingDependencies: (DependencyTerm | Dependency)[];
|
|
7043
7051
|
};
|
|
7044
7052
|
declare function evaluateTerm(term: DependencyTerm, actualValue: unknown): boolean;
|
|
7045
|
-
|
|
7053
|
+
type ExtractValueOptions = {
|
|
7054
|
+
unwrapOverridableLeaf?: boolean;
|
|
7055
|
+
};
|
|
7056
|
+
declare function extractValue(path: string[], elementValues: PropValue, nestedPath?: string[], options?: ExtractValueOptions): TransformablePropValue$1<string>;
|
|
7046
7057
|
declare function isDependency(term: DependencyTerm | Dependency): term is Dependency;
|
|
7047
7058
|
|
|
7048
7059
|
interface ParseResult {
|
|
@@ -7076,4 +7087,4 @@ declare const Schema: {
|
|
|
7076
7087
|
removeIntention: typeof removeIntention;
|
|
7077
7088
|
};
|
|
7078
7089
|
|
|
7079
|
-
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackdropFilterItemPropValue, type BackdropFilterPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ChildElement, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DateRangePropValue, type DateStringPropValue, DateTimePropTypeUtil, type DateTimePropValue, type Dependency, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type DropShadowFilterPropValue, type EmailPropValue, type FilterItemPropValue, type FilterPropValue, type FlexPropValue, type GradientColorStopPropValue, type HtmlPropValue, type HtmlV2PropValue, type HtmlV2Value, type HtmlV3PropValue, type HtmlV3Value, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type JsonSchema7, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type MoveTransformPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type ParseResult, type PerspectiveOriginPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type QueryPropValue, type RotateTransformPropValue, type ScaleTransformPropValue, Schema, type SelectionSizePropValue, type ShadowPropValue, type SizePropValue, type SkewTransformPropValue, type SpanPropValue, type StringArrayPropValue, type StringPropValue, type StrokePropValue, type SvgSrcPropValue, type TransformFunctionsItemPropValue, type TransformFunctionsPropValue, type TransformOriginPropValue, type TransformPropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, type VideoAttachmentIdPropValue, type VideoSrcPropValue, backdropFilterPropTypeUtil, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayItem, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, colorToneFilterPropTypeUtil, createArrayPropUtils, createPropUtils, cssFilterFunctionPropUtil, dateRangePropTypeUtil, dateStringPropTypeUtil, dimensionsPropTypeUtil, dropShadowFilterPropTypeUtil, emailPropTypeUtil, evaluateTerm, extractValue, filterEmptyValues, filterPropTypeUtil, flexPropTypeUtil, getPropSchemaFromCache, gradientColorStopPropTypeUtil, htmlPropTypeUtil, htmlV2PropTypeUtil, htmlV3PropTypeUtil, hueRotateFilterPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, intensityFilterPropTypeUtil, isDependency, isDependencyMet, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, moveTransformPropTypeUtil, numberPropTypeUtil, parseHtmlChildren, perspectiveOriginPropTypeUtil, positionPropTypeUtil, queryPropTypeUtil, rotateTransformPropTypeUtil, scaleTransformPropTypeUtil, selectionSizePropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, skewTransformPropTypeUtil, spanPropTypeUtil, stringArrayPropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, svgSrcPropTypeUtil, transformFunctionsPropTypeUtil, transformOriginPropTypeUtil, transformPropTypeUtil, urlPropTypeUtil, videoAttachmentIdPropType, videoSrcPropTypeUtil };
|
|
7090
|
+
export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, type BackdropFilterItemPropValue, type BackdropFilterPropValue, type BackgroundColorOverlayPropValue, type BackgroundGradientOverlayPropValue, type BackgroundImageOverlayPropValue, type BackgroundImagePositionOffsetPropValue, type BackgroundImageSizeScalePropValue, type BackgroundOverlayImagePropType, type BackgroundOverlayItemPropValue, type BackgroundOverlayPropType, type BackgroundOverlayPropValue, type BackgroundPropValue, type BooleanPropValue, type BorderRadiusPropValue, type BorderWidthPropValue, type BoxShadowPropValue, CLASSES_PROP_KEY, type ChildElement, type ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DateRangePropValue, type DateStringPropValue, DateTimePropTypeUtil, type DateTimePropValue, type Dependency, type DependencyOperator, type DependencyTerm, type DimensionsPropValue, type DropShadowFilterPropValue, type EmailPropValue, type ExtractValueOptions, type FilterItemPropValue, type FilterPropValue, type FlexPropValue, type GradientColorStopPropValue, type HtmlPropValue, type HtmlV2PropValue, type HtmlV2Value, type HtmlV3PropValue, type HtmlV3Value, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type JsonSchema7, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type MoveTransformPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type OverridableTransformable, type ParseResult, type PerspectiveOriginPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type QueryPropValue, type RotateTransformPropValue, type ScaleTransformPropValue, Schema, type SelectionSizePropValue, type ShadowPropValue, type SizePropValue, type SkewTransformPropValue, type SpanPropValue, type StringArrayPropValue, type StringPropValue, type StrokePropValue, type SvgSrcPropValue, type TransformFunctionsItemPropValue, type TransformFunctionsPropValue, type TransformOriginPropValue, type TransformPropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, type VideoAttachmentIdPropValue, type VideoSrcPropValue, backdropFilterPropTypeUtil, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayItem, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, blurFilterPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, colorToneFilterPropTypeUtil, createArrayPropUtils, createPropUtils, cssFilterFunctionPropUtil, dateRangePropTypeUtil, dateStringPropTypeUtil, dimensionsPropTypeUtil, dropShadowFilterPropTypeUtil, emailPropTypeUtil, evaluateTerm, extractValue, filterEmptyValues, filterPropTypeUtil, flexPropTypeUtil, getPropSchemaFromCache, gradientColorStopPropTypeUtil, htmlPropTypeUtil, htmlV2PropTypeUtil, htmlV3PropTypeUtil, hueRotateFilterPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, intensityFilterPropTypeUtil, isDependency, isDependencyMet, isEmpty, isOverridable, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, moveTransformPropTypeUtil, numberPropTypeUtil, parseHtmlChildren, perspectiveOriginPropTypeUtil, positionPropTypeUtil, queryPropTypeUtil, rewrapOverridableValue, rotateTransformPropTypeUtil, scaleTransformPropTypeUtil, selectionSizePropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, skewTransformPropTypeUtil, spanPropTypeUtil, stringArrayPropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, svgSrcPropTypeUtil, transformFunctionsPropTypeUtil, transformOriginPropTypeUtil, transformPropTypeUtil, urlPropTypeUtil, videoAttachmentIdPropType, videoSrcPropTypeUtil };
|
package/dist/index.js
CHANGED
|
@@ -67,6 +67,7 @@ __export(index_exports, {
|
|
|
67
67
|
isDependency: () => isDependency,
|
|
68
68
|
isDependencyMet: () => isDependencyMet,
|
|
69
69
|
isEmpty: () => isEmpty,
|
|
70
|
+
isOverridable: () => isOverridable,
|
|
70
71
|
isTransformable: () => isTransformable,
|
|
71
72
|
keyValuePropTypeUtil: () => keyValuePropTypeUtil,
|
|
72
73
|
layoutDirectionPropTypeUtil: () => layoutDirectionPropTypeUtil,
|
|
@@ -78,6 +79,7 @@ __export(index_exports, {
|
|
|
78
79
|
perspectiveOriginPropTypeUtil: () => perspectiveOriginPropTypeUtil,
|
|
79
80
|
positionPropTypeUtil: () => positionPropTypeUtil,
|
|
80
81
|
queryPropTypeUtil: () => queryPropTypeUtil,
|
|
82
|
+
rewrapOverridableValue: () => rewrapOverridableValue,
|
|
81
83
|
rotateTransformPropTypeUtil: () => rotateTransformPropTypeUtil,
|
|
82
84
|
scaleTransformPropTypeUtil: () => scaleTransformPropTypeUtil,
|
|
83
85
|
selectionSizePropTypeUtil: () => selectionSizePropTypeUtil,
|
|
@@ -1186,6 +1188,20 @@ var isNullishObject = (value) => {
|
|
|
1186
1188
|
return typeof value === "object" && isNullishArray(Object.values(value));
|
|
1187
1189
|
};
|
|
1188
1190
|
|
|
1191
|
+
// src/utils/is-overridable.ts
|
|
1192
|
+
function isOverridable(value) {
|
|
1193
|
+
return isTransformable(value) && value.$$type === "overridable";
|
|
1194
|
+
}
|
|
1195
|
+
function rewrapOverridableValue(existing, newInner) {
|
|
1196
|
+
return {
|
|
1197
|
+
...existing,
|
|
1198
|
+
value: {
|
|
1199
|
+
...existing.value,
|
|
1200
|
+
origin_value: newInner
|
|
1201
|
+
}
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1189
1205
|
// src/utils/merge-props.ts
|
|
1190
1206
|
function mergeProps(current, updates) {
|
|
1191
1207
|
let props = {};
|
|
@@ -1272,17 +1288,32 @@ function getRelationMethod(relation) {
|
|
|
1272
1288
|
throw new Error(`Relation not supported ${relation}`);
|
|
1273
1289
|
}
|
|
1274
1290
|
}
|
|
1275
|
-
function extractValue(path, elementValues, nestedPath = []) {
|
|
1291
|
+
function extractValue(path, elementValues, nestedPath = [], options = {}) {
|
|
1292
|
+
const { unwrapOverridableLeaf = true } = options;
|
|
1276
1293
|
const extractedValue = path.reduce((acc, key, index) => {
|
|
1277
1294
|
const value = acc?.[key];
|
|
1278
|
-
|
|
1295
|
+
if (index === path.length - 1) {
|
|
1296
|
+
return value;
|
|
1297
|
+
}
|
|
1298
|
+
if (isOverridable(value)) {
|
|
1299
|
+
const inner = value.value.origin_value;
|
|
1300
|
+
return isTransformable(inner) ? inner.value ?? null : inner;
|
|
1301
|
+
}
|
|
1302
|
+
if (isTransformable(value)) {
|
|
1303
|
+
return value.value ?? null;
|
|
1304
|
+
}
|
|
1305
|
+
return value;
|
|
1279
1306
|
}, elementValues);
|
|
1307
|
+
let resolved = extractedValue;
|
|
1308
|
+
if (unwrapOverridableLeaf && resolved && isOverridable(resolved)) {
|
|
1309
|
+
resolved = resolved.value.origin_value ?? null;
|
|
1310
|
+
}
|
|
1280
1311
|
if (!nestedPath?.length) {
|
|
1281
|
-
return
|
|
1312
|
+
return resolved;
|
|
1282
1313
|
}
|
|
1283
1314
|
const nestedValue = nestedPath.reduce(
|
|
1284
1315
|
(acc, key) => acc?.[key],
|
|
1285
|
-
|
|
1316
|
+
resolved?.value
|
|
1286
1317
|
);
|
|
1287
1318
|
return {
|
|
1288
1319
|
$$type: "unknown",
|
|
@@ -1409,6 +1440,7 @@ var Schema = {
|
|
|
1409
1440
|
isDependency,
|
|
1410
1441
|
isDependencyMet,
|
|
1411
1442
|
isEmpty,
|
|
1443
|
+
isOverridable,
|
|
1412
1444
|
isTransformable,
|
|
1413
1445
|
keyValuePropTypeUtil,
|
|
1414
1446
|
layoutDirectionPropTypeUtil,
|
|
@@ -1420,6 +1452,7 @@ var Schema = {
|
|
|
1420
1452
|
perspectiveOriginPropTypeUtil,
|
|
1421
1453
|
positionPropTypeUtil,
|
|
1422
1454
|
queryPropTypeUtil,
|
|
1455
|
+
rewrapOverridableValue,
|
|
1423
1456
|
rotateTransformPropTypeUtil,
|
|
1424
1457
|
scaleTransformPropTypeUtil,
|
|
1425
1458
|
selectionSizePropTypeUtil,
|