@elementor/editor-props 0.13.0 → 0.14.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @elementor/editor-props
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 20d04f2: Added object position custom control
8
+
3
9
  ## 0.13.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -108,6 +108,37 @@ declare function createPropUtils<TKey extends string, TValue extends PropValue>(
108
108
  }>[k_1]; } : never>;
109
109
  key: TKey;
110
110
  };
111
+ declare function createArrayPropUtils<TKey extends string, TValue extends PropValue>(key: TKey, valueSchema: ZodType<TValue>): {
112
+ extract: (prop: unknown) => TValue[] | null;
113
+ isValid: (prop: unknown) => prop is TransformablePropValue$1<`${TKey}-array`, TValue[]>;
114
+ create: {
115
+ (value: TValue[]): TransformablePropValue$1<`${TKey}-array`, TValue[]>;
116
+ (value: TValue[], createOptions?: CreateOptions): TransformablePropValue$1<`${TKey}-array`, TValue[]>;
117
+ (value: Updater<TValue[]>, createOptions: CreateOptions): TransformablePropValue$1<`${TKey}-array`, TValue[]>;
118
+ };
119
+ schema: z.ZodObject<{
120
+ $$type: z.ZodLiteral<`${TKey}-array`>;
121
+ value: z.ZodType<TValue[], z.ZodTypeDef, TValue[]>;
122
+ disabled: z.ZodOptional<z.ZodBoolean>;
123
+ }, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
124
+ $$type: z.ZodLiteral<`${TKey}-array`>;
125
+ value: z.ZodType<TValue[], z.ZodTypeDef, TValue[]>;
126
+ disabled: z.ZodOptional<z.ZodBoolean>;
127
+ }>, any> extends infer T ? { [k in keyof T]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
128
+ $$type: z.ZodLiteral<`${TKey}-array`>;
129
+ value: z.ZodType<TValue[], z.ZodTypeDef, TValue[]>;
130
+ disabled: z.ZodOptional<z.ZodBoolean>;
131
+ }>, any>[k]; } : never, z.baseObjectInputType<{
132
+ $$type: z.ZodLiteral<`${TKey}-array`>;
133
+ value: z.ZodType<TValue[], z.ZodTypeDef, TValue[]>;
134
+ disabled: z.ZodOptional<z.ZodBoolean>;
135
+ }> extends infer T_1 ? { [k_1 in keyof T_1]: z.baseObjectInputType<{
136
+ $$type: z.ZodLiteral<`${TKey}-array`>;
137
+ value: z.ZodType<TValue[], z.ZodTypeDef, TValue[]>;
138
+ disabled: z.ZodOptional<z.ZodBoolean>;
139
+ }>[k_1]; } : never>;
140
+ key: `${TKey}-array`;
141
+ };
111
142
 
