@symbo.ls/scratch 2.29.56 → 2.29.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +14 -8
- package/dist/cjs/set.js +14 -8
- package/dist/cjs/system/index.js +14 -8
- package/dist/cjs/system/shadow.js +14 -8
- package/dist/cjs/system/spacing.js +14 -8
- package/dist/cjs/system/timing.js +14 -8
- package/dist/cjs/system/typography.js +14 -8
- package/dist/cjs/transforms/index.js +14 -8
- package/dist/cjs/utils/index.js +14 -8
- package/dist/cjs/utils/sequence.js +14 -8
- package/package.json +4 -4
- package/src/utils/sequence.js +34 -24
package/dist/cjs/index.js
CHANGED
|
@@ -1162,7 +1162,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
1162
1162
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
1163
1163
|
const newVar = variable + (k + 1);
|
|
1164
1164
|
const newIndex = index + (k + 1) / 10;
|
|
1165
|
-
const scalingVariable = setSubScalingVar(
|
|
1165
|
+
const scalingVariable = setSubScalingVar(
|
|
1166
|
+
k + 1,
|
|
1167
|
+
arr,
|
|
1168
|
+
variable,
|
|
1169
|
+
sequenceProps
|
|
1170
|
+
);
|
|
1166
1171
|
const props2 = {
|
|
1167
1172
|
key: key + (k + 1),
|
|
1168
1173
|
variable: newVar,
|
|
@@ -1244,16 +1249,13 @@ var generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
1244
1249
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
1245
1250
|
const CONFIG2 = getActiveConfig();
|
|
1246
1251
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
1247
|
-
const {
|
|
1248
|
-
sequence,
|
|
1249
|
-
unit = UNIT2.default,
|
|
1250
|
-
useVariable
|
|
1251
|
-
} = sequenceProps;
|
|
1252
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
1252
1253
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
1253
1254
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
1254
1255
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1255
1256
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1256
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
1257
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
1258
|
+
return value;
|
|
1257
1259
|
const letterVal = value.toUpperCase();
|
|
1258
1260
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
1259
1261
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -1277,7 +1279,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1277
1279
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
1278
1280
|
}
|
|
1279
1281
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
1280
|
-
if (CONFIG2.verbose)
|
|
1282
|
+
if (CONFIG2.verbose)
|
|
1283
|
+
console.warn(
|
|
1284
|
+
absValue,
|
|
1285
|
+
"- value is not found because `subSequence` is set to false"
|
|
1286
|
+
);
|
|
1281
1287
|
absValue = absValue.slice(0, 1);
|
|
1282
1288
|
}
|
|
1283
1289
|
if (useVariable || CONFIG2.useVariable) {
|
package/dist/cjs/set.js
CHANGED
|
@@ -913,7 +913,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
913
913
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
914
914
|
const newVar = variable + (k + 1);
|
|
915
915
|
const newIndex = index + (k + 1) / 10;
|
|
916
|
-
const scalingVariable = setSubScalingVar(
|
|
916
|
+
const scalingVariable = setSubScalingVar(
|
|
917
|
+
k + 1,
|
|
918
|
+
arr,
|
|
919
|
+
variable,
|
|
920
|
+
sequenceProps
|
|
921
|
+
);
|
|
917
922
|
const props2 = {
|
|
918
923
|
key: key + (k + 1),
|
|
919
924
|
variable: newVar,
|
|
@@ -957,16 +962,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
957
962
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
958
963
|
const CONFIG2 = getActiveConfig();
|
|
959
964
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
960
|
-
const {
|
|
961
|
-
sequence,
|
|
962
|
-
unit = UNIT2.default,
|
|
963
|
-
useVariable
|
|
964
|
-
} = sequenceProps;
|
|
965
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
965
966
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
966
967
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
967
968
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
968
969
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
969
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
970
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
971
|
+
return value;
|
|
970
972
|
const letterVal = value.toUpperCase();
|
|
971
973
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
972
974
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -990,7 +992,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
990
992
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
991
993
|
}
|
|
992
994
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
993
|
-
if (CONFIG2.verbose)
|
|
995
|
+
if (CONFIG2.verbose)
|
|
996
|
+
console.warn(
|
|
997
|
+
absValue,
|
|
998
|
+
"- value is not found because `subSequence` is set to false"
|
|
999
|
+
);
|
|
994
1000
|
absValue = absValue.slice(0, 1);
|
|
995
1001
|
}
|
|
996
1002
|
if (useVariable || CONFIG2.useVariable) {
|
package/dist/cjs/system/index.js
CHANGED
|
@@ -932,7 +932,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
932
932
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
933
933
|
const newVar = variable + (k + 1);
|
|
934
934
|
const newIndex = index + (k + 1) / 10;
|
|
935
|
-
const scalingVariable = setSubScalingVar(
|
|
935
|
+
const scalingVariable = setSubScalingVar(
|
|
936
|
+
k + 1,
|
|
937
|
+
arr,
|
|
938
|
+
variable,
|
|
939
|
+
sequenceProps
|
|
940
|
+
);
|
|
936
941
|
const props2 = {
|
|
937
942
|
key: key + (k + 1),
|
|
938
943
|
variable: newVar,
|
|
@@ -976,16 +981,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
976
981
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
977
982
|
const CONFIG2 = getActiveConfig();
|
|
978
983
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
979
|
-
const {
|
|
980
|
-
sequence,
|
|
981
|
-
unit = UNIT2.default,
|
|
982
|
-
useVariable
|
|
983
|
-
} = sequenceProps;
|
|
984
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
984
985
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
985
986
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
986
987
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
987
988
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
988
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
989
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
990
|
+
return value;
|
|
989
991
|
const letterVal = value.toUpperCase();
|
|
990
992
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
991
993
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -1009,7 +1011,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1009
1011
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
1010
1012
|
}
|
|
1011
1013
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
1012
|
-
if (CONFIG2.verbose)
|
|
1014
|
+
if (CONFIG2.verbose)
|
|
1015
|
+
console.warn(
|
|
1016
|
+
absValue,
|
|
1017
|
+
"- value is not found because `subSequence` is set to false"
|
|
1018
|
+
);
|
|
1013
1019
|
absValue = absValue.slice(0, 1);
|
|
1014
1020
|
}
|
|
1015
1021
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -842,7 +842,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
842
842
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
843
843
|
const newVar = variable + (k + 1);
|
|
844
844
|
const newIndex = index + (k + 1) / 10;
|
|
845
|
-
const scalingVariable = setSubScalingVar(
|
|
845
|
+
const scalingVariable = setSubScalingVar(
|
|
846
|
+
k + 1,
|
|
847
|
+
arr,
|
|
848
|
+
variable,
|
|
849
|
+
sequenceProps
|
|
850
|
+
);
|
|
846
851
|
const props2 = {
|
|
847
852
|
key: key + (k + 1),
|
|
848
853
|
variable: newVar,
|
|
@@ -886,16 +891,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
886
891
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
887
892
|
const CONFIG2 = getActiveConfig();
|
|
888
893
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
889
|
-
const {
|
|
890
|
-
sequence,
|
|
891
|
-
unit = UNIT2.default,
|
|
892
|
-
useVariable
|
|
893
|
-
} = sequenceProps;
|
|
894
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
894
895
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
895
896
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
896
897
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
897
898
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
898
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
899
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
900
|
+
return value;
|
|
899
901
|
const letterVal = value.toUpperCase();
|
|
900
902
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
901
903
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -919,7 +921,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
919
921
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
920
922
|
}
|
|
921
923
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
922
|
-
if (CONFIG2.verbose)
|
|
924
|
+
if (CONFIG2.verbose)
|
|
925
|
+
console.warn(
|
|
926
|
+
absValue,
|
|
927
|
+
"- value is not found because `subSequence` is set to false"
|
|
928
|
+
);
|
|
923
929
|
absValue = absValue.slice(0, 1);
|
|
924
930
|
}
|
|
925
931
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -769,7 +769,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
769
769
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
770
770
|
const newVar = variable + (k + 1);
|
|
771
771
|
const newIndex = index + (k + 1) / 10;
|
|
772
|
-
const scalingVariable = setSubScalingVar(
|
|
772
|
+
const scalingVariable = setSubScalingVar(
|
|
773
|
+
k + 1,
|
|
774
|
+
arr,
|
|
775
|
+
variable,
|
|
776
|
+
sequenceProps
|
|
777
|
+
);
|
|
773
778
|
const props2 = {
|
|
774
779
|
key: key + (k + 1),
|
|
775
780
|
variable: newVar,
|
|
@@ -813,16 +818,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
813
818
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
814
819
|
const CONFIG2 = getActiveConfig();
|
|
815
820
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
816
|
-
const {
|
|
817
|
-
sequence,
|
|
818
|
-
unit = UNIT2.default,
|
|
819
|
-
useVariable
|
|
820
|
-
} = sequenceProps;
|
|
821
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
821
822
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
822
823
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
823
824
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
824
825
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
825
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
826
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
827
|
+
return value;
|
|
826
828
|
const letterVal = value.toUpperCase();
|
|
827
829
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
828
830
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -846,7 +848,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
846
848
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
847
849
|
}
|
|
848
850
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
849
|
-
if (CONFIG2.verbose)
|
|
851
|
+
if (CONFIG2.verbose)
|
|
852
|
+
console.warn(
|
|
853
|
+
absValue,
|
|
854
|
+
"- value is not found because `subSequence` is set to false"
|
|
855
|
+
);
|
|
850
856
|
absValue = absValue.slice(0, 1);
|
|
851
857
|
}
|
|
852
858
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -756,7 +756,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
756
756
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
757
757
|
const newVar = variable + (k + 1);
|
|
758
758
|
const newIndex = index + (k + 1) / 10;
|
|
759
|
-
const scalingVariable = setSubScalingVar(
|
|
759
|
+
const scalingVariable = setSubScalingVar(
|
|
760
|
+
k + 1,
|
|
761
|
+
arr,
|
|
762
|
+
variable,
|
|
763
|
+
sequenceProps
|
|
764
|
+
);
|
|
760
765
|
const props2 = {
|
|
761
766
|
key: key + (k + 1),
|
|
762
767
|
variable: newVar,
|
|
@@ -800,16 +805,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
800
805
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
801
806
|
const CONFIG2 = getActiveConfig();
|
|
802
807
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
803
|
-
const {
|
|
804
|
-
sequence,
|
|
805
|
-
unit = UNIT2.default,
|
|
806
|
-
useVariable
|
|
807
|
-
} = sequenceProps;
|
|
808
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
808
809
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
809
810
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
810
811
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
811
812
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
812
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
813
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
814
|
+
return value;
|
|
813
815
|
const letterVal = value.toUpperCase();
|
|
814
816
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
815
817
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -833,7 +835,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
833
835
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
834
836
|
}
|
|
835
837
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
836
|
-
if (CONFIG2.verbose)
|
|
838
|
+
if (CONFIG2.verbose)
|
|
839
|
+
console.warn(
|
|
840
|
+
absValue,
|
|
841
|
+
"- value is not found because `subSequence` is set to false"
|
|
842
|
+
);
|
|
837
843
|
absValue = absValue.slice(0, 1);
|
|
838
844
|
}
|
|
839
845
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -769,7 +769,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
769
769
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
770
770
|
const newVar = variable + (k + 1);
|
|
771
771
|
const newIndex = index + (k + 1) / 10;
|
|
772
|
-
const scalingVariable = setSubScalingVar(
|
|
772
|
+
const scalingVariable = setSubScalingVar(
|
|
773
|
+
k + 1,
|
|
774
|
+
arr,
|
|
775
|
+
variable,
|
|
776
|
+
sequenceProps
|
|
777
|
+
);
|
|
773
778
|
const props2 = {
|
|
774
779
|
key: key + (k + 1),
|
|
775
780
|
variable: newVar,
|
|
@@ -813,16 +818,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
813
818
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
814
819
|
const CONFIG2 = getActiveConfig();
|
|
815
820
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
816
|
-
const {
|
|
817
|
-
sequence,
|
|
818
|
-
unit = UNIT2.default,
|
|
819
|
-
useVariable
|
|
820
|
-
} = sequenceProps;
|
|
821
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
821
822
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
822
823
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
823
824
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
824
825
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
825
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
826
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
827
|
+
return value;
|
|
826
828
|
const letterVal = value.toUpperCase();
|
|
827
829
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
828
830
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -846,7 +848,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
846
848
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
847
849
|
}
|
|
848
850
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
849
|
-
if (CONFIG2.verbose)
|
|
851
|
+
if (CONFIG2.verbose)
|
|
852
|
+
console.warn(
|
|
853
|
+
absValue,
|
|
854
|
+
"- value is not found because `subSequence` is set to false"
|
|
855
|
+
);
|
|
850
856
|
absValue = absValue.slice(0, 1);
|
|
851
857
|
}
|
|
852
858
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -868,7 +868,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
868
868
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
869
869
|
const newVar = variable + (k + 1);
|
|
870
870
|
const newIndex = index + (k + 1) / 10;
|
|
871
|
-
const scalingVariable = setSubScalingVar(
|
|
871
|
+
const scalingVariable = setSubScalingVar(
|
|
872
|
+
k + 1,
|
|
873
|
+
arr,
|
|
874
|
+
variable,
|
|
875
|
+
sequenceProps
|
|
876
|
+
);
|
|
872
877
|
const props2 = {
|
|
873
878
|
key: key + (k + 1),
|
|
874
879
|
variable: newVar,
|
|
@@ -912,16 +917,13 @@ var generateSequence = (sequenceProps) => {
|
|
|
912
917
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
913
918
|
const CONFIG2 = getActiveConfig();
|
|
914
919
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
915
|
-
const {
|
|
916
|
-
sequence,
|
|
917
|
-
unit = UNIT2.default,
|
|
918
|
-
useVariable
|
|
919
|
-
} = sequenceProps;
|
|
920
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
920
921
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
921
922
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
922
923
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
923
924
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
924
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
925
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
926
|
+
return value;
|
|
925
927
|
const letterVal = value.toUpperCase();
|
|
926
928
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
927
929
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -945,7 +947,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
945
947
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
946
948
|
}
|
|
947
949
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
948
|
-
if (CONFIG2.verbose)
|
|
950
|
+
if (CONFIG2.verbose)
|
|
951
|
+
console.warn(
|
|
952
|
+
absValue,
|
|
953
|
+
"- value is not found because `subSequence` is set to false"
|
|
954
|
+
);
|
|
949
955
|
absValue = absValue.slice(0, 1);
|
|
950
956
|
}
|
|
951
957
|
if (useVariable || CONFIG2.useVariable) {
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -976,7 +976,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
976
976
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
977
977
|
const newVar = variable + (k + 1);
|
|
978
978
|
const newIndex = index + (k + 1) / 10;
|
|
979
|
-
const scalingVariable = setSubScalingVar(
|
|
979
|
+
const scalingVariable = setSubScalingVar(
|
|
980
|
+
k + 1,
|
|
981
|
+
arr,
|
|
982
|
+
variable,
|
|
983
|
+
sequenceProps
|
|
984
|
+
);
|
|
980
985
|
const props2 = {
|
|
981
986
|
key: key + (k + 1),
|
|
982
987
|
variable: newVar,
|
|
@@ -1058,16 +1063,13 @@ var generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
1058
1063
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
1059
1064
|
const CONFIG2 = getActiveConfig();
|
|
1060
1065
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
1061
|
-
const {
|
|
1062
|
-
sequence,
|
|
1063
|
-
unit = UNIT2.default,
|
|
1064
|
-
useVariable
|
|
1065
|
-
} = sequenceProps;
|
|
1066
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
1066
1067
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
1067
1068
|
const prefix = `--${(0, import_utils4.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
1068
1069
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1069
1070
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1070
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
1071
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
1072
|
+
return value;
|
|
1071
1073
|
const letterVal = value.toUpperCase();
|
|
1072
1074
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
1073
1075
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -1091,7 +1093,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
1091
1093
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
1092
1094
|
}
|
|
1093
1095
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
1094
|
-
if (CONFIG2.verbose)
|
|
1096
|
+
if (CONFIG2.verbose)
|
|
1097
|
+
console.warn(
|
|
1098
|
+
absValue,
|
|
1099
|
+
"- value is not found because `subSequence` is set to false"
|
|
1100
|
+
);
|
|
1095
1101
|
absValue = absValue.slice(0, 1);
|
|
1096
1102
|
}
|
|
1097
1103
|
if (useVariable || CONFIG2.useVariable) {
|
|
@@ -761,7 +761,12 @@ var generateSubSequence = (props, sequenceProps) => {
|
|
|
761
761
|
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
762
762
|
const newVar = variable + (k + 1);
|
|
763
763
|
const newIndex = index + (k + 1) / 10;
|
|
764
|
-
const scalingVariable = setSubScalingVar(
|
|
764
|
+
const scalingVariable = setSubScalingVar(
|
|
765
|
+
k + 1,
|
|
766
|
+
arr,
|
|
767
|
+
variable,
|
|
768
|
+
sequenceProps
|
|
769
|
+
);
|
|
765
770
|
const props2 = {
|
|
766
771
|
key: key + (k + 1),
|
|
767
772
|
variable: newVar,
|
|
@@ -843,16 +848,13 @@ var generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
843
848
|
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
844
849
|
const CONFIG2 = getActiveConfig();
|
|
845
850
|
const { UNIT: UNIT2 } = CONFIG2;
|
|
846
|
-
const {
|
|
847
|
-
sequence,
|
|
848
|
-
unit = UNIT2.default,
|
|
849
|
-
useVariable
|
|
850
|
-
} = sequenceProps;
|
|
851
|
+
const { sequence, unit = UNIT2.default, useVariable } = sequenceProps;
|
|
851
852
|
if (isString(value) && value.slice(0, 2) === "--") return `var(${value})`;
|
|
852
853
|
const prefix = `--${(0, import_utils3.toDashCase)(sequenceProps.type.replace(".", "-"))}-`;
|
|
853
854
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
854
855
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
855
|
-
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
856
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || value.includes("var") || !startsWithDashOrLetter)
|
|
857
|
+
return value;
|
|
856
858
|
const letterVal = value.toUpperCase();
|
|
857
859
|
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
858
860
|
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
@@ -876,7 +878,11 @@ var getSequenceValue = (value = "A", sequenceProps) => {
|
|
|
876
878
|
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
877
879
|
}
|
|
878
880
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
879
|
-
if (CONFIG2.verbose)
|
|
881
|
+
if (CONFIG2.verbose)
|
|
882
|
+
console.warn(
|
|
883
|
+
absValue,
|
|
884
|
+
"- value is not found because `subSequence` is set to false"
|
|
885
|
+
);
|
|
880
886
|
absValue = absValue.slice(0, 1);
|
|
881
887
|
}
|
|
882
888
|
if (useVariable || CONFIG2.useVariable) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/scratch",
|
|
3
3
|
"description": "Φ / CSS framework and methodology.",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "2.29.
|
|
5
|
+
"version": "2.29.58",
|
|
6
6
|
"files": [
|
|
7
7
|
"src",
|
|
8
8
|
"dist"
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@domql/utils": "^2.29.
|
|
29
|
-
"@symbo.ls/utils": "^2.29.
|
|
28
|
+
"@domql/utils": "^2.29.58",
|
|
29
|
+
"@symbo.ls/utils": "^2.29.58",
|
|
30
30
|
"color-contrast-checker": "^1.5.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "d32818a7552e84853d4dcc9dec1dcc7e3e5c7dab"
|
|
33
33
|
}
|
package/src/utils/sequence.js
CHANGED
|
@@ -39,7 +39,7 @@ const setSequenceValue = (props, sequenceProps) => {
|
|
|
39
39
|
sequenceProps.sequence[key] = {
|
|
40
40
|
key,
|
|
41
41
|
decimal: ~~(value * 100) / 100,
|
|
42
|
-
val: ~~
|
|
42
|
+
val: ~~value,
|
|
43
43
|
scaling,
|
|
44
44
|
index,
|
|
45
45
|
scalingVariable,
|
|
@@ -81,16 +81,16 @@ export const setSubScalingVar = (index, arr, variable, sequenceProps) => {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export const getSubratioDifference = (base, ratio) => {
|
|
84
|
-
const diff =
|
|
84
|
+
const diff = base * ratio - base
|
|
85
85
|
const subRatio = diff / 1.618
|
|
86
|
-
const first =
|
|
86
|
+
const first = base * ratio - subRatio
|
|
87
87
|
const second = base + subRatio
|
|
88
88
|
const middle = (first + second) / 2
|
|
89
89
|
return [first, middle, second]
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
export const getSubratio = (base, ratio) => {
|
|
93
|
-
return getSubratioDifference(base, ratio).map(v => v / base)
|
|
93
|
+
return getSubratioDifference(base, ratio).map((v) => v / base)
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export const generateSubSequence = (props, sequenceProps) => {
|
|
@@ -105,10 +105,15 @@ export const generateSubSequence = (props, sequenceProps) => {
|
|
|
105
105
|
else arr = [first, second]
|
|
106
106
|
|
|
107
107
|
arr.forEach((v, k) => {
|
|
108
|
-
const scaling = ~~(v / base * 1000) / 1000
|
|
108
|
+
const scaling = ~~((v / base) * 1000) / 1000
|
|
109
109
|
const newVar = variable + (k + 1)
|
|
110
110
|
const newIndex = index + (k + 1) / 10
|
|
111
|
-
const scalingVariable = setSubScalingVar(
|
|
111
|
+
const scalingVariable = setSubScalingVar(
|
|
112
|
+
k + 1,
|
|
113
|
+
arr,
|
|
114
|
+
variable,
|
|
115
|
+
sequenceProps
|
|
116
|
+
)
|
|
112
117
|
|
|
113
118
|
const props = {
|
|
114
119
|
key: key + (k + 1),
|
|
@@ -146,7 +151,7 @@ export const generateSequence = (sequenceProps) => {
|
|
|
146
151
|
const key = range[1] - i
|
|
147
152
|
const letterKey = numToLetterMap[key]
|
|
148
153
|
const value = switchSequenceOnNegative(key, base, ratio)
|
|
149
|
-
const scaling = ~~(value / base * 100) / 100
|
|
154
|
+
const scaling = ~~((value / base) * 100) / 100
|
|
150
155
|
const variable = prefix + letterKey
|
|
151
156
|
const scalingVariable = setScalingVar(key, sequenceProps)
|
|
152
157
|
|
|
@@ -176,7 +181,7 @@ export const generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
176
181
|
([, value]) => value === position
|
|
177
182
|
)?.[0]
|
|
178
183
|
: position
|
|
179
|
-
|
|
184
|
+
|
|
180
185
|
if (!letterKey) {
|
|
181
186
|
console.warn(`Position ${position} is out of range in numToLetterMap`)
|
|
182
187
|
return null
|
|
@@ -218,17 +223,11 @@ export const generateSequencePosition = (sequenceProps, position = 0) => {
|
|
|
218
223
|
export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
219
224
|
const CONFIG = getActiveConfig()
|
|
220
225
|
const { UNIT } = CONFIG
|
|
221
|
-
|
|
222
|
-
const {
|
|
223
|
-
sequence,
|
|
224
|
-
unit = UNIT.default,
|
|
225
|
-
useVariable
|
|
226
|
-
} = sequenceProps
|
|
226
|
+
const { sequence, unit = UNIT.default, useVariable } = sequenceProps
|
|
227
227
|
|
|
228
228
|
if (isString(value) && value.slice(0, 2) === '--') return `var(${value})`
|
|
229
229
|
|
|
230
230
|
const prefix = `--${toDashCase(sequenceProps.type.replace('.', '-'))}-`
|
|
231
|
-
|
|
232
231
|
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i
|
|
233
232
|
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value)
|
|
234
233
|
|
|
@@ -243,7 +242,8 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
243
242
|
value.includes('calc') ||
|
|
244
243
|
value.includes('var') ||
|
|
245
244
|
!startsWithDashOrLetter
|
|
246
|
-
)
|
|
245
|
+
)
|
|
246
|
+
return value
|
|
247
247
|
|
|
248
248
|
const letterVal = value.toUpperCase()
|
|
249
249
|
const isNegative = letterVal.slice(0, 1) === '-' ? '-' : ''
|
|
@@ -255,7 +255,8 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
255
255
|
absValue = absValue.split('_')[0]
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
-
const varValue =
|
|
258
|
+
const varValue = (v) =>
|
|
259
|
+
startsWithDashOrLetterRegex.test(v) ? `var(${prefix}${v}${mediaName})` : v
|
|
259
260
|
if (absValue.includes('+')) {
|
|
260
261
|
const [first, second] = absValue.split('+')
|
|
261
262
|
const joint = `${varValue(first)} + ${varValue(second)}`
|
|
@@ -274,7 +275,11 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
274
275
|
|
|
275
276
|
// if subsequence is not set but value is applied
|
|
276
277
|
if (!sequence[absValue] && absValue.length === 2) {
|
|
277
|
-
if (CONFIG.verbose)
|
|
278
|
+
if (CONFIG.verbose)
|
|
279
|
+
console.warn(
|
|
280
|
+
absValue,
|
|
281
|
+
'- value is not found because `subSequence` is set to false'
|
|
282
|
+
)
|
|
278
283
|
absValue = absValue.slice(0, 1)
|
|
279
284
|
}
|
|
280
285
|
|
|
@@ -284,7 +289,7 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
284
289
|
}
|
|
285
290
|
|
|
286
291
|
const sequenceItem = sequence ? sequence[absValue] : null
|
|
287
|
-
if (!sequenceItem) return console.warn(
|
|
292
|
+
if (!sequenceItem) return console.warn("can't find", sequence, absValue)
|
|
288
293
|
|
|
289
294
|
if (unit === 'ms' || unit === 's') {
|
|
290
295
|
return isNegative + sequenceItem.val + unit
|
|
@@ -293,19 +298,24 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
293
298
|
return isNegative + sequenceItem.scaling + unit
|
|
294
299
|
}
|
|
295
300
|
|
|
296
|
-
export const getSequenceValuePropertyPair = (
|
|
301
|
+
export const getSequenceValuePropertyPair = (
|
|
302
|
+
value,
|
|
303
|
+
propertyName,
|
|
304
|
+
sequenceProps
|
|
305
|
+
) => {
|
|
297
306
|
if (typeof value !== 'string') {
|
|
298
307
|
const CONFIG = getActiveConfig()
|
|
299
308
|
if (CONFIG.verbose) console.warn(propertyName, value, 'is not a string')
|
|
300
|
-
return
|
|
309
|
+
return { [propertyName]: value }
|
|
301
310
|
}
|
|
302
|
-
if (value === '-' || value === '') return
|
|
311
|
+
if (value === '-' || value === '') return {}
|
|
303
312
|
return { [propertyName]: getSequenceValue(value, sequenceProps) }
|
|
304
313
|
}
|
|
305
314
|
|
|
306
|
-
export const findHeadingLetter = (h1Matches, index) =>
|
|
315
|
+
export const findHeadingLetter = (h1Matches, index) =>
|
|
316
|
+
numToLetterMap[h1Matches - index]
|
|
307
317
|
|
|
308
|
-
export const findHeadings = propertyNames => {
|
|
318
|
+
export const findHeadings = (propertyNames) => {
|
|
309
319
|
const { h1Matches, sequence } = propertyNames
|
|
310
320
|
return new Array(6).fill(null).map((_, i) => {
|
|
311
321
|
const findLetter = findHeadingLetter(h1Matches, i)
|