@fluentui-react-native/callout 0.27.16 → 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.
Files changed (104) hide show
  1. package/CHANGELOG.md +49 -2
  2. package/lib/Callout.d.ts +8 -2
  3. package/lib/Callout.d.ts.map +1 -1
  4. package/lib/Callout.js +53 -56
  5. package/lib/Callout.js.map +1 -1
  6. package/lib/Callout.settings.d.ts +1 -1
  7. package/lib/Callout.settings.js +12 -12
  8. package/lib/Callout.settings.macos.d.ts +1 -1
  9. package/lib/Callout.settings.macos.js +15 -15
  10. package/lib/Callout.types.d.ts +210 -163
  11. package/lib/Callout.types.d.ts.map +1 -1
  12. package/lib/Callout.types.js +1 -1
  13. package/lib/CalloutNativeComponent.d.ts +2 -45
  14. package/lib/CalloutNativeComponent.d.ts.map +1 -1
  15. package/lib/CalloutNativeComponent.js +2 -7
  16. package/lib/CalloutNativeComponent.js.map +1 -1
  17. package/lib/CalloutNativeComponent.macos.d.ts +5 -0
  18. package/lib/CalloutNativeComponent.macos.d.ts.map +1 -0
  19. package/lib/CalloutNativeComponent.macos.js +9 -0
  20. package/lib/CalloutNativeComponent.macos.js.map +1 -0
  21. package/lib/CalloutNativeComponent.types.d.ts +30 -0
  22. package/lib/CalloutNativeComponent.types.d.ts.map +1 -0
  23. package/lib/CalloutNativeComponent.types.js +2 -0
  24. package/lib/CalloutNativeComponent.types.js.map +1 -0
  25. package/lib/CalloutNativeComponent.types.macos.d.ts +29 -0
  26. package/lib/CalloutNativeComponent.types.macos.d.ts.map +1 -0
  27. package/lib/CalloutNativeComponent.types.macos.js +2 -0
  28. package/lib/CalloutNativeComponent.types.macos.js.map +1 -0
  29. package/lib/CalloutNativeComponent.win32.d.ts +5 -0
  30. package/lib/CalloutNativeComponent.win32.d.ts.map +1 -0
  31. package/lib/CalloutNativeComponent.win32.js +8 -0
  32. package/lib/CalloutNativeComponent.win32.js.map +1 -0
  33. package/lib/__tests__/Callout.test.d.ts +1 -1
  34. package/lib/__tests__/Callout.test.js +8 -4
  35. package/lib/__tests__/Callout.test.js.map +1 -1
  36. package/lib/index.d.ts +12 -3
  37. package/lib/index.d.ts.map +1 -1
  38. package/lib/index.js +1 -1
  39. package/lib-commonjs/Callout.d.ts +8 -2
  40. package/lib-commonjs/Callout.d.ts.map +1 -1
  41. package/lib-commonjs/Callout.js +116 -90
  42. package/lib-commonjs/Callout.js.map +1 -1
  43. package/lib-commonjs/Callout.settings.d.ts +1 -1
  44. package/lib-commonjs/Callout.settings.js +15 -15
  45. package/lib-commonjs/Callout.settings.macos.d.ts +1 -1
  46. package/lib-commonjs/Callout.settings.macos.js +18 -18
  47. package/lib-commonjs/Callout.types.d.ts +210 -163
  48. package/lib-commonjs/Callout.types.d.ts.map +1 -1
  49. package/lib-commonjs/Callout.types.js +3 -3
  50. package/lib-commonjs/CalloutNativeComponent.d.ts +2 -45
  51. package/lib-commonjs/CalloutNativeComponent.d.ts.map +1 -1
  52. package/lib-commonjs/CalloutNativeComponent.js +11 -14
  53. package/lib-commonjs/CalloutNativeComponent.js.map +1 -1
  54. package/lib-commonjs/CalloutNativeComponent.macos.d.ts +5 -0
  55. package/lib-commonjs/CalloutNativeComponent.macos.d.ts.map +1 -0
  56. package/lib-commonjs/CalloutNativeComponent.macos.js +17 -0
  57. package/lib-commonjs/CalloutNativeComponent.macos.js.map +1 -0
  58. package/lib-commonjs/CalloutNativeComponent.types.d.ts +30 -0
  59. package/lib-commonjs/CalloutNativeComponent.types.d.ts.map +1 -0
  60. package/lib-commonjs/CalloutNativeComponent.types.js +3 -0
  61. package/lib-commonjs/CalloutNativeComponent.types.js.map +1 -0
  62. package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts +29 -0
  63. package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts.map +1 -0
  64. package/lib-commonjs/CalloutNativeComponent.types.macos.js +3 -0
  65. package/lib-commonjs/CalloutNativeComponent.types.macos.js.map +1 -0
  66. package/lib-commonjs/CalloutNativeComponent.win32.d.ts +5 -0
  67. package/lib-commonjs/CalloutNativeComponent.win32.d.ts.map +1 -0
  68. package/lib-commonjs/CalloutNativeComponent.win32.js +16 -0
  69. package/lib-commonjs/CalloutNativeComponent.win32.js.map +1 -0
  70. package/lib-commonjs/__tests__/Callout.test.d.ts +1 -1
  71. package/lib-commonjs/__tests__/Callout.test.js +62 -31
  72. package/lib-commonjs/__tests__/Callout.test.js.map +1 -1
  73. package/lib-commonjs/index.d.ts +12 -3
  74. package/lib-commonjs/index.d.ts.map +1 -1
  75. package/lib-commonjs/index.js +17 -7
  76. package/lib-commonjs/index.js.map +1 -1
  77. package/package.json +63 -62
  78. package/src/Callout.tsx +3 -11
  79. package/src/Callout.types.ts +35 -2
  80. package/src/CalloutNativeComponent.macos.ts +12 -0
  81. package/src/CalloutNativeComponent.ts +1 -62
  82. package/src/CalloutNativeComponent.types.macos.ts +31 -0
  83. package/src/CalloutNativeComponent.types.ts +31 -0
  84. package/src/CalloutNativeComponent.win32.ts +11 -0
  85. package/src/__tests__/Callout.test.tsx +6 -3
  86. package/src/index.ts +1 -1
  87. package/lib/CalloutNativeCommands.types.d.ts +0 -5
  88. package/lib/CalloutNativeCommands.types.d.ts.map +0 -1
  89. package/lib/CalloutNativeCommands.types.js +0 -2
  90. package/lib/CalloutNativeCommands.types.js.map +0 -1
  91. package/lib/MacOSCalloutNativeComponent.d.ts +0 -47
  92. package/lib/MacOSCalloutNativeComponent.d.ts.map +0 -1
  93. package/lib/MacOSCalloutNativeComponent.js +0 -12
  94. package/lib/MacOSCalloutNativeComponent.js.map +0 -1
  95. package/lib-commonjs/CalloutNativeCommands.types.d.ts +0 -5
  96. package/lib-commonjs/CalloutNativeCommands.types.d.ts.map +0 -1
  97. package/lib-commonjs/CalloutNativeCommands.types.js +0 -3
  98. package/lib-commonjs/CalloutNativeCommands.types.js.map +0 -1
  99. package/lib-commonjs/MacOSCalloutNativeComponent.d.ts +0 -47
  100. package/lib-commonjs/MacOSCalloutNativeComponent.d.ts.map +0 -1
  101. package/lib-commonjs/MacOSCalloutNativeComponent.js +0 -18
  102. package/lib-commonjs/MacOSCalloutNativeComponent.js.map +0 -1
  103. package/src/CalloutNativeCommands.types.ts +0 -4
  104. package/src/MacOSCalloutNativeComponent.ts +0 -66
