@elementor/editor-props 4.1.0-834 → 4.1.0-837
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 +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +84 -69
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/prop-types/index.ts +1 -0
- package/src/prop-types/number-range.ts +14 -0
- package/src/utils/props-to-llm-schema.ts +6 -27
package/dist/index.mjs
CHANGED
|
@@ -388,72 +388,82 @@ var gradientColorStopPropTypeUtil = createPropUtils(
|
|
|
388
388
|
z32.array(colorStopPropTypeUtil.schema)
|
|
389
389
|
);
|
|
390
390
|
|
|
391
|
-
// src/prop-types/
|
|
391
|
+
// src/prop-types/number-range.ts
|
|
392
392
|
import { z as z33 } from "@elementor/schema";
|
|
393
|
+
var numberRangePropTypeUtil = createPropUtils(
|
|
394
|
+
"number-range",
|
|
395
|
+
z33.strictObject({
|
|
396
|
+
min: unknownChildrenSchema,
|
|
397
|
+
max: unknownChildrenSchema
|
|
398
|
+
})
|
|
399
|
+
);
|
|
400
|
+
|
|
401
|
+
// src/prop-types/date-time.ts
|
|
402
|
+
import { z as z34 } from "@elementor/schema";
|
|
393
403
|
var DateTimePropTypeUtil = createPropUtils(
|
|
394
404
|
"date-time",
|
|
395
|
-
|
|
405
|
+
z34.strictObject({
|
|
396
406
|
date: unknownChildrenSchema,
|
|
397
407
|
time: unknownChildrenSchema
|
|
398
408
|
})
|
|
399
409
|
);
|
|
400
410
|
|
|
401
411
|
// src/prop-types/position.ts
|
|
402
|
-
import { z as
|
|
412
|
+
import { z as z35 } from "@elementor/schema";
|
|
403
413
|
var positionPropTypeUtil = createPropUtils(
|
|
404
414
|
"object-position",
|
|
405
|
-
|
|
415
|
+
z35.strictObject({
|
|
406
416
|
x: unknownChildrenSchema,
|
|
407
417
|
y: unknownChildrenSchema
|
|
408
418
|
})
|
|
409
419
|
);
|
|
410
420
|
|
|
411
421
|
// src/prop-types/query.ts
|
|
412
|
-
import { z as
|
|
422
|
+
import { z as z36 } from "@elementor/schema";
|
|
413
423
|
var queryPropTypeUtil = createPropUtils(
|
|
414
424
|
"query",
|
|
415
|
-
|
|
425
|
+
z36.strictObject({
|
|
416
426
|
id: unknownChildrenSchema,
|
|
417
427
|
label: unknownChildrenSchema
|
|
418
428
|
})
|
|
419
429
|
);
|
|
420
430
|
|
|
421
431
|
// src/prop-types/html.ts
|
|
422
|
-
import { z as
|
|
423
|
-
var htmlPropTypeUtil = createPropUtils("html",
|
|
432
|
+
import { z as z37 } from "@elementor/schema";
|
|
433
|
+
var htmlPropTypeUtil = createPropUtils("html", z37.string().nullable());
|
|
424
434
|
|
|
425
435
|
// src/prop-types/html-v2.ts
|
|
426
|
-
import { z as
|
|
427
|
-
var childElementSchema =
|
|
428
|
-
() =>
|
|
429
|
-
id:
|
|
430
|
-
type:
|
|
431
|
-
content:
|
|
432
|
-
children:
|
|
436
|
+
import { z as z38 } from "@elementor/schema";
|
|
437
|
+
var childElementSchema = z38.lazy(
|
|
438
|
+
() => z38.object({
|
|
439
|
+
id: z38.string(),
|
|
440
|
+
type: z38.string(),
|
|
441
|
+
content: z38.string().optional(),
|
|
442
|
+
children: z38.array(childElementSchema).optional()
|
|
433
443
|
})
|
|
434
444
|
);
|
|
435
|
-
var htmlV2ValueSchema =
|
|
436
|
-
content:
|
|
437
|
-
children:
|
|
445
|
+
var htmlV2ValueSchema = z38.object({
|
|
446
|
+
content: z38.string().nullable(),
|
|
447
|
+
children: z38.array(childElementSchema)
|
|
438
448
|
});
|
|
439
449
|
var htmlV2PropTypeUtil = createPropUtils("html-v2", htmlV2ValueSchema);
|
|
440
450
|
|
|
441
451
|
// src/prop-types/html-v3.ts
|
|
442
|
-
import { z as
|
|
443
|
-
var htmlV3ValueSchema =
|
|
452
|
+
import { z as z39 } from "@elementor/schema";
|
|
453
|
+
var htmlV3ValueSchema = z39.object({
|
|
444
454
|
content: stringPropTypeUtil.schema.nullable(),
|
|
445
|
-
children:
|
|
455
|
+
children: z39.array(z39.unknown())
|
|
446
456
|
});
|
|
447
457
|
var htmlV3PropTypeUtil = createPropUtils("html-v3", htmlV3ValueSchema);
|
|
448
458
|
|
|
449
459
|
// src/prop-types/filter-prop-types/filter.ts
|
|
450
|
-
import { z as
|
|
460
|
+
import { z as z45 } from "@elementor/schema";
|
|
451
461
|
|
|
452
462
|
// src/prop-types/filter-prop-types/drop-shadow-filter.ts
|
|
453
|
-
import { z as
|
|
463
|
+
import { z as z40 } from "@elementor/schema";
|
|
454
464
|
var dropShadowFilterPropTypeUtil = createPropUtils(
|
|
455
465
|
"drop-shadow",
|
|
456
|
-
|
|
466
|
+
z40.object({
|
|
457
467
|
xAxis: unknownChildrenSchema,
|
|
458
468
|
yAxis: unknownChildrenSchema,
|
|
459
469
|
blur: unknownChildrenSchema,
|
|
@@ -462,37 +472,37 @@ var dropShadowFilterPropTypeUtil = createPropUtils(
|
|
|
462
472
|
);
|
|
463
473
|
|
|
464
474
|
// src/prop-types/filter-prop-types/filter-functions/blur-filter.ts
|
|
465
|
-
import { z as
|
|
475
|
+
import { z as z41 } from "@elementor/schema";
|
|
466
476
|
var blurFilterPropTypeUtil = createPropUtils(
|
|
467
477
|
"blur",
|
|
468
|
-
|
|
478
|
+
z41.strictObject({
|
|
469
479
|
size: unknownChildrenSchema
|
|
470
480
|
})
|
|
471
481
|
);
|
|
472
482
|
|
|
473
483
|
// src/prop-types/filter-prop-types/filter-functions/color-tone-filter.ts
|
|
474
|
-
import { z as
|
|
484
|
+
import { z as z42 } from "@elementor/schema";
|
|
475
485
|
var colorToneFilterPropTypeUtil = createPropUtils(
|
|
476
486
|
"color-tone",
|
|
477
|
-
|
|
487
|
+
z42.strictObject({
|
|
478
488
|
size: unknownChildrenSchema
|
|
479
489
|
})
|
|
480
490
|
);
|
|
481
491
|
|
|
482
492
|
// src/prop-types/filter-prop-types/filter-functions/hue-rotate-filter.ts
|
|
483
|
-
import { z as
|
|
493
|
+
import { z as z43 } from "@elementor/schema";
|
|
484
494
|
var hueRotateFilterPropTypeUtil = createPropUtils(
|
|
485
495
|
"hue-rotate",
|
|
486
|
-
|
|
496
|
+
z43.strictObject({
|
|
487
497
|
size: unknownChildrenSchema
|
|
488
498
|
})
|
|
489
499
|
);
|
|
490
500
|
|
|
491
501
|
// src/prop-types/filter-prop-types/filter-functions/intensity-filter.ts
|
|
492
|
-
import { z as
|
|
502
|
+
import { z as z44 } from "@elementor/schema";
|
|
493
503
|
var intensityFilterPropTypeUtil = createPropUtils(
|
|
494
504
|
"intensity",
|
|
495
|
-
|
|
505
|
+
z44.strictObject({
|
|
496
506
|
size: unknownChildrenSchema
|
|
497
507
|
})
|
|
498
508
|
);
|
|
@@ -500,9 +510,9 @@ var intensityFilterPropTypeUtil = createPropUtils(
|
|
|
500
510
|
// src/prop-types/filter-prop-types/filter.ts
|
|
501
511
|
var cssFilterFunctionPropUtil = createPropUtils(
|
|
502
512
|
"css-filter-func",
|
|
503
|
-
|
|
513
|
+
z45.object({
|
|
504
514
|
func: stringPropTypeUtil.schema,
|
|
505
|
-
args:
|
|
515
|
+
args: z45.union([
|
|
506
516
|
blurFilterPropTypeUtil.schema,
|
|
507
517
|
intensityFilterPropTypeUtil.schema,
|
|
508
518
|
colorToneFilterPropTypeUtil.schema,
|
|
@@ -511,13 +521,13 @@ var cssFilterFunctionPropUtil = createPropUtils(
|
|
|
511
521
|
])
|
|
512
522
|
})
|
|
513
523
|
);
|
|
514
|
-
var filterPropTypeUtil = createPropUtils("filter",
|
|
524
|
+
var filterPropTypeUtil = createPropUtils("filter", z45.array(cssFilterFunctionPropUtil.schema));
|
|
515
525
|
|
|
516
526
|
// src/prop-types/transform-prop-types/transform.ts
|
|
517
|
-
import { z as
|
|
527
|
+
import { z as z46 } from "@elementor/schema";
|
|
518
528
|
var transformPropTypeUtil = createPropUtils(
|
|
519
529
|
"transform",
|
|
520
|
-
|
|
530
|
+
z46.strictObject({
|
|
521
531
|
"transform-functions": unknownChildrenSchema,
|
|
522
532
|
"transform-origin": unknownChildrenSchema,
|
|
523
533
|
perspective: unknownChildrenSchema,
|
|
@@ -526,10 +536,10 @@ var transformPropTypeUtil = createPropUtils(
|
|
|
526
536
|
);
|
|
527
537
|
|
|
528
538
|
// src/prop-types/transform-prop-types/transform-functions.ts
|
|
529
|
-
import { z as
|
|
539
|
+
import { z as z51 } from "@elementor/schema";
|
|
530
540
|
|
|
531
541
|
// src/prop-types/transform-prop-types/transform-functions/move-transform.ts
|
|
532
|
-
import { z as
|
|
542
|
+
import { z as z47 } from "@elementor/schema";
|
|
533
543
|
|
|
534
544
|
// src/prop-types/transform-prop-types/types.ts
|
|
535
545
|
var TransformFunctionKeys = {
|
|
@@ -542,7 +552,7 @@ var TransformFunctionKeys = {
|
|
|
542
552
|
// src/prop-types/transform-prop-types/transform-functions/move-transform.ts
|
|
543
553
|
var moveTransformPropTypeUtil = createPropUtils(
|
|
544
554
|
TransformFunctionKeys.move,
|
|
545
|
-
|
|
555
|
+
z47.strictObject({
|
|
546
556
|
x: unknownChildrenSchema,
|
|
547
557
|
y: unknownChildrenSchema,
|
|
548
558
|
z: unknownChildrenSchema
|
|
@@ -550,10 +560,10 @@ var moveTransformPropTypeUtil = createPropUtils(
|
|
|
550
560
|
);
|
|
551
561
|
|
|
552
562
|
// src/prop-types/transform-prop-types/transform-functions/rotate-transform.ts
|
|
553
|
-
import { z as
|
|
563
|
+
import { z as z48 } from "@elementor/schema";
|
|
554
564
|
var rotateTransformPropTypeUtil = createPropUtils(
|
|
555
565
|
TransformFunctionKeys.rotate,
|
|
556
|
-
|
|
566
|
+
z48.strictObject({
|
|
557
567
|
x: unknownChildrenSchema,
|
|
558
568
|
y: unknownChildrenSchema,
|
|
559
569
|
z: unknownChildrenSchema
|
|
@@ -561,10 +571,10 @@ var rotateTransformPropTypeUtil = createPropUtils(
|
|
|
561
571
|
);
|
|
562
572
|
|
|
563
573
|
// src/prop-types/transform-prop-types/transform-functions/scale-transform.ts
|
|
564
|
-
import { z as
|
|
574
|
+
import { z as z49 } from "@elementor/schema";
|
|
565
575
|
var scaleTransformPropTypeUtil = createPropUtils(
|
|
566
576
|
TransformFunctionKeys.scale,
|
|
567
|
-
|
|
577
|
+
z49.strictObject({
|
|
568
578
|
x: numberPropTypeUtil.schema.nullable(),
|
|
569
579
|
y: numberPropTypeUtil.schema.nullable(),
|
|
570
580
|
z: numberPropTypeUtil.schema.nullable()
|
|
@@ -572,10 +582,10 @@ var scaleTransformPropTypeUtil = createPropUtils(
|
|
|
572
582
|
);
|
|
573
583
|
|
|
574
584
|
// src/prop-types/transform-prop-types/transform-functions/skew-transform.ts
|
|
575
|
-
import { z as
|
|
585
|
+
import { z as z50 } from "@elementor/schema";
|
|
576
586
|
var skewTransformPropTypeUtil = createPropUtils(
|
|
577
587
|
TransformFunctionKeys.skew,
|
|
578
|
-
|
|
588
|
+
z50.strictObject({
|
|
579
589
|
x: unknownChildrenSchema,
|
|
580
590
|
y: unknownChildrenSchema
|
|
581
591
|
})
|
|
@@ -583,13 +593,13 @@ var skewTransformPropTypeUtil = createPropUtils(
|
|
|
583
593
|
|
|
584
594
|
// src/prop-types/transform-prop-types/transform-functions.ts
|
|
585
595
|
var filterTypes = moveTransformPropTypeUtil.schema.or(scaleTransformPropTypeUtil.schema).or(rotateTransformPropTypeUtil.schema).or(skewTransformPropTypeUtil.schema);
|
|
586
|
-
var transformFunctionsPropTypeUtil = createPropUtils("transform-functions",
|
|
596
|
+
var transformFunctionsPropTypeUtil = createPropUtils("transform-functions", z51.array(filterTypes));
|
|
587
597
|
|
|
588
598
|
// src/prop-types/transform-prop-types/transform-origin.ts
|
|
589
|
-
import { z as
|
|
599
|
+
import { z as z52 } from "@elementor/schema";
|
|
590
600
|
var transformOriginPropTypeUtil = createPropUtils(
|
|
591
601
|
"transform-origin",
|
|
592
|
-
|
|
602
|
+
z52.strictObject({
|
|
593
603
|
x: unknownChildrenSchema,
|
|
594
604
|
y: unknownChildrenSchema,
|
|
595
605
|
z: unknownChildrenSchema
|
|
@@ -597,49 +607,49 @@ var transformOriginPropTypeUtil = createPropUtils(
|
|
|
597
607
|
);
|
|
598
608
|
|
|
599
609
|
// src/prop-types/transform-prop-types/perspective-origin.ts
|
|
600
|
-
import { z as
|
|
610
|
+
import { z as z53 } from "@elementor/schema";
|
|
601
611
|
var perspectiveOriginPropTypeUtil = createPropUtils(
|
|
602
612
|
"perspective-origin",
|
|
603
|
-
|
|
613
|
+
z53.strictObject({
|
|
604
614
|
x: unknownChildrenSchema,
|
|
605
615
|
y: unknownChildrenSchema
|
|
606
616
|
})
|
|
607
617
|
);
|
|
608
618
|
|
|
609
619
|
// src/prop-types/filter-prop-types/backdrop-filter.ts
|
|
610
|
-
import { z as
|
|
620
|
+
import { z as z54 } from "@elementor/schema";
|
|
611
621
|
var backdropFilterPropTypeUtil = createPropUtils(
|
|
612
622
|
"backdrop-filter",
|
|
613
|
-
|
|
623
|
+
z54.array(cssFilterFunctionPropUtil.schema)
|
|
614
624
|
);
|
|
615
625
|
|
|
616
626
|
// src/prop-types/date-range.ts
|
|
617
|
-
import { z as
|
|
627
|
+
import { z as z55 } from "@elementor/schema";
|
|
618
628
|
var dateRangePropTypeUtil = createPropUtils(
|
|
619
629
|
"date-range",
|
|
620
|
-
|
|
630
|
+
z55.strictObject({
|
|
621
631
|
min: unknownChildrenSchema,
|
|
622
632
|
max: unknownChildrenSchema
|
|
623
633
|
})
|
|
624
634
|
);
|
|
625
635
|
|
|
626
636
|
// src/prop-types/date-string.ts
|
|
627
|
-
import { z as
|
|
628
|
-
var dateStringPropTypeUtil = createPropUtils("date-string",
|
|
637
|
+
import { z as z56 } from "@elementor/schema";
|
|
638
|
+
var dateStringPropTypeUtil = createPropUtils("date-string", z56.string());
|
|
629
639
|
|
|
630
640
|
// src/prop-types/time-range.ts
|
|
631
|
-
import { z as
|
|
641
|
+
import { z as z57 } from "@elementor/schema";
|
|
632
642
|
var timeRangePropTypeUtil = createPropUtils(
|
|
633
643
|
"time-range",
|
|
634
|
-
|
|
644
|
+
z57.strictObject({
|
|
635
645
|
min: unknownChildrenSchema,
|
|
636
646
|
max: unknownChildrenSchema
|
|
637
647
|
})
|
|
638
648
|
);
|
|
639
649
|
|
|
640
650
|
// src/prop-types/time-string.ts
|
|
641
|
-
import { z as
|
|
642
|
-
var timeStringPropTypeUtil = createPropUtils("time-string",
|
|
651
|
+
import { z as z58 } from "@elementor/schema";
|
|
652
|
+
var timeStringPropTypeUtil = createPropUtils("time-string", z58.string());
|
|
643
653
|
|
|
644
654
|
// src/utils/adjust-llm-prop-value-schema.ts
|
|
645
655
|
var ensureNotNull = (v, fallback) => v === null ? fallback : v;
|
|
@@ -957,11 +967,14 @@ function convertPropTypeToJsonSchema(propType) {
|
|
|
957
967
|
return propTypeToJsonSchema(propType);
|
|
958
968
|
}
|
|
959
969
|
var nonConfigurablePropKeys = ["_cssid", "classes", "attributes"];
|
|
960
|
-
function isPropKeyConfigurable(propKey) {
|
|
961
|
-
|
|
970
|
+
function isPropKeyConfigurable(propKey, propType) {
|
|
971
|
+
if (!nonConfigurablePropKeys.includes(propKey)) {
|
|
972
|
+
return true;
|
|
973
|
+
}
|
|
974
|
+
return !!(!Array.isArray(propType?.meta) && propType?.meta?.llm_configurable);
|
|
962
975
|
}
|
|
963
976
|
function configurableKeys(schema) {
|
|
964
|
-
return Object.keys(schema).filter(isPropKeyConfigurable);
|
|
977
|
+
return Object.keys(schema).filter((key) => isPropKeyConfigurable(key, schema[key]));
|
|
965
978
|
}
|
|
966
979
|
function enrichWithIntention(jsonSchema, text = "Describe the desired outcome") {
|
|
967
980
|
const result = structuredClone(jsonSchema);
|
|
@@ -1063,11 +1076,11 @@ var validatePropValue = (schema, value) => {
|
|
|
1063
1076
|
};
|
|
1064
1077
|
|
|
1065
1078
|
// src/utils/is-transformable.ts
|
|
1066
|
-
import { z as
|
|
1067
|
-
var transformableSchema =
|
|
1068
|
-
$$type:
|
|
1069
|
-
value:
|
|
1070
|
-
disabled:
|
|
1079
|
+
import { z as z59 } from "@elementor/schema";
|
|
1080
|
+
var transformableSchema = z59.object({
|
|
1081
|
+
$$type: z59.string(),
|
|
1082
|
+
value: z59.any(),
|
|
1083
|
+
disabled: z59.boolean().optional()
|
|
1071
1084
|
});
|
|
1072
1085
|
var isTransformable = (value) => {
|
|
1073
1086
|
return transformableSchema.safeParse(value).success;
|
|
@@ -1359,6 +1372,7 @@ export {
|
|
|
1359
1372
|
mergeProps,
|
|
1360
1373
|
moveTransformPropTypeUtil,
|
|
1361
1374
|
numberPropTypeUtil,
|
|
1375
|
+
numberRangePropTypeUtil,
|
|
1362
1376
|
parseHtmlChildren,
|
|
1363
1377
|
perspectiveOriginPropTypeUtil,
|
|
1364
1378
|
positionPropTypeUtil,
|