@fluentui-react-native/experimental-shimmer 0.14.0 → 0.14.3

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/lib/Shimmer.d.ts +2 -7
  3. package/lib/Shimmer.d.ts.map +1 -1
  4. package/lib/Shimmer.js +77 -149
  5. package/lib/Shimmer.js.map +1 -1
  6. package/lib/Shimmer.styling.d.ts +1 -1
  7. package/lib/Shimmer.styling.js +26 -29
  8. package/lib/Shimmer.styling.win32.d.ts +1 -1
  9. package/lib/Shimmer.styling.win32.js +24 -36
  10. package/lib/Shimmer.test.d.ts +1 -1
  11. package/lib/Shimmer.test.js +45 -45
  12. package/lib/Shimmer.test.js.map +1 -1
  13. package/lib/Shimmer.types.d.ts +2 -10
  14. package/lib/Shimmer.types.js +1 -1
  15. package/lib/Shimmer.types.shared.d.ts +123 -123
  16. package/lib/Shimmer.types.shared.d.ts.map +1 -1
  17. package/lib/Shimmer.types.shared.js +1 -1
  18. package/lib/Shimmer.types.win32.d.ts +26 -26
  19. package/lib/Shimmer.types.win32.js +1 -1
  20. package/lib/Shimmer.win32.d.ts +2 -7
  21. package/lib/Shimmer.win32.js +107 -137
  22. package/lib/ShimmerTokens.android.d.ts +1 -1
  23. package/lib/ShimmerTokens.android.js +8 -8
  24. package/lib/ShimmerTokens.android.js.map +1 -1
  25. package/lib/ShimmerTokens.d.ts +1 -1
  26. package/lib/ShimmerTokens.ios.d.ts +1 -1
  27. package/lib/ShimmerTokens.ios.js +8 -8
  28. package/lib/ShimmerTokens.ios.js.map +1 -1
  29. package/lib/ShimmerTokens.js +9 -9
  30. package/lib/ShimmerTokens.js.map +1 -1
  31. package/lib/ShimmerTokens.win32.d.ts +1 -1
  32. package/lib/ShimmerTokens.win32.js +10 -10
  33. package/lib/ShimmerTokens.win32.js.map +1 -1
  34. package/lib/SvgShapeToPath.d.ts +1 -1
  35. package/lib/SvgShapeToPath.js +120 -134
  36. package/lib/Win32ShimmerNativeComponent.d.ts +4 -4
  37. package/lib/Win32ShimmerNativeComponent.js +1 -1
  38. package/lib/consts.android.d.ts +1 -1
  39. package/lib/consts.android.js +1 -1
  40. package/lib/consts.d.ts +1 -1
  41. package/lib/consts.ios.d.ts +1 -1
  42. package/lib/consts.ios.js +1 -1
  43. package/lib/consts.js +1 -1
  44. package/lib/consts.win32.d.ts +1 -1
  45. package/lib/consts.win32.js +1 -1
  46. package/lib/index.d.ts +2 -10
  47. package/lib/index.js +1 -1
  48. package/lib-commonjs/Shimmer.d.ts +2 -7
  49. package/lib-commonjs/Shimmer.d.ts.map +1 -1
  50. package/lib-commonjs/Shimmer.js +89 -163
  51. package/lib-commonjs/Shimmer.js.map +1 -1
  52. package/lib-commonjs/Shimmer.styling.d.ts +1 -1
  53. package/lib-commonjs/Shimmer.styling.js +31 -34
  54. package/lib-commonjs/Shimmer.styling.win32.d.ts +1 -1
  55. package/lib-commonjs/Shimmer.styling.win32.js +29 -41
  56. package/lib-commonjs/Shimmer.test.d.ts +1 -1
  57. package/lib-commonjs/Shimmer.test.js +79 -96
  58. package/lib-commonjs/Shimmer.test.js.map +1 -1
  59. package/lib-commonjs/Shimmer.types.d.ts +2 -10
  60. package/lib-commonjs/Shimmer.types.js +5 -10
  61. package/lib-commonjs/Shimmer.types.shared.d.ts +123 -123
  62. package/lib-commonjs/Shimmer.types.shared.d.ts.map +1 -1
  63. package/lib-commonjs/Shimmer.types.shared.js +3 -3
  64. package/lib-commonjs/Shimmer.types.win32.d.ts +26 -26
  65. package/lib-commonjs/Shimmer.types.win32.js +5 -10
  66. package/lib-commonjs/Shimmer.win32.d.ts +2 -7
  67. package/lib-commonjs/Shimmer.win32.js +120 -164
  68. package/lib-commonjs/ShimmerTokens.android.d.ts +1 -1
  69. package/lib-commonjs/ShimmerTokens.android.js +11 -11
  70. package/lib-commonjs/ShimmerTokens.android.js.map +1 -1
  71. package/lib-commonjs/ShimmerTokens.d.ts +1 -1
  72. package/lib-commonjs/ShimmerTokens.ios.d.ts +1 -1
  73. package/lib-commonjs/ShimmerTokens.ios.js +11 -11
  74. package/lib-commonjs/ShimmerTokens.ios.js.map +1 -1
  75. package/lib-commonjs/ShimmerTokens.js +13 -13
  76. package/lib-commonjs/ShimmerTokens.js.map +1 -1
  77. package/lib-commonjs/ShimmerTokens.win32.d.ts +1 -1
  78. package/lib-commonjs/ShimmerTokens.win32.js +13 -13
  79. package/lib-commonjs/ShimmerTokens.win32.js.map +1 -1
  80. package/lib-commonjs/SvgShapeToPath.d.ts +1 -1
  81. package/lib-commonjs/SvgShapeToPath.js +122 -136
  82. package/lib-commonjs/Win32ShimmerNativeComponent.d.ts +4 -4
  83. package/lib-commonjs/Win32ShimmerNativeComponent.js +4 -4
  84. package/lib-commonjs/consts.android.d.ts +1 -1
  85. package/lib-commonjs/consts.android.js +3 -3
  86. package/lib-commonjs/consts.d.ts +1 -1
  87. package/lib-commonjs/consts.ios.d.ts +1 -1
  88. package/lib-commonjs/consts.ios.js +3 -3
  89. package/lib-commonjs/consts.js +3 -3
  90. package/lib-commonjs/consts.win32.d.ts +1 -1
  91. package/lib-commonjs/consts.win32.js +3 -3
  92. package/lib-commonjs/index.d.ts +2 -10
  93. package/lib-commonjs/index.js +11 -36
  94. package/package.json +26 -25
  95. package/src/Shimmer.test.tsx +1 -1
  96. package/src/Shimmer.tsx +4 -14
  97. package/src/Shimmer.types.shared.ts +1 -1
  98. package/src/ShimmerTokens.android.ts +1 -1
  99. package/src/ShimmerTokens.ios.ts +1 -1
  100. package/src/ShimmerTokens.ts +1 -1
  101. package/src/ShimmerTokens.win32.ts +1 -1
  102. package/eslint.config.js +0 -3