@@ -0,0 +1,8 @@
1
+ import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
2
+ import { requireNativeComponent } from 'react-native';
3
+ export const Commands = codegenNativeCommands({
4
+ supportedCommands: ['blurWindow', 'focusWindow'],
5
+ });
6
+ // no fabric for Win32, just use requireNativeComponent
7
+ export default requireNativeComponent('RCTCallout');
8
+ //# sourceMappingURL=CalloutNativeComponent.win32.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalloutNativeComponent.win32.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.win32.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD,MAAM,CAAC,MAAM,QAAQ,GAA0B,qBAAqB,CAAwB;IAC1F,iBAAiB,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;CACjD,CAAC,CAAC;AAEH,uDAAuD;AACvD,eAAe,sBAAsB,CAAc,YAAY,CAAyB,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=Callout.test.d.ts.map
2
+ //# sourceMappingURL=Callout.test.d.ts.map
@@ -1,8 +1,12 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx } from 'react/jsx-runtime';
2
+ import { act } from 'react';
2
3
  import * as renderer from 'react-test-renderer';
3
4
  import { Callout } from '..';
4
5
  it('Callout default props', () => {
5
- const tree = renderer.create(React.createElement(Callout, null)).toJSON();
6
- expect(tree).toMatchSnapshot();
6
+ let component;
7
+ act(() => {
8
+ component = renderer.create(_jsx(Callout, {}));
9
+ });
10
+ expect(component.toJSON()).toMatchSnapshot();
7
11
  });
