@fluentui-react-native/use-slots 0.10.12 → 0.11.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.
@@ -1,52 +1,89 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- const react_native_1 = require("react-native");
27
- const framework_base_1 = require("@fluentui-react-native/framework-base");
28
- const renderer = __importStar(require("react-test-renderer"));
29
- const buildUseSlots_1 = require("./buildUseSlots");
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('@fluentui-react-native/framework-base/jsx-runtime');
54
+ /** @jsxImportSource @fluentui-react-native/framework-base */
55
+ const react_1 = require('react');
56
+ const react_native_1 = require('react-native');
57
+ const framework_base_1 = require('@fluentui-react-native/framework-base');
58
+ const renderer = __importStar(require('react-test-renderer'));
59
+ const buildUseSlots_1 = require('./buildUseSlots');
30
60
  const useSlotsBase = (0, buildUseSlots_1.buildUseSlots)({
31
- slots: {
32
- outer: react_native_1.View,
33
- inner: react_native_1.View,
34
- content: react_native_1.Text,
35
- },
61
+ slots: {
62
+ outer: react_native_1.View,
63
+ inner: react_native_1.View,
64
+ content: react_native_1.Text,
65
+ },
36
66
  });
37
67
  const CompBase = (0, framework_base_1.stagedComponent)((props) => {
38
- const Slots = useSlotsBase(props);
39
- return (extra) => {
40
- const merged = { ...props, ...extra };
41
- return ((0, framework_base_1.withSlots)(Slots.outer, { ...merged },
42
- (0, framework_base_1.withSlots)(Slots.inner, { style: { backgroundColor: 'blue', width: 20, height: 10 } },
43
- (0, framework_base_1.withSlots)(Slots.content, null, "Hello"))));
44
- };
68
+ const Slots = useSlotsBase(props);
69
+ return (extra) => {
70
+ const merged = { ...props, ...extra };
71
+ return jsx_runtime_1.jsx(Slots.outer, {
72
+ ...merged,
73
+ children: jsx_runtime_1.jsx(Slots.inner, {
74
+ style: { backgroundColor: 'blue', width: 20, height: 10 },
75
+ children: jsx_runtime_1.jsx(Slots.content, { children: 'Hello' }),
76
+ }),
77
+ });
78
+ };
45
79
  });
46
80
  describe('buildUseSlots test suite', () => {
47
- it('Simple component render', () => {
48
- const tree = renderer.create((0, framework_base_1.withSlots)(CompBase, { style: { width: 30, height: 20, borderColor: 'green', borderWidth: 1 } })).toJSON();
49
- expect(tree).toMatchSnapshot();
81
+ it('Simple component render', () => {
82
+ let component;
83
+ (0, react_1.act)(() => {
84
+ component = renderer.create(jsx_runtime_1.jsx(CompBase, { style: { width: 30, height: 20, borderColor: 'green', borderWidth: 1 } }));
50
85
  });
86
+ expect(component.toJSON()).toMatchSnapshot();
87
+ });
51
88
  });
52
- //# sourceMappingURL=buildUseSlots.test.js.map
89
+ //# sourceMappingURL=buildUseSlots.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildUseSlots.test.js","sourceRoot":"","sources":["../src/buildUseSlots.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,+CAA0C;AAE1C,0EAAmF;AACnF,8DAAgD;AAEhD,mDAAgD;AAQhD,MAAM,YAAY,GAAG,IAAA,6BAAa,EAAa;IAC7C,KAAK,EAAE;QACL,KAAK,EAAE,mBAAI;QACX,KAAK,EAAE,mBAAI;QACX,OAAO,EAAE,mBAAI;KACd;CACF,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,IAAA,gCAAe,EAAC,CAAC,KAAgB,EAAE,EAAE;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,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AA,gCAAe,EAAC,CAAC,KAAgB,EAAE,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,CAAC,KAAgB,EAAE,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;QACtC,OAAO,CACL,kBAAC,KAAK,CAAC,KAAK,OAAK,MAAM,YACrB,kBAAC,KAAK,CAAC,KAAK,IAAC,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,YACpE,kBAAC,KAAK,CAAC,OAAO,wBAAsB,GACxB,GACF,CACf,CAAC;IAAA,CACH,CAAC;AAAA,CACH,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC;IACzC,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC;QAClC,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,GAAI,CAAC,CAAC;QAAA,CACnH,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { buildUseSlots } from './buildUseSlots';
2
2
  export type { GetSlotProps, Slots, UseSlotOptions, UseSlotsBase } from './buildUseSlots';
3
- //# sourceMappingURL=index.d.ts.map
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.buildUseSlots = void 0;
4
- var buildUseSlots_1 = require("./buildUseSlots");
5
- Object.defineProperty(exports, "buildUseSlots", { enumerable: true, get: function () { return buildUseSlots_1.buildUseSlots; } });
6
- //# sourceMappingURL=index.js.map
4
+ const buildUseSlots_1 = require('./buildUseSlots');
5
+ Object.defineProperty(exports, 'buildUseSlots', {
6
+ enumerable: true,
7
+ get: function () {
8
+ return buildUseSlots_1.buildUseSlots;
9
+ },
10
+ });
11
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAAvC,8GAAA,aAAa,OAAA"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=useSlots.samples.test.d.ts.map
2
+ //# sourceMappingURL=useSlots.samples.test.d.ts.map