@@ -1,179 +1,135 @@
1
- 'use strict';
2
- var __importDefault =
3
- (this && this.__importDefault) ||
4
- function (mod) {
5
- return mod && mod.__esModule ? mod : { default: mod };
6
- };
7
- Object.defineProperty(exports, '__esModule', { value: true });
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 });
8
6
  exports.Shimmer = void 0;
9
- const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
7
+ const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
10
8
  /**
11
9
  * Copyright (c) Microsoft Corporation.
12
10
  * Licensed under the MIT License.
13
11
  * @format
14
12
  */
15
13
  /** @jsxImportSource @fluentui-react-native/framework-base */
16
- const react_native_1 = require('react-native');
17
- const framework_1 = require('@fluentui-react-native/framework');
18
- const assert_never_1 = require('assert-never');
19
- const react_native_svg_1 = require('react-native-svg');
20
- const Shimmer_styling_win32_1 = require('./Shimmer.styling.win32');
21
- const Shimmer_types_shared_1 = require('./Shimmer.types.shared');
22
- const SvgShapeToPath_1 = require('./SvgShapeToPath');
23
- const Win32ShimmerNativeComponent_1 = __importDefault(require('./Win32ShimmerNativeComponent'));
14
+ const react_native_1 = require("react-native");
15
+ const framework_1 = require("@fluentui-react-native/framework");
16
+ const assert_never_1 = require("assert-never");
17
+ const react_native_svg_1 = require("react-native-svg");
18
+ const Shimmer_styling_win32_1 = require("./Shimmer.styling.win32");
19
+ const Shimmer_types_shared_1 = require("./Shimmer.types.shared");
20
+ const SvgShapeToPath_1 = require("./SvgShapeToPath");
21
+ const Win32ShimmerNativeComponent_1 = __importDefault(require("./Win32ShimmerNativeComponent"));
24
22
  const clippingMask = (props) => {
25
- /**
26
- * Absolute positioning is used to overlay the clipping mask on top of the shimmer wave.
27
- *
28
- * preserveAspectRatio = 'xMinYMin slice' asks the SVG to scale the viewBox up to fit the
29
- * viewPort, starting from the origin of the viewPort and minimum coordinates of the viewBox.
30
- * 'slice' removes the unnecessary remainder.
31
- */
32
- const { backgroundColor, viewBoxHeight, viewBoxWidth } = props;
33
- const svgProps = {
34
- style: { position: 'absolute', height: viewBoxHeight, width: viewBoxWidth },
35
- viewBox: '0 0 ' + viewBoxWidth + ' ' + viewBoxHeight,
36
- preserveAspectRatio: 'xMinYMin slice',
37
- };
38
- return jsx_runtime_1.jsxs(react_native_svg_1.Svg, {
39
- ...svgProps,
40
- children: [
41
- jsx_runtime_1.jsx(react_native_svg_1.Defs, {
42
- children: jsx_runtime_1.jsx(react_native_svg_1.ClipPath, {
43
- id: 'shimmerCuts',
44
- children: jsx_runtime_1.jsx(react_native_svg_1.Path, { d: props.clipPath, clipRule: 'evenodd' }),
45
- }),
46
- }),
47
- jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: '100%', height: '100%', fill: backgroundColor, clipPath: 'url(#shimmerCuts)' }),
48
- ],
49
- });
23
+ /**
24
+ * Absolute positioning is used to overlay the clipping mask on top of the shimmer wave.
25
+ *
26
+ * preserveAspectRatio = 'xMinYMin slice' asks the SVG to scale the viewBox up to fit the
27
+ * viewPort, starting from the origin of the viewPort and minimum coordinates of the viewBox.
28
+ * 'slice' removes the unnecessary remainder.
29
+ */
30
+ const { backgroundColor, viewBoxHeight, viewBoxWidth } = props;
31
+ const svgProps = {
32
+ style: { position: 'absolute', height: viewBoxHeight, width: viewBoxWidth },
33
+ viewBox: '0 0 ' + viewBoxWidth + ' ' + viewBoxHeight,
34
+ preserveAspectRatio: 'xMinYMin slice',
35
+ };
36
+ return (jsx_runtime_1.jsxs(react_native_svg_1.Svg, { ...svgProps, children: [
37
+ jsx_runtime_1.jsx(react_native_svg_1.Defs, { children: jsx_runtime_1.jsx(react_native_svg_1.ClipPath, { id: "shimmerCuts", children: jsx_runtime_1.jsx(react_native_svg_1.Path, { d: props.clipPath, clipRule: "evenodd" }) }) }), jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: "100%", height: "100%", fill: backgroundColor, clipPath: "url(#shimmerCuts)" })
38
+ ] }));
50
39
  };
