akanjs 2.1.0 → 2.1.1-rc.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/README.ko.md +1 -1
- package/README.md +1 -1
- package/constant/purify.ts +1 -1
- package/package.json +1 -1
- package/signal/signalContext.ts +1 -1
- package/test/signalTestRuntime.ts +4 -4
- package/types/constant/purify.d.ts +1 -1
- package/types/webkit/index.d.ts +2 -2
- package/ui/Field.tsx +0 -1
- package/ui/Layout/Navbar.tsx +1 -1
- package/ui/Layout/TopLeftAction.tsx +1 -1
- package/ui/Load/Units.tsx +1 -1
- package/ui/System/Client.tsx +12 -14
- package/webkit/index.ts +2 -4
package/README.ko.md
CHANGED
package/README.md
CHANGED
package/constant/purify.ts
CHANGED
|
@@ -33,7 +33,7 @@ export type PurifiedModel<T> = T extends Upload[]
|
|
|
33
33
|
? FileList
|
|
34
34
|
: T extends (infer S)[]
|
|
35
35
|
? PurifiedModel<S>[]
|
|
36
|
-
: T extends string | number | boolean | Dayjs
|
|
36
|
+
: T extends string | number | boolean | Dayjs | File
|
|
37
37
|
? T
|
|
38
38
|
: T extends Map<infer K, infer V>
|
|
39
39
|
? Map<K, PurifiedModel<V>>
|
package/package.json
CHANGED
package/signal/signalContext.ts
CHANGED
|
@@ -457,7 +457,7 @@ export class WebSocketExecutionContext<Appended = unknown> {
|
|
|
457
457
|
makeResponse(result: unknown, endpointInfo: EndpointInfo) {
|
|
458
458
|
return serialize(endpointInfo.returns.returnRef, endpointInfo.returns.arrDepth, result, "object", {
|
|
459
459
|
nullable: endpointInfo.returns.nullable,
|
|
460
|
-
}) as unknown as Response;
|
|
460
|
+
}) as unknown as Response;
|
|
461
461
|
}
|
|
462
462
|
on(event: "disconnect" | "unsubscribe", handler: () => void) {
|
|
463
463
|
if (event === "disconnect") this.onDisconnect.add(handler);
|
|
@@ -88,13 +88,13 @@ export const setupSignalTestTarget = async <Fetch = FetchProxy>(
|
|
|
88
88
|
terminatingContext = undefined;
|
|
89
89
|
const resolvedOptions = { ...configuredOptions, ...options };
|
|
90
90
|
const env: BackendEnv = {
|
|
91
|
-
repoName: process.env.AKAN_PUBLIC_REPO_NAME ?? "
|
|
92
|
-
serveDomain: process.env.AKAN_PUBLIC_SERVE_DOMAIN ?? "
|
|
91
|
+
repoName: process.env.AKAN_PUBLIC_REPO_NAME ?? "akanjs",
|
|
92
|
+
serveDomain: process.env.AKAN_PUBLIC_SERVE_DOMAIN ?? "akanjs.com",
|
|
93
93
|
appName: name,
|
|
94
94
|
environment: "testing",
|
|
95
95
|
operationMode: "local",
|
|
96
|
-
tunnelUsername: process.env.SSH_TUNNEL_USERNAME ?? "
|
|
97
|
-
tunnelPassword: process.env.SSH_TUNNEL_PASSWORD ?? process.env.AKAN_PUBLIC_REPO_NAME ?? "
|
|
96
|
+
tunnelUsername: process.env.SSH_TUNNEL_USERNAME ?? "username",
|
|
97
|
+
tunnelPassword: process.env.SSH_TUNNEL_PASSWORD ?? process.env.AKAN_PUBLIC_REPO_NAME ?? "password",
|
|
98
98
|
};
|
|
99
99
|
TestServer.applyProcessEnv(env, resolvedOptions);
|
|
100
100
|
|
|
@@ -6,7 +6,7 @@ type PurifiedWithObjectToId<T, StateKeys extends keyof GetStateObject<T> = keyof
|
|
|
6
6
|
} & {
|
|
7
7
|
[K in StateKeys as null extends T[K] ? K : never]?: Purified<T[K]> | undefined;
|
|
8
8
|
};
|
|
9
|
-
export type PurifiedModel<T> = T extends Upload[] ? FileList : T extends (infer S)[] ? PurifiedModel<S>[] : T extends string | number | boolean | Dayjs ? T : T extends Map<infer K, infer V> ? Map<K, PurifiedModel<V>> : PurifiedWithObjectToId<T>;
|
|
9
|
+
export type PurifiedModel<T> = T extends Upload[] ? FileList : T extends (infer S)[] ? PurifiedModel<S>[] : T extends string | number | boolean | Dayjs | File ? T : T extends Map<infer K, infer V> ? Map<K, PurifiedModel<V>> : PurifiedWithObjectToId<T>;
|
|
10
10
|
export type PurifyFunc<Input, _DefaultInput = DefaultOf<Input>, _PurifiedInput = PurifiedModel<Input>> = (self: _DefaultInput, isChild?: boolean) => _PurifiedInput | null;
|
|
11
11
|
export declare const makePurify: <I>(modelRef: ConstantCls<I>) => PurifyFunc<I>;
|
|
12
12
|
export {};
|
package/types/webkit/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export { useCsrValues } from "./useCsrValues.d.ts";
|
|
|
10
10
|
export { useDebounce } from "./useDebounce.d.ts";
|
|
11
11
|
export { useFetch, useFetchFn } from "./useFetch.d.ts";
|
|
12
12
|
export { useGeoLocation } from "./useGeoLocation.d.ts";
|
|
13
|
-
export { useInterval } from "./useInterval.d.ts";
|
|
14
|
-
export { usePushNoti } from "./usePushNoti.d.ts";
|
|
15
13
|
export { useHistory } from "./useHistory.d.ts";
|
|
14
|
+
export { useInterval } from "./useInterval.d.ts";
|
|
16
15
|
export { useLocation } from "./useLocation.d.ts";
|
|
16
|
+
export { usePushNoti } from "./usePushNoti.d.ts";
|
|
17
17
|
export { useThrottle } from "./useThrottle.d.ts";
|
package/ui/Field.tsx
CHANGED
package/ui/Layout/Navbar.tsx
CHANGED
|
@@ -18,7 +18,7 @@ export interface NavbarProps {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export const Navbar = ({ back = false, className, height, children, title, left, right }: NavbarProps) => {
|
|
21
|
-
const [render, setRender] = useState(false);
|
|
21
|
+
const [render, setRender] = useState(false);
|
|
22
22
|
const { location } = usePathCtx();
|
|
23
23
|
const suffix = getEnv().renderMode === "csr" ? `-${location.pathRoute.path}` : "";
|
|
24
24
|
useEffect(() => {
|
|
@@ -11,7 +11,7 @@ export interface TopLeftActionProps {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const TopLeftAction = ({ className, children }: TopLeftActionProps) => {
|
|
14
|
-
const [render, setRender] = useState(false);
|
|
14
|
+
const [render, setRender] = useState(false);
|
|
15
15
|
const { location } = usePathCtx();
|
|
16
16
|
const suffix = getEnv().renderMode === "csr" ? `-${location.pathRoute.path}` : "";
|
|
17
17
|
useEffect(() => {
|
package/ui/Load/Units.tsx
CHANGED
|
@@ -140,7 +140,7 @@ function Render<RefName extends string, Light extends { id: string }>({
|
|
|
140
140
|
[namesOfSlice.queryArgsOfModel]: initQueryArgsOfModel,
|
|
141
141
|
[namesOfSlice.sortOfModel]: initSortOfModel,
|
|
142
142
|
});
|
|
143
|
-
loaded.current = true;
|
|
143
|
+
loaded.current = true;
|
|
144
144
|
}, []);
|
|
145
145
|
|
|
146
146
|
const modelInsight = storeUse[namesOfSlice.modelInsight]() as BaseInsight;
|
package/ui/System/Client.tsx
CHANGED
|
@@ -214,6 +214,16 @@ function applyThemePolicy(theme: AkanTheme): void {
|
|
|
214
214
|
document.documentElement.setAttribute("data-theme", theme);
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
+
function buildSearchParams(entries: Iterable<[string, string]>): Record<string, string | string[]> {
|
|
218
|
+
const params: Record<string, string | string[]> = {};
|
|
219
|
+
for (const [key, value] of entries) {
|
|
220
|
+
const current = params[key];
|
|
221
|
+
if (current === undefined) params[key] = value;
|
|
222
|
+
else params[key] = Array.isArray(current) ? [...current, value] : [current, value];
|
|
223
|
+
}
|
|
224
|
+
return params;
|
|
225
|
+
}
|
|
226
|
+
|
|
217
227
|
export const ClientInner = () => {
|
|
218
228
|
const uiOperation = st.use.uiOperation();
|
|
219
229
|
return (
|
|
@@ -249,13 +259,7 @@ export const ClientSsrBridge = ({ lang, prefix = "" }: ClientSsrBridgeProps) =>
|
|
|
249
259
|
const syncHref = (href: string) => {
|
|
250
260
|
const url = new URL(href, window.location.origin);
|
|
251
261
|
const { path } = getPathInfo(`${url.pathname}${url.search}${url.hash}`, lang, prefix);
|
|
252
|
-
const searchParams =
|
|
253
|
-
(params, [key, value]) => {
|
|
254
|
-
params[key] = params[key] ? [...(Array.isArray(params[key]) ? params[key] : [params[key]]), value] : value;
|
|
255
|
-
return params;
|
|
256
|
-
},
|
|
257
|
-
{},
|
|
258
|
-
);
|
|
262
|
+
const searchParams = buildSearchParams(url.searchParams.entries());
|
|
259
263
|
st.set({ pathname: url.pathname, path, searchParams });
|
|
260
264
|
};
|
|
261
265
|
router.init({
|
|
@@ -289,13 +293,7 @@ export const ClientSsrBridge = ({ lang, prefix = "" }: ClientSsrBridgeProps) =>
|
|
|
289
293
|
const sync = () => {
|
|
290
294
|
const { pathname, search, hash } = window.location;
|
|
291
295
|
const { path } = getPathInfo(`${pathname}${search}${hash}`, lang, prefix);
|
|
292
|
-
const searchParams =
|
|
293
|
-
(params, [key, value]) => {
|
|
294
|
-
params[key] = params[key] ? [...(Array.isArray(params[key]) ? params[key] : [params[key]]), value] : value;
|
|
295
|
-
return params;
|
|
296
|
-
},
|
|
297
|
-
{},
|
|
298
|
-
);
|
|
296
|
+
const searchParams = buildSearchParams(new URLSearchParams(search).entries());
|
|
299
297
|
st.set({ pathname: window.location.pathname, path, searchParams });
|
|
300
298
|
};
|
|
301
299
|
sync();
|
package/webkit/index.ts
CHANGED
|
@@ -6,14 +6,12 @@ export type * from "./types";
|
|
|
6
6
|
export { useCamera } from "./useCamera";
|
|
7
7
|
export { useCodepush } from "./useCodepush";
|
|
8
8
|
export { useContact } from "./useContact";
|
|
9
|
-
|
|
10
9
|
export { useCsrValues } from "./useCsrValues";
|
|
11
10
|
export { useDebounce } from "./useDebounce";
|
|
12
11
|
export { useFetch, useFetchFn } from "./useFetch";
|
|
13
12
|
export { useGeoLocation } from "./useGeoLocation";
|
|
14
|
-
export { useInterval } from "./useInterval";
|
|
15
|
-
export { usePushNoti } from "./usePushNoti";
|
|
16
|
-
|
|
17
13
|
export { useHistory } from "./useHistory";
|
|
14
|
+
export { useInterval } from "./useInterval";
|
|
18
15
|
export { useLocation } from "./useLocation";
|
|
16
|
+
export { usePushNoti } from "./usePushNoti";
|
|
19
17
|
export { useThrottle } from "./useThrottle";
|