8
- //# sourceMappingURL=Callout.test.js.map
12
+ //# sourceMappingURL=Callout.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,MAAM,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Callout.test.js","sourceRoot":"","sources":["../../src/__tests__/Callout.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC;IAChC,IAAI,SAAqC,CAAC;IAC1C,GAAG,CAAC,GAAG,EAAE,CAAC;QACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAC,OAAO,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/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  export { calloutName } from './Callout.types';
2
- export type { DirectionalHint, DismissBehaviors, ICalloutProps, ICalloutRenderData, ICalloutSlotProps, ICalloutTokens, ICalloutType, RestoreFocusEvent, } from './Callout.types';
3
- export type { CalloutNativeCommands } from './CalloutNativeCommands.types';
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,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
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/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { calloutName } from './Callout.types';
2
2
  export { Callout } from './Callout';
3
- //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -4,6 +4,12 @@
4
4
  * @format
5
5
  */
6
6
  import type { ICalloutProps, ICalloutSlotProps } from './Callout.types';
7
- export declare const Callout: import("@uifabricshared/foundation-compose").IComposeReturnType<ICalloutProps, ICalloutSlotProps, import("./Callout.types").ICalloutTokens, object, object>;
7
+ export declare const Callout: import('@uifabricshared/foundation-compose').IComposeReturnType<
8
+ ICalloutProps,
9
+ ICalloutSlotProps,
10
+ import('./Callout.types').ICalloutTokens,
11
+ object,
12
+ object
13
+ >;
8
14
  export default Callout;
9
- //# sourceMappingURL=Callout.d.ts.map
15
+ //# sourceMappingURL=Callout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../src/Callout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAgB,MAAM,iBAAiB,CAAC;AAatF,eAAO,MAAM,OAAO,6JAqDlB,CAAC;AAEH,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"Callout.d.ts","sourceRoot":"","sources":["../src/Callout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAgB,MAAM,iBAAiB,CAAC;AAMtF,eAAO,MAAM,OAAO,6JAqDlB,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -1,99 +1,125 @@
1
- "use strict";
1
+ 'use strict';
2
2
  /**
3
3
  * Copyright (c) Microsoft Corporation.
4
4
  * Licensed under the MIT License.
5
5
  * @format
6
6
  */