51
40
  const wave = (props) => {
52
- const { shimmerColor, shimmerColorOpacity, shimmerWaveColor, shimmerWaveColorOpacity, viewBoxHeight, viewBoxWidth } = props;
53
- /**
54
- * See the comment above for an explanation of preserveAspectRatio.
55
- */
56
- const svgProps = {
57
- style: { height: viewBoxHeight, width: viewBoxWidth },
58
- viewBox: '0 0 ' + viewBoxWidth + ' ' + viewBoxHeight,
59
- preserveAspectRatio: 'xMinYMin slice',
60
- };
61
- /**
62
- * React-Native-SVG doesn't process opaque color values correctly for gradients, directly invoking `processColor`
63
- * and squashing in the opacity value of the color stop. This handling scheme is incompatible with OpaqueColorValue type
64
- * colors e.g. PlatformColor, and will show nothing. As a short-term solution, provide alternate non-gradient handling
65
- * of the wave color as a solid color.
66
- */
67
- if (
68
- typeof (0, react_native_1.processColor)(shimmerWaveColor) !== 'object' &&
69
- typeof (0, react_native_1.processColor)(shimmerColor) !== 'object'
70
- ) {
71
- // The typical path where the provided shimmer colors are not OpaqueColorValues.
72
- return jsx_runtime_1.jsxs(react_native_svg_1.Svg, {
73
- ...svgProps,
74
- children: [
75
- jsx_runtime_1.jsxs(react_native_svg_1.LinearGradient, {
76
- id: 'gradient',
77
- children: [
78
- jsx_runtime_1.jsx(react_native_svg_1.Stop, { stopColor: shimmerColor, stopOpacity: shimmerColorOpacity }),
79
- jsx_runtime_1.jsx(react_native_svg_1.Stop, {
80
- offset: '20%',
81
- stopColor: shimmerWaveColor,
82
- stopOpacity: shimmerWaveColorOpacity,
83
- }),
84
- jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: '40%', stopColor: shimmerColor, stopOpacity: shimmerColorOpacity }),
85
- ],
86
- }),
87
- jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: props.shimmerWaveWidth, height: '100%', fill: 'url(#gradient)' }),
88
- ],
89
- });
90
- } else {
91
- // The unexpected path where either of the provided shimmer colors are OpaqueColorValues.
92
- // scaleX is used to mimic the gradient occupying 40% of the fill since we don't know the provided width of the
93
- // shimmer wave.
94
- return jsx_runtime_1.jsx(react_native_svg_1.Svg, {
95
- ...svgProps,
96
- children: jsx_runtime_1.jsx(react_native_svg_1.Rect, {
97
- width: props.shimmerWaveWidth,
98
- height: '100%',
99
- fill: shimmerWaveColor,
100
- fillOpacity: shimmerWaveColorOpacity,
101
- scaleX: '0.4',
102
- }),
103
- });
104
- }
41
+ const { shimmerColor, shimmerColorOpacity, shimmerWaveColor, shimmerWaveColorOpacity, viewBoxHeight, viewBoxWidth } = props;
42
+ /**
43
+ * See the comment above for an explanation of preserveAspectRatio.
44
+ */
45
+ const svgProps = {
46
+ style: { height: viewBoxHeight, width: viewBoxWidth },
47
+ viewBox: '0 0 ' + viewBoxWidth + ' ' + viewBoxHeight,
48
+ preserveAspectRatio: 'xMinYMin slice',
49
+ };
50
+ /**
51
+ * React-Native-SVG doesn't process opaque color values correctly for gradients, directly invoking `processColor`
52
+ * and squashing in the opacity value of the color stop. This handling scheme is incompatible with OpaqueColorValue type
53
+ * colors e.g. PlatformColor, and will show nothing. As a short-term solution, provide alternate non-gradient handling
54
+ * of the wave color as a solid color.
55
+ */
56
+ if (typeof (0, react_native_1.processColor)(shimmerWaveColor) !== 'object' && typeof (0, react_native_1.processColor)(shimmerColor) !== 'object') {
57
+ // The typical path where the provided shimmer colors are not OpaqueColorValues.
58
+ return (jsx_runtime_1.jsxs(react_native_svg_1.Svg, { ...svgProps, children: [
59
+ jsx_runtime_1.jsxs(react_native_svg_1.LinearGradient, { id: "gradient", children: [
60
+ jsx_runtime_1.jsx(react_native_svg_1.Stop, { stopColor: shimmerColor, stopOpacity: shimmerColorOpacity }), jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: "20%", stopColor: shimmerWaveColor, stopOpacity: shimmerWaveColorOpacity }), jsx_runtime_1.jsx(react_native_svg_1.Stop, { offset: "40%", stopColor: shimmerColor, stopOpacity: shimmerColorOpacity })
61
+ ] }), jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: props.shimmerWaveWidth, height: "100%", fill: "url(#gradient)" })
62
+ ] }));
63
+ }
64
+ else {
65
+ // The unexpected path where either of the provided shimmer colors are OpaqueColorValues.
66
+ // scaleX is used to mimic the gradient occupying 40% of the fill since we don't know the provided width of the
67
+ // shimmer wave.
68
+ return (jsx_runtime_1.jsx(react_native_svg_1.Svg, { ...svgProps, children: jsx_runtime_1.jsx(react_native_svg_1.Rect, { width: props.shimmerWaveWidth, height: "100%", fill: shimmerWaveColor, fillOpacity: shimmerWaveColorOpacity, scaleX: "0.4" }) }));
69
+ }
105
70
  };
