@fluentui-react-native/experimental-avatar 0.14.45 → 0.15.2
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/CHANGELOG.json +61 -1
- package/CHANGELOG.md +26 -2
- package/FRNAvatar.podspec +2 -2
- package/{lib-commonjs/Avatar.d.ts → lib/NativeAvatar.d.ts} +6 -6
- package/lib/NativeAvatar.d.ts.map +1 -0
- package/lib/{Avatar.js → NativeAvatar.js} +3 -3
- package/lib/NativeAvatar.js.map +1 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/{lib/Avatar.d.ts → lib-commonjs/NativeAvatar.d.ts} +6 -6
- package/lib-commonjs/NativeAvatar.d.ts.map +1 -0
- package/lib-commonjs/{Avatar.js → NativeAvatar.js} +4 -4
- package/lib-commonjs/NativeAvatar.js.map +1 -0
- package/lib-commonjs/index.d.ts +1 -3
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +1 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +2 -10
- package/src/{Avatar.tsx → NativeAvatar.tsx} +11 -11
- package/src/__tests__/Avatar.test.jsx +129 -0
- package/src/__tests__/__snapshots__/{JSAvatar.test.jsx.snap → Avatar.test.jsx.snap} +0 -0
- package/src/index.ts +1 -3
- package/MIGRATION.md +0 -157
- package/SPEC.md +0 -295
- package/jest.config.js +0 -2
- package/lib/Avatar.d.ts.map +0 -1
- package/lib/Avatar.js.map +0 -1
- package/lib/JSAvatar.d.ts +0 -12
- package/lib/JSAvatar.d.ts.map +0 -1
- package/lib/JSAvatar.js +0 -84
- package/lib/JSAvatar.js.map +0 -1
- package/lib/JSAvatar.styling.d.ts +0 -5
- package/lib/JSAvatar.styling.d.ts.map +0 -1
- package/lib/JSAvatar.styling.js +0 -158
- package/lib/JSAvatar.styling.js.map +0 -1
- package/lib/JSAvatar.types.d.ts +0 -213
- package/lib/JSAvatar.types.d.ts.map +0 -1
- package/lib/JSAvatar.types.js +0 -56
- package/lib/JSAvatar.types.js.map +0 -1
- package/lib/JSAvatarTokens.d.ts +0 -5
- package/lib/JSAvatarTokens.d.ts.map +0 -1
- package/lib/JSAvatarTokens.js +0 -198
- package/lib/JSAvatarTokens.js.map +0 -1
- package/lib/JSAvatarTokens.win32.d.ts +0 -5
- package/lib/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib/JSAvatarTokens.win32.js +0 -201
- package/lib/JSAvatarTokens.win32.js.map +0 -1
- package/lib/getHashCode.d.ts +0 -8
- package/lib/getHashCode.d.ts.map +0 -1
- package/lib/getHashCode.js +0 -16
- package/lib/getHashCode.js.map +0 -1
- package/lib/titles.d.ts +0 -2
- package/lib/titles.d.ts.map +0 -1
- package/lib/titles.js +0 -109
- package/lib/titles.js.map +0 -1
- package/lib/useAvatar.d.ts +0 -33
- package/lib/useAvatar.d.ts.map +0 -1
- package/lib/useAvatar.js +0 -106
- package/lib/useAvatar.js.map +0 -1
- package/lib-commonjs/Avatar.d.ts.map +0 -1
- package/lib-commonjs/Avatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.d.ts +0 -12
- package/lib-commonjs/JSAvatar.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.js +0 -88
- package/lib-commonjs/JSAvatar.js.map +0 -1
- package/lib-commonjs/JSAvatar.styling.d.ts +0 -5
- package/lib-commonjs/JSAvatar.styling.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.styling.js +0 -161
- package/lib-commonjs/JSAvatar.styling.js.map +0 -1
- package/lib-commonjs/JSAvatar.types.d.ts +0 -213
- package/lib-commonjs/JSAvatar.types.d.ts.map +0 -1
- package/lib-commonjs/JSAvatar.types.js +0 -59
- package/lib-commonjs/JSAvatar.types.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.js +0 -202
- package/lib-commonjs/JSAvatarTokens.js.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.d.ts +0 -5
- package/lib-commonjs/JSAvatarTokens.win32.d.ts.map +0 -1
- package/lib-commonjs/JSAvatarTokens.win32.js +0 -205
- package/lib-commonjs/JSAvatarTokens.win32.js.map +0 -1
- package/lib-commonjs/getHashCode.d.ts +0 -8
- package/lib-commonjs/getHashCode.d.ts.map +0 -1
- package/lib-commonjs/getHashCode.js +0 -20
- package/lib-commonjs/getHashCode.js.map +0 -1
- package/lib-commonjs/titles.d.ts +0 -2
- package/lib-commonjs/titles.d.ts.map +0 -1
- package/lib-commonjs/titles.js +0 -112
- package/lib-commonjs/titles.js.map +0 -1
- package/lib-commonjs/useAvatar.d.ts +0 -33
- package/lib-commonjs/useAvatar.d.ts.map +0 -1
- package/lib-commonjs/useAvatar.js +0 -113
- package/lib-commonjs/useAvatar.js.map +0 -1
- package/src/JSAvatar.styling.ts +0 -201
- package/src/JSAvatar.tsx +0 -96
- package/src/JSAvatar.types.ts +0 -286
- package/src/JSAvatarTokens.ts +0 -201
- package/src/JSAvatarTokens.win32.ts +0 -204
- package/src/__tests__/JSAvatar.test.jsx +0 -96
- package/src/getHashCode.ts +0 -16
- package/src/titles.ts +0 -108
- package/src/useAvatar.ts +0 -126
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,67 @@
|
|
|
2
2
|
"name": "@fluentui-react-native/experimental-avatar",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 07 Jul 2022 21:22:09 GMT",
|
|
6
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.15.2",
|
|
7
|
+
"version": "0.15.2",
|
|
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.31",
|
|
14
|
+
"commit": "f10be0c3afa914ad42fcb639dc4d0a65a87c6425"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 23 Jun 2022 16:08:07 GMT",
|
|
21
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.15.1",
|
|
22
|
+
"version": "0.15.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "78454019+lyzhan7@users.noreply.github.com",
|
|
27
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
28
|
+
"commit": "7880dae12f6e2283020d0a6413fdb7e8193afb2b",
|
|
29
|
+
"comment": "Bump FUA podspecs/podfile.lock to 0.5.2"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Tue, 21 Jun 2022 23:39:02 GMT",
|
|
36
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.15.0",
|
|
37
|
+
"version": "0.15.0",
|
|
38
|
+
"comments": {
|
|
39
|
+
"none": [
|
|
40
|
+
{
|
|
41
|
+
"author": "joannaquu@gmail.com",
|
|
42
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
43
|
+
"commit": "6426ed850d4667d8cefdd7140017959dca5642fe",
|
|
44
|
+
"comment": "merge"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Tue, 21 Jun 2022 21:07:14 GMT",
|
|
51
|
+
"tag": "@fluentui-react-native/experimental-avatar_v0.15.0",
|
|
52
|
+
"version": "0.15.0",
|
|
53
|
+
"comments": {
|
|
54
|
+
"minor": [
|
|
55
|
+
{
|
|
56
|
+
"author": "v.kozova13@gmail.com",
|
|
57
|
+
"package": "@fluentui-react-native/experimental-avatar",
|
|
58
|
+
"commit": "2ad8751db36583b42e819bbf6667161d2687cf7a",
|
|
59
|
+
"comment": "Renamed Avatar to NativeAvatar, JSAvatar to Avatar"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "Tue, 21 Jun 2022 20:05:26 GMT",
|
|
6
66
|
"tag": "@fluentui-react-native/experimental-avatar_v0.14.45",
|
|
7
67
|
"version": "0.14.45",
|
|
8
68
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/experimental-avatar
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 07 Jul 2022 21:22:09 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.15.2
|
|
8
|
+
|
|
9
|
+
Thu, 07 Jul 2022 21:22:09 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Bump @fluentui-react-native/framework to v0.7.31
|
|
14
|
+
|
|
15
|
+
## 0.15.1
|
|
16
|
+
|
|
17
|
+
Thu, 23 Jun 2022 16:08:07 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Bump FUA podspecs/podfile.lock to 0.5.2 (78454019+lyzhan7@users.noreply.github.com)
|
|
22
|
+
|
|
23
|
+
## 0.15.0
|
|
24
|
+
|
|
25
|
+
Tue, 21 Jun 2022 21:07:14 GMT
|
|
26
|
+
|
|
27
|
+
### Minor changes
|
|
28
|
+
|
|
29
|
+
- Renamed Avatar to NativeAvatar, JSAvatar to Avatar (v.kozova13@gmail.com)
|
|
30
|
+
|
|
7
31
|
## 0.14.45
|
|
8
32
|
|
|
9
|
-
Tue, 21 Jun 2022 20:05:
|
|
33
|
+
Tue, 21 Jun 2022 20:05:26 GMT
|
|
10
34
|
|
|
11
35
|
### Patches
|
|
12
36
|
|
package/FRNAvatar.podspec
CHANGED
|
@@ -16,11 +16,11 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
|
|
17
17
|
s.ios.deployment_target = "14.0"
|
|
18
18
|
s.ios.source_files = "ios/*.{swift,h,m}"
|
|
19
|
-
s.ios.dependency 'MicrosoftFluentUI/Avatar_ios', '0.5.
|
|
19
|
+
s.ios.dependency 'MicrosoftFluentUI/Avatar_ios', '0.5.2'
|
|
20
20
|
|
|
21
21
|
s.osx.deployment_target = "10.15"
|
|
22
22
|
s.osx.source_files = "macos/*.{swift,h,m}"
|
|
23
|
-
s.osx.dependency 'MicrosoftFluentUI', '0.5.
|
|
23
|
+
s.osx.dependency 'MicrosoftFluentUI', '0.5.2'
|
|
24
24
|
|
|
25
25
|
s.dependency 'React'
|
|
26
26
|
end
|
|
@@ -2,7 +2,7 @@ import { ImageURISource, ViewProps, ColorValue } from 'react-native';
|
|
|
2
2
|
export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
|
|
3
3
|
export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
|
|
4
4
|
export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type NativeAvatarTokens = {
|
|
6
6
|
/**
|
|
7
7
|
* Supported Avatar sizes
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ export declare type AvatarTokens = {
|
|
|
12
12
|
*/
|
|
13
13
|
avatarStyle?: AvatarStyle;
|
|
14
14
|
};
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type NativeAvatarProps = NativeAvatarTokens & {
|
|
16
16
|
/**
|
|
17
17
|
* The image to be displayed
|
|
18
18
|
*/
|
|
@@ -63,8 +63,8 @@ export declare type AvatarProps = AvatarTokens & {
|
|
|
63
63
|
*/
|
|
64
64
|
customBorderImageSource?: ImageURISource;
|
|
65
65
|
};
|
|
66
|
-
export declare type NativeAvatarViewProps = ViewProps &
|
|
67
|
-
export declare const
|
|
66
|
+
export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
67
|
+
export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
|
|
68
68
|
root: NativeAvatarViewProps;
|
|
69
|
-
},
|
|
70
|
-
//# sourceMappingURL=
|
|
69
|
+
}, NativeAvatarTokens, object>;
|
|
70
|
+
//# sourceMappingURL=NativeAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.d.ts","sourceRoot":"","sources":["../src/NativeAvatar.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,kBAAkB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;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,iBAAiB,CAAC;AAOlE,eAAO,MAAM,YAAY;UAJJ,qBAAqB;8BAgCxC,CAAC"}
|
|
@@ -13,11 +13,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
import { compose, buildProps, mergeProps, withSlots } from '@fluentui-react-native/framework';
|
|
14
14
|
import { NativeModules } from 'react-native';
|
|
15
15
|
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
|
|
16
|
-
var avatarName = '
|
|
16
|
+
var avatarName = 'NativeAvatar';
|
|
17
17
|
var NativeAvatarView = ensureNativeComponent('FRNAvatarView');
|
|
18
18
|
var ExportedNativeConstants = NativeModules.FRNAvatarViewManager;
|
|
19
19
|
var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
|
|
20
|
-
export var
|
|
20
|
+
export var NativeAvatar = compose({
|
|
21
21
|
displayName: avatarName,
|
|
22
22
|
tokens: [
|
|
23
23
|
{
|
|
@@ -42,4 +42,4 @@ export var Avatar = compose({
|
|
|
42
42
|
return function (rest) { return withSlots(Root, __assign({}, mergeProps(props, rest))); };
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=NativeAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.js","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,qBAAqB;AACrB,OAAO,EAAE,OAAO,EAAY,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAkB,aAAa,EAAyB,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,IAAM,UAAU,GAAG,cAAc,CAAC;AAElC,IAAM,gBAAgB,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,aAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAAiC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASrF,MAAM,CAAC,IAAM,YAAY,GAAG,OAAO,CAAa;IAC9C,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,SAAS,EAAE,UAAC,KAAwB,EAAE,QAA8B;QAClE,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAuB,IAAK,OAAA,UAAC,IAAI,eAAK,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IAC5E,CAAC;CACF,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { ImageURISource, ViewProps, ColorValue } from 'react-native';
|
|
|
2
2
|
export declare type Size = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge';
|
|
3
3
|
export declare type AvatarStyle = 'default' | 'accent' | 'group' | 'outlined' | 'outlinedPrimary' | 'overflow';
|
|
4
4
|
export declare type Presence = 'none' | 'available' | 'away' | 'blocked' | 'doNotDisturb' | 'offline' | 'unknown';
|
|
5
|
-
export declare type
|
|
5
|
+
export declare type NativeAvatarTokens = {
|
|
6
6
|
/**
|
|
7
7
|
* Supported Avatar sizes
|
|
8
8
|
*/
|
|
@@ -12,7 +12,7 @@ export declare type AvatarTokens = {
|
|
|
12
12
|
*/
|
|
13
13
|
avatarStyle?: AvatarStyle;
|
|
14
14
|
};
|
|
15
|
-
export declare type
|
|
15
|
+
export declare type NativeAvatarProps = NativeAvatarTokens & {
|
|
16
16
|
/**
|
|
17
17
|
* The image to be displayed
|
|
18
18
|
*/
|
|
@@ -63,8 +63,8 @@ export declare type AvatarProps = AvatarTokens & {
|
|
|
63
63
|
*/
|
|
64
64
|
customBorderImageSource?: ImageURISource;
|
|
65
65
|
};
|
|
66
|
-
export declare type NativeAvatarViewProps = ViewProps &
|
|
67
|
-
export declare const
|
|
66
|
+
export declare type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
67
|
+
export declare const NativeAvatar: import("@fluentui-react-native/framework").ComposableComponent<NativeAvatarProps, {
|
|
68
68
|
root: NativeAvatarViewProps;
|
|
69
|
-
},
|
|
70
|
-
//# sourceMappingURL=
|
|
69
|
+
}, NativeAvatarTokens, object>;
|
|
70
|
+
//# sourceMappingURL=NativeAvatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.d.ts","sourceRoot":"","sources":["../src/NativeAvatar.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,kBAAkB,GAAG;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,oBAAY,iBAAiB,GAAG,kBAAkB,GAAG;IACnD;;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,iBAAiB,CAAC;AAOlE,eAAO,MAAM,YAAY;UAJJ,qBAAqB;8BAgCxC,CAAC"}
|
|
@@ -11,16 +11,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.NativeAvatar = void 0;
|
|
15
15
|
/** @jsx withSlots */
|
|
16
16
|
var framework_1 = require("@fluentui-react-native/framework");
|
|
17
17
|
var react_native_1 = require("react-native");
|
|
18
18
|
var component_cache_1 = require("@fluentui-react-native/component-cache");
|
|
19
|
-
var avatarName = '
|
|
19
|
+
var avatarName = 'NativeAvatar';
|
|
20
20
|
var NativeAvatarView = (0, component_cache_1.ensureNativeComponent)('FRNAvatarView');
|
|
21
21
|
var ExportedNativeConstants = react_native_1.NativeModules.FRNAvatarViewManager;
|
|
22
22
|
var tokensThatAreAlsoProps = ['size', 'avatarStyle'];
|
|
23
|
-
exports.
|
|
23
|
+
exports.NativeAvatar = (0, framework_1.compose)({
|
|
24
24
|
displayName: avatarName,
|
|
25
25
|
tokens: [
|
|
26
26
|
{
|
|
@@ -45,4 +45,4 @@ exports.Avatar = (0, framework_1.compose)({
|
|
|
45
45
|
return function (rest) { return (0, framework_1.withSlots)(Root, __assign({}, (0, framework_1.mergeProps)(props, rest))); };
|
|
46
46
|
},
|
|
47
47
|
});
|
|
48
|
-
//# sourceMappingURL=
|
|
48
|
+
//# sourceMappingURL=NativeAvatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeAvatar.js","sourceRoot":"","sources":["../src/NativeAvatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qBAAqB;AACrB,8DAAwG;AACxG,6CAAoF;AACpF,0EAA+E;AAE/E,IAAM,UAAU,GAAG,cAAc,CAAC;AAElC,IAAM,gBAAgB,GAAG,IAAA,uCAAqB,EAAC,eAAe,CAAC,CAAC;AAYhE,IAAM,uBAAuB,GAAsB,4BAAa,CAAC,oBAAoB,CAAC;AA6EtF,IAAM,sBAAsB,GAAiC,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AASxE,QAAA,YAAY,GAAG,IAAA,mBAAO,EAAa;IAC9C,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,IAAA,sBAAU,EACd,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,SAAS,EAAE,UAAC,KAAwB,EAAE,QAA8B;QAClE,IAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QAElC,OAAO,UAAC,IAAuB,IAAK,OAAA,2BAAC,IAAI,eAAK,IAAA,sBAAU,EAAC,KAAK,EAAE,IAAI,CAAC,EAAI,EAArC,CAAqC,CAAC;IAC5E,CAAC;CACF,CAAC,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -10,7 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
14
|
-
__exportStar(require("./JSAvatar"), exports);
|
|
15
|
-
__exportStar(require("./JSAvatar.types"), exports);
|
|
13
|
+
__exportStar(require("./NativeAvatar"), exports);
|
|
16
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/experimental-avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "A cross-platform Avatar component using the Fluent Design System. Currently only implemented on iOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Microsoft <fluentuinativeowners@microsoft.com>",
|
|
@@ -25,16 +25,8 @@
|
|
|
25
25
|
"directory": "packages/experimental/Avatar"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@fluentui-react-native/adapters": "^0.8.5",
|
|
29
|
-
"@fluentui-react-native/badge": "^0.0.43",
|
|
30
28
|
"@fluentui-react-native/component-cache": "^1.3.2",
|
|
31
|
-
"@fluentui-react-native/framework": "0.7.
|
|
32
|
-
"@fluentui-react-native/icon": "^0.12.1",
|
|
33
|
-
"@fluentui-react-native/interactive-hooks": "^0.16.3",
|
|
34
|
-
"@fluentui-react-native/theme-tokens": "^0.18.0",
|
|
35
|
-
"@fluentui-react-native/tokens": "^0.14.0",
|
|
36
|
-
"@fluentui-react-native/use-styling": "^0.8.3",
|
|
37
|
-
"react-native-svg": "^12.3.0"
|
|
29
|
+
"@fluentui-react-native/framework": "0.7.31"
|
|
38
30
|
},
|
|
39
31
|
"devDependencies": {
|
|
40
32
|
"@fluentui-react-native/eslint-config-rules": "^0.1.1",
|
|
@@ -3,7 +3,7 @@ import { compose, UseSlots, buildProps, mergeProps, withSlots } from '@fluentui-
|
|
|
3
3
|
import { ImageURISource, NativeModules, ViewProps, ColorValue } from 'react-native';
|
|
4
4
|
import { ensureNativeComponent } from '@fluentui-react-native/component-cache';
|
|
5
5
|
|
|
6
|
-
const avatarName = '
|
|
6
|
+
const avatarName = 'NativeAvatar';
|
|
7
7
|
|
|
8
8
|
const NativeAvatarView = ensureNativeComponent('FRNAvatarView');
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ interface ExportedConstants {
|
|
|
19
19
|
|
|
20
20
|
const ExportedNativeConstants: ExportedConstants = NativeModules.FRNAvatarViewManager;
|
|
21
21
|
|
|
22
|
-
export type
|
|
22
|
+
export type NativeAvatarTokens = {
|
|
23
23
|
/**
|
|
24
24
|
* Supported Avatar sizes
|
|
25
25
|
*/
|
|
@@ -31,7 +31,7 @@ export type AvatarTokens = {
|
|
|
31
31
|
avatarStyle?: AvatarStyle;
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
export type
|
|
34
|
+
export type NativeAvatarProps = NativeAvatarTokens & {
|
|
35
35
|
/**
|
|
36
36
|
* The image to be displayed
|
|
37
37
|
*/
|
|
@@ -94,16 +94,16 @@ export type AvatarProps = AvatarTokens & {
|
|
|
94
94
|
customBorderImageSource?: ImageURISource;
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
const tokensThatAreAlsoProps: (keyof
|
|
97
|
+
const tokensThatAreAlsoProps: (keyof NativeAvatarTokens)[] = ['size', 'avatarStyle'];
|
|
98
98
|
|
|
99
|
-
export type NativeAvatarViewProps = ViewProps &
|
|
99
|
+
export type NativeAvatarViewProps = ViewProps & NativeAvatarProps;
|
|
100
100
|
interface AvatarType {
|
|
101
|
-
props:
|
|
101
|
+
props: NativeAvatarProps;
|
|
102
102
|
slotProps: { root: NativeAvatarViewProps };
|
|
103
|
-
tokens:
|
|
103
|
+
tokens: NativeAvatarTokens;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
export const
|
|
106
|
+
export const NativeAvatar = compose<AvatarType>({
|
|
107
107
|
displayName: avatarName,
|
|
108
108
|
tokens: [
|
|
109
109
|
{
|
|
@@ -115,7 +115,7 @@ export const Avatar = compose<AvatarType>({
|
|
|
115
115
|
tokensThatAreAlsoProps,
|
|
116
116
|
slots: { root: NativeAvatarView },
|
|
117
117
|
slotProps: {
|
|
118
|
-
root: buildProps<NativeAvatarViewProps,
|
|
118
|
+
root: buildProps<NativeAvatarViewProps, NativeAvatarTokens>(
|
|
119
119
|
(tokens) => ({
|
|
120
120
|
size: tokens.size,
|
|
121
121
|
style: {
|
|
@@ -126,9 +126,9 @@ export const Avatar = compose<AvatarType>({
|
|
|
126
126
|
['size'],
|
|
127
127
|
),
|
|
128
128
|
},
|
|
129
|
-
useRender: (props:
|
|
129
|
+
useRender: (props: NativeAvatarProps, useSlots: UseSlots<AvatarType>) => {
|
|
130
130
|
const Root = useSlots(props).root;
|
|
131
131
|
|
|
132
|
-
return (rest:
|
|
132
|
+
return (rest: NativeAvatarProps) => <Root {...mergeProps(props, rest)} />;
|
|
133
133
|
},
|
|
134
134
|
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Avatar } from '..';
|
|
3
|
+
import { getInitials } from '../useAvatar';
|
|
4
|
+
import * as renderer from 'react-test-renderer';
|
|
5
|
+
|
|
6
|
+
const alphabeticalTestNames = [
|
|
7
|
+
'Marie',
|
|
8
|
+
'Aadi KaPoor',
|
|
9
|
+
'Marie Beaudouin',
|
|
10
|
+
'Aadi Meni KaPoor',
|
|
11
|
+
'Aadi Meni Ka Jr',
|
|
12
|
+
'Will Little (Teams)',
|
|
13
|
+
'Will Little-Tanaka',
|
|
14
|
+
'-Aadi Kapoor',
|
|
15
|
+
'Richard 23 Feynman',
|
|
16
|
+
'* Richard *',
|
|
17
|
+
'Richard Feynman [Teams]',
|
|
18
|
+
'Richard Feynman {Teams}',
|
|
19
|
+
];
|
|
20
|
+
const alphabeticalInitials = ['M', 'AK', 'MB', 'AK', 'AK', 'WL', 'WL', 'AK', 'RF', 'R', 'RF', 'RF'];
|
|
21
|
+
const namesWithTitles = ['Mr Feynman', 'Dr Richard Feynman'];
|
|
22
|
+
const initialsForNameWithTitles = ['F', 'RF'];
|
|
23
|
+
|
|
24
|
+
describe('Avatar rendering', () => {
|
|
25
|
+
it('renders Avatar', () => {
|
|
26
|
+
const tree = renderer.create(<Avatar />).toJSON();
|
|
27
|
+
expect(tree).toMatchSnapshot();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('getInitials - names with titles', () => {
|
|
32
|
+
it('returns initials without title', () => {
|
|
33
|
+
expect(getInitials('Mr Faynman')).toBe('F');
|
|
34
|
+
});
|
|
35
|
+
it('returns initials for names with multi-word titles', () => {
|
|
36
|
+
expect(getInitials('Consul General Richard Faynman')).toBe('RF');
|
|
37
|
+
expect(getInitials('Major General Victor')).toBe('V');
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
describe('getInitials method - language support', () => {
|
|
42
|
+
it('returns correct initials cyrillic language', () => {
|
|
43
|
+
const test = getInitials('Илон Маск');
|
|
44
|
+
expect(test).toBe('ИМ');
|
|
45
|
+
});
|
|
46
|
+
it('calculates correct initials for non-ASCII characters', () => {
|
|
47
|
+
const test = getInitials('Írissa Þórðardóttir');
|
|
48
|
+
expect(test).toBe('ÍÞ');
|
|
49
|
+
});
|
|
50
|
+
it('returns correct initials for non-ASCII characters', () => {
|
|
51
|
+
const test = getInitials('Øyvind Åsen');
|
|
52
|
+
expect(test).toBe('ØÅ');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('getInitials method', () => {
|
|
57
|
+
it('returns correct initials', () => {
|
|
58
|
+
const test = getInitials('-Test str with *spaces');
|
|
59
|
+
expect(test).toBe('TS');
|
|
60
|
+
});
|
|
61
|
+
it('returns an empty string if name is undefined', () => {
|
|
62
|
+
expect(getInitials(undefined)).toBe('');
|
|
63
|
+
});
|
|
64
|
+
it('return initials for alphabetical words', () => {
|
|
65
|
+
for (let i = 0; i < alphabeticalTestNames.length; i++) {
|
|
66
|
+
expect(getInitials(alphabeticalTestNames[i])).toBe(alphabeticalInitials[i]);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
it('return initials for words with titles', () => {
|
|
70
|
+
for (let i = 0; i < namesWithTitles.length; i++) {
|
|
71
|
+
expect(getInitials(namesWithTitles[i])).toBe(initialsForNameWithTitles[i]);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
it("returns initials when there's a coma", () => {
|
|
75
|
+
expect(getInitials('Second, First')).toEqual('SF');
|
|
76
|
+
});
|
|
77
|
+
// Unit tests from Web
|
|
78
|
+
it('handles null inputs', () => {
|
|
79
|
+
expect(getInitials(null)).toEqual('');
|
|
80
|
+
expect(getInitials(undefined)).toEqual('');
|
|
81
|
+
});
|
|
82
|
+
it('calculates an expected initials in LTR with a hypen', () => {
|
|
83
|
+
expect(getInitials('David Zearing-Goff')).toEqual('DZ');
|
|
84
|
+
});
|
|
85
|
+
it('calculates an expected initials in LTR with numbers', () => {
|
|
86
|
+
expect(getInitials('4lex 5loo')).toEqual('LL');
|
|
87
|
+
});
|
|
88
|
+
it('calculates an expected initials in LTR with multiple parentheses, extra spaces, and unwanted characters', () => {
|
|
89
|
+
const result = getInitials(' !@#$%^&*()=+ (Alpha) David (The man) `~<>,./?[]{}| Goff (Gamma) ');
|
|
90
|
+
expect(result).toEqual('DG');
|
|
91
|
+
});
|
|
92
|
+
it('calculates an expected initials in LTR with multiple types of unwanted text', () => {
|
|
93
|
+
const result = getInitials(" !@#$%^&*()=+ (Alpha) /David (The man) `~<>,./?[]{}| 'Goff (Gamma) [Beta] ");
|
|
94
|
+
expect(result).toEqual('DG');
|
|
95
|
+
});
|
|
96
|
+
it('calculates an expected initials for Arabic names', () => {
|
|
97
|
+
expect(getInitials('خسرو رحیمی')).toEqual('خ');
|
|
98
|
+
});
|
|
99
|
+
it('calculates an expected initials for Chinese names', () => {
|
|
100
|
+
expect(getInitials('桂英')).toEqual('桂');
|
|
101
|
+
expect(getInitials('佳')).toEqual('佳');
|
|
102
|
+
expect(getInitials('宋智洋')).toEqual('宋');
|
|
103
|
+
});
|
|
104
|
+
it('calculates an expected initials for Korean names', () => {
|
|
105
|
+
expect(getInitials('강현')).toEqual('강');
|
|
106
|
+
expect(getInitials('최종래')).toEqual('최');
|
|
107
|
+
expect(getInitials('남궁 성종')).toEqual('남');
|
|
108
|
+
});
|
|
109
|
+
it('calculates an expected initials for Japanese names', () => {
|
|
110
|
+
expect(getInitials('松田')).toEqual('松');
|
|
111
|
+
expect(getInitials('海野')).toEqual('海');
|
|
112
|
+
expect(getInitials('かり')).toEqual('か');
|
|
113
|
+
});
|
|
114
|
+
it('validates phone numbers', () => {
|
|
115
|
+
expect(getInitials('12345678')).toEqual('');
|
|
116
|
+
// expect(getInitials('+1 (555) 123-4567 ext.4567')).toEqual('');
|
|
117
|
+
expect(getInitials('+47 12 34 56 78 (X 5678)')).toEqual('');
|
|
118
|
+
expect(getInitials('47 12 34')).toEqual('');
|
|
119
|
+
expect(getInitials('47 12')).toEqual('');
|
|
120
|
+
|
|
121
|
+
expect(getInitials('James Ext 2')).toEqual('JE');
|
|
122
|
+
// expect(getInitials('1 Ext 2')).toEqual('');
|
|
123
|
+
// expect(getInitials('1x1')).toEqual('');
|
|
124
|
+
result = getInitials('1');
|
|
125
|
+
expect(result).toEqual('');
|
|
126
|
+
result = getInitials('A 2');
|
|
127
|
+
expect(result).toEqual('A');
|
|
128
|
+
});
|
|
129
|
+
});
|
|
File without changes
|
package/src/index.ts
CHANGED