@webiny/app 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f
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.d.ts +12 -15
- package/App.js +72 -82
- package/App.js.map +1 -1
- package/AppContainer.d.ts +23 -0
- package/AppContainer.js +9 -0
- package/AppContainer.js.map +1 -0
- package/apollo-client/InMemoryCache.d.ts +3 -2
- package/apollo-client/InMemoryCache.js +18 -54
- package/apollo-client/InMemoryCache.js.map +1 -1
- package/apollo-client/IntrospectionFragmentMatcher.d.ts +11 -0
- package/apollo-client/IntrospectionFragmentMatcher.js +45 -0
- package/apollo-client/IntrospectionFragmentMatcher.js.map +1 -0
- package/components/Image.d.ts +3 -3
- package/components/Image.js +13 -20
- package/components/Image.js.map +1 -1
- package/components/Routes.d.ts +2 -2
- package/components/Routes.js +15 -24
- package/components/Routes.js.map +1 -1
- package/components/View.d.ts +1 -1
- package/components/View.js +16 -27
- package/components/View.js.map +1 -1
- package/components/index.js +3 -18
- package/components/index.js.map +1 -1
- package/config/RouterConfig/Route.d.ts +30 -0
- package/config/RouterConfig/Route.js +42 -0
- package/config/RouterConfig/Route.js.map +1 -0
- package/config/RouterConfig.d.ts +32 -0
- package/config/RouterConfig.js +18 -0
- package/config/RouterConfig.js.map +1 -0
- package/config.d.ts +1 -1
- package/config.js +9 -14
- package/config.js.map +1 -1
- package/contexts/Ui/index.d.ts +4 -4
- package/contexts/Ui/index.js +30 -57
- package/contexts/Ui/index.js.map +1 -1
- package/core/DebounceRender.d.ts +2 -1
- package/core/DebounceRender.js +15 -25
- package/core/DebounceRender.js.map +1 -1
- package/core/Plugin.d.ts +2 -2
- package/core/Plugin.js +13 -20
- package/core/Plugin.js.map +1 -1
- package/core/Plugins.d.ts +5 -2
- package/core/Plugins.js +21 -27
- package/core/Plugins.js.map +1 -1
- package/core/Provider.d.ts +3 -4
- package/core/Provider.js +11 -14
- package/core/Provider.js.map +1 -1
- package/core/Routes.d.ts +1 -1
- package/core/Routes.js +16 -24
- package/core/Routes.js.map +1 -1
- package/core/createProvider.d.ts +7 -3
- package/core/createProvider.js +6 -10
- package/core/createProvider.js.map +1 -1
- package/core/createProviderPlugin.d.ts +2 -2
- package/core/createProviderPlugin.js +8 -12
- package/core/createProviderPlugin.js.map +1 -1
- package/hooks/useAutocomplete/index.js +2 -11
- package/hooks/useAutocomplete/index.js.map +1 -1
- package/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/hooks/useAutocomplete/useAutocomplete.js +11 -17
- package/hooks/useAutocomplete/useAutocomplete.js.map +1 -1
- package/hooks/useDataList/functions/getData.js +3 -11
- package/hooks/useDataList/functions/getData.js.map +1 -1
- package/hooks/useDataList/functions/getError.js +3 -11
- package/hooks/useDataList/functions/getError.js.map +1 -1
- package/hooks/useDataList/functions/getMeta.js +3 -11
- package/hooks/useDataList/functions/getMeta.js.map +1 -1
- package/hooks/useDataList/functions/index.js +4 -26
- package/hooks/useDataList/functions/index.js.map +1 -1
- package/hooks/useDataList/functions/searchDataByKey.js +6 -11
- package/hooks/useDataList/functions/searchDataByKey.js.map +1 -1
- package/hooks/useDataList/index.js +2 -11
- package/hooks/useDataList/index.js.map +1 -1
- package/hooks/useDataList/useDataList.d.ts +2 -2
- package/hooks/useDataList/useDataList.js +80 -79
- package/hooks/useDataList/useDataList.js.map +1 -1
- package/hooks/useDataList/utils/index.js +3 -19
- package/hooks/useDataList/utils/index.js.map +1 -1
- package/hooks/useDataList/utils/prepareLoadListParams.d.ts +1 -2
- package/hooks/useDataList/utils/prepareLoadListParams.js +34 -34
- package/hooks/useDataList/utils/prepareLoadListParams.js.map +1 -1
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js +12 -15
- package/hooks/useDataList/utils/redirectToRouteWithQueryParams.js.map +1 -1
- package/hooks/useDataList/utils/types.d.ts +21 -15
- package/hooks/useDataList/utils/types.js +2 -4
- package/hooks/useDataList/utils/types.js.map +1 -1
- package/hooks/useHandler.js +14 -13
- package/hooks/useHandler.js.map +1 -1
- package/hooks/useHandlers.d.ts +3 -3
- package/hooks/useHandlers.js +14 -18
- package/hooks/useHandlers.js.map +1 -1
- package/hooks/useRegisterLegacyPlugin.d.ts +2 -0
- package/hooks/useRegisterLegacyPlugin.js +11 -0
- package/hooks/useRegisterLegacyPlugin.js.map +1 -0
- package/hooks/useUi.d.ts +1 -1
- package/hooks/useUi.js +6 -11
- package/hooks/useUi.js.map +1 -1
- package/i18n/i18n.js +6 -13
- package/i18n/i18n.js.map +1 -1
- package/i18n/index.js +2 -12
- package/i18n/index.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.js +19 -146
- package/index.js.map +1 -1
- package/package.json +25 -33
- package/plugins/AddQuerySelectionPlugin.d.ts +9 -2
- package/plugins/AddQuerySelectionPlugin.js +65 -94
- package/plugins/AddQuerySelectionPlugin.js.map +1 -1
- package/plugins/ApolloCacheObjectIdPlugin.js +14 -36
- package/plugins/ApolloCacheObjectIdPlugin.js.map +1 -1
- package/plugins/ApolloDynamicLink.d.ts +3 -2
- package/plugins/ApolloDynamicLink.js +21 -50
- package/plugins/ApolloDynamicLink.js.map +1 -1
- package/plugins/ApolloLinkPlugin.d.ts +1 -1
- package/plugins/ApolloLinkPlugin.js +20 -44
- package/plugins/ApolloLinkPlugin.js.map +1 -1
- package/plugins/ConsoleLinkPlugin.js +22 -44
- package/plugins/ConsoleLinkPlugin.js.map +1 -1
- package/plugins/LocaleHeaderLinkPlugin.d.ts +1 -6
- package/plugins/LocaleHeaderLinkPlugin.js +25 -49
- package/plugins/LocaleHeaderLinkPlugin.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.d.ts +1 -1
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js +41 -52
- package/plugins/NetworkErrorLinkPlugin/ErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.d.ts +8 -4
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js +76 -16
- package/plugins/NetworkErrorLinkPlugin/StyledComponents.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.d.ts +1 -1
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js +18 -18
- package/plugins/NetworkErrorLinkPlugin/createErrorOverlay.js.map +1 -1
- package/plugins/NetworkErrorLinkPlugin.js +24 -42
- package/plugins/NetworkErrorLinkPlugin.js.map +1 -1
- package/plugins/OmitTypenameLinkPlugin.js +13 -33
- package/plugins/OmitTypenameLinkPlugin.js.map +1 -1
- package/plugins/RoutePlugin.d.ts +1 -1
- package/plugins/RoutePlugin.js +14 -36
- package/plugins/RoutePlugin.js.map +1 -1
- package/plugins/TenantHeaderLinkPlugin.d.ts +1 -6
- package/plugins/TenantHeaderLinkPlugin.js +32 -56
- package/plugins/TenantHeaderLinkPlugin.js.map +1 -1
- package/plugins/ViewPlugin.d.ts +1 -1
- package/plugins/ViewPlugin.js +17 -41
- package/plugins/ViewPlugin.js.map +1 -1
- package/plugins/image.d.ts +1 -1
- package/plugins/image.js +48 -54
- package/plugins/image.js.map +1 -1
- package/plugins/index.d.ts +3 -3
- package/plugins/index.js +35 -58
- package/plugins/index.js.map +1 -1
- package/react-butterfiles/Files.d.ts +69 -0
- package/react-butterfiles/Files.js +227 -0
- package/react-butterfiles/Files.js.map +1 -0
- package/react-butterfiles/index.d.ts +2 -0
- package/react-butterfiles/index.js +4 -0
- package/react-butterfiles/index.js.map +1 -0
- package/react-butterfiles/utils/generateId.d.ts +1 -0
- package/react-butterfiles/utils/generateId.js +5 -0
- package/react-butterfiles/utils/generateId.js.map +1 -0
- package/react-butterfiles/utils/readFileContent.d.ts +1 -0
- package/react-butterfiles/utils/readFileContent.js +15 -0
- package/react-butterfiles/utils/readFileContent.js.map +1 -0
- package/renderApp.d.ts +2 -0
- package/renderApp.js +9 -0
- package/renderApp.js.map +1 -0
- package/types.d.ts +24 -27
- package/types.js +13 -11
- package/types.js.map +1 -1
- package/utils/createGenericContext.d.ts +13 -0
- package/utils/createGenericContext.js +25 -0
- package/utils/createGenericContext.js.map +1 -0
- package/utils/createHashing.d.ts +2 -0
- package/utils/createHashing.js +18 -0
- package/utils/createHashing.js.map +1 -0
- package/utils/getApiUrl.d.ts +1 -0
- package/utils/getApiUrl.js +5 -0
- package/utils/getApiUrl.js.map +1 -0
- package/utils/getGqlApiUrl.d.ts +1 -0
- package/utils/getGqlApiUrl.js +6 -0
- package/utils/getGqlApiUrl.js.map +1 -0
- package/utils/getHeadlessCmsGqlApiUrl.d.ts +5 -0
- package/utils/getHeadlessCmsGqlApiUrl.js +12 -0
- package/utils/getHeadlessCmsGqlApiUrl.js.map +1 -0
- package/utils/getLocaleCode.d.ts +6 -0
- package/utils/getLocaleCode.js +33 -0
- package/utils/getLocaleCode.js.map +1 -0
- package/utils/getPrerenderId.d.ts +6 -0
- package/utils/getPrerenderId.js +5 -0
- package/utils/getPrerenderId.js.map +1 -0
- package/utils/getTenantId.d.ts +6 -0
- package/utils/getTenantId.js +45 -0
- package/utils/getTenantId.js.map +1 -0
- package/utils/index.d.ts +10 -0
- package/utils/index.js +12 -0
- package/utils/index.js.map +1 -0
- package/utils/isLocalhost.d.ts +1 -0
- package/utils/isLocalhost.js +7 -0
- package/utils/isLocalhost.js.map +1 -0
- package/utils/isPrerendering.d.ts +1 -0
- package/utils/isPrerendering.js +5 -0
- package/utils/isPrerendering.js.map +1 -0
- package/utils/legacyPluginToReactComponent.d.ts +7 -0
- package/utils/legacyPluginToReactComponent.js +14 -0
- package/utils/legacyPluginToReactComponent.js.map +1 -0
- package/core/AddRoute.d.ts +0 -3
- package/core/AddRoute.js +0 -19
- package/core/AddRoute.js.map +0 -1
package/core/Plugins.js
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.PluginsProvider = exports.PluginsContext = exports.Plugins = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _App = require("../App");
|
|
10
|
-
var PluginsContext = /*#__PURE__*/(0, _react.createContext)(false);
|
|
11
|
-
exports.PluginsContext = PluginsContext;
|
|
1
|
+
import React, { Fragment, Children, createContext, useContext, useEffect, memo } from "react";
|
|
2
|
+
import { useApp } from "../App";
|
|
3
|
+
export const PluginsContext = /*#__PURE__*/createContext(false);
|
|
12
4
|
PluginsContext.displayName = "PluginsContext";
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
const PluginsProviderComponent = ({
|
|
6
|
+
children
|
|
7
|
+
}) => {
|
|
15
8
|
/**
|
|
16
9
|
* This context only serves as a safeguard. We need to warn users when they mount a plugin without using
|
|
17
10
|
* the <Plugins> component. In that case, the context will not be available, and we can log warnings.
|
|
18
11
|
*/
|
|
19
|
-
return /*#__PURE__*/
|
|
12
|
+
return /*#__PURE__*/React.createElement(PluginsContext.Provider, {
|
|
20
13
|
value: true
|
|
21
14
|
}, children);
|
|
22
15
|
};
|
|
23
|
-
|
|
16
|
+
export const PluginsProvider = /*#__PURE__*/memo(PluginsProviderComponent);
|
|
24
17
|
|
|
25
18
|
/**
|
|
26
19
|
* @param children
|
|
27
20
|
* @deprecated This component should not be used directly. Use the <Plugin> component to create plugins.
|
|
28
21
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
|
|
23
|
+
export const Plugins = ({
|
|
24
|
+
children
|
|
25
|
+
}) => {
|
|
26
|
+
const {
|
|
27
|
+
addPlugin
|
|
28
|
+
} = useApp();
|
|
29
|
+
const hasParentPlugin = useContext(PluginsContext);
|
|
30
|
+
useEffect(() => {
|
|
36
31
|
if (hasParentPlugin) {
|
|
37
32
|
return;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
|
-
return addPlugin(child);
|
|
41
|
-
});
|
|
34
|
+
Children.forEach(children, child => addPlugin(child));
|
|
42
35
|
}, []);
|
|
43
|
-
return hasParentPlugin ? /*#__PURE__*/
|
|
36
|
+
return hasParentPlugin ? /*#__PURE__*/React.createElement(Fragment, null, children) : null;
|
|
44
37
|
};
|
|
45
|
-
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=Plugins.js.map
|
package/core/Plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","Fragment","Children","createContext","useContext","useEffect","memo","useApp","PluginsContext","displayName","PluginsProviderComponent","children","createElement","Provider","value","PluginsProvider","Plugins","addPlugin","hasParentPlugin","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 = ({ children }: PluginsProviderComponentProps) => {\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 */\ninterface PluginsComponentsProps {\n children: React.ReactNode;\n}\nexport const Plugins = ({ children }: PluginsComponentsProps) => {\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,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,IAAI,QAAQ,OAAO;AAC7F,SAASC,MAAM;AAEf,OAAO,MAAMC,cAAc,gBAAGL,aAAa,CAAU,KAAK,CAAC;AAC3DK,cAAc,CAACC,WAAW,GAAG,gBAAgB;AAK7C,MAAMC,wBAAwB,GAAGA,CAAC;EAAEC;AAAwC,CAAC,KAAK;EAC9E;AACJ;AACA;AACA;EACI,oBAAOX,KAAA,CAAAY,aAAA,CAACJ,cAAc,CAACK,QAAQ;IAACC,KAAK,EAAE;EAAK,GAAEH,QAAkC,CAAC;AACrF,CAAC;AAED,OAAO,MAAMI,eAAe,gBAAGT,IAAI,CAACI,wBAAwB,CAAC;;AAE7D;AACA;AACA;AACA;;AAIA,OAAO,MAAMM,OAAO,GAAGA,CAAC;EAAEL;AAAiC,CAAC,KAAK;EAC7D,MAAM;IAAEM;EAAU,CAAC,GAAGV,MAAM,CAAC,CAAC;EAC9B,MAAMW,eAAe,GAAGd,UAAU,CAACI,cAAc,CAAC;EAElDH,SAAS,CAAC,MAAM;IACZ,IAAIa,eAAe,EAAE;MACjB;IACJ;IAEAhB,QAAQ,CAACiB,OAAO,CAACR,QAAQ,EAAES,KAAK,IAAIH,SAAS,CAACG,KAAK,CAAC,CAAC;EACzD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,eAAe,gBAAGlB,KAAA,CAAAY,aAAA,CAACX,QAAQ,QAAEU,QAAmB,CAAC,GAAG,IAAI;AACnE,CAAC","ignoreList":[]}
|
package/core/Provider.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HigherOrderComponent } from "../index";
|
|
1
|
+
import type { GenericComponent, Decorator } from "../index";
|
|
3
2
|
export interface ProviderProps {
|
|
4
|
-
hoc:
|
|
3
|
+
hoc: Decorator<GenericComponent>;
|
|
5
4
|
}
|
|
6
5
|
/**
|
|
7
6
|
* Register a new React context provider.
|
|
8
7
|
*/
|
|
9
|
-
export declare const Provider:
|
|
8
|
+
export declare const Provider: ({ hoc }: ProviderProps) => null;
|
package/core/Provider.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Provider = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _ = require("./..");
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useApp } from "./..";
|
|
9
3
|
/**
|
|
10
4
|
* Register a new React context provider.
|
|
11
5
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
export const Provider = ({
|
|
7
|
+
hoc
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
addProvider
|
|
11
|
+
} = useApp();
|
|
12
|
+
useEffect(() => {
|
|
17
13
|
return addProvider(hoc);
|
|
18
14
|
}, []);
|
|
19
15
|
return null;
|
|
20
16
|
};
|
|
21
|
-
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=Provider.js.map
|
package/core/Provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useEffect","useApp","Provider","hoc","addProvider"],"sources":["Provider.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport type { GenericComponent, Decorator } from \"~/index\";\nimport { useApp } from \"~/index\";\n\nexport interface ProviderProps {\n hoc: Decorator<GenericComponent>;\n}\n\n/**\n * Register a new React context provider.\n */\nexport const Provider = ({ hoc }: ProviderProps) => {\n const { addProvider } = useApp();\n\n useEffect(() => {\n return addProvider(hoc);\n }, []);\n\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SAASC,MAAM;AAMf;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAGA,CAAC;EAAEC;AAAmB,CAAC,KAAK;EAChD,MAAM;IAAEC;EAAY,CAAC,GAAGH,MAAM,CAAC,CAAC;EAEhCD,SAAS,CAAC,MAAM;IACZ,OAAOI,WAAW,CAACD,GAAG,CAAC;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
|
package/core/Routes.d.ts
CHANGED
package/core/Routes.js
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var Routes = function Routes(props) {
|
|
13
|
-
var routes = [].concat((0, _toConsumableArray2.default)(props.routes), (0, _toConsumableArray2.default)(_plugins.plugins.byType("route").map(function (_ref) {
|
|
14
|
-
var route = _ref.route;
|
|
15
|
-
return route;
|
|
16
|
-
}))).sort(function (a, b) {
|
|
17
|
-
var pathA = a.props.path || "*";
|
|
18
|
-
var pathB = b.props.path || "*";
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import { Routes as ReactRouterRoutes } from "@webiny/react-router";
|
|
4
|
+
export const Routes = props => {
|
|
5
|
+
const routes = [...props.routes,
|
|
6
|
+
// For backwards compatibility, we need to support the RoutePlugin routes as well.
|
|
7
|
+
...plugins.byType("route").map(({
|
|
8
|
+
route
|
|
9
|
+
}) => route)].sort((a, b) => {
|
|
10
|
+
const pathA = a.props.path || "*";
|
|
11
|
+
const pathB = b.props.path || "*";
|
|
19
12
|
|
|
20
13
|
// This will sort paths at the very bottom of the list
|
|
21
14
|
if (pathA === "/" && pathB === "*") {
|
|
@@ -33,10 +26,9 @@ var Routes = function Routes(props) {
|
|
|
33
26
|
}
|
|
34
27
|
return 0;
|
|
35
28
|
});
|
|
36
|
-
return /*#__PURE__*/
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
}));
|
|
29
|
+
return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map((route, index) => /*#__PURE__*/React.cloneElement(route, {
|
|
30
|
+
key: `${route.props.path}:${index}`
|
|
31
|
+
})));
|
|
41
32
|
};
|
|
42
|
-
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=Routes.js.map
|
package/core/Routes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Routes","
|
|
1
|
+
{"version":3,"names":["React","plugins","Routes","ReactRouterRoutes","props","routes","byType","map","route","sort","a","b","pathA","path","pathB","includes","createElement","index","cloneElement","key"],"sources":["Routes.tsx"],"sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport type { RoutePlugin } from \"~/types\";\n\ninterface RoutesProps {\n routes: JSX.Element[];\n}\n\nexport const Routes = (props: RoutesProps) => {\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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,MAAM,IAAIC,iBAAiB,QAAQ,sBAAsB;AAOlE,OAAO,MAAMD,MAAM,GAAIE,KAAkB,IAAK;EAC1C,MAAMC,MAAM,GAAG,CACX,GAAGD,KAAK,CAACC,MAAM;EACf;EACA,GAAGJ,OAAO,CAACK,MAAM,CAAc,OAAO,CAAC,CAACC,GAAG,CAAC,CAAC;IAAEC;EAAM,CAAC,KAAKA,KAAK,CAAC,CACpE,CAACC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAK;IACb,MAAMC,KAAK,GAAGF,CAAC,CAACN,KAAK,CAACS,IAAI,IAAI,GAAG;IACjC,MAAMC,KAAK,GAAGH,CAAC,CAACP,KAAK,CAACS,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,oBACId,KAAA,CAAAgB,aAAA,CAACb,iBAAiB,QACbE,MAAM,CAACE,GAAG,CAAC,CAACC,KAAK,EAAES,KAAK,kBACrBjB,KAAK,CAACkB,YAAY,CAACV,KAAK,EAAE;IAAEW,GAAG,EAAE,GAAGX,KAAK,CAACJ,KAAK,CAACS,IAAI,IAAII,KAAK;EAAG,CAAC,CACrE,CACe,CAAC;AAE5B,CAAC","ignoreList":[]}
|
package/core/createProvider.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { Decorator, GenericComponent } from "@webiny/react-composition";
|
|
3
|
+
export interface ChildrenProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
2
6
|
/**
|
|
3
|
-
* Creates a Higher Order Component which
|
|
7
|
+
* Creates a Higher Order Component which wraps the entire app content.
|
|
4
8
|
* This is mostly useful for adding React Context providers.
|
|
5
9
|
*/
|
|
6
|
-
export declare function createProvider(
|
|
10
|
+
export declare function createProvider(decorator: Decorator<GenericComponent<ChildrenProps>>): Decorator<GenericComponent<ChildrenProps>>;
|
package/core/createProvider.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createProvider = createProvider;
|
|
7
1
|
/**
|
|
8
|
-
* Creates a Higher Order Component which
|
|
2
|
+
* Creates a Higher Order Component which wraps the entire app content.
|
|
9
3
|
* This is mostly useful for adding React Context providers.
|
|
10
4
|
*/
|
|
11
|
-
function createProvider(
|
|
12
|
-
return
|
|
13
|
-
}
|
|
5
|
+
export function createProvider(decorator) {
|
|
6
|
+
return decorator;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=createProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createProvider","
|
|
1
|
+
{"version":3,"names":["createProvider","decorator"],"sources":["createProvider.tsx"],"sourcesContent":["import type React from \"react\";\nimport type { Decorator, GenericComponent } from \"@webiny/react-composition\";\n\nexport interface ChildrenProps {\n children: React.ReactNode;\n}\n\n/**\n * Creates a Higher Order Component which wraps the entire app content.\n * This is mostly useful for adding React Context providers.\n */\nexport function createProvider(\n decorator: Decorator<GenericComponent<ChildrenProps>>\n): Decorator<GenericComponent<ChildrenProps>> {\n return decorator;\n}\n"],"mappings":"AAOA;AACA;AACA;AACA;AACA,OAAO,SAASA,cAAcA,CAC1BC,SAAqD,EACX;EAC1C,OAAOA,SAAS;AACpB","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import type { GenericComponent, Decorator } from "@webiny/react-composition";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a component, which, when mounted, will register an app provider.
|
|
5
5
|
* This is particularly useful for wrapping the entire app with custom React Context providers.
|
|
6
6
|
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
|
|
7
7
|
*/
|
|
8
|
-
export declare function createProviderPlugin(
|
|
8
|
+
export declare function createProviderPlugin(decorator: Decorator<GenericComponent>): () => React.JSX.Element;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Provider } from "./Provider";
|
|
2
3
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createProviderPlugin = createProviderPlugin;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Provider = require("./Provider");
|
|
10
4
|
/**
|
|
11
5
|
* Creates a component, which, when mounted, will register an app provider.
|
|
12
6
|
* This is particularly useful for wrapping the entire app with custom React Context providers.
|
|
13
7
|
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework.
|
|
14
8
|
*/
|
|
15
|
-
function createProviderPlugin(
|
|
9
|
+
export function createProviderPlugin(decorator) {
|
|
16
10
|
return function ProviderPlugin() {
|
|
17
|
-
return /*#__PURE__*/
|
|
18
|
-
hoc:
|
|
11
|
+
return /*#__PURE__*/React.createElement(Provider, {
|
|
12
|
+
hoc: decorator
|
|
19
13
|
});
|
|
20
14
|
};
|
|
21
|
-
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=createProviderPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createProviderPlugin","
|
|
1
|
+
{"version":3,"names":["React","Provider","createProviderPlugin","decorator","ProviderPlugin","createElement","hoc"],"sources":["createProviderPlugin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { GenericComponent, Decorator } 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(decorator: Decorator<GenericComponent>) {\n return function ProviderPlugin() {\n return <Provider hoc={decorator} />;\n };\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,SAAsC,EAAE;EACzE,OAAO,SAASC,cAAcA,CAAA,EAAG;IAC7B,oBAAOJ,KAAA,CAAAK,aAAA,CAACJ,QAAQ;MAACK,GAAG,EAAEH;IAAU,CAAE,CAAC;EACvC,CAAC;AACL","ignoreList":[]}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { useAutocomplete } from "./useAutocomplete";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "useAutocomplete", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useAutocomplete.useAutocomplete;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _useAutocomplete = require("./useAutocomplete");
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useAutocomplete"],"sources":["index.ts"],"sourcesContent":["export { useAutocomplete } from \"./useAutocomplete\";\n"],"mappings":"AAAA,SAASA,eAAe","ignoreList":[]}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
|
10
|
-
var _useDataList = require("../useDataList");
|
|
11
|
-
var useAutocomplete = function useAutocomplete(props) {
|
|
12
|
-
var dataList = (0, _useDataList.useDataList)((0, _objectSpread2.default)({
|
|
13
|
-
useRouter: false
|
|
14
|
-
}, props));
|
|
1
|
+
import { useDataList } from "../useDataList";
|
|
2
|
+
import debounce from "lodash/debounce";
|
|
3
|
+
export const useAutocomplete = props => {
|
|
4
|
+
const dataList = useDataList({
|
|
5
|
+
useRouter: false,
|
|
6
|
+
...props
|
|
7
|
+
});
|
|
15
8
|
return {
|
|
16
9
|
options: dataList.data || [],
|
|
17
|
-
onInput: (
|
|
10
|
+
onInput: debounce(query => {
|
|
18
11
|
if (!query) {
|
|
19
12
|
return;
|
|
20
13
|
}
|
|
21
|
-
|
|
14
|
+
let search = props.search || query;
|
|
22
15
|
if (typeof search === "function") {
|
|
23
16
|
search = search(query);
|
|
24
17
|
}
|
|
@@ -26,4 +19,5 @@ var useAutocomplete = function useAutocomplete(props) {
|
|
|
26
19
|
}, 250)
|
|
27
20
|
};
|
|
28
21
|
};
|
|
29
|
-
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useAutocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAutocomplete","props","dataList","
|
|
1
|
+
{"version":3,"names":["useDataList","debounce","useAutocomplete","props","dataList","useRouter","options","data","onInput","query","search","setSearch"],"sources":["useAutocomplete.ts"],"sourcesContent":["import { useDataList } from \"../useDataList\";\nimport debounce from \"lodash/debounce\";\nimport type { 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,SAASA,WAAW;AACpB,OAAOC,QAAQ,MAAM,iBAAiB;AAatC,OAAO,MAAMC,eAAe,GAAIC,KAAY,IAA0B;EAClE,MAAMC,QAAQ,GAAGJ,WAAW,CAAC;IAAEK,SAAS,EAAE,KAAK;IAAE,GAAGF;EAAM,CAAC,CAAC;EAE5D,OAAO;IACHG,OAAO,EAAEF,QAAQ,CAACG,IAAI,IAAI,EAAE;IAC5BC,OAAO,EAAEP,QAAQ,CAACQ,KAAK,IAAI;MACvB,IAAI,CAACA,KAAK,EAAE;QACR;MACJ;MAEA,IAAIC,MAAM,GAAGP,KAAK,CAACO,MAAM,IAAID,KAAK;MAClC,IAAI,OAAOC,MAAM,KAAK,UAAU,EAAE;QAC9BA,MAAM,GAAGA,MAAM,CAACD,KAAK,CAAC;MAC1B;MAEAL,QAAQ,CAACO,SAAS,CAACD,MAAM,CAAC;IAC9B,CAAC,EAAE,GAAG;EACV,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import searchDataByKey from "./searchDataByKey";
|
|
2
|
+
export default response => searchDataByKey("data", response);
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
9
|
-
var _default = function _default(response) {
|
|
10
|
-
return (0, _searchDataByKey.default)("data", response);
|
|
11
|
-
};
|
|
12
|
-
exports.default = _default;
|
|
4
|
+
//# sourceMappingURL=getData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["searchDataByKey","response"],"sources":["getData.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"data\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,MAAM,EAAEC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import searchDataByKey from "./searchDataByKey";
|
|
2
|
+
export default response => searchDataByKey("error", response);
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
9
|
-
var _default = function _default(response) {
|
|
10
|
-
return (0, _searchDataByKey.default)("error", response);
|
|
11
|
-
};
|
|
12
|
-
exports.default = _default;
|
|
4
|
+
//# sourceMappingURL=getError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["searchDataByKey","response"],"sources":["getError.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"error\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,OAAO,EAAEC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import searchDataByKey from "./searchDataByKey";
|
|
2
|
+
export default response => searchDataByKey("meta", response);
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _searchDataByKey = _interopRequireDefault(require("./searchDataByKey"));
|
|
9
|
-
var _default = function _default(response) {
|
|
10
|
-
return (0, _searchDataByKey.default)("meta", response);
|
|
11
|
-
};
|
|
12
|
-
exports.default = _default;
|
|
4
|
+
//# sourceMappingURL=getMeta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["searchDataByKey","response"],"sources":["getMeta.ts"],"sourcesContent":["import searchDataByKey from \"./searchDataByKey\";\n\nexport default (response: Record<string, string>) => searchDataByKey(\"meta\", response);\n"],"mappings":"AAAA,OAAOA,eAAe;AAEtB,eAAgBC,QAAgC,IAAKD,eAAe,CAAC,MAAM,EAAEC,QAAQ,CAAC","ignoreList":[]}
|
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { default as getData } from "./getData";
|
|
2
|
+
export { default as getError } from "./getError";
|
|
3
|
+
export { default as getMeta } from "./getMeta";
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "getData", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _getData.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "getError", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _getError.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "getMeta", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _getMeta.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
var _getData = _interopRequireDefault(require("./getData"));
|
|
26
|
-
var _getError = _interopRequireDefault(require("./getError"));
|
|
27
|
-
var _getMeta = _interopRequireDefault(require("./getMeta"));
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -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":["default","getData","getError","getMeta"],"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,SAASA,OAAO,IAAIC,OAAO;AAC3B,SAASD,OAAO,IAAIE,QAAQ;AAC5B,SAASF,OAAO,IAAIG,OAAO","ignoreList":[]}
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var searchDataByKey = function searchDataByKey(searchKey, object) {
|
|
1
|
+
const searchDataByKey = (searchKey, object) => {
|
|
8
2
|
if (!object || typeof object !== "object") {
|
|
9
3
|
return null;
|
|
10
4
|
}
|
|
11
5
|
if (object[searchKey]) {
|
|
12
6
|
return object[searchKey];
|
|
13
7
|
}
|
|
14
|
-
for (
|
|
15
|
-
|
|
8
|
+
for (const key in object) {
|
|
9
|
+
const value = searchDataByKey(searchKey, object[key]);
|
|
16
10
|
if (value) {
|
|
17
11
|
return value;
|
|
18
12
|
}
|
|
19
13
|
}
|
|
20
14
|
return null;
|
|
21
15
|
};
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
export default searchDataByKey;
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=searchDataByKey.js.map
|
|
@@ -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,MAAMA,eAAe,GAAGA,CAACC,SAAiB,EAAEC,MAA2B,KAAoB;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,MAAME,GAAG,IAAID,MAAM,EAAE;IACtB,MAAME,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;AAED,eAAeJ,eAAe","ignoreList":[]}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
export { useDataList } from "./useDataList";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "useDataList", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useDataList.useDataList;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _useDataList = require("./useDataList");
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["useDataList"],"sources":["index.ts"],"sourcesContent":["export { useDataList } from \"./useDataList\";\n"],"mappings":"AAAA,SAASA,WAAW","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentNode } from "graphql";
|
|
2
|
-
import { ApolloClient } from "apollo-client";
|
|
1
|
+
import type { DocumentNode } from "graphql";
|
|
2
|
+
import type { ApolloClient } from "apollo-client";
|
|
3
3
|
export interface UseDataListParams {
|
|
4
4
|
useRouter?: boolean;
|
|
5
5
|
variables?: ((params: UseDataListParams) => any) | object;
|