106
71
  const waveContainer = (props) => {
107
- const { shimmerColor, viewBoxHeight, viewBoxWidth } = props;
108
- return jsx_runtime_1.jsx(Win32ShimmerNativeComponent_1.default, {
109
- ...props,
110
- style: { backgroundColor: shimmerColor, height: viewBoxHeight, width: viewBoxWidth, overflow: 'hidden' },
111
- });
72
+ const { shimmerColor, viewBoxHeight, viewBoxWidth } = props;
73
+ return (jsx_runtime_1.jsx(Win32ShimmerNativeComponent_1.default, { ...props, style: { backgroundColor: shimmerColor, height: viewBoxHeight, width: viewBoxWidth, overflow: 'hidden' } }));
112
74
  };
113
75
  exports.Shimmer = (0, framework_1.compose)({
114
- displayName: Shimmer_types_shared_1.shimmerName,
115
- ...Shimmer_styling_win32_1.stylingSettings,
116
- slots: {
117
- root: react_native_1.View,
118
- clippingMask: clippingMask,
119
- shimmerWave: wave,
120
- shimmerWaveContainer: waveContainer,
121
- },
122
- useRender: (props, useSlots) => {
123
- const Slots = useSlots(props);
124
- return (rest) => {
125
- const { elements, ...mergedProps } = (0, framework_1.mergeProps)(props, rest);
126
- /**
127
- * Generate a clip path from the provided element shapes, with their path parameter strings generated from their corresponding properties.
128
- * Ideally this would be better possible with functions from the shape elements themselves and not to rely on our own calculations.
129
- *
130
- * One nuanced consideration is scaling the SVG with DPI. Without specifying a viewBox, points are considered to be pixels on an SVG canvas.
131
- * When the native control is scaled the SVG canvas will scale up -- but pixel coordinates will not, changing the visual for different pixel densities.
132
- * By providing a viewBox appropriate for our SVG the viewBox containing the graphics will be scaled up to fit the viewPort.
133
- * Since we're programmatically generating the visual, we can assert our viewBox is `0 0 xMax yMax` where xMax and yMax are the greatest
134
- * X and Y points used by a shape.
135
- */
136
- let clipPathsAsMask = [];
137
- let xMax = 0;
138
- let yMax = 0;
139
- if (elements) {
140
- elements.forEach((element) => {
141
- if (element.type == 'circle') {
142
- clipPathsAsMask = clipPathsAsMask.concat((0, SvgShapeToPath_1.convertCircleToSvgPath)(element));
143
- const xMaxCandidate = element.cx + element.radius;
144
- const yMaxCandidate = element.cy + element.radius;
145
- xMax = xMax >= xMaxCandidate ? xMax : xMaxCandidate;
146
- yMax = yMax >= yMaxCandidate ? yMax : yMaxCandidate;
147
- } else if (element.type == 'rect') {
148
- clipPathsAsMask = clipPathsAsMask.concat((0, SvgShapeToPath_1.convertRectToSvgPath)(element));
149
- const xMaxCandidate = element.x + element.width;
150
- const yMaxCandidate = element.y + element.height;
151
- xMax = xMax >= xMaxCandidate ? xMax : xMaxCandidate;
152
- yMax = yMax >= yMaxCandidate ? yMax : yMaxCandidate;
153
- } else {
154
- (0, assert_never_1.assertNever)(element);
155
- }
156
- });
157
- }
158
- /**
159
- * Win32 D2D1 doesn't directly support SVG mask elements, so we're going to generate a mask
160
- * by manipulating our clip path for the same effect. We do so utilizing the clip-rule='evenodd'
161
- * and drawing a rectangle around the entire svg viewBox, causing all inner elements to be "clipped out"
162
- * instead of "clipped around," generating the visual we desire with the linear gradient below the mask.
163
- */
164
- const mergedClipPath = clipPathsAsMask.join(' ').concat('M 0 0 h ' + xMax + ' v ' + yMax + ' h -' + xMax + ' z ');
165
- return jsx_runtime_1.jsxs(Slots.root, {
166
- ...mergedProps,
167
- children: [
168
- jsx_runtime_1.jsx(Slots.shimmerWaveContainer, {
169
- viewBoxHeight: yMax,
170
- viewBoxWidth: xMax,
171
- children: jsx_runtime_1.jsx(Slots.shimmerWave, { viewBoxHeight: yMax, viewBoxWidth: xMax }),
172
- }),
173
- jsx_runtime_1.jsx(Slots.clippingMask, { clipPath: mergedClipPath, viewBoxHeight: yMax, viewBoxWidth: xMax }),
174
- ],
175
- });
176
- };
177
- },
76
+ displayName: Shimmer_types_shared_1.shimmerName,
77
+ ...Shimmer_styling_win32_1.stylingSettings,
78
+ slots: {
79
+ root: react_native_1.View,
80
+ clippingMask: clippingMask,
81
+ shimmerWave: wave,
82
+ shimmerWaveContainer: waveContainer,
83
+ },
84
+ useRender: (props, useSlots) => {
85
+ const Slots = useSlots(props);
86
+ return (rest) => {
87
+ const { elements, ...mergedProps } = (0, framework_1.mergeProps)(props, rest);
88
+ /**
89
+ * Generate a clip path from the provided element shapes, with their path parameter strings generated from their corresponding properties.
90
+ * Ideally this would be better possible with functions from the shape elements themselves and not to rely on our own calculations.
91
+ *
92
+ * One nuanced consideration is scaling the SVG with DPI. Without specifying a viewBox, points are considered to be pixels on an SVG canvas.
93
+ * When the native control is scaled the SVG canvas will scale up -- but pixel coordinates will not, changing the visual for different pixel densities.
94
+ * By providing a viewBox appropriate for our SVG the viewBox containing the graphics will be scaled up to fit the viewPort.
95
+ * Since we're programmatically generating the visual, we can assert our viewBox is `0 0 xMax yMax` where xMax and yMax are the greatest
96
+ * X and Y points used by a shape.
97
+ */
98
+ let clipPathsAsMask = [];
99
+ let xMax = 0;
100
+ let yMax = 0;
101
+ if (elements) {
102
+ elements.forEach((element) => {
103
+ if (element.type == 'circle') {
104
+ clipPathsAsMask = clipPathsAsMask.concat((0, SvgShapeToPath_1.convertCircleToSvgPath)(element));
105
+ const xMaxCandidate = element.cx + element.radius;
106
+ const yMaxCandidate = element.cy + element.radius;
107
+ xMax = xMax >= xMaxCandidate ? xMax : xMaxCandidate;
108
+ yMax = yMax >= yMaxCandidate ? yMax : yMaxCandidate;
109
+ }
110
+ else if (element.type == 'rect') {
111
+ clipPathsAsMask = clipPathsAsMask.concat((0, SvgShapeToPath_1.convertRectToSvgPath)(element));
112
+ const xMaxCandidate = element.x + element.width;
113
+ const yMaxCandidate = element.y + element.height;
114
+ xMax = xMax >= xMaxCandidate ? xMax : xMaxCandidate;
115
+ yMax = yMax >= yMaxCandidate ? yMax : yMaxCandidate;
116
+ }
117
+ else {
118
+ (0, assert_never_1.assertNever)(element);
119
+ }
120
+ });
121
+ }
122
+ /**
123
+ * Win32 D2D1 doesn't directly support SVG mask elements, so we're going to generate a mask
124
+ * by manipulating our clip path for the same effect. We do so utilizing the clip-rule='evenodd'
125
+ * and drawing a rectangle around the entire svg viewBox, causing all inner elements to be "clipped out"
126
+ * instead of "clipped around," generating the visual we desire with the linear gradient below the mask.
127
+ */
128
+ const mergedClipPath = clipPathsAsMask.join(' ').concat('M 0 0 h ' + xMax + ' v ' + yMax + ' h -' + xMax + ' z ');
129
+ return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, children: [
130
+ jsx_runtime_1.jsx(Slots.shimmerWaveContainer, { viewBoxHeight: yMax, viewBoxWidth: xMax, children: jsx_runtime_1.jsx(Slots.shimmerWave, { viewBoxHeight: yMax, viewBoxWidth: xMax }) }), jsx_runtime_1.jsx(Slots.clippingMask, { clipPath: mergedClipPath, viewBoxHeight: yMax, viewBoxWidth: xMax })
131
+ ] }));
132
+ };
133
+ },
178
134
  });
