@webiny/app 5.34.8 → 5.35.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.js +15 -37
- package/App.js.map +1 -1
- package/apollo-client/InMemoryCache.js +1 -24
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/components/Image.js +1 -14
- package/components/Image.js.map +1 -1
- package/components/Routes.js +8 -14
- package/components/Routes.js.map +1 -1
- package/components/View.js +3 -14
- package/components/View.js.map +1 -1
- package/components/index.js +0 -2
- package/components/index.js.map +1 -1
- package/config.js +0 -3
- package/config.js.map +1 -1
- package/contexts/Ui/index.js +0 -22
- package/contexts/Ui/index.js.map +1 -1
- package/core/AddRoute.js +1 -8
- package/core/AddRoute.js.map +1 -1
- package/core/DebounceRender.js +5 -15
- package/core/DebounceRender.js.map +1 -1
- package/core/Plugin.d.ts +8 -0
- package/core/Plugin.js +21 -0
- package/core/Plugin.js.map +1 -0
- package/core/Plugins.d.ts +4 -0
- package/core/Plugins.js +6 -13
- package/core/Plugins.js.map +1 -1
- package/core/Provider.js +1 -7
- package/core/Provider.js.map +1 -1
- package/core/Routes.js +6 -13
- package/core/Routes.js.map +1 -1
- package/core/createProvider.d.ts +6 -0
- package/core/createProvider.js +13 -0
- package/core/createProvider.js.map +1 -0
- package/core/createProviderPlugin.d.ts +0 -1
- package/core/createProviderPlugin.js +1 -12
- package/core/createProviderPlugin.js.map +1 -1
- package/hooks/useAutocomplete/index.js +0 -1
- package/hooks/useAutocomplete/index.js.map +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +0 -9
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +0 -4
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +0 -4
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +0 -4
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.js +0 -4
- package/hooks/useDataList/functions/index.js.map +1 -1
- package/hooks/useDataList/functions/searchDataByKey.js +0 -6
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.js +0 -1
- package/hooks/useDataList/index.js.map +1 -1
- package/hooks/useDataList/useDataList.js +6 -32
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.js +0 -3
- package/hooks/useDataList/utils/index.js.map +1 -1
- package/hooks/useDataList/utils/prepareLoadListParams.js +0 -10
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +1 -3
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
- package/hooks/useHandler.js +0 -2
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.js +0 -3
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useUi.js +0 -4
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +0 -7
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.js +0 -2
- package/i18n/index.js.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +24 -18
- package/index.js.map +1 -1
- package/package.json +12 -12
- package/plugins/AddQuerySelectionPlugin.d.ts +8 -1
- package/plugins/AddQuerySelectionPlugin.js +31 -41
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +0 -15
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.js +0 -23
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.js +0 -17
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.js +0 -15
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +0 -5
- package/plugins/LocaleHeaderLinkPlugin.js +2 -26
- package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +5 -25
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +9 -3
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +0 -3
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +8 -15
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.js +3 -20
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +1 -15
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/RoutePlugin.js +0 -15
- package/plugins/RoutePlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +0 -5
- package/plugins/TenantHeaderLinkPlugin.js +2 -27
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/ViewPlugin.js +0 -15
- package/plugins/ViewPlugin.js.map +1 -1
- package/plugins/image.js +12 -45
- package/plugins/image.js.map +1 -1
- package/plugins/index.js +12 -33
- package/plugins/index.js.map +1 -1
- package/types.d.ts +4 -2
- package/types.js +0 -1
- package/types.js.map +1 -1
- package/utils/getApiUrl.d.ts +1 -0
- package/utils/getApiUrl.js +11 -0
- package/utils/getApiUrl.js.map +1 -0
- package/utils/getGqlApiUrl.d.ts +1 -0
- package/utils/getGqlApiUrl.js +11 -0
- package/utils/getGqlApiUrl.js.map +1 -0
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +5 -0
- package/utils/getHeadlessCmsGqlApiUrl.js +17 -0
- package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -0
- package/utils/getLocaleCode.d.ts +6 -0
- package/utils/getLocaleCode.js +42 -0
- package/utils/getLocaleCode.js.map +1 -0
- package/utils/getPrerenderId.d.ts +6 -0
- package/utils/getPrerenderId.js +10 -0
- package/utils/getPrerenderId.js.map +1 -0
- package/utils/getTenantId.d.ts +6 -0
- package/utils/getTenantId.js +34 -0
- package/utils/getTenantId.js.map +1 -0
- package/utils/index.d.ts +8 -0
- package/utils/index.js +93 -0
- package/utils/index.js.map +1 -0
- package/utils/isLocalhost.d.ts +1 -0
- package/utils/isLocalhost.js +14 -0
- package/utils/isLocalhost.js.map +1 -0
- package/utils/isPrerendering.d.ts +1 -0
- package/utils/isPrerendering.js +10 -0
- package/utils/isPrerendering.js.map +1 -0
package/core/DebounceRender.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.DebounceRender = void 0;
|
|
11
|
-
|
|
12
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
17
|
-
|
|
18
12
|
/**
|
|
19
13
|
* We need to debounce the rendering of children during app bootstrap, since many plugins
|
|
20
14
|
* can add more and more Providers which will recompose the entire hierarchy of React Context providers.
|
|
@@ -22,14 +16,12 @@ var _lodash = _interopRequireDefault(require("lodash.debounce"));
|
|
|
22
16
|
*/
|
|
23
17
|
var DebounceRender = function DebounceRender(_ref) {
|
|
24
18
|
var _ref$wait = _ref.wait,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
wait = _ref$wait === void 0 ? 50 : _ref$wait,
|
|
20
|
+
children = _ref.children;
|
|
28
21
|
var _useState = (0, _react.useState)(wait === 0),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
+
render = _useState2[0],
|
|
24
|
+
setRender = _useState2[1];
|
|
33
25
|
var debouncedRender = (0, _react.useMemo)(function () {
|
|
34
26
|
return (0, _lodash.default)(function () {
|
|
35
27
|
setRender(true);
|
|
@@ -39,7 +31,6 @@ var DebounceRender = function DebounceRender(_ref) {
|
|
|
39
31
|
if (render) {
|
|
40
32
|
return;
|
|
41
33
|
}
|
|
42
|
-
|
|
43
34
|
debouncedRender();
|
|
44
35
|
return function () {
|
|
45
36
|
debouncedRender.cancel();
|
|
@@ -47,5 +38,4 @@ var DebounceRender = function DebounceRender(_ref) {
|
|
|
47
38
|
}, []);
|
|
48
39
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, render ? children : null);
|
|
49
40
|
};
|
|
50
|
-
|
|
51
41
|
exports.DebounceRender = DebounceRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DebounceRender","wait","children","useState","render","setRender","debouncedRender","useMemo","debounce","useEffect","cancel"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash.debounce\";\n\ninterface Props {\n wait?: number;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender: React.FC<Props> = ({ wait = 50, children }) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["DebounceRender","wait","children","useState","render","setRender","debouncedRender","useMemo","debounce","useEffect","cancel"],"sources":["DebounceRender.tsx"],"sourcesContent":["import React from \"react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport debounce from \"lodash.debounce\";\n\ninterface Props {\n wait?: number;\n}\n/**\n * We need to debounce the rendering of children during app bootstrap, since many plugins\n * can add more and more Providers which will recompose the entire hierarchy of React Context providers.\n * During this stage, we don't want to render anything.\n */\nexport const DebounceRender: React.FC<Props> = ({ wait = 50, children }) => {\n const [render, setRender] = useState(wait === 0);\n\n const debouncedRender = useMemo(() => {\n return debounce(() => {\n setRender(true);\n }, wait);\n }, [setRender]);\n\n useEffect(() => {\n if (render) {\n return;\n }\n\n debouncedRender();\n\n return () => {\n debouncedRender.cancel();\n };\n }, []);\n\n return <>{render ? children : null}</>;\n};\n"],"mappings":";;;;;;;;;AAAA;AAEA;AAKA;AACA;AACA;AACA;AACA;AACO,IAAMA,cAA+B,GAAG,SAAlCA,cAA+B,OAAgC;EAAA,qBAA1BC,IAAI;IAAJA,IAAI,0BAAG,EAAE;IAAEC,QAAQ,QAARA,QAAQ;EACjE,gBAA4B,IAAAC,eAAQ,EAACF,IAAI,KAAK,CAAC,CAAC;IAAA;IAAzCG,MAAM;IAAEC,SAAS;EAExB,IAAMC,eAAe,GAAG,IAAAC,cAAO,EAAC,YAAM;IAClC,OAAO,IAAAC,eAAQ,EAAC,YAAM;MAClBH,SAAS,CAAC,IAAI,CAAC;IACnB,CAAC,EAAEJ,IAAI,CAAC;EACZ,CAAC,EAAE,CAACI,SAAS,CAAC,CAAC;EAEf,IAAAI,gBAAS,EAAC,YAAM;IACZ,IAAIL,MAAM,EAAE;MACR;IACJ;IAEAE,eAAe,EAAE;IAEjB,OAAO,YAAM;MACTA,eAAe,CAACI,MAAM,EAAE;IAC5B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,oBAAO,4DAAGN,MAAM,GAAGF,QAAQ,GAAG,IAAI,CAAI;AAC1C,CAAC;AAAC"}
|
package/core/Plugin.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HigherOrderComponent } from "@webiny/react-composition";
|
|
3
|
+
interface PluginProps {
|
|
4
|
+
providers?: HigherOrderComponent[];
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const Plugin: React.NamedExoticComponent<PluginProps>;
|
|
8
|
+
export {};
|
package/core/Plugin.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Plugin = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Provider = require("./Provider");
|
|
10
|
+
var _Plugins = require("./Plugins");
|
|
11
|
+
var Plugin = /*#__PURE__*/_react.default.memo(function Plugin(_ref) {
|
|
12
|
+
var providers = _ref.providers,
|
|
13
|
+
children = _ref.children;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (providers || []).map(function (provider, index) {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_Provider.Provider, {
|
|
16
|
+
key: index,
|
|
17
|
+
hoc: provider
|
|
18
|
+
});
|
|
19
|
+
}), children ? /*#__PURE__*/_react.default.createElement(_Plugins.Plugins, null, children) : null);
|
|
20
|
+
});
|
|
21
|
+
exports.Plugin = Plugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Plugin","React","memo","providers","children","map","provider","index"],"sources":["Plugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { Provider } from \"./Provider\";\nimport { Plugins } from \"./Plugins\";\nimport { HigherOrderComponent } from \"@webiny/react-composition\";\n\ninterface PluginProps {\n providers?: HigherOrderComponent[];\n children?: React.ReactNode;\n}\n\nexport const Plugin = React.memo(function Plugin({ providers, children }: PluginProps) {\n return (\n <>\n {(providers || []).map((provider, index) => (\n <Provider key={index} hoc={provider} />\n ))}\n {children ? <Plugins>{children}</Plugins> : null}\n </>\n );\n});\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAQO,IAAMA,MAAM,gBAAGC,cAAK,CAACC,IAAI,CAAC,SAASF,MAAM,OAAuC;EAAA,IAApCG,SAAS,QAATA,SAAS;IAAEC,QAAQ,QAARA,QAAQ;EAClE,oBACI,4DACK,CAACD,SAAS,IAAI,EAAE,EAAEE,GAAG,CAAC,UAACC,QAAQ,EAAEC,KAAK;IAAA,oBACnC,6BAAC,kBAAQ;MAAC,GAAG,EAAEA,KAAM;MAAC,GAAG,EAAED;IAAS,EAAG;EAAA,CAC1C,CAAC,EACDF,QAAQ,gBAAG,6BAAC,gBAAO,QAAEA,QAAQ,CAAW,GAAG,IAAI,CACjD;AAEX,CAAC,CAAC;AAAC"}
|
package/core/Plugins.d.ts
CHANGED
|
@@ -4,5 +4,9 @@ interface PluginsProviderComponentProps {
|
|
|
4
4
|
children: JSX.Element[];
|
|
5
5
|
}
|
|
6
6
|
export declare const PluginsProvider: React.NamedExoticComponent<PluginsProviderComponentProps>;
|
|
7
|
+
/**
|
|
8
|
+
* @param children
|
|
9
|
+
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
10
|
+
*/
|
|
7
11
|
export declare const Plugins: React.FC;
|
|
8
12
|
export {};
|
package/core/Plugins.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.PluginsProvider = exports.PluginsContext = exports.Plugins = void 0;
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
9
|
var _App = require("../App");
|
|
13
|
-
|
|
14
10
|
var PluginsContext = /*#__PURE__*/(0, _react.createContext)(false);
|
|
15
11
|
exports.PluginsContext = PluginsContext;
|
|
16
12
|
PluginsContext.displayName = "PluginsContext";
|
|
17
|
-
|
|
18
13
|
var PluginsProviderComponent = function PluginsProviderComponent(_ref) {
|
|
19
14
|
var children = _ref.children;
|
|
20
|
-
|
|
21
15
|
/**
|
|
22
16
|
* This context only serves as a safeguard. We need to warn users when they mount a plugin without using
|
|
23
17
|
* the <Plugins> component. In that case, the context will not be available, and we can log warnings.
|
|
@@ -26,27 +20,26 @@ var PluginsProviderComponent = function PluginsProviderComponent(_ref) {
|
|
|
26
20
|
value: true
|
|
27
21
|
}, children);
|
|
28
22
|
};
|
|
29
|
-
|
|
30
23
|
var PluginsProvider = /*#__PURE__*/(0, _react.memo)(PluginsProviderComponent);
|
|
31
|
-
exports.PluginsProvider = PluginsProvider;
|
|
32
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @param children
|
|
27
|
+
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
28
|
+
*/
|
|
29
|
+
exports.PluginsProvider = PluginsProvider;
|
|
33
30
|
var Plugins = function Plugins(_ref2) {
|
|
34
31
|
var children = _ref2.children;
|
|
35
|
-
|
|
36
32
|
var _useApp = (0, _App.useApp)(),
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
addPlugin = _useApp.addPlugin;
|
|
39
34
|
var hasParentPlugin = (0, _react.useContext)(PluginsContext);
|
|
40
35
|
(0, _react.useEffect)(function () {
|
|
41
36
|
if (hasParentPlugin) {
|
|
42
37
|
return;
|
|
43
38
|
}
|
|
44
|
-
|
|
45
39
|
_react.Children.forEach(children, function (child) {
|
|
46
40
|
return addPlugin(child);
|
|
47
41
|
});
|
|
48
42
|
}, []);
|
|
49
43
|
return hasParentPlugin ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children) : null;
|
|
50
44
|
};
|
|
51
|
-
|
|
52
45
|
exports.Plugins = Plugins;
|
package/core/Plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PluginsContext","createContext","displayName","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","useApp","addPlugin","hasParentPlugin","useContext","useEffect","Children","forEach","child"],"sources":["Plugins.tsx"],"sourcesContent":["import React, { Fragment, Children, createContext, useContext, useEffect, memo } from \"react\";\nimport { useApp } from \"~/App\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: JSX.Element[];\n}\nconst PluginsProviderComponent: React.FC<PluginsProviderComponentProps> = ({ children }) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\nexport const Plugins: React.FC = ({ children }) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["PluginsContext","createContext","displayName","PluginsProviderComponent","children","PluginsProvider","memo","Plugins","useApp","addPlugin","hasParentPlugin","useContext","useEffect","Children","forEach","child"],"sources":["Plugins.tsx"],"sourcesContent":["import React, { Fragment, Children, createContext, useContext, useEffect, memo } from \"react\";\nimport { useApp } from \"~/App\";\n\nexport const PluginsContext = createContext<boolean>(false);\nPluginsContext.displayName = \"PluginsContext\";\n\ninterface PluginsProviderComponentProps {\n children: JSX.Element[];\n}\nconst PluginsProviderComponent: React.FC<PluginsProviderComponentProps> = ({ children }) => {\n /**\n * This context only serves as a safeguard. We need to warn users when they mount a plugin without using\n * the <Plugins> component. In that case, the context will not be available, and we can log warnings.\n */\n return <PluginsContext.Provider value={true}>{children}</PluginsContext.Provider>;\n};\n\nexport const PluginsProvider = memo(PluginsProviderComponent);\n\n/**\n * @param children\n * @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.\n */\nexport const Plugins: React.FC = ({ children }) => {\n const { addPlugin } = useApp();\n const hasParentPlugin = useContext(PluginsContext);\n\n useEffect(() => {\n if (hasParentPlugin) {\n return;\n }\n\n Children.forEach(children, child => addPlugin(child));\n }, []);\n\n return hasParentPlugin ? <Fragment>{children}</Fragment> : null;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,IAAMA,cAAc,gBAAG,IAAAC,oBAAa,EAAU,KAAK,CAAC;AAAC;AAC5DD,cAAc,CAACE,WAAW,GAAG,gBAAgB;AAK7C,IAAMC,wBAAiE,GAAG,SAApEA,wBAAiE,OAAqB;EAAA,IAAfC,QAAQ,QAARA,QAAQ;EACjF;AACJ;AACA;AACA;EACI,oBAAO,6BAAC,cAAc,CAAC,QAAQ;IAAC,KAAK,EAAE;EAAK,GAAEA,QAAQ,CAA2B;AACrF,CAAC;AAEM,IAAMC,eAAe,gBAAG,IAAAC,WAAI,EAACH,wBAAwB,CAAC;;AAE7D;AACA;AACA;AACA;AAHA;AAIO,IAAMI,OAAiB,GAAG,SAApBA,OAAiB,QAAqB;EAAA,IAAfH,QAAQ,SAARA,QAAQ;EACxC,cAAsB,IAAAI,WAAM,GAAE;IAAtBC,SAAS,WAATA,SAAS;EACjB,IAAMC,eAAe,GAAG,IAAAC,iBAAU,EAACX,cAAc,CAAC;EAElD,IAAAY,gBAAS,EAAC,YAAM;IACZ,IAAIF,eAAe,EAAE;MACjB;IACJ;IAEAG,eAAQ,CAACC,OAAO,CAACV,QAAQ,EAAE,UAAAW,KAAK;MAAA,OAAIN,SAAS,CAACM,KAAK,CAAC;IAAA,EAAC;EACzD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOL,eAAe,gBAAG,6BAAC,eAAQ,QAAEN,QAAQ,CAAY,GAAG,IAAI;AACnE,CAAC;AAAC"}
|
package/core/Provider.js
CHANGED
|
@@ -4,24 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.Provider = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
var _ = require("./..");
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Register a new React context provider.
|
|
14
11
|
*/
|
|
15
12
|
var Provider = function Provider(_ref) {
|
|
16
13
|
var hoc = _ref.hoc;
|
|
17
|
-
|
|
18
14
|
var _useApp = (0, _.useApp)(),
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
addProvider = _useApp.addProvider;
|
|
21
16
|
(0, _react.useEffect)(function () {
|
|
22
17
|
return addProvider(hoc);
|
|
23
18
|
}, []);
|
|
24
19
|
return null;
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
exports.Provider = Provider;
|
package/core/Provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Provider","hoc","useApp","addProvider","useEffect"],"sources":["Provider.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { HigherOrderComponent, useApp } from \"~/index\";\n\nexport interface ProviderProps {\n hoc: HigherOrderComponent;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider: React.FC<ProviderProps> = ({ hoc }) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Provider","hoc","useApp","addProvider","useEffect"],"sources":["Provider.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\nimport { HigherOrderComponent, useApp } from \"~/index\";\n\nexport interface ProviderProps {\n hoc: HigherOrderComponent;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider: React.FC<ProviderProps> = ({ hoc }) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"mappings":";;;;;;AAAA;AACA;AAMA;AACA;AACA;AACO,IAAMA,QAAiC,GAAG,SAApCA,QAAiC,OAAgB;EAAA,IAAVC,GAAG,QAAHA,GAAG;EACnD,cAAwB,IAAAC,QAAM,GAAE;IAAxBC,WAAW,WAAXA,WAAW;EAEnB,IAAAC,gBAAS,EAAC,YAAM;IACZ,OAAOD,WAAW,CAACF,GAAG,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACf,CAAC;AAAC"}
|
package/core/Routes.js
CHANGED
|
@@ -1,42 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Routes = void 0;
|
|
9
|
-
|
|
10
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _plugins = require("@webiny/plugins");
|
|
15
|
-
|
|
16
11
|
var _reactRouter = require("@webiny/react-router");
|
|
17
|
-
|
|
18
12
|
var Routes = function Routes(props) {
|
|
19
13
|
var routes = [].concat((0, _toConsumableArray2.default)(props.routes), (0, _toConsumableArray2.default)(_plugins.plugins.byType("route").map(function (_ref) {
|
|
20
14
|
var route = _ref.route;
|
|
21
15
|
return route;
|
|
22
16
|
}))).sort(function (a, b) {
|
|
23
17
|
var pathA = a.props.path || "*";
|
|
24
|
-
var pathB = b.props.path || "*";
|
|
18
|
+
var pathB = b.props.path || "*";
|
|
25
19
|
|
|
20
|
+
// This will sort paths at the very bottom of the list
|
|
26
21
|
if (pathA === "/" && pathB === "*") {
|
|
27
22
|
return -1;
|
|
28
|
-
}
|
|
29
|
-
|
|
23
|
+
}
|
|
30
24
|
|
|
25
|
+
// This will push * and / to the bottom of the list
|
|
31
26
|
if (pathA === "*" || pathA === "/") {
|
|
32
27
|
return 1;
|
|
33
|
-
}
|
|
34
|
-
|
|
28
|
+
}
|
|
35
29
|
|
|
30
|
+
// This will push * and / to the bottom of the list
|
|
36
31
|
if (["*", "/"].includes(pathB)) {
|
|
37
32
|
return -1;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
return 0;
|
|
41
35
|
});
|
|
42
36
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Routes, null, routes.map(function (route, index) {
|
|
@@ -45,5 +39,4 @@ var Routes = function Routes(props) {
|
|
|
45
39
|
});
|
|
46
40
|
}));
|
|
47
41
|
};
|
|
48
|
-
|
|
49
42
|
exports.Routes = Routes;
|
package/core/Routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Routes","props","routes","plugins","byType","map","route","sort","a","b","pathA","path","pathB","includes","index","React","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport { RoutePlugin } from \"~/types\";\n\ninterface RoutesProps {\n routes: JSX.Element[];\n}\n\nexport const Routes: React.FC<RoutesProps> = props => {\n const routes = [\n ...props.routes,\n // For backwards compatibility, we need to support the RoutePlugin routes as well.\n ...plugins.byType<RoutePlugin>(\"route\").map(({ route }) => route)\n ].sort((a, b) => {\n const pathA = a.props.path || \"*\";\n const pathB = b.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map((route, index) =>\n React.cloneElement(route, { key: `${route.props.path}:${index}` })\n )}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Routes","props","routes","plugins","byType","map","route","sort","a","b","pathA","path","pathB","includes","index","React","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport { RoutePlugin } from \"~/types\";\n\ninterface RoutesProps {\n routes: JSX.Element[];\n}\n\nexport const Routes: React.FC<RoutesProps> = props => {\n const routes = [\n ...props.routes,\n // For backwards compatibility, we need to support the RoutePlugin routes as well.\n ...plugins.byType<RoutePlugin>(\"route\").map(({ route }) => route)\n ].sort((a, b) => {\n const pathA = a.props.path || \"*\";\n const pathB = b.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map((route, index) =>\n React.cloneElement(route, { key: `${route.props.path}:${index}` })\n )}\n </ReactRouterRoutes>\n );\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AAOO,IAAMA,MAA6B,GAAG,SAAhCA,MAA6B,CAAGC,KAAK,EAAI;EAClD,IAAMC,MAAM,GAAG,2CACRD,KAAK,CAACC,MAAM,oCAEZC,gBAAO,CAACC,MAAM,CAAc,OAAO,CAAC,CAACC,GAAG,CAAC;IAAA,IAAGC,KAAK,QAALA,KAAK;IAAA,OAAOA,KAAK;EAAA,EAAC,GACnEC,IAAI,CAAC,UAACC,CAAC,EAAEC,CAAC,EAAK;IACb,IAAMC,KAAK,GAAGF,CAAC,CAACP,KAAK,CAACU,IAAI,IAAI,GAAG;IACjC,IAAMC,KAAK,GAAGH,CAAC,CAACR,KAAK,CAACU,IAAI,IAAI,GAAG;;IAEjC;IACA,IAAID,KAAK,KAAK,GAAG,IAAIE,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC,CAAC;IACb;;IAEA;IACA,IAAIF,KAAK,KAAK,GAAG,IAAIA,KAAK,KAAK,GAAG,EAAE;MAChC,OAAO,CAAC;IACZ;;IAEA;IACA,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAACG,QAAQ,CAACD,KAAK,CAAC,EAAE;MAC5B,OAAO,CAAC,CAAC;IACb;IAEA,OAAO,CAAC;EACZ,CAAC,CAAC;EAEF,oBACI,6BAAC,mBAAiB,QACbV,MAAM,CAACG,GAAG,CAAC,UAACC,KAAK,EAAEQ,KAAK;IAAA,oBACrBC,cAAK,CAACC,YAAY,CAACV,KAAK,EAAE;MAAEW,GAAG,YAAKX,KAAK,CAACL,KAAK,CAACU,IAAI,cAAIG,KAAK;IAAG,CAAC,CAAC;EAAA,EACrE,CACe;AAE5B,CAAC;AAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HigherOrderComponent } from "@webiny/react-composition";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Higher Order Component which is meant to wrap the entire app content.
|
|
4
|
+
* This is mostly useful for adding React Context providers.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createProvider(hoc: HigherOrderComponent): HigherOrderComponent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createProvider = createProvider;
|
|
7
|
+
/**
|
|
8
|
+
* Creates a Higher Order Component which is meant to wrap the entire app content.
|
|
9
|
+
* This is mostly useful for adding React Context providers.
|
|
10
|
+
*/
|
|
11
|
+
function createProvider(hoc) {
|
|
12
|
+
return hoc;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createProvider","hoc"],"sources":["createProvider.tsx"],"sourcesContent":["import { HigherOrderComponent } from \"@webiny/react-composition\";\n\n/**\n * Creates a Higher Order Component which is meant to wrap the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(hoc: HigherOrderComponent): HigherOrderComponent {\n return hoc;\n}\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACO,SAASA,cAAc,CAACC,GAAyB,EAAwB;EAC5E,OAAOA,GAAG;AACd"}
|
|
@@ -6,4 +6,3 @@ import { HigherOrderComponent } from "@webiny/react-composition";
|
|
|
6
6
|
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
|
|
7
7
|
*/
|
|
8
8
|
export declare function createProviderPlugin(hoc: HigherOrderComponent): React.FC;
|
|
9
|
-
export declare const createProvider: (hoc: HigherOrderComponent) => HigherOrderComponent;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.createProvider = void 0;
|
|
9
7
|
exports.createProviderPlugin = createProviderPlugin;
|
|
10
|
-
|
|
11
8
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
9
|
var _Provider = require("./Provider");
|
|
14
|
-
|
|
15
10
|
/**
|
|
16
11
|
* Creates a component, which, when mounted, will register an app provider.
|
|
17
12
|
* This is particularly useful for wrapping the entire app with custom React Context providers.
|
|
@@ -23,10 +18,4 @@ function createProviderPlugin(hoc) {
|
|
|
23
18
|
hoc: hoc
|
|
24
19
|
});
|
|
25
20
|
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var createProvider = function createProvider(hoc) {
|
|
29
|
-
return hoc;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.createProvider = createProvider;
|
|
21
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createProviderPlugin","hoc","ProviderPlugin"
|
|
1
|
+
{"version":3,"names":["createProviderPlugin","hoc","ProviderPlugin"],"sources":["createProviderPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport { HigherOrderComponent } from \"@webiny/react-composition\";\nimport { Provider } from \"./Provider\";\n\n/**\n * Creates a component, which, when mounted, will register an app provider.\n * This is particularly useful for wrapping the entire app with custom React Context providers.\n * For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.\n */\nexport function createProviderPlugin(hoc: HigherOrderComponent): React.FC {\n return function ProviderPlugin() {\n return <Provider hoc={hoc} />;\n };\n}\n"],"mappings":";;;;;;;AAAA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAoB,CAACC,GAAyB,EAAY;EACtE,OAAO,SAASC,cAAc,GAAG;IAC7B,oBAAO,6BAAC,kBAAQ;MAAC,GAAG,EAAED;IAAI,EAAG;EACjC,CAAC;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":";;;;;;;;;;;AAAA"}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useAutocomplete = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
|
13
|
-
|
|
14
10
|
var _useDataList = require("../useDataList");
|
|
15
|
-
|
|
16
11
|
var useAutocomplete = function useAutocomplete(props) {
|
|
17
12
|
var dataList = (0, _useDataList.useDataList)((0, _objectSpread2.default)({
|
|
18
13
|
useRouter: false
|
|
@@ -23,16 +18,12 @@ var useAutocomplete = function useAutocomplete(props) {
|
|
|
23
18
|
if (!query) {
|
|
24
19
|
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
var search = props.search || query;
|
|
28
|
-
|
|
29
22
|
if (typeof search === "function") {
|
|
30
23
|
search = search(query);
|
|
31
24
|
}
|
|
32
|
-
|
|
33
25
|
dataList.setSearch(search);
|
|
34
26
|
}, 250)
|
|
35
27
|
};
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
exports.useAutocomplete = useAutocomplete;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAutocomplete","props","dataList","useDataList","useRouter","options","data","onInput","query","search","setSearch"],"sources":["useAutocomplete.ts"],"sourcesContent":["import { useDataList } from \"../useDataList\";\nimport { debounce } from \"lodash\";\nimport { DocumentNode } from \"graphql\";\n\ninterface UseAutocompleteHook {\n options: any[];\n onInput(value: string): void;\n}\n\ninterface Props {\n query: DocumentNode;\n search?: string | ((value: string) => string);\n}\n\nexport const useAutocomplete = (props: Props): UseAutocompleteHook => {\n const dataList = useDataList({ useRouter: false, ...props });\n\n return {\n options: dataList.data || [],\n onInput: debounce(query => {\n if (!query) {\n return;\n }\n\n let search = props.search || query;\n if (typeof search === \"function\") {\n search = search(query);\n }\n\n dataList.setSearch(search);\n }, 250)\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useAutocomplete","props","dataList","useDataList","useRouter","options","data","onInput","query","search","setSearch"],"sources":["useAutocomplete.ts"],"sourcesContent":["import { useDataList } from \"../useDataList\";\nimport { debounce } from \"lodash\";\nimport { DocumentNode } from \"graphql\";\n\ninterface UseAutocompleteHook {\n options: any[];\n onInput(value: string): void;\n}\n\ninterface Props {\n query: DocumentNode;\n search?: string | ((value: string) => string);\n}\n\nexport const useAutocomplete = (props: Props): UseAutocompleteHook => {\n const dataList = useDataList({ useRouter: false, ...props });\n\n return {\n options: dataList.data || [],\n onInput: debounce(query => {\n if (!query) {\n return;\n }\n\n let search = props.search || query;\n if (typeof search === \"function\") {\n search = search(query);\n }\n\n dataList.setSearch(search);\n }, 250)\n };\n};\n"],"mappings":";;;;;;;;;AAAA;AAcO,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAY,EAA0B;EAClE,IAAMC,QAAQ,GAAG,IAAAC,wBAAW;IAAGC,SAAS,EAAE;EAAK,GAAKH,KAAK,EAAG;EAE5D,OAAO;IACHI,OAAO,EAAEH,QAAQ,CAACI,IAAI,IAAI,EAAE;IAC5BC,OAAO,EAAE,wBAAS,UAAAC,KAAK,EAAI;MACvB,IAAI,CAACA,KAAK,EAAE;QACR;MACJ;MAEA,IAAIC,MAAM,GAAGR,KAAK,CAACQ,MAAM,IAAID,KAAK;MAClC,IAAI,OAAOC,MAAM,KAAK,UAAU,EAAE;QAC9BA,MAAM,GAAGA,MAAM,CAACD,KAAK,CAAC;MAC1B;MAEAN,QAAQ,CAACQ,SAAS,CAACD,MAAM,CAAC;IAC9B,CAAC,EAAE,GAAG;EACV,CAAC;AACL,CAAC;AAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
11
|
-
|
|
12
9
|
var _default = function _default(response) {
|
|
13
10
|
return (0, _searchDataByKey.default)("data", response);
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["response","searchDataByKey"],"sources":["getData.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"data\", response);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["response","searchDataByKey"],"sources":["getData.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"data\", response);\n"],"mappings":";;;;;;;AAAA;AAAgD,eAEjC,kBAACA,QAAgC;EAAA,OAAK,IAAAC,wBAAe,EAAC,MAAM,EAAED,QAAQ,CAAC;AAAA;AAAA"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
11
|
-
|
|
12
9
|
var _default = function _default(response) {
|
|
13
10
|
return (0, _searchDataByKey.default)("error", response);
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["response","searchDataByKey"],"sources":["getError.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"error\", response);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["response","searchDataByKey"],"sources":["getError.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"error\", response);\n"],"mappings":";;;;;;;AAAA;AAAgD,eAEjC,kBAACA,QAAgC;EAAA,OAAK,IAAAC,wBAAe,EAAC,OAAO,EAAED,QAAQ,CAAC;AAAA;AAAA"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
11
|
-
|
|
12
9
|
var _default = function _default(response) {
|
|
13
10
|
return (0, _searchDataByKey.default)("meta", response);
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["response","searchDataByKey"],"sources":["getMeta.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"meta\", response);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["response","searchDataByKey"],"sources":["getMeta.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"meta\", response);\n"],"mappings":";;;;;;;AAAA;AAAgD,eAEjC,kBAACA,QAAgC;EAAA,OAAK,IAAAC,wBAAe,EAAC,MAAM,EAAED,QAAQ,CAAC;AAAA;AAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -23,9 +22,6 @@ Object.defineProperty(exports, "getMeta", {
|
|
|
23
22
|
return _getMeta.default;
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
|
-
|
|
27
25
|
var _getData = _interopRequireDefault(require("./getData"));
|
|
28
|
-
|
|
29
26
|
var _getError = _interopRequireDefault(require("./getError"));
|
|
30
|
-
|
|
31
27
|
var _getMeta = _interopRequireDefault(require("./getMeta"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as getData } from \"./getData\";\nexport { default as getError } from \"./getError\";\nexport { default as getMeta } from \"./getMeta\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as getData } from \"./getData\";\nexport { default as getError } from \"./getError\";\nexport { default as getMeta } from \"./getMeta\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA"}
|
|
@@ -4,26 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var searchDataByKey = function searchDataByKey(searchKey, object) {
|
|
9
8
|
if (!object || typeof object !== "object") {
|
|
10
9
|
return null;
|
|
11
10
|
}
|
|
12
|
-
|
|
13
11
|
if (object[searchKey]) {
|
|
14
12
|
return object[searchKey];
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
for (var key in object) {
|
|
18
15
|
var value = searchDataByKey(searchKey, object[key]);
|
|
19
|
-
|
|
20
16
|
if (value) {
|
|
21
17
|
return value;
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
|
-
|
|
25
20
|
return null;
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
var _default = searchDataByKey;
|
|
29
23
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["searchDataByKey","searchKey","object","key","value"],"sources":["searchDataByKey.ts"],"sourcesContent":["const searchDataByKey = (searchKey: string, object: Record<string, any>): string | null => {\n if (!object || typeof object !== \"object\") {\n return null;\n }\n\n if (object[searchKey]) {\n return object[searchKey];\n }\n\n for (const key in object) {\n const value = searchDataByKey(searchKey, object[key]);\n if (value) {\n return value;\n }\n }\n\n return null;\n};\n\nexport default searchDataByKey;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["searchDataByKey","searchKey","object","key","value"],"sources":["searchDataByKey.ts"],"sourcesContent":["const searchDataByKey = (searchKey: string, object: Record<string, any>): string | null => {\n if (!object || typeof object !== \"object\") {\n return null;\n }\n\n if (object[searchKey]) {\n return object[searchKey];\n }\n\n for (const key in object) {\n const value = searchDataByKey(searchKey, object[key]);\n if (value) {\n return value;\n }\n }\n\n return null;\n};\n\nexport default searchDataByKey;\n"],"mappings":";;;;;;AAAA,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,SAAiB,EAAEC,MAA2B,EAAoB;EACvF,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IACvC,OAAO,IAAI;EACf;EAEA,IAAIA,MAAM,CAACD,SAAS,CAAC,EAAE;IACnB,OAAOC,MAAM,CAACD,SAAS,CAAC;EAC5B;EAEA,KAAK,IAAME,GAAG,IAAID,MAAM,EAAE;IACtB,IAAME,KAAK,GAAGJ,eAAe,CAACC,SAAS,EAAEC,MAAM,CAACC,GAAG,CAAC,CAAC;IACrD,IAAIC,KAAK,EAAE;MACP,OAAOA,KAAK;IAChB;EACJ;EAEA,OAAO,IAAI;AACf,CAAC;AAAC,eAEaJ,eAAe;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList\";\n"],"mappings":";;;;;;;;;;;AAAA"}
|