7
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
- if (k2 === undefined) k2 = k;
9
- var desc = Object.getOwnPropertyDescriptor(m, k);
10
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
- desc = { enumerable: true, get: function() { return m[k]; } };
12
- }
13
- Object.defineProperty(o, k2, desc);
14
- }) : (function(o, m, k, k2) {
15
- if (k2 === undefined) k2 = k;
16
- o[k2] = m[k];
17
- }));
18
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
- Object.defineProperty(o, "default", { enumerable: true, value: v });
20
- }) : function(o, v) {
21
- o["default"] = v;
22
- });
23
- var __importStar = (this && this.__importStar) || function (mod) {
24
- if (mod && mod.__esModule) return mod;
25
- var result = {};
26
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
27
- __setModuleDefault(result, mod);
28
- return result;
29
- };
30
- var __importDefault = (this && this.__importDefault) || function (mod) {
31
- return (mod && mod.__esModule) ? mod : { "default": mod };
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
7
+ var __createBinding =
8
+ (this && this.__createBinding) ||
9
+ (Object.create
10
+ ? function (o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ var desc = Object.getOwnPropertyDescriptor(m, k);
13
+ if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
14
+ desc = {
15
+ enumerable: true,
16
+ get: function () {
17
+ return m[k];
18
+ },
19
+ };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }
23
+ : function (o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ });
27
+ var __setModuleDefault =
28
+ (this && this.__setModuleDefault) ||
29
+ (Object.create
30
+ ? function (o, v) {
31
+ Object.defineProperty(o, 'default', { enumerable: true, value: v });
32
+ }
33
+ : function (o, v) {
34
+ o['default'] = v;
35
+ });
36
+ var __importStar =
37
+ (this && this.__importStar) ||
38
+ (function () {
39
+ var ownKeys = function (o) {
40
+ ownKeys =
41
+ Object.getOwnPropertyNames ||
42
+ function (o) {
43
+ var ar = [];
44
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
45
+ return ar;
46
+ };
47
+ return ownKeys(o);
48
+ };
49
+ return function (mod) {
50
+ if (mod && mod.__esModule) return mod;
51
+ var result = {};
52
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== 'default') __createBinding(result, mod, k[i]);
53
+ __setModuleDefault(result, mod);
54
+ return result;
55
+ };
56
+ })();
57
+ var __importDefault =
58
+ (this && this.__importDefault) ||
59
+ function (mod) {
60
+ return mod && mod.__esModule ? mod : { default: mod };
61
+ };
62
+ Object.defineProperty(exports, '__esModule', { value: true });
34
63
  exports.Callout = void 0;