179
- //# sourceMappingURL=Shimmer.win32.js.map
135
+ //# sourceMappingURL=Shimmer.win32.js.map
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
2
2
  import type { TokenSettings } from '@fluentui-react-native/use-styling';
3
3
  import type { ShimmerTokens } from './Shimmer.types';
4
4
  export declare const defaultShimmerTokens: TokenSettings<ShimmerTokens, Theme>;
5
- //# sourceMappingURL=ShimmerTokens.android.d.ts.map
5
+ //# sourceMappingURL=ShimmerTokens.android.d.ts.map
@@ -1,15 +1,15 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultShimmerTokens = void 0;
4
- const consts_1 = require('./consts');
4
+ const consts_1 = require("./consts");
5
5
  const defaultShimmerTokens = (theme) => ({
6
- angle: consts_1.shimmerDefaultAngle,
7
- delay: consts_1.shimmerDefaultDelay,
8
- duration: consts_1.shimmerDefaultDuration,
9
- shimmerColor: theme.colors.neutralStencil1,
10
- shimmerColorOpacity: 1,
11
- shimmerWaveColor: theme.colors.neutralStencil2,
12
- shimmerWaveColorOpacity: 1,
6
+ angle: consts_1.shimmerDefaultAngle,
7
+ delay: consts_1.shimmerDefaultDelay,
8
+ duration: consts_1.shimmerDefaultDuration,
9
+ shimmerColor: theme.colors.neutralStencil1,
10
+ shimmerColorOpacity: 1,
11
+ shimmerWaveColor: theme.colors.neutralStencil2,
12
+ shimmerWaveColorOpacity: 1,
13
13
  });
