@fluentui-react-native/experimental-shimmer 0.14.1 → 0.14.4
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/.cache/tsconfig.tsbuildinfo +1 -0
- package/CHANGELOG.md +42 -0
- package/jest.config.cjs +1 -0
- package/lib/Shimmer.d.ts.map +1 -1
- package/lib/Shimmer.js +4 -22
- package/lib/Shimmer.js.map +1 -1
- package/lib/Shimmer.test.js.map +1 -1
- package/lib/Shimmer.types.shared.d.ts +1 -1
- package/lib/Shimmer.types.shared.d.ts.map +1 -1
- package/lib/Shimmer.win32.js +3 -11
- package/lib/Shimmer.win32.js.map +1 -1
- package/lib/SvgShapeToPath.js.map +1 -1
- package/lib/Win32ShimmerNativeComponent.d.ts.map +1 -1
- package/package.json +24 -29
- package/src/Shimmer.test.tsx +1 -1
- package/src/Shimmer.tsx +3 -13
- package/src/Shimmer.types.shared.ts +1 -1
- package/tsconfig.json +26 -3
- package/babel.config.js +0 -1
- package/eslint.config.js +0 -3
- package/jest.config.js +0 -2
- package/lib-commonjs/Shimmer.d.ts +0 -3
- package/lib-commonjs/Shimmer.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.js +0 -104
- package/lib-commonjs/Shimmer.js.map +0 -1
- package/lib-commonjs/Shimmer.styling.d.ts +0 -4
- package/lib-commonjs/Shimmer.styling.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.styling.js +0 -34
- package/lib-commonjs/Shimmer.styling.js.map +0 -1
- package/lib-commonjs/Shimmer.styling.win32.d.ts +0 -8
- package/lib-commonjs/Shimmer.styling.win32.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.styling.win32.js +0 -35
- package/lib-commonjs/Shimmer.styling.win32.js.map +0 -1
- package/lib-commonjs/Shimmer.test.d.ts +0 -2
- package/lib-commonjs/Shimmer.test.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.test.js +0 -92
- package/lib-commonjs/Shimmer.test.js.map +0 -1
- package/lib-commonjs/Shimmer.types.d.ts +0 -3
- package/lib-commonjs/Shimmer.types.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.types.js +0 -6
- package/lib-commonjs/Shimmer.types.js.map +0 -1
- package/lib-commonjs/Shimmer.types.shared.d.ts +0 -145
- package/lib-commonjs/Shimmer.types.shared.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.types.shared.js +0 -5
- package/lib-commonjs/Shimmer.types.shared.js.map +0 -1
- package/lib-commonjs/Shimmer.types.win32.d.ts +0 -39
- package/lib-commonjs/Shimmer.types.win32.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.types.win32.js +0 -6
- package/lib-commonjs/Shimmer.types.win32.js.map +0 -1
- package/lib-commonjs/Shimmer.win32.d.ts +0 -9
- package/lib-commonjs/Shimmer.win32.d.ts.map +0 -1
- package/lib-commonjs/Shimmer.win32.js +0 -135
- package/lib-commonjs/Shimmer.win32.js.map +0 -1
- package/lib-commonjs/ShimmerTokens.android.d.ts +0 -5
- package/lib-commonjs/ShimmerTokens.android.d.ts.map +0 -1
- package/lib-commonjs/ShimmerTokens.android.js +0 -15
- package/lib-commonjs/ShimmerTokens.android.js.map +0 -1
- package/lib-commonjs/ShimmerTokens.d.ts +0 -5
- package/lib-commonjs/ShimmerTokens.d.ts.map +0 -1
- package/lib-commonjs/ShimmerTokens.ios.d.ts +0 -5
- package/lib-commonjs/ShimmerTokens.ios.d.ts.map +0 -1
- package/lib-commonjs/ShimmerTokens.ios.js +0 -15
- package/lib-commonjs/ShimmerTokens.ios.js.map +0 -1
- package/lib-commonjs/ShimmerTokens.js +0 -17
- package/lib-commonjs/ShimmerTokens.js.map +0 -1
- package/lib-commonjs/ShimmerTokens.win32.d.ts +0 -5
- package/lib-commonjs/ShimmerTokens.win32.d.ts.map +0 -1
- package/lib-commonjs/ShimmerTokens.win32.js +0 -17
- package/lib-commonjs/ShimmerTokens.win32.js.map +0 -1
- package/lib-commonjs/SvgShapeToPath.d.ts +0 -18
- package/lib-commonjs/SvgShapeToPath.d.ts.map +0 -1
- package/lib-commonjs/SvgShapeToPath.js +0 -148
- package/lib-commonjs/SvgShapeToPath.js.map +0 -1
- package/lib-commonjs/Win32ShimmerNativeComponent.d.ts +0 -14
- package/lib-commonjs/Win32ShimmerNativeComponent.d.ts.map +0 -1
- package/lib-commonjs/Win32ShimmerNativeComponent.js +0 -10
- package/lib-commonjs/Win32ShimmerNativeComponent.js.map +0 -1
- package/lib-commonjs/consts.android.d.ts +0 -4
- package/lib-commonjs/consts.android.d.ts.map +0 -1
- package/lib-commonjs/consts.android.js +0 -7
- package/lib-commonjs/consts.android.js.map +0 -1
- package/lib-commonjs/consts.d.ts +0 -4
- package/lib-commonjs/consts.d.ts.map +0 -1
- package/lib-commonjs/consts.ios.d.ts +0 -4
- package/lib-commonjs/consts.ios.d.ts.map +0 -1
- package/lib-commonjs/consts.ios.js +0 -7
- package/lib-commonjs/consts.ios.js.map +0 -1
- package/lib-commonjs/consts.js +0 -7
- package/lib-commonjs/consts.js.map +0 -1
- package/lib-commonjs/consts.win32.d.ts +0 -4
- package/lib-commonjs/consts.win32.d.ts.map +0 -1
- package/lib-commonjs/consts.win32.js +0 -7
- package/lib-commonjs/consts.win32.js.map +0 -1
- package/lib-commonjs/index.d.ts +0 -5
- package/lib-commonjs/index.d.ts.map +0 -1
- package/lib-commonjs/index.js +0 -12
- package/lib-commonjs/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Win32ShimmerNativeComponent.d.ts","sourceRoot":"","sources":["../src/Win32ShimmerNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGxE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB
|
|
1
|
+
{"version":3,"file":"Win32ShimmerNativeComponent.d.ts","sourceRoot":"","sources":["../src/Win32ShimmerNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGxE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-shimmer",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "A cross-platform Fluent Shimmer component",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -9,63 +9,57 @@
|
|
|
9
9
|
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
10
10
|
"directory": "packages/experimental/Shimmer"
|
|
11
11
|
},
|
|
12
|
-
"
|
|
12
|
+
"type": "module",
|
|
13
|
+
"main": "lib/index.js",
|
|
13
14
|
"module": "lib/index.js",
|
|
14
15
|
"types": "lib/index.d.ts",
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./lib/index.d.ts",
|
|
19
|
+
"react-native": "./src/index.ts",
|
|
18
20
|
"import": "./lib/index.js",
|
|
19
|
-
"require": "./lib-commonjs/index.js",
|
|
20
21
|
"default": "./src/index.ts"
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"build-cjs": "tsgo --outDir lib-commonjs",
|
|
26
|
-
"build-core": "tsgo --outDir lib --module esnext --moduleResolution bundler",
|
|
25
|
+
"build": "tsgo -b",
|
|
27
26
|
"clean": "fluentui-scripts clean",
|
|
28
27
|
"depcheck": "fluentui-scripts depcheck",
|
|
29
|
-
"lint": "fluentui-scripts eslint",
|
|
30
|
-
"lint-package": "fluentui-scripts lint-package",
|
|
31
28
|
"format": "fluentui-scripts format",
|
|
29
|
+
"lint": "fluentui-scripts lint",
|
|
32
30
|
"test": "fluentui-scripts jest",
|
|
33
31
|
"update-snapshots": "fluentui-scripts jest -u"
|
|
34
32
|
},
|
|
35
33
|
"dependencies": {
|
|
36
|
-
"@fluentui-react-native/framework": "0.
|
|
37
|
-
"@fluentui-react-native/theming-utils": "0.27.
|
|
38
|
-
"@fluentui-react-native/tokens": "0.24.
|
|
39
|
-
"@fluentui-react-native/use-styling": "0.
|
|
34
|
+
"@fluentui-react-native/framework": "0.16.0",
|
|
35
|
+
"@fluentui-react-native/theming-utils": "0.27.4",
|
|
36
|
+
"@fluentui-react-native/tokens": "0.24.4",
|
|
37
|
+
"@fluentui-react-native/use-styling": "0.15.0",
|
|
40
38
|
"assert-never": "^1.2.1"
|
|
41
39
|
},
|
|
42
40
|
"devDependencies": {
|
|
43
41
|
"@babel/core": "^7.20.0",
|
|
44
|
-
"@fluentui-react-native/
|
|
45
|
-
"@fluentui-react-native/eslint-config-rules": "0.1.2",
|
|
46
|
-
"@fluentui-react-native/framework-base": "0.3.1",
|
|
47
|
-
"@fluentui-react-native/jest-config": "0.1.0",
|
|
48
|
-
"@fluentui-react-native/kit-config": "0.1.2",
|
|
42
|
+
"@fluentui-react-native/framework-base": "0.4.0",
|
|
49
43
|
"@fluentui-react-native/scripts": "0.1.0",
|
|
50
44
|
"@react-native-community/cli": "^20.0.0",
|
|
51
45
|
"@react-native-community/cli-platform-android": "^20.0.0",
|
|
52
46
|
"@react-native-community/cli-platform-ios": "^20.0.0",
|
|
53
47
|
"@react-native/babel-preset": "^0.81.0",
|
|
54
48
|
"@react-native/metro-config": "^0.81.0",
|
|
55
|
-
"@types/react": "~19.1.
|
|
49
|
+
"@types/react": "~19.1.4",
|
|
56
50
|
"@types/react-test-renderer": "^19.1.0",
|
|
57
|
-
"react": "19.1.
|
|
58
|
-
"react-native": "^0.81.
|
|
51
|
+
"react": "19.1.4",
|
|
52
|
+
"react-native": "^0.81.6",
|
|
59
53
|
"react-native-macos": "^0.81.0",
|
|
60
54
|
"react-native-svg": "^15.12.1",
|
|
61
55
|
"react-native-windows": "^0.81.0",
|
|
62
|
-
"react-test-renderer": "19.1.
|
|
56
|
+
"react-test-renderer": "19.1.4"
|
|
63
57
|
},
|
|
64
58
|
"peerDependencies": {
|
|
65
|
-
"@office-iss/react-native-win32": "^0.74.0",
|
|
66
|
-
"@types/react": "~18.2.0 || ~19.0.0 || ~19.1.
|
|
67
|
-
"react": "18.2.0 || 19.0.0 || 19.1.
|
|
68
|
-
"react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.
|
|
59
|
+
"@office-iss/react-native-win32": "^0.74.0 || ^0.81.0",
|
|
60
|
+
"@types/react": "~18.2.0 || ~19.0.0 || ~19.1.4",
|
|
61
|
+
"react": "18.2.0 || 19.0.0 || 19.1.4",
|
|
62
|
+
"react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.6",
|
|
69
63
|
"react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
70
64
|
"react-native-svg": ">=15.0.0 <15.13.0 || >=15.4.0 <15.13.0 || ^15.11.2 || ^15.12.1",
|
|
71
65
|
"react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
|
|
@@ -84,6 +78,9 @@
|
|
|
84
78
|
"optional": true
|
|
85
79
|
}
|
|
86
80
|
},
|
|
81
|
+
"furn": {
|
|
82
|
+
"jestPlatform": "android"
|
|
83
|
+
},
|
|
87
84
|
"rnx-kit": {
|
|
88
85
|
"kitType": "library",
|
|
89
86
|
"alignDeps": {
|
|
@@ -95,11 +92,9 @@
|
|
|
95
92
|
"core-macos",
|
|
96
93
|
"core-windows",
|
|
97
94
|
"react-test-renderer",
|
|
98
|
-
"svg"
|
|
99
|
-
"tools-core",
|
|
100
|
-
"tools-jest"
|
|
95
|
+
"svg"
|
|
101
96
|
]
|
|
102
97
|
},
|
|
103
|
-
"extends": "@fluentui-react-native/kit-config"
|
|
98
|
+
"extends": "@fluentui-react-native/scripts/kit-config"
|
|
104
99
|
}
|
|
105
100
|
}
|
package/src/Shimmer.test.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import * as renderer from 'react-test-renderer';
|
|
|
5
5
|
import { Shimmer } from './Shimmer';
|
|
6
6
|
import type { ShimmerCircleElement, ShimmerRectElement } from './Shimmer.types';
|
|
7
7
|
|
|
8
|
-
function shimmerRects():
|
|
8
|
+
function shimmerRects(): (ShimmerRectElement | ShimmerCircleElement)[] {
|
|
9
9
|
return [
|
|
10
10
|
{
|
|
11
11
|
type: 'rect',
|
package/src/Shimmer.tsx
CHANGED
|
@@ -38,17 +38,7 @@ export const Shimmer = compose<ShimmerType>({
|
|
|
38
38
|
shimmerWaveColor: props.shimmerWaveColor ? props.shimmerWaveColor : tokens['shimmerWaveColor'],
|
|
39
39
|
shimmerWaveColorOpacity: tokens['shimmerWaveColorOpacity'],
|
|
40
40
|
}),
|
|
41
|
-
[
|
|
42
|
-
props.angle,
|
|
43
|
-
props.backgroundColor,
|
|
44
|
-
props.delay,
|
|
45
|
-
props.duration,
|
|
46
|
-
props.shimmerColor,
|
|
47
|
-
props.shimmerColorOpacity,
|
|
48
|
-
props.shimmerWaveColor,
|
|
49
|
-
props.shimmerWaveColorOpacity,
|
|
50
|
-
props.style,
|
|
51
|
-
],
|
|
41
|
+
[props.angle, props.delay, props.duration, props.shimmerColor, props.shimmerWaveColor, props.style, tokens],
|
|
52
42
|
);
|
|
53
43
|
|
|
54
44
|
/* The shimmer animation is implemented using a LinearGradient which travels from left to right.
|
|
@@ -69,11 +59,11 @@ export const Shimmer = compose<ShimmerType>({
|
|
|
69
59
|
useNativeDriver: true,
|
|
70
60
|
}),
|
|
71
61
|
).start();
|
|
72
|
-
}, [memoizedShimmerData.delay, memoizedShimmerData.duration]);
|
|
62
|
+
}, [endValue, memoizedShimmerData.delay, memoizedShimmerData.duration, x1]);
|
|
73
63
|
|
|
74
64
|
useEffect(() => {
|
|
75
65
|
shimmerAnimation();
|
|
76
|
-
});
|
|
66
|
+
}, [shimmerAnimation]);
|
|
77
67
|
|
|
78
68
|
return (rest: ShimmerProps) => {
|
|
79
69
|
const { elements, ...mergedProps } = mergeProps(props, rest);
|
|
@@ -161,7 +161,7 @@ export interface ShimmerProps extends ViewProps, ShimmerTokens {
|
|
|
161
161
|
/**
|
|
162
162
|
* Shimmer shapes that define the masking effect of the Shimmer control.
|
|
163
163
|
*/
|
|
164
|
-
elements:
|
|
164
|
+
elements: ShimmerElementTypes[];
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
export interface ShimmerType {
|
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "@fluentui-react-native/scripts/
|
|
2
|
+
"extends": "@fluentui-react-native/scripts/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"outDir": "lib"
|
|
4
|
+
"outDir": "lib",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"composite": true,
|
|
7
|
+
"tsBuildInfoFile": ".cache/tsconfig.tsbuildinfo"
|
|
5
8
|
},
|
|
6
|
-
"include": ["src"]
|
|
9
|
+
"include": ["src"],
|
|
10
|
+
"references": [
|
|
11
|
+
{
|
|
12
|
+
"path": "../../framework-base/tsconfig.json"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"path": "../../framework/framework/tsconfig.json"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "../../../scripts/tsconfig.json"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "../../theming/theming-utils/tsconfig.json"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"path": "../../utils/tokens/tsconfig.json"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "../../framework/use-styling/tsconfig.json"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
7
30
|
}
|
package/babel.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = require('@fluentui-react-native/babel-config');
|
package/eslint.config.js
DELETED
package/jest.config.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ShimmerProps } from './Shimmer.types';
|
|
2
|
-
export declare const Shimmer: import("@fluentui-react-native/framework").ComposableComponent<ShimmerProps, import("./Shimmer.types.shared").ShimmerSlotProps, import("./Shimmer.types.shared").ShimmerTokens, import("@fluentui-react-native/framework").ObjectBase>;
|
|
3
|
-
//# sourceMappingURL=Shimmer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.d.ts","sourceRoot":"","sources":["../src/Shimmer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,iBAAiB,CAAC;AAIjE,eAAO,MAAM,OAAO,wOAmIlB,CAAC"}
|
package/lib-commonjs/Shimmer.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Shimmer = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
|
|
8
|
-
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
9
|
-
const react_1 = require("react");
|
|
10
|
-
const react_native_1 = require("react-native");
|
|
11
|
-
const framework_1 = require("@fluentui-react-native/framework");
|
|
12
|
-
const assert_never_1 = __importDefault(require("assert-never"));
|
|
13
|
-
const react_native_svg_1 = require("react-native-svg");
|
|
14
|
-
const Shimmer_styling_1 = require("./Shimmer.styling");
|
|
15
|
-
const Shimmer_types_1 = require("./Shimmer.types");
|
|
16
|
-
const useStyling = (0, framework_1.buildUseStyling)(Shimmer_styling_1.stylingSettings);
|
|
17
|
-
exports.Shimmer = (0, framework_1.compose)({
|
|
18
|
-
displayName: Shimmer_types_1.shimmerName,
|
|
19
|
-
...Shimmer_styling_1.stylingSettings,
|
|
20
|
-
slots: {
|
|
21
|
-
root: react_native_svg_1.Svg,
|
|
22
|
-
},
|
|
23
|
-
useRender: (props, useSlots) => {
|
|
24
|
-
const Slots = useSlots(props);
|
|
25
|
-
props = (0, framework_1.mergeProps)(props, Slots.root({}).props);
|
|
26
|
-
const AnimatedLinearGradient = react_native_1.Animated.createAnimatedComponent(react_native_svg_1.LinearGradient);
|
|
27
|
-
const tokens = useStyling(props).root;
|
|
28
|
-
const memoizedShimmerData = (0, react_1.useMemo)(() => ({
|
|
29
|
-
angle: props.angle ? props.angle : tokens['angle'],
|
|
30
|
-
backgroundColor: props?.style?.['backgroundColor'] ? props?.style['backgroundColor'] : (tokens['backgroundColor'] ?? 'transparent'),
|
|
31
|
-
containerBorderRadius: props?.style?.['borderRadius'] ? props?.style['borderRadius'] : 0,
|
|
32
|
-
containerWidth: props?.style?.['width'] ? props?.style['width'] : '100%',
|
|
33
|
-
containerHeight: props?.style?.['height'] ? props?.style['height'] : '100%',
|
|
34
|
-
delay: props.delay ? props.delay : tokens['delay'],
|
|
35
|
-
duration: props.duration ? props.duration : tokens['duration'],
|
|
36
|
-
shimmerColor: props.shimmerColor ? props.shimmerColor : tokens['shimmerColor'],
|
|
37
|
-
shimmerColorOpacity: tokens['shimmerColorOpacity'],
|
|
38
|
-
shimmerWaveColor: props.shimmerWaveColor ? props.shimmerWaveColor : tokens['shimmerWaveColor'],
|
|
39
|
-
shimmerWaveColorOpacity: tokens['shimmerWaveColorOpacity'],
|
|
40
|
-
}), [
|
|
41
|
-
props.angle,
|
|
42
|
-
props.backgroundColor,
|
|
43
|
-
props.delay,
|
|
44
|
-
props.duration,
|
|
45
|
-
props.shimmerColor,
|
|
46
|
-
props.shimmerColorOpacity,
|
|
47
|
-
props.shimmerWaveColor,
|
|
48
|
-
props.shimmerWaveColorOpacity,
|
|
49
|
-
props.style,
|
|
50
|
-
]);
|
|
51
|
-
/* The shimmer animation is implemented using a LinearGradient which travels from left to right.
|
|
52
|
-
* Different angles are handled by rotating this gradient.
|
|
53
|
-
* The startValue is used to control the start position of the gradient animation, it is set as -2 to make sure it is starts off the screen for any angle.
|
|
54
|
-
* Similarly the endValue is set to 3 to make sure the gradient animation exits the entire screen for any angle.
|
|
55
|
-
* In RTL, startValue and endValue are flipped to ensure that the animation moves from right to left.
|
|
56
|
-
*/
|
|
57
|
-
const startValue = react_native_1.I18nManager.isRTL ? 3 : -2;
|
|
58
|
-
const endValue = react_native_1.I18nManager.isRTL ? -2 : 3;
|
|
59
|
-
const x1 = (0, react_1.useRef)(new react_native_1.Animated.Value(startValue)).current;
|
|
60
|
-
const shimmerAnimation = (0, react_1.useCallback)(() => {
|
|
61
|
-
react_native_1.Animated.loop(react_native_1.Animated.timing(x1, {
|
|
62
|
-
toValue: endValue,
|
|
63
|
-
duration: memoizedShimmerData.duration,
|
|
64
|
-
delay: memoizedShimmerData.delay,
|
|
65
|
-
useNativeDriver: true,
|
|
66
|
-
})).start();
|
|
67
|
-
}, [memoizedShimmerData.delay, memoizedShimmerData.duration]);
|
|
68
|
-
(0, react_1.useEffect)(() => {
|
|
69
|
-
shimmerAnimation();
|
|
70
|
-
});
|
|
71
|
-
return (rest) => {
|
|
72
|
-
const { elements, ...mergedProps } = (0, framework_1.mergeProps)(props, rest);
|
|
73
|
-
const rows = [];
|
|
74
|
-
if (elements) {
|
|
75
|
-
for (let i = 0; i < elements.length; i++) {
|
|
76
|
-
const element = elements[i];
|
|
77
|
-
if (element.type == 'rect') {
|
|
78
|
-
rows.push(jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: element.width, height: element.height, x: element.x, y: element.y, rx: element.borderRadiusX, ry: element.borderRadiusY }, i));
|
|
79
|
-
}
|
|
80
|
-
else if (element.type == 'circle') {
|
|
81
|
-
rows.push(jsx_runtime_1.jsx(react_native_svg_1.Circle, { r: element.radius, cx: element.cx, cy: element.cy }, i));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
(0, assert_never_1.default)(element);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Flip the SVG if we are running in RTL
|
|
89
|
-
const rtlTransfrom = react_native_1.I18nManager.isRTL
|
|
90
|
-
? { translateX: memoizedShimmerData.containerWidth, scaleX: -1 }
|
|
91
|
-
: { translateX: undefined, scaleX: undefined };
|
|
92
|
-
return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, children: [
|
|
93
|
-
jsx_runtime_1.jsxs(react_native_svg_1.Defs, { children: [
|
|
94
|
-
jsx_runtime_1.jsxs(AnimatedLinearGradient, { id: "gradient", x1: x1, x2: "-1", gradientTransform: `rotate(${memoizedShimmerData.angle})`, children: [
|
|
95
|
-
jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: "10%", stopColor: memoizedShimmerData.shimmerColor, stopOpacity: memoizedShimmerData.shimmerColorOpacity }), jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: "20%", stopColor: memoizedShimmerData.shimmerWaveColor, stopOpacity: memoizedShimmerData.shimmerWaveColorOpacity }), jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: "30%", stopColor: memoizedShimmerData.shimmerColor, stopOpacity: memoizedShimmerData.shimmerColorOpacity })
|
|
96
|
-
] }), jsx_runtime_1.jsx(react_native_svg_1.ClipPath, { id: "shimmerView", children: rows })
|
|
97
|
-
] }), jsx_runtime_1.jsxs(react_native_svg_1.G, { transformProps: rtlTransfrom, children: [
|
|
98
|
-
jsx_runtime_1.jsx(react_native_svg_1.Rect, { x: "0", y: "0", width: memoizedShimmerData.containerWidth, height: memoizedShimmerData.containerHeight, fill: memoizedShimmerData.backgroundColor, rx: memoizedShimmerData.containerBorderRadius }), jsx_runtime_1.jsx(react_native_svg_1.Rect, { x: "0", y: "0", width: memoizedShimmerData.containerWidth, height: memoizedShimmerData.containerHeight, fill: "url(#gradient)", rx: memoizedShimmerData.containerBorderRadius, clipPath: "url(#shimmerView)" })
|
|
99
|
-
] })
|
|
100
|
-
] }));
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=Shimmer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.js","sourceRoot":"","sources":["../src/Shimmer.tsx"],"names":[],"mappings":";;;;;;;AAAA,6DAA6D;AAC7D,iCAAgE;AAEhE,+CAAqD;AAGrD,gEAAwF;AACxF,gEAAuC;AACvC,uDAA8F;AAE9F,uDAAoD;AAEpD,mDAA8C;AAE9C,MAAM,UAAU,GAAG,IAAA,2BAAe,EAAC,iCAAe,CAAC,CAAC;AACvC,QAAA,OAAO,GAAG,IAAA,mBAAO,EAAc;IAC1C,WAAW,EAAE,2BAAW;IACxB,GAAG,iCAAe;IAClB,KAAK,EAAE;QACL,IAAI,EAAE,sBAAG;KACV;IACD,SAAS,EAAE,CAAC,KAAmB,EAAE,QAA+B,EAAE,EAAE,CAAC;QACnE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,KAAK,GAAG,IAAA,sBAAU,EAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,KAAqB,CAAC,CAAC;QAChE,MAAM,sBAAsB,GAAG,uBAAQ,CAAC,uBAAuB,CAAC,iCAAc,CAAC,CAAC;QAChF,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QACtC,MAAM,mBAAmB,GAAG,IAAA,eAAO,EACjC,GAAG,EAAE,CAAC,CAAC;YACL,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAA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|
1
|
-
import type { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
2
|
-
import type { ShimmerProps, ShimmerSlotProps, ShimmerTokens } from './Shimmer.types';
|
|
3
|
-
export declare const stylingSettings: UseStylingOptions<ShimmerProps, ShimmerSlotProps, ShimmerTokens>;
|
|
4
|
-
//# sourceMappingURL=Shimmer.styling.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.styling.d.ts","sourceRoot":"","sources":["../src/Shimmer.styling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrF,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,CA6B5F,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stylingSettings = void 0;
|
|
4
|
-
const framework_1 = require("@fluentui-react-native/framework");
|
|
5
|
-
const Shimmer_types_1 = require("./Shimmer.types");
|
|
6
|
-
const ShimmerTokens_1 = require("./ShimmerTokens");
|
|
7
|
-
exports.stylingSettings = {
|
|
8
|
-
tokens: [ShimmerTokens_1.defaultShimmerTokens, Shimmer_types_1.shimmerName],
|
|
9
|
-
tokensThatAreAlsoProps: 'all',
|
|
10
|
-
slotProps: {
|
|
11
|
-
root: (0, framework_1.buildProps)((tokens) => ({
|
|
12
|
-
accessibilityRole: 'progressbar',
|
|
13
|
-
accessible: true,
|
|
14
|
-
style: { overflow: 'hidden', backgroundColor: tokens.backgroundColor },
|
|
15
|
-
angle: tokens.angle,
|
|
16
|
-
delay: tokens.delay,
|
|
17
|
-
duration: tokens.duration,
|
|
18
|
-
shimmerColor: tokens.shimmerColor,
|
|
19
|
-
shimmerColorOpacity: tokens.shimmerColorOpacity,
|
|
20
|
-
shimmerWaveColor: tokens.shimmerWaveColor,
|
|
21
|
-
shimmerWaveColorOpacity: tokens.shimmerWaveColorOpacity,
|
|
22
|
-
}), [
|
|
23
|
-
'angle',
|
|
24
|
-
'delay',
|
|
25
|
-
'duration',
|
|
26
|
-
'shimmerColor',
|
|
27
|
-
'shimmerColorOpacity',
|
|
28
|
-
'shimmerWaveColor',
|
|
29
|
-
'shimmerWaveColorOpacity',
|
|
30
|
-
'backgroundColor',
|
|
31
|
-
]),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=Shimmer.styling.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.styling.js","sourceRoot":"","sources":["../src/Shimmer.styling.ts"],"names":[],"mappings":";;;AACA,gEAA8D;AAG9D,mDAA8C;AAC9C,mDAAuD;AAE1C,QAAA,eAAe,GAAqE;IAC/F,MAAM,EAAE,CAAC,oCAAoB,EAAE,2BAAW,CAAC;IAC3C,sBAAsB,EAAE,KAAK;IAC7B,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;YAC1B,iBAAiB,EAAE,aAAa;YAChC,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE;YACtE,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,uBAAuB,EAAE,MAAM,CAAC,uBAAuB;SACxD,CAAC,EACF;YACE,OAAO;YACP,OAAO;YACP,UAAU;YACV,cAAc;YACd,qBAAqB;YACrB,kBAAkB;YAClB,yBAAyB;YACzB,iBAAiB;SAClB,CACF;KACF;CACF,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
2
|
-
import type { ShimmerProps, ShimmerTokens } from './Shimmer.types';
|
|
3
|
-
import type { ShimmerSlotProps } from './Shimmer.types.win32';
|
|
4
|
-
/**
|
|
5
|
-
* tell the styling hook how to build up the tokens
|
|
6
|
-
*/
|
|
7
|
-
export declare const stylingSettings: UseStylingOptions<ShimmerProps, ShimmerSlotProps, ShimmerTokens>;
|
|
8
|
-
//# sourceMappingURL=Shimmer.styling.win32.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.styling.win32.d.ts","sourceRoot":"","sources":["../src/Shimmer.styling.win32.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,CAuC5F,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stylingSettings = void 0;
|
|
4
|
-
const framework_1 = require("@fluentui-react-native/framework");
|
|
5
|
-
const Shimmer_types_1 = require("./Shimmer.types");
|
|
6
|
-
const ShimmerTokens_win32_1 = require("./ShimmerTokens.win32");
|
|
7
|
-
/**
|
|
8
|
-
* tell the styling hook how to build up the tokens
|
|
9
|
-
*/
|
|
10
|
-
exports.stylingSettings = {
|
|
11
|
-
tokens: [ShimmerTokens_win32_1.defaultShimmerTokens, Shimmer_types_1.shimmerName],
|
|
12
|
-
tokensThatAreAlsoProps: 'all',
|
|
13
|
-
slotProps: {
|
|
14
|
-
root: (0, framework_1.buildProps)((tokens) => ({
|
|
15
|
-
accessibilityRole: 'progressbar',
|
|
16
|
-
accessible: true,
|
|
17
|
-
style: { overflow: 'hidden', backgroundColor: tokens.backgroundColor },
|
|
18
|
-
}), ['backgroundColor']),
|
|
19
|
-
shimmerWaveContainer: (0, framework_1.buildProps)((tokens) => ({
|
|
20
|
-
delay: tokens.delay,
|
|
21
|
-
duration: tokens.duration,
|
|
22
|
-
shimmerColor: tokens.shimmerColor,
|
|
23
|
-
}), ['delay', 'duration', 'shimmerColor']),
|
|
24
|
-
shimmerWave: (0, framework_1.buildProps)((tokens) => ({
|
|
25
|
-
angle: tokens.angle,
|
|
26
|
-
shimmerColor: tokens.shimmerColor,
|
|
27
|
-
shimmerWaveColor: tokens.shimmerWaveColor,
|
|
28
|
-
shimmerWaveWidth: tokens.shimmerWaveWidth,
|
|
29
|
-
}), ['angle', 'shimmerColor', 'shimmerWaveColor', 'shimmerWaveWidth']),
|
|
30
|
-
clippingMask: (0, framework_1.buildProps)((tokens) => ({
|
|
31
|
-
backgroundColor: tokens.backgroundColor,
|
|
32
|
-
}), ['backgroundColor']),
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
//# sourceMappingURL=Shimmer.styling.win32.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.styling.win32.js","sourceRoot":"","sources":["../src/Shimmer.styling.win32.ts"],"names":[],"mappings":";;;AACA,gEAA8D;AAG9D,mDAA8C;AAE9C,+DAA6D;AAE7D;;GAEG;AACU,QAAA,eAAe,GAAqE;IAC/F,MAAM,EAAE,CAAC,0CAAoB,EAAE,2BAAW,CAAC;IAC3C,sBAAsB,EAAE,KAAK;IAC7B,SAAS,EAAE;QACT,IAAI,EAAE,IAAA,sBAAU,EACd,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;YAC1B,iBAAiB,EAAE,aAAa;YAChC,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE;SACvE,CAAC,EACF,CAAC,iBAAiB,CAAC,CACpB;QAED,oBAAoB,EAAE,IAAA,sBAAU,EAC9B,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;YAC1B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC,EACF,CAAC,OAAO,EAAE,UAAU,EAAE,cAAc,CAAC,CACtC;QAED,WAAW,EAAE,IAAA,sBAAU,EACrB,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;YAC1B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;SAC1C,CAAC,EACF,CAAC,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAClE;QAED,YAAY,EAAE,IAAA,sBAAU,EACtB,CAAC,MAAqB,EAAE,EAAE,CAAC,CAAC;YAC1B,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC,CAAC,EACF,CAAC,iBAAiB,CAAC,CACpB;KACF;CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.test.d.ts","sourceRoot":"","sources":["../src/Shimmer.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
37
|
-
const react_1 = require("react");
|
|
38
|
-
const renderer = __importStar(require("react-test-renderer"));
|
|
39
|
-
const Shimmer_1 = require("./Shimmer");
|
|
40
|
-
function shimmerRects() {
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
type: 'rect',
|
|
44
|
-
borderRadiusX: 3,
|
|
45
|
-
borderRadiusY: 3,
|
|
46
|
-
width: 100,
|
|
47
|
-
height: 20,
|
|
48
|
-
x: 90,
|
|
49
|
-
y: 70,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: 'rect',
|
|
53
|
-
borderRadiusX: 3,
|
|
54
|
-
borderRadiusY: 3,
|
|
55
|
-
width: 150,
|
|
56
|
-
height: 20,
|
|
57
|
-
x: 90,
|
|
58
|
-
y: 42,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: 'rect',
|
|
62
|
-
borderRadiusX: 3,
|
|
63
|
-
borderRadiusY: 3,
|
|
64
|
-
width: 200,
|
|
65
|
-
height: 20,
|
|
66
|
-
x: 90,
|
|
67
|
-
y: 15,
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
const style = { width: 300, height: 100 };
|
|
72
|
-
// mocks out setTimeout and other timer functions with mock functions, test will fail without this as we're using Animated API
|
|
73
|
-
jest.useFakeTimers();
|
|
74
|
-
describe('Shimmer component tests', () => {
|
|
75
|
-
it('Shimmer default', async () => {
|
|
76
|
-
let component;
|
|
77
|
-
(0, react_1.act)(() => {
|
|
78
|
-
component = renderer.create(jsx_runtime_1.jsx(Shimmer_1.Shimmer, { elements: shimmerRects() }));
|
|
79
|
-
});
|
|
80
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
81
|
-
await (0, react_1.act)(async () => null);
|
|
82
|
-
});
|
|
83
|
-
it('Shimmer with style prop', async () => {
|
|
84
|
-
let component;
|
|
85
|
-
(0, react_1.act)(() => {
|
|
86
|
-
component = renderer.create(jsx_runtime_1.jsx(Shimmer_1.Shimmer, { elements: shimmerRects(), style: style }));
|
|
87
|
-
});
|
|
88
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
89
|
-
await (0, react_1.act)(async () => null);
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
//# sourceMappingURL=Shimmer.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"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C,CAAC,eAAe,EAAE,CAAC;QAC9C,MAAM,IAAA,WAAG,EAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;IAAA,CAC7B,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE,CAAC;QACxC,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,iBAAO,IAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC;QAAA,CAClF,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;QAC9C,MAAM,IAAA,WAAG,EAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;IAAA,CAC7B,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.types.d.ts","sourceRoot":"","sources":["../src/Shimmer.types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shimmerName = void 0;
|
|
4
|
-
const Shimmer_types_shared_1 = require("./Shimmer.types.shared");
|
|
5
|
-
Object.defineProperty(exports, "shimmerName", { enumerable: true, get: function () { return Shimmer_types_shared_1.shimmerName; } });
|
|
6
|
-
//# sourceMappingURL=Shimmer.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Shimmer.types.js","sourceRoot":"","sources":["../src/Shimmer.types.ts"],"names":[],"mappings":";;;AASA,iEAAqD;AAA5C,mHAAA,WAAW,OAAA"}
|