@elice/material-shared-utils 1.230726.0 → 1.230817.1
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/cjs/_virtual/_rollupPluginBabelHelpers.js +6 -11
- package/cjs/components/MaterialIntlProvider.d.ts +1 -1
- package/cjs/material-config/MaterialConfigContext.d.ts +1 -1
- package/cjs/material-config/MaterialConfigProvider.d.ts +1 -1
- package/cjs/material-config/useMaterialConfigApiClientUpdate.d.ts +1 -1
- package/cjs/material-fetch/useMaterialFetch.d.ts +3 -3
- package/cjs/material-fetch/useMaterialFetchRaw.d.ts +2 -2
- package/cjs/material-hoc/withMaterial.d.ts +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +6 -11
- package/es/components/MaterialIntlProvider.d.ts +1 -1
- package/es/material-config/MaterialConfigContext.d.ts +1 -1
- package/es/material-config/MaterialConfigProvider.d.ts +1 -1
- package/es/material-config/useMaterialConfigApiClientUpdate.d.ts +1 -1
- package/es/material-fetch/useMaterialFetch.d.ts +3 -3
- package/es/material-fetch/useMaterialFetchRaw.d.ts +2 -2
- package/es/material-hoc/withMaterial.d.ts +1 -1
- package/package.json +6 -10
|
@@ -135,7 +135,10 @@ function _regeneratorRuntime() {
|
|
|
135
135
|
if ("executing" === state) throw new Error("Generator is already running");
|
|
136
136
|
if ("completed" === state) {
|
|
137
137
|
if ("throw" === method) throw arg;
|
|
138
|
-
return
|
|
138
|
+
return {
|
|
139
|
+
value: void 0,
|
|
140
|
+
done: !0
|
|
141
|
+
};
|
|
139
142
|
}
|
|
140
143
|
for (context.method = method, context.arg = arg;;) {
|
|
141
144
|
var delegate = context.delegate;
|
|
@@ -188,7 +191,7 @@ function _regeneratorRuntime() {
|
|
|
188
191
|
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
189
192
|
}
|
|
190
193
|
function values(iterable) {
|
|
191
|
-
if (iterable) {
|
|
194
|
+
if (iterable || "" === iterable) {
|
|
192
195
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
193
196
|
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
194
197
|
if ("function" == typeof iterable.next) return iterable;
|
|
@@ -201,15 +204,7 @@ function _regeneratorRuntime() {
|
|
|
201
204
|
return next.next = next;
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
|
-
|
|
205
|
-
next: doneResult
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function doneResult() {
|
|
209
|
-
return {
|
|
210
|
-
value: undefined,
|
|
211
|
-
done: !0
|
|
212
|
-
};
|
|
207
|
+
throw new TypeError(typeof iterable + " is not iterable");
|
|
213
208
|
}
|
|
214
209
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
215
210
|
value: GeneratorFunctionPrototype,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type MaterialIntlProviderPhrases = Record<string, Record<string, string>>;
|
|
3
3
|
export interface MaterialIntlProviderProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
/** Locale code. (default: `ko`) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
export
|
|
3
|
+
export type MaterialConfigSessionKey = null | string;
|
|
4
4
|
export interface MaterialConfig {
|
|
5
5
|
/** Origin of API server. Should start with `http(s?)://` */
|
|
6
6
|
apiOriginUrl: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MaterialConfig } from './MaterialConfigContext';
|
|
3
|
-
|
|
3
|
+
type MaterialConfigProviderProps = Omit<MaterialConfig, 'sessionKey'>;
|
|
4
4
|
declare const MaterialConfigProvider: React.FC<MaterialConfigProviderProps>;
|
|
5
5
|
export default MaterialConfigProvider;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { config as eliceApiClientConfig } from '@elice/api-client';
|
|
2
|
-
export
|
|
2
|
+
export type MaterialConfigApiClientUpdateCallback = typeof eliceApiClientConfig.init;
|
|
3
3
|
export declare const useMaterialConfigApiClientUpdate: (callback: MaterialConfigApiClientUpdateCallback) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EliceApiClientConfigs, EliceApiResponse } from '@elice/api-client';
|
|
2
2
|
import type { enums } from '@elice/types';
|
|
3
3
|
import type { FetchKeyMap } from './useMaterialFetchRaw';
|
|
4
|
-
|
|
4
|
+
type FetchClientInitializer = (config: EliceApiClientConfigs) => void;
|
|
5
5
|
/**
|
|
6
6
|
* Init api client and fetch material for contaner.
|
|
7
7
|
*
|
|
@@ -20,7 +20,7 @@ declare type FetchClientInitializer = (config: EliceApiClientConfigs) => void;
|
|
|
20
20
|
* eliceApiClientConfigs.init
|
|
21
21
|
* );
|
|
22
22
|
*/
|
|
23
|
-
export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal
|
|
23
|
+
export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal) => Promise<EliceApiResponse<R>>, init: FetchClientInitializer) => Record<FetchKeyMap[MT], R[FetchKeyMap[MT]] | null> & {
|
|
24
24
|
materialLecturePage: {
|
|
25
25
|
certificateDescription: string | null;
|
|
26
26
|
certificateFileUrl: string | null;
|
|
@@ -67,7 +67,7 @@ export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R
|
|
|
67
67
|
title: string;
|
|
68
68
|
} | null;
|
|
69
69
|
} & {
|
|
70
|
-
status: import("
|
|
70
|
+
status: import("packages/elice-material-shared-types/es").APIStatus;
|
|
71
71
|
refetch: (signal?: AbortSignal | undefined) => Promise<void>;
|
|
72
72
|
};
|
|
73
73
|
export {};
|
|
@@ -36,9 +36,9 @@ export interface FetchKeyMap {
|
|
|
36
36
|
* isReady // boolean
|
|
37
37
|
* );
|
|
38
38
|
*/
|
|
39
|
-
export declare const useMaterialFetchRaw: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal
|
|
39
|
+
export declare const useMaterialFetchRaw: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal) => Promise<EliceApiResponse<R>>, isReady?: boolean) => Record<FetchKeyMap[MT], R[FetchKeyMap[MT]] | null> & {
|
|
40
40
|
materialLecturePage: GetOrgLecturePageGetResponses['lecturePage'] | null;
|
|
41
41
|
} & {
|
|
42
42
|
status: APIStatus;
|
|
43
|
-
refetch: (signal?: AbortSignal
|
|
43
|
+
refetch: (signal?: AbortSignal) => Promise<void>;
|
|
44
44
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MaterialIntlProviderPhrases } from '../components/MaterialIntlProvider';
|
|
3
3
|
import type { MaterialConfigApiClientUpdateCallback } from '../material-config';
|
|
4
|
-
|
|
4
|
+
type AnyObject = Record<string, any>;
|
|
5
5
|
/**
|
|
6
6
|
* Options for `withMaterial` HOC.
|
|
7
7
|
*/
|
|
@@ -131,7 +131,10 @@ function _regeneratorRuntime() {
|
|
|
131
131
|
if ("executing" === state) throw new Error("Generator is already running");
|
|
132
132
|
if ("completed" === state) {
|
|
133
133
|
if ("throw" === method) throw arg;
|
|
134
|
-
return
|
|
134
|
+
return {
|
|
135
|
+
value: void 0,
|
|
136
|
+
done: !0
|
|
137
|
+
};
|
|
135
138
|
}
|
|
136
139
|
for (context.method = method, context.arg = arg;;) {
|
|
137
140
|
var delegate = context.delegate;
|
|
@@ -184,7 +187,7 @@ function _regeneratorRuntime() {
|
|
|
184
187
|
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
185
188
|
}
|
|
186
189
|
function values(iterable) {
|
|
187
|
-
if (iterable) {
|
|
190
|
+
if (iterable || "" === iterable) {
|
|
188
191
|
var iteratorMethod = iterable[iteratorSymbol];
|
|
189
192
|
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
190
193
|
if ("function" == typeof iterable.next) return iterable;
|
|
@@ -197,15 +200,7 @@ function _regeneratorRuntime() {
|
|
|
197
200
|
return next.next = next;
|
|
198
201
|
}
|
|
199
202
|
}
|
|
200
|
-
|
|
201
|
-
next: doneResult
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
function doneResult() {
|
|
205
|
-
return {
|
|
206
|
-
value: undefined,
|
|
207
|
-
done: !0
|
|
208
|
-
};
|
|
203
|
+
throw new TypeError(typeof iterable + " is not iterable");
|
|
209
204
|
}
|
|
210
205
|
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
211
206
|
value: GeneratorFunctionPrototype,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type MaterialIntlProviderPhrases = Record<string, Record<string, string>>;
|
|
3
3
|
export interface MaterialIntlProviderProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
/** Locale code. (default: `ko`) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
export
|
|
3
|
+
export type MaterialConfigSessionKey = null | string;
|
|
4
4
|
export interface MaterialConfig {
|
|
5
5
|
/** Origin of API server. Should start with `http(s?)://` */
|
|
6
6
|
apiOriginUrl: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MaterialConfig } from './MaterialConfigContext';
|
|
3
|
-
|
|
3
|
+
type MaterialConfigProviderProps = Omit<MaterialConfig, 'sessionKey'>;
|
|
4
4
|
declare const MaterialConfigProvider: React.FC<MaterialConfigProviderProps>;
|
|
5
5
|
export default MaterialConfigProvider;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { config as eliceApiClientConfig } from '@elice/api-client';
|
|
2
|
-
export
|
|
2
|
+
export type MaterialConfigApiClientUpdateCallback = typeof eliceApiClientConfig.init;
|
|
3
3
|
export declare const useMaterialConfigApiClientUpdate: (callback: MaterialConfigApiClientUpdateCallback) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EliceApiClientConfigs, EliceApiResponse } from '@elice/api-client';
|
|
2
2
|
import type { enums } from '@elice/types';
|
|
3
3
|
import type { FetchKeyMap } from './useMaterialFetchRaw';
|
|
4
|
-
|
|
4
|
+
type FetchClientInitializer = (config: EliceApiClientConfigs) => void;
|
|
5
5
|
/**
|
|
6
6
|
* Init api client and fetch material for contaner.
|
|
7
7
|
*
|
|
@@ -20,7 +20,7 @@ declare type FetchClientInitializer = (config: EliceApiClientConfigs) => void;
|
|
|
20
20
|
* eliceApiClientConfigs.init
|
|
21
21
|
* );
|
|
22
22
|
*/
|
|
23
|
-
export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal
|
|
23
|
+
export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal) => Promise<EliceApiResponse<R>>, init: FetchClientInitializer) => Record<FetchKeyMap[MT], R[FetchKeyMap[MT]] | null> & {
|
|
24
24
|
materialLecturePage: {
|
|
25
25
|
certificateDescription: string | null;
|
|
26
26
|
certificateFileUrl: string | null;
|
|
@@ -67,7 +67,7 @@ export declare const useMaterialFetch: <MT extends enums.LectureMaterialType, R
|
|
|
67
67
|
title: string;
|
|
68
68
|
} | null;
|
|
69
69
|
} & {
|
|
70
|
-
status: import("
|
|
70
|
+
status: import("packages/elice-material-shared-types/es").APIStatus;
|
|
71
71
|
refetch: (signal?: AbortSignal | undefined) => Promise<void>;
|
|
72
72
|
};
|
|
73
73
|
export {};
|
|
@@ -36,9 +36,9 @@ export interface FetchKeyMap {
|
|
|
36
36
|
* isReady // boolean
|
|
37
37
|
* );
|
|
38
38
|
*/
|
|
39
|
-
export declare const useMaterialFetchRaw: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal
|
|
39
|
+
export declare const useMaterialFetchRaw: <MT extends enums.LectureMaterialType, R extends Record<FetchKeyMap[MT], Record<string, any>> = Record<FetchKeyMap[MT], Record<string, any>>>(materialType: MT, materialFetchFn: (signal?: AbortSignal) => Promise<EliceApiResponse<R>>, isReady?: boolean) => Record<FetchKeyMap[MT], R[FetchKeyMap[MT]] | null> & {
|
|
40
40
|
materialLecturePage: GetOrgLecturePageGetResponses['lecturePage'] | null;
|
|
41
41
|
} & {
|
|
42
42
|
status: APIStatus;
|
|
43
|
-
refetch: (signal?: AbortSignal
|
|
43
|
+
refetch: (signal?: AbortSignal) => Promise<void>;
|
|
44
44
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MaterialIntlProviderPhrases } from '../components/MaterialIntlProvider';
|
|
3
3
|
import type { MaterialConfigApiClientUpdateCallback } from '../material-config';
|
|
4
|
-
|
|
4
|
+
type AnyObject = Record<string, any>;
|
|
5
5
|
/**
|
|
6
6
|
* Options for `withMaterial` HOC.
|
|
7
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elice/material-shared-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.230817.1",
|
|
4
4
|
"description": "Shared typings for elice material projects",
|
|
5
5
|
"repository": "https://git.elicer.io/elice/frontend/library/elice-material",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"sideEffects": false,
|
|
17
|
-
"engines": {
|
|
18
|
-
"node": "~16.14",
|
|
19
|
-
"yarn": ">=1.20 <2"
|
|
20
|
-
},
|
|
21
17
|
"scripts": {
|
|
22
18
|
"start": "run-s watch",
|
|
23
19
|
"prebuild": "run-s clean",
|
|
@@ -36,14 +32,14 @@
|
|
|
36
32
|
"recoil": "~0.7.3"
|
|
37
33
|
},
|
|
38
34
|
"dependencies": {
|
|
39
|
-
"tslib": "^2.
|
|
35
|
+
"tslib": "^2.6.1"
|
|
40
36
|
},
|
|
41
37
|
"devDependencies": {
|
|
42
|
-
"@elice/api-client": "^1.
|
|
43
|
-
"@elice/material-shared-types": "1.
|
|
44
|
-
"@elice/types": "^1.
|
|
38
|
+
"@elice/api-client": "^1.230815.0",
|
|
39
|
+
"@elice/material-shared-types": "1.230817.1",
|
|
40
|
+
"@elice/types": "^1.230815.0",
|
|
45
41
|
"@types/react": "~17.0.9",
|
|
46
42
|
"react-use": "^17.2.4"
|
|
47
43
|
},
|
|
48
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "93a18ac95c6242a4985f6dc35ca03028312bff71"
|
|
49
45
|
}
|