@alepha/react 0.10.3 → 0.10.5
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.md +1 -1
- package/dist/index.browser.js +2 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/descriptors/$page.ts +1 -1
- package/src/providers/ReactBrowserProvider.ts +1 -1
- package/src/providers/ReactServerProvider.ts +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core10 from "@alepha/core";
|
|
2
2
|
import { Alepha, Async, Descriptor, Hooks, KIND, Service, State, Static, TObject, TSchema } from "@alepha/core";
|
|
3
3
|
import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "@alepha/server";
|
|
4
4
|
import { ServerRouteCache } from "@alepha/server-cache";
|
|
5
5
|
import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "@alepha/server-links";
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
6
|
+
import * as _alepha_logger0 from "@alepha/logger";
|
|
7
|
+
import * as react1 from "react";
|
|
8
8
|
import React, { AnchorHTMLAttributes, CSSProperties, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
9
9
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
10
|
import { ServerStaticProvider } from "@alepha/server-static";
|
|
@@ -40,14 +40,14 @@ declare class Redirection extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/providers/ReactPageProvider.d.ts
|
|
43
|
-
declare const envSchema$2:
|
|
44
|
-
REACT_STRICT_MODE:
|
|
43
|
+
declare const envSchema$2: _alepha_core10.TObject<{
|
|
44
|
+
REACT_STRICT_MODE: _alepha_core10.TBoolean;
|
|
45
45
|
}>;
|
|
46
46
|
declare module "@alepha/core" {
|
|
47
47
|
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
48
48
|
}
|
|
49
49
|
declare class ReactPageProvider {
|
|
50
|
-
protected readonly log:
|
|
50
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
51
51
|
protected readonly env: {
|
|
52
52
|
REACT_STRICT_MODE: boolean;
|
|
53
53
|
};
|
|
@@ -83,7 +83,7 @@ declare class ReactPageProvider {
|
|
|
83
83
|
}, params?: Record<string, any>): string;
|
|
84
84
|
compile(path: string, params?: Record<string, string>): string;
|
|
85
85
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
86
|
-
protected readonly configure:
|
|
86
|
+
protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
|
|
87
87
|
protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
|
|
88
88
|
add(entry: PageRouteEntry): void;
|
|
89
89
|
protected createMatch(page: PageRoute): string;
|
|
@@ -210,7 +210,7 @@ interface CreateLayersResult {
|
|
|
210
210
|
* path: "/users/:id",
|
|
211
211
|
* schema: {
|
|
212
212
|
* params: t.object({ id: t.int() }),
|
|
213
|
-
* query: t.object({ tab: t.optional(t.
|
|
213
|
+
* query: t.object({ tab: t.optional(t.text()) })
|
|
214
214
|
* },
|
|
215
215
|
* resolve: async ({ params }) => {
|
|
216
216
|
* const user = await userApi.getUser(params.id);
|
|
@@ -489,18 +489,18 @@ interface BrowserRoute extends Route {
|
|
|
489
489
|
page: PageRoute;
|
|
490
490
|
}
|
|
491
491
|
declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
492
|
-
protected readonly log:
|
|
492
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
493
493
|
protected readonly alepha: Alepha;
|
|
494
494
|
protected readonly pageApi: ReactPageProvider;
|
|
495
495
|
add(entry: PageRouteEntry): void;
|
|
496
|
-
protected readonly configure:
|
|
496
|
+
protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
|
|
497
497
|
transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
|
|
498
498
|
root(state: ReactRouterState): ReactNode;
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
502
|
-
declare const envSchema$1:
|
|
503
|
-
REACT_ROOT_ID:
|
|
502
|
+
declare const envSchema$1: _alepha_core10.TObject<{
|
|
503
|
+
REACT_ROOT_ID: _alepha_core10.TString;
|
|
504
504
|
}>;
|
|
505
505
|
declare module "@alepha/core" {
|
|
506
506
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
@@ -512,7 +512,7 @@ declare class ReactBrowserProvider {
|
|
|
512
512
|
protected readonly env: {
|
|
513
513
|
REACT_ROOT_ID: string;
|
|
514
514
|
};
|
|
515
|
-
protected readonly log:
|
|
515
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
516
516
|
protected readonly client: LinkProvider;
|
|
517
517
|
protected readonly alepha: Alepha;
|
|
518
518
|
protected readonly router: ReactBrowserRouterProvider;
|
|
@@ -546,8 +546,8 @@ declare class ReactBrowserProvider {
|
|
|
546
546
|
* Get embedded layers from the server.
|
|
547
547
|
*/
|
|
548
548
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
549
|
-
protected readonly onTransitionEnd:
|
|
550
|
-
readonly ready:
|
|
549
|
+
protected readonly onTransitionEnd: _alepha_core10.HookDescriptor<"react:transition:end">;
|
|
550
|
+
readonly ready: _alepha_core10.HookDescriptor<"ready">;
|
|
551
551
|
}
|
|
552
552
|
interface RouterGoOptions {
|
|
553
553
|
replace?: boolean;
|
|
@@ -632,7 +632,7 @@ interface NestedViewProps {
|
|
|
632
632
|
children?: ReactNode;
|
|
633
633
|
errorBoundary?: false | ((error: Error) => ReactNode);
|
|
634
634
|
}
|
|
635
|
-
declare const _default:
|
|
635
|
+
declare const _default: react1.MemoExoticComponent<(props: NestedViewProps) => react_jsx_runtime0.JSX.Element>;
|
|
636
636
|
//#endregion
|
|
637
637
|
//#region src/components/NotFound.d.ts
|
|
638
638
|
declare function NotFoundPage(props: {
|
|
@@ -640,14 +640,14 @@ declare function NotFoundPage(props: {
|
|
|
640
640
|
}): react_jsx_runtime0.JSX.Element;
|
|
641
641
|
//#endregion
|
|
642
642
|
//#region src/contexts/AlephaContext.d.ts
|
|
643
|
-
declare const AlephaContext:
|
|
643
|
+
declare const AlephaContext: react1.Context<Alepha | undefined>;
|
|
644
644
|
//#endregion
|
|
645
645
|
//#region src/contexts/RouterLayerContext.d.ts
|
|
646
646
|
interface RouterLayerContextValue {
|
|
647
647
|
index: number;
|
|
648
648
|
path: string;
|
|
649
649
|
}
|
|
650
|
-
declare const RouterLayerContext:
|
|
650
|
+
declare const RouterLayerContext: react1.Context<RouterLayerContextValue | undefined>;
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region src/hooks/useActive.d.ts
|
|
653
653
|
interface UseActiveOptions {
|
|
@@ -800,12 +800,12 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
|
|
|
800
800
|
declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
|
|
801
801
|
//#endregion
|
|
802
802
|
//#region src/providers/ReactServerProvider.d.ts
|
|
803
|
-
declare const envSchema:
|
|
804
|
-
REACT_SERVER_DIST:
|
|
805
|
-
REACT_SERVER_PREFIX:
|
|
806
|
-
REACT_SSR_ENABLED:
|
|
807
|
-
REACT_ROOT_ID:
|
|
808
|
-
REACT_SERVER_TEMPLATE:
|
|
803
|
+
declare const envSchema: _alepha_core10.TObject<{
|
|
804
|
+
REACT_SERVER_DIST: _alepha_core10.TString;
|
|
805
|
+
REACT_SERVER_PREFIX: _alepha_core10.TString;
|
|
806
|
+
REACT_SSR_ENABLED: _alepha_core10.TOptional<_alepha_core10.TBoolean>;
|
|
807
|
+
REACT_ROOT_ID: _alepha_core10.TString;
|
|
808
|
+
REACT_SERVER_TEMPLATE: _alepha_core10.TOptional<_alepha_core10.TString>;
|
|
809
809
|
}>;
|
|
810
810
|
declare module "@alepha/core" {
|
|
811
811
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -814,7 +814,7 @@ declare module "@alepha/core" {
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
declare class ReactServerProvider {
|
|
817
|
-
protected readonly log:
|
|
817
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
818
818
|
protected readonly alepha: Alepha;
|
|
819
819
|
protected readonly pageApi: ReactPageProvider;
|
|
820
820
|
protected readonly serverProvider: ServerProvider;
|
|
@@ -830,7 +830,7 @@ declare class ReactServerProvider {
|
|
|
830
830
|
};
|
|
831
831
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
832
832
|
protected preprocessedTemplate: PreprocessedTemplate | null;
|
|
833
|
-
readonly onConfigure:
|
|
833
|
+
readonly onConfigure: _alepha_core10.HookDescriptor<"configure">;
|
|
834
834
|
get template(): string;
|
|
835
835
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
836
836
|
protected getPublicDirectory(): string;
|
|
@@ -903,7 +903,7 @@ declare module "@alepha/core" {
|
|
|
903
903
|
* @see {@link $page}
|
|
904
904
|
* @module alepha.react
|
|
905
905
|
*/
|
|
906
|
-
declare const AlephaReact:
|
|
906
|
+
declare const AlephaReact: _alepha_core10.Service<_alepha_core10.Module<{}>>;
|
|
907
907
|
//#endregion
|
|
908
908
|
export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, LinkProps, _default as NestedView, NotFoundPage as NotFound, PageAnimation, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactRouter, ReactRouterState, ReactServerProvider, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
|
|
909
909
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,7 @@ import { RouterProvider } from "@alepha/router";
|
|
|
60
60
|
* path: "/users/:id",
|
|
61
61
|
* schema: {
|
|
62
62
|
* params: t.object({ id: t.int() }),
|
|
63
|
-
* query: t.object({ tab: t.optional(t.
|
|
63
|
+
* query: t.object({ tab: t.optional(t.text()) })
|
|
64
64
|
* },
|
|
65
65
|
* resolve: async ({ params }) => {
|
|
66
66
|
* const user = await userApi.getUser(params.id);
|
|
@@ -894,11 +894,11 @@ const isPageRoute = (it) => {
|
|
|
894
894
|
//#endregion
|
|
895
895
|
//#region src/providers/ReactServerProvider.ts
|
|
896
896
|
const envSchema$1 = t.object({
|
|
897
|
-
REACT_SERVER_DIST: t.
|
|
898
|
-
REACT_SERVER_PREFIX: t.
|
|
897
|
+
REACT_SERVER_DIST: t.text({ default: "public" }),
|
|
898
|
+
REACT_SERVER_PREFIX: t.text({ default: "" }),
|
|
899
899
|
REACT_SSR_ENABLED: t.optional(t.boolean()),
|
|
900
|
-
REACT_ROOT_ID: t.
|
|
901
|
-
REACT_SERVER_TEMPLATE: t.optional(t.
|
|
900
|
+
REACT_ROOT_ID: t.text({ default: "root" }),
|
|
901
|
+
REACT_SERVER_TEMPLATE: t.optional(t.text({ size: "rich" }))
|
|
902
902
|
});
|
|
903
903
|
var ReactServerProvider = class {
|
|
904
904
|
log = $logger();
|
|
@@ -1266,7 +1266,7 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
|
1266
1266
|
|
|
1267
1267
|
//#endregion
|
|
1268
1268
|
//#region src/providers/ReactBrowserProvider.ts
|
|
1269
|
-
const envSchema = t.object({ REACT_ROOT_ID: t.
|
|
1269
|
+
const envSchema = t.object({ REACT_ROOT_ID: t.text({ default: "root" }) });
|
|
1270
1270
|
var ReactBrowserProvider = class {
|
|
1271
1271
|
env = $env(envSchema);
|
|
1272
1272
|
log = $logger();
|