14
14
  exports.defaultShimmerTokens = defaultShimmerTokens;
15
- //# sourceMappingURL=ShimmerTokens.android.js.map
15
+ //# sourceMappingURL=ShimmerTokens.android.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShimmerTokens.android.js","sourceRoot":"","sources":["../src/ShimmerTokens.android.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,EACvF;IACC,KAAK,EAAE,4BAAmB;IAC1B,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC1C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC9C,uBAAuB,EAAE,CAAC;CACT,CAAA,CAAC;AATT,QAAA,oBAAoB,GAApB,oBAAoB,CASX"}
1
+ {"version":3,"file":"ShimmerTokens.android.js","sourceRoot":"","sources":["../src/ShimmerTokens.android.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,CACxF,CAAC;IACC,KAAK,EAAE,4BAAmB;IAC1B,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC1C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC9C,uBAAuB,EAAE,CAAC;CAC3B,CAAkB,CAAC;AATT,QAAA,oBAAoB,GAApB,oBAAoB,CASX"}
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
2
2
  import type { TokenSettings } from '@fluentui-react-native/use-styling';
3
3
  import type { ShimmerTokens } from './Shimmer.types';
4
4
  export declare const defaultShimmerTokens: TokenSettings<ShimmerTokens, Theme>;
5
- //# sourceMappingURL=ShimmerTokens.d.ts.map
5
+ //# sourceMappingURL=ShimmerTokens.d.ts.map
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
2
2
  import type { TokenSettings } from '@fluentui-react-native/use-styling';
3
3
  import type { ShimmerTokens } from './Shimmer.types';
4
4
  export declare const defaultShimmerTokens: TokenSettings<ShimmerTokens, Theme>;
5
- //# sourceMappingURL=ShimmerTokens.ios.d.ts.map
5
+ //# sourceMappingURL=ShimmerTokens.ios.d.ts.map
@@ -1,15 +1,15 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultShimmerTokens = void 0;
4
- const consts_1 = require('./consts');
4
+ const consts_1 = require("./consts");
5
5
  const defaultShimmerTokens = (theme) => ({
6
- angle: consts_1.shimmerDefaultAngle,
7
- delay: consts_1.shimmerDefaultDelay,
8
- duration: consts_1.shimmerDefaultDuration,
9
- shimmerColor: theme.colors.neutralStencil1,
10
- shimmerColorOpacity: 1,
11
- shimmerWaveColor: theme.colors.neutralStencil2,
12
- shimmerWaveColorOpacity: 1,
6
+ angle: consts_1.shimmerDefaultAngle,
7
+ delay: consts_1.shimmerDefaultDelay,
8
+ duration: consts_1.shimmerDefaultDuration,
9
+ shimmerColor: theme.colors.neutralStencil1,
10
+ shimmerColorOpacity: 1,
11
+ shimmerWaveColor: theme.colors.neutralStencil2,
12
+ shimmerWaveColorOpacity: 1,
13
13
  });
14
14
  exports.defaultShimmerTokens = defaultShimmerTokens;
15
- //# sourceMappingURL=ShimmerTokens.ios.js.map
15
+ //# sourceMappingURL=ShimmerTokens.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShimmerTokens.ios.js","sourceRoot":"","sources":["../src/ShimmerTokens.ios.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,EACvF;IACC,KAAK,EAAE,4BAAmB;IAC1B,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC1C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC9C,uBAAuB,EAAE,CAAC;CACT,CAAA,CAAC;AATT,QAAA,oBAAoB,GAApB,oBAAoB,CASX"}
1
+ {"version":3,"file":"ShimmerTokens.ios.js","sourceRoot":"","sources":["../src/ShimmerTokens.ios.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,CACxF,CAAC;IACC,KAAK,EAAE,4BAAmB;IAC1B,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC1C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe;IAC9C,uBAAuB,EAAE,CAAC;CAC3B,CAAkB,CAAC;AATT,QAAA,oBAAoB,GAApB,oBAAoB,CASX"}
@@ -1,17 +1,17 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultShimmerTokens = void 0;
4
- const theming_utils_1 = require('@fluentui-react-native/theming-utils');
5
- const consts_1 = require('./consts');
4
+ const theming_utils_1 = require("@fluentui-react-native/theming-utils");
5
+ const consts_1 = require("./consts");
6
6
  const defaultShimmerTokens = (theme) => ({
7
- angle: consts_1.shimmerDefaultAngle,
8
- backgroundColor: theme.colors.transparentBackground,
9
- delay: consts_1.shimmerDefaultDelay,
10
- duration: consts_1.shimmerDefaultDuration,
11
- shimmerColor: (0, theming_utils_1.getCurrentAppearance)(theme.host.appearance, 'light') === 'light' ? '#E1E1E1' : '#404040',
12
- shimmerColorOpacity: 1,
13
- shimmerWaveColor: (0, theming_utils_1.getCurrentAppearance)(theme.host.appearance, 'light') === 'light' ? 'white' : 'black',
14
- shimmerWaveColorOpacity: 1,
7
+ angle: consts_1.shimmerDefaultAngle,
8
+ backgroundColor: theme.colors.transparentBackground,
9
+ delay: consts_1.shimmerDefaultDelay,
10
+ duration: consts_1.shimmerDefaultDuration,
11
+ shimmerColor: (0, theming_utils_1.getCurrentAppearance)(theme.host.appearance, 'light') === 'light' ? '#E1E1E1' : '#404040',
12
+ shimmerColorOpacity: 1,
13
+ shimmerWaveColor: (0, theming_utils_1.getCurrentAppearance)(theme.host.appearance, 'light') === 'light' ? 'white' : 'black',
14
+ shimmerWaveColorOpacity: 1,
15
15
  });
16
16
  exports.defaultShimmerTokens = defaultShimmerTokens;
17
- //# sourceMappingURL=ShimmerTokens.js.map
17
+ //# sourceMappingURL=ShimmerTokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShimmerTokens.js","sourceRoot":"","sources":["../src/ShimmerTokens.ts"],"names":[],"mappings":";;;AACA,wEAA4E;AAG5E,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,EACvF;IACC,KAAK,EAAE,4BAAmB;IAC1B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,qBAAqB;IACnD,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,IAAA,oCAAoB,EAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;IACtG,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,IAAA,oCAAoB,EAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;IACtG,uBAAuB,EAAE,CAAC;CACT,CAAA,CAAC;AAVT,QAAA,oBAAoB,GAApB,oBAAoB,CAUX"}
1
+ {"version":3,"file":"ShimmerTokens.js","sourceRoot":"","sources":["../src/ShimmerTokens.ts"],"names":[],"mappings":";;;AACA,wEAA4E;AAG5E,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,CACxF,CAAC;IACC,KAAK,EAAE,4BAAmB;IAC1B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,qBAAqB;IACnD,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,IAAA,oCAAoB,EAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;IACtG,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,IAAA,oCAAoB,EAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;IACtG,uBAAuB,EAAE,CAAC;CAC3B,CAAkB,CAAC;AAVT,QAAA,oBAAoB,GAApB,oBAAoB,CAUX"}
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
2
2
  import type { TokenSettings } from '@fluentui-react-native/use-styling';
3
3
  import type { ShimmerTokens } from './Shimmer.types';
4
4
  export declare const defaultShimmerTokens: TokenSettings<ShimmerTokens, Theme>;
5
- //# sourceMappingURL=ShimmerTokens.win32.d.ts.map
5
+ //# sourceMappingURL=ShimmerTokens.win32.d.ts.map
@@ -1,17 +1,17 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultShimmerTokens = void 0;
4
- const consts_1 = require('./consts');
4
+ const consts_1 = require("./consts");
5
5
  const defaultShimmerTokens = (theme) => ({
6
- angle: consts_1.shimmerDefaultAngle,
7
- backgroundColor: theme.colors.background,
8
- delay: consts_1.shimmerDefaultDelay,
9
- duration: consts_1.shimmerDefaultDuration,
10
- shimmerColor: theme.colors.bodyFrameDivider,
11
- shimmerColorOpacity: 1,
12
- shimmerWaveColor: '#E1E1E1',
13
- shimmerWaveColorOpacity: 1,
14
- shimmerWaveWidth: '100%',
6
+ angle: consts_1.shimmerDefaultAngle,
7
+ backgroundColor: theme.colors.background,
8
+ delay: consts_1.shimmerDefaultDelay,
9
+ duration: consts_1.shimmerDefaultDuration,
10
+ shimmerColor: theme.colors.bodyFrameDivider,
11
+ shimmerColorOpacity: 1,
12
+ shimmerWaveColor: '#E1E1E1',
13
+ shimmerWaveColorOpacity: 1,
14
+ shimmerWaveWidth: '100%',
15
15
  });
16
16
  exports.defaultShimmerTokens = defaultShimmerTokens;
17
- //# sourceMappingURL=ShimmerTokens.win32.js.map
17
+ //# sourceMappingURL=ShimmerTokens.win32.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShimmerTokens.win32.js","sourceRoot":"","sources":["../src/ShimmerTokens.win32.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,EACvF;IACC,KAAK,EAAE,4BAAmB;IAC1B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;IACxC,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;IAC3C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,SAAS;IAC3B,uBAAuB,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM;CACP,CAAA,CAAC;AAXT,QAAA,oBAAoB,GAApB,oBAAoB,CAWX"}
1
+ {"version":3,"file":"ShimmerTokens.win32.js","sourceRoot":"","sources":["../src/ShimmerTokens.win32.ts"],"names":[],"mappings":";;;AAGA,qCAA4F;AAGrF,MAAM,oBAAoB,GAAwC,CAAC,KAAY,EAAE,EAAE,CACxF,CAAC;IACC,KAAK,EAAE,4BAAmB;IAC1B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;IACxC,KAAK,EAAE,4BAAmB;IAC1B,QAAQ,EAAE,+BAAsB;IAChC,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;IAC3C,mBAAmB,EAAE,CAAC;IACtB,gBAAgB,EAAE,SAAS;IAC3B,uBAAuB,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM;CACzB,CAAkB,CAAC;AAXT,QAAA,oBAAoB,GAApB,oBAAoB,CAWX"}
@@ -15,4 +15,4 @@
15
15
  import type { ShimmerCircleElement, ShimmerRectElement } from './Shimmer.types';
16
16
  export declare function convertRectToSvgPath(rectShape: ShimmerRectElement): string;
17
17
  export declare function convertCircleToSvgPath(circleShape: ShimmerCircleElement): string;
18
- //# sourceMappingURL=SvgShapeToPath.d.ts.map
18
+ //# sourceMappingURL=SvgShapeToPath.d.ts.map