@fluentui-react-native/callout 0.27.17 → 0.28.0
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.md +49 -2
- package/lib/Callout.d.ts +8 -2
- package/lib/Callout.d.ts.map +1 -1
- package/lib/Callout.js +53 -56
- package/lib/Callout.js.map +1 -1
- package/lib/Callout.settings.d.ts +1 -1
- package/lib/Callout.settings.js +12 -12
- package/lib/Callout.settings.macos.d.ts +1 -1
- package/lib/Callout.settings.macos.js +15 -15
- package/lib/Callout.types.d.ts +210 -163
- package/lib/Callout.types.d.ts.map +1 -1
- package/lib/Callout.types.js +1 -1
- package/lib/CalloutNativeComponent.d.ts +2 -45
- package/lib/CalloutNativeComponent.d.ts.map +1 -1
- package/lib/CalloutNativeComponent.js +2 -7
- package/lib/CalloutNativeComponent.js.map +1 -1
- package/lib/CalloutNativeComponent.macos.d.ts +5 -0
- package/lib/CalloutNativeComponent.macos.d.ts.map +1 -0
- package/lib/CalloutNativeComponent.macos.js +9 -0
- package/lib/CalloutNativeComponent.macos.js.map +1 -0
- package/lib/CalloutNativeComponent.types.d.ts +30 -0
- package/lib/CalloutNativeComponent.types.d.ts.map +1 -0
- package/lib/CalloutNativeComponent.types.js +2 -0
- package/lib/CalloutNativeComponent.types.js.map +1 -0
- package/lib/CalloutNativeComponent.types.macos.d.ts +29 -0
- package/lib/CalloutNativeComponent.types.macos.d.ts.map +1 -0
- package/lib/CalloutNativeComponent.types.macos.js +2 -0
- package/lib/CalloutNativeComponent.types.macos.js.map +1 -0
- package/lib/CalloutNativeComponent.win32.d.ts +5 -0
- package/lib/CalloutNativeComponent.win32.d.ts.map +1 -0
- package/lib/CalloutNativeComponent.win32.js +8 -0
- package/lib/CalloutNativeComponent.win32.js.map +1 -0
- package/lib/__tests__/Callout.test.d.ts +1 -1
- package/lib/__tests__/Callout.test.js +8 -4
- package/lib/__tests__/Callout.test.js.map +1 -1
- package/lib/index.d.ts +12 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib-commonjs/Callout.d.ts +8 -2
- package/lib-commonjs/Callout.d.ts.map +1 -1
- package/lib-commonjs/Callout.js +116 -90
- package/lib-commonjs/Callout.js.map +1 -1
- package/lib-commonjs/Callout.settings.d.ts +1 -1
- package/lib-commonjs/Callout.settings.js +15 -15
- package/lib-commonjs/Callout.settings.macos.d.ts +1 -1
- package/lib-commonjs/Callout.settings.macos.js +18 -18
- package/lib-commonjs/Callout.types.d.ts +210 -163
- package/lib-commonjs/Callout.types.d.ts.map +1 -1
- package/lib-commonjs/Callout.types.js +3 -3
- package/lib-commonjs/CalloutNativeComponent.d.ts +2 -45
- package/lib-commonjs/CalloutNativeComponent.d.ts.map +1 -1
- package/lib-commonjs/CalloutNativeComponent.js +11 -14
- package/lib-commonjs/CalloutNativeComponent.js.map +1 -1
- package/lib-commonjs/CalloutNativeComponent.macos.d.ts +5 -0
- package/lib-commonjs/CalloutNativeComponent.macos.d.ts.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.macos.js +17 -0
- package/lib-commonjs/CalloutNativeComponent.macos.js.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.types.d.ts +30 -0
- package/lib-commonjs/CalloutNativeComponent.types.d.ts.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.types.js +3 -0
- package/lib-commonjs/CalloutNativeComponent.types.js.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts +29 -0
- package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.types.macos.js +3 -0
- package/lib-commonjs/CalloutNativeComponent.types.macos.js.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.win32.d.ts +5 -0
- package/lib-commonjs/CalloutNativeComponent.win32.d.ts.map +1 -0
- package/lib-commonjs/CalloutNativeComponent.win32.js +16 -0
- package/lib-commonjs/CalloutNativeComponent.win32.js.map +1 -0
- package/lib-commonjs/__tests__/Callout.test.d.ts +1 -1
- package/lib-commonjs/__tests__/Callout.test.js +62 -31
- package/lib-commonjs/__tests__/Callout.test.js.map +1 -1
- package/lib-commonjs/index.d.ts +12 -3
- package/lib-commonjs/index.d.ts.map +1 -1
- package/lib-commonjs/index.js +17 -7
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +63 -62
- package/src/Callout.tsx +3 -11
- package/src/Callout.types.ts +35 -2
- package/src/CalloutNativeComponent.macos.ts +12 -0
- package/src/CalloutNativeComponent.ts +1 -62
- package/src/CalloutNativeComponent.types.macos.ts +31 -0
- package/src/CalloutNativeComponent.types.ts +31 -0
- package/src/CalloutNativeComponent.win32.ts +11 -0
- package/src/__tests__/Callout.test.tsx +6 -3
- package/src/index.ts +1 -1
- package/lib/CalloutNativeCommands.types.d.ts +0 -5
- package/lib/CalloutNativeCommands.types.d.ts.map +0 -1
- package/lib/CalloutNativeCommands.types.js +0 -2
- package/lib/CalloutNativeCommands.types.js.map +0 -1
- package/lib/MacOSCalloutNativeComponent.d.ts +0 -47
- package/lib/MacOSCalloutNativeComponent.d.ts.map +0 -1
- package/lib/MacOSCalloutNativeComponent.js +0 -12
- package/lib/MacOSCalloutNativeComponent.js.map +0 -1
- package/lib-commonjs/CalloutNativeCommands.types.d.ts +0 -5
- package/lib-commonjs/CalloutNativeCommands.types.d.ts.map +0 -1
- package/lib-commonjs/CalloutNativeCommands.types.js +0 -3
- package/lib-commonjs/CalloutNativeCommands.types.js.map +0 -1
- package/lib-commonjs/MacOSCalloutNativeComponent.d.ts +0 -47
- package/lib-commonjs/MacOSCalloutNativeComponent.d.ts.map +0 -1
- package/lib-commonjs/MacOSCalloutNativeComponent.js +0 -18
- package/lib-commonjs/MacOSCalloutNativeComponent.js.map +0 -1
- package/src/CalloutNativeCommands.types.ts +0 -4
- package/src/MacOSCalloutNativeComponent.ts +0 -66
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutNativeComponent.types.macos.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.types.macos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD,eAAe,CAAC,EAAE,WAAW,CACzB,aAAa,GACb,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,WAAW,GACX,cAAc,GACd,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,iBAAiB,EACnB,aAAa,CACd,CAAC;IACF,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAGD,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAC9D,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;IACvE,UAAU,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;CACvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutNativeComponent.types.macos.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.types.macos.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
2
|
+
export declare const Commands: CalloutNativeCommands;
|
|
3
|
+
declare const _default: CalloutComponentType;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=CalloutNativeComponent.win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutNativeComponent.win32.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.win32.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE/G,eAAO,MAAM,QAAQ,EAAE,qBAErB,CAAC;;AAGH,wBAAyF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 });
|
|
8
|
+
exports.Commands = void 0;
|
|
9
|
+
const codegenNativeCommands_1 = __importDefault(require('react-native/Libraries/Utilities/codegenNativeCommands'));
|
|
10
|
+
const react_native_1 = require('react-native');
|
|
11
|
+
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
12
|
+
supportedCommands: ['blurWindow', 'focusWindow'],
|
|
13
|
+
});
|
|
14
|
+
// no fabric for Win32, just use requireNativeComponent
|
|
15
|
+
exports.default = (0, react_native_1.requireNativeComponent)('RCTCallout');
|
|
16
|
+
//# sourceMappingURL=CalloutNativeComponent.win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CalloutNativeComponent.win32.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.win32.ts"],"names":[],"mappings":";;;;;;AAAA,mHAA2F;AAC3F,+CAAsD;AAIzC,QAAA,QAAQ,GAA0B,IAAA,+BAAqB,EAAwB;IAC1F,iBAAiB,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;CACjD,CAAC,CAAC;AAEH,uDAAuD;kBACxC,IAAA,qCAAsB,EAAc,YAAY,CAAyB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=Callout.test.d.ts.map
|
|
2
|
+
//# sourceMappingURL=Callout.test.d.ts.map
|
|
@@ -1,33 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
var __createBinding =
|
|
3
|
+
(this && this.__createBinding) ||
|
|
4
|
+
(Object.create
|
|
5
|
+
? function (o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return m[k];
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
Object.defineProperty(o, k2, desc);
|
|
17
|
+
}
|
|
18
|
+
: function (o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
});
|
|
22
|
+
var __setModuleDefault =
|
|
23
|
+
(this && this.__setModuleDefault) ||
|
|
24
|
+
(Object.create
|
|
25
|
+
? function (o, v) {
|
|
26
|
+
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
27
|
+
}
|
|
28
|
+
: function (o, v) {
|
|
29
|
+
o['default'] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar =
|
|
32
|
+
(this && this.__importStar) ||
|
|
33
|
+
(function () {
|
|
34
|
+
var ownKeys = function (o) {
|
|
35
|
+
ownKeys =
|
|
36
|
+
Object.getOwnPropertyNames ||
|
|
37
|
+
function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
53
|
+
const jsx_runtime_1 = require('react/jsx-runtime');
|
|
54
|
+
const react_1 = require('react');
|
|
55
|
+
const renderer = __importStar(require('react-test-renderer'));
|
|
56
|
+
const __1 = require('..');
|
|
29
57
|
it('Callout default props', () => {
|
|
30
|
-
|
|
31
|
-
|
|
58
|
+
let component;
|
|
59
|
+
(0, react_1.act)(() => {
|
|
60
|
+
component = renderer.create(jsx_runtime_1.jsx(__1.Callout, {}));
|
|
61
|
+
});
|
|
62
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
32
63
|
});
|
|
33
|
-
//# sourceMappingURL=Callout.test.js.map
|
|
64
|
+
//# sourceMappingURL=Callout.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA4B;AAE5B,MAAY,QAAQ,gDAA4B;AAEhD,0BAA6B;AAE7B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC;IAChC,IAAI,SAAqC,CAAC;IAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,WAAO,KAAG,CAAC,CAAC;IAAA,CAC1C,CAAC,CAAC;IACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;AAAA,CAC/C,CAAC,CAAC"}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export { calloutName } from './Callout.types';
|
|
2
|
-
export type {
|
|
3
|
-
|
|
2
|
+
export type {
|
|
3
|
+
DirectionalHint,
|
|
4
|
+
DismissBehaviors,
|
|
5
|
+
ICalloutProps,
|
|
6
|
+
ICalloutRenderData,
|
|
7
|
+
ICalloutSlotProps,
|
|
8
|
+
ICalloutTokens,
|
|
9
|
+
ICalloutType,
|
|
10
|
+
RestoreFocusEvent,
|
|
11
|
+
} from './Callout.types';
|
|
12
|
+
export type { CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
4
13
|
export { Callout } from './Callout';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,qBAAqB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
3
|
exports.Callout = exports.calloutName = void 0;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const Callout_types_1 = require('./Callout.types');
|
|
5
|
+
Object.defineProperty(exports, 'calloutName', {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function () {
|
|
8
|
+
return Callout_types_1.calloutName;
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
const Callout_1 = require('./Callout');
|
|
12
|
+
Object.defineProperty(exports, 'Callout', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return Callout_1.Callout;
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# 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,mDAA8C;AAArC,4GAAA,WAAW,OAAA;AAYpB,uCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,97 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-react-native/callout",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "A cross-platform Callout component using the Fluent Design System",
|
|
5
|
+
"homepage": "https://github.com/microsoft/fluentui-react-native",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
9
|
+
"directory": "packages/components/Callout"
|
|
10
|
+
},
|
|
5
11
|
"license": "MIT",
|
|
6
12
|
"author": "",
|
|
7
|
-
"homepage": "https://github.com/microsoft/fluentui-react-native",
|
|
8
|
-
"main": "lib-commonjs/index.js",
|
|
9
|
-
"module": "lib/index.js",
|
|
10
|
-
"react-native": "src/index.ts",
|
|
11
13
|
"exports": {
|
|
12
14
|
".": {
|
|
15
|
+
"types": "./lib/index.d.ts",
|
|
13
16
|
"import": "./lib/index.js",
|
|
14
|
-
"require": "./lib-commonjs/index.js"
|
|
15
|
-
"types": "./lib/index.d.ts"
|
|
17
|
+
"require": "./lib-commonjs/index.js"
|
|
16
18
|
}
|
|
17
19
|
},
|
|
18
|
-
"
|
|
20
|
+
"main": "lib-commonjs/index.js",
|
|
21
|
+
"module": "lib/index.js",
|
|
22
|
+
"types": "lib/index.d.ts",
|
|
19
23
|
"scripts": {
|
|
20
24
|
"build": "fluentui-scripts build",
|
|
25
|
+
"build-cjs": "tsgo --outDir lib-commonjs",
|
|
26
|
+
"build-esm": "tsgo --outDir lib --module esnext --moduleResolution bundler",
|
|
21
27
|
"clean": "fluentui-scripts clean",
|
|
22
28
|
"depcheck": "fluentui-scripts depcheck",
|
|
23
|
-
"just": "fluentui-scripts",
|
|
24
29
|
"lint": "fluentui-scripts eslint",
|
|
25
|
-
"
|
|
26
|
-
"update-snapshots": "fluentui-scripts jest -u",
|
|
30
|
+
"lint-package": "fluentui-scripts lint-package",
|
|
27
31
|
"prettier": "fluentui-scripts prettier",
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "https://github.com/microsoft/fluentui-react-native.git",
|
|
33
|
-
"directory": "packages/components/Callout"
|
|
32
|
+
"test": "fluentui-scripts jest",
|
|
33
|
+
"update-snapshots": "fluentui-scripts jest -u"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@fluentui-react-native/adapters": "0.
|
|
37
|
-
"@fluentui-react-native/tokens": "0.
|
|
38
|
-
"@uifabricshared/foundation-composable": "0.
|
|
39
|
-
"@uifabricshared/foundation-compose": "1.
|
|
40
|
-
"@uifabricshared/foundation-settings": "0.
|
|
36
|
+
"@fluentui-react-native/adapters": "0.14.0",
|
|
37
|
+
"@fluentui-react-native/tokens": "0.24.0",
|
|
38
|
+
"@uifabricshared/foundation-composable": "0.14.0",
|
|
39
|
+
"@uifabricshared/foundation-compose": "1.16.0",
|
|
40
|
+
"@uifabricshared/foundation-settings": "0.16.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@babel/core": "^7.20.0",
|
|
44
44
|
"@fluentui-react-native/babel-config": "0.1.1",
|
|
45
45
|
"@fluentui-react-native/eslint-config-rules": "0.1.1",
|
|
46
46
|
"@fluentui-react-native/jest-config": "0.1.1",
|
|
47
|
-
"@fluentui-react-native/
|
|
47
|
+
"@fluentui-react-native/kit-config": "0.1.2",
|
|
48
|
+
"@fluentui-react-native/scripts": "0.1.2",
|
|
48
49
|
"@office-iss/react-native-win32": "^0.74.0",
|
|
49
|
-
"@react-native/
|
|
50
|
-
"@react-native/
|
|
51
|
-
"@
|
|
52
|
-
"react": "
|
|
53
|
-
"react-native": "^0.
|
|
54
|
-
"react
|
|
55
|
-
"react-
|
|
56
|
-
"react
|
|
50
|
+
"@react-native-community/cli": "^20.0.0",
|
|
51
|
+
"@react-native-community/cli-platform-android": "^20.0.0",
|
|
52
|
+
"@react-native-community/cli-platform-ios": "^20.0.0",
|
|
53
|
+
"@react-native/babel-preset": "^0.81.0",
|
|
54
|
+
"@react-native/metro-config": "^0.81.0",
|
|
55
|
+
"@types/react": "~19.1.0",
|
|
56
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
57
|
+
"react": "19.1.0",
|
|
58
|
+
"react-native": "^0.81.0",
|
|
59
|
+
"react-native-macos": "^0.81.0",
|
|
60
|
+
"react-native-windows": "^0.81.0",
|
|
61
|
+
"react-test-renderer": "19.1.0"
|
|
57
62
|
},
|
|
58
63
|
"peerDependencies": {
|
|
59
64
|
"@office-iss/react-native-win32": "^0.74.0",
|
|
60
|
-
"react": "18.2.0",
|
|
61
|
-
"react
|
|
62
|
-
"react-native
|
|
63
|
-
"react-native-
|
|
64
|
-
|
|
65
|
-
"rnx-kit": {
|
|
66
|
-
"kitType": "library",
|
|
67
|
-
"alignDeps": {
|
|
68
|
-
"presets": [
|
|
69
|
-
"microsoft/react-native"
|
|
70
|
-
],
|
|
71
|
-
"requirements": {
|
|
72
|
-
"development": [
|
|
73
|
-
"react-native@0.74"
|
|
74
|
-
],
|
|
75
|
-
"production": [
|
|
76
|
-
"react-native@0.73 || 0.74"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
|
-
"capabilities": [
|
|
80
|
-
"babel-preset-react-native",
|
|
81
|
-
"core",
|
|
82
|
-
"core-android",
|
|
83
|
-
"core-ios",
|
|
84
|
-
"core-macos",
|
|
85
|
-
"core-windows",
|
|
86
|
-
"react",
|
|
87
|
-
"react-test-renderer"
|
|
88
|
-
]
|
|
89
|
-
}
|
|
65
|
+
"@types/react": "~18.2.0 || ~19.0.0 || ~19.1.0",
|
|
66
|
+
"react": "18.2.0 || 19.0.0 || 19.1.0",
|
|
67
|
+
"react-native": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
68
|
+
"react-native-macos": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0",
|
|
69
|
+
"react-native-windows": "^0.73.0 || ^0.74.0 || ^0.78.0 || ^0.81.0"
|
|
90
70
|
},
|
|
91
71
|
"peerDependenciesMeta": {
|
|
92
72
|
"@office-iss/react-native-win32": {
|
|
93
73
|
"optional": true
|
|
94
74
|
},
|
|
75
|
+
"@types/react": {
|
|
76
|
+
"optional": true
|
|
77
|
+
},
|
|
95
78
|
"react-native-macos": {
|
|
96
79
|
"optional": true
|
|
97
80
|
},
|
|
@@ -103,5 +86,23 @@
|
|
|
103
86
|
"name": "FRNCalloutSpec",
|
|
104
87
|
"type": "components",
|
|
105
88
|
"jsSrcsDir": "lib"
|
|
89
|
+
},
|
|
90
|
+
"rnx-kit": {
|
|
91
|
+
"kitType": "library",
|
|
92
|
+
"alignDeps": {
|
|
93
|
+
"capabilities": [
|
|
94
|
+
"babel-preset-react-native",
|
|
95
|
+
"core",
|
|
96
|
+
"core-android",
|
|
97
|
+
"core-ios",
|
|
98
|
+
"core-macos",
|
|
99
|
+
"core-windows",
|
|
100
|
+
"react",
|
|
101
|
+
"react-test-renderer",
|
|
102
|
+
"tools-core",
|
|
103
|
+
"tools-jest"
|
|
104
|
+
]
|
|
105
|
+
},
|
|
106
|
+
"extends": "@fluentui-react-native/kit-config"
|
|
106
107
|
}
|
|
107
|
-
}
|
|
108
|
+
}
|
package/src/Callout.tsx
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as React from 'react';
|
|
8
|
-
import { findNodeHandle
|
|
9
|
-
import type { HostComponent } from 'react-native';
|
|
8
|
+
import { findNodeHandle } from 'react-native';
|
|
10
9
|
|
|
11
10
|
import { backgroundColorTokens, borderTokens } from '@fluentui-react-native/tokens';
|
|
12
11
|
import type { IUseComposeStyling } from '@uifabricshared/foundation-compose';
|
|
@@ -16,16 +15,9 @@ import { mergeSettings } from '@uifabricshared/foundation-settings';
|
|
|
16
15
|
import { settings } from './Callout.settings';
|
|
17
16
|
import type { ICalloutProps, ICalloutSlotProps, ICalloutType } from './Callout.types';
|
|
18
17
|
import { calloutName } from './Callout.types';
|
|
19
|
-
import type { NativeProps as CalloutNativeProps } from './CalloutNativeComponent';
|
|
20
|
-
import CalloutNativeComponent from './CalloutNativeComponent';
|
|
21
|
-
import type { NativeProps as FRNCalloutNativeProps } from './MacOSCalloutNativeComponent';
|
|
22
|
-
import FRNCalloutNativeComponent from './MacOSCalloutNativeComponent';
|
|
23
|
-
import { Commands } from './MacOSCalloutNativeComponent';
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
default: CalloutNativeComponent, // win32
|
|
28
|
-
});
|
|
19
|
+
import NativeCalloutView from './CalloutNativeComponent';
|
|
20
|
+
import { Commands } from './CalloutNativeComponent';
|
|
29
21
|
|
|
30
22
|
export const Callout = compose<ICalloutType>({
|
|
31
23
|
displayName: calloutName,
|
package/src/Callout.types.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
|
-
import type { KeyboardMetrics, ViewStyle } from 'react-native';
|
|
2
|
+
import type { KeyboardMetrics, ViewStyle, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
5
5
|
import type { IBackgroundColorTokens, IBorderTokens } from '@fluentui-react-native/tokens';
|
|
6
6
|
import type { IRenderData } from '@uifabricshared/foundation-composable';
|
|
7
7
|
|
|
8
|
-
import type { CalloutNativeCommands } from './
|
|
8
|
+
import type { CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
9
9
|
export const calloutName = 'Callout';
|
|
10
10
|
|
|
11
|
+
import type { DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* Properties and Tokens for FluentUI React Native Callout
|
|
13
15
|
*/
|
|
@@ -225,3 +227,34 @@ export interface ICalloutType {
|
|
|
225
227
|
slotProps: ICalloutSlotProps;
|
|
226
228
|
tokens: ICalloutTokens;
|
|
227
229
|
}
|
|
230
|
+
|
|
231
|
+
type AnchorRect = {
|
|
232
|
+
screenX: Double;
|
|
233
|
+
screenY: Double;
|
|
234
|
+
width: Double;
|
|
235
|
+
height: Double;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Shared native props specific to Callout native component
|
|
240
|
+
*/
|
|
241
|
+
export interface NativePropsBase extends ViewProps {
|
|
242
|
+
accessibilityLabel?: string;
|
|
243
|
+
accessibilityOnShowAnnouncement?: string;
|
|
244
|
+
anchorRect?: AnchorRect;
|
|
245
|
+
|
|
246
|
+
dismissBehaviors?: string[];
|
|
247
|
+
doNotTakePointerCapture?: boolean;
|
|
248
|
+
focusable?: boolean;
|
|
249
|
+
isBeakVisible?: boolean;
|
|
250
|
+
maxHeight?: Int32;
|
|
251
|
+
maxWidth?: Int32;
|
|
252
|
+
setInitialFocus?: boolean;
|
|
253
|
+
|
|
254
|
+
// targetAnchor?: string; // Win32 only Callout can target an anchor registered in the anchor registry // Can be a node id or an anchor ID - This need to be reworked as Mixed types are not supported going forward
|
|
255
|
+
testID?: string;
|
|
256
|
+
|
|
257
|
+
onRestoreFocus?: DirectEventHandler<{ target: Int32; containsFocus: boolean }>;
|
|
258
|
+
onDismiss?: DirectEventHandler<{ target: Int32 }>;
|
|
259
|
+
onShow?: DirectEventHandler<{ target: Int32 }>;
|
|
260
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
2
|
+
import { requireNativeComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { NativeProps, CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types.macos';
|
|
5
|
+
|
|
6
|
+
export const Commands: CalloutNativeCommands = codegenNativeCommands<CalloutNativeCommands>({
|
|
7
|
+
supportedCommands: ['blurWindow', 'focusWindow'],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// no fabric for macOS, just use requireNativeComponent
|
|
11
|
+
// macOS uses FRNCallout (registered by FRNCalloutManager), not RCTCallout
|
|
12
|
+
export default requireNativeComponent<NativeProps>('FRNCallout') as CalloutComponentType;
|
|
@@ -1,68 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
* @format
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { HostComponent, ViewProps } from 'react-native';
|
|
8
|
-
|
|
9
|
-
import type { WithDefault, DirectEventHandler, Double, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
10
1
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
11
2
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
12
3
|
|
|
13
|
-
import type {
|
|
14
|
-
// Should be:
|
|
15
|
-
// import type {UnsafeMixed} from 'react-native/Libraries/Types/CodegenTypes';
|
|
16
|
-
|
|
17
|
-
type AnchorRect = {
|
|
18
|
-
screenX: Double;
|
|
19
|
-
screenY: Double;
|
|
20
|
-
width: Double;
|
|
21
|
-
height: Double;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export interface NativeProps extends ViewProps {
|
|
25
|
-
accessibilityLabel?: string;
|
|
26
|
-
accessibilityOnShowAnnouncement?: string;
|
|
27
|
-
anchorRect?: AnchorRect;
|
|
28
|
-
directionalHint?: WithDefault<
|
|
29
|
-
| 'leftTopEdge'
|
|
30
|
-
| 'leftCenter'
|
|
31
|
-
| 'leftBottomEdge'
|
|
32
|
-
| 'topLeftEdge'
|
|
33
|
-
| 'topAutoEdge'
|
|
34
|
-
| 'topCenter'
|
|
35
|
-
| 'topRightEdge'
|
|
36
|
-
| 'rightTopEdge'
|
|
37
|
-
| 'rightCenter'
|
|
38
|
-
| 'rightBottomEdge'
|
|
39
|
-
| 'bottonLeftEdge'
|
|
40
|
-
| 'bottomAutoEdge'
|
|
41
|
-
| 'bottomCenter'
|
|
42
|
-
| 'bottomRightEdge',
|
|
43
|
-
'bottonLeftEdge'
|
|
44
|
-
>;
|
|
45
|
-
dismissBehaviors?: string[];
|
|
46
|
-
doNotTakePointerCapture?: boolean;
|
|
47
|
-
focusable?: boolean;
|
|
48
|
-
isBeakVisible?: boolean;
|
|
49
|
-
maxHeight?: Int32;
|
|
50
|
-
maxWidth?: Int32;
|
|
51
|
-
setInitialFocus?: boolean;
|
|
52
|
-
target?: UnsafeMixed;
|
|
53
|
-
// targetAnchor?: string; // Win32 only Callout can target an anchor registered in the anchor registry // Can be a node id or an anchor ID - This need to be reworked as Mixed types are not supported going forward
|
|
54
|
-
testID?: string;
|
|
55
|
-
|
|
56
|
-
onRestoreFocus?: DirectEventHandler<{ target: Int32; containsFocus: boolean }>;
|
|
57
|
-
onDismiss?: DirectEventHandler<{ target: Int32 }>;
|
|
58
|
-
onShow?: DirectEventHandler<{ target: Int32 }>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export type CalloutComponentType = HostComponent<NativeProps>;
|
|
62
|
-
export interface CalloutNativeCommands {
|
|
63
|
-
focusWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
64
|
-
blurWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
65
|
-
}
|
|
4
|
+
import type { NativeProps, CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
66
5
|
|
|
67
6
|
export const Commands: CalloutNativeCommands = codegenNativeCommands<CalloutNativeCommands>({
|
|
68
7
|
supportedCommands: ['blurWindow', 'focusWindow'],
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { WithDefault, Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import type { NativePropsBase } from './Callout.types';
|
|
4
|
+
|
|
5
|
+
export interface NativeProps extends NativePropsBase {
|
|
6
|
+
directionalHint?: WithDefault<
|
|
7
|
+
| 'leftTopEdge'
|
|
8
|
+
| 'leftCenter'
|
|
9
|
+
| 'leftBottomEdge'
|
|
10
|
+
| 'topLeftEdge'
|
|
11
|
+
| 'topAutoEdge'
|
|
12
|
+
| 'topCenter'
|
|
13
|
+
| 'topRightEdge'
|
|
14
|
+
| 'rightTopEdge'
|
|
15
|
+
| 'rightCenter'
|
|
16
|
+
| 'rightBottomEdge'
|
|
17
|
+
| 'bottonLeftEdge'
|
|
18
|
+
| 'bottomAutoEdge'
|
|
19
|
+
| 'bottomCenter'
|
|
20
|
+
| 'bottomRightEdge',
|
|
21
|
+
'topLeftEdge'
|
|
22
|
+
>;
|
|
23
|
+
target?: Int32;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// making these explicit as codegen can't always handle complex typescript types and fails silently
|
|
27
|
+
export type CalloutComponentType = HostComponent<NativeProps>;
|
|
28
|
+
export type CalloutNativeCommands = {
|
|
29
|
+
focusWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
30
|
+
blurWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HostComponent } from 'react-native';
|
|
2
|
+
import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import type { UnsafeMixed } from './codegenTypes';
|
|
4
|
+
import type { NativePropsBase } from './Callout.types';
|
|
5
|
+
|
|
6
|
+
export interface NativeProps extends NativePropsBase {
|
|
7
|
+
directionalHint?: WithDefault<
|
|
8
|
+
| 'leftTopEdge'
|
|
9
|
+
| 'leftCenter'
|
|
10
|
+
| 'leftBottomEdge'
|
|
11
|
+
| 'topLeftEdge'
|
|
12
|
+
| 'topAutoEdge'
|
|
13
|
+
| 'topCenter'
|
|
14
|
+
| 'topRightEdge'
|
|
15
|
+
| 'rightTopEdge'
|
|
16
|
+
| 'rightCenter'
|
|
17
|
+
| 'rightBottomEdge'
|
|
18
|
+
| 'bottonLeftEdge'
|
|
19
|
+
| 'bottomAutoEdge'
|
|
20
|
+
| 'bottomCenter'
|
|
21
|
+
| 'bottomRightEdge',
|
|
22
|
+
'bottonLeftEdge'
|
|
23
|
+
>;
|
|
24
|
+
target?: UnsafeMixed;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type CalloutComponentType = HostComponent<NativeProps>;
|
|
28
|
+
export type CalloutNativeCommands = {
|
|
29
|
+
focusWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
30
|
+
blurWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
2
|
+
import { requireNativeComponent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { NativeProps, CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
5
|
+
|
|
6
|
+
export const Commands: CalloutNativeCommands = codegenNativeCommands<CalloutNativeCommands>({
|
|
7
|
+
supportedCommands: ['blurWindow', 'focusWindow'],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// no fabric for Win32, just use requireNativeComponent
|
|
11
|
+
export default requireNativeComponent<NativeProps>('RCTCallout') as CalloutComponentType;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { act } from 'react';
|
|
2
2
|
|
|
3
3
|
import * as renderer from 'react-test-renderer';
|
|
4
4
|
|
|
5
5
|
import { Callout } from '..';
|
|
6
6
|
|
|
7
7
|
it('Callout default props', () => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
let component: renderer.ReactTestRenderer;
|
|
9
|
+
act(() => {
|
|
10
|
+
component = renderer.create(<Callout />);
|
|
11
|
+
});
|
|
12
|
+
expect(component!.toJSON()).toMatchSnapshot();
|
|
10
13
|
});
|
package/src/index.ts
CHANGED
|
@@ -9,5 +9,5 @@ export type {
|
|
|
9
9
|
ICalloutType,
|
|
10
10
|
RestoreFocusEvent,
|
|
11
11
|
} from './Callout.types';
|
|
12
|
-
export type { CalloutNativeCommands } from './
|
|
12
|
+
export type { CalloutNativeCommands } from './CalloutNativeComponent.types';
|
|
13
13
|
export { Callout } from './Callout';
|