112
143
  declare const boxShadowPropTypeUtil: {
113
144
  extract: (prop: unknown) => {
@@ -1941,6 +1972,472 @@ declare const gradientColorStopPropTypeUtil: {
1941
1972
  };
1942
1973
  type GradientColorStopPropValue = z.infer<typeof gradientColorStopPropTypeUtil.schema>;
1943
1974
 
1975
+ declare const keyValuePropTypeUtil: {
1976
+ extract: (prop: unknown) => {
1977
+ value?: any;
1978
+ key?: any;
1979
+ } | null;
1980
+ isValid: (prop: unknown) => prop is TransformablePropValue$1<"keyValue", {
1981
+ value?: any;
1982
+ key?: any;
1983
+ }>;
1984
+ create: {
1985
+ (value: {
1986
+ value?: any;
1987
+ key?: any;
1988
+ }): TransformablePropValue$1<"keyValue", {
1989
+ value?: any;
1990
+ key?: any;
1991
+ }>;
1992
+ (value: {
1993
+ value?: any;
1994
+ key?: any;
1995
+ }, createOptions?: CreateOptions): TransformablePropValue$1<"keyValue", {
1996
+ value?: any;
1997
+ key?: any;
1998
+ }>;
1999
+ (value: (prev?: {
2000
+ value?: any;
2001
+ key?: any;
2002
+ } | undefined) => {
2003
+ value?: any;
2004
+ key?: any;
2005
+ }, createOptions: CreateOptions): TransformablePropValue$1<"keyValue", {
2006
+ value?: any;
2007
+ key?: any;
2008
+ }>;
2009
+ };
2010
+ schema: z.ZodObject<{
2011
+ $$type: z.ZodLiteral<"keyValue">;
2012
+ value: z.ZodType<{
2013
+ value?: any;
2014
+ key?: any;
2015
+ }, z.ZodTypeDef, {
2016
+ value?: any;
2017
+ key?: any;
2018
+ }>;
2019
+ disabled: z.ZodOptional<z.ZodBoolean>;
2020
+ }, "strict", z.ZodTypeAny, {
2021
+ $$type: "keyValue";
2022
+ value: {
2023
+ value?: any;
2024
+ key?: any;
2025
+ };
2026
+ disabled?: boolean | undefined;
2027
+ }, {
2028
+ $$type: "keyValue";
2029
+ value: {
2030
+ value?: any;
2031
+ key?: any;
2032
+ };
2033
+ disabled?: boolean | undefined;
2034
+ }>;
2035
+ key: "keyValue";
2036
+ };
2037
+ type KeyValuePropValue = z.infer<typeof keyValuePropTypeUtil.schema>;
2038
+
2039
+ declare const positionPropTypeUtil: {
2040
+ extract: (prop: unknown) => {
2041
+ x: {
2042
+ $$type: "size";
2043
+ value: {
2044
+ size: number;
2045
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2046
+ } | {
2047
+ size: "";
2048
+ unit: "auto";
2049
+ } | {
2050
+ size: string;
2051
+ unit: "custom";
2052
+ };
2053
+ disabled?: boolean | undefined;
2054
+ } | null;
2055
+ y: {
2056
+ $$type: "size";
2057
+ value: {
2058
+ size: number;
2059
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2060
+ } | {
2061
+ size: "";
2062
+ unit: "auto";
2063
+ } | {
2064
+ size: string;
2065
+ unit: "custom";
2066
+ };
2067
+ disabled?: boolean | undefined;
2068
+ } | null;
2069
+ } | null;
2070
+ isValid: (prop: unknown) => prop is TransformablePropValue$1<"object-position", {
2071
+ x: {
2072
+ $$type: "size";
2073
+ value: {
2074
+ size: number;
2075
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2076
+ } | {
2077
+ size: "";
2078
+ unit: "auto";
2079
+ } | {
2080
+ size: string;
2081
+ unit: "custom";
2082
+ };
2083
+ disabled?: boolean | undefined;
2084
+ } | null;
2085
+ y: {
2086
+ $$type: "size";
2087
+ value: {
2088
+ size: number;
2089
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2090
+ } | {
2091
+ size: "";
2092
+ unit: "auto";
2093
+ } | {
2094
+ size: string;
2095
+ unit: "custom";
2096
+ };
2097
+ disabled?: boolean | undefined;
2098
+ } | null;
2099
+ }>;
2100
+ create: {
2101
+ (value: {
2102
+ x: {
2103
+ $$type: "size";
2104
+ value: {
2105
+ size: number;
2106
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2107
+ } | {
2108
+ size: "";
2109
+ unit: "auto";
2110
+ } | {
2111
+ size: string;
2112
+ unit: "custom";
2113
+ };
2114
+ disabled?: boolean | undefined;
2115
+ } | null;
2116
+ y: {
2117
+ $$type: "size";
2118
+ value: {
2119
+ size: number;
2120
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2121
+ } | {
2122
+ size: "";
2123
+ unit: "auto";
2124
+ } | {
2125
+ size: string;
2126
+ unit: "custom";
2127
+ };
2128
+ disabled?: boolean | undefined;
2129
+ } | null;
2130
+ }): TransformablePropValue$1<"object-position", {
2131
+ x: {
2132
+ $$type: "size";
2133
+ value: {
2134
+ size: number;
2135
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2136
+ } | {
2137
+ size: "";
2138
+ unit: "auto";
2139
+ } | {
2140
+ size: string;
2141
+ unit: "custom";
2142
+ };
2143
+ disabled?: boolean | undefined;
2144
+ } | null;
2145
+ y: {
2146
+ $$type: "size";
2147
+ value: {
2148
+ size: number;
2149
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2150
+ } | {
2151
+ size: "";
2152
+ unit: "auto";
2153
+ } | {
2154
+ size: string;
2155
+ unit: "custom";
2156
+ };
2157
+ disabled?: boolean | undefined;
2158
+ } | null;
2159
+ }>;
2160
+ (value: {
2161
+ x: {
2162
+ $$type: "size";
2163
+ value: {
2164
+ size: number;
2165
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2166
+ } | {
2167
+ size: "";
2168
+ unit: "auto";
2169
+ } | {
2170
+ size: string;
2171
+ unit: "custom";
2172
+ };
2173
+ disabled?: boolean | undefined;
2174
+ } | null;
2175
+ y: {
2176
+ $$type: "size";
2177
+ value: {
2178
+ size: number;
2179
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2180
+ } | {
2181
+ size: "";
2182
+ unit: "auto";
2183
+ } | {
2184
+ size: string;
2185
+ unit: "custom";
2186
+ };
2187
+ disabled?: boolean | undefined;
2188
+ } | null;
2189
+ }, createOptions?: CreateOptions): TransformablePropValue$1<"object-position", {
2190
+ x: {
2191
+ $$type: "size";
2192
+ value: {
2193
+ size: number;
2194
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2195
+ } | {
2196
+ size: "";
2197
+ unit: "auto";
2198
+ } | {
2199
+ size: string;
2200
+ unit: "custom";
2201
+ };
2202
+ disabled?: boolean | undefined;
2203
+ } | null;
2204
+ y: {
2205
+ $$type: "size";
2206
+ value: {
2207
+ size: number;
2208
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2209
+ } | {
2210
+ size: "";
2211
+ unit: "auto";
2212
+ } | {
2213
+ size: string;
2214
+ unit: "custom";
2215
+ };
2216
+ disabled?: boolean | undefined;
2217
+ } | null;
2218
+ }>;
2219
+ (value: (prev?: {
2220
+ x: {
2221
+ $$type: "size";
2222
+ value: {
2223
+ size: number;
2224
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2225
+ } | {
2226
+ size: "";
2227
+ unit: "auto";
2228
+ } | {
2229
+ size: string;
2230
+ unit: "custom";
2231
+ };
2232
+ disabled?: boolean | undefined;
2233
+ } | null;
2234
+ y: {
2235
+ $$type: "size";
2236
+ value: {
2237
+ size: number;
2238
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2239
+ } | {
2240
+ size: "";
2241
+ unit: "auto";
2242
+ } | {
2243
+ size: string;
2244
+ unit: "custom";
2245
+ };
2246
+ disabled?: boolean | undefined;
2247
+ } | null;
2248
+ } | undefined) => {
2249
+ x: {
2250
+ $$type: "size";
2251
+ value: {
2252
+ size: number;
2253
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2254
+ } | {
2255
+ size: "";
2256
+ unit: "auto";
2257
+ } | {
2258
+ size: string;
2259
+ unit: "custom";
2260
+ };
2261
+ disabled?: boolean | undefined;
2262
+ } | null;
2263
+ y: {
2264
+ $$type: "size";
2265
+ value: {
2266
+ size: number;
2267
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2268
+ } | {
2269
+ size: "";
2270
+ unit: "auto";
2271
+ } | {
2272
+ size: string;
2273
+ unit: "custom";
2274
+ };
2275
+ disabled?: boolean | undefined;
2276
+ } | null;
2277
+ }, createOptions: CreateOptions): TransformablePropValue$1<"object-position", {
2278
+ x: {
2279
+ $$type: "size";
2280
+ value: {
2281
+ size: number;
2282
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2283
+ } | {
2284
+ size: "";
2285
+ unit: "auto";
2286
+ } | {
2287
+ size: string;
2288
+ unit: "custom";
2289
+ };
2290
+ disabled?: boolean | undefined;
2291
+ } | null;
2292
+ y: {
2293
+ $$type: "size";
2294
+ value: {
2295
+ size: number;
2296
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2297
+ } | {
2298
+ size: "";
2299
+ unit: "auto";
2300
+ } | {
2301
+ size: string;
2302
+ unit: "custom";
2303
+ };
2304
+ disabled?: boolean | undefined;
2305
+ } | null;
2306
+ }>;
2307
+ };
2308
+ schema: z.ZodObject<{
2309
+ $$type: z.ZodLiteral<"object-position">;
2310
+ value: z.ZodType<{
2311
+ x: {
2312
+ $$type: "size";
2313
+ value: {
2314
+ size: number;
2315
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2316
+ } | {
2317
+ size: "";
2318
+ unit: "auto";
2319
+ } | {
2320
+ size: string;
2321
+ unit: "custom";
2322
+ };
2323
+ disabled?: boolean | undefined;
2324
+ } | null;
2325
+ y: {
2326
+ $$type: "size";
2327
+ value: {
2328
+ size: number;
2329
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2330
+ } | {
2331
+ size: "";
2332
+ unit: "auto";
2333
+ } | {
2334
+ size: string;
2335
+ unit: "custom";
2336
+ };
2337
+ disabled?: boolean | undefined;
2338
+ } | null;
2339
+ }, z.ZodTypeDef, {
2340
+ x: {
2341
+ $$type: "size";
2342
+ value: {
2343
+ size: number;
2344
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2345
+ } | {
2346
+ size: "";
2347
+ unit: "auto";
2348
+ } | {
2349
+ size: string;
2350
+ unit: "custom";
2351
+ };
2352
+ disabled?: boolean | undefined;
2353
+ } | null;
2354
+ y: {
2355
+ $$type: "size";
2356
+ value: {
2357
+ size: number;
2358
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2359
+ } | {
2360
+ size: "";
2361
+ unit: "auto";
2362
+ } | {
2363
+ size: string;
2364
+ unit: "custom";
2365
+ };
2366
+ disabled?: boolean | undefined;
2367
+ } | null;
2368
+ }>;
2369
+ disabled: z.ZodOptional<z.ZodBoolean>;
2370
+ }, "strict", z.ZodTypeAny, {
2371
+ $$type: "object-position";
2372
+ value: {
2373
+ x: {
2374
+ $$type: "size";
2375
+ value: {
2376
+ size: number;
2377
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2378
+ } | {
2379
+ size: "";
2380
+ unit: "auto";
2381
+ } | {
2382
+ size: string;
2383
+ unit: "custom";
2384
+ };
2385
+ disabled?: boolean | undefined;
2386
+ } | null;
2387
+ y: {
2388
+ $$type: "size";
2389
+ value: {
2390
+ size: number;
2391
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2392
+ } | {
2393
+ size: "";
2394
+ unit: "auto";
2395
+ } | {
2396
+ size: string;
2397
+ unit: "custom";
2398
+ };
2399
+ disabled?: boolean | undefined;
2400
+ } | null;
2401
+ };
2402
+ disabled?: boolean | undefined;
2403
+ }, {
2404
+ $$type: "object-position";
2405
+ value: {
2406
+ x: {
2407
+ $$type: "size";
2408
+ value: {
2409
+ size: number;
2410
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2411
+ } | {
2412
+ size: "";
2413
+ unit: "auto";
2414
+ } | {
2415
+ size: string;
2416
+ unit: "custom";
2417
+ };
2418
+ disabled?: boolean | undefined;
2419
+ } | null;
2420
+ y: {
2421
+ $$type: "size";
2422
+ value: {
2423
+ size: number;
2424
+ unit: "px" | "em" | "rem" | "%" | "vw" | "vh";
2425
+ } | {
2426
+ size: "";
2427
+ unit: "auto";
2428
+ } | {
2429
+ size: string;
2430
+ unit: "custom";
2431
+ };
2432
+ disabled?: boolean | undefined;
2433
+ } | null;
2434
+ };
2435
+ disabled?: boolean | undefined;
2436
+ }>;
2437
+ key: "object-position";
2438
+ };
2439
+ type PositionPropTypeValue = z.infer<typeof positionPropTypeUtil.schema>;
2440
+
1944
2441
  declare function mergeProps(current: Props, updates: Props): Props;
1945
2442
 
1946
2443
  declare const transformableSchema: z.ZodObject<{
@@ -1963,4 +2460,4 @@ declare const filterEmptyValues: <TValue extends PropValue>(value: TValue) => TV
1963
2460
  type Nullish = null | undefined | '';
1964
2461
  declare const isEmpty: (value: PropValue) => value is Nullish;
1965
2462
 
1966
- export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, 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 ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DimensionsPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createPropUtils, dimensionsPropTypeUtil, filterEmptyValues, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };
2463
+ export { type AnyTransformable, type ArrayPropType, type ArrayPropValue, 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 ClassesPropValue, type ColorPropValue, type ColorStopPropValue, type CreateOptions, type DimensionsPropValue, type GradientColorStopPropValue, type ImageAttachmentIdPropValue, type ImagePropValue, type ImageSrcPropValue, type KeyValuePropValue, type LayoutDirectionPropValue, type LinkPropValue, type NumberPropValue, type ObjectPropType, type ObjectPropValue, type PlainPropType, type PlainPropValue, type PositionPropTypeValue, type PropKey, type PropType, type PropTypeKey, type PropTypeUtil, type PropValue, type Props, type PropsSchema, type ShadowPropValue, type SizePropValue, type StringPropValue, type StrokePropValue, type TransformablePropType, type TransformablePropValue$1 as TransformablePropValue, type UnionPropType, type UrlPropValue, backgroundColorOverlayPropTypeUtil, backgroundGradientOverlayPropTypeUtil, backgroundImageOverlayPropTypeUtil, backgroundImagePositionOffsetPropTypeUtil, backgroundImageSizeScalePropTypeUtil, backgroundOverlayPropTypeUtil, backgroundPropTypeUtil, booleanPropTypeUtil, borderRadiusPropTypeUtil, borderWidthPropTypeUtil, boxShadowPropTypeUtil, classesPropTypeUtil, colorPropTypeUtil, colorStopPropTypeUtil, createArrayPropUtils, createPropUtils, dimensionsPropTypeUtil, filterEmptyValues, gradientColorStopPropTypeUtil, imageAttachmentIdPropType, imagePropTypeUtil, imageSrcPropTypeUtil, isEmpty, isTransformable, keyValuePropTypeUtil, layoutDirectionPropTypeUtil, linkPropTypeUtil, mergeProps, numberPropTypeUtil, positionPropTypeUtil, shadowPropTypeUtil, sizePropTypeUtil, stringPropTypeUtil, strokePropTypeUtil, urlPropTypeUtil };