@common-stack/client-react 3.0.2-alpha.1 → 3.0.2-alpha.4
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/lib/__tests__/fill-register-test.js +6 -31
- package/lib/__tests__/fill-register-test.js.map +1 -1
- package/lib/__tests__/helpers/sample-menu.js +1 -4
- package/lib/__tests__/helpers/sample-menu.js.map +1 -1
- package/lib/__tests__/integrated-routes.test.js +12 -37
- package/lib/__tests__/integrated-routes.test.js.map +1 -1
- package/lib/__tests__/router-render.test.js +13 -53
- package/lib/__tests__/router-render.test.js.map +1 -1
- package/lib/connector/base-connector.js +24 -48
- package/lib/connector/base-connector.js.map +1 -1
- package/lib/connector/connector.js +9 -13
- package/lib/connector/connector.js.map +1 -1
- package/lib/connector/connector.native.js +10 -17
- package/lib/connector/connector.native.js.map +1 -1
- package/lib/connector/connector.test.js +5 -30
- package/lib/connector/connector.test.js.map +1 -1
- package/lib/connector/index.js +1 -17
- package/lib/connector/index.js.map +1 -1
- package/lib/index.js +10 -28
- package/lib/index.js.map +1 -1
- package/lib/index.native.js +10 -28
- package/lib/index.native.js.map +1 -1
- package/lib/interfaces/extended-feature.js +1 -2
- package/lib/interfaces/feature.js +1 -2
- package/lib/interfaces/index.js +5 -21
- package/lib/interfaces/index.js.map +1 -1
- package/lib/interfaces/menu.js +2 -5
- package/lib/interfaces/menu.js.map +1 -1
- package/lib/interfaces/new-router.js +1 -2
- package/lib/interfaces/router.js +1 -2
- package/lib/inversify/InversifyContext.js +6 -34
- package/lib/inversify/InversifyContext.js.map +1 -1
- package/lib/inversify/index.js +1 -17
- package/lib/inversify/index.js.map +1 -1
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js +12 -37
- package/lib/plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/plugin-area/base-plugin-area.js +12 -39
- package/lib/plugin-area/base-plugin-area.js.map +1 -1
- package/lib/plugin-area/higher-order-component-util.js +3 -7
- package/lib/plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/plugin-area/index.js +5 -35
- package/lib/plugin-area/index.js.map +1 -1
- package/lib/plugin-area/index.native.js +7 -37
- package/lib/plugin-area/index.native.js.map +1 -1
- package/lib/plugin-area/plugin-api.js +15 -18
- package/lib/plugin-area/plugin-api.js.map +1 -1
- package/lib/plugin-area/plugin-context.js +5 -32
- package/lib/plugin-area/plugin-context.js.map +1 -1
- package/lib/route/__tests__/admin-new-routes.test.js +11 -45
- package/lib/route/__tests__/admin-new-routes.test.js.map +1 -1
- package/lib/route/__tests__/getFlatMenus.test.js +4 -6
- package/lib/route/__tests__/getFlatMenus.test.js.map +1 -1
- package/lib/route/__tests__/render-routes-config.test.js +6 -18
- package/lib/route/__tests__/render-routes-config.test.js.map +1 -1
- package/lib/route/__tests__/route-type.test.js +1 -2
- package/lib/route/__tests__/route-type.test.js.map +1 -1
- package/lib/route/get-routes.js +22 -29
- package/lib/route/get-routes.js.map +1 -1
- package/lib/route/get-routes.test.js +6 -17
- package/lib/route/get-routes.test.js.map +1 -1
- package/lib/route/index.js +2 -18
- package/lib/route/index.js.map +1 -1
- package/lib/route/index.native.js +1 -17
- package/lib/route/index.native.js.map +1 -1
- package/lib/route/old/__tests__/config-sidebar-menu.test.js +17 -15
- package/lib/route/old/__tests__/config-sidebar-menu.test.js.map +1 -1
- package/lib/route/old/get-menus.js +14 -21
- package/lib/route/old/get-menus.js.map +1 -1
- package/lib/route/old/get-routes-notused.js +14 -12
- package/lib/route/old/get-routes-notused.js.map +1 -1
- package/lib/route/old/render.js +6 -33
- package/lib/route/old/render.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.js +35 -40
- package/lib/route/react-navigation/get-navigation-utils.js.map +1 -1
- package/lib/route/react-navigation/get-navigation-utils.test.js +14 -16
- package/lib/route/react-navigation/get-navigation-utils.test.js.map +1 -1
- package/lib/route/react-navigation/index.js +2 -18
- package/lib/route/react-navigation/index.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample.test.js +8 -22
- package/lib/route/react-navigation/react-native.sample.test.js.map +1 -1
- package/lib/route/react-navigation/react-native.sample1.test.js +14 -48
- package/lib/route/react-navigation/react-native.sample1.test.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.js +16 -31
- package/lib/route/react-navigation/react-navigation-render.js.map +1 -1
- package/lib/route/react-navigation/react-navigation-render.test.js +23 -37
- package/lib/route/react-navigation/react-navigation-render.test.js.map +1 -1
- package/lib/route/react-navigation/root-navigation.js +5 -9
- package/lib/route/react-navigation/root-navigation.js.map +1 -1
- package/lib/route/react-navigation/routes.js +1 -2
- package/lib/route/react-navigation/types.js +1 -5
- package/lib/route/react-navigation/types.js.map +1 -1
- package/lib/route/render-routes-native.js +32 -65
- package/lib/route/render-routes-native.js.map +1 -1
- package/lib/route/render-routes.js +54 -85
- package/lib/route/render-routes.js.map +1 -1
- package/lib/route/render-routes.test.js +189 -203
- package/lib/route/render-routes.test.js.map +1 -1
- package/lib/route/root-navigation.js +3 -7
- package/lib/route/root-navigation.js.map +1 -1
- package/lib/route/test-routes.js +1 -3
- package/lib/route/test-routes.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js +12 -37
- package/lib/route-based-plugin-area/__tests__/higher-order-component-util.test.js.map +1 -1
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js +11 -13
- package/lib/route-based-plugin-area/__tests__/plugin-api.test.js.map +1 -1
- package/lib/route-based-plugin-area/higher-order-component-util.js +3 -7
- package/lib/route-based-plugin-area/higher-order-component-util.js.map +1 -1
- package/lib/route-based-plugin-area/index.js +2 -18
- package/lib/route-based-plugin-area/index.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-api.js +15 -18
- package/lib/route-based-plugin-area/plugin-api.js.map +1 -1
- package/lib/route-based-plugin-area/plugin-context.js +5 -32
- package/lib/route-based-plugin-area/plugin-context.js.map +1 -1
- package/lib/route-based-plugin-area/route-based-plugin-area.js +12 -39
- package/lib/route-based-plugin-area/route-based-plugin-area.js.map +1 -1
- package/lib/router-factory/index.js +5 -31
- package/lib/router-factory/index.js.map +1 -1
- package/lib/router-factory/index.native.js +5 -31
- package/lib/router-factory/index.native.js.map +1 -1
- package/lib/utils/before-ssr.js +6 -19
- package/lib/utils/before-ssr.js.map +1 -1
- package/lib/utils/combine.js +2 -6
- package/lib/utils/combine.js.map +1 -1
- package/lib/utils/hydrate.js +3 -7
- package/lib/utils/hydrate.js.map +1 -1
- package/lib/utils/index.js +5 -21
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/sort-keys.js +5 -13
- package/lib/utils/sort-keys.js.map +1 -1
- package/lib/utils/sort-keys.test.js +3 -5
- package/lib/utils/sort-keys.test.js.map +1 -1
- package/lib/utils/utils.js +1 -5
- package/lib/utils/utils.js.map +1 -1
- package/package.json +5 -4
package/lib/index.native.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ClientTypes = void 0;
|
|
18
|
-
var client_core_1 = require("@common-stack/client-core");
|
|
19
|
-
Object.defineProperty(exports, "ClientTypes", { enumerable: true, get: function () { return client_core_1.ClientTypes; } });
|
|
20
|
-
__exportStar(require("./connector/connector.native"), exports);
|
|
21
|
-
__exportStar(require("./router-factory/index.native"), exports);
|
|
22
|
-
__exportStar(require("./route/index.native"), exports);
|
|
23
|
-
__exportStar(require("./route/react-navigation/root-navigation"), exports);
|
|
24
|
-
__exportStar(require("./utils"), exports);
|
|
25
|
-
__exportStar(require("./interfaces"), exports);
|
|
26
|
-
__exportStar(require("./plugin-area/index.native"), exports);
|
|
27
|
-
__exportStar(require("./route-based-plugin-area"), exports);
|
|
28
|
-
__exportStar(require("./inversify"), exports);
|
|
1
|
+
export { ClientTypes } from '@common-stack/client-core';
|
|
2
|
+
export * from './connector/connector.native';
|
|
3
|
+
export * from './router-factory/index.native';
|
|
4
|
+
export * from './route/index.native';
|
|
5
|
+
export * from './route/react-navigation/root-navigation';
|
|
6
|
+
export * from './utils';
|
|
7
|
+
export * from './interfaces';
|
|
8
|
+
export * from './plugin-area/index.native';
|
|
9
|
+
export * from './route-based-plugin-area';
|
|
10
|
+
export * from './inversify';
|
|
29
11
|
//# sourceMappingURL=index.native.js.map
|
package/lib/index.native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0CAA0C,CAAC;AACzD,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC"}
|
package/lib/interfaces/index.js
CHANGED
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./router"), exports);
|
|
18
|
-
__exportStar(require("./extended-feature"), exports);
|
|
19
|
-
__exportStar(require("./menu"), exports);
|
|
20
|
-
__exportStar(require("./new-router"), exports);
|
|
21
|
-
__exportStar(require("./feature"), exports);
|
|
1
|
+
export * from './router';
|
|
2
|
+
export * from './extended-feature';
|
|
3
|
+
export * from './menu';
|
|
4
|
+
export * from './new-router';
|
|
5
|
+
export * from './feature';
|
|
22
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/lib/interfaces/menu.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IMenuPosition = void 0;
|
|
4
|
-
var IMenuPosition;
|
|
1
|
+
export var IMenuPosition;
|
|
5
2
|
(function (IMenuPosition) {
|
|
6
3
|
IMenuPosition["LOGO"] = "LOGO";
|
|
7
4
|
IMenuPosition["UPPER"] = "UPPER";
|
|
@@ -13,5 +10,5 @@ var IMenuPosition;
|
|
|
13
10
|
IMenuPosition["Middle"] = "MIDDLE";
|
|
14
11
|
IMenuPosition["Lower"] = "LOWER";
|
|
15
12
|
IMenuPosition["Bottom"] = "BOTTOM";
|
|
16
|
-
})(IMenuPosition
|
|
13
|
+
})(IMenuPosition || (IMenuPosition = {}));
|
|
17
14
|
//# sourceMappingURL=menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/interfaces/menu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["../../src/interfaces/menu.tsx"],"names":[],"mappings":"AAsGA,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,gCAAe,CAAA;IACf,kCAAiB,CAAA;AACrB,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB"}
|
package/lib/interfaces/router.js
CHANGED
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
exports.useInjection = exports.InversifyProvider = exports.InversifyContext = void 0;
|
|
27
|
-
const React = __importStar(require("react"));
|
|
28
|
-
exports.InversifyContext = React.createContext({ container: null, modules: null });
|
|
29
|
-
const InversifyProvider = (props) => {
|
|
30
|
-
return (React.createElement(exports.InversifyContext.Provider, { value: { container: props.container, modules: props.modules } }, props.children));
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const InversifyContext = React.createContext({ container: null, modules: null });
|
|
3
|
+
export const InversifyProvider = (props) => {
|
|
4
|
+
return (React.createElement(InversifyContext.Provider, { value: { container: props.container, modules: props.modules } }, props.children));
|
|
31
5
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const { container } = React.useContext(exports.InversifyContext);
|
|
6
|
+
export function useInjection(identifier) {
|
|
7
|
+
const { container } = React.useContext(InversifyContext);
|
|
35
8
|
if (!container) {
|
|
36
9
|
throw new Error('Container is null');
|
|
37
10
|
}
|
|
38
11
|
return container.get(identifier);
|
|
39
12
|
}
|
|
40
|
-
exports.useInjection = useInjection;
|
|
41
13
|
//# sourceMappingURL=InversifyContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InversifyContext.js","sourceRoot":"","sources":["../../src/inversify/InversifyContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InversifyContext.js","sourceRoot":"","sources":["../../src/inversify/InversifyContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAA+D,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAStJ,MAAM,CAAC,MAAM,iBAAiB,GAAoB,CAAC,KAAK,EAAE,EAAE;IACxD,OAAO,CACH,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAClF,KAAK,CAAC,QAAQ,CACS,CAC/B,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,UAAU,YAAY,CAAI,UAA2C;IACvE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;KACxC;IACD,OAAO,SAAS,CAAC,GAAG,CAAI,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
package/lib/inversify/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./InversifyContext"), exports);
|
|
1
|
+
export * from './InversifyContext';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inversify/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inversify/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,63 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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_1 = __importStar(require("react"));
|
|
27
|
-
const higher_order_component_util_1 = require("../higher-order-component-util");
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { createHigherOrderComponent } from '../higher-order-component-util';
|
|
28
3
|
describe('createHigherOrderComponent', () => {
|
|
29
4
|
it('should use default name for anonymous function', () => {
|
|
30
|
-
const TestComponent =
|
|
5
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(() => React.createElement("div", null));
|
|
31
6
|
expect(TestComponent.displayName).toBe('WithTest(Component');
|
|
32
7
|
});
|
|
33
8
|
it('should use camel case starting with upper for wrapper prefix ', () => {
|
|
34
|
-
const TestComponent =
|
|
9
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'with-one-two_threeFOUR')(() => React.createElement("div", null));
|
|
35
10
|
expect(TestComponent.displayName).toBe('WithOneTwoThreeFour(Component)');
|
|
36
11
|
});
|
|
37
12
|
it('should use function name', () => {
|
|
38
13
|
function SomeComponent() {
|
|
39
|
-
return
|
|
14
|
+
return React.createElement("div", null);
|
|
40
15
|
}
|
|
41
|
-
const TestComponent =
|
|
16
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeComponent);
|
|
42
17
|
expect(TestComponent.displayName).toBe('WithTest(SomeComponent)');
|
|
43
18
|
});
|
|
44
19
|
it('should use component class name', () => {
|
|
45
|
-
class SomeAnotherComponent extends
|
|
20
|
+
class SomeAnotherComponent extends Component {
|
|
46
21
|
render() {
|
|
47
|
-
return
|
|
22
|
+
return React.createElement("div", null);
|
|
48
23
|
}
|
|
49
24
|
}
|
|
50
|
-
const TestComponent =
|
|
25
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeAnotherComponent);
|
|
51
26
|
expect(TestComponent.displayName).toBe('WithTest(SomeAnotherComponent)');
|
|
52
27
|
});
|
|
53
28
|
it('should use displayName property', () => {
|
|
54
|
-
class SomeYetAnotherComponent extends
|
|
29
|
+
class SomeYetAnotherComponent extends Component {
|
|
55
30
|
render() {
|
|
56
|
-
return
|
|
31
|
+
return React.createElement("div", null);
|
|
57
32
|
}
|
|
58
33
|
}
|
|
59
34
|
SomeYetAnotherComponent.displayName = 'CustomDisplayName';
|
|
60
|
-
const TestComponent =
|
|
35
|
+
const TestComponent = createHigherOrderComponent((OriginalComponent) => OriginalComponent, 'withTest')(SomeYetAnotherComponent);
|
|
61
36
|
expect(TestComponent.displayName).toBe('WithTest(CustomDisplayName)');
|
|
62
37
|
});
|
|
63
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"higher-order-component-util.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/higher-order-component-util.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"higher-order-component-util.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/higher-order-component-util.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACtD,MAAM,aAAa,GAAG,0BAA0B,CAC5C,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,EACxC,UAAU,CACb,CAAE,GAAG,EAAE,CAAC,gCAAO,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAE,+DAA+D,EAAE,GAAG,EAAE;QAC5E,MAAM,aAAa,GAAG,0BAA0B,CAC/C,CAAE,iBAAiB,EAAG,EAAE,CAAC,iBAAiB,EAC1C,wBAAwB,CACxB,CAAE,GAAG,EAAE,CAAC,gCAAO,CAAE,CAAC;QAEnB,MAAM,CAAE,aAAa,CAAC,WAAW,CAAE,CAAC,IAAI,CACvC,gCAA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ports, "__esModule", { value: true });
|
|
3
|
-
const plugin_api_1 = require("../plugin-api");
|
|
1
|
+
import { registerPlugin, unregisterPlugin, getPlugin, getPlugins } from '../plugin-api';
|
|
4
2
|
describe('registerPlugin', () => {
|
|
5
3
|
afterEach(() => {
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
getPlugins().forEach((plugin) => {
|
|
5
|
+
unregisterPlugin(plugin.name);
|
|
8
6
|
});
|
|
9
7
|
});
|
|
10
8
|
it('successfully registers a plugin', () => {
|
|
11
9
|
const name = 'plugin';
|
|
12
10
|
const icon = 'smiley';
|
|
13
11
|
const Component = () => 'plugin content';
|
|
14
|
-
|
|
12
|
+
registerPlugin(name, {
|
|
15
13
|
render: Component,
|
|
16
14
|
icon,
|
|
17
15
|
});
|
|
18
|
-
expect(
|
|
16
|
+
expect(getPlugin(name)).toEqual({
|
|
19
17
|
name,
|
|
20
18
|
render: Component,
|
|
21
19
|
icon,
|
|
22
20
|
});
|
|
23
21
|
});
|
|
24
22
|
it('fails to register a plugin without a settings object', () => {
|
|
25
|
-
|
|
23
|
+
registerPlugin();
|
|
26
24
|
expect(console).toThrowError('No settings object provided!');
|
|
27
25
|
});
|
|
28
26
|
it('fails to register a plugin with special character in the name', () => {
|
|
29
|
-
|
|
27
|
+
registerPlugin('plugin/with/special/characters', {
|
|
30
28
|
render: () => { },
|
|
31
29
|
});
|
|
32
30
|
expect(console).toThrowError('Plugin names must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".');
|
|
33
31
|
});
|
|
34
32
|
it('fails to register a plugin with a non-string name', () => {
|
|
35
|
-
|
|
33
|
+
registerPlugin({}, {
|
|
36
34
|
render: () => { },
|
|
37
35
|
});
|
|
38
36
|
expect(console).toThrowError('Plugin names must be strings.');
|
|
39
37
|
});
|
|
40
38
|
it('fails to register a plugin without a render function', () => {
|
|
41
|
-
|
|
39
|
+
registerPlugin('another-plugin', {});
|
|
42
40
|
expect(console).toThrowError('The "render" property must be specified and must be a valid function.');
|
|
43
41
|
});
|
|
44
42
|
it('fails to register a plugin that was already been registered', () => {
|
|
45
|
-
|
|
43
|
+
registerPlugin('plugin', {
|
|
46
44
|
render: () => 'plugin content',
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
registerPlugin('plugin', {
|
|
49
47
|
render: () => 'plugin content',
|
|
50
48
|
});
|
|
51
49
|
expect(console).toThrowError('Plugin "plugin" is already registered.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-api.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/plugin-api.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin-api.test.js","sourceRoot":"","sources":["../../../src/plugin-area/__tests__/plugin-api.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvF,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,SAAS,CAAC,GAAG,EAAE;QACX,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC5B,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACvC,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,MAAM,IAAI,GAAG,QAAQ,CAAC;QACtB,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,gBAAgB,CAAC;QAEzC,cAAc,CAAC,IAAI,EAAE;YACjB,MAAM,EAAE,SAAS;YACjB,IAAI;SACP,CAAC,CAAC;QAEH,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YAC5B,IAAI;YACJ,MAAM,EAAE,SAAS;YACjB,IAAI;SACP,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IAEN,EAAE,CAA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|
|
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
|
-
exports.BasePluginArea = void 0;
|
|
27
|
-
const lodash_1 = require("lodash");
|
|
28
|
-
const React = __importStar(require("react"));
|
|
29
|
-
const hooks_1 = require("@wordpress/hooks");
|
|
30
|
-
const plugin_context_1 = require("./plugin-context");
|
|
31
|
-
const plugin_api_1 = require("./plugin-api");
|
|
1
|
+
import { map } from 'lodash';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { addAction, removeAction } from '@wordpress/hooks';
|
|
4
|
+
import { PluginContextProvider } from './plugin-context';
|
|
5
|
+
import { getPlugins } from './plugin-api';
|
|
32
6
|
/**
|
|
33
7
|
* A component that renders all plugin fills in a hidden div.
|
|
34
8
|
*/
|
|
35
|
-
class BasePluginArea extends React.Component {
|
|
9
|
+
export class BasePluginArea extends React.Component {
|
|
36
10
|
constructor(args) {
|
|
37
11
|
super(args);
|
|
38
12
|
this.setPlugins = this.setPlugins.bind(this);
|
|
@@ -40,7 +14,7 @@ class BasePluginArea extends React.Component {
|
|
|
40
14
|
}
|
|
41
15
|
getCurrentPluginsState() {
|
|
42
16
|
return {
|
|
43
|
-
plugins:
|
|
17
|
+
plugins: map(getPlugins(), ({ icon, name, render }) => {
|
|
44
18
|
return {
|
|
45
19
|
Plugin: render,
|
|
46
20
|
context: {
|
|
@@ -52,13 +26,13 @@ class BasePluginArea extends React.Component {
|
|
|
52
26
|
};
|
|
53
27
|
}
|
|
54
28
|
componentDidMount() {
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
addAction('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered', this.setPlugins);
|
|
30
|
+
addAction('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered', this.setPlugins);
|
|
57
31
|
this.setPlugins();
|
|
58
32
|
}
|
|
59
33
|
componentWillUnMount() {
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
removeAction('plugins.pluginRegistered', 'core/plugins/plugin-area/plugins-registered');
|
|
35
|
+
removeAction('plugins.pluginUnregistered', 'core/plugins/plugin-area/plugins-unregistered');
|
|
62
36
|
}
|
|
63
37
|
setPlugins() {
|
|
64
38
|
this.setState(this.getCurrentPluginsState);
|
|
@@ -70,9 +44,8 @@ class BasePluginArea extends React.Component {
|
|
|
70
44
|
const pluginsState = this.getCurrentPluginsState();
|
|
71
45
|
plugins = pluginsState.plugins;
|
|
72
46
|
}
|
|
73
|
-
return (React.createElement(React.Fragment, null,
|
|
47
|
+
return (React.createElement(React.Fragment, null, map(plugins, ({ context, Plugin }) => (React.createElement(PluginContextProvider, { key: context.name, value: context },
|
|
74
48
|
React.createElement(Plugin, null))))));
|
|
75
49
|
}
|
|
76
50
|
}
|
|
77
|
-
exports.BasePluginArea = BasePluginArea;
|
|
78
51
|
//# sourceMappingURL=base-plugin-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-plugin-area.js","sourceRoot":"","sources":["../../src/plugin-area/base-plugin-area.tsx"],"names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AC5B,+CAA+C,CAChD,CAAC;IACJ,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC7C,CAAC;IAEM,MAAM;QACX,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;YACjC,2EAA2E;YAC3E,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACnD,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;SAChC;QACD,OAAO,CACL,0CACG,GAAG,CAAC,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACrC,oBAAC,qBAAqB,IACpB,GAAG,EAAE,OAAO,CAAC,IAAI,EACjB,KAAK,EAAE,OAAO;YAEd,oBAAC,MAAM,OAAG,CACY,CACzB,CAAC,CACD,CACJ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createHigherOrderComponent = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
1
|
+
import { camelCase, upperFirst } from 'lodash';
|
|
5
2
|
/**
|
|
6
3
|
* Given a function mapping a component to an enhanced component and modifier
|
|
7
4
|
* name, returns the enhanced component augmented with a generated displayName.
|
|
@@ -11,13 +8,12 @@ const lodash_1 = require("lodash");
|
|
|
11
8
|
*
|
|
12
9
|
* @return Component class with generated display name assigned.
|
|
13
10
|
*/
|
|
14
|
-
function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
|
|
11
|
+
export function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
|
|
15
12
|
return (OriginalComponent) => {
|
|
16
13
|
const EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
|
|
17
14
|
const { displayName = OriginalComponent.name || 'Component', } = OriginalComponent;
|
|
18
|
-
EnhancedComponent.displayName = `${
|
|
15
|
+
EnhancedComponent.displayName = `${upperFirst(camelCase(modifierName))}(${displayName})`;
|
|
19
16
|
return EnhancedComponent;
|
|
20
17
|
};
|
|
21
18
|
}
|
|
22
|
-
exports.createHigherOrderComponent = createHigherOrderComponent;
|
|
23
19
|
//# sourceMappingURL=higher-order-component-util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"higher-order-component-util.js","sourceRoot":"","sources":["../../src/plugin-area/higher-order-component-util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"higher-order-component-util.js","sourceRoot":"","sources":["../../src/plugin-area/higher-order-component-util.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACtC,+BAA+B,EAC/B,YAAY;IAEZ,OAAO,CAAE,iBAAiB,EAAG,EAAE;QAC3B,MAAM,iBAAiB,GAAG,+BAA+B,CACrD,iBAAiB,CACpB,CAAC;QACF,MAAM,EACF,WAAW,GAAG,iBAAiB,CAAC,IAAI,IAAI,WAAW,GACtD,GAAG,iBAAiB,CAAC;QACtB,iBAAiB,CAAC,WAAW,GAAG,GAAI,UAAU,CAC1C,SAAS,CAAC,YAAY,CAAC,CAC1B,IAAI,WAAW,GAAG,CAAC;QAEpB,OAAO,iBAAiB,CAAC;IAC7B,CAAC,CAAA;AACL,CAAC"}
|
package/lib/plugin-area/index.js
CHANGED
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.PluginArea = void 0;
|
|
30
|
-
const React = __importStar(require("react"));
|
|
31
|
-
const base_plugin_area_1 = require("./base-plugin-area");
|
|
32
|
-
__exportStar(require("./plugin-api"), exports);
|
|
33
|
-
const PluginArea = () => {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { BasePluginArea } from './base-plugin-area';
|
|
3
|
+
export * from './plugin-api';
|
|
4
|
+
export const PluginArea = () => {
|
|
34
5
|
return React.createElement("div", { style: { display: "none" } },
|
|
35
|
-
React.createElement(
|
|
6
|
+
React.createElement(BasePluginArea, null));
|
|
36
7
|
};
|
|
37
|
-
exports.PluginArea = PluginArea;
|
|
38
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin-area/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugin-area/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,OAAO,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACpC,oBAAC,cAAc,OAAG,CACd,CAAA;AACR,CAAC,CAAA"}
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
1
|
+
import { View } from 'native-base';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { BasePluginArea } from './base-plugin-area';
|
|
4
|
+
export * from './plugin-api';
|
|
5
|
+
export const PluginArea = () => {
|
|
6
|
+
return (React.createElement(View, { style: { display: "none" } },
|
|
7
|
+
React.createElement(BasePluginArea, null)));
|
|
24
8
|
};
|
|
25
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.PluginArea = void 0;
|
|
30
|
-
const native_base_1 = require("native-base");
|
|
31
|
-
const React = __importStar(require("react"));
|
|
32
|
-
const base_plugin_area_1 = require("./base-plugin-area");
|
|
33
|
-
__exportStar(require("./plugin-api"), exports);
|
|
34
|
-
const PluginArea = () => {
|
|
35
|
-
return (React.createElement(native_base_1.View, { style: { display: "none" } },
|
|
36
|
-
React.createElement(base_plugin_area_1.BasePluginArea, null)));
|
|
37
|
-
};
|
|
38
|
-
exports.PluginArea = PluginArea;
|
|
39
9
|
//# sourceMappingURL=index.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/plugin-area/index.native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../../src/plugin-area/index.native.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,cAAc,cAAc,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,OAAO,CACH,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC5B,oBAAC,cAAc,OAAG,CACf,CACV,CAAA;AACL,CAAC,CAAA"}
|