@fluentui-react-native/callout 0.28.0 → 0.28.1

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 (79) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/Callout.d.ts +2 -8
  3. package/lib/Callout.js +48 -50
  4. package/lib/Callout.settings.d.ts +1 -1
  5. package/lib/Callout.settings.js +12 -12
  6. package/lib/Callout.settings.macos.d.ts +1 -1
  7. package/lib/Callout.settings.macos.js +15 -15
  8. package/lib/Callout.types.d.ts +163 -210
  9. package/lib/Callout.types.d.ts.map +1 -1
  10. package/lib/Callout.types.js +1 -1
  11. package/lib/CalloutNativeComponent.d.ts +42 -2
  12. package/lib/CalloutNativeComponent.d.ts.map +1 -1
  13. package/lib/CalloutNativeComponent.js +2 -2
  14. package/lib/CalloutNativeComponent.js.map +1 -1
  15. package/lib/CalloutNativeComponent.macos.d.ts +42 -2
  16. package/lib/CalloutNativeComponent.macos.d.ts.map +1 -1
  17. package/lib/CalloutNativeComponent.macos.js +4 -6
  18. package/lib/CalloutNativeComponent.macos.js.map +1 -1
  19. package/lib/__tests__/Callout.test.d.ts +1 -1
  20. package/lib/__tests__/Callout.test.js +7 -7
  21. package/lib/index.d.ts +3 -12
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +1 -1
  24. package/lib-commonjs/Callout.d.ts +2 -8
  25. package/lib-commonjs/Callout.js +91 -112
  26. package/lib-commonjs/Callout.settings.d.ts +1 -1
  27. package/lib-commonjs/Callout.settings.js +15 -15
  28. package/lib-commonjs/Callout.settings.macos.d.ts +1 -1
  29. package/lib-commonjs/Callout.settings.macos.js +18 -18
  30. package/lib-commonjs/Callout.types.d.ts +163 -210
  31. package/lib-commonjs/Callout.types.d.ts.map +1 -1
  32. package/lib-commonjs/Callout.types.js +3 -3
  33. package/lib-commonjs/CalloutNativeComponent.d.ts +42 -2
  34. package/lib-commonjs/CalloutNativeComponent.d.ts.map +1 -1
  35. package/lib-commonjs/CalloutNativeComponent.js +9 -11
  36. package/lib-commonjs/CalloutNativeComponent.js.map +1 -1
  37. package/lib-commonjs/CalloutNativeComponent.macos.d.ts +42 -2
  38. package/lib-commonjs/CalloutNativeComponent.macos.d.ts.map +1 -1
  39. package/lib-commonjs/CalloutNativeComponent.macos.js +10 -14
  40. package/lib-commonjs/CalloutNativeComponent.macos.js.map +1 -1
  41. package/lib-commonjs/__tests__/Callout.test.d.ts +1 -1
  42. package/lib-commonjs/__tests__/Callout.test.js +41 -58
  43. package/lib-commonjs/index.d.ts +3 -12
  44. package/lib-commonjs/index.d.ts.map +1 -1
  45. package/lib-commonjs/index.js +7 -17
  46. package/macos/FRNCalloutManager.m +2 -1
  47. package/package.json +18 -17
  48. package/src/Callout.types.ts +4 -36
  49. package/src/CalloutNativeComponent.macos.ts +62 -5
  50. package/src/CalloutNativeComponent.ts +60 -1
  51. package/src/index.ts +1 -1
  52. package/lib/CalloutNativeComponent.types.d.ts +0 -30
  53. package/lib/CalloutNativeComponent.types.d.ts.map +0 -1
  54. package/lib/CalloutNativeComponent.types.js +0 -2
  55. package/lib/CalloutNativeComponent.types.js.map +0 -1
  56. package/lib/CalloutNativeComponent.types.macos.d.ts +0 -29
  57. package/lib/CalloutNativeComponent.types.macos.d.ts.map +0 -1
  58. package/lib/CalloutNativeComponent.types.macos.js +0 -2
  59. package/lib/CalloutNativeComponent.types.macos.js.map +0 -1
  60. package/lib/CalloutNativeComponent.win32.d.ts +0 -5
  61. package/lib/CalloutNativeComponent.win32.d.ts.map +0 -1
  62. package/lib/CalloutNativeComponent.win32.js +0 -8
  63. package/lib/CalloutNativeComponent.win32.js.map +0 -1
  64. package/lib-commonjs/CalloutNativeComponent.types.d.ts +0 -30
  65. package/lib-commonjs/CalloutNativeComponent.types.d.ts.map +0 -1
  66. package/lib-commonjs/CalloutNativeComponent.types.js +0 -3
  67. package/lib-commonjs/CalloutNativeComponent.types.js.map +0 -1
  68. package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts +0 -29
  69. package/lib-commonjs/CalloutNativeComponent.types.macos.d.ts.map +0 -1
  70. package/lib-commonjs/CalloutNativeComponent.types.macos.js +0 -3
  71. package/lib-commonjs/CalloutNativeComponent.types.macos.js.map +0 -1
  72. package/lib-commonjs/CalloutNativeComponent.win32.d.ts +0 -5
  73. package/lib-commonjs/CalloutNativeComponent.win32.d.ts.map +0 -1
  74. package/lib-commonjs/CalloutNativeComponent.win32.js +0 -16
  75. package/lib-commonjs/CalloutNativeComponent.win32.js.map +0 -1
  76. package/src/CalloutNativeComponent.types.macos.ts +0 -31
  77. package/src/CalloutNativeComponent.types.ts +0 -31
  78. package/src/CalloutNativeComponent.win32.ts +0 -11
  79. package/src/codegenTypes.d.ts +0 -2
