@plumeria/eslint-plugin 0.1.0 → 0.2.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/lib/rules/no-inner-call.js +4 -3
- package/lib/rules/no-unused-keys.js +19 -11
- package/lib/rules/sort-properties.js +9 -4
- package/lib/rules/validate-values.js +368 -143
- package/lib/util/colorData.js +32 -32
- package/lib/util/place.js +17 -2
- package/lib/util/propertyGroups.js +2 -2
- package/lib/util/validData.js +10 -10
- package/package.json +6 -3
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
const validData = require('../util/validData');
|
|
9
9
|
const unitData = require('../util/unitData');
|
|
10
10
|
const { colorValue } = require('../util/colorData');
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
isValidPlaceContent,
|
|
13
|
+
isValidPlaceItems,
|
|
14
|
+
isValidPlaceSelf,
|
|
15
|
+
isValidTouchAction,
|
|
16
|
+
} = require('../util/place');
|
|
12
17
|
|
|
13
18
|
const globalValues = ['inherit', 'initial', 'revert', 'revert-layer', 'unset'];
|
|
14
19
|
|
|
@@ -157,17 +162,33 @@ function buildColorMixPattern() {
|
|
|
157
162
|
|
|
158
163
|
const colorMixString = buildColorMixPattern();
|
|
159
164
|
|
|
160
|
-
const colorRegex = new RegExp(
|
|
165
|
+
const colorRegex = new RegExp(
|
|
166
|
+
`^(${colorValue}|${colorMixString}|${varString})$`,
|
|
167
|
+
);
|
|
161
168
|
const colorSource = colorRegex.source.slice(1, -1);
|
|
162
169
|
|
|
163
170
|
const imageRegex = new RegExp(`^(${linearGradientString}|${urlString})$`);
|
|
164
171
|
const urlRegex = new RegExp(`^(${urlString})$`);
|
|
165
172
|
|
|
166
|
-
const sliceValuePattern =
|
|
173
|
+
const sliceValuePattern =
|
|
174
|
+
'^(?:-?\\d+(?:\\.\\d+)?%?|fill)(?:\\s+(?:-?\\d+(?:\\.\\d+)?%?|fill)){0,3}$';
|
|
167
175
|
const sliceRegex = new RegExp(`^(${sliceValuePattern})$`);
|
|
168
176
|
|
|
169
|
-
const otherGroupProperties = [
|
|
170
|
-
|
|
177
|
+
const otherGroupProperties = [
|
|
178
|
+
'fontWeight',
|
|
179
|
+
'opacity',
|
|
180
|
+
'stopOpacity',
|
|
181
|
+
'strokeOpacity',
|
|
182
|
+
'flexGrow',
|
|
183
|
+
'flexShrink',
|
|
184
|
+
];
|
|
185
|
+
const integerGroupProperties = [
|
|
186
|
+
'columnCount',
|
|
187
|
+
'zIndex',
|
|
188
|
+
'order',
|
|
189
|
+
'orphans',
|
|
190
|
+
'widows',
|
|
191
|
+
];
|
|
171
192
|
|
|
172
193
|
const multipleValueProperties = [
|
|
173
194
|
'borderSpacing',
|
|
@@ -243,7 +264,12 @@ const borderWidthProperties = [
|
|
|
243
264
|
'columnRuleWidth',
|
|
244
265
|
'outlineWidth',
|
|
245
266
|
];
|
|
246
|
-
const ImageSourceProperties = [
|
|
267
|
+
const ImageSourceProperties = [
|
|
268
|
+
'borderImageSource',
|
|
269
|
+
'listStyleImage',
|
|
270
|
+
'maskBorderSource',
|
|
271
|
+
'maskImage',
|
|
272
|
+
];
|
|
247
273
|
const borderProperties = [
|
|
248
274
|
'border',
|
|
249
275
|
'outline', // same as border
|
|
@@ -382,12 +408,14 @@ module.exports = {
|
|
|
382
408
|
meta: {
|
|
383
409
|
type: 'problem',
|
|
384
410
|
docs: {
|
|
385
|
-
description:
|
|
411
|
+
description:
|
|
412
|
+
'Validate camelCase CSS property values in JS objects or JSX',
|
|
386
413
|
recommended: true,
|
|
387
414
|
},
|
|
388
415
|
schema: [],
|
|
389
416
|
messages: {
|
|
390
|
-
validateValue:
|
|
417
|
+
validateValue:
|
|
418
|
+
"'{{key}}' has an invalid value '{{value}}'. Valid values: {{validValues}}",
|
|
391
419
|
},
|
|
392
420
|
},
|
|
393
421
|
create(context) {
|
|
@@ -420,7 +448,9 @@ module.exports = {
|
|
|
420
448
|
const report = createReport(property, key, value);
|
|
421
449
|
|
|
422
450
|
const globalValue =
|
|
423
|
-
!validData[key].includes(value) &&
|
|
451
|
+
!validData[key].includes(value) &&
|
|
452
|
+
!globalValues.includes(value) &&
|
|
453
|
+
!varRegex.test(value);
|
|
424
454
|
|
|
425
455
|
const isBorderWidth = borderWidthProperties.includes(key);
|
|
426
456
|
const multiAutoProperties = [
|
|
@@ -568,28 +598,45 @@ module.exports = {
|
|
|
568
598
|
`|${calcString}|${clampString}|${anchorString}|${anchorSizeString}|${minString}|${maxString}|${varString}`;
|
|
569
599
|
const lengthValueRegex = new RegExp(`^(${lengthValuePattern})$`);
|
|
570
600
|
|
|
571
|
-
const isOtherGroups = [
|
|
572
|
-
|
|
573
|
-
|
|
601
|
+
const isOtherGroups = [
|
|
602
|
+
'opacity',
|
|
603
|
+
'stopOpacity',
|
|
604
|
+
'strokeOpacity',
|
|
605
|
+
].includes(key);
|
|
606
|
+
const otherSingleValue =
|
|
607
|
+
`${numberPattern}` + (isOtherGroups ? '%?' : '') + `|0`;
|
|
608
|
+
const otherSingleValueRegex = new RegExp(
|
|
609
|
+
`^(${otherSingleValue})$`,
|
|
610
|
+
);
|
|
574
611
|
|
|
575
612
|
const multipleValueRegex = new RegExp(
|
|
576
|
-
`^(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,${valueCountMap[key] - 1}}
|
|
613
|
+
`^(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,${valueCountMap[key] - 1}}$`,
|
|
577
614
|
);
|
|
578
615
|
|
|
579
616
|
const backgroundPairRegex = new RegExp(
|
|
580
|
-
`^(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s*,\\s*(${lengthValuePattern})(\\s+(${lengthValuePattern}))?)
|
|
617
|
+
`^(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s*,\\s*(${lengthValuePattern})(\\s+(${lengthValuePattern}))?)*$`,
|
|
581
618
|
);
|
|
582
|
-
const backgroundPairProperties = [
|
|
619
|
+
const backgroundPairProperties = [
|
|
620
|
+
'backgroundSize',
|
|
621
|
+
'backgroundPositionY',
|
|
622
|
+
'backgroundPositionX',
|
|
623
|
+
];
|
|
583
624
|
|
|
584
625
|
const backgroundQuadRegex = new RegExp(
|
|
585
|
-
`^(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s*,\\s*(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?)
|
|
626
|
+
`^(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s*,\\s*(${lengthValuePattern})(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?(\\s+(${lengthValuePattern}))?)*$`,
|
|
586
627
|
);
|
|
587
628
|
|
|
588
629
|
const backgroundQuadProperties = ['backgroundPosition'];
|
|
589
630
|
|
|
590
|
-
const visualBox =
|
|
591
|
-
|
|
592
|
-
const
|
|
631
|
+
const visualBox =
|
|
632
|
+
'border-box|padding-box|content-box|' + varString;
|
|
633
|
+
const backgroundOriginRegex = new RegExp(
|
|
634
|
+
`^(${visualBox})(\\s*,\\s*(${visualBox}))*$`,
|
|
635
|
+
);
|
|
636
|
+
const backgroundOriginProperties = [
|
|
637
|
+
'backgroundOrigin',
|
|
638
|
+
'backgroundClip',
|
|
639
|
+
];
|
|
593
640
|
|
|
594
641
|
const blendMode = [
|
|
595
642
|
'normal',
|
|
@@ -611,25 +658,32 @@ module.exports = {
|
|
|
611
658
|
varString,
|
|
612
659
|
].join('|');
|
|
613
660
|
|
|
614
|
-
const backgroundBlendModeRegex = new RegExp(
|
|
661
|
+
const backgroundBlendModeRegex = new RegExp(
|
|
662
|
+
`^(${blendMode})(\\s*,\\s*(${blendMode}))*$`,
|
|
663
|
+
);
|
|
615
664
|
const backgroundBlendModeProperties = ['backgroundBlendMode'];
|
|
616
665
|
|
|
617
666
|
const attachment = `scroll|fixed|local|${varString}`;
|
|
618
667
|
const backgroundAttachmentProperties = ['backgroundAttachment'];
|
|
619
|
-
const backgroundAttachmentRegex = new RegExp(
|
|
668
|
+
const backgroundAttachmentRegex = new RegExp(
|
|
669
|
+
`^(${attachment})(\\s*,\\s*(${attachment}))*$`,
|
|
670
|
+
);
|
|
620
671
|
|
|
621
672
|
const backgroundImageRegex = new RegExp(
|
|
622
|
-
`^(${linearGradientString}|${urlString}|${varString}|none)(\\s*,\\s*(${linearGradientString}|${urlString}|${varString}|none))
|
|
673
|
+
`^(${linearGradientString}|${urlString}|${varString}|none)(\\s*,\\s*(${linearGradientString}|${urlString}|${varString}|none))*$`,
|
|
623
674
|
);
|
|
624
675
|
const backgroundImageProperties = ['backgroundImage'];
|
|
625
676
|
|
|
626
677
|
const repeatKeyword = 'repeat|space|round|no-repeat';
|
|
627
678
|
const backgroundRepeatRegex = new RegExp(
|
|
628
|
-
`^(((?:${repeatKeyword}|${varString})(\\s+(?:${repeatKeyword}|${varString})))?|(repeatX|repeatY))
|
|
679
|
+
`^(((?:${repeatKeyword}|${varString})(\\s+(?:${repeatKeyword}|${varString})))?|(repeatX|repeatY))$`,
|
|
629
680
|
);
|
|
630
681
|
const backgroundRepeatProperties = ['backgroundRepeat'];
|
|
631
682
|
|
|
632
|
-
const backgroundRepeatSource = backgroundRepeatRegex.source.slice(
|
|
683
|
+
const backgroundRepeatSource = backgroundRepeatRegex.source.slice(
|
|
684
|
+
1,
|
|
685
|
+
-1,
|
|
686
|
+
);
|
|
633
687
|
|
|
634
688
|
const positionKeyword = `top|bottom|center|left|right|${varString}`;
|
|
635
689
|
const sizeKeyword = 'cover|contain';
|
|
@@ -656,21 +710,23 @@ module.exports = {
|
|
|
656
710
|
const flexibleLayerWithColor = `(?:${flexibleLayerWithoutColor}\\s*)*${colorValuePattern}`;
|
|
657
711
|
|
|
658
712
|
const backgroundRegex = new RegExp(
|
|
659
|
-
`^(?!\\s)(?=\\S)${flexibleLayerWithColor}(?:\\s*,\\s*${flexibleLayerWithColor})
|
|
713
|
+
`^(?!\\s)(?=\\S)${flexibleLayerWithColor}(?:\\s*,\\s*${flexibleLayerWithColor})*$`,
|
|
660
714
|
);
|
|
661
715
|
|
|
662
716
|
const backgroundProperties = ['background'];
|
|
663
717
|
|
|
664
718
|
const boxShadowRegex = new RegExp(
|
|
665
|
-
`^(?:(?:inset\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${lengthValuePattern}))?\\s+(${colorSource}))(?:\\s*,\\s*(?:(?:inset\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${lengthValuePattern}))?\\s+(${colorSource})))
|
|
719
|
+
`^(?:(?:inset\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${lengthValuePattern}))?\\s+(${colorSource}))(?:\\s*,\\s*(?:(?:inset\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${lengthValuePattern}))?\\s+(${colorSource})))*$`,
|
|
666
720
|
);
|
|
667
721
|
const boxShadowProperties = ['boxShadow'];
|
|
668
722
|
|
|
669
723
|
const borderRadiusRegex = new RegExp(
|
|
670
|
-
`^(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,3}(\\s*/\\s*(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,3})
|
|
724
|
+
`^(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,3}(\\s*/\\s*(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,3})?$`,
|
|
671
725
|
);
|
|
672
726
|
|
|
673
|
-
const borderStyleRegex = new RegExp(
|
|
727
|
+
const borderStyleRegex = new RegExp(
|
|
728
|
+
`^(${lineStyle})( (?!\\s)(${lineStyle})){0,3}$`,
|
|
729
|
+
);
|
|
674
730
|
|
|
675
731
|
function createBorderImageRegex() {
|
|
676
732
|
const varString = `var\\(${dashedIdentString}(,\\s*[^\\)]+)?\\)?`;
|
|
@@ -683,19 +739,23 @@ module.exports = {
|
|
|
683
739
|
const repeatPart = `(?:\\s+(${varString}|stretch|repeat|round|space)){0,2}?`; // Optional repeat part
|
|
684
740
|
|
|
685
741
|
return new RegExp(
|
|
686
|
-
`^${imageSource}` +
|
|
742
|
+
`^${imageSource}` +
|
|
743
|
+
`${slicePart}` +
|
|
744
|
+
`${widthPart}` +
|
|
745
|
+
`${outsetPart}` +
|
|
746
|
+
`${repeatPart}$`,
|
|
687
747
|
);
|
|
688
748
|
}
|
|
689
749
|
const borderImageRegex = createBorderImageRegex();
|
|
690
750
|
|
|
691
751
|
const aspectRatioRegex = new RegExp(
|
|
692
|
-
`^(auto\\s+)?(${varString}|${numberPattern}(\\s*\\/\\s*${numberPattern})?|auto)(\\s+auto)
|
|
752
|
+
`^(auto\\s+)?(${varString}|${numberPattern}(\\s*\\/\\s*${numberPattern})?|auto)(\\s+auto)?$`,
|
|
693
753
|
);
|
|
694
754
|
const aspectRatioProperties = ['aspectRatio'];
|
|
695
755
|
|
|
696
756
|
const timeUnit = '(s|ms)';
|
|
697
757
|
const animationTimeRegex = new RegExp(
|
|
698
|
-
`^-?(${pureNumber}${timeUnit}|${varString})(,\\s-?(${pureNumber}${timeUnit}|${varString}))
|
|
758
|
+
`^-?(${pureNumber}${timeUnit}|${varString})(,\\s-?(${pureNumber}${timeUnit}|${varString}))*$`,
|
|
699
759
|
);
|
|
700
760
|
|
|
701
761
|
const animationTimeProperties = [
|
|
@@ -705,22 +765,44 @@ module.exports = {
|
|
|
705
765
|
'transitionDuration',
|
|
706
766
|
];
|
|
707
767
|
|
|
708
|
-
const animationDirection = [
|
|
709
|
-
|
|
768
|
+
const animationDirection = [
|
|
769
|
+
'normal',
|
|
770
|
+
'reverse',
|
|
771
|
+
'alternate',
|
|
772
|
+
'alternate-reverse',
|
|
773
|
+
varString,
|
|
774
|
+
].join('|');
|
|
775
|
+
const animationDirectionRegex = new RegExp(
|
|
776
|
+
`^(${animationDirection})(,\\s*(${animationDirection}))*$`,
|
|
777
|
+
);
|
|
710
778
|
const animationDirectionProperties = ['animationDirection'];
|
|
711
779
|
|
|
712
|
-
const animationFillMode = [
|
|
713
|
-
|
|
780
|
+
const animationFillMode = [
|
|
781
|
+
'none',
|
|
782
|
+
'forwards',
|
|
783
|
+
'backwards',
|
|
784
|
+
'both',
|
|
785
|
+
varString,
|
|
786
|
+
].join('|');
|
|
787
|
+
const animationFillModeRegex = new RegExp(
|
|
788
|
+
`^(${animationFillMode})(,\\s*(${animationFillMode}))*$`,
|
|
789
|
+
);
|
|
714
790
|
const animationFillModeProperties = ['animationFillMode'];
|
|
715
791
|
|
|
716
|
-
const animationPlayState = ['paused', 'running', varString].join(
|
|
717
|
-
|
|
792
|
+
const animationPlayState = ['paused', 'running', varString].join(
|
|
793
|
+
'|',
|
|
794
|
+
);
|
|
795
|
+
const animationPlayStateRegex = new RegExp(
|
|
796
|
+
`^(${animationPlayState})(,\\s*(${animationPlayState}))*$`,
|
|
797
|
+
);
|
|
718
798
|
const animationPlayStateProperties = ['animationPlayState'];
|
|
719
799
|
|
|
720
800
|
const animationIterationCountRegex = new RegExp(
|
|
721
|
-
`^${numberPattern}|infinite(,\\s*${numberPattern}|infinite)
|
|
801
|
+
`^${numberPattern}|infinite(,\\s*${numberPattern}|infinite)*$`,
|
|
722
802
|
);
|
|
723
|
-
const animationIterationCountProperties = [
|
|
803
|
+
const animationIterationCountProperties = [
|
|
804
|
+
'animationIterationCount',
|
|
805
|
+
];
|
|
724
806
|
|
|
725
807
|
const stringNameRegex = new RegExp('^.*$');
|
|
726
808
|
const stringNameProperties = [
|
|
@@ -745,7 +827,15 @@ module.exports = {
|
|
|
745
827
|
'willChange',
|
|
746
828
|
];
|
|
747
829
|
|
|
748
|
-
const easing = [
|
|
830
|
+
const easing = [
|
|
831
|
+
'ease',
|
|
832
|
+
'ease-in',
|
|
833
|
+
'ease-out',
|
|
834
|
+
'ease-in-out',
|
|
835
|
+
'linear',
|
|
836
|
+
'step-start',
|
|
837
|
+
'step-end',
|
|
838
|
+
];
|
|
749
839
|
const easingPattern = easing.join('|');
|
|
750
840
|
|
|
751
841
|
const zeroToOne = '(0(\\.\\d+)?|1(\\.0+)?|0?\\.\\d+)';
|
|
@@ -756,17 +846,27 @@ module.exports = {
|
|
|
756
846
|
|
|
757
847
|
const linearPattern = `linear\\(\\s*(${numberPercentage}(\\s*,\\s*${numberPercentage})*)+\\s*\\)`;
|
|
758
848
|
|
|
759
|
-
const stepPositions = [
|
|
849
|
+
const stepPositions = [
|
|
850
|
+
'jump-start',
|
|
851
|
+
'jump-end',
|
|
852
|
+
'jump-none',
|
|
853
|
+
'jump-both',
|
|
854
|
+
'start',
|
|
855
|
+
'end',
|
|
856
|
+
];
|
|
760
857
|
const stepPositionPattern = stepPositions.join('|');
|
|
761
858
|
const stepPattern = `steps\\(\\s*(\\d+)\\s*,\\s*(${stepPositionPattern})\\s*\\)`;
|
|
762
859
|
|
|
763
860
|
const singleTimingFunctionPattern = `(${easingPattern}|${cubicBezierPattern}|${linearPattern}|${stepPattern}|${varString})`;
|
|
764
861
|
|
|
765
862
|
const animationTimingFunctionRegex = new RegExp(
|
|
766
|
-
`^${singleTimingFunctionPattern}(\\s*,\\s*${singleTimingFunctionPattern})
|
|
863
|
+
`^${singleTimingFunctionPattern}(\\s*,\\s*${singleTimingFunctionPattern})*$`,
|
|
767
864
|
);
|
|
768
865
|
|
|
769
|
-
const animationTimingFunctionProperties = [
|
|
866
|
+
const animationTimingFunctionProperties = [
|
|
867
|
+
'animationTimingFunction',
|
|
868
|
+
'transitionTimingFunction',
|
|
869
|
+
];
|
|
770
870
|
|
|
771
871
|
const filterNumFunction = [
|
|
772
872
|
'brightness',
|
|
@@ -812,7 +912,12 @@ module.exports = {
|
|
|
812
912
|
}
|
|
813
913
|
}
|
|
814
914
|
|
|
815
|
-
return
|
|
915
|
+
return (
|
|
916
|
+
hasStyle ||
|
|
917
|
+
hasWidth ||
|
|
918
|
+
hasColor ||
|
|
919
|
+
parts.some((part) => varRegex.test(part))
|
|
920
|
+
);
|
|
816
921
|
}
|
|
817
922
|
|
|
818
923
|
const matrixString = 'matrix\\([^\\)]+\\)';
|
|
@@ -863,7 +968,8 @@ module.exports = {
|
|
|
863
968
|
|
|
864
969
|
const filterProperties = ['backdropFilter', 'filter'];
|
|
865
970
|
|
|
866
|
-
const geometryBaseSet =
|
|
971
|
+
const geometryBaseSet =
|
|
972
|
+
'content-box|padding-box|border-box|fill-box|stroke-box|view-box';
|
|
867
973
|
const geometryBox = geometryBaseSet + '|margin-box';
|
|
868
974
|
|
|
869
975
|
const insetString = 'inset\\([^\\)]+\\)';
|
|
@@ -879,18 +985,18 @@ module.exports = {
|
|
|
879
985
|
const geometryBoxWithVar = `(${geometryBox}|${varString})`;
|
|
880
986
|
|
|
881
987
|
const clipPathRegex = new RegExp(
|
|
882
|
-
`^(${basicShapeString}|${geometryBoxWithVar}|${geometryBoxWithVar}\\s+${basicShapeString}|${basicShapeString}\\s+${geometryBoxWithVar})
|
|
988
|
+
`^(${basicShapeString}|${geometryBoxWithVar}|${geometryBoxWithVar}\\s+${basicShapeString}|${basicShapeString}\\s+${geometryBoxWithVar})$`,
|
|
883
989
|
);
|
|
884
990
|
|
|
885
991
|
const clipPathProperties = ['clipPath'];
|
|
886
992
|
|
|
887
993
|
const columnsRegex = new RegExp(
|
|
888
|
-
`^(?:auto\\s*(?:auto|${lengthValuePattern}|${numberPattern})?|${numberPattern}\\s*(?:auto|${lengthValuePattern}|${numberPattern})?|${lengthValuePattern}\\s*(?:auto|${lengthValuePattern}|${numberPattern})?)
|
|
994
|
+
`^(?:auto\\s*(?:auto|${lengthValuePattern}|${numberPattern})?|${numberPattern}\\s*(?:auto|${lengthValuePattern}|${numberPattern})?|${lengthValuePattern}\\s*(?:auto|${lengthValuePattern}|${numberPattern})?)$`,
|
|
889
995
|
);
|
|
890
996
|
const columnsProperties = ['columns'];
|
|
891
997
|
|
|
892
998
|
const contentValueRegex = new RegExp(
|
|
893
|
-
`^(${urlString}|${linearGradientString}|${imageSetString}|${attrString}|${counterString}|${countersString}|${stringString})
|
|
999
|
+
`^(${urlString}|${linearGradientString}|${imageSetString}|${attrString}|${counterString}|${countersString}|${stringString})$`,
|
|
894
1000
|
);
|
|
895
1001
|
|
|
896
1002
|
const contentProperty = ['content'];
|
|
@@ -899,7 +1005,9 @@ module.exports = {
|
|
|
899
1005
|
const urlWithHotspotRegex = `(${urlString}|${varString})(\\s+(${numberPattern})(\\s+(${numberPattern}))?)?`;
|
|
900
1006
|
const urlPart = `(${urlWithHotspotRegex})`;
|
|
901
1007
|
const standalonePattern = new RegExp(`^(${cursorValue})$`);
|
|
902
|
-
const urlListPattern = new RegExp(
|
|
1008
|
+
const urlListPattern = new RegExp(
|
|
1009
|
+
`^${urlPart}(\\s*,\\s*${urlPart})*\\s*,\\s*(${cursorValue})$`,
|
|
1010
|
+
);
|
|
903
1011
|
|
|
904
1012
|
if (standalonePattern.test(value)) {
|
|
905
1013
|
return true;
|
|
@@ -944,7 +1052,8 @@ module.exports = {
|
|
|
944
1052
|
if (parts.length === 1) {
|
|
945
1053
|
// Single value can be either a number or a length
|
|
946
1054
|
return (
|
|
947
|
-
new RegExp(`^${numberPattern}$`).test(parts[0]) ||
|
|
1055
|
+
new RegExp(`^${numberPattern}$`).test(parts[0]) ||
|
|
1056
|
+
new RegExp(lengthValuePattern).test(parts[0])
|
|
948
1057
|
);
|
|
949
1058
|
}
|
|
950
1059
|
|
|
@@ -957,7 +1066,8 @@ module.exports = {
|
|
|
957
1066
|
|
|
958
1067
|
// Second value can be either a number or a length
|
|
959
1068
|
return (
|
|
960
|
-
new RegExp(`^${numberPattern}$`).test(parts[1]) ||
|
|
1069
|
+
new RegExp(`^${numberPattern}$`).test(parts[1]) ||
|
|
1070
|
+
new RegExp(lengthValuePattern).test(parts[1])
|
|
961
1071
|
);
|
|
962
1072
|
}
|
|
963
1073
|
|
|
@@ -1126,16 +1236,29 @@ module.exports = {
|
|
|
1126
1236
|
.map((tag) => `'${tag}'|"${tag}"`)
|
|
1127
1237
|
.join('|');
|
|
1128
1238
|
|
|
1129
|
-
const featureTag = [
|
|
1239
|
+
const featureTag = [
|
|
1240
|
+
tagA_E,
|
|
1241
|
+
tagF_J,
|
|
1242
|
+
tagsK_O,
|
|
1243
|
+
tagsP_T,
|
|
1244
|
+
tagsU_Z,
|
|
1245
|
+
].join('|');
|
|
1130
1246
|
const singlePair = `(${featureTag}|${varString})(\\s+(-?\\d+|on|off|${varString}))?`;
|
|
1131
1247
|
|
|
1132
|
-
const fontFeatureSettingsRegex = new RegExp(
|
|
1248
|
+
const fontFeatureSettingsRegex = new RegExp(
|
|
1249
|
+
`^${singlePair}(\\s*,\\s*${singlePair})*$`,
|
|
1250
|
+
);
|
|
1133
1251
|
const fontFeatureSettingsProperties = ['fontFeatureSettings'];
|
|
1134
1252
|
|
|
1135
1253
|
const stringValueRegex = RegExp(`^${stringString}$`);
|
|
1136
|
-
const stringStringProperties = [
|
|
1254
|
+
const stringStringProperties = [
|
|
1255
|
+
'fontLanguageOverride',
|
|
1256
|
+
'hyphenateCharacter',
|
|
1257
|
+
];
|
|
1137
1258
|
|
|
1138
|
-
const fontPaletteRegex = new RegExp(
|
|
1259
|
+
const fontPaletteRegex = new RegExp(
|
|
1260
|
+
`^(${dashedIdentString}|${paletteMixString})$`,
|
|
1261
|
+
);
|
|
1139
1262
|
const fontPaletteProperties = 'fontPalette';
|
|
1140
1263
|
|
|
1141
1264
|
const fontMetric = `ex-height|cap-height|ch-width|ic-width|ic-height|${varString}`;
|
|
@@ -1156,7 +1279,9 @@ module.exports = {
|
|
|
1156
1279
|
}
|
|
1157
1280
|
|
|
1158
1281
|
if (parts.length === 2) {
|
|
1159
|
-
const isValidFirstPart = new RegExp(`^(${fontMetric})$`).test(
|
|
1282
|
+
const isValidFirstPart = new RegExp(`^(${fontMetric})$`).test(
|
|
1283
|
+
parts[0],
|
|
1284
|
+
);
|
|
1160
1285
|
if (!isValidFirstPart) {
|
|
1161
1286
|
return false;
|
|
1162
1287
|
}
|
|
@@ -1170,12 +1295,14 @@ module.exports = {
|
|
|
1170
1295
|
|
|
1171
1296
|
const fontStretchProperties = ['fontStretch'];
|
|
1172
1297
|
|
|
1173
|
-
const fontStyleRegex = new RegExp(
|
|
1298
|
+
const fontStyleRegex = new RegExp(
|
|
1299
|
+
`^(oblique|${anglePattern})(\\s+(oblique|${anglePattern}))?$`,
|
|
1300
|
+
);
|
|
1174
1301
|
const fontStyleProperties = ['fontStyle'];
|
|
1175
1302
|
|
|
1176
1303
|
const fontSynthesisRegex = new RegExp(
|
|
1177
1304
|
`^(?:(weight|style|small-caps|position|${varString})(?:\\s+(?!\\1)(weight|style|small-caps|position|${varString}))*)?$`,
|
|
1178
|
-
'i'
|
|
1305
|
+
'i',
|
|
1179
1306
|
);
|
|
1180
1307
|
const fontSynthesisProperties = ['fontSynthesis'];
|
|
1181
1308
|
|
|
@@ -1186,7 +1313,7 @@ module.exports = {
|
|
|
1186
1313
|
`(?:(?:${notationFuncs})\\s+){0,6}(historical-forms|${varString})` +
|
|
1187
1314
|
`(?:\\s+(?:${notationFuncs})){0,6})` +
|
|
1188
1315
|
`)$`,
|
|
1189
|
-
'i'
|
|
1316
|
+
'i',
|
|
1190
1317
|
);
|
|
1191
1318
|
|
|
1192
1319
|
const fontVariantAlternatesProperties = ['fontVariantAlternates'];
|
|
@@ -1196,7 +1323,7 @@ module.exports = {
|
|
|
1196
1323
|
`(?:jis78|jis83|jis90|jis04|simplified|traditional|full-width|proportional-width|ruby|${varString})` +
|
|
1197
1324
|
`(?:\\s+(?:jis78|jis83|jis90|jis04|simplified|traditional|full-width|proportional-width|ruby|${varString})){0,2}` +
|
|
1198
1325
|
'$',
|
|
1199
|
-
'i'
|
|
1326
|
+
'i',
|
|
1200
1327
|
);
|
|
1201
1328
|
|
|
1202
1329
|
function isValidFontVariantEastAsian(value) {
|
|
@@ -1207,10 +1334,19 @@ module.exports = {
|
|
|
1207
1334
|
const values = value.toLowerCase().split(/\s+/);
|
|
1208
1335
|
|
|
1209
1336
|
const jisCount = values.filter((v) =>
|
|
1210
|
-
[
|
|
1337
|
+
[
|
|
1338
|
+
'jis78',
|
|
1339
|
+
'jis83',
|
|
1340
|
+
'jis90',
|
|
1341
|
+
'jis04',
|
|
1342
|
+
'simplified',
|
|
1343
|
+
'traditional',
|
|
1344
|
+
].includes(v),
|
|
1211
1345
|
).length;
|
|
1212
1346
|
|
|
1213
|
-
const widthCount = values.filter((v) =>
|
|
1347
|
+
const widthCount = values.filter((v) =>
|
|
1348
|
+
['full-width', 'proportional-width'].includes(v),
|
|
1349
|
+
).length;
|
|
1214
1350
|
|
|
1215
1351
|
const rubyCount = values.filter((v) => v === 'ruby').length;
|
|
1216
1352
|
|
|
@@ -1218,24 +1354,33 @@ module.exports = {
|
|
|
1218
1354
|
}
|
|
1219
1355
|
const fontVariantEastAsianProperties = ['fontVariantEastAsian'];
|
|
1220
1356
|
|
|
1221
|
-
const commonLig =
|
|
1222
|
-
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1357
|
+
const commonLig =
|
|
1358
|
+
'common-ligatures|no-common-ligatures' + `|${varString}`;
|
|
1359
|
+
const discretionaryLig =
|
|
1360
|
+
'discretionary-ligatures|no-discretionary-ligatures' +
|
|
1361
|
+
`|${varString}`;
|
|
1362
|
+
const historicalLig =
|
|
1363
|
+
'historical-ligatures|no-historical-ligatures' +
|
|
1364
|
+
`|${varString}`;
|
|
1365
|
+
const contextualAlt =
|
|
1366
|
+
'contextual|no-contextual' + `|${varString}`;
|
|
1225
1367
|
const fontVariantLigaturesRegex = new RegExp(
|
|
1226
|
-
`^(?:(?:(${commonLig})|)(?: (${discretionaryLig})|)(?: (${historicalLig})|)(?: (${contextualAlt})|)){1,4}
|
|
1368
|
+
`^(?:(?:(${commonLig})|)(?: (${discretionaryLig})|)(?: (${historicalLig})|)(?: (${contextualAlt})|)){1,4}$`,
|
|
1227
1369
|
);
|
|
1228
1370
|
const fontVariantLigaturesProperties = ['fontVariantLigatures'];
|
|
1229
1371
|
|
|
1230
1372
|
const alternatesValues = `(?:${notationFuncs}|historical-forms)`;
|
|
1231
1373
|
const numericFigureValues = 'lining-nums|oldstyle-nums';
|
|
1232
1374
|
const numericSpacingValues = 'proportional-nums|tabular-nums';
|
|
1233
|
-
const numericFractionValues =
|
|
1375
|
+
const numericFractionValues =
|
|
1376
|
+
'diagonal-fractions|stacked-fractions';
|
|
1234
1377
|
const numericOtherValues = 'normal|ordinal|slashed-zero';
|
|
1235
|
-
const eastAsianVariantValues =
|
|
1378
|
+
const eastAsianVariantValues =
|
|
1379
|
+
'jis78|jis83|jis90|jis04|simplified|traditional';
|
|
1236
1380
|
const eastAsianWidthValues = 'full-width|proportional-width';
|
|
1237
1381
|
const eastAsianRuby = 'ruby';
|
|
1238
|
-
const capsValues =
|
|
1382
|
+
const capsValues =
|
|
1383
|
+
'small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps';
|
|
1239
1384
|
const emojiValues = 'text|emoji|unicode';
|
|
1240
1385
|
const positionValues = 'sub|super';
|
|
1241
1386
|
|
|
@@ -1249,7 +1394,7 @@ module.exports = {
|
|
|
1249
1394
|
|
|
1250
1395
|
const fontVariantNumericRegex = new RegExp(
|
|
1251
1396
|
`^(?:(${figureSpacingFractionValues})(?:\\s+(?!\\1)(${figureSpacingFractionValues}))*)?$`,
|
|
1252
|
-
'i'
|
|
1397
|
+
'i',
|
|
1253
1398
|
);
|
|
1254
1399
|
const fontVariantNumericProperties = ['fontVariantNumeric'];
|
|
1255
1400
|
|
|
@@ -1291,7 +1436,7 @@ module.exports = {
|
|
|
1291
1436
|
`)` +
|
|
1292
1437
|
`)*` +
|
|
1293
1438
|
`)$`,
|
|
1294
|
-
'i'
|
|
1439
|
+
'i',
|
|
1295
1440
|
);
|
|
1296
1441
|
|
|
1297
1442
|
const fontVariantProperties = ['fontVariant'];
|
|
@@ -1299,7 +1444,7 @@ module.exports = {
|
|
|
1299
1444
|
const axisTagDouble = '"wght"|"wdth"|"slnt"|"ital"|"opsz"';
|
|
1300
1445
|
const axisTagSingle = "'wght'|'wdth'|'slnt'|'ital'|'opsz'";
|
|
1301
1446
|
const fontVariationSettingsRegex = new RegExp(
|
|
1302
|
-
`^(${axisTagDouble}|${axisTagSingle}|${varString})\\s+(${numberPattern})
|
|
1447
|
+
`^(${axisTagDouble}|${axisTagSingle}|${varString})\\s+(${numberPattern})$`,
|
|
1303
1448
|
);
|
|
1304
1449
|
const fontVariationSettingsProperties = ['fontVariationSettings'];
|
|
1305
1450
|
|
|
@@ -1324,10 +1469,13 @@ module.exports = {
|
|
|
1324
1469
|
].join('|');
|
|
1325
1470
|
|
|
1326
1471
|
const gridAutoColumnsRegex = new RegExp(
|
|
1327
|
-
`^(?:${gridTrackListPattern})(?:\\s+(?:${gridTrackListPattern}))
|
|
1472
|
+
`^(?:${gridTrackListPattern})(?:\\s+(?:${gridTrackListPattern}))*$`,
|
|
1328
1473
|
);
|
|
1329
1474
|
|
|
1330
|
-
const gridAutoColumnsRowsProperties = [
|
|
1475
|
+
const gridAutoColumnsRowsProperties = [
|
|
1476
|
+
'gridAutoColumns',
|
|
1477
|
+
'gridAutoRows',
|
|
1478
|
+
];
|
|
1331
1479
|
|
|
1332
1480
|
const quoteRegex = new RegExp(`${stringString}`);
|
|
1333
1481
|
const gridTemplateAreasProperties = ['gridTemplateAreas'];
|
|
@@ -1353,7 +1501,7 @@ module.exports = {
|
|
|
1353
1501
|
`(?:\\s*\\/\\s*(?:${explicitTrackPattern}|${autoFlowPattern}(?:\\s+${explicitTrackPattern}|${autoFlowPattern})*)+)?|` +
|
|
1354
1502
|
// Option 3: Columns only (starting with a slash)
|
|
1355
1503
|
`\\s*\\/\\s*(?:${explicitTrackPattern}|${autoFlowPattern}(?:\\s+${explicitTrackPattern}|${autoFlowPattern})*)+` +
|
|
1356
|
-
')$'
|
|
1504
|
+
')$',
|
|
1357
1505
|
);
|
|
1358
1506
|
|
|
1359
1507
|
const gridProperties = ['grid'];
|
|
@@ -1370,9 +1518,12 @@ module.exports = {
|
|
|
1370
1518
|
...(isTemplateColumns ? [fitContentString] : []),
|
|
1371
1519
|
].join('|');
|
|
1372
1520
|
const gridTemplateTrackListRegex = new RegExp(
|
|
1373
|
-
`^(?:${templateTrackListPattern})(?:\\s+(?:${templateTrackListPattern}))
|
|
1521
|
+
`^(?:${templateTrackListPattern})(?:\\s+(?:${templateTrackListPattern}))*$`,
|
|
1374
1522
|
);
|
|
1375
|
-
const gridTemplateTrackListProperties = [
|
|
1523
|
+
const gridTemplateTrackListProperties = [
|
|
1524
|
+
'gridTemplateColumns',
|
|
1525
|
+
'gridTemplateRows',
|
|
1526
|
+
];
|
|
1376
1527
|
|
|
1377
1528
|
const isValidateGridTemplate = (value) => {
|
|
1378
1529
|
if (typeof value !== 'string') return false;
|
|
@@ -1398,29 +1549,35 @@ module.exports = {
|
|
|
1398
1549
|
`(?:\\s*\\/\\s*(?:${explicitTrackPattern}(?:\\s+${explicitTrackPattern})*)+)?|` +
|
|
1399
1550
|
// Option 3: Columns only (starting with a slash)
|
|
1400
1551
|
`\\s*\\/\\s*(?:${explicitTrackPattern}(?:\\s+${explicitTrackPattern})*)+` +
|
|
1401
|
-
')$'
|
|
1552
|
+
')$',
|
|
1402
1553
|
).test(value);
|
|
1403
1554
|
};
|
|
1404
1555
|
|
|
1405
1556
|
const gridTemplateProperties = ['gridTemplate'];
|
|
1406
1557
|
|
|
1407
1558
|
const hyphenateLimitCharsRegex = new RegExp(
|
|
1408
|
-
`^(${numberPattern}|auto)( (?!\\s)(${numberPattern}|auto)){0,2}
|
|
1559
|
+
`^(${numberPattern}|auto)( (?!\\s)(${numberPattern}|auto)){0,2}$`,
|
|
1409
1560
|
);
|
|
1410
1561
|
const hyphenateLimitCharsProperties = ['hyphenateLimitChars'];
|
|
1411
1562
|
|
|
1412
|
-
const imageOrientationRegex = new RegExp(
|
|
1563
|
+
const imageOrientationRegex = new RegExp(
|
|
1564
|
+
`^(${anglePattern})( (?!\\s)(flip|${varString})){0,1}$`,
|
|
1565
|
+
);
|
|
1413
1566
|
const imageOrientationProperties = ['imageOrientation'];
|
|
1414
1567
|
|
|
1415
1568
|
const initialLetterRegex = new RegExp(
|
|
1416
|
-
`^(${numberPattern})( (?!\\s)(${integerPattern}|drop|raise)){0,1}
|
|
1569
|
+
`^(${numberPattern})( (?!\\s)(${integerPattern}|drop|raise)){0,1}$`,
|
|
1417
1570
|
);
|
|
1418
1571
|
const initialLetterProperties = ['initialLetter'];
|
|
1419
1572
|
|
|
1420
|
-
const insetPairRegex = new RegExp(
|
|
1573
|
+
const insetPairRegex = new RegExp(
|
|
1574
|
+
`^(${lengthValuePattern}|auto)(\\s+(${lengthValuePattern}))?$`,
|
|
1575
|
+
);
|
|
1421
1576
|
const insetPairProperties = ['insetBlock', 'insetInline'];
|
|
1422
1577
|
|
|
1423
|
-
const marginPairRegex = new RegExp(
|
|
1578
|
+
const marginPairRegex = new RegExp(
|
|
1579
|
+
`^(${lengthValuePattern})(\\s+(${lengthValuePattern}))?$`,
|
|
1580
|
+
);
|
|
1424
1581
|
const marginPairProperties = [
|
|
1425
1582
|
'marginBlock', //
|
|
1426
1583
|
'marginInline', //
|
|
@@ -1432,19 +1589,24 @@ module.exports = {
|
|
|
1432
1589
|
'scrollMarginInline', // not auto
|
|
1433
1590
|
];
|
|
1434
1591
|
|
|
1435
|
-
const markerProperties = [
|
|
1592
|
+
const markerProperties = [
|
|
1593
|
+
'marker',
|
|
1594
|
+
'markerEnd',
|
|
1595
|
+
'markerMid',
|
|
1596
|
+
'markerStart',
|
|
1597
|
+
];
|
|
1436
1598
|
|
|
1437
1599
|
const maskBorderOutsetRegex = new RegExp(
|
|
1438
|
-
`^(${lengthValuePattern}|${numberPattern})( (?!\\s)(${lengthValuePattern}|${numberPattern})){0,3}
|
|
1600
|
+
`^(${lengthValuePattern}|${numberPattern})( (?!\\s)(${lengthValuePattern}|${numberPattern})){0,3}$`,
|
|
1439
1601
|
);
|
|
1440
1602
|
const maskBorderOutsetProperties = ['maskBorderOutset'];
|
|
1441
1603
|
|
|
1442
1604
|
const maskBorderSliceRegex = new RegExp(
|
|
1443
|
-
`^(${percentagePattern}|${numberPattern}|fill)( (?!\\s)(${percentagePattern}|${numberPattern}|fill)){0,3}
|
|
1605
|
+
`^(${percentagePattern}|${numberPattern}|fill)( (?!\\s)(${percentagePattern}|${numberPattern}|fill)){0,3}$`,
|
|
1444
1606
|
);
|
|
1445
1607
|
const maskBorderSliceProperties = ['maskBorderSlice'];
|
|
1446
1608
|
const maskBorderWidthRegex = new RegExp(
|
|
1447
|
-
`^(${lengthValuePattern}|${numberPattern}|auto)( (?!\\s)(${lengthValuePattern}|${numberPattern}|auto)){0,3}
|
|
1609
|
+
`^(${lengthValuePattern}|${numberPattern}|auto)( (?!\\s)(${lengthValuePattern}|${numberPattern}|auto)){0,3}$`,
|
|
1448
1610
|
);
|
|
1449
1611
|
const maskBorderWidthProperties = ['maskBorderWidth'];
|
|
1450
1612
|
|
|
@@ -1452,9 +1614,18 @@ module.exports = {
|
|
|
1452
1614
|
|
|
1453
1615
|
const repeatFullSet = `(${repeatKeyword}|${backgroundRepeatRegex.source.slice(1, -1)})`;
|
|
1454
1616
|
|
|
1455
|
-
const maskBorderOutsetSource = maskBorderOutsetRegex.source.slice(
|
|
1456
|
-
|
|
1457
|
-
|
|
1617
|
+
const maskBorderOutsetSource = maskBorderOutsetRegex.source.slice(
|
|
1618
|
+
1,
|
|
1619
|
+
-1,
|
|
1620
|
+
);
|
|
1621
|
+
const maskBorderSliceSource = maskBorderSliceRegex.source.slice(
|
|
1622
|
+
1,
|
|
1623
|
+
-1,
|
|
1624
|
+
);
|
|
1625
|
+
const maskBorderWidthSource = maskBorderWidthRegex.source.slice(
|
|
1626
|
+
1,
|
|
1627
|
+
-1,
|
|
1628
|
+
);
|
|
1458
1629
|
|
|
1459
1630
|
const maskBorderRegex = new RegExp(
|
|
1460
1631
|
`^(?:${linearGradientString}|${urlString})` +
|
|
@@ -1462,42 +1633,58 @@ module.exports = {
|
|
|
1462
1633
|
`(?:\\s?/\\s?${maskBorderWidthSource})?` +
|
|
1463
1634
|
`(?:\\s?/\\s?${maskBorderOutsetSource})?` +
|
|
1464
1635
|
`(?:\\s+(?:${repeatFullSet}))?` +
|
|
1465
|
-
`(?:\\s+(?:${modeKeyword}))
|
|
1636
|
+
`(?:\\s+(?:${modeKeyword}))?$`,
|
|
1466
1637
|
);
|
|
1467
1638
|
const maskBorderProperties = ['maskBorder'];
|
|
1468
1639
|
|
|
1469
|
-
const maskClipKeyword =
|
|
1470
|
-
|
|
1640
|
+
const maskClipKeyword =
|
|
1641
|
+
geometryBaseSet +
|
|
1642
|
+
`|no-clip|border|padding|content|text|${varString}`;
|
|
1643
|
+
const maskClipRegex = new RegExp(
|
|
1644
|
+
`^(${maskClipKeyword})(,\\s*(${maskClipKeyword}))*$`,
|
|
1645
|
+
);
|
|
1471
1646
|
const maskClipProperties = ['maskClip'];
|
|
1472
1647
|
|
|
1473
1648
|
const compositeKeyword = `add|subtract|intersect|exclude|${varString}`;
|
|
1474
|
-
const maskCompositeRegex = new RegExp(
|
|
1649
|
+
const maskCompositeRegex = new RegExp(
|
|
1650
|
+
`^(${compositeKeyword})(,\\s*(${compositeKeyword}))*$`,
|
|
1651
|
+
);
|
|
1475
1652
|
const maskCompositeProperties = ['maskComposite'];
|
|
1476
1653
|
|
|
1477
1654
|
const maskModeKeyword = `alpha|luminance|match-source|${varString}`;
|
|
1478
|
-
const maskModeRegex = new RegExp(
|
|
1655
|
+
const maskModeRegex = new RegExp(
|
|
1656
|
+
`^(${maskModeKeyword})(,\\s*(${maskModeKeyword}))*$`,
|
|
1657
|
+
);
|
|
1479
1658
|
const maksModeProperties = ['maskMode'];
|
|
1480
1659
|
|
|
1481
|
-
const maskOriginKeyword =
|
|
1482
|
-
|
|
1660
|
+
const maskOriginKeyword =
|
|
1661
|
+
geometryBaseSet + `|content|padding|border|${varString}`;
|
|
1662
|
+
const maskOriginRegex = new RegExp(
|
|
1663
|
+
`^(${maskOriginKeyword})(,\\s*(${maskOriginKeyword}))*$`,
|
|
1664
|
+
);
|
|
1483
1665
|
const maskOriginProperties = ['maskOrigin'];
|
|
1484
1666
|
|
|
1485
1667
|
const maskPositionRegex = new RegExp(
|
|
1486
|
-
`^(?:(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3})(?:,\\s*(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3})
|
|
1668
|
+
`^(?:(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3})(?:,\\s*(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3})*$`,
|
|
1487
1669
|
);
|
|
1488
1670
|
const maskPositionProperties = ['maskPosition'];
|
|
1489
1671
|
|
|
1490
|
-
const maskRepeatRegex = new RegExp(
|
|
1672
|
+
const maskRepeatRegex = new RegExp(
|
|
1673
|
+
`^(${backgroundRepeatSource})(,\\s*(${backgroundRepeatSource}))*$`,
|
|
1674
|
+
);
|
|
1491
1675
|
const maskRepeatProperties = ['maskRepeat'];
|
|
1492
1676
|
|
|
1493
1677
|
const maskRepeatKeyword = 'stretch|repeat|round|space';
|
|
1494
1678
|
const maskBorderRepeatRegex = new RegExp(
|
|
1495
|
-
`^((?:${maskRepeatKeyword}|${varString})(?:\\s+(?:${maskRepeatKeyword}|${varString}))?)
|
|
1679
|
+
`^((?:${maskRepeatKeyword}|${varString})(?:\\s+(?:${maskRepeatKeyword}|${varString}))?)$`,
|
|
1496
1680
|
);
|
|
1497
|
-
const maskBorderRepeatProperties = [
|
|
1681
|
+
const maskBorderRepeatProperties = [
|
|
1682
|
+
'maskBorderRepeat',
|
|
1683
|
+
'borderImageRepeat',
|
|
1684
|
+
];
|
|
1498
1685
|
|
|
1499
1686
|
const maskSizeRegex = new RegExp(
|
|
1500
|
-
`^(${lengthValuePattern}|cover|contain|auto)(\\s+(${lengthValuePattern}|cover|contain|auto))?(,\\s*(${lengthValuePattern}|cover|contain|auto)(\\s+(${lengthValuePattern}|cover|contain|auto))?)
|
|
1687
|
+
`^(${lengthValuePattern}|cover|contain|auto)(\\s+(${lengthValuePattern}|cover|contain|auto))?(,\\s*(${lengthValuePattern}|cover|contain|auto)(\\s+(${lengthValuePattern}|cover|contain|auto))?)*$`,
|
|
1501
1688
|
);
|
|
1502
1689
|
const maskSizeProperties = ['maskSize'];
|
|
1503
1690
|
|
|
@@ -1515,14 +1702,18 @@ module.exports = {
|
|
|
1515
1702
|
`(?:\\s+${maskClipKeyword})?` +
|
|
1516
1703
|
`(?:\\s+${compositeKeyword})?` +
|
|
1517
1704
|
`(?:\\s+${maskModeKeyword})?`;
|
|
1518
|
-
const maskRegex = new RegExp(
|
|
1705
|
+
const maskRegex = new RegExp(
|
|
1706
|
+
`^${maskLayerRegex}(?:,(?:\\s+${maskLayerRegex}))*$`,
|
|
1707
|
+
);
|
|
1519
1708
|
const maskProperties = ['mask'];
|
|
1520
1709
|
|
|
1521
|
-
const mathDepthRegex = new RegExp(
|
|
1710
|
+
const mathDepthRegex = new RegExp(
|
|
1711
|
+
`^(${addString}|${integerPattern})$`,
|
|
1712
|
+
);
|
|
1522
1713
|
const mathDepthProperties = ['mathDepth'];
|
|
1523
1714
|
|
|
1524
1715
|
const lengthPositionRegex = new RegExp(
|
|
1525
|
-
`^(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3}
|
|
1716
|
+
`^(${lengthValuePattern}|${positionKeyword})( (?!\\s)(${lengthValuePattern}|${positionKeyword})){0,3}$`,
|
|
1526
1717
|
);
|
|
1527
1718
|
|
|
1528
1719
|
const lengthPositionProperties = [
|
|
@@ -1534,34 +1725,41 @@ module.exports = {
|
|
|
1534
1725
|
|
|
1535
1726
|
const rayString = 'ray\\([^\\)]+\\)';
|
|
1536
1727
|
const offsetPathRegex = new RegExp(
|
|
1537
|
-
`^(${rayString}|${urlString}|${basicShapeString}|${geometryBaseSet})
|
|
1728
|
+
`^(${rayString}|${urlString}|${basicShapeString}|${geometryBaseSet})$`,
|
|
1538
1729
|
);
|
|
1539
1730
|
const offsetPathProperties = ['offsetPath'];
|
|
1540
1731
|
|
|
1541
|
-
const offsetRotateRegex = new RegExp(
|
|
1732
|
+
const offsetRotateRegex = new RegExp(
|
|
1733
|
+
`^(${anglePattern}|auto|reverse)( (?!\\s)(${anglePattern})){0,1}$`,
|
|
1734
|
+
);
|
|
1542
1735
|
const offsetRotateProperties = ['offsetRotate'];
|
|
1543
1736
|
|
|
1544
|
-
const offsetPositionSource = lengthPositionRegex.source.slice(
|
|
1737
|
+
const offsetPositionSource = lengthPositionRegex.source.slice(
|
|
1738
|
+
1,
|
|
1739
|
+
-1,
|
|
1740
|
+
);
|
|
1545
1741
|
const offsetRotateSource = offsetRotateRegex.source.slice(1, -1);
|
|
1546
1742
|
// distance at use lengthValuePattern
|
|
1547
1743
|
const offsetPathSource = offsetPathRegex.source.slice(1, -1);
|
|
1548
1744
|
|
|
1549
1745
|
const offsetRegex = new RegExp(
|
|
1550
|
-
`^(?!\\s)(?=\\S)(${offsetPositionSource})?\\s*(${offsetPathSource}(\\s(${lengthValuePattern}(\\s+${offsetRotateSource})?|${offsetRotateSource}))?)?\\s*(\\/\\s*${offsetPositionSource})?(?<!\\s)
|
|
1746
|
+
`^(?!\\s)(?=\\S)(${offsetPositionSource})?\\s*(${offsetPathSource}(\\s(${lengthValuePattern}(\\s+${offsetRotateSource})?|${offsetRotateSource}))?)?\\s*(\\/\\s*${offsetPositionSource})?(?<!\\s)$`,
|
|
1551
1747
|
);
|
|
1552
1748
|
const offsetProperties = ['offset'];
|
|
1553
1749
|
|
|
1554
1750
|
const oveflowKeyword = `visible|hidden|clip|scroll|auto|${varString}`;
|
|
1555
|
-
const oveflowRegex = new RegExp(
|
|
1751
|
+
const oveflowRegex = new RegExp(
|
|
1752
|
+
`^(${oveflowKeyword})(\\s+(${oveflowKeyword}))?$`,
|
|
1753
|
+
);
|
|
1556
1754
|
const oveflowProperties = ['overflow'];
|
|
1557
1755
|
|
|
1558
1756
|
const overflowClipMarginRegex = new RegExp(
|
|
1559
|
-
`^(?:${lengthValuePattern}$|${visualBox}$|${lengthValuePattern}\\s+${visualBox}$|${visualBox}\\s+${lengthValuePattern}$)
|
|
1757
|
+
`^(?:${lengthValuePattern}$|${visualBox}$|${lengthValuePattern}\\s+${visualBox}$|${visualBox}\\s+${lengthValuePattern}$)`,
|
|
1560
1758
|
);
|
|
1561
1759
|
const overflowClipMarginProperties = ['overflowClipMargin'];
|
|
1562
1760
|
|
|
1563
1761
|
const overscrollBehaviorRegex = new RegExp(
|
|
1564
|
-
`^(auto|contain|${varString})( (?!\\s)(auto|contain|${varString})){0,1}
|
|
1762
|
+
`^(auto|contain|${varString})( (?!\\s)(auto|contain|${varString})){0,1}$`,
|
|
1565
1763
|
);
|
|
1566
1764
|
const overscrollBehaviorProperties = ['overscrollBehavior'];
|
|
1567
1765
|
|
|
@@ -1579,7 +1777,9 @@ module.exports = {
|
|
|
1579
1777
|
const paintOrderRegex = new RegExp(`^(${paintOrderPattern})$`);
|
|
1580
1778
|
const paintOrderProperties = ['paintOrder'];
|
|
1581
1779
|
|
|
1582
|
-
const quotesRegex = new RegExp(
|
|
1780
|
+
const quotesRegex = new RegExp(
|
|
1781
|
+
`^(${stringString}|${varString})(\\s(${stringString}|${varString}))*$`,
|
|
1782
|
+
);
|
|
1583
1783
|
const quotesProperties = ['quotes'];
|
|
1584
1784
|
|
|
1585
1785
|
const rotatePattern =
|
|
@@ -1591,22 +1791,28 @@ module.exports = {
|
|
|
1591
1791
|
|
|
1592
1792
|
const numberAndPercentagePattern = `${numberPattern}|${percentagePattern}`;
|
|
1593
1793
|
const scaleRegex = new RegExp(
|
|
1594
|
-
`^(${numberAndPercentagePattern})( (?!\\s)(${numberAndPercentagePattern})){0,2}
|
|
1794
|
+
`^(${numberAndPercentagePattern})( (?!\\s)(${numberAndPercentagePattern})){0,2}$`,
|
|
1595
1795
|
);
|
|
1596
1796
|
const scaleProperties = ['scale'];
|
|
1597
1797
|
|
|
1598
|
-
const scrollMarginRegex = new RegExp(
|
|
1798
|
+
const scrollMarginRegex = new RegExp(
|
|
1799
|
+
`^(${lengthValuePattern})( (?!\\s)(${lengthValuePattern})){0,3}$`,
|
|
1800
|
+
);
|
|
1599
1801
|
const scrollMarginProperties = ['scrollMargin'];
|
|
1600
1802
|
|
|
1601
1803
|
const scrollPaddingRegex = new RegExp(
|
|
1602
|
-
`^(${lengthValuePattern}|auto)( (?!\\s)(${lengthValuePattern}|auto)){0,3}
|
|
1804
|
+
`^(${lengthValuePattern}|auto)( (?!\\s)(${lengthValuePattern}|auto)){0,3}$`,
|
|
1603
1805
|
);
|
|
1604
1806
|
const scrollPaddingProperties = ['scrollPadding'];
|
|
1605
1807
|
|
|
1606
|
-
const scrollbarColorRegex = new RegExp(
|
|
1808
|
+
const scrollbarColorRegex = new RegExp(
|
|
1809
|
+
`^(${colorSource}(\\s${colorSource})?)$`,
|
|
1810
|
+
);
|
|
1607
1811
|
const scrollbarColorProperties = ['scrollbarColor'];
|
|
1608
1812
|
|
|
1609
|
-
const shapeImageThresholdRegex = new RegExp(
|
|
1813
|
+
const shapeImageThresholdRegex = new RegExp(
|
|
1814
|
+
`^(${numberAndPercentagePattern})$`,
|
|
1815
|
+
);
|
|
1610
1816
|
const shapeImageThresholdProperties = ['shapeImageThreshold'];
|
|
1611
1817
|
|
|
1612
1818
|
const outsideShape = `(${insetString}|${circleString}|${ellipseString}|${polygonString}|${varString})`;
|
|
@@ -1617,15 +1823,17 @@ module.exports = {
|
|
|
1617
1823
|
`(?:${outsideShape}(?:\\s+${shapeVisualBox})?)|` +
|
|
1618
1824
|
`(?:${shapeVisualBox}(?:\\s+${outsideShape})?)|` +
|
|
1619
1825
|
`${linearGradientString}|${urlString}|${varString}` +
|
|
1620
|
-
`)
|
|
1826
|
+
`)$`,
|
|
1621
1827
|
);
|
|
1622
1828
|
const shapeOutsideProperties = ['shapeOutside'];
|
|
1623
1829
|
|
|
1624
|
-
const strokeRegex = new RegExp(
|
|
1830
|
+
const strokeRegex = new RegExp(
|
|
1831
|
+
`^${linearGradientString}|${urlString}|${colorSource}$`,
|
|
1832
|
+
);
|
|
1625
1833
|
const strokeProperties = ['stroke'];
|
|
1626
1834
|
|
|
1627
1835
|
const strokeDasharrayRegex = new RegExp(
|
|
1628
|
-
`^(${numberPattern}|${lengthValuePattern})(,\\s(${numberPattern}|${lengthValuePattern}))
|
|
1836
|
+
`^(${numberPattern}|${lengthValuePattern})(,\\s(${numberPattern}|${lengthValuePattern}))*$`,
|
|
1629
1837
|
);
|
|
1630
1838
|
const strokeDasharrayProperties = ['strokeDasharray'];
|
|
1631
1839
|
|
|
@@ -1633,7 +1841,12 @@ module.exports = {
|
|
|
1633
1841
|
const strokeMiterlimitProperties = ['strokeMiterlimit'];
|
|
1634
1842
|
|
|
1635
1843
|
const isValidTextDecorationLine = (value) => {
|
|
1636
|
-
const decorationValues = [
|
|
1844
|
+
const decorationValues = [
|
|
1845
|
+
'underline',
|
|
1846
|
+
'overline',
|
|
1847
|
+
'line-through',
|
|
1848
|
+
'blink',
|
|
1849
|
+
];
|
|
1637
1850
|
const usedValues = new Set();
|
|
1638
1851
|
|
|
1639
1852
|
const trimmedValue = value.trim();
|
|
@@ -1648,7 +1861,10 @@ module.exports = {
|
|
|
1648
1861
|
return true;
|
|
1649
1862
|
}
|
|
1650
1863
|
|
|
1651
|
-
if (
|
|
1864
|
+
if (
|
|
1865
|
+
decorationValues.includes(token) ||
|
|
1866
|
+
varString.includes(token)
|
|
1867
|
+
) {
|
|
1652
1868
|
return !usedValues.has(token) && usedValues.add(token);
|
|
1653
1869
|
}
|
|
1654
1870
|
|
|
@@ -1658,12 +1874,12 @@ module.exports = {
|
|
|
1658
1874
|
const textDecorationProperties = ['textDecorationLine'];
|
|
1659
1875
|
|
|
1660
1876
|
const textIndentRegex = new RegExp(
|
|
1661
|
-
`^(${lengthValuePattern})(\\s(hanging|${varString})?)?(\\s(each-line|${varString})?)
|
|
1877
|
+
`^(${lengthValuePattern})(\\s(hanging|${varString})?)?(\\s(each-line|${varString})?)?$`,
|
|
1662
1878
|
);
|
|
1663
1879
|
const textIndentProperties = ['textIndent'];
|
|
1664
1880
|
|
|
1665
1881
|
const textShadowRegex = new RegExp(
|
|
1666
|
-
`^(?:(?:(${colorSource})\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${colorSource}))?(?:\\s*,\\s*(?:(${colorSource})\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${colorSource}))?)*|none)
|
|
1882
|
+
`^(?:(?:(${colorSource})\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${colorSource}))?(?:\\s*,\\s*(?:(${colorSource})\\s+)?(${lengthValuePattern})\\s+(${lengthValuePattern})(?:\\s+(${lengthValuePattern}))?(?:\\s+(${colorSource}))?)*|none)$`,
|
|
1667
1883
|
);
|
|
1668
1884
|
const textShadowProperties = ['textShadow'];
|
|
1669
1885
|
|
|
@@ -1672,13 +1888,13 @@ module.exports = {
|
|
|
1672
1888
|
const baseline = `baseline|${varString}`;
|
|
1673
1889
|
const touchActionProperties = ['touchAction'];
|
|
1674
1890
|
const alignContentRegex = new RegExp(
|
|
1675
|
-
`^(((safe|unsafe|${varString})\\s+(${alignKeyword}))|(${firstLast})\\s+(${baseline}))
|
|
1891
|
+
`^(((safe|unsafe|${varString})\\s+(${alignKeyword}))|(${firstLast})\\s+(${baseline}))$`,
|
|
1676
1892
|
);
|
|
1677
1893
|
const alignContentProperties = ['alignContent'];
|
|
1678
1894
|
|
|
1679
1895
|
const itemsSelfKeyword = `self-start|self-end|anchor-center|start|end|center|flex-start|flex-end|${varString}`;
|
|
1680
1896
|
const alignItemsSelfRegex = new RegExp(
|
|
1681
|
-
`^(((safe|unsafe|${varString})\\s+(${itemsSelfKeyword}))|(${firstLast})\\s+(${baseline}))
|
|
1897
|
+
`^(((safe|unsafe|${varString})\\s+(${itemsSelfKeyword}))|(${firstLast})\\s+(${baseline}))$`,
|
|
1682
1898
|
);
|
|
1683
1899
|
const alignItemsSelfProperties = ['alignItems', 'alignSelf'];
|
|
1684
1900
|
|
|
@@ -1687,13 +1903,15 @@ module.exports = {
|
|
|
1687
1903
|
const listItem = `list-item|${varString}`;
|
|
1688
1904
|
const listItemRightGroup = `block|inline|flow|flow-root|run-in|${varString}`;
|
|
1689
1905
|
const displayRegex = new RegExp(
|
|
1690
|
-
`^(((${leftGroup})\\s+(${rightGroup}))|(${listItem})\\s+(${listItemRightGroup}))
|
|
1906
|
+
`^(((${leftGroup})\\s+(${rightGroup}))|(${listItem})\\s+(${listItemRightGroup}))$`,
|
|
1691
1907
|
);
|
|
1692
1908
|
const displayProperties = ['display'];
|
|
1693
1909
|
|
|
1694
1910
|
const direction = 'row|row-reverse|column|column-reverse';
|
|
1695
1911
|
const wrap = 'nowrap|wrap|wrap-reverse';
|
|
1696
|
-
const flexFlowRegex = new RegExp(
|
|
1912
|
+
const flexFlowRegex = new RegExp(
|
|
1913
|
+
`^((${direction}|${varString})(\\s+(${wrap}|${varString})))$`,
|
|
1914
|
+
);
|
|
1697
1915
|
const flexFlowProperties = ['flexFlow'];
|
|
1698
1916
|
|
|
1699
1917
|
const first = `(first|${varString})`;
|
|
@@ -1706,37 +1924,39 @@ module.exports = {
|
|
|
1706
1924
|
`(?:${first}\\s+${forceAllow}\\s+${last})?` +
|
|
1707
1925
|
`(?:${first}\\s+${last})?`;
|
|
1708
1926
|
|
|
1709
|
-
const hangingPunctuationRegex = new RegExp(
|
|
1927
|
+
const hangingPunctuationRegex = new RegExp(
|
|
1928
|
+
`^(${hangingPunctuationPattern})$`,
|
|
1929
|
+
);
|
|
1710
1930
|
const hangingPunctuationProperties = ['hangingPunctuation'];
|
|
1711
1931
|
|
|
1712
1932
|
const justifyContentKeyword = `left|right|stretch|start|end|center|flex-start|flex-end|${varString}`;
|
|
1713
1933
|
const justifyContentRegex = new RegExp(
|
|
1714
|
-
`^(((safe|unsafe|${varString})\\s+(${justifyContentKeyword}))|(${firstLast})\\s+(${baseline}))
|
|
1934
|
+
`^(((safe|unsafe|${varString})\\s+(${justifyContentKeyword}))|(${firstLast})\\s+(${baseline}))$`,
|
|
1715
1935
|
);
|
|
1716
1936
|
const justifyContentProperties = ['justifyContent'];
|
|
1717
1937
|
|
|
1718
1938
|
const justifyItemsSelfKeyword = `left|right|anchor-center|stretch|self-start|self-end|start|end|center|flex-start|flex-end|${varString}`;
|
|
1719
1939
|
const justifySelfRegex = new RegExp(
|
|
1720
|
-
`^(((safe|unsafe|${varString})\\s+(${justifyItemsSelfKeyword}))|(${firstLast})\\s+(${baseline}))
|
|
1940
|
+
`^(((safe|unsafe|${varString})\\s+(${justifyItemsSelfKeyword}))|(${firstLast})\\s+(${baseline}))$`,
|
|
1721
1941
|
);
|
|
1722
1942
|
const justifySelfProperties = ['justifySelf'];
|
|
1723
1943
|
|
|
1724
1944
|
const legacyValues = `(legacy|${varString})\\s+(left|right|center|${varString})`;
|
|
1725
1945
|
const justifyItemsRegex = new RegExp(
|
|
1726
|
-
`^(((safe|unsafe|${varString})\\s+(${justifyItemsSelfKeyword}))|(${firstLast})\\s+(${baseline})|(${legacyValues}))
|
|
1946
|
+
`^(((safe|unsafe|${varString})\\s+(${justifyItemsSelfKeyword}))|(${firstLast})\\s+(${baseline})|(${legacyValues}))$`,
|
|
1727
1947
|
);
|
|
1728
1948
|
const justifyItemsProperties = ['justifyItems'];
|
|
1729
1949
|
|
|
1730
1950
|
const scrollSnapAlignKeyword = 'start|end|center';
|
|
1731
1951
|
const scrollSnapAlignRegex = new RegExp(
|
|
1732
|
-
`^((?:${scrollSnapAlignKeyword}|${varString})(?:\\s+(?:${scrollSnapAlignKeyword}|${varString}))?)
|
|
1952
|
+
`^((?:${scrollSnapAlignKeyword}|${varString})(?:\\s+(?:${scrollSnapAlignKeyword}|${varString}))?)$`,
|
|
1733
1953
|
);
|
|
1734
1954
|
const scrollSnapAlignProperties = ['scrollSnapAlign'];
|
|
1735
1955
|
|
|
1736
1956
|
const scrollSnapTypeKeyword = 'x|y|block|inline|both';
|
|
1737
1957
|
const snapStrictKeyowrd = 'mandatory|proximity';
|
|
1738
1958
|
const scrollSnapTypeRegex = new RegExp(
|
|
1739
|
-
`^((?:${scrollSnapTypeKeyword}|${varString})(?:\\s+(?:${snapStrictKeyowrd}|${varString}))?)
|
|
1959
|
+
`^((?:${scrollSnapTypeKeyword}|${varString})(?:\\s+(?:${snapStrictKeyowrd}|${varString}))?)$`,
|
|
1740
1960
|
);
|
|
1741
1961
|
const scrollSnapTypeProperties = ['scrollSnapType'];
|
|
1742
1962
|
|
|
@@ -1744,32 +1964,37 @@ module.exports = {
|
|
|
1744
1964
|
const overUnder = `over|under|${varString}`;
|
|
1745
1965
|
|
|
1746
1966
|
const textEmphasisPositionRegex = new RegExp(
|
|
1747
|
-
`^(((?:${overUnder})(?:\\s+(?:${leftRight}))|(?:${leftRight})(?:\\s+(?:${overUnder})))?)
|
|
1967
|
+
`^(((?:${overUnder})(?:\\s+(?:${leftRight}))|(?:${leftRight})(?:\\s+(?:${overUnder})))?)$`,
|
|
1748
1968
|
);
|
|
1749
1969
|
const textEmphasisPositionProperties = ['textEmphasisPosition'];
|
|
1750
1970
|
|
|
1751
1971
|
const filledOpen = `filled|open|${varString}`;
|
|
1752
1972
|
const emphasisStyleKeyword = `dot|circle|double-circle|triangle|sesame|${varString}`;
|
|
1753
1973
|
const textEmphasisStyleRegex = new RegExp(
|
|
1754
|
-
`^(((?:${filledOpen})(?:\\s+(?:${emphasisStyleKeyword})))?|${stringString}?)
|
|
1974
|
+
`^(((?:${filledOpen})(?:\\s+(?:${emphasisStyleKeyword})))?|${stringString}?)$`,
|
|
1755
1975
|
);
|
|
1756
1976
|
const textEmphasisStyleProperties = ['textEmphasisStyle'];
|
|
1757
1977
|
|
|
1758
|
-
const textEmphasisStyleSource =
|
|
1759
|
-
|
|
1978
|
+
const textEmphasisStyleSource =
|
|
1979
|
+
textEmphasisStyleRegex.source.slice(1, -1);
|
|
1980
|
+
const textEmphasisRegex = new RegExp(
|
|
1981
|
+
`^(${textEmphasisStyleSource})(\\s(${colorSource}))?$`,
|
|
1982
|
+
);
|
|
1760
1983
|
const textEmphasisProperties = ['textEmphasis'];
|
|
1761
1984
|
|
|
1762
1985
|
const transformValue = `(${lengthValuePattern}|left|center|right|top|bottom)`;
|
|
1763
1986
|
const transformOriginRegex = new RegExp(
|
|
1764
|
-
`^(${transformValue})(\\s(${transformValue}))?(\\s(${transformValue}))
|
|
1987
|
+
`^(${transformValue})(\\s(${transformValue}))?(\\s(${transformValue}))?$`,
|
|
1765
1988
|
);
|
|
1766
1989
|
const transformOriginProperties = ['transformOrigin'];
|
|
1767
1990
|
|
|
1768
|
-
const transformRegex = new RegExp(
|
|
1991
|
+
const transformRegex = new RegExp(
|
|
1992
|
+
`^((${transformFunctions})(\\s+(${transformFunctions}))*)?$`,
|
|
1993
|
+
);
|
|
1769
1994
|
const transformProperties = ['transform'];
|
|
1770
1995
|
|
|
1771
1996
|
const translateRegex = new RegExp(
|
|
1772
|
-
`^(${lengthValuePattern}|${percentagePattern})(\\s(${lengthValuePattern}|${percentagePattern}))?(\\s(${lengthValuePattern}))
|
|
1997
|
+
`^(${lengthValuePattern}|${percentagePattern})(\\s(${lengthValuePattern}|${percentagePattern}))?(\\s(${lengthValuePattern}))?$`,
|
|
1773
1998
|
);
|
|
1774
1999
|
const translateProperties = ['translate'];
|
|
1775
2000
|
|