35
- const React = __importStar(require("react"));
36
- const react_native_1 = require("react-native");
37
- const tokens_1 = require("@fluentui-react-native/tokens");
38
- const foundation_compose_1 = require("@uifabricshared/foundation-compose");
39
- const foundation_settings_1 = require("@uifabricshared/foundation-settings");
40
- const Callout_settings_1 = require("./Callout.settings");
41
- const Callout_types_1 = require("./Callout.types");
42
- const CalloutNativeComponent_1 = __importDefault(require("./CalloutNativeComponent"));
43
- const MacOSCalloutNativeComponent_1 = __importDefault(require("./MacOSCalloutNativeComponent"));
44
- const MacOSCalloutNativeComponent_2 = require("./MacOSCalloutNativeComponent");
45
- const NativeCalloutView = react_native_1.Platform.select({
46
- macos: MacOSCalloutNativeComponent_1.default,
47
- default: CalloutNativeComponent_1.default, // win32
48
- });
64
+ const React = __importStar(require('react'));
65
+ const react_native_1 = require('react-native');
66
+ const tokens_1 = require('@fluentui-react-native/tokens');
67
+ const foundation_compose_1 = require('@uifabricshared/foundation-compose');
68
+ const foundation_settings_1 = require('@uifabricshared/foundation-settings');
69
+ const Callout_settings_1 = require('./Callout.settings');
70
+ const Callout_types_1 = require('./Callout.types');
71
+ const CalloutNativeComponent_1 = __importDefault(require('./CalloutNativeComponent'));
72
+ const CalloutNativeComponent_2 = require('./CalloutNativeComponent');
49
73
  exports.Callout = (0, foundation_compose_1.compose)({
50
- displayName: Callout_types_1.calloutName,
51
- usePrepareProps: (props, useStyling) => {
52
- const { componentRef, target, ...rest } = props;
53
- React.useImperativeHandle(componentRef, () => ({
54
- blurWindow() {
55
- if (componentRef.current != null) {
56
- MacOSCalloutNativeComponent_2.Commands.blurWindow(nativeComponentRef.current);
57
- }
58
- },
59
- focusWindow() {
60
- if (componentRef.current != null) {
61
- MacOSCalloutNativeComponent_2.Commands.focusWindow(nativeComponentRef.current);
62
- }
63
- },
64
- }), [componentRef]);
65
- const nativeComponentRef = React.useRef(null);
66
- const [nativeTarget, setNativeTarget] = React.useState(null);
67
- React.useLayoutEffect(() => {
68
- if (typeof target === 'string') {
69
- // Pass string type `target` directly
70
- setNativeTarget(target);
71
- }
72
- else if (target?.current) {
73
- // Pass the tagID for a valid ref `target`
74
- setNativeTarget((0, react_native_1.findNodeHandle)(target.current));
75
- }
76
- else {
77
- // Clear `target` so we may fall back on `anchorRect` if provided
78
- setNativeTarget(null);
79
- }
80
- }, [target]);
81
- const slotProps = (0, foundation_settings_1.mergeSettings)(useStyling(props), {
82
- root: {
83
- ref: nativeComponentRef,
84
- ...(nativeTarget && { target: nativeTarget }),
85
- ...rest,
86
- },
87
- });
88
- return { slotProps };
89
- },
90
- settings: Callout_settings_1.settings,
91
- slots: {
92
- root: NativeCalloutView,
93
- },
94
- styles: {
95
- root: [tokens_1.backgroundColorTokens, tokens_1.borderTokens],
96
- },
74
+ displayName: Callout_types_1.calloutName,
75
+ usePrepareProps: (props, useStyling) => {
76
+ const { componentRef, target, ...rest } = props;
77
+ React.useImperativeHandle(
78
+ componentRef,
79
+ () => ({
80
+ blurWindow() {
81
+ if (componentRef.current != null) {
82
+ CalloutNativeComponent_2.Commands.blurWindow(nativeComponentRef.current);
83
+ }
84
+ },
85
+ focusWindow() {
86
+ if (componentRef.current != null) {
87
+ CalloutNativeComponent_2.Commands.focusWindow(nativeComponentRef.current);
88
+ }
89
+ },
90
+ }),
91
+ [componentRef],
92
+ );
93
+ const nativeComponentRef = React.useRef(null);
94
+ const [nativeTarget, setNativeTarget] = React.useState(null);
95
+ React.useLayoutEffect(() => {
96
+ if (typeof target === 'string') {
97
+ // Pass string type `target` directly
98
+ setNativeTarget(target);
99
+ } else if (target?.current) {
100
+ // Pass the tagID for a valid ref `target`
101
+ setNativeTarget((0, react_native_1.findNodeHandle)(target.current));
102
+ } else {
103
+ // Clear `target` so we may fall back on `anchorRect` if provided
104
+ setNativeTarget(null);
105
+ }
106
+ }, [target]);
107
+ const slotProps = (0, foundation_settings_1.mergeSettings)(useStyling(props), {
108
+ root: {
109
+ ref: nativeComponentRef,
110
+ ...(nativeTarget && { target: nativeTarget }),
111
+ ...rest,
112
+ },
113
+ });
114
+ return { slotProps };
115
+ },
116
+ settings: Callout_settings_1.settings,
117
+ slots: {
118
+ root: CalloutNativeComponent_1.default,
119
+ },
120
+ styles: {
121
+ root: [tokens_1.backgroundColorTokens, tokens_1.borderTokens],
122
+ },
97
123
  });
98
124
  exports.default = exports.Callout;
99
- //# sourceMappingURL=Callout.js.map
125
+ //# sourceMappingURL=Callout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.js","sourceRoot":"","sources":["../src/Callout.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6CAA+B;AAC/B,+CAAwD;AAGxD,0DAAoF;AAEpF,2EAA6D;AAC7D,6EAAoE;AAEpE,yDAA8C;AAE9C,mDAA8C;AAE9C,sFAA8D;AAE9D,gGAAsE;AACtE,+EAAyD;AAEzD,MAAM,iBAAiB,GAAG,uBAAQ,CAAC,MAAM,CAA2E;IAClH,KAAK,EAAE,qCAAyB;IAChC,OAAO,EAAE,gCAAsB,EAAE,QAAQ;CAC1C,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,4BAAO,EAAe;IAC3C,WAAW,EAAE,2BAAW;IACxB,eAAe,EAAE,CAAC,KAAoB,EAAE,UAA4C,EAAE,EAAE;QACtF,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAChD,KAAK,CAAC,mBAAmB,CACvB,YAAY,EACZ,GAAG,EAAE,CAAC,CAAC;YACL,UAAU;gBACR,IAAI,YAAY,CAAC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1B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC/B,qCAAqC;gBACrC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;iBAAM,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;gBAC3B,0CAA0C;gBAC1C,eAAe,CAAC,IAAA,6BAAc,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,iEAAiE;gBACjE,eAAe,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QAAA,CACF,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QAEb,MAAM,SAAS,GAAG,IAAA,mCAAa,EAAoB,UAAU,CAAC,KAAK,CAAC,EAAE;YACpE,IAAI,EAAE;gBACJ,GAAG,EAAE,kBAAkB;gBACvB,GAAG,CAAC,YAAY,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;gBAC7C,GAAG,IAAI;aACR;SACF,CAAC,CAAC;QAEH,OAAO,EAAE,SAAS,EAAE,CAAC;IAAA,CACtB;IACD,QAAQ,EAAE,2BAAQ;IAClB,KAAK,EAAE;QACL,IAAI,EAAE,gCAAiB;KACxB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,CAAC,8BAAqB,EAAE,qBAAY,CAAC;KAC5C;CACF,CAAC,CAAC;kBAEY,QAAA,OAAO"}
@@ -1,4 +1,4 @@
1
1
  import type { IComposeSettings } from '@uifabricshared/foundation-compose';
