inl-ui 0.1.112 → 0.1.113

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.
@@ -1,110 +1,110 @@
1
- /* stylelint-disable */
2
- .bezierEasingMixin() {
3
- @functions: ~`(function() {
4
- var NEWTON_ITERATIONS = 4;
5
- var NEWTON_MIN_SLOPE = 0.001;
6
- var SUBDIVISION_PRECISION = 0.0000001;
7
- var SUBDIVISION_MAX_ITERATIONS = 10;
8
-
9
- var kSplineTableSize = 11;
10
- var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
11
-
12
- var float32ArraySupported = typeof Float32Array === 'function';
13
-
14
- function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
15
- function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
16
- function C (aA1) { return 3.0 * aA1; }
17
-
18
- // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
19
- function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
20
-
21
- // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
22
- function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
23
-
24
- function binarySubdivide (aX, aA, aB, mX1, mX2) {
25
- var currentX, currentT, i = 0;
26
- do {
27
- currentT = aA + (aB - aA) / 2.0;
28
- currentX = calcBezier(currentT, mX1, mX2) - aX;
29
- if (currentX > 0.0) {
30
- aB = currentT;
31
- } else {
32
- aA = currentT;
33
- }
34
- } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
35
- return currentT;
36
- }
37
-
38
- function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
39
- for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
40
- var currentSlope = getSlope(aGuessT, mX1, mX2);
41
- if (currentSlope === 0.0) {
42
- return aGuessT;
43
- }
44
- var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
45
- aGuessT -= currentX / currentSlope;
46
- }
47
- return aGuessT;
48
- }
49
-
50
- var BezierEasing = function (mX1, mY1, mX2, mY2) {
51
- if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
52
- throw new Error('bezier x values must be in [0, 1] range');
53
- }
54
-
55
- // Precompute samples table
56
- var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
57
- if (mX1 !== mY1 || mX2 !== mY2) {
58
- for (var i = 0; i < kSplineTableSize; ++i) {
59
- sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
60
- }
61
- }
62
-
63
- function getTForX (aX) {
64
- var intervalStart = 0.0;
65
- var currentSample = 1;
66
- var lastSample = kSplineTableSize - 1;
67
-
68
- for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
69
- intervalStart += kSampleStepSize;
70
- }
71
- --currentSample;
72
-
73
- // Interpolate to provide an initial guess for t
74
- var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
75
- var guessForT = intervalStart + dist * kSampleStepSize;
76
-
77
- var initialSlope = getSlope(guessForT, mX1, mX2);
78
- if (initialSlope >= NEWTON_MIN_SLOPE) {
79
- return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
80
- } else if (initialSlope === 0.0) {
81
- return guessForT;
82
- } else {
83
- return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
84
- }
85
- }
86
-
87
- return function BezierEasing (x) {
88
- if (mX1 === mY1 && mX2 === mY2) {
89
- return x; // linear
90
- }
91
- // Because JavaScript number are imprecise, we should guarantee the extremes are right.
92
- if (x === 0) {
93
- return 0;
94
- }
95
- if (x === 1) {
96
- return 1;
97
- }
98
- return calcBezier(getTForX(x), mY1, mY2);
99
- };
100
- };
101
-
102
- this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
103
- // less 3 requires a return
104
- return '';
105
- })()`;
106
- }
107
- // It is hacky way to make this function will be compiled preferentially by less
108
- // resolve error: `ReferenceError: colorPalette is not defined`
109
- // https://github.com/ant-design/ant-motion/issues/44
110
- .bezierEasingMixin();
1
+ /* stylelint-disable */
2
+ .bezierEasingMixin() {
3
+ @functions: ~`(function() {
4
+ var NEWTON_ITERATIONS = 4;
5
+ var NEWTON_MIN_SLOPE = 0.001;
6
+ var SUBDIVISION_PRECISION = 0.0000001;
7
+ var SUBDIVISION_MAX_ITERATIONS = 10;
8
+
9
+ var kSplineTableSize = 11;
10
+ var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
11
+
12
+ var float32ArraySupported = typeof Float32Array === 'function';
13
+
14
+ function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
15
+ function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
16
+ function C (aA1) { return 3.0 * aA1; }
17
+
18
+ // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
19
+ function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
20
+
21
+ // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
22
+ function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
23
+
24
+ function binarySubdivide (aX, aA, aB, mX1, mX2) {
25
+ var currentX, currentT, i = 0;
26
+ do {
27
+ currentT = aA + (aB - aA) / 2.0;
28
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
29
+ if (currentX > 0.0) {
30
+ aB = currentT;
31
+ } else {
32
+ aA = currentT;
33
+ }
34
+ } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
35
+ return currentT;
36
+ }
37
+
38
+ function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
39
+ for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
40
+ var currentSlope = getSlope(aGuessT, mX1, mX2);
41
+ if (currentSlope === 0.0) {
42
+ return aGuessT;
43
+ }
44
+ var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
45
+ aGuessT -= currentX / currentSlope;
46
+ }
47
+ return aGuessT;
48
+ }
49
+
50
+ var BezierEasing = function (mX1, mY1, mX2, mY2) {
51
+ if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
52
+ throw new Error('bezier x values must be in [0, 1] range');
53
+ }
54
+
55
+ // Precompute samples table
56
+ var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
57
+ if (mX1 !== mY1 || mX2 !== mY2) {
58
+ for (var i = 0; i < kSplineTableSize; ++i) {
59
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
60
+ }
61
+ }
62
+
63
+ function getTForX (aX) {
64
+ var intervalStart = 0.0;
65
+ var currentSample = 1;
66
+ var lastSample = kSplineTableSize - 1;
67
+
68
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
69
+ intervalStart += kSampleStepSize;
70
+ }
71
+ --currentSample;
72
+
73
+ // Interpolate to provide an initial guess for t
74
+ var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
75
+ var guessForT = intervalStart + dist * kSampleStepSize;
76
+
77
+ var initialSlope = getSlope(guessForT, mX1, mX2);
78
+ if (initialSlope >= NEWTON_MIN_SLOPE) {
79
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
80
+ } else if (initialSlope === 0.0) {
81
+ return guessForT;
82
+ } else {
83
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
84
+ }
85
+ }
86
+
87
+ return function BezierEasing (x) {
88
+ if (mX1 === mY1 && mX2 === mY2) {
89
+ return x; // linear
90
+ }
91
+ // Because JavaScript number are imprecise, we should guarantee the extremes are right.
92
+ if (x === 0) {
93
+ return 0;
94
+ }
95
+ if (x === 1) {
96
+ return 1;
97
+ }
98
+ return calcBezier(getTForX(x), mY1, mY2);
99
+ };
100
+ };
101
+
102
+ this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
103
+ // less 3 requires a return
104
+ return '';
105
+ })()`;
106
+ }
107
+ // It is hacky way to make this function will be compiled preferentially by less
108
+ // resolve error: `ReferenceError: colorPalette is not defined`
109
+ // https://github.com/ant-design/ant-motion/issues/44
110
+ .bezierEasingMixin();
@@ -1,81 +1,81 @@
1
- /* stylelint-disable no-duplicate-selectors */
2
- @import "bezierEasing";
3
- @import "tinyColor";
4
-
5
- // We create a very complex algorithm which take the place of original tint/shade color system
6
- // to make sure no one can understand it 👻
7
- // and create an entire color palette magicly by inputing just a single primary color.
8
- // We are using bezier-curve easing function and some color manipulations like tint/shade/darken/spin
9
- .colorPaletteMixin() {
10
- @functions: ~`(function() {
11
- var hueStep = 2;
12
- var saturationStep = 0.16;
13
- var saturationStep2 = 0.05;
14
- var brightnessStep1 = 0.05;
15
- var brightnessStep2 = 0.15;
16
- var lightColorCount = 5;
17
- var darkColorCount = 4;
18
-
19
- var getHue = function(hsv, i, isLight) {
20
- var hue;
21
- if (hsv.h >= 60 && hsv.h <= 240) {
22
- hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
23
- } else {
24
- hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
25
- }
26
- if (hue < 0) {
27
- hue += 360;
28
- } else if (hue >= 360) {
29
- hue -= 360;
30
- }
31
- return Math.round(hue);
32
- };
33
- var getSaturation = function(hsv, i, isLight) {
34
- var saturation;
35
- if (isLight) {
36
- saturation = hsv.s - saturationStep * i;
37
- } else if (i === darkColorCount) {
38
- saturation = hsv.s + saturationStep;
39
- } else {
40
- saturation = hsv.s + saturationStep2 * i;
41
- }
42
- if (saturation > 1) {
43
- saturation = 1;
44
- }
45
- if (isLight && i === lightColorCount && saturation > 0.1) {
46
- saturation = 0.1;
47
- }
48
- if (saturation < 0.06) {
49
- saturation = 0.06;
50
- }
51
- return Number(saturation.toFixed(2));
52
- };
53
- var getValue = function(hsv, i, isLight) {
54
- var value;
55
- if (isLight) {
56
- value = hsv.v + brightnessStep1 * i;
57
- }else{
58
- value = hsv.v - brightnessStep2 * i
59
- }
60
- if (value > 1) {
61
- value = 1;
62
- }
63
- return Number(value.toFixed(2))
64
- };
65
-
66
- this.colorPalette = function(color, index) {
67
- var isLight = index <= 6;
68
- var hsv = tinycolor(color).toHsv();
69
- var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1;
70
- return tinycolor({
71
- h: getHue(hsv, i, isLight),
72
- s: getSaturation(hsv, i, isLight),
73
- v: getValue(hsv, i, isLight),
74
- }).toHexString();
75
- };
76
- })()`;
77
- }
78
- // It is hacky way to make this function will be compiled preferentially by less
79
- // resolve error: `ReferenceError: colorPalette is not defined`
80
- // https://github.com/ant-design/ant-motion/issues/44
81
- .colorPaletteMixin();
1
+ /* stylelint-disable no-duplicate-selectors */
2
+ @import "bezierEasing";
3
+ @import "tinyColor";
4
+
5
+ // We create a very complex algorithm which take the place of original tint/shade color system
6
+ // to make sure no one can understand it 👻
7
+ // and create an entire color palette magicly by inputing just a single primary color.
8
+ // We are using bezier-curve easing function and some color manipulations like tint/shade/darken/spin
9
+ .colorPaletteMixin() {
10
+ @functions: ~`(function() {
11
+ var hueStep = 2;
12
+ var saturationStep = 0.16;
13
+ var saturationStep2 = 0.05;
14
+ var brightnessStep1 = 0.05;
15
+ var brightnessStep2 = 0.15;
16
+ var lightColorCount = 5;
17
+ var darkColorCount = 4;
18
+
19
+ var getHue = function(hsv, i, isLight) {
20
+ var hue;
21
+ if (hsv.h >= 60 && hsv.h <= 240) {
22
+ hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
23
+ } else {
24
+ hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
25
+ }
26
+ if (hue < 0) {
27
+ hue += 360;
28
+ } else if (hue >= 360) {
29
+ hue -= 360;
30
+ }
31
+ return Math.round(hue);
32
+ };
33
+ var getSaturation = function(hsv, i, isLight) {
34
+ var saturation;
35
+ if (isLight) {
36
+ saturation = hsv.s - saturationStep * i;
37
+ } else if (i === darkColorCount) {
38
+ saturation = hsv.s + saturationStep;
39
+ } else {
40
+ saturation = hsv.s + saturationStep2 * i;
41
+ }
42
+ if (saturation > 1) {
43
+ saturation = 1;
44
+ }
45
+ if (isLight && i === lightColorCount && saturation > 0.1) {
46
+ saturation = 0.1;
47
+ }
48
+ if (saturation < 0.06) {
49
+ saturation = 0.06;
50
+ }
51
+ return Number(saturation.toFixed(2));
52
+ };
53
+ var getValue = function(hsv, i, isLight) {
54
+ var value;
55
+ if (isLight) {
56
+ value = hsv.v + brightnessStep1 * i;
57
+ }else{
58
+ value = hsv.v - brightnessStep2 * i
59
+ }
60
+ if (value > 1) {
61
+ value = 1;
62
+ }
63
+ return Number(value.toFixed(2))
64
+ };
65
+
66
+ this.colorPalette = function(color, index) {
67
+ var isLight = index <= 6;
68
+ var hsv = tinycolor(color).toHsv();
69
+ var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1;
70
+ return tinycolor({
71
+ h: getHue(hsv, i, isLight),
72
+ s: getSaturation(hsv, i, isLight),
73
+ v: getValue(hsv, i, isLight),
74
+ }).toHexString();
75
+ };
76
+ })()`;
77
+ }
78
+ // It is hacky way to make this function will be compiled preferentially by less
79
+ // resolve error: `ReferenceError: colorPalette is not defined`
80
+ // https://github.com/ant-design/ant-motion/issues/44
81
+ .colorPaletteMixin();