@fluentui-react-native/experimental-avatar 0.13.0 → 0.13.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.
Files changed (117) hide show
  1. package/CHANGELOG.json +106 -1
  2. package/CHANGELOG.md +39 -2
  3. package/lib/Avatar.d.ts +69 -2
  4. package/lib/Avatar.d.ts.map +1 -1
  5. package/lib/Avatar.js +32 -38
  6. package/lib/Avatar.js.map +1 -1
  7. package/lib/JSAvatar.d.ts +12 -0
  8. package/lib/JSAvatar.d.ts.map +1 -0
  9. package/lib/{Avatar.helpers.d.ts → JSAvatar.helpers.d.ts} +3 -3
  10. package/lib/JSAvatar.helpers.d.ts.map +1 -0
  11. package/lib/{Avatar.helpers.js → JSAvatar.helpers.js} +1 -1
  12. package/lib/JSAvatar.helpers.js.map +1 -0
  13. package/lib/JSAvatar.js +62 -0
  14. package/lib/JSAvatar.js.map +1 -0
  15. package/lib/JSAvatar.styling.d.ts +5 -0
  16. package/lib/JSAvatar.styling.d.ts.map +1 -0
  17. package/lib/{Avatar.styling.js → JSAvatar.styling.js} +35 -43
  18. package/lib/JSAvatar.styling.js.map +1 -0
  19. package/{lib-commonjs/Avatar.types.d.ts → lib/JSAvatar.types.d.ts} +20 -12
  20. package/lib/JSAvatar.types.d.ts.map +1 -0
  21. package/lib/JSAvatar.types.js +2 -0
  22. package/lib/JSAvatar.types.js.map +1 -0
  23. package/lib/JSAvatarTokens.d.ts +5 -0
  24. package/lib/JSAvatarTokens.d.ts.map +1 -0
  25. package/lib/JSAvatarTokens.js +18 -0
  26. package/lib/JSAvatarTokens.js.map +1 -0
  27. package/lib/index.d.ts +2 -1
  28. package/lib/index.d.ts.map +1 -1
  29. package/lib/index.js +2 -1
  30. package/lib/index.js.map +1 -1
  31. package/lib/useAvatar.d.ts +2 -2
  32. package/lib/useAvatar.d.ts.map +1 -1
  33. package/lib/useAvatar.js +3 -3
  34. package/lib/useAvatar.js.map +1 -1
  35. package/lib-commonjs/Avatar.d.ts +69 -2
  36. package/lib-commonjs/Avatar.d.ts.map +1 -1
  37. package/lib-commonjs/Avatar.js +31 -37
  38. package/lib-commonjs/Avatar.js.map +1 -1
  39. package/lib-commonjs/JSAvatar.d.ts +12 -0
  40. package/lib-commonjs/JSAvatar.d.ts.map +1 -0
  41. package/lib-commonjs/{Avatar.helpers.d.ts → JSAvatar.helpers.d.ts} +3 -3
  42. package/lib-commonjs/JSAvatar.helpers.d.ts.map +1 -0
  43. package/lib-commonjs/{Avatar.helpers.js → JSAvatar.helpers.js} +1 -1
  44. package/lib-commonjs/JSAvatar.helpers.js.map +1 -0
  45. package/lib-commonjs/JSAvatar.js +64 -0
  46. package/lib-commonjs/JSAvatar.js.map +1 -0
  47. package/lib-commonjs/JSAvatar.styling.d.ts +5 -0
  48. package/lib-commonjs/JSAvatar.styling.d.ts.map +1 -0
  49. package/lib-commonjs/JSAvatar.styling.js +125 -0
  50. package/lib-commonjs/JSAvatar.styling.js.map +1 -0
  51. package/{lib/Avatar.types.d.ts → lib-commonjs/JSAvatar.types.d.ts} +20 -12
  52. package/lib-commonjs/JSAvatar.types.d.ts.map +1 -0
  53. package/lib-commonjs/{Avatar.types.js → JSAvatar.types.js} +2 -2
  54. package/lib-commonjs/JSAvatar.types.js.map +1 -0
  55. package/lib-commonjs/JSAvatarTokens.d.ts +5 -0
  56. package/lib-commonjs/JSAvatarTokens.d.ts.map +1 -0
  57. package/lib-commonjs/JSAvatarTokens.js +20 -0
  58. package/lib-commonjs/JSAvatarTokens.js.map +1 -0
  59. package/lib-commonjs/index.d.ts +2 -1
  60. package/lib-commonjs/index.d.ts.map +1 -1
  61. package/lib-commonjs/index.js +2 -1
  62. package/lib-commonjs/index.js.map +1 -1
  63. package/lib-commonjs/useAvatar.d.ts +2 -2
  64. package/lib-commonjs/useAvatar.d.ts.map +1 -1
  65. package/lib-commonjs/useAvatar.js +4 -4
  66. package/lib-commonjs/useAvatar.js.map +1 -1
  67. package/package.json +5 -5
  68. package/src/Avatar.tsx +127 -37
  69. package/src/{Avatar.helpers.ts → JSAvatar.helpers.ts} +2 -2
  70. package/src/{Avatar.styling.ts → JSAvatar.styling.ts} +24 -20
  71. package/src/JSAvatar.tsx +56 -0
  72. package/src/{Avatar.types.ts → JSAvatar.types.ts} +20 -11
  73. package/src/{AvatarTokens.ts → JSAvatarTokens.ts} +11 -4
  74. package/src/index.ts +2 -1
  75. package/src/useAvatar.ts +6 -5
  76. package/lib/Avatar.helpers.d.ts.map +0 -1
  77. package/lib/Avatar.helpers.js.map +0 -1
  78. package/lib/Avatar.ios.d.ts +0 -70
  79. package/lib/Avatar.ios.d.ts.map +0 -1
  80. package/lib/Avatar.ios.js +0 -45
  81. package/lib/Avatar.ios.js.map +0 -1
  82. package/lib/Avatar.macos.d.ts +0 -70
  83. package/lib/Avatar.macos.d.ts.map +0 -1
  84. package/lib/Avatar.macos.js +0 -45
  85. package/lib/Avatar.macos.js.map +0 -1
  86. package/lib/Avatar.styling.d.ts +0 -4
  87. package/lib/Avatar.styling.d.ts.map +0 -1
  88. package/lib/Avatar.styling.js.map +0 -1
  89. package/lib/Avatar.types.d.ts.map +0 -1
  90. package/lib/Avatar.types.js +0 -2
  91. package/lib/Avatar.types.js.map +0 -1
  92. package/lib/AvatarTokens.d.ts +0 -5
  93. package/lib/AvatarTokens.d.ts.map +0 -1
  94. package/lib/AvatarTokens.js +0 -11
  95. package/lib/AvatarTokens.js.map +0 -1
  96. package/lib-commonjs/Avatar.helpers.d.ts.map +0 -1
  97. package/lib-commonjs/Avatar.helpers.js.map +0 -1
  98. package/lib-commonjs/Avatar.ios.d.ts +0 -70
  99. package/lib-commonjs/Avatar.ios.d.ts.map +0 -1
  100. package/lib-commonjs/Avatar.ios.js +0 -47
  101. package/lib-commonjs/Avatar.ios.js.map +0 -1
  102. package/lib-commonjs/Avatar.macos.d.ts +0 -70
  103. package/lib-commonjs/Avatar.macos.d.ts.map +0 -1
  104. package/lib-commonjs/Avatar.macos.js +0 -47
  105. package/lib-commonjs/Avatar.macos.js.map +0 -1
  106. package/lib-commonjs/Avatar.styling.d.ts +0 -4
  107. package/lib-commonjs/Avatar.styling.d.ts.map +0 -1
  108. package/lib-commonjs/Avatar.styling.js +0 -133
  109. package/lib-commonjs/Avatar.styling.js.map +0 -1
  110. package/lib-commonjs/Avatar.types.d.ts.map +0 -1
  111. package/lib-commonjs/Avatar.types.js.map +0 -1
  112. package/lib-commonjs/AvatarTokens.d.ts +0 -5
  113. package/lib-commonjs/AvatarTokens.d.ts.map +0 -1
  114. package/lib-commonjs/AvatarTokens.js +0 -13
  115. package/lib-commonjs/AvatarTokens.js.map +0 -1
  116. package/src/Avatar.ios.tsx +0 -134
  117. package/src/Avatar.macos.tsx +0 -134