2
2
  import type { ICalloutType } from './Callout.types';
3
3
  export declare const settings: IComposeSettings<ICalloutType>;
4
- //# sourceMappingURL=Callout.settings.d.ts.map
4
+ //# sourceMappingURL=Callout.settings.d.ts.map
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.settings = void 0;
4
- const Callout_types_1 = require("./Callout.types");
4
+ const Callout_types_1 = require('./Callout.types');
5
5
  exports.settings = [
6
- {
7
- tokens: {
8
- backgroundColor: 'bodyStandoutBackground',
9
- beakWidth: 20,
10
- borderColor: 'bodyFrameBackground',
11
- borderWidth: 1,
12
- directionalHint: 'bottonLeftEdge',
13
- gapSpace: 0,
14
- minPadding: 0,
15
- },
6
+ {
7
+ tokens: {
8
+ backgroundColor: 'bodyStandoutBackground',
9
+ beakWidth: 20,
10
+ borderColor: 'bodyFrameBackground',
11
+ borderWidth: 1,
12
+ directionalHint: 'bottonLeftEdge',
13
+ gapSpace: 0,
14
+ minPadding: 0,
16
15
  },
17
- Callout_types_1.calloutName,
16
+ },
17
+ Callout_types_1.calloutName,
18
18
  ];
19
- //# sourceMappingURL=Callout.settings.js.map
19
+ //# sourceMappingURL=Callout.settings.js.map
@@ -1,4 +1,4 @@
1
1
  import type { IComposeSettings } from '@uifabricshared/foundation-compose';
2
2
  import type { ICalloutType } from './Callout.types';
3
3
  export declare const settings: IComposeSettings<ICalloutType>;
4
- //# sourceMappingURL=Callout.settings.macos.d.ts.map
4
+ //# sourceMappingURL=Callout.settings.macos.d.ts.map
@@ -1,22 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.settings = void 0;
4
- const Callout_types_1 = require("./Callout.types");
4
+ const Callout_types_1 = require('./Callout.types');
5
5
  exports.settings = [
6
- {
7
- tokens: {
8
- backgroundColor: 'bodyStandoutBackground',
9
- borderColor: 'transparent',
10
- borderWidth: 0,
11
- borderRadius: 5,
12
- directionalHint: 'bottonLeftEdge',
13
- },
14
- root: {
15
- style: {
16
- position: 'absolute',
17
- },
18
- },
6
+ {
7
+ tokens: {
8
+ backgroundColor: 'bodyStandoutBackground',
9
+ borderColor: 'transparent',
10
+ borderWidth: 0,
11
+ borderRadius: 5,
12
+ directionalHint: 'bottonLeftEdge',
19
13
  },
20
- Callout_types_1.calloutName,
14
+ root: {
15
+ style: {
16
+ position: 'absolute',
17
+ },
18
+ },
19
+ },
20
+ Callout_types_1.calloutName,
21
21
  ];
22
- //# sourceMappingURL=Callout.settings.macos.js.map
22
+ //# sourceMappingURL=Callout.settings.macos.js.map