@@ -1,2 +1,2 @@
1
1
  export const calloutName = 'Callout';
2
- //# sourceMappingURL=Callout.types.js.map
2
+ //# sourceMappingURL=Callout.types.js.map
@@ -1,5 +1,45 @@
1
- import type { CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types';
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { WithDefault, UnsafeMixed, Int32, DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes';
3
+ interface AnchorRect {
4
+ screenX: Double;
5
+ screenY: Double;
6
+ width: Double;
7
+ height: Double;
8
+ }
9
+ /**
10
+ * Shared native props specific to Callout native component
11
+ */
12
+ export interface NativeProps extends ViewProps {
13
+ accessibilityLabel?: string;
14
+ accessibilityOnShowAnnouncement?: string;
15
+ anchorRect?: AnchorRect;
16
+ dismissBehaviors?: string[];
17
+ doNotTakePointerCapture?: boolean;
18
+ focusable?: boolean;
19
+ isBeakVisible?: boolean;
20
+ maxHeight?: Int32;
21
+ maxWidth?: Int32;
22
+ setInitialFocus?: boolean;
23
+ testID?: string;
24
+ onRestoreFocus?: DirectEventHandler<{
25
+ target: Int32;
26
+ containsFocus: boolean;
27
+ }>;
28
+ onDismiss?: DirectEventHandler<{
29
+ target: Int32;
30
+ }>;
31
+ onShow?: DirectEventHandler<{
32
+ target: Int32;
33
+ }>;
34
+ directionalHint?: WithDefault<'leftTopEdge' | 'leftCenter' | 'leftBottomEdge' | 'topLeftEdge' | 'topAutoEdge' | 'topCenter' | 'topRightEdge' | 'rightTopEdge' | 'rightCenter' | 'rightBottomEdge' | 'bottomLeftEdge' | 'bottonLeftEdge' | 'bottomAutoEdge' | 'bottomCenter' | 'bottomRightEdge', 'bottonLeftEdge'>;
35
+ target?: UnsafeMixed;
36
+ }
37
+ export type CalloutComponentType = HostComponent<NativeProps>;
38
+ export interface CalloutNativeCommands {
39
+ focusWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
40
+ blurWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
41
+ }
2
42
  export declare const Commands: CalloutNativeCommands;
3
43
  declare const _default: CalloutComponentType;
4
44
  export default _default;
5
- //# sourceMappingURL=CalloutNativeComponent.d.ts.map
45
+ //# sourceMappingURL=CalloutNativeComponent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutNativeComponent.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE/G,eAAO,MAAM,QAAQ,EAAE,qBAErB,CAAC;;AAEH,wBAAyF"}
1
+ {"version":3,"file":"CalloutNativeComponent.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAE7H,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/E,SAAS,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAE/C,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,gBAAgB,GAChB,cAAc,GACd,iBAAiB,EACnB,gBAAgB,CACjB,CAAC;IACF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,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;AAED,eAAO,MAAM,QAAQ,EAAE,qBAErB,CAAC;;AAEH,wBAAyF"}
@@ -1,7 +1,7 @@
1
1
  import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
2
2
  import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
3
3
  export const Commands = codegenNativeCommands({
4
- supportedCommands: ['blurWindow', 'focusWindow'],
4
+ supportedCommands: ['blurWindow', 'focusWindow'],
5
5
  });
6
6
  export default codegenNativeComponent('RCTCallout');
7
- //# sourceMappingURL=CalloutNativeComponent.js.map
7
+ //# sourceMappingURL=CalloutNativeComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutNativeComponent.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AAI7F,MAAM,CAAC,MAAM,QAAQ,GAA0B,qBAAqB,CAAwB;IAC1F,iBAAiB,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;CACjD,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAc,YAAY,CAAyB,CAAC"}
1
+ {"version":3,"file":"CalloutNativeComponent.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AA+D7F,MAAM,CAAC,MAAM,QAAQ,GAA0B,qBAAqB,CAAwB;IAC1F,iBAAiB,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;CACjD,CAAC,CAAC;AAEH,eAAe,sBAAsB,CAAc,YAAY,CAAyB,CAAC"}
@@ -1,5 +1,45 @@
1
- import type { CalloutComponentType, CalloutNativeCommands } from './CalloutNativeComponent.types.macos';
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { WithDefault, UnsafeMixed, Int32, DirectEventHandler, Double } from 'react-native/Libraries/Types/CodegenTypes';
3
+ interface AnchorRect {
4
+ screenX: Double;
5
+ screenY: Double;
6
+ width: Double;
7
+ height: Double;
8
+ }
9
+ /**
10
+ * Shared native props specific to Callout native component
11
+ */
12
+ export interface NativeProps extends ViewProps {
13
+ accessibilityLabel?: string;
14
+ accessibilityOnShowAnnouncement?: string;
15
+ anchorRect?: AnchorRect;
16
+ dismissBehaviors?: string[];
17
+ doNotTakePointerCapture?: boolean;
18
+ focusable?: boolean;
19
+ isBeakVisible?: boolean;
20
+ maxHeight?: Int32;
21
+ maxWidth?: Int32;
22
+ setInitialFocus?: boolean;
23
+ testID?: string;
24
+ onRestoreFocus?: DirectEventHandler<{
25
+ target: Int32;
26
+ containsFocus: boolean;
27
+ }>;
28
+ onDismiss?: DirectEventHandler<{
29
+ target: Int32;
30
+ }>;
31
+ onShow?: DirectEventHandler<{
32
+ target: Int32;
33
+ }>;
34
+ directionalHint?: WithDefault<'leftTopEdge' | 'leftCenter' | 'leftBottomEdge' | 'topLeftEdge' | 'topAutoEdge' | 'topCenter' | 'topRightEdge' | 'rightTopEdge' | 'rightCenter' | 'rightBottomEdge' | 'bottomLeftEdge' | 'bottonLeftEdge' | 'bottomAutoEdge' | 'bottomCenter' | 'bottomRightEdge', 'topleftEdge'>;
35
+ target?: UnsafeMixed;
36
+ }
37
+ export type CalloutComponentType = HostComponent<NativeProps>;
38
+ export interface CalloutNativeCommands {
39
+ focusWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
40
+ blurWindow: (viewRef: React.ElementRef<CalloutComponentType>) => void;
41
+ }
2
42
  export declare const Commands: CalloutNativeCommands;
3
43
  declare const _default: CalloutComponentType;
4
44
  export default _default;
5
- //# sourceMappingURL=CalloutNativeComponent.macos.d.ts.map
45
+ //# sourceMappingURL=CalloutNativeComponent.macos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutNativeComponent.macos.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.macos.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAErH,eAAO,MAAM,QAAQ,EAAE,qBAErB,CAAC;;AAIH,wBAAyF"}
1
+ {"version":3,"file":"CalloutNativeComponent.macos.d.ts","sourceRoot":"","sources":["../src/CalloutNativeComponent.macos.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAE7H,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAG1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,cAAc,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/E,SAAS,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,KAAK,CAAA;KAAE,CAAC,CAAC;IAE/C,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,gBAAgB,GAChB,cAAc,GACd,iBAAiB,EACnB,aAAa,CACd,CAAC;IACF,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,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;AAED,eAAO,MAAM,QAAQ,EAAE,qBAErB,CAAC;;AAEH,wBAAyF"}
@@ -1,9 +1,7 @@
1
1
  import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
2
- import { requireNativeComponent } from 'react-native';
2
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
3
3
  export const Commands = codegenNativeCommands({
4
- supportedCommands: ['blurWindow', 'focusWindow'],
4
+ supportedCommands: ['blurWindow', 'focusWindow'],
5
5
  });
6
- // no fabric for macOS, just use requireNativeComponent
7
- // macOS uses FRNCallout (registered by FRNCalloutManager), not RCTCallout
8
- export default requireNativeComponent('FRNCallout');
9
- //# sourceMappingURL=CalloutNativeComponent.macos.js.map
6
+ export default codegenNativeComponent('FRNCallout');
7
+ //# sourceMappingURL=CalloutNativeComponent.macos.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CalloutNativeComponent.macos.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.macos.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,0EAA0E;AAC1E,eAAe,sBAAsB,CAAc,YAAY,CAAyB,CAAC"}
1
+ {"version":3,"file":"CalloutNativeComponent.macos.js","sourceRoot":"","sources":["../src/CalloutNativeComponent.macos.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,wDAAwD,CAAC;AAC3F,OAAO,sBAAsB,MAAM,yDAAyD,CAAC;AA+D7F,MAAM,CAAC,MAAM,QAAQ,GAA0B,qBAAqB,CAAwB;IAC1F,iBAAiB,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;CACjD,CAAC,CAAC;AAEH,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,12 +1,12 @@
1
- import { jsx as _jsx } from 'react/jsx-runtime';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { act } from 'react';
3
3
  import * as renderer from 'react-test-renderer';
4
4
  import { Callout } from '..';
5
5
  it('Callout default props', () => {
6
- let component;
7
- act(() => {
8
- component = renderer.create(_jsx(Callout, {}));
9
- });
10
- expect(component.toJSON()).toMatchSnapshot();
6
+ let component;
7
+ act(() => {
8
+ component = renderer.create(_jsx(Callout, {}));
9
+ });
10
+ expect(component.toJSON()).toMatchSnapshot();
11
11
  });
12
- //# sourceMappingURL=Callout.test.js.map
12
+ //# sourceMappingURL=Callout.test.js.map
package/lib/index.d.ts CHANGED
@@ -1,14 +1,5 @@
1
1
  export { calloutName } from './Callout.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';
2
+ export type { DirectionalHint, DismissBehaviors, ICalloutProps, ICalloutRenderData, ICalloutSlotProps, ICalloutTokens, ICalloutType, RestoreFocusEvent, } from './Callout.types';
3
+ export type { CalloutNativeCommands } from './CalloutNativeComponent';
13
4
  export { Callout } from './Callout';
14
- //# sourceMappingURL=index.d.ts.map
5
+ //# 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,gCAAgC,CAAC;AAC5E,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,0BAA0B,CAAC;AACtE,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,12 +4,6 @@
4
4
  * @format
5
5
  */
6
6
  import type { ICalloutProps, ICalloutSlotProps } from './Callout.types';
7
- export declare const Callout: import('@uifabricshared/foundation-compose').IComposeReturnType<
8
- ICalloutProps,
9
- ICalloutSlotProps,
10
- import('./Callout.types').ICalloutTokens,
11
- object,
12
- object
13
- >;
7
+ export declare const Callout: import("@uifabricshared/foundation-compose").IComposeReturnType<ICalloutProps, ICalloutSlotProps, import("./Callout.types").ICalloutTokens, object, object>;
14
8
  export default Callout;
15
- //# sourceMappingURL=Callout.d.ts.map
9
+ //# sourceMappingURL=Callout.d.ts.map
@@ -1,125 +1,104 @@
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 =
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;
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 () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
46
29
  };
47
- return ownKeys(o);
30
+ return ownKeys(o);
48
31
  };
49
32
  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;
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
55
38
  };
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 });
39
+ })();
40
+ var __importDefault = (this && this.__importDefault) || function (mod) {
41
+ return (mod && mod.__esModule) ? mod : { "default": mod };
42
+ };
43
+ Object.defineProperty(exports, "__esModule", { value: true });
63
44
  exports.Callout = void 0;
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');
45
+ const React = __importStar(require("react"));
46
+ const react_native_1 = require("react-native");
47
+ const tokens_1 = require("@fluentui-react-native/tokens");
48
+ const foundation_compose_1 = require("@uifabricshared/foundation-compose");
49
+ const foundation_settings_1 = require("@uifabricshared/foundation-settings");
50
+ const Callout_settings_1 = require("./Callout.settings");
51
+ const Callout_types_1 = require("./Callout.types");
52
+ const CalloutNativeComponent_1 = __importDefault(require("./CalloutNativeComponent"));
53
+ const CalloutNativeComponent_2 = require("./CalloutNativeComponent");
73
54
  exports.Callout = (0, foundation_compose_1.compose)({
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
- },
55
+ displayName: Callout_types_1.calloutName,
56
+ usePrepareProps: (props, useStyling) => {
57
+ const { componentRef, target, ...rest } = props;
58
+ React.useImperativeHandle(componentRef, () => ({
59
+ blurWindow() {
60
+ if (componentRef.current != null) {
61
+ CalloutNativeComponent_2.Commands.blurWindow(nativeComponentRef.current);
62
+ }
63
+ },
64
+ focusWindow() {
65
+ if (componentRef.current != null) {
66
+ CalloutNativeComponent_2.Commands.focusWindow(nativeComponentRef.current);
67
+ }
68
+ },
69
+ }), [componentRef]);
70
+ const nativeComponentRef = React.useRef(null);
71
+ const [nativeTarget, setNativeTarget] = React.useState(null);
72
+ React.useLayoutEffect(() => {
73
+ if (typeof target === 'string') {
74
+ // Pass string type `target` directly
75
+ setNativeTarget(target);
76
+ }
77
+ else if (target?.current) {
78
+ // Pass the tagID for a valid ref `target`
79
+ setNativeTarget((0, react_native_1.findNodeHandle)(target.current));
80
+ }
81
+ else {
82
+ // Clear `target` so we may fall back on `anchorRect` if provided
83
+ setNativeTarget(null);
84
+ }
85
+ }, [target]);
86
+ const slotProps = (0, foundation_settings_1.mergeSettings)(useStyling(props), {
87
+ root: {
88
+ ref: nativeComponentRef,
89
+ ...(nativeTarget && { target: nativeTarget }),
90
+ ...rest,
91
+ },
92
+ });
93
+ return { slotProps };
94
+ },
95
+ settings: Callout_settings_1.settings,
96
+ slots: {
97
+ root: CalloutNativeComponent_1.default,
98
+ },
99
+ styles: {
100
+ root: [tokens_1.backgroundColorTokens, tokens_1.borderTokens],
101
+ },
123
102
  });
124
103
  exports.default = exports.Callout;
125
- //# sourceMappingURL=Callout.js.map
104
+ //# sourceMappingURL=Callout.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.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,
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
+ },
15
16
  },
16
- },
17
- Callout_types_1.calloutName,
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',
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
+ },
13
19
  },
14
- root: {
15
- style: {
16
- position: 'absolute',
17
- },
18
- },
19
- },
20
- Callout_types_1.calloutName,
20
+ Callout_types_1.calloutName,
21
21
  ];
22
- //# sourceMappingURL=Callout.settings.macos.js.map
22
+ //# sourceMappingURL=Callout.settings.macos.js.map