@elementor/editor-props 0.18.0 → 3.32.0-21
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 +0 -8
- package/dist/index.d.mts +10748 -3163
- package/dist/index.d.ts +10748 -3163
- package/dist/index.js +202 -149
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +193 -139
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/prop-types/filter-prop-types/backdrop-filter.ts +6 -3
- package/src/prop-types/filter-prop-types/drop-shadow-filter.ts +11 -2
- package/src/prop-types/filter-prop-types/filter.ts +12 -21
- package/src/prop-types/flex.ts +15 -0
- package/src/prop-types/index.ts +6 -8
- package/src/prop-types/selection-size.ts +16 -0
- package/src/prop-types/size.ts +13 -1
- package/src/prop-types/transform-prop-types/move-transform.ts +2 -1
- package/src/prop-types/transform-prop-types/rotate-transform.ts +16 -0
- package/src/prop-types/transform-prop-types/scale-transform.ts +8 -5
- package/src/prop-types/transform-prop-types/skew-transform.ts +15 -0
- package/src/prop-types/transform-prop-types/transform.ts +8 -1
- package/src/prop-types/transform-prop-types/types.ts +8 -0
- package/src/types.ts +1 -4
- package/src/utils/create-prop-utils.ts +3 -2
- package/src/utils/prop-dependency-utils.ts +26 -16
- package/src/prop-types/filter-prop-types/blur-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/brightness-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/contrast-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/grayscale-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/hue-rotate-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/invert-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/saturate-filter.ts +0 -8
- package/src/prop-types/filter-prop-types/sepia-filter.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -29,31 +29,29 @@ __export(index_exports, {
|
|
|
29
29
|
backgroundImageSizeScalePropTypeUtil: () => backgroundImageSizeScalePropTypeUtil,
|
|
30
30
|
backgroundOverlayPropTypeUtil: () => backgroundOverlayPropTypeUtil,
|
|
31
31
|
backgroundPropTypeUtil: () => backgroundPropTypeUtil,
|
|
32
|
-
blurFilterPropTypeUtil: () => blurFilterPropTypeUtil,
|
|
33
32
|
booleanPropTypeUtil: () => booleanPropTypeUtil,
|
|
34
33
|
borderRadiusPropTypeUtil: () => borderRadiusPropTypeUtil,
|
|
35
34
|
borderWidthPropTypeUtil: () => borderWidthPropTypeUtil,
|
|
36
35
|
boxShadowPropTypeUtil: () => boxShadowPropTypeUtil,
|
|
37
|
-
brightnessFilterPropTypeUtil: () => brightnessFilterPropTypeUtil,
|
|
38
36
|
classesPropTypeUtil: () => classesPropTypeUtil,
|
|
39
37
|
colorPropTypeUtil: () => colorPropTypeUtil,
|
|
40
38
|
colorStopPropTypeUtil: () => colorStopPropTypeUtil,
|
|
41
|
-
contrastFilterPropTypeUtil: () => contrastFilterPropTypeUtil,
|
|
42
39
|
createArrayPropUtils: () => createArrayPropUtils,
|
|
43
40
|
createPropUtils: () => createPropUtils,
|
|
41
|
+
cssFilterFunctionPropUtil: () => cssFilterFunctionPropUtil,
|
|
44
42
|
dimensionsPropTypeUtil: () => dimensionsPropTypeUtil,
|
|
45
43
|
dropShadowFilterPropTypeUtil: () => dropShadowFilterPropTypeUtil,
|
|
46
44
|
evaluateTerm: () => evaluateTerm,
|
|
45
|
+
extractValue: () => extractValue,
|
|
47
46
|
filterEmptyValues: () => filterEmptyValues,
|
|
48
47
|
filterPropTypeUtil: () => filterPropTypeUtil,
|
|
49
|
-
|
|
48
|
+
flexPropTypeUtil: () => flexPropTypeUtil,
|
|
50
49
|
gradientColorStopPropTypeUtil: () => gradientColorStopPropTypeUtil,
|
|
51
|
-
grayscaleFilterPropTypeUtil: () => grayscaleFilterPropTypeUtil,
|
|
52
|
-
hueRotateFilterPropTypeUtil: () => hueRotateFilterPropTypeUtil,
|
|
53
50
|
imageAttachmentIdPropType: () => imageAttachmentIdPropType,
|
|
54
51
|
imagePropTypeUtil: () => imagePropTypeUtil,
|
|
55
52
|
imageSrcPropTypeUtil: () => imageSrcPropTypeUtil,
|
|
56
|
-
|
|
53
|
+
isDependency: () => isDependency,
|
|
54
|
+
isDependencyMet: () => isDependencyMet,
|
|
57
55
|
isEmpty: () => isEmpty,
|
|
58
56
|
isTransformable: () => isTransformable,
|
|
59
57
|
keyValuePropTypeUtil: () => keyValuePropTypeUtil,
|
|
@@ -63,11 +61,12 @@ __export(index_exports, {
|
|
|
63
61
|
moveTransformPropTypeUtil: () => moveTransformPropTypeUtil,
|
|
64
62
|
numberPropTypeUtil: () => numberPropTypeUtil,
|
|
65
63
|
positionPropTypeUtil: () => positionPropTypeUtil,
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
rotateTransformPropTypeUtil: () => rotateTransformPropTypeUtil,
|
|
65
|
+
scaleTransformPropTypeUtil: () => scaleTransformPropTypeUtil,
|
|
66
|
+
selectionSizePropTypeUtil: () => selectionSizePropTypeUtil,
|
|
68
67
|
shadowPropTypeUtil: () => shadowPropTypeUtil,
|
|
69
|
-
shouldApplyEffect: () => shouldApplyEffect,
|
|
70
68
|
sizePropTypeUtil: () => sizePropTypeUtil,
|
|
69
|
+
skewTransformPropTypeUtil: () => skewTransformPropTypeUtil,
|
|
71
70
|
stringPropTypeUtil: () => stringPropTypeUtil,
|
|
72
71
|
strokePropTypeUtil: () => strokePropTypeUtil,
|
|
73
72
|
transformPropTypeUtil: () => transformPropTypeUtil,
|
|
@@ -122,8 +121,8 @@ function createPropUtils(key, valueSchema) {
|
|
|
122
121
|
key
|
|
123
122
|
};
|
|
124
123
|
}
|
|
125
|
-
function createArrayPropUtils(key, valueSchema) {
|
|
126
|
-
return createPropUtils(`${key}-array`, import_schema.z.array(valueSchema));
|
|
124
|
+
function createArrayPropUtils(key, valueSchema, overrideKey) {
|
|
125
|
+
return createPropUtils(overrideKey || `${key}-array`, import_schema.z.array(valueSchema));
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
// src/prop-types/shadow.ts
|
|
@@ -185,40 +184,51 @@ var classesPropTypeUtil = createPropUtils(
|
|
|
185
184
|
var import_schema8 = require("@elementor/schema");
|
|
186
185
|
var colorPropTypeUtil = createPropUtils("color", import_schema8.z.string());
|
|
187
186
|
|
|
188
|
-
// src/prop-types/
|
|
187
|
+
// src/prop-types/flex.ts
|
|
189
188
|
var import_schema9 = require("@elementor/schema");
|
|
189
|
+
var flexPropTypeUtil = createPropUtils(
|
|
190
|
+
"flex",
|
|
191
|
+
import_schema9.z.strictObject({
|
|
192
|
+
flexGrow: unknownChildrenSchema,
|
|
193
|
+
flexShrink: unknownChildrenSchema,
|
|
194
|
+
flexBasis: unknownChildrenSchema
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
|
|
198
|
+
// src/prop-types/image.ts
|
|
199
|
+
var import_schema10 = require("@elementor/schema");
|
|
190
200
|
var imagePropTypeUtil = createPropUtils(
|
|
191
201
|
"image",
|
|
192
|
-
|
|
202
|
+
import_schema10.z.strictObject({
|
|
193
203
|
src: unknownChildrenSchema,
|
|
194
204
|
size: unknownChildrenSchema
|
|
195
205
|
})
|
|
196
206
|
);
|
|
197
207
|
|
|
198
208
|
// src/prop-types/image-attachment-id.ts
|
|
199
|
-
var
|
|
200
|
-
var imageAttachmentIdPropType = createPropUtils("image-attachment-id",
|
|
209
|
+
var import_schema11 = require("@elementor/schema");
|
|
210
|
+
var imageAttachmentIdPropType = createPropUtils("image-attachment-id", import_schema11.z.number());
|
|
201
211
|
|
|
202
212
|
// src/prop-types/image-src.ts
|
|
203
|
-
var
|
|
213
|
+
var import_schema12 = require("@elementor/schema");
|
|
204
214
|
var imageSrcPropTypeUtil = createPropUtils(
|
|
205
215
|
"image-src",
|
|
206
|
-
|
|
216
|
+
import_schema12.z.strictObject({
|
|
207
217
|
id: unknownChildrenSchema,
|
|
208
|
-
url:
|
|
218
|
+
url: import_schema12.z.null()
|
|
209
219
|
}).or(
|
|
210
|
-
|
|
211
|
-
id:
|
|
220
|
+
import_schema12.z.strictObject({
|
|
221
|
+
id: import_schema12.z.null(),
|
|
212
222
|
url: unknownChildrenSchema
|
|
213
223
|
})
|
|
214
224
|
)
|
|
215
225
|
);
|
|
216
226
|
|
|
217
227
|
// src/prop-types/dimensions.ts
|
|
218
|
-
var
|
|
228
|
+
var import_schema13 = require("@elementor/schema");
|
|
219
229
|
var dimensionsPropTypeUtil = createPropUtils(
|
|
220
230
|
"dimensions",
|
|
221
|
-
|
|
231
|
+
import_schema13.z.strictObject({
|
|
222
232
|
"block-start": unknownChildrenSchema,
|
|
223
233
|
"block-end": unknownChildrenSchema,
|
|
224
234
|
"inline-start": unknownChildrenSchema,
|
|
@@ -227,80 +237,112 @@ var dimensionsPropTypeUtil = createPropUtils(
|
|
|
227
237
|
);
|
|
228
238
|
|
|
229
239
|
// src/prop-types/number.ts
|
|
230
|
-
var
|
|
231
|
-
var numberPropTypeUtil = createPropUtils("number",
|
|
240
|
+
var import_schema14 = require("@elementor/schema");
|
|
241
|
+
var numberPropTypeUtil = createPropUtils("number", import_schema14.z.number().nullable());
|
|
232
242
|
|
|
233
243
|
// src/prop-types/size.ts
|
|
234
|
-
var
|
|
244
|
+
var import_schema15 = require("@elementor/schema");
|
|
235
245
|
var sizePropTypeUtil = createPropUtils(
|
|
236
246
|
"size",
|
|
237
|
-
|
|
238
|
-
unit:
|
|
239
|
-
size:
|
|
247
|
+
import_schema15.z.strictObject({
|
|
248
|
+
unit: import_schema15.z.enum(["px", "em", "rem", "%", "vw", "vh"]),
|
|
249
|
+
size: import_schema15.z.number()
|
|
240
250
|
}).or(
|
|
241
|
-
|
|
242
|
-
unit:
|
|
243
|
-
size:
|
|
251
|
+
import_schema15.z.strictObject({
|
|
252
|
+
unit: import_schema15.z.enum(["deg", "rad", "grad", "turn"]),
|
|
253
|
+
size: import_schema15.z.number()
|
|
254
|
+
})
|
|
255
|
+
).or(
|
|
256
|
+
import_schema15.z.strictObject({
|
|
257
|
+
unit: import_schema15.z.enum(["s", "ms"]),
|
|
258
|
+
size: import_schema15.z.number()
|
|
259
|
+
})
|
|
260
|
+
).or(
|
|
261
|
+
import_schema15.z.strictObject({
|
|
262
|
+
unit: import_schema15.z.literal("auto"),
|
|
263
|
+
size: import_schema15.z.literal("")
|
|
244
264
|
})
|
|
245
265
|
).or(
|
|
246
|
-
|
|
247
|
-
unit:
|
|
248
|
-
size:
|
|
266
|
+
import_schema15.z.strictObject({
|
|
267
|
+
unit: import_schema15.z.literal("custom"),
|
|
268
|
+
size: import_schema15.z.string()
|
|
249
269
|
})
|
|
250
270
|
)
|
|
251
271
|
);
|
|
252
272
|
|
|
253
273
|
// src/prop-types/string.ts
|
|
254
|
-
var
|
|
255
|
-
var stringPropTypeUtil = createPropUtils("string",
|
|
274
|
+
var import_schema16 = require("@elementor/schema");
|
|
275
|
+
var stringPropTypeUtil = createPropUtils("string", import_schema16.z.string().nullable());
|
|
256
276
|
|
|
257
277
|
// src/prop-types/stroke.ts
|
|
258
|
-
var
|
|
278
|
+
var import_schema17 = require("@elementor/schema");
|
|
259
279
|
var strokePropTypeUtil = createPropUtils(
|
|
260
280
|
"stroke",
|
|
261
|
-
|
|
281
|
+
import_schema17.z.strictObject({
|
|
262
282
|
color: unknownChildrenSchema,
|
|
263
283
|
width: unknownChildrenSchema
|
|
264
284
|
})
|
|
265
285
|
);
|
|
266
286
|
|
|
267
287
|
// src/prop-types/url.ts
|
|
268
|
-
var
|
|
269
|
-
var urlPropTypeUtil = createPropUtils("url",
|
|
288
|
+
var import_schema18 = require("@elementor/schema");
|
|
289
|
+
var urlPropTypeUtil = createPropUtils("url", import_schema18.z.string().nullable());
|
|
270
290
|
|
|
271
291
|
// src/prop-types/layout-direction.ts
|
|
272
|
-
var
|
|
292
|
+
var import_schema19 = require("@elementor/schema");
|
|
273
293
|
var layoutDirectionPropTypeUtil = createPropUtils(
|
|
274
294
|
"layout-direction",
|
|
275
|
-
|
|
276
|
-
row:
|
|
277
|
-
column:
|
|
295
|
+
import_schema19.z.object({
|
|
296
|
+
row: import_schema19.z.any(),
|
|
297
|
+
column: import_schema19.z.any()
|
|
278
298
|
})
|
|
279
299
|
);
|
|
280
300
|
|
|
281
301
|
// src/prop-types/link.ts
|
|
282
|
-
var
|
|
302
|
+
var import_schema20 = require("@elementor/schema");
|
|
283
303
|
var linkPropTypeUtil = createPropUtils(
|
|
284
304
|
"link",
|
|
285
|
-
|
|
305
|
+
import_schema20.z.strictObject({
|
|
286
306
|
destination: unknownChildrenSchema,
|
|
287
307
|
label: unknownChildrenSchema,
|
|
288
308
|
isTargetBlank: unknownChildrenSchema
|
|
289
309
|
})
|
|
290
310
|
);
|
|
291
311
|
|
|
312
|
+
// src/prop-types/selection-size.ts
|
|
313
|
+
var import_schema22 = require("@elementor/schema");
|
|
314
|
+
|
|
315
|
+
// src/prop-types/key-value.ts
|
|
316
|
+
var import_schema21 = require("@elementor/schema");
|
|
317
|
+
var keyValuePropTypeUtil = createPropUtils(
|
|
318
|
+
"key-value",
|
|
319
|
+
import_schema21.z.strictObject({
|
|
320
|
+
key: unknownChildrenSchema,
|
|
321
|
+
value: unknownChildrenSchema
|
|
322
|
+
})
|
|
323
|
+
);
|
|
324
|
+
|
|
325
|
+
// src/prop-types/selection-size.ts
|
|
326
|
+
var selectionSizePropTypeUtil = createPropUtils(
|
|
327
|
+
"selection-size",
|
|
328
|
+
import_schema22.z.strictObject({
|
|
329
|
+
selection: import_schema22.z.union([keyValuePropTypeUtil.schema, stringPropTypeUtil.schema]),
|
|
330
|
+
size: sizePropTypeUtil.schema
|
|
331
|
+
})
|
|
332
|
+
);
|
|
333
|
+
|
|
292
334
|
// src/prop-types/background-prop-types/background.ts
|
|
293
|
-
var
|
|
335
|
+
var import_schema23 = require("@elementor/schema");
|
|
294
336
|
var backgroundPropTypeUtil = createPropUtils(
|
|
295
337
|
"background",
|
|
296
|
-
|
|
338
|
+
import_schema23.z.strictObject({
|
|
297
339
|
color: unknownChildrenSchema,
|
|
298
340
|
"background-overlay": unknownChildrenSchema
|
|
299
341
|
})
|
|
300
342
|
);
|
|
301
343
|
|
|
302
344
|
// src/prop-types/background-prop-types/background-overlay.ts
|
|
303
|
-
var
|
|
345
|
+
var import_schema24 = require("@elementor/schema");
|
|
304
346
|
|
|
305
347
|
// src/prop-types/background-prop-types/background-color-overlay.ts
|
|
306
348
|
var backgroundColorOverlayPropTypeUtil = createPropUtils("background-color-overlay", unknownChildrenSchema);
|
|
@@ -316,7 +358,7 @@ var backgroundImageOverlayPropTypeUtil = createPropUtils("background-image-overl
|
|
|
316
358
|
|
|
317
359
|
// src/prop-types/background-prop-types/background-overlay.ts
|
|
318
360
|
var backgroundOverlayItem = backgroundColorOverlayPropTypeUtil.schema.or(backgroundGradientOverlayPropTypeUtil.schema).or(backgroundImageOverlayPropTypeUtil.schema);
|
|
319
|
-
var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay",
|
|
361
|
+
var backgroundOverlayPropTypeUtil = createPropUtils("background-overlay", import_schema24.z.array(backgroundOverlayItem));
|
|
320
362
|
|
|
321
363
|
// src/prop-types/background-prop-types/background-image-position-offset.ts
|
|
322
364
|
var backgroundImagePositionOffsetPropTypeUtil = createPropUtils(
|
|
@@ -331,122 +373,132 @@ var backgroundImageSizeScalePropTypeUtil = createPropUtils(
|
|
|
331
373
|
);
|
|
332
374
|
|
|
333
375
|
// src/prop-types/boolean.ts
|
|
334
|
-
var
|
|
335
|
-
var booleanPropTypeUtil = createPropUtils("boolean",
|
|
376
|
+
var import_schema25 = require("@elementor/schema");
|
|
377
|
+
var booleanPropTypeUtil = createPropUtils("boolean", import_schema25.z.boolean().nullable());
|
|
336
378
|
|
|
337
379
|
// src/prop-types/color-stop.ts
|
|
338
|
-
var
|
|
380
|
+
var import_schema26 = require("@elementor/schema");
|
|
339
381
|
var colorStopPropTypeUtil = createPropUtils(
|
|
340
382
|
"color-stop",
|
|
341
|
-
|
|
383
|
+
import_schema26.z.strictObject({
|
|
342
384
|
color: unknownChildrenSchema,
|
|
343
385
|
offset: unknownChildrenSchema
|
|
344
386
|
})
|
|
345
387
|
);
|
|
346
388
|
|
|
347
389
|
// src/prop-types/gradient-color-stop.ts
|
|
348
|
-
var
|
|
390
|
+
var import_schema27 = require("@elementor/schema");
|
|
349
391
|
var gradientColorStopPropTypeUtil = createPropUtils(
|
|
350
392
|
"gradient-color-stop",
|
|
351
|
-
|
|
352
|
-
);
|
|
353
|
-
|
|
354
|
-
// src/prop-types/key-value.ts
|
|
355
|
-
var import_schema25 = require("@elementor/schema");
|
|
356
|
-
var keyValuePropTypeUtil = createPropUtils(
|
|
357
|
-
"key-value",
|
|
358
|
-
import_schema25.z.strictObject({
|
|
359
|
-
key: unknownChildrenSchema,
|
|
360
|
-
value: unknownChildrenSchema
|
|
361
|
-
})
|
|
393
|
+
import_schema27.z.array(colorStopPropTypeUtil.schema)
|
|
362
394
|
);
|
|
363
395
|
|
|
364
396
|
// src/prop-types/position.ts
|
|
365
|
-
var
|
|
397
|
+
var import_schema28 = require("@elementor/schema");
|
|
366
398
|
var positionPropTypeUtil = createPropUtils(
|
|
367
399
|
"object-position",
|
|
368
|
-
|
|
400
|
+
import_schema28.z.strictObject({
|
|
369
401
|
x: sizePropTypeUtil.schema.nullable(),
|
|
370
402
|
y: sizePropTypeUtil.schema.nullable()
|
|
371
403
|
})
|
|
372
404
|
);
|
|
373
405
|
|
|
374
406
|
// src/prop-types/filter-prop-types/filter.ts
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
// src/prop-types/filter-prop-types/blur-filter.ts
|
|
378
|
-
var blurFilterPropTypeUtil = createPropUtils("blur", unknownChildrenSchema);
|
|
379
|
-
|
|
380
|
-
// src/prop-types/filter-prop-types/brightness-filter.ts
|
|
381
|
-
var brightnessFilterPropTypeUtil = createPropUtils("brightness", unknownChildrenSchema);
|
|
382
|
-
|
|
383
|
-
// src/prop-types/filter-prop-types/contrast-filter.ts
|
|
384
|
-
var contrastFilterPropTypeUtil = createPropUtils("contrast", unknownChildrenSchema);
|
|
407
|
+
var import_schema30 = require("@elementor/schema");
|
|
385
408
|
|
|
386
409
|
// src/prop-types/filter-prop-types/drop-shadow-filter.ts
|
|
387
|
-
var
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
// src/prop-types/filter-prop-types/saturate-filter.ts
|
|
399
|
-
var saturateFilterPropTypeUtil = createPropUtils("saturate", unknownChildrenSchema);
|
|
400
|
-
|
|
401
|
-
// src/prop-types/filter-prop-types/sepia-filter.ts
|
|
402
|
-
var sepiaFilterPropTypeUtil = createPropUtils("sepia", unknownChildrenSchema);
|
|
410
|
+
var import_schema29 = require("@elementor/schema");
|
|
411
|
+
var dropShadowFilterPropTypeUtil = createPropUtils(
|
|
412
|
+
"drop-shadow",
|
|
413
|
+
import_schema29.z.object({
|
|
414
|
+
xAxis: sizePropTypeUtil.schema,
|
|
415
|
+
yAxis: sizePropTypeUtil.schema,
|
|
416
|
+
blur: sizePropTypeUtil.schema,
|
|
417
|
+
color: unknownChildrenSchema
|
|
418
|
+
})
|
|
419
|
+
);
|
|
403
420
|
|
|
404
421
|
// src/prop-types/filter-prop-types/filter.ts
|
|
405
|
-
var
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
hueRotateFilterPropTypeUtil.schema,
|
|
414
|
-
dropShadowFilterPropTypeUtil.schema
|
|
415
|
-
]);
|
|
416
|
-
var filterPropTypeUtil = createPropUtils("filter", import_schema27.z.array(filterTypes));
|
|
422
|
+
var cssFilterFunctionPropUtil = createPropUtils(
|
|
423
|
+
"css-filter-func",
|
|
424
|
+
import_schema30.z.object({
|
|
425
|
+
func: stringPropTypeUtil.schema,
|
|
426
|
+
args: import_schema30.z.union([sizePropTypeUtil.schema, dropShadowFilterPropTypeUtil.schema])
|
|
427
|
+
})
|
|
428
|
+
);
|
|
429
|
+
var filterPropTypeUtil = createPropUtils("filter", import_schema30.z.array(cssFilterFunctionPropUtil.schema));
|
|
417
430
|
|
|
418
431
|
// src/prop-types/transform-prop-types/transform.ts
|
|
419
|
-
var
|
|
432
|
+
var import_schema35 = require("@elementor/schema");
|
|
433
|
+
|
|
434
|
+
// src/prop-types/transform-prop-types/move-transform.ts
|
|
435
|
+
var import_schema31 = require("@elementor/schema");
|
|
436
|
+
|
|
437
|
+
// src/prop-types/transform-prop-types/types.ts
|
|
438
|
+
var TransformFunctionKeys = {
|
|
439
|
+
move: "transform-move",
|
|
440
|
+
scale: "transform-scale",
|
|
441
|
+
rotate: "transform-rotate",
|
|
442
|
+
skew: "transform-skew"
|
|
443
|
+
};
|
|
420
444
|
|
|
421
445
|
// src/prop-types/transform-prop-types/move-transform.ts
|
|
422
|
-
var import_schema28 = require("@elementor/schema");
|
|
423
446
|
var moveTransformPropTypeUtil = createPropUtils(
|
|
424
|
-
|
|
425
|
-
|
|
447
|
+
TransformFunctionKeys.move,
|
|
448
|
+
import_schema31.z.strictObject({
|
|
426
449
|
x: sizePropTypeUtil.schema.nullable(),
|
|
427
450
|
y: sizePropTypeUtil.schema.nullable(),
|
|
428
451
|
z: sizePropTypeUtil.schema.nullable()
|
|
429
452
|
})
|
|
430
453
|
);
|
|
431
454
|
|
|
432
|
-
// src/prop-types/transform-prop-types/
|
|
433
|
-
var
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
|
|
455
|
+
// src/prop-types/transform-prop-types/rotate-transform.ts
|
|
456
|
+
var import_schema32 = require("@elementor/schema");
|
|
457
|
+
var rotateTransformPropTypeUtil = createPropUtils(
|
|
458
|
+
TransformFunctionKeys.rotate,
|
|
459
|
+
import_schema32.z.strictObject({
|
|
437
460
|
x: sizePropTypeUtil.schema.nullable(),
|
|
438
461
|
y: sizePropTypeUtil.schema.nullable(),
|
|
439
462
|
z: sizePropTypeUtil.schema.nullable()
|
|
440
463
|
})
|
|
441
464
|
);
|
|
442
465
|
|
|
466
|
+
// src/prop-types/transform-prop-types/scale-transform.ts
|
|
467
|
+
var import_schema33 = require("@elementor/schema");
|
|
468
|
+
var scaleTransformPropTypeUtil = createPropUtils(
|
|
469
|
+
TransformFunctionKeys.scale,
|
|
470
|
+
import_schema33.z.strictObject({
|
|
471
|
+
x: numberPropTypeUtil.schema.nullable(),
|
|
472
|
+
y: numberPropTypeUtil.schema.nullable(),
|
|
473
|
+
z: numberPropTypeUtil.schema.nullable()
|
|
474
|
+
})
|
|
475
|
+
);
|
|
476
|
+
|
|
477
|
+
// src/prop-types/transform-prop-types/skew-transform.ts
|
|
478
|
+
var import_schema34 = require("@elementor/schema");
|
|
479
|
+
var skewTransformPropTypeUtil = createPropUtils(
|
|
480
|
+
TransformFunctionKeys.skew,
|
|
481
|
+
import_schema34.z.strictObject({
|
|
482
|
+
x: sizePropTypeUtil.schema.nullable(),
|
|
483
|
+
y: sizePropTypeUtil.schema.nullable()
|
|
484
|
+
})
|
|
485
|
+
);
|
|
486
|
+
|
|
443
487
|
// src/prop-types/transform-prop-types/transform.ts
|
|
444
|
-
var
|
|
445
|
-
|
|
488
|
+
var filterTypes = import_schema35.z.union([
|
|
489
|
+
moveTransformPropTypeUtil.schema,
|
|
490
|
+
scaleTransformPropTypeUtil.schema,
|
|
491
|
+
rotateTransformPropTypeUtil.schema,
|
|
492
|
+
skewTransformPropTypeUtil.schema
|
|
493
|
+
]);
|
|
494
|
+
var transformPropTypeUtil = createPropUtils("transform", import_schema35.z.array(filterTypes));
|
|
446
495
|
|
|
447
496
|
// src/prop-types/filter-prop-types/backdrop-filter.ts
|
|
448
|
-
var
|
|
449
|
-
var backdropFilterPropTypeUtil = createPropUtils(
|
|
497
|
+
var import_schema36 = require("@elementor/schema");
|
|
498
|
+
var backdropFilterPropTypeUtil = createPropUtils(
|
|
499
|
+
"backdrop-filter",
|
|
500
|
+
import_schema36.z.array(cssFilterFunctionPropUtil.schema)
|
|
501
|
+
);
|
|
450
502
|
|
|
451
503
|
// src/utils/merge-props.ts
|
|
452
504
|
function mergeProps(current, updates) {
|
|
@@ -461,14 +513,26 @@ function mergeProps(current, updates) {
|
|
|
461
513
|
return props;
|
|
462
514
|
}
|
|
463
515
|
|
|
516
|
+
// src/utils/is-transformable.ts
|
|
517
|
+
var import_schema37 = require("@elementor/schema");
|
|
518
|
+
var transformableSchema = import_schema37.z.object({
|
|
519
|
+
$$type: import_schema37.z.string(),
|
|
520
|
+
value: import_schema37.z.any(),
|
|
521
|
+
disabled: import_schema37.z.boolean().optional()
|
|
522
|
+
});
|
|
523
|
+
var isTransformable = (value) => {
|
|
524
|
+
return transformableSchema.safeParse(value).success;
|
|
525
|
+
};
|
|
526
|
+
|
|
464
527
|
// src/utils/prop-dependency-utils.ts
|
|
465
|
-
function
|
|
466
|
-
if (!terms.length) {
|
|
467
|
-
return
|
|
528
|
+
function isDependencyMet(dependency, values) {
|
|
529
|
+
if (!dependency?.terms.length) {
|
|
530
|
+
return true;
|
|
468
531
|
}
|
|
532
|
+
const { relation, terms } = dependency;
|
|
469
533
|
const method = getRelationMethod(relation);
|
|
470
534
|
return terms[method](
|
|
471
|
-
(term) => isDependency(term) ?
|
|
535
|
+
(term) => isDependency(term) ? isDependencyMet(term, values) : evaluateTerm(term, extractValue(term.path, values)?.value)
|
|
472
536
|
);
|
|
473
537
|
}
|
|
474
538
|
function evaluateTerm(term, actualValue) {
|
|
@@ -506,7 +570,7 @@ function evaluateTerm(term, actualValue) {
|
|
|
506
570
|
const evaluation = !!actualValue || 0 === actualValue || false === actualValue;
|
|
507
571
|
return "exists" === operator === evaluation;
|
|
508
572
|
default:
|
|
509
|
-
return
|
|
573
|
+
return true;
|
|
510
574
|
}
|
|
511
575
|
}
|
|
512
576
|
function isNumber(value) {
|
|
@@ -522,26 +586,16 @@ function getRelationMethod(relation) {
|
|
|
522
586
|
throw new Error(`Relation not supported ${relation}`);
|
|
523
587
|
}
|
|
524
588
|
}
|
|
525
|
-
function
|
|
526
|
-
return path.reduce((acc, key) => {
|
|
527
|
-
|
|
589
|
+
function extractValue(path, elementValues) {
|
|
590
|
+
return path.reduce((acc, key, index) => {
|
|
591
|
+
const value = acc?.[key];
|
|
592
|
+
return index !== path.length - 1 && isTransformable(value) ? value.value ?? null : value;
|
|
528
593
|
}, elementValues);
|
|
529
594
|
}
|
|
530
595
|
function isDependency(term) {
|
|
531
596
|
return "relation" in term;
|
|
532
597
|
}
|
|
533
598
|
|
|
534
|
-
// src/utils/is-transformable.ts
|
|
535
|
-
var import_schema32 = require("@elementor/schema");
|
|
536
|
-
var transformableSchema = import_schema32.z.object({
|
|
537
|
-
$$type: import_schema32.z.string(),
|
|
538
|
-
value: import_schema32.z.any(),
|
|
539
|
-
disabled: import_schema32.z.boolean().optional()
|
|
540
|
-
});
|
|
541
|
-
var isTransformable = (value) => {
|
|
542
|
-
return transformableSchema.safeParse(value).success;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
599
|
// src/utils/filter-empty-values.ts
|
|
546
600
|
var filterEmptyValues = (value) => {
|
|
547
601
|
if (isEmpty(value)) {
|
|
@@ -579,31 +633,29 @@ var isNullishObject = (value) => {
|
|
|
579
633
|
backgroundImageSizeScalePropTypeUtil,
|
|
580
634
|
backgroundOverlayPropTypeUtil,
|
|
581
635
|
backgroundPropTypeUtil,
|
|
582
|
-
blurFilterPropTypeUtil,
|
|
583
636
|
booleanPropTypeUtil,
|
|
584
637
|
borderRadiusPropTypeUtil,
|
|
585
638
|
borderWidthPropTypeUtil,
|
|
586
639
|
boxShadowPropTypeUtil,
|
|
587
|
-
brightnessFilterPropTypeUtil,
|
|
588
640
|
classesPropTypeUtil,
|
|
589
641
|
colorPropTypeUtil,
|
|
590
642
|
colorStopPropTypeUtil,
|
|
591
|
-
contrastFilterPropTypeUtil,
|
|
592
643
|
createArrayPropUtils,
|
|
593
644
|
createPropUtils,
|
|
645
|
+
cssFilterFunctionPropUtil,
|
|
594
646
|
dimensionsPropTypeUtil,
|
|
595
647
|
dropShadowFilterPropTypeUtil,
|
|
596
648
|
evaluateTerm,
|
|
649
|
+
extractValue,
|
|
597
650
|
filterEmptyValues,
|
|
598
651
|
filterPropTypeUtil,
|
|
599
|
-
|
|
652
|
+
flexPropTypeUtil,
|
|
600
653
|
gradientColorStopPropTypeUtil,
|
|
601
|
-
grayscaleFilterPropTypeUtil,
|
|
602
|
-
hueRotateFilterPropTypeUtil,
|
|
603
654
|
imageAttachmentIdPropType,
|
|
604
655
|
imagePropTypeUtil,
|
|
605
656
|
imageSrcPropTypeUtil,
|
|
606
|
-
|
|
657
|
+
isDependency,
|
|
658
|
+
isDependencyMet,
|
|
607
659
|
isEmpty,
|
|
608
660
|
isTransformable,
|
|
609
661
|
keyValuePropTypeUtil,
|
|
@@ -613,11 +665,12 @@ var isNullishObject = (value) => {
|
|
|
613
665
|
moveTransformPropTypeUtil,
|
|
614
666
|
numberPropTypeUtil,
|
|
615
667
|
positionPropTypeUtil,
|
|
616
|
-
|
|
617
|
-
|
|
668
|
+
rotateTransformPropTypeUtil,
|
|
669
|
+
scaleTransformPropTypeUtil,
|
|
670
|
+
selectionSizePropTypeUtil,
|
|
618
671
|
shadowPropTypeUtil,
|
|
619
|
-
shouldApplyEffect,
|
|
620
672
|
sizePropTypeUtil,
|
|
673
|
+
skewTransformPropTypeUtil,
|
|
621
674
|
stringPropTypeUtil,
|
|
622
675
|
strokePropTypeUtil,
|
|
623
676
|
transformPropTypeUtil,
|