package/CHANGELOG.json CHANGED
@@ -2,7 +2,112 @@
2
2
  "name": "@fluentui-react-native/experimental-avatar",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 17 Nov 2021 19:23:57 GMT",
5
+ "date": "Fri, 17 Dec 2021 19:51:04 GMT",
6
+ "tag": "@fluentui-react-native/experimental-avatar_v0.13.4",
7
+ "version": "0.13.4",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "beachball",
12
+ "package": "@fluentui-react-native/experimental-avatar",
13
+ "comment": "Bump @fluentui-react-native/framework to v0.7.3",
14
+ "commit": "3012e075ca89e36931357442679b73d20540af8b"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Fri, 17 Dec 2021 01:26:42 GMT",
21
+ "tag": "@fluentui-react-native/experimental-avatar_v0.13.3",
22
+ "version": "0.13.3",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "beachball",
27
+ "package": "@fluentui-react-native/experimental-avatar",
28
+ "comment": "Bump @fluentui-react-native/framework to v0.7.2",
29
+ "commit": "511aeb31982a5fb9dd2f7196c0c7217cc4a3dbc6"
30
+ },
31
+ {
32
+ "author": "beachball",
33
+ "package": "@fluentui-react-native/experimental-avatar",
34
+ "comment": "Bump @fluentui-react-native/theme-tokens to v0.11.1",
35
+ "commit": "511aeb31982a5fb9dd2f7196c0c7217cc4a3dbc6"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "date": "Thu, 16 Dec 2021 23:00:56 GMT",
42
+ "tag": "@fluentui-react-native/experimental-avatar_v0.13.2",
43
+ "version": "0.13.2",
44
+ "comments": {
45
+ "none": [
46
+ {
47
+ "author": "dannyvv@microsoft.com",
48
+ "package": "@fluentui-react-native/experimental-avatar",
49
+ "commit": "25b3989739737bc598a5d699a941af4c0b4a421f",
50
+ "comment": "📦 applying package updates ***NO_CI***"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Thu, 16 Dec 2021 19:10:29 GMT",
57
+ "tag": "@fluentui-react-native/experimental-avatar_v0.13.2",
58
+ "version": "0.13.2",
59
+ "comments": {
60
+ "patch": [
61
+ {
62
+ "author": "v.kozlova13@gmail.com",
63
+ "package": "@fluentui-react-native/experimental-avatar",
64
+ "commit": "ea7b9238079f53af55ce3c37458b925bb3dfa922",
65
+ "comment": "Added shape prop to Avatar"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui-react-native/experimental-avatar",
70
+ "comment": "Bump @fluentui-react-native/adapters to v0.8.1",
71
+ "commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui-react-native/experimental-avatar",
76
+ "comment": "Bump @fluentui-react-native/framework to v0.7.1",
77
+ "commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui-react-native/experimental-avatar",
82
+ "comment": "Bump @fluentui-react-native/theme-tokens to v0.11.0",
83
+ "commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
84
+ },
85
+ {
86
+ "author": "beachball",
87
+ "package": "@fluentui-react-native/experimental-avatar",
88
+ "comment": "Bump @fluentui-react-native/tokens to v0.11.1",
89
+ "commit": "6a9f067ae2510481b6ff3512c10c08e7de84f86e"
90
+ }
91
+ ]
92
+ }
93
+ },
94
+ {
95
+ "date": "Wed, 17 Nov 2021 21:07:06 GMT",
96
+ "tag": "@fluentui-react-native/experimental-avatar_v0.13.1",
97
+ "version": "0.13.1",
98
+ "comments": {
99
+ "patch": [
100
+ {
101
+ "comment": "fix Avatar not working on iOS",
102
+ "author": "sanajmi@microsoft.com",
103
+ "commit": "7356f363aa7ef56ecd1221ba4b36411701438c2e",
104
+ "package": "@fluentui-react-native/experimental-avatar"
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ "date": "Wed, 17 Nov 2021 19:28:07 GMT",
6
111
  "tag": "@fluentui-react-native/experimental-avatar_v0.13.0",
7
112
  "version": "0.13.0",
8
113
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,49 @@
1
1
  # Change Log - @fluentui-react-native/experimental-avatar
2
2
 
3
- This log was last generated on Wed, 17 Nov 2021 19:23:57 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 17 Dec 2021 19:51:04 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.13.4
8
+
9
+ Fri, 17 Dec 2021 19:51:04 GMT
10
+
11
+ ### Patches
12
+
13
+ - Bump @fluentui-react-native/framework to v0.7.3
14
+
15
+ ## 0.13.3
16
+
17
+ Fri, 17 Dec 2021 01:26:42 GMT
18
+
19
+ ### Patches
20
+
21
+ - Bump @fluentui-react-native/framework to v0.7.2
22
+ - Bump @fluentui-react-native/theme-tokens to v0.11.1
23
+
24
+ ## 0.13.2
25
+
26
+ Thu, 16 Dec 2021 19:10:29 GMT
27
+
28
+ ### Patches
29
+
30
+ - Added shape prop to Avatar (v.kozlova13@gmail.com)
31
+ - Bump @fluentui-react-native/adapters to v0.8.1
32
+ - Bump @fluentui-react-native/framework to v0.7.1
33
+ - Bump @fluentui-react-native/theme-tokens to v0.11.0
34
+ - Bump @fluentui-react-native/tokens to v0.11.1
35
+
36
+ ## 0.13.1
37
+
38
+ Wed, 17 Nov 2021 21:07:06 GMT
39
+
40
+ ### Patches
41
+
42
+ - fix Avatar not working on iOS (sanajmi@microsoft.com)
43
+
7
44
  ## 0.13.0
8
45
 
9
- Wed, 17 Nov 2021 19:23:57 GMT
46
+ Wed, 17 Nov 2021 19:28:07 GMT
10
47
 
11
48
  ### Minor changes
12
49
 
package/lib/Avatar.d.ts CHANGED
@@ -1,3 +1,70 @@
1
- import { AvatarProps } from './Avatar.types';
2
- export declare const Avatar: import("@fluentui-react-native/composition").ComposeFactoryComponent<AvatarProps, import("./Avatar.types").AvatarSlotProps, import("./Avatar.types").AvatarTokens, import("@fluentui-react-native/framework").Theme, object>;
1
+ import { ImageURISource, ViewProps, ColorValue } from 'react-native';
2
+ export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
3
+ export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
4
+ export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
5
+ export declare type AvatarTokens = {
6
+ /**
7
+ * Supported Avatar sizes
8
+ */
9
+ size?: Size;
10
+ /**
11
+ * Supported Avatar styles
12
+ */
13
+ avatarStyle?: AvatarStyle;
14
+ };
15
+ export declare type AvatarProps = AvatarTokens & {
16
+ /**
17
+ * The image to be displayed
18
+ */
19
+ imageSource?: ImageURISource;
20
+ /**
21
+ * The primary text to create initials with (e.g. a name)
22
+ */
23
+ primaryText?: string;
24
+ /**
25
+ * The secondary text to create initials with if primary text is not provided (e.g. an email address)
26
+ */
27
+ secondaryText?: string;
28
+ /**
29
+ * A custom color for the ring around the Avatar
30
+ */
31
+ ringColor?: ColorValue;
32
+ /**
33
+ * A custom color for the avatar initials when no image is shown
34
+ */
35
+ foregroundColor?: ColorValue;
36
+ /**
37
+ * A custom color for the avatar background when no image is shown
38
+ */
39
+ backgroundColor?: ColorValue;
40
+ /**
41
+ * The avatar view's presence state.
42
+ */
43
+ presence?: Presence;
44
+ /**
45
+ * A boolean inidicating whether the ring is visible
46
+ */
47
+ isRingVisible?: boolean;
48
+ /**
49
+ * A boolean indicating whether the Inner Ring Gap is transparent
50
+ */
51
+ isTransparent?: boolean;
52
+ /**
53
+ * A boolean indicating out of office status
54
+ */
55
+ isOutOfOffice?: boolean;
56
+ /**
57
+ * A boolean indicating whether the gap between the avatar and ring is visible.
58
+ */
59
+ hasRingInnerGap?: boolean;
60
+ /**
61
+ * An image to be shown as the backdrop of the ring, rather then a solid color.
62
+ * Takes precendence over `ringColor`
63
+ */
64
+ customBorderImageSource?: ImageURISource;
65
+ };
66
+ export declare type NativeAvatarViewProps = ViewProps & AvatarProps;
67
+ export declare const Avatar: import("@fluentui-react-native/composition").ComposeFactoryComponent<AvatarProps, {
68
+ root: NativeAvatarViewProps;
69
+ }, AvatarTokens, import("@fluentui-react-native/framework").Theme, object>;
3
70
  //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AAKrE,eAAO,MAAM,MAAM,8NAoCjB,CAAC"}
1
+ {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAiB,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAOpF,oBAAY,IAAI,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElF,oBAAY,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,UAAU,CAAC;AAEvG,oBAAY,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ1G,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,WAAW,GAAG,YAAY,GAAG;IACvC;;OAEG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,eAAe,CAAC,EAAE,UAAU,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,cAAc,CAAC;CAC1C,CAAC;AAIF,oBAAY,qBAAqB,GAAG,SAAS,GAAG,WAAW,CAAC;AAO5D,eAAO,MAAM,MAAM;;0EA4BjB,CAAC"}
package/lib/Avatar.js CHANGED
@@ -9,43 +9,37 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  /** @jsx withSlots */
24
- import { Image, View, Text } from 'react-native';
25
- import { avatarName } from './Avatar.types';
26
- import { stylingSettings } from './Avatar.styling';
27
- import { compose, mergeProps, withSlots } from '@fluentui-react-native/framework';
28
- import { useAvatar } from './useAvatar';
29
- export var Avatar = compose(__assign(__assign({ displayName: avatarName }, stylingSettings), { slots: {
30
- root: View,
31
- photo: Image,
32
- initials: Text,
33
- initialsBackground: View,
34
- icon: Image,
35
- ring: View,
36
- glow: View,
37
- }, render: function (userProps, useSlots) {
38
- var Avatar = useAvatar(userProps);
39
- var Slots = useSlots(userProps, function (layer) { return Avatar.state[layer] || userProps[layer]; });
40
- return function (final) {
41
- var _a = mergeProps(Avatar.props, final), children = _a.children, accessibilityLabel = _a.accessibilityLabel, mergedProps = __rest(_a, ["children", "accessibilityLabel"]);
42
- var _b = Avatar.state, personaPhotoSource = _b.personaPhotoSource, iconSource = _b.iconSource, showRing = _b.showRing, transparentRing = _b.transparentRing;
43
- return (withSlots(Slots.root, __assign({}, mergedProps),
44
- personaPhotoSource ? (withSlots(Slots.photo, { accessibilityLabel: accessibilityLabel, source: personaPhotoSource })) : (withSlots(Slots.initialsBackground, null,
45
- withSlots(Slots.initials, null, children))),
46
- showRing && !transparentRing && withSlots(Slots.ring, null),
47
- showRing && withSlots(Slots.glow, null),
48
- !!iconSource && !!iconSource.uri && withSlots(Slots.icon, { source: iconSource })));
49
- };
50
- } }));
13
+ import { compose, buildProps, mergeProps, withSlots } from '@fluentui-react-native/framework';
14
+ import { NativeModules } from 'react-native';
15
+ import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
16
+ var avatarName = 'Avatar';
17
+ var NativeAvatarView = ensureNativeComponent('FRNAvatarView');
18
+ var ExportedNativeConstants = NativeModules.FRNAvatarViewManager;
19
+ var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
20
+ export var Avatar = compose({
21
+ displayName: avatarName,
22
+ tokens: [
23
+ {
24
+ size: 'small',
25
+ avatarStyle: 'default',
26
+ },
27
+ avatarName,
28
+ ],
29
+ tokensThatAreAlsoProps: tokensThatAreAlsoProps,
30
+ slots: { root: NativeAvatarView },
31
+ slotProps: {
32
+ root: buildProps(function (tokens) { return ({
33
+ size: tokens.size,
34
+ style: {
35
+ height: ExportedNativeConstants.sizes[tokens.size],
36
+ width: ExportedNativeConstants.sizes[tokens.size],
37
+ },
38
+ }); }, ['size']),
39
+ },
40
+ render: function (props, useSlots) {
41
+ var Root = useSlots(props).root;
42
+ return function (rest) { return withSlots(Root, __assign({}, mergeProps(props, rest))); };
43
+ },
44
+ });
51
45
  //# sourceMappingURL=Avatar.js.map
package/lib/Avatar.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["../src/Avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAA2B,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,IAAM,MAAM,GAAG,OAAO,qBAC3B,WAAW,EAAE,UAAU,IACpB,eAAe,KAClB,KAAK,EAAE;QACL,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,IAAI;QACd,kBAAkB,EAAE,IAAI;QACxB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;KACX,EACD,MAAM,EAAE,UAAC,SAAsB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AyB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,UAAU,GAAG,QAAQ,CAAC;AAE5B,IAAM,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,aAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAA2B,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAS/E,MAAM,CAAC,IAAM,MAAM,GAAG,OAAO,CAAa;IACxC,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE;QACN;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,SAAS;SACvB;QACD,UAAU;KACX;IACD,sBAAsB,wBAAA;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACjC,SAAS,EAAE;QACT,IAAI,EAAE,UAAU,CACd,UAAC,MAAM,IAAK,OAAA,CAAC;YACX,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE;gBACL,MAAM,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAClD,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;aAClD;SACF,CAAC,EANU,CAMV,EACF,CAAC,MAAM,CAAC,CACT;KACF;IACD,MAAM,EAAE,UAAC,KAAkB,EAAE,QAA8B;QACzD,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAiB,IAAK,OAAA,UAAC,IAAI,eAAK,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IACtE,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { JSAvatarProps, JSAvatarState } from './JSAvatar.types';
2
+ /**
3
+ * A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
4
+ *
5
+ * @param layer The name of the state that is being checked for
6
+ * @param state The current state of the avatar
7
+ * @param userProps The props that were passed into the avatar
8
+ * @returns Whether the styles that are assigned to the layer should be applied to the avatar
9
+ */
10
+ export declare const avatarLookup: (layer: string, state: JSAvatarState, userProps: JSAvatarProps) => boolean;
11
+ export declare const JSAvatar: import("@fluentui-react-native/composition").ComposeFactoryComponent<JSAvatarProps, import("./JSAvatar.types").AvatarSlotProps, import("./JSAvatar.types").JSAvatarTokens, import("@fluentui-react-native/framework").Theme, object>;
12
+ //# sourceMappingURL=JSAvatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.d.ts","sourceRoot":"","sources":["../src/JSAvatar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAA8B,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAK5F;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,4EAExB,CAAC;AAEF,eAAO,MAAM,QAAQ,sOAoCnB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AvatarSize, AvatarColor, AvatarPresence, AvatarTokens, RingThickness } from './Avatar.types';
1
+ import { AvatarSize, AvatarColor, AvatarPresence, JSAvatarTokens, RingThickness } from './JSAvatar.types';
2
2
  import { ImageURISource } from 'react-native';
3
3
  export declare function getPresenceIconSource(presence: AvatarPresence, isOutOfOffice: boolean): ImageURISource;
4
4
  export declare type AvatarSizeConfig = {
@@ -12,6 +12,6 @@ export declare function getSizeConfig(size: AvatarSize): AvatarSizeConfig;
12
12
  * Converts the AvatarColor into a hex color value
13
13
  */
14
14
  export declare function convertCoinColorFluent(coinColor: AvatarColor): string;
15
- export declare function calculateEffectiveSizes(tokens: AvatarTokens): AvatarSizeConfig;
15
+ export declare function calculateEffectiveSizes(tokens: JSAvatarTokens): AvatarSizeConfig;
16
16
  export declare function getRingThickness(thickness: RingThickness): number;
17
- //# sourceMappingURL=Avatar.helpers.d.ts.map
17
+ //# sourceMappingURL=JSAvatar.helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.helpers.d.ts","sourceRoot":"","sources":["../src/JSAvatar.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA4B9C,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,GAAG,cAAc,CAEtG;AAED,oBAAY,gBAAgB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAcF,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAEhE;AAyBD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,WAAW,GAAG,MAAM,CAErE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,CAoBhF;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAiBjE"}
@@ -100,4 +100,4 @@ export function getRingThickness(thickness) {
100
100
  return thickness < 0 ? 4 : thickness;
101
101
  }
102
102
  }
103
- //# sourceMappingURL=Avatar.helpers.js.map
103
+ //# sourceMappingURL=JSAvatar.helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.helpers.js","sourceRoot":"","sources":["../src/JSAvatar.helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnE,IAAM,iBAAiB,GAAgD;IACrE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,wXAAwX;KAC9X;IACD,MA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,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX,KAAK,SAAS;YACZ,OAAO,CAAC,CAAC;QACX;YACE,OAAO,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KACxC;AACH,CAAC"}
@@ -0,0 +1,62 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /** @jsx withSlots */
24
+ import { Image, View, Text } from 'react-native';
25
+ import { JSAvatarName } from './JSAvatar.types';
26
+ import { stylingSettings } from './JSAvatar.styling';
27
+ import { compose, mergeProps, withSlots } from '@fluentui-react-native/framework';
28
+ import { useAvatar } from './useAvatar';
29
+ /**
30
+ * A function which determines if a set of styles should be applied to the compoent given the current state and props of the avatar.
31
+ *
32
+ * @param layer The name of the state that is being checked for
33
+ * @param state The current state of the avatar
34
+ * @param userProps The props that were passed into the avatar
35
+ * @returns Whether the styles that are assigned to the layer should be applied to the avatar
36
+ */
37
+ export var avatarLookup = function (layer, state, userProps) {
38
+ return state[layer] || userProps[layer] || layer === userProps['shape'] || (!userProps['shape'] && layer === 'circular');
39
+ };
40
+ export var JSAvatar = compose(__assign(__assign({ displayName: JSAvatarName }, stylingSettings), { slots: {
41
+ root: View,
42
+ photo: Image,
43
+ initials: Text,
44
+ initialsBackground: View,
45
+ icon: Image,
46
+ ring: View,
47
+ glow: View,
48
+ }, render: function (userProps, useSlots) {
49
+ var avatar = useAvatar(userProps);
50
+ var Slots = useSlots(userProps, function (layer) { return avatarLookup(layer, avatar.state, userProps); });
51
+ return function (final) {
52
+ var _a = mergeProps(avatar.props, final), children = _a.children, accessibilityLabel = _a.accessibilityLabel, mergedProps = __rest(_a, ["children", "accessibilityLabel"]);
53
+ var _b = avatar.state, personaPhotoSource = _b.personaPhotoSource, iconSource = _b.iconSource, showRing = _b.showRing, transparentRing = _b.transparentRing;
54
+ return (withSlots(Slots.root, __assign({}, mergedProps),
55
+ personaPhotoSource ? (withSlots(Slots.photo, { accessibilityLabel: accessibilityLabel, source: personaPhotoSource })) : (withSlots(Slots.initialsBackground, null,
56
+ withSlots(Slots.initials, null, children))),
57
+ showRing && !transparentRing && withSlots(Slots.ring, null),
58
+ showRing && withSlots(Slots.glow, null),
59
+ !!iconSource && !!iconSource.uri && withSlots(Slots.icon, { source: iconSource })));
60
+ };
61
+ } }));
62
+ //# sourceMappingURL=JSAvatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.js","sourceRoot":"","sources":["../src/JSAvatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAA+B,YAAY,EAAiB,MAAM,kBAAkB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OA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F,CAAC,CAAC,CAAC,CACF,UAAC,KAAK,CAAC,kBAAkB;oBACvB,UAAC,KAAK,CAAC,QAAQ,QAAE,QAAQ,CAAkB,CAClB,CAC5B;gBACA,QAAQ,IAAI,CAAC,eAAe,IAAI,UAAC,KAAK,CAAC,IAAI,OAAG;gBAC9C,QAAQ,IAAI,UAAC,KAAK,CAAC,IAAI,OAAG;gBAC1B,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,UAAC,KAAK,CAAC,IAAI,IAAC,MAAM,EAAE,UAAU,GAAI,CAC5D,CACd,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC,IACD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { JSAvatarTokens, AvatarSlotProps, JSAvatarProps } from './JSAvatar.types';
2
+ import { UseStylingOptions } from '@fluentui-react-native/framework';
3
+ export declare const avatarStates: (keyof JSAvatarTokens)[];
4
+ export declare const stylingSettings: UseStylingOptions<JSAvatarProps, AvatarSlotProps, JSAvatarTokens>;
5
+ //# sourceMappingURL=JSAvatar.styling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.styling.d.ts","sourceRoot":"","sources":["../src/JSAvatar.styling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAS,iBAAiB,EAAc,MAAM,kCAAkC,CAAC;AAYxF,eAAO,MAAM,YAAY,EAAE,CAAC,MAAM,cAAc,CAAC,EAA2B,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,aAAa,EAAE,eAAe,EAAE,cAAc,CAmJ7F,CAAC"}
@@ -1,14 +1,35 @@
1
- import { avatarName } from './Avatar.types';
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
13
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
14
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
15
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
16
+ r[k] = a[j];
17
+ return r;
18
+ };
19
+ import { JSAvatarName } from './JSAvatar.types';
2
20
  import { buildProps } from '@fluentui-react-native/framework';
3
- import { defaultAvatarTokens } from './AvatarTokens';
4
- import { calculateEffectiveSizes, convertCoinColorFluent, getRingThickness } from './Avatar.helpers';
21
+ import { defaultJSAvatarTokens } from './JSAvatarTokens';
22
+ import { calculateEffectiveSizes, convertCoinColorFluent, getRingThickness } from './JSAvatar.helpers';
23
+ import { borderStyles } from '@fluentui-react-native/tokens';
5
24
  var nameMap = {
6
25
  start: 'flex-start',
7
26
  center: 'center',
8
27
  end: 'flex-end',
9
28
  };
29
+ export var avatarStates = ['circular', 'square'];
10
30
  export var stylingSettings = {
11
- tokens: [defaultAvatarTokens, avatarName],
31
+ tokens: [defaultJSAvatarTokens, JSAvatarName],
32
+ states: avatarStates,
12
33
  slotProps: {
13
34
  root: buildProps(function (tokens) {
14
35
  var physicalSize = calculateEffectiveSizes(tokens).physicalSize;
@@ -33,7 +54,7 @@ export var stylingSettings = {
33
54
  },
34
55
  };
35
56
  }, ['initialsSize']),
36
- initialsBackground: buildProps(function (tokens) {
57
+ initialsBackground: buildProps(function (tokens, theme) {
37
58
  var physicalSize = calculateEffectiveSizes(tokens).physicalSize;
38
59
  var backgroundColor = tokens.backgroundColor, coinColorFluent = tokens.coinColorFluent;
39
60
  var effectiveBackgroundColor = backgroundColor;
@@ -41,28 +62,19 @@ export var stylingSettings = {
41
62
  effectiveBackgroundColor = convertCoinColorFluent(coinColorFluent);
42
63
  }
43
64
  return {
44
- style: {
45
- borderRadius: physicalSize / 2,
46
- width: physicalSize,
47
- height: physicalSize,
48
- flexGrow: 1,
49
- alignSelf: 'stretch',
50
- justifyContent: 'center',
51
- alignItems: 'center',
52
- backgroundColor: effectiveBackgroundColor,
53
- },
65
+ style: __assign(__assign({}, borderStyles.from(tokens, theme)), { width: physicalSize, height: physicalSize, flexGrow: 1, alignSelf: 'stretch', justifyContent: 'center', alignItems: 'center', backgroundColor: effectiveBackgroundColor }),
54
66
  };
55
- }, ['coinColorFluent', 'backgroundColor', 'physicalSize']),
67
+ }, __spreadArrays(['coinColorFluent', 'backgroundColor', 'physicalSize'], borderStyles.keys)),
56
68
  photo: buildProps(function (tokens) {
57
69
  var physicalSize = calculateEffectiveSizes(tokens).physicalSize;
58
70
  return {
59
71
  style: {
60
- borderRadius: physicalSize / 2,
72
+ borderRadius: tokens.borderRadius,
61
73
  width: physicalSize,
62
74
  height: physicalSize,
63
75
  },
64
76
  };
65
- }, ['physicalSize']),
77
+ }, ['physicalSize', 'borderRadius']),
66
78
  icon: buildProps(function (tokens, theme) {
67
79
  var _a = calculateEffectiveSizes(tokens), iconSize = _a.iconSize, iconStrokeWidth = _a.iconStrokeWidth;
68
80
  var iconSizeAdjusted = iconSize + iconStrokeWidth * 2;
@@ -90,19 +102,9 @@ export var stylingSettings = {
90
102
  var effectiveSize = physicalSize + 2 * effectiveRingThickness;
91
103
  var ringColor = ring.ringBackgroundColor || theme.colors.personaActivityRing;
92
104
  return {
93
- style: {
94
- borderStyle: 'solid',
95
- borderColor: ringColor,
96
- borderWidth: effectiveRingThickness,
97
- borderRadius: effectiveSize / 2,
98
- width: effectiveSize,
99
- height: effectiveSize,
100
- position: 'absolute',
101
- top: -effectiveRingThickness,
102
- left: -effectiveRingThickness,
103
- },
105
+ style: __assign({ borderStyle: 'solid', borderColor: ringColor, borderWidth: effectiveRingThickness, width: effectiveSize, height: effectiveSize, position: 'absolute', top: -effectiveRingThickness, left: -effectiveRingThickness }, borderStyles.from(tokens, theme)),
104
106
  };
105
- }, ['physicalSize', 'ring', 'physicalSize']),
107
+ }, __spreadArrays(['physicalSize', 'ring', 'physicalSize'], borderStyles.keys)),
106
108
  glow: buildProps(function (tokens, theme) {
107
109
  var physicalSize = calculateEffectiveSizes(tokens).physicalSize;
108
110
  var ring = tokens.ring;
@@ -113,19 +115,9 @@ export var stylingSettings = {
113
115
  var effectiveSize = physicalSize + 2 * effectiveRingThickness;
114
116
  var glowColor = ring.accent ? theme.colors.accentButtonBackground : ring.ringColor || theme.colors.personaActivityGlow;
115
117
  return {
116
- style: {
117
- borderStyle: 'solid',
118
- borderColor: glowColor,
119
- borderWidth: effectiveRingThickness - innerGap,
120
- borderRadius: effectiveSize / 2,
121
- width: effectiveSize,
122
- height: effectiveSize,
123
- position: 'absolute',
124
- top: -effectiveRingThickness,
125
- left: -effectiveRingThickness,
126
- },
118
+ style: __assign({ borderStyle: 'solid', borderColor: glowColor, borderWidth: effectiveRingThickness - innerGap, width: effectiveSize, height: effectiveSize, position: 'absolute', top: -effectiveRingThickness, left: -effectiveRingThickness }, borderStyles.from(tokens, theme)),
127
119
  };
128
- }, ['physicalSize', 'ring']),
120
+ }, __spreadArrays(['physicalSize', 'ring'], borderStyles.keys)),
129
121
  },
130
122
  };
131
- //# sourceMappingURL=Avatar.styling.js.map
123
+ //# sourceMappingURL=JSAvatar.styling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JSAvatar.styling.js","sourceRoot":"","sources":["../src/JSAvatar.styling.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAkD,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAA4B,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAE,YAAY,E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