@symbo.ls/atoms 2.34.27 → 2.34.30
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/Box.js +732 -420
- package/Text.js +93 -41
- package/package.json +6 -6
package/Box.js
CHANGED
|
@@ -348,8 +348,10 @@ export const Box = {
|
|
|
348
348
|
class: {
|
|
349
349
|
// flex
|
|
350
350
|
...{
|
|
351
|
-
flow: (
|
|
352
|
-
const {
|
|
351
|
+
flow: (element) => {
|
|
352
|
+
const { props, deps } = element
|
|
353
|
+
const flow = deps.exec.call(element, props.flow)
|
|
354
|
+
const reverse = deps.exec.call(element, props.reverse)
|
|
353
355
|
if (!isString(flow)) return
|
|
354
356
|
let [direction, wrap] = (flow || 'row').split(' ')
|
|
355
357
|
if (flow.startsWith('x') || flow === 'row') direction = 'row'
|
|
@@ -363,11 +365,17 @@ export const Box = {
|
|
|
363
365
|
(wrap || '')
|
|
364
366
|
}
|
|
365
367
|
},
|
|
366
|
-
wrap: (
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
if (!
|
|
370
|
-
|
|
368
|
+
wrap: (element) => {
|
|
369
|
+
const { props, deps } = element
|
|
370
|
+
const val = deps.exec.call(element, props.wrap)
|
|
371
|
+
if (!val) return
|
|
372
|
+
return { display: 'flex', flexWrap: val }
|
|
373
|
+
},
|
|
374
|
+
align: (element) => {
|
|
375
|
+
const { props, deps } = element
|
|
376
|
+
const val = deps.exec.call(element, props.align)
|
|
377
|
+
if (!isString(val)) return
|
|
378
|
+
const [alignItems, justifyContent] = val.split(' ')
|
|
371
379
|
return { display: 'flex', alignItems, justifyContent }
|
|
372
380
|
}
|
|
373
381
|
},
|
|
@@ -393,15 +401,19 @@ export const Box = {
|
|
|
393
401
|
return deps.transformSizeRatio.call(el, 'width', props)
|
|
394
402
|
},
|
|
395
403
|
|
|
396
|
-
boxSizing: (
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
404
|
+
boxSizing: (element) => {
|
|
405
|
+
const { props, deps } = element
|
|
406
|
+
const val = deps.exec.call(element, props.boxSizing)
|
|
407
|
+
return !deps.isUndefined(val)
|
|
408
|
+
? { boxSizing: val }
|
|
409
|
+
: { boxSizing: 'border-box' }
|
|
410
|
+
},
|
|
400
411
|
|
|
401
412
|
boxSize: (el) => {
|
|
402
413
|
const { props, deps } = el
|
|
403
|
-
|
|
404
|
-
|
|
414
|
+
const val = deps.exec.call(el, props.boxSize)
|
|
415
|
+
if (!deps.isString(val)) return
|
|
416
|
+
const [height, width] = val.split(' ')
|
|
405
417
|
return {
|
|
406
418
|
...deps.transformSize.call(el, 'height', height),
|
|
407
419
|
...deps.transformSize.call(el, 'width', width || height)
|
|
@@ -427,8 +439,9 @@ export const Box = {
|
|
|
427
439
|
},
|
|
428
440
|
widthRange: (el) => {
|
|
429
441
|
const { props, deps } = el
|
|
430
|
-
|
|
431
|
-
|
|
442
|
+
const val = deps.exec.call(el, props.widthRange)
|
|
443
|
+
if (!deps.isString(val)) return
|
|
444
|
+
const [minWidth, maxWidth] = val.split(' ')
|
|
432
445
|
return {
|
|
433
446
|
...deps.transformSize.call(el, 'minWidth', minWidth),
|
|
434
447
|
...deps.transformSize.call(el, 'maxWidth', maxWidth || minWidth)
|
|
@@ -445,8 +458,9 @@ export const Box = {
|
|
|
445
458
|
},
|
|
446
459
|
heightRange: (el) => {
|
|
447
460
|
const { props, deps } = el
|
|
448
|
-
|
|
449
|
-
|
|
461
|
+
const val = deps.exec.call(el, props.heightRange)
|
|
462
|
+
if (!deps.isString(val)) return
|
|
463
|
+
const [minHeight, maxHeight] = val.split(' ')
|
|
450
464
|
return {
|
|
451
465
|
...deps.transformSize.call(el, 'minHeight', minHeight),
|
|
452
466
|
...deps.transformSize.call(el, 'maxHeight', maxHeight || minHeight)
|
|
@@ -455,8 +469,9 @@ export const Box = {
|
|
|
455
469
|
|
|
456
470
|
size: (el) => {
|
|
457
471
|
const { props, deps } = el
|
|
458
|
-
|
|
459
|
-
|
|
472
|
+
const val = deps.exec.call(el, props.size)
|
|
473
|
+
if (!deps.isString(val)) return
|
|
474
|
+
const [inlineSize, blockSize] = val.split(' ')
|
|
460
475
|
return {
|
|
461
476
|
...deps.transformSizeRatio.call(el, 'inlineSize', inlineSize),
|
|
462
477
|
...deps.transformSizeRatio.call(
|
|
@@ -487,8 +502,9 @@ export const Box = {
|
|
|
487
502
|
|
|
488
503
|
minSize: (el) => {
|
|
489
504
|
const { props, deps } = el
|
|
490
|
-
|
|
491
|
-
|
|
505
|
+
const val = deps.exec.call(el, props.minSize)
|
|
506
|
+
if (!deps.isString(val)) return
|
|
507
|
+
const [minInlineSize, minBlockSize] = val.split(' ')
|
|
492
508
|
return {
|
|
493
509
|
...deps.transformSize.call(el, 'minInlineSize', minInlineSize),
|
|
494
510
|
...deps.transformSize.call(
|
|
@@ -501,8 +517,9 @@ export const Box = {
|
|
|
501
517
|
|
|
502
518
|
maxSize: (el) => {
|
|
503
519
|
const { props, deps } = el
|
|
504
|
-
|
|
505
|
-
|
|
520
|
+
const val = deps.exec.call(el, props.maxSize)
|
|
521
|
+
if (!deps.isString(val)) return
|
|
522
|
+
const [maxInlineSize, maxBlockSize] = val.split(' ')
|
|
506
523
|
return {
|
|
507
524
|
...deps.transformSize.call(el, 'maxInlineSize', maxInlineSize),
|
|
508
525
|
...deps.transformSize.call(
|
|
@@ -528,9 +545,9 @@ export const Box = {
|
|
|
528
545
|
},
|
|
529
546
|
paddingInline: (el) => {
|
|
530
547
|
const { props, deps } = el
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
548
|
+
const val = deps.exec.call(el, props.paddingInline)
|
|
549
|
+
if (!deps.isString(val)) return
|
|
550
|
+
const [paddingInlineStart, paddingInlineEnd] = val.split(' ')
|
|
534
551
|
return {
|
|
535
552
|
...deps.transformSize.call(
|
|
536
553
|
el,
|
|
@@ -545,9 +562,9 @@ export const Box = {
|
|
|
545
562
|
},
|
|
546
563
|
paddingBlock: (el) => {
|
|
547
564
|
const { props, deps } = el
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
565
|
+
const val = deps.exec.call(el, props.paddingBlock)
|
|
566
|
+
if (!deps.isString(val)) return
|
|
567
|
+
const [paddingBlockStart, paddingBlockEnd] = val.split(' ')
|
|
551
568
|
return {
|
|
552
569
|
...deps.transformSize.call(
|
|
553
570
|
el,
|
|
@@ -583,9 +600,9 @@ export const Box = {
|
|
|
583
600
|
},
|
|
584
601
|
marginInline: (el) => {
|
|
585
602
|
const { props, deps } = el
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
603
|
+
const val = deps.exec.call(el, props.marginInline)
|
|
604
|
+
if (!deps.isString(val)) return
|
|
605
|
+
const [marginInlineStart, marginInlineEnd] = val.split(' ')
|
|
589
606
|
return {
|
|
590
607
|
...deps.transformSize.call(
|
|
591
608
|
el,
|
|
@@ -600,8 +617,9 @@ export const Box = {
|
|
|
600
617
|
},
|
|
601
618
|
marginBlock: (el) => {
|
|
602
619
|
const { props, deps } = el
|
|
603
|
-
|
|
604
|
-
|
|
620
|
+
const val = deps.exec.call(el, props.marginBlock)
|
|
621
|
+
if (!deps.isString(val)) return
|
|
622
|
+
const [marginBlockStart, marginBlockEnd] = val.split(' ')
|
|
605
623
|
return {
|
|
606
624
|
...deps.transformSize.call(el, 'marginBlockStart', marginBlockStart),
|
|
607
625
|
...deps.transformSize(
|
|
@@ -627,28 +645,42 @@ export const Box = {
|
|
|
627
645
|
return deps.transformSizeRatio.call(el, 'marginBlockEnd', props)
|
|
628
646
|
},
|
|
629
647
|
|
|
630
|
-
gap: (
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
648
|
+
gap: (element) => {
|
|
649
|
+
const { props, deps } = element
|
|
650
|
+
const val = deps.exec.call(element, props.gap)
|
|
651
|
+
if (deps.isUndefined(val)) return
|
|
652
|
+
return { gap: transfromGap(val) }
|
|
653
|
+
},
|
|
634
654
|
|
|
635
|
-
columnGap: (
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
655
|
+
columnGap: (element) => {
|
|
656
|
+
const { props, deps } = element
|
|
657
|
+
const val = deps.exec.call(element, props.columnGap)
|
|
658
|
+
if (deps.isUndefined(val)) return
|
|
659
|
+
return deps.getSpacingBasedOnRatio(
|
|
660
|
+
{ ...props, columnGap: val },
|
|
661
|
+
'columnGap'
|
|
662
|
+
)
|
|
663
|
+
},
|
|
664
|
+
rowGap: (element) => {
|
|
665
|
+
const { props, deps } = element
|
|
666
|
+
const val = deps.exec.call(element, props.rowGap)
|
|
667
|
+
if (deps.isUndefined(val)) return
|
|
668
|
+
return deps.getSpacingBasedOnRatio({ ...props, rowGap: val }, 'rowGap')
|
|
669
|
+
},
|
|
670
|
+
|
|
671
|
+
flexWrap: (element) => {
|
|
672
|
+
const { props, deps } = element
|
|
673
|
+
const val = deps.exec.call(element, props.flexWrap)
|
|
674
|
+
if (deps.isUndefined(val)) return
|
|
675
|
+
return {
|
|
646
676
|
display: 'flex',
|
|
647
|
-
flexFlow:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
flexFlow: (
|
|
651
|
-
const {
|
|
677
|
+
flexFlow: (props.flexFlow || 'row').split(' ')[0] + ' ' + val
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
flexFlow: (element) => {
|
|
681
|
+
const { props, deps } = element
|
|
682
|
+
const flexFlow = deps.exec.call(element, props.flexFlow)
|
|
683
|
+
const reverse = deps.exec.call(element, props.reverse)
|
|
652
684
|
if (!deps.isString(flexFlow)) return
|
|
653
685
|
let [direction, wrap] = (flexFlow || 'row').split(' ')
|
|
654
686
|
if (flexFlow.startsWith('x') || flexFlow === 'row') direction = 'row'
|
|
@@ -665,8 +697,9 @@ export const Box = {
|
|
|
665
697
|
},
|
|
666
698
|
flexAlign: (el) => {
|
|
667
699
|
const { props, deps } = el
|
|
668
|
-
|
|
669
|
-
|
|
700
|
+
const val = deps.exec.call(el, props.flexAlign)
|
|
701
|
+
if (!deps.isString(val)) return
|
|
702
|
+
const [alignItems, justifyContent] = val.split(' ')
|
|
670
703
|
return {
|
|
671
704
|
display: 'flex',
|
|
672
705
|
alignItems,
|
|
@@ -675,130 +708,195 @@ export const Box = {
|
|
|
675
708
|
},
|
|
676
709
|
|
|
677
710
|
// block:css
|
|
678
|
-
display: (
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
711
|
+
display: (element) => {
|
|
712
|
+
const { props, deps } = element
|
|
713
|
+
const val = deps.exec.call(element, props.display)
|
|
714
|
+
if (deps.isUndefined(val)) return
|
|
715
|
+
return { display: val }
|
|
716
|
+
},
|
|
682
717
|
|
|
683
|
-
direction: (
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
718
|
+
direction: (element) => {
|
|
719
|
+
const { props, deps } = element
|
|
720
|
+
const val = deps.exec.call(element, props.direction)
|
|
721
|
+
if (deps.isUndefined(val)) return
|
|
722
|
+
return { direction: val }
|
|
723
|
+
},
|
|
687
724
|
|
|
688
|
-
objectFit: (
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
725
|
+
objectFit: (element) => {
|
|
726
|
+
const { props, deps } = element
|
|
727
|
+
const val = deps.exec.call(element, props.objectFit)
|
|
728
|
+
if (deps.isUndefined(val)) return
|
|
729
|
+
return { objectFit: val }
|
|
730
|
+
},
|
|
692
731
|
|
|
693
|
-
aspectRatio: (
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
732
|
+
aspectRatio: (element) => {
|
|
733
|
+
const { props, deps } = element
|
|
734
|
+
const val = deps.exec.call(element, props.aspectRatio)
|
|
735
|
+
if (deps.isUndefined(val)) return
|
|
736
|
+
return { aspectRatio: val }
|
|
737
|
+
},
|
|
697
738
|
|
|
698
|
-
gridArea: (
|
|
699
|
-
|
|
739
|
+
gridArea: (element) => {
|
|
740
|
+
const { props, deps } = element
|
|
741
|
+
const val = deps.exec.call(element, props.gridArea)
|
|
742
|
+
if (!val) return
|
|
743
|
+
return { gridArea: val }
|
|
744
|
+
},
|
|
700
745
|
|
|
701
|
-
float: (
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
746
|
+
float: (element) => {
|
|
747
|
+
const { props, deps } = element
|
|
748
|
+
const val = deps.exec.call(element, props.float)
|
|
749
|
+
if (deps.isUndefined(val)) return
|
|
750
|
+
return { float: val }
|
|
751
|
+
},
|
|
705
752
|
|
|
706
|
-
flex: (
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
}
|
|
753
|
+
flex: (element) => {
|
|
754
|
+
const { props, deps } = element
|
|
755
|
+
const val = deps.exec.call(element, props.flex)
|
|
756
|
+
if (deps.isUndefined(val)) return
|
|
757
|
+
return { flex: val }
|
|
758
|
+
},
|
|
759
|
+
flexDirection: (element) => {
|
|
760
|
+
const { props, deps } = element
|
|
761
|
+
const val = deps.exec.call(element, props.flexDirection)
|
|
762
|
+
if (deps.isUndefined(val)) return
|
|
763
|
+
return { flexDirection: val }
|
|
764
|
+
},
|
|
765
|
+
alignItems: (element) => {
|
|
766
|
+
const { props, deps } = element
|
|
767
|
+
const val = deps.exec.call(element, props.alignItems)
|
|
768
|
+
if (deps.isUndefined(val)) return
|
|
769
|
+
return { alignItems: val }
|
|
770
|
+
},
|
|
771
|
+
alignContent: (element) => {
|
|
772
|
+
const { props, deps } = element
|
|
773
|
+
const val = deps.exec.call(element, props.alignContent)
|
|
774
|
+
if (deps.isUndefined(val)) return
|
|
775
|
+
return { alignContent: val }
|
|
776
|
+
},
|
|
777
|
+
justifyContent: (element) => {
|
|
778
|
+
const { props, deps } = element
|
|
779
|
+
const val = deps.exec.call(element, props.justifyContent)
|
|
780
|
+
if (deps.isUndefined(val)) return
|
|
781
|
+
return { justifyContent: val }
|
|
782
|
+
},
|
|
783
|
+
justifyItems: (element) => {
|
|
784
|
+
const { props, deps } = element
|
|
785
|
+
const val = deps.exec.call(element, props.justifyItems)
|
|
786
|
+
if (deps.isUndefined(val)) return
|
|
787
|
+
return { justifyItems: val }
|
|
788
|
+
},
|
|
789
|
+
alignSelf: (element) => {
|
|
790
|
+
const { props, deps } = element
|
|
791
|
+
const val = deps.exec.call(element, props.alignSelf)
|
|
792
|
+
if (deps.isUndefined(val)) return
|
|
793
|
+
return { alignSelf: val }
|
|
794
|
+
},
|
|
795
|
+
order: (element) => {
|
|
796
|
+
const { props, deps } = element
|
|
797
|
+
const val = deps.exec.call(element, props.order)
|
|
798
|
+
if (deps.isUndefined(val)) return
|
|
799
|
+
return { order: val }
|
|
800
|
+
},
|
|
738
801
|
|
|
739
|
-
gridColumn: (
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
802
|
+
gridColumn: (element) => {
|
|
803
|
+
const { props, deps } = element
|
|
804
|
+
const val = deps.exec.call(element, props.gridColumn)
|
|
805
|
+
if (deps.isUndefined(val)) return
|
|
806
|
+
return { gridColumn: val }
|
|
807
|
+
},
|
|
808
|
+
gridColumnStart: (element) => {
|
|
809
|
+
const { props, deps } = element
|
|
810
|
+
const val = deps.exec.call(element, props.gridColumnStart)
|
|
811
|
+
if (deps.isUndefined(val)) return
|
|
812
|
+
return { gridColumnStart: val }
|
|
813
|
+
},
|
|
814
|
+
gridRow: (element) => {
|
|
815
|
+
const { props, deps } = element
|
|
816
|
+
const val = deps.exec.call(element, props.gridRow)
|
|
817
|
+
if (deps.isUndefined(val)) return
|
|
818
|
+
return { gridRow: val }
|
|
819
|
+
},
|
|
820
|
+
gridRowStart: (element) => {
|
|
821
|
+
const { props, deps } = element
|
|
822
|
+
const val = deps.exec.call(element, props.gridRowStart)
|
|
823
|
+
if (deps.isUndefined(val)) return
|
|
824
|
+
return { gridRowStart: val }
|
|
825
|
+
},
|
|
755
826
|
|
|
756
|
-
resize: (
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
827
|
+
resize: (element) => {
|
|
828
|
+
const { props, deps } = element
|
|
829
|
+
const val = deps.exec.call(element, props.resize)
|
|
830
|
+
if (deps.isUndefined(val)) return
|
|
831
|
+
return { resize: val }
|
|
832
|
+
},
|
|
760
833
|
|
|
761
|
-
verticalAlign: (
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
834
|
+
verticalAlign: (element) => {
|
|
835
|
+
const { props, deps } = element
|
|
836
|
+
const val = deps.exec.call(element, props.verticalAlign)
|
|
837
|
+
if (deps.isUndefined(val)) return
|
|
838
|
+
return { verticalAlign: val }
|
|
839
|
+
},
|
|
765
840
|
|
|
766
|
-
columns: (
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
841
|
+
columns: (element) => {
|
|
842
|
+
const { props, deps } = element
|
|
843
|
+
const val = deps.exec.call(element, props.columns)
|
|
844
|
+
if (deps.isUndefined(val)) return
|
|
845
|
+
return { columns: val }
|
|
846
|
+
},
|
|
847
|
+
columnRule: (element) => {
|
|
848
|
+
const { props, deps } = element
|
|
849
|
+
const val = deps.exec.call(element, props.columnRule)
|
|
850
|
+
if (deps.isUndefined(val)) return
|
|
851
|
+
return { columnRule: val }
|
|
852
|
+
},
|
|
853
|
+
columnWidth: (element) => {
|
|
854
|
+
const { props, deps } = element
|
|
855
|
+
const val = deps.exec.call(element, props.columnWidth)
|
|
856
|
+
if (deps.isUndefined(val)) return
|
|
857
|
+
return { columnWidth: val }
|
|
858
|
+
},
|
|
859
|
+
columnSpan: (element) => {
|
|
860
|
+
const { props, deps } = element
|
|
861
|
+
const val = deps.exec.call(element, props.columnSpan)
|
|
862
|
+
if (deps.isUndefined(val)) return
|
|
863
|
+
return { columnSpan: val }
|
|
864
|
+
},
|
|
865
|
+
columnFill: (element) => {
|
|
866
|
+
const { props, deps } = element
|
|
867
|
+
const val = deps.exec.call(element, props.columnFill)
|
|
868
|
+
if (deps.isUndefined(val)) return
|
|
869
|
+
return { columnFill: val }
|
|
870
|
+
},
|
|
871
|
+
columnCount: (element) => {
|
|
872
|
+
const { props, deps } = element
|
|
873
|
+
const val = deps.exec.call(element, props.columnCount)
|
|
874
|
+
if (deps.isUndefined(val)) return
|
|
875
|
+
return { columnCount: val }
|
|
876
|
+
}
|
|
790
877
|
},
|
|
791
878
|
|
|
792
879
|
// direction
|
|
793
|
-
direction: (
|
|
880
|
+
direction: (element) => {
|
|
881
|
+
const { props, deps } = element
|
|
882
|
+
const val = deps.exec.call(element, props.direction)
|
|
883
|
+
if (!val) return
|
|
884
|
+
return { direction: val }
|
|
885
|
+
},
|
|
794
886
|
|
|
795
887
|
// position
|
|
796
888
|
...{
|
|
797
|
-
position: (
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
|
|
889
|
+
position: (element) => {
|
|
890
|
+
const { props, deps } = element
|
|
891
|
+
const val = deps.exec.call(element, props.position)
|
|
892
|
+
if (!val) return
|
|
893
|
+
return { position: val }
|
|
894
|
+
},
|
|
895
|
+
inset: (element, s, ctx) => {
|
|
896
|
+
const { props, deps } = element
|
|
897
|
+
const inset = deps.exec.call(element, props.inset)
|
|
898
|
+
if (ctx.utils.isNumber(inset)) return { inset }
|
|
899
|
+
if (!ctx.utils.isString(inset)) return
|
|
802
900
|
return {
|
|
803
901
|
inset: inset
|
|
804
902
|
.split(' ')
|
|
@@ -807,13 +905,34 @@ export const Box = {
|
|
|
807
905
|
}
|
|
808
906
|
},
|
|
809
907
|
|
|
810
|
-
left: (
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
908
|
+
left: (element) => {
|
|
909
|
+
const { props, deps } = element
|
|
910
|
+
const val = deps.exec.call(element, props.left)
|
|
911
|
+
if (deps.isUndefined(val)) return
|
|
912
|
+
return deps.getSpacingByKey(val, 'left')
|
|
913
|
+
},
|
|
914
|
+
top: (element) => {
|
|
915
|
+
const { props, deps } = element
|
|
916
|
+
const val = deps.exec.call(element, props.top)
|
|
917
|
+
if (deps.isUndefined(val)) return
|
|
918
|
+
return deps.getSpacingByKey(val, 'top')
|
|
919
|
+
},
|
|
920
|
+
right: (element) => {
|
|
921
|
+
const { props, deps } = element
|
|
922
|
+
const val = deps.exec.call(element, props.right)
|
|
923
|
+
if (deps.isUndefined(val)) return
|
|
924
|
+
return deps.getSpacingByKey(val, 'right')
|
|
925
|
+
},
|
|
926
|
+
bottom: (element) => {
|
|
927
|
+
const { props, deps } = element
|
|
928
|
+
const val = deps.exec.call(element, props.bottom)
|
|
929
|
+
if (deps.isUndefined(val)) return
|
|
930
|
+
return deps.getSpacingByKey(val, 'bottom')
|
|
931
|
+
},
|
|
814
932
|
|
|
815
|
-
verticalInset: (
|
|
816
|
-
const {
|
|
933
|
+
verticalInset: (element) => {
|
|
934
|
+
const { props, deps } = element
|
|
935
|
+
const verticalInset = deps.exec.call(element, props.verticalInset)
|
|
817
936
|
if (typeof verticalInset !== 'string') return
|
|
818
937
|
const vi = verticalInset
|
|
819
938
|
.split(' ')
|
|
@@ -824,8 +943,9 @@ export const Box = {
|
|
|
824
943
|
}
|
|
825
944
|
},
|
|
826
945
|
|
|
827
|
-
horizontalInset: (
|
|
828
|
-
const {
|
|
946
|
+
horizontalInset: (element) => {
|
|
947
|
+
const { props, deps } = element
|
|
948
|
+
const horizontalInset = deps.exec.call(element, props.horizontalInset)
|
|
829
949
|
if (typeof horizontalInset !== 'string') return
|
|
830
950
|
const vi = horizontalInset
|
|
831
951
|
.split(' ')
|
|
@@ -839,33 +959,48 @@ export const Box = {
|
|
|
839
959
|
|
|
840
960
|
// overflow
|
|
841
961
|
...{
|
|
842
|
-
overflow: (
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}
|
|
962
|
+
overflow: (element) => {
|
|
963
|
+
const { props, deps } = element
|
|
964
|
+
const val = deps.exec.call(element, props.overflow)
|
|
965
|
+
if (deps.isUndefined(val)) return
|
|
966
|
+
return { overflow: val, scrollBehavior: 'smooth' }
|
|
967
|
+
},
|
|
968
|
+
overflowX: (element) => {
|
|
969
|
+
const { props, deps } = element
|
|
970
|
+
const val = deps.exec.call(element, props.overflowX)
|
|
971
|
+
if (deps.isUndefined(val)) return
|
|
972
|
+
return { overflowX: val }
|
|
973
|
+
},
|
|
974
|
+
overflowY: (element) => {
|
|
975
|
+
const { props, deps } = element
|
|
976
|
+
const val = deps.exec.call(element, props.overflowY)
|
|
977
|
+
if (deps.isUndefined(val)) return
|
|
978
|
+
return { overflowY: val }
|
|
979
|
+
},
|
|
980
|
+
overscrollBehavior: (element) => {
|
|
981
|
+
const { props, deps } = element
|
|
982
|
+
const val = deps.exec.call(element, props.overscrollBehavior)
|
|
983
|
+
if (deps.isUndefined(val)) return
|
|
984
|
+
return { overscrollBehavior: val }
|
|
985
|
+
}
|
|
859
986
|
},
|
|
860
987
|
|
|
861
988
|
// interaction
|
|
862
989
|
...{
|
|
863
|
-
userSelect: (
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
990
|
+
userSelect: (element) => {
|
|
991
|
+
const { props, deps } = element
|
|
992
|
+
const val = deps.exec.call(element, props.userSelect)
|
|
993
|
+
if (!val) return
|
|
994
|
+
return { userSelect: val }
|
|
995
|
+
},
|
|
996
|
+
pointerEvents: (element) => {
|
|
997
|
+
const { props, deps } = element
|
|
998
|
+
const val = deps.exec.call(element, props.pointerEvents)
|
|
999
|
+
if (!val) return
|
|
1000
|
+
return { pointerEvents: val }
|
|
1001
|
+
},
|
|
867
1002
|
cursor: (el, s, ctx) => {
|
|
868
|
-
let val = el.props.cursor
|
|
1003
|
+
let val = el.deps.exec.call(el, el.props.cursor)
|
|
869
1004
|
if (!val) return
|
|
870
1005
|
|
|
871
1006
|
const file = ctx.files && ctx.files[val]
|
|
@@ -877,71 +1012,112 @@ export const Box = {
|
|
|
877
1012
|
|
|
878
1013
|
// pseudo
|
|
879
1014
|
...{
|
|
880
|
-
content: (
|
|
1015
|
+
content: (element) => {
|
|
1016
|
+
const { props, deps } = element
|
|
1017
|
+
const val = deps.exec.call(element, props.content)
|
|
1018
|
+
if (!val) return
|
|
1019
|
+
return { content: val }
|
|
1020
|
+
}
|
|
881
1021
|
},
|
|
882
1022
|
|
|
883
1023
|
// timing
|
|
884
1024
|
...{
|
|
885
|
-
transition: (
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1025
|
+
transition: (element) => {
|
|
1026
|
+
const { props, deps } = element
|
|
1027
|
+
const val = deps.exec.call(element, props.transition)
|
|
1028
|
+
if (isUndefined(val)) return
|
|
1029
|
+
return { transition: deps.splitTransition(val) }
|
|
1030
|
+
},
|
|
1031
|
+
willChange: (element) => {
|
|
1032
|
+
const { props, deps } = element
|
|
1033
|
+
const val = deps.exec.call(element, props.willChange)
|
|
1034
|
+
if (isUndefined(val)) return
|
|
1035
|
+
return { willChange: val }
|
|
1036
|
+
},
|
|
1037
|
+
transitionDuration: (element) => {
|
|
1038
|
+
const { props, deps } = element
|
|
1039
|
+
const val = deps.exec.call(element, props.transitionDuration)
|
|
1040
|
+
if (isUndefined(val)) return
|
|
1041
|
+
return { transitionDuration: deps.transformDuration(val) }
|
|
1042
|
+
},
|
|
1043
|
+
transitionDelay: (element) => {
|
|
1044
|
+
const { props, deps } = element
|
|
1045
|
+
const val = deps.exec.call(element, props.transitionDelay)
|
|
1046
|
+
if (isUndefined(val)) return
|
|
1047
|
+
return { transitionDelay: deps.transformDuration(val) }
|
|
1048
|
+
},
|
|
1049
|
+
transitionTimingFunction: (element) => {
|
|
1050
|
+
const { props, deps } = element
|
|
1051
|
+
const val = deps.exec.call(element, props.transitionTimingFunction)
|
|
1052
|
+
if (isUndefined(val)) return
|
|
1053
|
+
return { transitionTimingFunction: deps.getTimingFunction(val) }
|
|
1054
|
+
},
|
|
1055
|
+
transitionProperty: (element) => {
|
|
1056
|
+
const { props, deps } = element
|
|
1057
|
+
const val = deps.exec.call(element, props.transitionProperty)
|
|
1058
|
+
if (isUndefined(val)) return
|
|
1059
|
+
return { transitionProperty: val, willChange: val }
|
|
1060
|
+
}
|
|
912
1061
|
},
|
|
913
1062
|
|
|
914
1063
|
// transform
|
|
915
1064
|
...{
|
|
916
|
-
zoom: (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
}
|
|
1065
|
+
zoom: (element) => {
|
|
1066
|
+
const { props, deps } = element
|
|
1067
|
+
const val = deps.exec.call(element, props.zoom)
|
|
1068
|
+
if (isUndefined(val)) return
|
|
1069
|
+
return { zoom: val }
|
|
1070
|
+
},
|
|
1071
|
+
transform: (element) => {
|
|
1072
|
+
const { props, deps } = element
|
|
1073
|
+
const val = deps.exec.call(element, props.transform)
|
|
1074
|
+
if (isUndefined(val)) return
|
|
1075
|
+
return { transform: val }
|
|
1076
|
+
},
|
|
1077
|
+
transformOrigin: (element) => {
|
|
1078
|
+
const { props, deps } = element
|
|
1079
|
+
const val = deps.exec.call(element, props.transformOrigin)
|
|
1080
|
+
if (isUndefined(val)) return
|
|
1081
|
+
return { transformOrigin: val }
|
|
1082
|
+
},
|
|
1083
|
+
backfaceVisibility: (element) => {
|
|
1084
|
+
const { props, deps } = element
|
|
1085
|
+
const val = deps.exec.call(element, props.backfaceVisibility)
|
|
1086
|
+
if (isUndefined(val)) return
|
|
1087
|
+
return { backfaceVisibility: val }
|
|
1088
|
+
}
|
|
927
1089
|
},
|
|
928
1090
|
|
|
929
1091
|
// xyz
|
|
930
1092
|
...{
|
|
931
|
-
zIndex: (
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
}
|
|
1093
|
+
zIndex: (element) => {
|
|
1094
|
+
const { props, deps } = element
|
|
1095
|
+
const val = deps.exec.call(element, props.zIndex)
|
|
1096
|
+
if (isUndefined(val)) return
|
|
1097
|
+
return { zIndex: val }
|
|
1098
|
+
},
|
|
1099
|
+
perspective: (element) => {
|
|
1100
|
+
const { props, deps } = element
|
|
1101
|
+
const val = deps.exec.call(element, props.perspective)
|
|
1102
|
+
if (isUndefined(val)) return
|
|
1103
|
+
return { perspective: val }
|
|
1104
|
+
},
|
|
1105
|
+
perspectiveOrigin: (element) => {
|
|
1106
|
+
const { props, deps } = element
|
|
1107
|
+
const val = deps.exec.call(element, props.perspectiveOrigin)
|
|
1108
|
+
if (isUndefined(val)) return
|
|
1109
|
+
return { perspectiveOrigin: val }
|
|
1110
|
+
}
|
|
939
1111
|
},
|
|
940
1112
|
|
|
941
1113
|
// theme
|
|
942
1114
|
...{
|
|
943
|
-
depth: (
|
|
944
|
-
|
|
1115
|
+
depth: (element) => {
|
|
1116
|
+
const { props, deps } = element
|
|
1117
|
+
const val = deps.exec.call(element, props.depth)
|
|
1118
|
+
if (isUndefined(val)) return
|
|
1119
|
+
return deps.depth[val]
|
|
1120
|
+
},
|
|
945
1121
|
|
|
946
1122
|
theme: (element) => {
|
|
947
1123
|
const { props, deps } = element
|
|
@@ -1006,82 +1182,98 @@ export const Box = {
|
|
|
1006
1182
|
backgroundImage: deps.transformBackgroundImage(val, globalTheme)
|
|
1007
1183
|
}
|
|
1008
1184
|
},
|
|
1009
|
-
backgroundSize: (
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
backgroundPosition: (
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
backgroundRepeat: (
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
textStroke: (
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
outline: (
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1185
|
+
backgroundSize: (element) => {
|
|
1186
|
+
const { props, deps } = element
|
|
1187
|
+
const val = deps.exec.call(element, props.backgroundSize)
|
|
1188
|
+
if (isUndefined(val)) return
|
|
1189
|
+
return { backgroundSize: val }
|
|
1190
|
+
},
|
|
1191
|
+
backgroundPosition: (element) => {
|
|
1192
|
+
const { props, deps } = element
|
|
1193
|
+
const val = deps.exec.call(element, props.backgroundPosition)
|
|
1194
|
+
if (isUndefined(val)) return
|
|
1195
|
+
return { backgroundPosition: val }
|
|
1196
|
+
},
|
|
1197
|
+
backgroundRepeat: (element) => {
|
|
1198
|
+
const { props, deps } = element
|
|
1199
|
+
const val = deps.exec.call(element, props.backgroundRepeat)
|
|
1200
|
+
if (isUndefined(val)) return
|
|
1201
|
+
return { backgroundRepeat: val }
|
|
1202
|
+
},
|
|
1203
|
+
|
|
1204
|
+
textStroke: (element) => {
|
|
1205
|
+
const { props, deps } = element
|
|
1206
|
+
const val = deps.exec.call(element, props.textStroke)
|
|
1207
|
+
if (isUndefined(val)) return
|
|
1208
|
+
return { WebkitTextStroke: deps.transformTextStroke(val) }
|
|
1209
|
+
},
|
|
1210
|
+
|
|
1211
|
+
outline: (element) => {
|
|
1212
|
+
const { props, deps } = element
|
|
1213
|
+
const val = deps.exec.call(element, props.outline)
|
|
1214
|
+
if (isUndefined(val)) return
|
|
1215
|
+
return { outline: deps.transformBorder(val) }
|
|
1216
|
+
},
|
|
1039
1217
|
outlineOffset: (el) => {
|
|
1040
1218
|
const { props, deps } = el
|
|
1041
1219
|
return deps.transformSizeRatio.call(el, 'outlineOffset', props)
|
|
1042
1220
|
},
|
|
1043
1221
|
|
|
1044
|
-
border: (
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1222
|
+
border: (element) => {
|
|
1223
|
+
const { props, deps } = element
|
|
1224
|
+
const val = deps.exec.call(element, props.border)
|
|
1225
|
+
if (!isString(val) && !isNumber(val)) return
|
|
1226
|
+
return { border: deps.transformBorder(val) }
|
|
1227
|
+
},
|
|
1048
1228
|
|
|
1049
1229
|
borderColor: (element) => {
|
|
1050
1230
|
const { props, deps } = element
|
|
1051
1231
|
const globalTheme = deps.getSystemGlobalTheme(element)
|
|
1052
1232
|
if (!props.borderColor) return
|
|
1233
|
+
const val = deps.exec.call(element, props.borderColor)
|
|
1053
1234
|
return {
|
|
1054
|
-
borderColor: deps.getMediaColor(
|
|
1235
|
+
borderColor: deps.getMediaColor(val, globalTheme)
|
|
1055
1236
|
}
|
|
1056
1237
|
},
|
|
1057
|
-
borderStyle: (
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1238
|
+
borderStyle: (element) => {
|
|
1239
|
+
const { props, deps } = element
|
|
1240
|
+
const val = deps.exec.call(element, props.borderStyle)
|
|
1241
|
+
if (isUndefined(val)) return
|
|
1242
|
+
return { borderStyle: val }
|
|
1243
|
+
},
|
|
1061
1244
|
|
|
1062
|
-
borderLeft: (
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1245
|
+
borderLeft: (element) => {
|
|
1246
|
+
const { props, deps } = element
|
|
1247
|
+
const val = deps.exec.call(element, props.borderLeft)
|
|
1248
|
+
if (isUndefined(val)) return
|
|
1249
|
+
return { borderLeft: deps.transformBorder(val) }
|
|
1250
|
+
},
|
|
1251
|
+
borderTop: (element) => {
|
|
1252
|
+
const { props, deps } = element
|
|
1253
|
+
const val = deps.exec.call(element, props.borderTop)
|
|
1254
|
+
if (isUndefined(val)) return
|
|
1255
|
+
return { borderTop: deps.transformBorder(val) }
|
|
1256
|
+
},
|
|
1257
|
+
borderRight: (element) => {
|
|
1258
|
+
const { props, deps } = element
|
|
1259
|
+
const val = deps.exec.call(element, props.borderRight)
|
|
1260
|
+
if (isUndefined(val)) return
|
|
1261
|
+
return { borderRight: deps.transformBorder(val) }
|
|
1262
|
+
},
|
|
1263
|
+
borderBottom: (element) => {
|
|
1264
|
+
const { props, deps } = element
|
|
1265
|
+
const val = deps.exec.call(element, props.borderBottom)
|
|
1266
|
+
if (isUndefined(val)) return
|
|
1267
|
+
return { borderBottom: deps.transformBorder(val) }
|
|
1268
|
+
},
|
|
1078
1269
|
|
|
1079
1270
|
shadow: (element) => {
|
|
1080
1271
|
const { props, deps } = element
|
|
1081
1272
|
const globalTheme = deps.getSystemGlobalTheme(element)
|
|
1082
|
-
|
|
1273
|
+
const val = deps.exec.call(element, props.shadow)
|
|
1274
|
+
if (!val) return
|
|
1083
1275
|
return {
|
|
1084
|
-
boxShadow: deps.transformShadow(
|
|
1276
|
+
boxShadow: deps.transformShadow(val, globalTheme)
|
|
1085
1277
|
}
|
|
1086
1278
|
},
|
|
1087
1279
|
|
|
@@ -1091,8 +1283,9 @@ export const Box = {
|
|
|
1091
1283
|
|
|
1092
1284
|
boxShadow: (element, state, context) => {
|
|
1093
1285
|
const { props, deps } = element
|
|
1094
|
-
|
|
1095
|
-
|
|
1286
|
+
const boxShadow = deps.exec.call(element, props.boxShadow)
|
|
1287
|
+
if (!isString(boxShadow)) return
|
|
1288
|
+
const [val, hasImportant] = boxShadow.split('!importan')
|
|
1096
1289
|
const globalTheme = getSystemGlobalTheme(element)
|
|
1097
1290
|
const important = hasImportant ? ' !important' : ''
|
|
1098
1291
|
return {
|
|
@@ -1101,147 +1294,196 @@ export const Box = {
|
|
|
1101
1294
|
}
|
|
1102
1295
|
},
|
|
1103
1296
|
|
|
1104
|
-
textShadow: (
|
|
1105
|
-
|
|
1297
|
+
textShadow: (element) => {
|
|
1298
|
+
const { props, deps, context } = element
|
|
1299
|
+
const val = deps.exec.call(element, props.textShadow)
|
|
1300
|
+
if (isUndefined(val)) return
|
|
1301
|
+
return {
|
|
1106
1302
|
textShadow: deps.transformBoxShadow(
|
|
1107
|
-
|
|
1303
|
+
val,
|
|
1108
1304
|
context.designSystem.globalTheme
|
|
1109
1305
|
)
|
|
1110
|
-
}
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1111
1308
|
|
|
1112
|
-
backdropFilter: (
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1309
|
+
backdropFilter: (element) => {
|
|
1310
|
+
const { props, deps } = element
|
|
1311
|
+
const val = deps.exec.call(element, props.backdropFilter)
|
|
1312
|
+
if (isUndefined(val)) return
|
|
1313
|
+
return { backdropFilter: val }
|
|
1314
|
+
},
|
|
1116
1315
|
|
|
1117
|
-
caretColor: (
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1316
|
+
caretColor: (element) => {
|
|
1317
|
+
const { props, deps } = element
|
|
1318
|
+
const val = deps.exec.call(element, props.caretColor)
|
|
1319
|
+
if (isUndefined(val)) return
|
|
1320
|
+
return { caretColor: val }
|
|
1321
|
+
},
|
|
1121
1322
|
|
|
1122
|
-
opacity: (
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
}
|
|
1323
|
+
opacity: (element) => {
|
|
1324
|
+
const { props, deps } = element
|
|
1325
|
+
const val = deps.exec.call(element, props.opacity)
|
|
1326
|
+
if (isUndefined(val)) return
|
|
1327
|
+
return { opacity: val }
|
|
1328
|
+
},
|
|
1329
|
+
visibility: (element) => {
|
|
1330
|
+
const { props, deps } = element
|
|
1331
|
+
const val = deps.exec.call(element, props.visibility)
|
|
1332
|
+
if (isUndefined(val)) return
|
|
1333
|
+
return { visibility: val }
|
|
1334
|
+
},
|
|
1130
1335
|
|
|
1131
|
-
columnRule: (
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1336
|
+
columnRule: (element) => {
|
|
1337
|
+
const { props, deps } = element
|
|
1338
|
+
const val = deps.exec.call(element, props.columnRule)
|
|
1339
|
+
if (isUndefined(val)) return
|
|
1340
|
+
return { columnRule: deps.transformBorder(val) }
|
|
1341
|
+
},
|
|
1135
1342
|
|
|
1136
|
-
filter: (
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1343
|
+
filter: (element) => {
|
|
1344
|
+
const { props, deps } = element
|
|
1345
|
+
const val = deps.exec.call(element, props.filter)
|
|
1346
|
+
if (isUndefined(val)) return
|
|
1347
|
+
return { filter: val }
|
|
1348
|
+
},
|
|
1140
1349
|
|
|
1141
|
-
mixBlendMode: (
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1350
|
+
mixBlendMode: (element) => {
|
|
1351
|
+
const { props, deps } = element
|
|
1352
|
+
const val = deps.exec.call(element, props.mixBlendMode)
|
|
1353
|
+
if (isUndefined(val)) return
|
|
1354
|
+
return { mixBlendMode: val }
|
|
1355
|
+
},
|
|
1145
1356
|
|
|
1146
|
-
appearance: (
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1357
|
+
appearance: (element) => {
|
|
1358
|
+
const { props, deps } = element
|
|
1359
|
+
const val = deps.exec.call(element, props.appearance)
|
|
1360
|
+
if (isUndefined(val)) return
|
|
1361
|
+
return { appearance: val }
|
|
1362
|
+
}
|
|
1150
1363
|
},
|
|
1151
1364
|
|
|
1152
1365
|
// animation
|
|
1153
1366
|
...{
|
|
1154
|
-
animation: (el) =>
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1367
|
+
animation: (el) => {
|
|
1368
|
+
const { props, deps } = el
|
|
1369
|
+
const val = deps.exec.call(el, props.animation)
|
|
1370
|
+
if (!val) return
|
|
1371
|
+
return {
|
|
1372
|
+
animationName: deps.applyAnimationProps(val, el),
|
|
1373
|
+
animationDuration: deps.getTimingByKey(
|
|
1374
|
+
deps.exec.call(el, props.animationDuration) || 'A'
|
|
1159
1375
|
).timing,
|
|
1160
|
-
animationDelay:
|
|
1161
|
-
el
|
|
1376
|
+
animationDelay: deps.getTimingByKey(
|
|
1377
|
+
deps.exec.call(el, props.animationDelay) || '0s'
|
|
1162
1378
|
).timing,
|
|
1163
|
-
animationTimingFunction: el.deps.getTimingFunction(
|
|
1164
|
-
el.props.animationTimingFunction || 'ease'
|
|
1165
|
-
),
|
|
1166
|
-
animationFillMode: el.props.animationFillMode || 'both',
|
|
1167
|
-
animationPlayState: el.props.animationPlayState,
|
|
1168
|
-
animationDirection: el.props.animationDirection
|
|
1169
|
-
},
|
|
1170
|
-
animationName: (el) =>
|
|
1171
|
-
el.props.animationName && {
|
|
1172
|
-
animationName: el.deps.applyAnimationProps(el.props.animationName, el)
|
|
1173
|
-
},
|
|
1174
|
-
animationDuration: ({ props, deps }) =>
|
|
1175
|
-
props.animationDuration && {
|
|
1176
|
-
animationDuration: deps.getTimingByKey(props.animationDuration).timing
|
|
1177
|
-
},
|
|
1178
|
-
animationDelay: ({ props, deps }) =>
|
|
1179
|
-
props.animationDelay && {
|
|
1180
|
-
animationDelay: deps.getTimingByKey(props.animationDelay).timing
|
|
1181
|
-
},
|
|
1182
|
-
animationTimingFunction: ({ props, deps }) =>
|
|
1183
|
-
props.animationTimingFunction && {
|
|
1184
1379
|
animationTimingFunction: deps.getTimingFunction(
|
|
1185
|
-
props.animationTimingFunction
|
|
1186
|
-
)
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
animationFillMode: props.animationFillMode
|
|
1192
|
-
},
|
|
1193
|
-
animationPlayState: ({ props }) =>
|
|
1194
|
-
props.animationPlayState && {
|
|
1195
|
-
animationPlayState: props.animationPlayState
|
|
1196
|
-
},
|
|
1197
|
-
animationIterationCount: ({ props }) =>
|
|
1198
|
-
props.animationIterationCount && {
|
|
1199
|
-
animationIterationCount: props.animationIterationCount || 1
|
|
1200
|
-
},
|
|
1201
|
-
animationDirection: ({ props }) =>
|
|
1202
|
-
props.animationDirection && {
|
|
1203
|
-
animationDirection: props.animationDirection
|
|
1380
|
+
deps.exec.call(el, props.animationTimingFunction) || 'ease'
|
|
1381
|
+
),
|
|
1382
|
+
animationFillMode:
|
|
1383
|
+
deps.exec.call(el, props.animationFillMode) || 'both',
|
|
1384
|
+
animationPlayState: deps.exec.call(el, props.animationPlayState),
|
|
1385
|
+
animationDirection: deps.exec.call(el, props.animationDirection)
|
|
1204
1386
|
}
|
|
1387
|
+
},
|
|
1388
|
+
animationName: (el) => {
|
|
1389
|
+
const { props, deps } = el
|
|
1390
|
+
const val = deps.exec.call(el, props.animationName)
|
|
1391
|
+
if (!val) return
|
|
1392
|
+
return { animationName: deps.applyAnimationProps(val, el) }
|
|
1393
|
+
},
|
|
1394
|
+
animationDuration: (element) => {
|
|
1395
|
+
const { props, deps } = element
|
|
1396
|
+
const val = deps.exec.call(element, props.animationDuration)
|
|
1397
|
+
if (!val) return
|
|
1398
|
+
return { animationDuration: deps.getTimingByKey(val).timing }
|
|
1399
|
+
},
|
|
1400
|
+
animationDelay: (element) => {
|
|
1401
|
+
const { props, deps } = element
|
|
1402
|
+
const val = deps.exec.call(element, props.animationDelay)
|
|
1403
|
+
if (!val) return
|
|
1404
|
+
return { animationDelay: deps.getTimingByKey(val).timing }
|
|
1405
|
+
},
|
|
1406
|
+
animationTimingFunction: (element) => {
|
|
1407
|
+
const { props, deps } = element
|
|
1408
|
+
const val = deps.exec.call(element, props.animationTimingFunction)
|
|
1409
|
+
if (!val) return
|
|
1410
|
+
return { animationTimingFunction: deps.getTimingFunction(val) }
|
|
1411
|
+
},
|
|
1412
|
+
// animation:css
|
|
1413
|
+
animationFillMode: (element) => {
|
|
1414
|
+
const { props, deps } = element
|
|
1415
|
+
const val = deps.exec.call(element, props.animationFillMode)
|
|
1416
|
+
if (!val) return
|
|
1417
|
+
return { animationFillMode: val }
|
|
1418
|
+
},
|
|
1419
|
+
animationPlayState: (element) => {
|
|
1420
|
+
const { props, deps } = element
|
|
1421
|
+
const val = deps.exec.call(element, props.animationPlayState)
|
|
1422
|
+
if (!val) return
|
|
1423
|
+
return { animationPlayState: val }
|
|
1424
|
+
},
|
|
1425
|
+
animationIterationCount: (element) => {
|
|
1426
|
+
const { props, deps } = element
|
|
1427
|
+
const val = deps.exec.call(element, props.animationIterationCount)
|
|
1428
|
+
if (!val) return
|
|
1429
|
+
return { animationIterationCount: val || 1 }
|
|
1430
|
+
},
|
|
1431
|
+
animationDirection: (element) => {
|
|
1432
|
+
const { props, deps } = element
|
|
1433
|
+
const val = deps.exec.call(element, props.animationDirection)
|
|
1434
|
+
if (!val) return
|
|
1435
|
+
return { animationDirection: val }
|
|
1436
|
+
}
|
|
1205
1437
|
},
|
|
1206
1438
|
|
|
1207
1439
|
// shape
|
|
1208
1440
|
...{
|
|
1209
|
-
shape: (
|
|
1210
|
-
const {
|
|
1441
|
+
shape: (element) => {
|
|
1442
|
+
const { props, deps } = element
|
|
1443
|
+
const shape = deps.exec.call(element, props.shape)
|
|
1211
1444
|
return deps.exec(SHAPES[shape], { props, deps })
|
|
1212
1445
|
},
|
|
1213
|
-
shapeDirection: (
|
|
1214
|
-
const {
|
|
1446
|
+
shapeDirection: (element) => {
|
|
1447
|
+
const { props, deps } = element
|
|
1448
|
+
const shape = deps.exec.call(element, props.shape)
|
|
1449
|
+
const shapeDirection = deps.exec.call(element, props.shapeDirection)
|
|
1215
1450
|
if (!shape || !shapeDirection) return
|
|
1216
1451
|
const shapeDir = SHAPES[shape + 'Direction']
|
|
1217
1452
|
return shape && shapeDir ? shapeDir[shapeDirection || 'left'] : null
|
|
1218
1453
|
},
|
|
1219
|
-
shapeDirectionColor: (
|
|
1220
|
-
const {
|
|
1454
|
+
shapeDirectionColor: (element) => {
|
|
1455
|
+
const { props, deps } = element
|
|
1456
|
+
const background = deps.exec.call(element, props.background)
|
|
1457
|
+
const backgroundColor = deps.exec.call(element, props.backgroundColor)
|
|
1221
1458
|
const borderColor = {
|
|
1222
1459
|
borderColor: deps.getMediaColor(background || backgroundColor)
|
|
1223
1460
|
}
|
|
1224
|
-
|
|
1461
|
+
const shapeDirection = deps.exec.call(element, props.shapeDirection)
|
|
1462
|
+
return shapeDirection ? borderColor : null
|
|
1225
1463
|
},
|
|
1226
1464
|
|
|
1227
|
-
round: (
|
|
1228
|
-
deps
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
borderRadius: (
|
|
1234
|
-
deps
|
|
1235
|
-
|
|
1465
|
+
round: (element) => {
|
|
1466
|
+
const { props, deps } = element
|
|
1467
|
+
const round = deps.exec.call(element, props.round)
|
|
1468
|
+
const borderRadius = deps.exec.call(element, props.borderRadius)
|
|
1469
|
+
return deps.transformBorderRadius(round || borderRadius, props, 'round')
|
|
1470
|
+
},
|
|
1471
|
+
borderRadius: (element) => {
|
|
1472
|
+
const { props, deps } = element
|
|
1473
|
+
const borderRadius = deps.exec.call(element, props.borderRadius)
|
|
1474
|
+
const round = deps.exec.call(element, props.round)
|
|
1475
|
+
return deps.transformBorderRadius(
|
|
1476
|
+
borderRadius || round,
|
|
1236
1477
|
props,
|
|
1237
1478
|
'borderRadius'
|
|
1238
|
-
)
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1479
|
+
)
|
|
1480
|
+
},
|
|
1481
|
+
clip: (element) => {
|
|
1482
|
+
const { props, deps } = element
|
|
1483
|
+
const val = deps.exec.call(element, props.clip)
|
|
1484
|
+
if (isUndefined(val)) return
|
|
1485
|
+
return { clip: val }
|
|
1486
|
+
}
|
|
1245
1487
|
},
|
|
1246
1488
|
|
|
1247
1489
|
// scrollbar
|
|
@@ -1252,20 +1494,90 @@ export const Box = {
|
|
|
1252
1494
|
}
|
|
1253
1495
|
},
|
|
1254
1496
|
|
|
1497
|
+
// grid
|
|
1498
|
+
...{
|
|
1499
|
+
gridTemplate: (element) => {
|
|
1500
|
+
const { props, deps } = element
|
|
1501
|
+
const val = deps.exec.call(element, props.gridTemplate)
|
|
1502
|
+
if (isUndefined(val)) return
|
|
1503
|
+
return { gridTemplate: val }
|
|
1504
|
+
},
|
|
1505
|
+
gridTemplateColumns: (element) => {
|
|
1506
|
+
const { props, deps } = element
|
|
1507
|
+
const val = deps.exec.call(element, props.gridTemplateColumns)
|
|
1508
|
+
if (isUndefined(val)) return
|
|
1509
|
+
return { gridTemplateColumns: val }
|
|
1510
|
+
},
|
|
1511
|
+
gridTemplateRows: (element) => {
|
|
1512
|
+
const { props, deps } = element
|
|
1513
|
+
const val = deps.exec.call(element, props.gridTemplateRows)
|
|
1514
|
+
if (isUndefined(val)) return
|
|
1515
|
+
return { gridTemplateRows: val }
|
|
1516
|
+
},
|
|
1517
|
+
gridTemplateAreas: (element) => {
|
|
1518
|
+
const { props, deps } = element
|
|
1519
|
+
const val = deps.exec.call(element, props.gridTemplateAreas)
|
|
1520
|
+
if (isUndefined(val)) return
|
|
1521
|
+
return { gridTemplateAreas: val }
|
|
1522
|
+
},
|
|
1523
|
+
gridAutoColumns: (element) => {
|
|
1524
|
+
const { props, deps } = element
|
|
1525
|
+
const val = deps.exec.call(element, props.gridAutoColumns)
|
|
1526
|
+
if (isUndefined(val)) return
|
|
1527
|
+
return { gridAutoColumns: val }
|
|
1528
|
+
},
|
|
1529
|
+
gridAutoRows: (element) => {
|
|
1530
|
+
const { props, deps } = element
|
|
1531
|
+
const val = deps.exec.call(element, props.gridAutoRows)
|
|
1532
|
+
if (isUndefined(val)) return
|
|
1533
|
+
return { gridAutoRows: val }
|
|
1534
|
+
},
|
|
1535
|
+
gridAutoFlow: (element) => {
|
|
1536
|
+
const { props, deps } = element
|
|
1537
|
+
const val = deps.exec.call(element, props.gridAutoFlow)
|
|
1538
|
+
if (isUndefined(val)) return
|
|
1539
|
+
return { gridAutoFlow: val }
|
|
1540
|
+
},
|
|
1541
|
+
grid: (element) => {
|
|
1542
|
+
const { props, deps } = element
|
|
1543
|
+
const val = deps.exec.call(element, props.grid)
|
|
1544
|
+
if (isUndefined(val)) return
|
|
1545
|
+
return { grid: val }
|
|
1546
|
+
},
|
|
1547
|
+
gridColumnEnd: (element) => {
|
|
1548
|
+
const { props, deps } = element
|
|
1549
|
+
const val = deps.exec.call(element, props.gridColumnEnd)
|
|
1550
|
+
if (isUndefined(val)) return
|
|
1551
|
+
return { gridColumnEnd: val }
|
|
1552
|
+
},
|
|
1553
|
+
gridRowEnd: (element) => {
|
|
1554
|
+
const { props, deps } = element
|
|
1555
|
+
const val = deps.exec.call(element, props.gridRowEnd)
|
|
1556
|
+
if (isUndefined(val)) return
|
|
1557
|
+
return { gridRowEnd: val }
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
|
|
1255
1561
|
// container queries
|
|
1256
1562
|
...{
|
|
1257
|
-
container: (
|
|
1258
|
-
props
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1563
|
+
container: (element) => {
|
|
1564
|
+
const { props, deps } = element
|
|
1565
|
+
const val = deps.exec.call(element, props.container)
|
|
1566
|
+
if (!val) return
|
|
1567
|
+
return { container: val }
|
|
1568
|
+
},
|
|
1569
|
+
containerName: (element) => {
|
|
1570
|
+
const { props, deps } = element
|
|
1571
|
+
const val = deps.exec.call(element, props.containerName)
|
|
1572
|
+
if (!val) return
|
|
1573
|
+
return { containerName: val || 1 }
|
|
1574
|
+
},
|
|
1575
|
+
containerType: (element) => {
|
|
1576
|
+
const { props, deps } = element
|
|
1577
|
+
const val = deps.exec.call(element, props.containerType)
|
|
1578
|
+
if (!val) return
|
|
1579
|
+
return { containerType: val }
|
|
1580
|
+
}
|
|
1269
1581
|
}
|
|
1270
1582
|
},
|
|
1271
1583
|
|