@gravity-ui/data-source 0.10.0-alpha.4 → 0.10.0-alpha.6
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/build/cjs/react/components/Async/Async.d.ts +3 -0
- package/build/cjs/react/components/Async/Async.js +18 -0
- package/build/cjs/react/components/Async/Async.js.map +1 -0
- package/build/cjs/react/components/Async/index.d.ts +3 -0
- package/build/cjs/react/components/Async/index.js +20 -0
- package/build/cjs/react/components/Async/index.js.map +1 -0
- package/build/cjs/react/components/Async/types.d.ts +9 -0
- package/build/cjs/react/components/Async/types.js +6 -0
- package/build/cjs/react/components/Async/types.js.map +1 -0
- package/build/cjs/react/components/Async/withAsync.d.ts +3 -0
- package/build/cjs/react/components/Async/withAsync.js +26 -0
- package/build/cjs/react/components/Async/withAsync.js.map +1 -0
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js +3 -2
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -1
- package/build/cjs/react/components/AsyncBoundary/types.d.ts +3 -3
- package/build/cjs/react/components/AsyncBoundary/types.js.map +1 -1
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.d.ts +1 -1
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -1
- package/build/cjs/react/index.d.ts +1 -0
- package/build/cjs/react/index.js +12 -0
- package/build/cjs/react/index.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.d.ts +3 -3
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -1
- package/build/esm/react/components/Async/Async.d.ts +3 -0
- package/build/esm/react/components/Async/Async.js +11 -0
- package/build/esm/react/components/Async/Async.js.map +1 -0
- package/build/esm/react/components/Async/index.d.ts +3 -0
- package/build/esm/react/components/Async/index.js +3 -0
- package/build/esm/react/components/Async/index.js.map +1 -0
- package/build/esm/react/components/Async/types.d.ts +9 -0
- package/build/esm/react/components/Async/types.js +2 -0
- package/build/esm/react/components/Async/types.js.map +1 -0
- package/build/esm/react/components/Async/withAsync.d.ts +3 -0
- package/build/esm/react/components/Async/withAsync.js +19 -0
- package/build/esm/react/components/Async/withAsync.js.map +1 -0
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js +3 -2
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/types.d.ts +3 -3
- package/build/esm/react/components/AsyncBoundary/types.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.d.ts +1 -1
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -1
- package/build/esm/react/index.d.ts +1 -0
- package/build/esm/react/index.js +1 -0
- package/build/esm/react/index.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/types.d.ts +3 -3
- package/build/esm/react-query/components/QueryAsyncBoundary/types.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -1
- package/build/plugin/esbuild.cjs +1 -1
- package/build/plugin/esbuild.mjs +1 -1
- package/build/plugin/{factory--H-amlua.mjs → factory-C-n_7Tjo.mjs} +103 -9
- package/build/plugin/{factory-CmOH3Kh6.cjs → factory-CIwgQy1N.cjs} +103 -9
- package/build/plugin/index.cjs +1 -1
- package/build/plugin/index.mjs +1 -1
- package/build/plugin/rollup.cjs +1 -1
- package/build/plugin/rollup.mjs +1 -1
- package/build/plugin/rspack.cjs +1 -1
- package/build/plugin/rspack.mjs +1 -1
- package/build/plugin/typings/client.d.ts +12 -4
- package/build/plugin/vite.cjs +1 -1
- package/build/plugin/vite.mjs +1 -1
- package/build/plugin/webpack.cjs +1 -1
- package/build/plugin/webpack.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Async = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
var Async = exports.Async = function Async(_ref) {
|
|
11
|
+
var LoadingView = _ref.LoadingView,
|
|
12
|
+
children = _ref.children;
|
|
13
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Suspense, {
|
|
14
|
+
fallback: /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, {}),
|
|
15
|
+
children: children
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
// #sourceMappingURL=Async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","Async","exports","_ref","LoadingView","children","_jsx","React","Suspense","fallback"],"sources":["Async.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {AsyncProps} from './types';\n\nexport const Async: React.FC<AsyncProps> = ({LoadingView, children}) => {\n return <React.Suspense fallback={<LoadingView />}>{children}</React.Suspense>;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAInB,IAAMG,KAA2B,GAAAC,OAAA,CAAAD,KAAA,GAAG,SAA9BA,KAA2BA,CAAAE,IAAA,EAAgC;EAAA,IAA3BC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC9D,oBAAO,IAAAC,eAAA,EAACC,cAAK,CAACC,QAAQ;IAACC,QAAQ,eAAE,IAAAH,eAAA,EAACF,WAAW,IAAE,CAAE;IAAAC,QAAA,EAAEA;EAAQ,CAAiB,CAAC;AACjF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Async", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Async.Async;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "withAsync", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _withAsync.withAsync;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _Async = require("./Async");
|
|
19
|
+
var _withAsync = require("./withAsync");
|
|
20
|
+
// #sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_Async","require","_withAsync"],"sources":["index.ts"],"sourcesContent":["export type {AsyncProps, AsyncComponent} from './types';\nexport {Async} from './Async';\nexport {withAsync} from './withAsync';\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface AsyncProps {
|
|
3
|
+
LoadingView: ComponentType;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface AsyncComponent<TProps extends object = {}, TLoadingProps extends object = {}> extends React.FC<TProps & TLoadingProps> {
|
|
7
|
+
Content: React.ComponentType<TProps>;
|
|
8
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nexport interface AsyncProps {\n LoadingView: ComponentType;\n children: ReactNode;\n}\n\nexport interface AsyncComponent<TProps extends object = {}, TLoadingProps extends object = {}>\n extends React.FC<TProps & TLoadingProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AsyncComponent } from './types';
|
|
3
|
+
export declare const withAsync: <TProps extends object = {}, TLoadingProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>) => AsyncComponent<TProps, TLoadingProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withAsync = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Async = require("./Async");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
var withAsync = exports.withAsync = function withAsync(Component, _LoadingView) {
|
|
13
|
+
var WrappedComponent = function WrappedComponent(props) {
|
|
14
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Async.Async, {
|
|
15
|
+
LoadingView: function LoadingView() {
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingView, (0, _objectSpread2.default)({}, props));
|
|
17
|
+
},
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)({}, props))
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
WrappedComponent.displayName = "WithAsync(".concat(Component.displayName || Component.name, ")");
|
|
22
|
+
WrappedComponent.Content = Component;
|
|
23
|
+
WrappedComponent.Loading = _LoadingView;
|
|
24
|
+
return WrappedComponent;
|
|
25
|
+
};
|
|
26
|
+
// #sourceMappingURL=withAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_Async","_jsxRuntime","e","__esModule","default","withAsync","exports","Component","_LoadingView","WrappedComponent","props","_jsx","Async","LoadingView","_objectSpread","children","displayName","concat","name","Content","Loading"],"sources":["withAsync.tsx"],"sourcesContent":["import React from 'react';\n\nimport {Async} from './Async';\nimport type {AsyncComponent} from './types';\n\nexport const withAsync = <TProps extends object = {}, TLoadingProps extends object = {}>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps) => (\n <Async LoadingView={() => <LoadingView {...props} />}>\n <Component {...props} />\n </Async>\n )) as AsyncComponent<TProps, TLoadingProps>;\n\n WrappedComponent.displayName = `WithAsync(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAA8B,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvB,IAAMG,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,SAAZA,SAASA,CAClBE,SAAsC,EACtCC,YAAiE,EAChE;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA6B;IAAA,oBACpD,IAAAC,eAAA,EAACC,YAAK;MAACC,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQ,IAAAF,eAAA,EAACH,YAAW,MAAAM,sBAAA,MAAKJ,KAAK,CAAG,CAAC;MAAA,CAAC;MAAAK,QAAA,eACjD,IAAAJ,eAAA,EAACJ,SAAS,MAAAO,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACrB,CAAC;EAAA,CAC+B;EAE3CD,gBAAgB,CAACO,WAAW,gBAAAC,MAAA,CAAgBV,SAAS,CAACS,WAAW,IAAIT,SAAS,CAACW,IAAI,MAAG;EAEtFT,gBAAgB,CAACU,OAAO,GAAGZ,SAAS;EACpCE,gBAAgB,CAACW,OAAO,GAAGZ,YAAW;EAEtC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.AsyncBoundary = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactErrorBoundary = require("react-error-boundary");
|
|
9
|
+
var _Async = require("../Async");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
var AsyncBoundary = exports.AsyncBoundary = function AsyncBoundary(_ref) {
|
|
@@ -26,8 +27,8 @@ var AsyncBoundary = exports.AsyncBoundary = function AsyncBoundary(_ref) {
|
|
|
26
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactErrorBoundary.ErrorBoundary, {
|
|
27
28
|
fallbackRender: fallbackRender,
|
|
28
29
|
onReset: onReset,
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
30
|
-
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Async.Async, {
|
|
31
|
+
LoadingView: LoadingView,
|
|
31
32
|
children: children
|
|
32
33
|
})
|
|
33
34
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactErrorBoundary","_jsxRuntime","e","__esModule","default","AsyncBoundary","exports","_ref","LoadingView","ErrorView","onReset","children","fallbackRender","React","useCallback","_ref2","error","resetErrorBoundary","_jsx","action","handler","ErrorBoundary","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactErrorBoundary","_Async","_jsxRuntime","e","__esModule","default","AsyncBoundary","exports","_ref","LoadingView","ErrorView","onReset","children","fallbackRender","React","useCallback","_ref2","error","resetErrorBoundary","_jsx","action","handler","ErrorBoundary","Async"],"sources":["AsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {FallbackProps} from 'react-error-boundary';\nimport {ErrorBoundary} from 'react-error-boundary';\n\nimport {Async} from '../Async';\n\nimport type {AsyncBoundaryProps} from './types';\n\nexport const AsyncBoundary: React.FC<AsyncBoundaryProps> = ({\n LoadingView,\n ErrorView,\n onReset,\n children,\n}) => {\n const fallbackRender = React.useCallback(\n ({error, resetErrorBoundary}: FallbackProps) => (\n <ErrorView error={error} action={{handler: resetErrorBoundary}} />\n ),\n [ErrorView],\n );\n\n return (\n <ErrorBoundary fallbackRender={fallbackRender} onReset={onReset}>\n <Async LoadingView={LoadingView}>{children}</Async>\n </ErrorBoundary>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAA+B,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIxB,IAAMG,aAA2C,GAAAC,OAAA,CAAAD,aAAA,GAAG,SAA9CA,aAA2CA,CAAAE,IAAA,EAKlD;EAAA,IAJFC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;EAER,IAAMC,cAAc,GAAGC,cAAK,CAACC,WAAW,CACpC,UAAAC,KAAA;IAAA,IAAEC,KAAK,GAAAD,KAAA,CAALC,KAAK;MAAEC,kBAAkB,GAAAF,KAAA,CAAlBE,kBAAkB;IAAA,oBACvB,IAAAC,eAAA,EAACT,SAAS;MAACO,KAAK,EAAEA,KAAM;MAACG,MAAM,EAAE;QAACC,OAAO,EAAEH;MAAkB;IAAE,CAAE,CAAC;EAAA,CACrE,EACD,CAACR,SAAS,CACd,CAAC;EAED,oBACI,IAAAS,eAAA,EAACG,iCAAa;IAACT,cAAc,EAAEA,cAAe;IAACF,OAAO,EAAEA,OAAQ;IAAAC,QAAA,eAC5D,IAAAO,eAAA,EAACI,YAAK;MAACd,WAAW,EAAEA,WAAY;MAAAG,QAAA,EAAEA;IAAQ,CAAQ;EAAC,CACxC,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -6,8 +6,8 @@ export interface AsyncBoundaryProps {
|
|
|
6
6
|
onReset?: () => void;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps
|
|
9
|
+
export interface AsyncBoundaryComponent<TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {
|
|
10
10
|
Content: React.ComponentType<TProps>;
|
|
11
|
-
Loading: ComponentType<TProps
|
|
12
|
-
Error: ComponentType<
|
|
11
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
12
|
+
Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ErrorViewProps } from '../types';
|
|
3
3
|
import type { AsyncBoundaryComponent } from './types';
|
|
4
|
-
export declare const withAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps
|
|
4
|
+
export declare const withAsyncBoundary: <TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>, ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>) => AsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_AsyncBoundary","_jsxRuntime","e","__esModule","default","withAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","AsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary =
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_AsyncBoundary","_jsxRuntime","e","__esModule","default","withAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","AsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary = <\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps & TErrorProps) => (\n <AsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </AsyncBoundary>\n )) as AsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;\n\n WrappedComponent.displayName = `WithAsyncBoundary(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,cAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvC,IAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,SAApBA,iBAAiBA,CAK1BE,SAAsC,EACtCC,YAAiE,EACjEC,UAA8E,EAC7E;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA2C;IAAA,oBAClE,IAAAC,eAAA,EAACC,4BAAa;MACVC,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQ,IAAAF,eAAA,EAACJ,YAAW,MAAAO,sBAAA,MAAKJ,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CK,SAAS,EAAE,SAAXA,SAASA,CAAGC,UAAU;QAAA,oBAAK,IAAAL,eAAA,EAACH,UAAS,MAAAM,sBAAA,MAAAA,sBAAA,MAAKJ,KAAK,GAAMM,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAC,QAAA,eAEpE,IAAAN,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACb,CAAC;EAAA,CAC4C;EAEhED,gBAAgB,CAACS,WAAW,wBAAAC,MAAA,CAAwBb,SAAS,CAACY,WAAW,IAAIZ,SAAS,CAACc,IAAI,MAAG;EAE9FX,gBAAgB,CAACY,OAAO,GAAGf,SAAS;EACpCG,gBAAgB,CAACa,OAAO,GAAGf,YAAW;EACtCE,gBAAgB,CAACc,KAAK,GAAGf,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
package/build/cjs/react/index.js
CHANGED
|
@@ -33,6 +33,18 @@ Object.defineProperty(exports, "withDataManager", {
|
|
|
33
33
|
return _withDataManager.withDataManager;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
+
var _Async = require("./components/Async");
|
|
37
|
+
Object.keys(_Async).forEach(function (key) {
|
|
38
|
+
if (key === "default" || key === "__esModule") return;
|
|
39
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
40
|
+
if (key in exports && exports[key] === _Async[key]) return;
|
|
41
|
+
Object.defineProperty(exports, key, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _Async[key];
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
36
48
|
var _AsyncBoundary = require("./components/AsyncBoundary");
|
|
37
49
|
Object.keys(_AsyncBoundary).forEach(function (key) {
|
|
38
50
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_Async","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_AsyncBoundary","_DataLoader","_DataInfiniteLoader","_EmptyView","_DataManagerContext","_DataManagerProvider","_withDataManager"],"sources":["index.ts"],"sourcesContent":["export * from './components/Async';\nexport * from './components/AsyncBoundary';\nexport * from './components/DataLoader';\nexport * from './components/DataInfiniteLoader';\nexport * from './components/EmptyView';\nexport type {ErrorAction, ErrorViewProps} from './components/types';\n\nexport {DataManagerContext, useDataManager} from './DataManagerContext';\nexport {DataManagerProvider} from './DataManagerProvider';\nexport type {DataManagerProviderProps} from './DataManagerProvider';\nexport type {WithDataManagerProps} from './withDataManager';\nexport {withDataManager} from './withDataManager';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAb,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,cAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,cAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,cAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,cAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,WAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,WAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,WAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,WAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,mBAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,mBAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,mBAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,mBAAA,CAAAX,GAAA;IAAA;EAAA;AAAA;AACA,IAAAY,UAAA,GAAAhB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAc,UAAA,EAAAb,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAY,UAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,UAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AAGA,IAAAa,mBAAA,GAAAjB,OAAA;AACA,IAAAkB,oBAAA,GAAAlB,OAAA;AAGA,IAAAmB,gBAAA,GAAAnB,OAAA","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@ import type { ComponentType } from 'react';
|
|
|
2
2
|
import type { AsyncBoundaryProps, ErrorViewProps } from '../../../react';
|
|
3
3
|
export interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {
|
|
4
4
|
}
|
|
5
|
-
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps
|
|
5
|
+
export interface QueryAsyncBoundaryComponent<TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {
|
|
6
6
|
Content: React.ComponentType<TProps>;
|
|
7
|
-
Loading: ComponentType<TProps
|
|
8
|
-
Error: ComponentType<
|
|
7
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
8
|
+
Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ErrorViewProps } from '../../../react';
|
|
3
3
|
import type { QueryAsyncBoundaryComponent } from './types';
|
|
4
|
-
export declare const withQueryAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps
|
|
4
|
+
export declare const withQueryAsyncBoundary: <TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>, ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>) => QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_QueryAsyncBoundary","_jsxRuntime","e","__esModule","default","withQueryAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","QueryAsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary =
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_QueryAsyncBoundary","_jsxRuntime","e","__esModule","default","withQueryAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","QueryAsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary = <\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps & TErrorProps) => (\n <QueryAsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;\n\n WrappedComponent.displayName = `WithQueryAsyncBoundary(${\n Component.displayName || Component.name\n })`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAAwD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,IAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,SAAzBA,sBAAsBA,CAK/BE,SAAsC,EACtCC,YAAiE,EACjEC,UAA8E,EAC7E;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA2C;IAAA,oBAClE,IAAAC,eAAA,EAACC,sCAAkB;MACfC,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQ,IAAAF,eAAA,EAACJ,YAAW,MAAAO,sBAAA,MAAKJ,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CK,SAAS,EAAE,SAAXA,SAASA,CAAGC,UAAU;QAAA,oBAAK,IAAAL,eAAA,EAACH,UAAS,MAAAM,sBAAA,MAAAA,sBAAA,MAAKJ,KAAK,GAAMM,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAC,QAAA,eAEpE,IAAAN,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACR,CAAC;EAAA,CAC4C;EAErED,gBAAgB,CAACS,WAAW,6BAAAC,MAAA,CACxBb,SAAS,CAACY,WAAW,IAAIZ,SAAS,CAACc,IAAI,MACxC;EAEHX,gBAAgB,CAACY,OAAO,GAAGf,SAAS;EACpCG,gBAAgB,CAACa,OAAO,GAAGf,YAAW;EACtCE,gBAAgB,CAACc,KAAK,GAAGf,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export var Async = function Async(_ref) {
|
|
4
|
+
var LoadingView = _ref.LoadingView,
|
|
5
|
+
children = _ref.children;
|
|
6
|
+
return /*#__PURE__*/_jsx(React.Suspense, {
|
|
7
|
+
fallback: /*#__PURE__*/_jsx(LoadingView, {}),
|
|
8
|
+
children: children
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
// #sourceMappingURL=Async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","jsx","_jsx","Async","_ref","LoadingView","children","Suspense","fallback"],"sources":["Async.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {AsyncProps} from './types';\n\nexport const Async: React.FC<AsyncProps> = ({LoadingView, children}) => {\n return <React.Suspense fallback={<LoadingView />}>{children}</React.Suspense>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI1B,OAAO,IAAMC,KAA2B,GAAG,SAA9BA,KAA2BA,CAAAC,IAAA,EAAgC;EAAA,IAA3BC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC9D,oBAAOJ,IAAA,CAACF,KAAK,CAACO,QAAQ;IAACC,QAAQ,eAAEN,IAAA,CAACG,WAAW,IAAE,CAAE;IAAAC,QAAA,EAAEA;EAAQ,CAAiB,CAAC;AACjF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Async","withAsync"],"sources":["index.ts"],"sourcesContent":["export type {AsyncProps, AsyncComponent} from './types';\nexport {Async} from './Async';\nexport {withAsync} from './withAsync';\n"],"mappings":"AACA,SAAQA,KAAK,QAAO,SAAS;AAC7B,SAAQC,SAAS,QAAO,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface AsyncProps {
|
|
3
|
+
LoadingView: ComponentType;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface AsyncComponent<TProps extends object = {}, TLoadingProps extends object = {}> extends React.FC<TProps & TLoadingProps> {
|
|
7
|
+
Content: React.ComponentType<TProps>;
|
|
8
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nexport interface AsyncProps {\n LoadingView: ComponentType;\n children: ReactNode;\n}\n\nexport interface AsyncComponent<TProps extends object = {}, TLoadingProps extends object = {}>\n extends React.FC<TProps & TLoadingProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AsyncComponent } from './types';
|
|
3
|
+
export declare const withAsync: <TProps extends object = {}, TLoadingProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>) => AsyncComponent<TProps, TLoadingProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Async } from './Async';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var withAsync = function withAsync(Component, _LoadingView) {
|
|
6
|
+
var WrappedComponent = function WrappedComponent(props) {
|
|
7
|
+
return /*#__PURE__*/_jsx(Async, {
|
|
8
|
+
LoadingView: function LoadingView() {
|
|
9
|
+
return /*#__PURE__*/_jsx(_LoadingView, _objectSpread({}, props));
|
|
10
|
+
},
|
|
11
|
+
children: /*#__PURE__*/_jsx(Component, _objectSpread({}, props))
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
WrappedComponent.displayName = "WithAsync(".concat(Component.displayName || Component.name, ")");
|
|
15
|
+
WrappedComponent.Content = Component;
|
|
16
|
+
WrappedComponent.Loading = _LoadingView;
|
|
17
|
+
return WrappedComponent;
|
|
18
|
+
};
|
|
19
|
+
// #sourceMappingURL=withAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Async","jsx","_jsx","withAsync","Component","LoadingView","WrappedComponent","props","_LoadingView","_objectSpread","children","displayName","concat","name","Content","Loading"],"sources":["withAsync.tsx"],"sourcesContent":["import React from 'react';\n\nimport {Async} from './Async';\nimport type {AsyncComponent} from './types';\n\nexport const withAsync = <TProps extends object = {}, TLoadingProps extends object = {}>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps) => (\n <Async LoadingView={() => <LoadingView {...props} />}>\n <Component {...props} />\n </Async>\n )) as AsyncComponent<TProps, TLoadingProps>;\n\n WrappedComponent.displayName = `WithAsync(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n\n return WrappedComponent;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,KAAK,QAAO,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG9B,OAAO,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAClBC,SAAsC,EACtCC,YAAiE,EAChE;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA6B;IAAA,oBACpDL,IAAA,CAACF,KAAK;MAACK,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQH,IAAA,CAACM,YAAW,EAAAC,aAAA,KAAKF,KAAK,CAAG,CAAC;MAAA,CAAC;MAAAG,QAAA,eACjDR,IAAA,CAACE,SAAS,EAAAK,aAAA,KAAKF,KAAK,CAAG;IAAC,CACrB,CAAC;EAAA,CAC+B;EAE3CD,gBAAgB,CAACK,WAAW,gBAAAC,MAAA,CAAgBR,SAAS,CAACO,WAAW,IAAIP,SAAS,CAACS,IAAI,MAAG;EAEtFP,gBAAgB,CAACQ,OAAO,GAAGV,SAAS;EACpCE,gBAAgB,CAACS,OAAO,GAAGV,YAAW;EAEtC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
3
|
+
import { Async } from '../Async';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
export var AsyncBoundary = function AsyncBoundary(_ref) {
|
|
5
6
|
var LoadingView = _ref.LoadingView,
|
|
@@ -19,8 +20,8 @@ export var AsyncBoundary = function AsyncBoundary(_ref) {
|
|
|
19
20
|
return /*#__PURE__*/_jsx(ErrorBoundary, {
|
|
20
21
|
fallbackRender: fallbackRender,
|
|
21
22
|
onReset: onReset,
|
|
22
|
-
children: /*#__PURE__*/_jsx(
|
|
23
|
-
|
|
23
|
+
children: /*#__PURE__*/_jsx(Async, {
|
|
24
|
+
LoadingView: LoadingView,
|
|
24
25
|
children: children
|
|
25
26
|
})
|
|
26
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ErrorBoundary","jsx","_jsx","AsyncBoundary","_ref","LoadingView","ErrorView","onReset","children","fallbackRender","useCallback","_ref2","error","resetErrorBoundary","action","handler"
|
|
1
|
+
{"version":3,"names":["React","ErrorBoundary","Async","jsx","_jsx","AsyncBoundary","_ref","LoadingView","ErrorView","onReset","children","fallbackRender","useCallback","_ref2","error","resetErrorBoundary","action","handler"],"sources":["AsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {FallbackProps} from 'react-error-boundary';\nimport {ErrorBoundary} from 'react-error-boundary';\n\nimport {Async} from '../Async';\n\nimport type {AsyncBoundaryProps} from './types';\n\nexport const AsyncBoundary: React.FC<AsyncBoundaryProps> = ({\n LoadingView,\n ErrorView,\n onReset,\n children,\n}) => {\n const fallbackRender = React.useCallback(\n ({error, resetErrorBoundary}: FallbackProps) => (\n <ErrorView error={error} action={{handler: resetErrorBoundary}} />\n ),\n [ErrorView],\n );\n\n return (\n <ErrorBoundary fallbackRender={fallbackRender} onReset={onReset}>\n <Async LoadingView={LoadingView}>{children}</Async>\n </ErrorBoundary>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAAQC,aAAa,QAAO,sBAAsB;AAElD,SAAQC,KAAK,QAAO,UAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAI/B,OAAO,IAAMC,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAKlD;EAAA,IAJFC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IACXC,SAAS,GAAAF,IAAA,CAATE,SAAS;IACTC,OAAO,GAAAH,IAAA,CAAPG,OAAO;IACPC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;EAER,IAAMC,cAAc,GAAGX,KAAK,CAACY,WAAW,CACpC,UAAAC,KAAA;IAAA,IAAEC,KAAK,GAAAD,KAAA,CAALC,KAAK;MAAEC,kBAAkB,GAAAF,KAAA,CAAlBE,kBAAkB;IAAA,oBACvBX,IAAA,CAACI,SAAS;MAACM,KAAK,EAAEA,KAAM;MAACE,MAAM,EAAE;QAACC,OAAO,EAAEF;MAAkB;IAAE,CAAE,CAAC;EAAA,CACrE,EACD,CAACP,SAAS,CACd,CAAC;EAED,oBACIJ,IAAA,CAACH,aAAa;IAACU,cAAc,EAAEA,cAAe;IAACF,OAAO,EAAEA,OAAQ;IAAAC,QAAA,eAC5DN,IAAA,CAACF,KAAK;MAACK,WAAW,EAAEA,WAAY;MAAAG,QAAA,EAAEA;IAAQ,CAAQ;EAAC,CACxC,CAAC;AAExB,CAAC","ignoreList":[]}
|
|
@@ -6,8 +6,8 @@ export interface AsyncBoundaryProps {
|
|
|
6
6
|
onReset?: () => void;
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps
|
|
9
|
+
export interface AsyncBoundaryComponent<TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {
|
|
10
10
|
Content: React.ComponentType<TProps>;
|
|
11
|
-
Loading: ComponentType<TProps
|
|
12
|
-
Error: ComponentType<
|
|
11
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
12
|
+
Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ErrorViewProps } from '../types';
|
|
3
3
|
import type { AsyncBoundaryComponent } from './types';
|
|
4
|
-
export declare const withAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps
|
|
4
|
+
export declare const withAsyncBoundary: <TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>, ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>) => AsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AsyncBoundary","jsx","_jsx","withAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary =
|
|
1
|
+
{"version":3,"names":["React","AsyncBoundary","jsx","_jsx","withAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary = <\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps & TErrorProps) => (\n <AsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </AsyncBoundary>\n )) as AsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;\n\n WrappedComponent.displayName = `WithAsyncBoundary(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAAQC,aAAa,QAAO,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG9C,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAK1BC,SAAsC,EACtCC,YAAiE,EACjEC,UAA8E,EAC7E;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA2C;IAAA,oBAClEN,IAAA,CAACF,aAAa;MACVK,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQH,IAAA,CAACO,YAAW,EAAAC,aAAA,KAAKF,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CF,SAAS,EAAE,SAAXA,SAASA,CAAGK,UAAU;QAAA,oBAAKT,IAAA,CAACU,UAAS,EAAAF,aAAA,CAAAA,aAAA,KAAKF,KAAK,GAAMG,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAE,QAAA,eAEpEX,IAAA,CAACE,SAAS,EAAAM,aAAA,KAAKF,KAAK,CAAG;IAAC,CACb,CAAC;EAAA,CAC4C;EAEhED,gBAAgB,CAACO,WAAW,wBAAAC,MAAA,CAAwBX,SAAS,CAACU,WAAW,IAAIV,SAAS,CAACY,IAAI,MAAG;EAE9FT,gBAAgB,CAACU,OAAO,GAAGb,SAAS;EACpCG,gBAAgB,CAACW,OAAO,GAAGb,YAAW;EACtCE,gBAAgB,CAACY,KAAK,GAAGb,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
package/build/esm/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["DataManagerContext","useDataManager","DataManagerProvider","withDataManager"],"sources":["index.ts"],"sourcesContent":["export * from './components/AsyncBoundary';\nexport * from './components/DataLoader';\nexport * from './components/DataInfiniteLoader';\nexport * from './components/EmptyView';\nexport type {ErrorAction, ErrorViewProps} from './components/types';\n\nexport {DataManagerContext, useDataManager} from './DataManagerContext';\nexport {DataManagerProvider} from './DataManagerProvider';\nexport type {DataManagerProviderProps} from './DataManagerProvider';\nexport type {WithDataManagerProps} from './withDataManager';\nexport {withDataManager} from './withDataManager';\n"],"mappings":"AAAA,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,iCAAiC;AAC/C,cAAc,wBAAwB;AAGtC,SAAQA,kBAAkB,EAAEC,cAAc,QAAO,sBAAsB;AACvE,SAAQC,mBAAmB,QAAO,uBAAuB;AAGzD,SAAQC,eAAe,QAAO,mBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["DataManagerContext","useDataManager","DataManagerProvider","withDataManager"],"sources":["index.ts"],"sourcesContent":["export * from './components/Async';\nexport * from './components/AsyncBoundary';\nexport * from './components/DataLoader';\nexport * from './components/DataInfiniteLoader';\nexport * from './components/EmptyView';\nexport type {ErrorAction, ErrorViewProps} from './components/types';\n\nexport {DataManagerContext, useDataManager} from './DataManagerContext';\nexport {DataManagerProvider} from './DataManagerProvider';\nexport type {DataManagerProviderProps} from './DataManagerProvider';\nexport type {WithDataManagerProps} from './withDataManager';\nexport {withDataManager} from './withDataManager';\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,4BAA4B;AAC1C,cAAc,yBAAyB;AACvC,cAAc,iCAAiC;AAC/C,cAAc,wBAAwB;AAGtC,SAAQA,kBAAkB,EAAEC,cAAc,QAAO,sBAAsB;AACvE,SAAQC,mBAAmB,QAAO,uBAAuB;AAGzD,SAAQC,eAAe,QAAO,mBAAmB","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@ import type { ComponentType } from 'react';
|
|
|
2
2
|
import type { AsyncBoundaryProps, ErrorViewProps } from '../../../react';
|
|
3
3
|
export interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {
|
|
4
4
|
}
|
|
5
|
-
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps
|
|
5
|
+
export interface QueryAsyncBoundaryComponent<TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {
|
|
6
6
|
Content: React.ComponentType<TProps>;
|
|
7
|
-
Loading: ComponentType<TProps
|
|
8
|
-
Error: ComponentType<
|
|
7
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
8
|
+
Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ErrorViewProps } from '../../../react';
|
|
3
3
|
import type { QueryAsyncBoundaryComponent } from './types';
|
|
4
|
-
export declare const withQueryAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps
|
|
4
|
+
export declare const withQueryAsyncBoundary: <TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>, ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>) => QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","QueryAsyncBoundary","jsx","_jsx","withQueryAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary =
|
|
1
|
+
{"version":3,"names":["React","QueryAsyncBoundary","jsx","_jsx","withQueryAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary = <\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps & TErrorProps) => (\n <QueryAsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;\n\n WrappedComponent.displayName = `WithQueryAsyncBoundary(${\n Component.displayName || Component.name\n })`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAAQC,kBAAkB,QAAO,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGxD,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAK/BC,SAAsC,EACtCC,YAAiE,EACjEC,UAA8E,EAC7E;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA2C;IAAA,oBAClEN,IAAA,CAACF,kBAAkB;MACfK,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQH,IAAA,CAACO,YAAW,EAAAC,aAAA,KAAKF,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CF,SAAS,EAAE,SAAXA,SAASA,CAAGK,UAAU;QAAA,oBAAKT,IAAA,CAACU,UAAS,EAAAF,aAAA,CAAAA,aAAA,KAAKF,KAAK,GAAMG,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAE,QAAA,eAEpEX,IAAA,CAACE,SAAS,EAAAM,aAAA,KAAKF,KAAK,CAAG;IAAC,CACR,CAAC;EAAA,CAC4C;EAErED,gBAAgB,CAACO,WAAW,6BAAAC,MAAA,CACxBX,SAAS,CAACU,WAAW,IAAIV,SAAS,CAACY,IAAI,MACxC;EAEHT,gBAAgB,CAACU,OAAO,GAAGb,SAAS;EACpCG,gBAAgB,CAACW,OAAO,GAAGb,YAAW;EACtCE,gBAAgB,CAACY,KAAK,GAAGb,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
package/build/plugin/esbuild.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
2
2
|
//#region src/plugin/esbuild.ts
|
|
3
3
|
var esbuild_default = (0, require("unplugin").createEsbuildPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/esbuild.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createEsbuildPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/esbuild.ts
|
|
4
4
|
var esbuild_default = createEsbuildPlugin(dataSourceLazyUnpluginFactory);
|
|
@@ -131,6 +131,59 @@ function extractHocInfo(hocsSet, filename, source) {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
+
function extractReExports(filename, source) {
|
|
135
|
+
const named = /* @__PURE__ */ new Map();
|
|
136
|
+
const stars = [];
|
|
137
|
+
const program = parseProgram(filename, source);
|
|
138
|
+
if (!program) return {
|
|
139
|
+
named,
|
|
140
|
+
stars
|
|
141
|
+
};
|
|
142
|
+
const localImports = /* @__PURE__ */ new Map();
|
|
143
|
+
for (const node of program.body) {
|
|
144
|
+
if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
|
|
145
|
+
for (const spec of node.specifiers) {
|
|
146
|
+
if (spec.type !== "ImportSpecifier" || spec.importKind === "type") continue;
|
|
147
|
+
const importedName = spec.imported.type === "Literal" ? spec.imported.value : spec.imported.name;
|
|
148
|
+
localImports.set(spec.local.name, {
|
|
149
|
+
source: node.source.value,
|
|
150
|
+
importedName
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
for (const node of program.body) {
|
|
155
|
+
if (node.type === "ExportAllDeclaration" && node.exportKind !== "type" && !node.exported) {
|
|
156
|
+
stars.push(node.source.value);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
if (node.type !== "ExportNamedDeclaration" || node.exportKind === "type") continue;
|
|
160
|
+
if (node.source) {
|
|
161
|
+
const src = node.source.value;
|
|
162
|
+
for (const spec of node.specifiers) {
|
|
163
|
+
if (spec.exportKind === "type") continue;
|
|
164
|
+
const localName = spec.local.type === "Literal" ? spec.local.value : spec.local.name;
|
|
165
|
+
const exportedName = spec.exported.type === "Literal" ? spec.exported.value : spec.exported.name;
|
|
166
|
+
named.set(exportedName, {
|
|
167
|
+
source: src,
|
|
168
|
+
importedName: localName
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (node.declaration) continue;
|
|
174
|
+
for (const spec of node.specifiers) {
|
|
175
|
+
if (spec.exportKind === "type" || spec.local.type === "Literal") continue;
|
|
176
|
+
const target = localImports.get(spec.local.name);
|
|
177
|
+
if (!target) continue;
|
|
178
|
+
const exportedName = spec.exported.type === "Literal" ? spec.exported.value : spec.exported.name;
|
|
179
|
+
named.set(exportedName, target);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
named,
|
|
184
|
+
stars
|
|
185
|
+
};
|
|
186
|
+
}
|
|
134
187
|
const COMPANION_PROPS_RE = new RegExp(`\\.(${Object.values(COMPANION_TYPES).join("|")})\\b`);
|
|
135
188
|
function extractUsages(filename, source) {
|
|
136
189
|
const result = [];
|
|
@@ -381,15 +434,15 @@ function transformDefinitionModule(s, filename, info) {
|
|
|
381
434
|
}
|
|
382
435
|
}
|
|
383
436
|
function transformUsages(s, usages) {
|
|
384
|
-
for (const {
|
|
437
|
+
for (const { usage } of usages) for (const access of usage.accesses) s.overwrite(access.start, access.end, `${usage.spec.localName}${access.prop}`);
|
|
385
438
|
const newImports = [];
|
|
386
|
-
for (const {
|
|
387
|
-
const propsUsed = new Set(accesses.map((access) => access.prop));
|
|
388
|
-
for (const prop of propsUsed) newImports.push(renderNamedImport(`${spec.localName}${prop}`, `${
|
|
439
|
+
for (const { usage, hocSourceFile, hocExportedName } of usages) {
|
|
440
|
+
const propsUsed = new Set(usage.accesses.map((access) => access.prop));
|
|
441
|
+
for (const prop of propsUsed) newImports.push(renderNamedImport(`${usage.spec.localName}${prop}`, `${hocExportedName}${prop}`, makeCompanionId(COMPANION_TYPE_BY_SUFFIX[prop], hocSourceFile)));
|
|
389
442
|
}
|
|
390
443
|
if (newImports.length > 0) s.prepend(newImports.join("\n") + "\n");
|
|
391
444
|
const localsByDecl = /* @__PURE__ */ new Map();
|
|
392
|
-
for (const usage of usages) {
|
|
445
|
+
for (const { usage } of usages) {
|
|
393
446
|
if (usage.hasOtherUsages) continue;
|
|
394
447
|
let locals = localsByDecl.get(usage.decl);
|
|
395
448
|
if (!locals) localsByDecl.set(usage.decl, locals = /* @__PURE__ */ new Set());
|
|
@@ -434,6 +487,7 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
434
487
|
const hocsSet = new Set(hocPatterns.map((pattern) => getHocString(pattern.from, pattern.name)));
|
|
435
488
|
const hocsRegexp = new RegExp(Array.from(new Set(hocPatterns.map((pattern) => pattern.name))).map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"));
|
|
436
489
|
const hocInfoCache = /* @__PURE__ */ new Map();
|
|
490
|
+
const reExportsCache = /* @__PURE__ */ new Map();
|
|
437
491
|
const getHocInfo = (sourceFile, source) => {
|
|
438
492
|
const key = stripQuery(sourceFile);
|
|
439
493
|
const cachedInfo = hocInfoCache.get(key);
|
|
@@ -443,6 +497,14 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
443
497
|
hocInfoCache.set(key, info);
|
|
444
498
|
return info;
|
|
445
499
|
};
|
|
500
|
+
const getReExports = (sourceFile, source) => {
|
|
501
|
+
const key = stripQuery(sourceFile);
|
|
502
|
+
const cachedReExports = reExportsCache.get(key);
|
|
503
|
+
if (cachedReExports) return cachedReExports;
|
|
504
|
+
const reExports = extractReExports(key, source ?? fs.readFileSync(key, "utf-8"));
|
|
505
|
+
reExportsCache.set(key, reExports);
|
|
506
|
+
return reExports;
|
|
507
|
+
};
|
|
446
508
|
return {
|
|
447
509
|
name: "data-source-lazy",
|
|
448
510
|
enforce: "pre",
|
|
@@ -485,12 +547,42 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
485
547
|
const usages = extractUsages(id, code);
|
|
486
548
|
if (!info && usages.length === 0) return null;
|
|
487
549
|
const filteredUsages = info ? dropAccessesInsideHocArgs(info, usages) : usages;
|
|
550
|
+
const resolveHocSourceFile = async (file, importedName, visited = /* @__PURE__ */ new Set()) => {
|
|
551
|
+
const visitKey = `${file}\0${importedName}`;
|
|
552
|
+
if (visited.has(visitKey)) return null;
|
|
553
|
+
visited.add(visitKey);
|
|
554
|
+
const directInfo = getHocInfo(file);
|
|
555
|
+
if (directInfo && directInfo.exportedName === importedName) return {
|
|
556
|
+
file,
|
|
557
|
+
info: directInfo
|
|
558
|
+
};
|
|
559
|
+
const reExports = getReExports(file);
|
|
560
|
+
const named = reExports.named.get(importedName);
|
|
561
|
+
if (named) {
|
|
562
|
+
const resolved = await resolveSourceFile(this, named.source, file);
|
|
563
|
+
if (resolved) {
|
|
564
|
+
const next = await resolveHocSourceFile(resolved, named.importedName, visited);
|
|
565
|
+
if (next) return next;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
for (const starSource of reExports.stars) {
|
|
569
|
+
const resolved = await resolveSourceFile(this, starSource, file);
|
|
570
|
+
if (!resolved) continue;
|
|
571
|
+
const next = await resolveHocSourceFile(resolved, importedName, visited);
|
|
572
|
+
if (next) return next;
|
|
573
|
+
}
|
|
574
|
+
return null;
|
|
575
|
+
};
|
|
488
576
|
const verifiedUsages = (await Promise.all(filteredUsages.map(async (usage) => {
|
|
489
577
|
const resolvedSourceFile = await resolveSourceFile(this, usage.decl.source, id);
|
|
490
578
|
if (!resolvedSourceFile) return null;
|
|
491
|
-
const
|
|
492
|
-
if (!
|
|
493
|
-
return
|
|
579
|
+
const target = await resolveHocSourceFile(resolvedSourceFile, usage.spec.importedName);
|
|
580
|
+
if (!target) return null;
|
|
581
|
+
return {
|
|
582
|
+
usage,
|
|
583
|
+
hocSourceFile: target.file,
|
|
584
|
+
hocExportedName: target.info.exportedName
|
|
585
|
+
};
|
|
494
586
|
}))).filter((usage) => usage !== null);
|
|
495
587
|
if (!info && verifiedUsages.length === 0) return null;
|
|
496
588
|
const s = new MagicString(code);
|
|
@@ -507,7 +599,9 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
507
599
|
}
|
|
508
600
|
},
|
|
509
601
|
watchChange(id) {
|
|
510
|
-
|
|
602
|
+
const key = stripQuery(id);
|
|
603
|
+
hocInfoCache.delete(key);
|
|
604
|
+
reExportsCache.delete(key);
|
|
511
605
|
}
|
|
512
606
|
};
|
|
513
607
|
};
|
|
@@ -156,6 +156,59 @@ function extractHocInfo(hocsSet, filename, source) {
|
|
|
156
156
|
}
|
|
157
157
|
return null;
|
|
158
158
|
}
|
|
159
|
+
function extractReExports(filename, source) {
|
|
160
|
+
const named = /* @__PURE__ */ new Map();
|
|
161
|
+
const stars = [];
|
|
162
|
+
const program = parseProgram(filename, source);
|
|
163
|
+
if (!program) return {
|
|
164
|
+
named,
|
|
165
|
+
stars
|
|
166
|
+
};
|
|
167
|
+
const localImports = /* @__PURE__ */ new Map();
|
|
168
|
+
for (const node of program.body) {
|
|
169
|
+
if (node.type !== "ImportDeclaration" || node.importKind === "type") continue;
|
|
170
|
+
for (const spec of node.specifiers) {
|
|
171
|
+
if (spec.type !== "ImportSpecifier" || spec.importKind === "type") continue;
|
|
172
|
+
const importedName = spec.imported.type === "Literal" ? spec.imported.value : spec.imported.name;
|
|
173
|
+
localImports.set(spec.local.name, {
|
|
174
|
+
source: node.source.value,
|
|
175
|
+
importedName
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
for (const node of program.body) {
|
|
180
|
+
if (node.type === "ExportAllDeclaration" && node.exportKind !== "type" && !node.exported) {
|
|
181
|
+
stars.push(node.source.value);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
if (node.type !== "ExportNamedDeclaration" || node.exportKind === "type") continue;
|
|
185
|
+
if (node.source) {
|
|
186
|
+
const src = node.source.value;
|
|
187
|
+
for (const spec of node.specifiers) {
|
|
188
|
+
if (spec.exportKind === "type") continue;
|
|
189
|
+
const localName = spec.local.type === "Literal" ? spec.local.value : spec.local.name;
|
|
190
|
+
const exportedName = spec.exported.type === "Literal" ? spec.exported.value : spec.exported.name;
|
|
191
|
+
named.set(exportedName, {
|
|
192
|
+
source: src,
|
|
193
|
+
importedName: localName
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (node.declaration) continue;
|
|
199
|
+
for (const spec of node.specifiers) {
|
|
200
|
+
if (spec.exportKind === "type" || spec.local.type === "Literal") continue;
|
|
201
|
+
const target = localImports.get(spec.local.name);
|
|
202
|
+
if (!target) continue;
|
|
203
|
+
const exportedName = spec.exported.type === "Literal" ? spec.exported.value : spec.exported.name;
|
|
204
|
+
named.set(exportedName, target);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
named,
|
|
209
|
+
stars
|
|
210
|
+
};
|
|
211
|
+
}
|
|
159
212
|
const COMPANION_PROPS_RE = new RegExp(`\\.(${Object.values(COMPANION_TYPES).join("|")})\\b`);
|
|
160
213
|
function extractUsages(filename, source) {
|
|
161
214
|
const result = [];
|
|
@@ -406,15 +459,15 @@ function transformDefinitionModule(s, filename, info) {
|
|
|
406
459
|
}
|
|
407
460
|
}
|
|
408
461
|
function transformUsages(s, usages) {
|
|
409
|
-
for (const {
|
|
462
|
+
for (const { usage } of usages) for (const access of usage.accesses) s.overwrite(access.start, access.end, `${usage.spec.localName}${access.prop}`);
|
|
410
463
|
const newImports = [];
|
|
411
|
-
for (const {
|
|
412
|
-
const propsUsed = new Set(accesses.map((access) => access.prop));
|
|
413
|
-
for (const prop of propsUsed) newImports.push(renderNamedImport(`${spec.localName}${prop}`, `${
|
|
464
|
+
for (const { usage, hocSourceFile, hocExportedName } of usages) {
|
|
465
|
+
const propsUsed = new Set(usage.accesses.map((access) => access.prop));
|
|
466
|
+
for (const prop of propsUsed) newImports.push(renderNamedImport(`${usage.spec.localName}${prop}`, `${hocExportedName}${prop}`, makeCompanionId(COMPANION_TYPE_BY_SUFFIX[prop], hocSourceFile)));
|
|
414
467
|
}
|
|
415
468
|
if (newImports.length > 0) s.prepend(newImports.join("\n") + "\n");
|
|
416
469
|
const localsByDecl = /* @__PURE__ */ new Map();
|
|
417
|
-
for (const usage of usages) {
|
|
470
|
+
for (const { usage } of usages) {
|
|
418
471
|
if (usage.hasOtherUsages) continue;
|
|
419
472
|
let locals = localsByDecl.get(usage.decl);
|
|
420
473
|
if (!locals) localsByDecl.set(usage.decl, locals = /* @__PURE__ */ new Set());
|
|
@@ -459,6 +512,7 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
459
512
|
const hocsSet = new Set(hocPatterns.map((pattern) => getHocString(pattern.from, pattern.name)));
|
|
460
513
|
const hocsRegexp = new RegExp(Array.from(new Set(hocPatterns.map((pattern) => pattern.name))).map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|"));
|
|
461
514
|
const hocInfoCache = /* @__PURE__ */ new Map();
|
|
515
|
+
const reExportsCache = /* @__PURE__ */ new Map();
|
|
462
516
|
const getHocInfo = (sourceFile, source) => {
|
|
463
517
|
const key = stripQuery(sourceFile);
|
|
464
518
|
const cachedInfo = hocInfoCache.get(key);
|
|
@@ -468,6 +522,14 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
468
522
|
hocInfoCache.set(key, info);
|
|
469
523
|
return info;
|
|
470
524
|
};
|
|
525
|
+
const getReExports = (sourceFile, source) => {
|
|
526
|
+
const key = stripQuery(sourceFile);
|
|
527
|
+
const cachedReExports = reExportsCache.get(key);
|
|
528
|
+
if (cachedReExports) return cachedReExports;
|
|
529
|
+
const reExports = extractReExports(key, source ?? node_fs.default.readFileSync(key, "utf-8"));
|
|
530
|
+
reExportsCache.set(key, reExports);
|
|
531
|
+
return reExports;
|
|
532
|
+
};
|
|
471
533
|
return {
|
|
472
534
|
name: "data-source-lazy",
|
|
473
535
|
enforce: "pre",
|
|
@@ -510,12 +572,42 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
510
572
|
const usages = extractUsages(id, code);
|
|
511
573
|
if (!info && usages.length === 0) return null;
|
|
512
574
|
const filteredUsages = info ? dropAccessesInsideHocArgs(info, usages) : usages;
|
|
575
|
+
const resolveHocSourceFile = async (file, importedName, visited = /* @__PURE__ */ new Set()) => {
|
|
576
|
+
const visitKey = `${file}\0${importedName}`;
|
|
577
|
+
if (visited.has(visitKey)) return null;
|
|
578
|
+
visited.add(visitKey);
|
|
579
|
+
const directInfo = getHocInfo(file);
|
|
580
|
+
if (directInfo && directInfo.exportedName === importedName) return {
|
|
581
|
+
file,
|
|
582
|
+
info: directInfo
|
|
583
|
+
};
|
|
584
|
+
const reExports = getReExports(file);
|
|
585
|
+
const named = reExports.named.get(importedName);
|
|
586
|
+
if (named) {
|
|
587
|
+
const resolved = await resolveSourceFile(this, named.source, file);
|
|
588
|
+
if (resolved) {
|
|
589
|
+
const next = await resolveHocSourceFile(resolved, named.importedName, visited);
|
|
590
|
+
if (next) return next;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
for (const starSource of reExports.stars) {
|
|
594
|
+
const resolved = await resolveSourceFile(this, starSource, file);
|
|
595
|
+
if (!resolved) continue;
|
|
596
|
+
const next = await resolveHocSourceFile(resolved, importedName, visited);
|
|
597
|
+
if (next) return next;
|
|
598
|
+
}
|
|
599
|
+
return null;
|
|
600
|
+
};
|
|
513
601
|
const verifiedUsages = (await Promise.all(filteredUsages.map(async (usage) => {
|
|
514
602
|
const resolvedSourceFile = await resolveSourceFile(this, usage.decl.source, id);
|
|
515
603
|
if (!resolvedSourceFile) return null;
|
|
516
|
-
const
|
|
517
|
-
if (!
|
|
518
|
-
return
|
|
604
|
+
const target = await resolveHocSourceFile(resolvedSourceFile, usage.spec.importedName);
|
|
605
|
+
if (!target) return null;
|
|
606
|
+
return {
|
|
607
|
+
usage,
|
|
608
|
+
hocSourceFile: target.file,
|
|
609
|
+
hocExportedName: target.info.exportedName
|
|
610
|
+
};
|
|
519
611
|
}))).filter((usage) => usage !== null);
|
|
520
612
|
if (!info && verifiedUsages.length === 0) return null;
|
|
521
613
|
const s = new magic_string.default(code);
|
|
@@ -532,7 +624,9 @@ const dataSourceLazyUnpluginFactory = (options = {}) => {
|
|
|
532
624
|
}
|
|
533
625
|
},
|
|
534
626
|
watchChange(id) {
|
|
535
|
-
|
|
627
|
+
const key = stripQuery(id);
|
|
628
|
+
hocInfoCache.delete(key);
|
|
629
|
+
reExportsCache.delete(key);
|
|
536
630
|
}
|
|
537
631
|
};
|
|
538
632
|
};
|
package/build/plugin/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_factory = require("./factory-
|
|
5
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
6
6
|
//#region src/plugin/index.ts
|
|
7
7
|
const DataSourceLazyPlugin = /* @__PURE__ */ (0, require("unplugin").createUnplugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
8
8
|
//#endregion
|
package/build/plugin/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory, t as DEFAULT_HOCS } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory, t as DEFAULT_HOCS } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/index.ts
|
|
4
4
|
const DataSourceLazyPlugin = /* @__PURE__ */ createUnplugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/rollup.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
2
2
|
//#region src/plugin/rollup.ts
|
|
3
3
|
var rollup_default = (0, require("unplugin").createRollupPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/rollup.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createRollupPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/rollup.ts
|
|
4
4
|
var rollup_default = createRollupPlugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/rspack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
2
2
|
//#region src/plugin/rspack.ts
|
|
3
3
|
var rspack_default = (0, require("unplugin").createRspackPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/rspack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createRspackPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/rspack.ts
|
|
4
4
|
var rspack_default = createRspackPlugin(dataSourceLazyUnpluginFactory);
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type {ComponentType} from 'react';
|
|
2
2
|
|
|
3
3
|
declare module '@gravity-ui/data-source' {
|
|
4
|
-
interface AsyncBoundaryComponent<
|
|
5
|
-
|
|
4
|
+
interface AsyncBoundaryComponent<
|
|
5
|
+
TProps extends object = {},
|
|
6
|
+
TLoadingProps extends object = {},
|
|
7
|
+
TErrorProps extends object = {},
|
|
8
|
+
> {
|
|
9
|
+
Lazy: ComponentType<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>>;
|
|
6
10
|
}
|
|
7
11
|
|
|
8
|
-
interface QueryAsyncBoundaryComponent<
|
|
9
|
-
|
|
12
|
+
interface QueryAsyncBoundaryComponent<
|
|
13
|
+
TProps extends object = {},
|
|
14
|
+
TLoadingProps extends object = {},
|
|
15
|
+
TErrorProps extends object = {},
|
|
16
|
+
> {
|
|
17
|
+
Lazy: ComponentType<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>>;
|
|
10
18
|
}
|
|
11
19
|
}
|
package/build/plugin/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
2
2
|
//#region src/plugin/vite.ts
|
|
3
3
|
var vite_default = (0, require("unplugin").createVitePlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createVitePlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/vite.ts
|
|
4
4
|
var vite_default = createVitePlugin(dataSourceLazyUnpluginFactory);
|
package/build/plugin/webpack.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-CIwgQy1N.cjs");
|
|
2
2
|
//#region src/plugin/webpack.ts
|
|
3
3
|
var webpack_default = (0, require("unplugin").createWebpackPlugin)(require_factory.dataSourceLazyUnpluginFactory);
|
|
4
4
|
//#endregion
|
package/build/plugin/webpack.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C-n_7Tjo.mjs";
|
|
2
2
|
import { createWebpackPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/webpack.ts
|
|
4
4
|
var webpack_default = createWebpackPlugin(dataSourceLazyUnpluginFactory);
|