crelte 0.1.1 → 0.1.3
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/dist/Crelte.d.ts +89 -25
- package/dist/Crelte.d.ts.map +1 -1
- package/dist/Crelte.js +79 -38
- package/dist/CrelteRequest.d.ts +63 -0
- package/dist/CrelteRequest.d.ts.map +1 -0
- package/dist/CrelteRequest.js +94 -0
- package/dist/blocks/Blocks.d.ts +27 -3
- package/dist/blocks/Blocks.d.ts.map +1 -1
- package/dist/blocks/Blocks.js +8 -0
- package/dist/blocks/Blocks.svelte +1 -1
- package/dist/blocks/Blocks.svelte.d.ts +36 -4
- package/dist/blocks/Blocks.svelte.d.ts.map +1 -1
- package/dist/blocks/index.d.ts +6 -3
- package/dist/blocks/index.d.ts.map +1 -1
- package/dist/blocks/index.js +3 -2
- package/dist/cookies/ServerCookies.d.ts +1 -1
- package/dist/cookies/ServerCookies.d.ts.map +1 -1
- package/dist/cookies/index.d.ts +7 -0
- package/dist/cookies/index.d.ts.map +1 -1
- package/dist/graphql/GraphQl.d.ts +53 -14
- package/dist/graphql/GraphQl.d.ts.map +1 -1
- package/dist/graphql/GraphQl.js +44 -23
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.d.ts.map +1 -1
- package/dist/graphql/index.js +2 -2
- package/dist/index.d.ts +55 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -23
- package/dist/init/client.d.ts +43 -2
- package/dist/init/client.d.ts.map +1 -1
- package/dist/init/client.js +26 -6
- package/dist/init/server.d.ts +49 -2
- package/dist/init/server.d.ts.map +1 -1
- package/dist/init/server.js +56 -6
- package/dist/init/shared.d.ts +5 -4
- package/dist/init/shared.d.ts.map +1 -1
- package/dist/init/shared.js +3 -3
- package/dist/loadData/Globals.d.ts +41 -2
- package/dist/loadData/Globals.d.ts.map +1 -1
- package/dist/loadData/Globals.js +33 -5
- package/dist/loadData/index.d.ts +74 -11
- package/dist/loadData/index.d.ts.map +1 -1
- package/dist/loadData/index.js +5 -8
- package/dist/plugins/Events.d.ts +18 -5
- package/dist/plugins/Events.d.ts.map +1 -1
- package/dist/plugins/Events.js +3 -0
- package/dist/plugins/Plugins.d.ts +28 -2
- package/dist/plugins/Plugins.d.ts.map +1 -1
- package/dist/plugins/Plugins.js +8 -0
- package/dist/routing/History.d.ts +3 -0
- package/dist/routing/History.d.ts.map +1 -1
- package/dist/routing/History.js +6 -0
- package/dist/routing/InnerRouter.d.ts +10 -9
- package/dist/routing/InnerRouter.d.ts.map +1 -1
- package/dist/routing/InnerRouter.js +41 -33
- package/dist/routing/PageLoader.d.ts +5 -5
- package/dist/routing/PageLoader.d.ts.map +1 -1
- package/dist/routing/PageLoader.js +7 -7
- package/dist/routing/Request.d.ts +102 -0
- package/dist/routing/Request.d.ts.map +1 -0
- package/dist/routing/Request.js +128 -0
- package/dist/routing/Route.d.ts +73 -5
- package/dist/routing/Route.d.ts.map +1 -1
- package/dist/routing/Route.js +72 -7
- package/dist/routing/Router.d.ts +59 -53
- package/dist/routing/Router.d.ts.map +1 -1
- package/dist/routing/Router.js +92 -117
- package/dist/routing/Site.d.ts +1 -1
- package/dist/routing/Site.js +2 -2
- package/dist/routing/index.d.ts +4 -3
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/index.js +2 -1
- package/dist/routing/utils.d.ts +2 -0
- package/dist/routing/utils.d.ts.map +1 -0
- package/dist/routing/utils.js +3 -0
- package/dist/ssr/SsrCache.d.ts +17 -0
- package/dist/ssr/SsrCache.d.ts.map +1 -1
- package/dist/ssr/SsrCache.js +17 -4
- package/dist/ssr/SsrComponents.d.ts +1 -0
- package/dist/ssr/SsrComponents.d.ts.map +1 -1
- package/dist/ssr/SsrComponents.js +1 -0
- package/package.json +6 -6
- package/src/Crelte.ts +124 -52
- package/src/CrelteRequest.ts +124 -0
- package/src/blocks/Blocks.svelte +35 -18
- package/src/blocks/Blocks.ts +38 -6
- package/src/blocks/index.ts +19 -10
- package/src/cookies/ServerCookies.ts +1 -1
- package/src/cookies/index.ts +7 -1
- package/src/graphql/GraphQl.ts +79 -27
- package/src/graphql/index.ts +7 -1
- package/src/index.ts +65 -29
- package/src/init/client.ts +55 -10
- package/src/init/server.ts +70 -10
- package/src/init/shared.ts +8 -7
- package/src/loadData/Globals.ts +43 -7
- package/src/loadData/index.ts +76 -13
- package/src/plugins/Events.ts +16 -5
- package/src/plugins/Plugins.ts +28 -2
- package/src/routing/History.ts +9 -0
- package/src/routing/InnerRouter.ts +47 -37
- package/src/routing/PageLoader.ts +10 -10
- package/src/routing/Request.ts +175 -0
- package/src/routing/Route.ts +74 -9
- package/src/routing/Router.ts +103 -163
- package/src/routing/Site.ts +2 -2
- package/src/routing/index.ts +12 -3
- package/src/routing/utils.ts +3 -0
- package/src/ssr/SsrCache.ts +17 -4
- package/src/ssr/SsrComponents.ts +1 -0
- package/dist/CrelteBase.d.ts +0 -16
- package/dist/CrelteBase.d.ts.map +0 -1
- package/dist/CrelteBase.js +0 -1
- package/dist/CrelteRouted.d.ts +0 -50
- package/dist/CrelteRouted.d.ts.map +0 -1
- package/dist/CrelteRouted.js +0 -88
- package/src/CrelteBase.ts +0 -24
- package/src/CrelteRouted.ts +0 -128
package/dist/Crelte.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { Cookies } from './cookies/index.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import GraphQl, { GraphQlOptions, GraphQlRequestOptions } from './graphql/GraphQl.js';
|
|
5
|
-
import Globals from './loadData/Globals.js';
|
|
2
|
+
import GraphQl, { GraphQlOptions, GraphQlQuery } from './graphql/GraphQl.js';
|
|
3
|
+
import Globals, { Global, GlobalData } from './loadData/Globals.js';
|
|
6
4
|
import Events from './plugins/Events.js';
|
|
7
5
|
import Plugins, { Plugin } from './plugins/Plugins.js';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import Site, { SiteFromGraphQl } from './routing/Site.js';
|
|
6
|
+
import Router, { RouterOptions } from './routing/Router.js';
|
|
7
|
+
import { SiteFromGraphQl } from './routing/Site.js';
|
|
11
8
|
import SsrCache from './ssr/SsrCache.js';
|
|
12
9
|
export declare class CrelteBuilder {
|
|
13
10
|
ssrCache: SsrCache;
|
|
@@ -19,37 +16,104 @@ export declare class CrelteBuilder {
|
|
|
19
16
|
cookies: Cookies;
|
|
20
17
|
constructor();
|
|
21
18
|
setupGraphQl(endpoint: string, opts?: GraphQlOptions): void;
|
|
22
|
-
setupRouter(sites: SiteFromGraphQl[], opts?:
|
|
19
|
+
setupRouter(sites: SiteFromGraphQl[], opts?: RouterOptions): void;
|
|
23
20
|
setupCookies(cookies: string): void;
|
|
24
21
|
build(): Crelte;
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Options to configure the request
|
|
25
|
+
*/
|
|
26
|
+
export type QueryOptions = {
|
|
27
|
+
/**
|
|
28
|
+
* Ignore the response status code
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
ignoreStatusCode?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Configure caching
|
|
34
|
+
* @default true
|
|
35
|
+
*/
|
|
36
|
+
caching?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Status code of the response
|
|
39
|
+
* This will be set after the request if
|
|
40
|
+
* `ignoreStatusCode` is set to `true`
|
|
41
|
+
*/
|
|
42
|
+
status?: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* This is the main class of Crelte and can be accessed
|
|
46
|
+
* in component initialisation via `getCrelte()` and is the
|
|
47
|
+
* first parameter in `loadData`
|
|
48
|
+
*/
|
|
49
|
+
export default class Crelte {
|
|
50
|
+
protected _ssrCache: SsrCache;
|
|
51
|
+
protected _graphQl: GraphQl;
|
|
52
|
+
protected _router: Router;
|
|
53
|
+
protected _plugins: Plugins;
|
|
54
|
+
protected _events: Events;
|
|
55
|
+
protected _globals: Globals;
|
|
56
|
+
protected _cookies: Cookies;
|
|
57
|
+
constructor(builder: CrelteBuilder | Crelte);
|
|
58
|
+
/**
|
|
59
|
+
* Get the SSR cache
|
|
60
|
+
*/
|
|
61
|
+
get ssrCache(): SsrCache;
|
|
62
|
+
/**
|
|
63
|
+
* Get the GraphQl instance
|
|
64
|
+
*/
|
|
65
|
+
get graphQl(): GraphQl;
|
|
66
|
+
/**
|
|
67
|
+
* Get the Router instance
|
|
68
|
+
*/
|
|
69
|
+
get router(): Router;
|
|
70
|
+
/**
|
|
71
|
+
* Get the Plugins instance
|
|
72
|
+
*/
|
|
73
|
+
get plugins(): Plugins;
|
|
74
|
+
/**
|
|
75
|
+
* Get the Events instance
|
|
76
|
+
*/
|
|
77
|
+
get events(): Events;
|
|
78
|
+
/**
|
|
79
|
+
* Get the Globals instance
|
|
80
|
+
*/
|
|
81
|
+
get globals(): Globals;
|
|
82
|
+
/**
|
|
83
|
+
* Get the Cookies instance
|
|
84
|
+
*/
|
|
85
|
+
get cookies(): Cookies;
|
|
86
|
+
/**
|
|
87
|
+
* Get a Plugin by name
|
|
88
|
+
*/
|
|
35
89
|
getPlugin(name: string): Plugin | null;
|
|
36
90
|
/**
|
|
37
|
-
* returns an env
|
|
38
|
-
*
|
|
91
|
+
* returns an env variable from the craft/.env file.
|
|
92
|
+
* All env variables need to start with VITE_
|
|
93
|
+
* except ENDPOINT_URL and CRAFT_WEB_URL
|
|
39
94
|
*/
|
|
95
|
+
getEnv(name: 'ENDPOINT_URL'): string;
|
|
96
|
+
getEnv(name: 'CRAFT_WEB_URL'): string;
|
|
40
97
|
getEnv(name: string): string | null;
|
|
41
|
-
|
|
42
|
-
|
|
98
|
+
/**
|
|
99
|
+
* returns a store which contains a globalSet
|
|
100
|
+
*
|
|
101
|
+
* ## Note
|
|
102
|
+
* This only works in loadData, in loadGlobalData this will
|
|
103
|
+
* always return null. In that context you should use
|
|
104
|
+
* `CrelteRequest.getGlobalAsync`
|
|
105
|
+
*/
|
|
106
|
+
getGlobal<T extends GlobalData>(name: string): Global<T> | null;
|
|
43
107
|
/**
|
|
44
108
|
* Run a GraphQl Query
|
|
45
109
|
*
|
|
46
|
-
* @param query the default export from a graphql file
|
|
110
|
+
* @param query the default export from a graphql file or the gql`query {}`
|
|
111
|
+
* function
|
|
47
112
|
* @param variables variables that should be passed to the
|
|
48
113
|
* graphql query
|
|
49
|
-
* @param options opts `{ caching: true, previewToken: string,
|
|
50
|
-
* siteToken: string, ignoreStatusCode: false, headers: {} }`
|
|
51
114
|
*/
|
|
52
|
-
query(query: GraphQlQuery, variables?: Record<string, unknown>, opts?:
|
|
115
|
+
query(query: GraphQlQuery, variables?: Record<string, unknown>, opts?: QueryOptions): Promise<unknown>;
|
|
116
|
+
/** @hidden */
|
|
53
117
|
_getContext(): Map<string, any>;
|
|
54
118
|
}
|
|
55
119
|
//# sourceMappingURL=Crelte.d.ts.map
|
package/dist/Crelte.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Crelte.d.ts","sourceRoot":"","sources":["../../../src/Crelte.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,
|
|
1
|
+
{"version":3,"file":"Crelte.d.ts","sourceRoot":"","sources":["../../../src/Crelte.ts"],"names":[],"mappings":"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"}
|
package/dist/Crelte.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import ClientCookies from './cookies/ClientCookies.js';
|
|
2
2
|
import ServerCookies from './cookies/ServerCookies.js';
|
|
3
|
-
import CrelteRouted from './CrelteRouted.js';
|
|
4
3
|
import GraphQl from './graphql/GraphQl.js';
|
|
5
4
|
import Globals from './loadData/Globals.js';
|
|
6
5
|
import Events from './plugins/Events.js';
|
|
@@ -38,66 +37,108 @@ export class CrelteBuilder {
|
|
|
38
37
|
return new Crelte(this);
|
|
39
38
|
}
|
|
40
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* This is the main class of Crelte and can be accessed
|
|
42
|
+
* in component initialisation via `getCrelte()` and is the
|
|
43
|
+
* first parameter in `loadData`
|
|
44
|
+
*/
|
|
41
45
|
export default class Crelte {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
_ssrCache;
|
|
47
|
+
_graphQl;
|
|
48
|
+
_router;
|
|
49
|
+
_plugins;
|
|
50
|
+
_events;
|
|
51
|
+
_globals;
|
|
52
|
+
_cookies;
|
|
49
53
|
constructor(builder) {
|
|
50
54
|
if (!builder.graphQl || !builder.router)
|
|
51
55
|
throw new Error('builder not ready');
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
56
|
+
this._ssrCache = builder.ssrCache;
|
|
57
|
+
this._graphQl = builder.graphQl;
|
|
58
|
+
this._router = builder.router;
|
|
59
|
+
this._plugins = builder.plugins;
|
|
60
|
+
this._events = builder.events;
|
|
61
|
+
this._globals = builder.globals;
|
|
62
|
+
this._cookies = builder.cookies;
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Get the SSR cache
|
|
66
|
+
*/
|
|
67
|
+
get ssrCache() {
|
|
68
|
+
return this._ssrCache;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get the GraphQl instance
|
|
72
|
+
*/
|
|
73
|
+
get graphQl() {
|
|
74
|
+
return this._graphQl;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get the Router instance
|
|
78
|
+
*/
|
|
79
|
+
get router() {
|
|
80
|
+
return this._router;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the Plugins instance
|
|
84
|
+
*/
|
|
85
|
+
get plugins() {
|
|
86
|
+
return this._plugins;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Get the Events instance
|
|
90
|
+
*/
|
|
91
|
+
get events() {
|
|
92
|
+
return this._events;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the Globals instance
|
|
96
|
+
*/
|
|
97
|
+
get globals() {
|
|
98
|
+
return this._globals;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get the Cookies instance
|
|
102
|
+
*/
|
|
103
|
+
get cookies() {
|
|
104
|
+
return this._cookies;
|
|
62
105
|
}
|
|
63
106
|
/**
|
|
64
|
-
*
|
|
65
|
-
* Except ENDPOINT_URL and CRAFT_WEB_URL
|
|
107
|
+
* Get a Plugin by name
|
|
66
108
|
*/
|
|
109
|
+
getPlugin(name) {
|
|
110
|
+
return this.plugins.get(name);
|
|
111
|
+
}
|
|
67
112
|
getEnv(name) {
|
|
68
113
|
return this.ssrCache.get(name);
|
|
69
114
|
}
|
|
70
|
-
|
|
71
|
-
|
|
115
|
+
/**
|
|
116
|
+
* returns a store which contains a globalSet
|
|
117
|
+
*
|
|
118
|
+
* ## Note
|
|
119
|
+
* This only works in loadData, in loadGlobalData this will
|
|
120
|
+
* always return null. In that context you should use
|
|
121
|
+
* `CrelteRequest.getGlobalAsync`
|
|
122
|
+
*/
|
|
72
123
|
getGlobal(name) {
|
|
73
124
|
return this.globals.get(name) ?? null;
|
|
74
125
|
}
|
|
75
|
-
/// requires a site if the route does not contain a site
|
|
76
|
-
toRouted(route, site) {
|
|
77
|
-
if (!route) {
|
|
78
|
-
route = this.router.route.get();
|
|
79
|
-
}
|
|
80
|
-
if (!site) {
|
|
81
|
-
if (!route.site)
|
|
82
|
-
throw new Error('site is required');
|
|
83
|
-
site = route.site;
|
|
84
|
-
}
|
|
85
|
-
return new CrelteRouted(this, route, site);
|
|
86
|
-
}
|
|
87
126
|
/**
|
|
88
127
|
* Run a GraphQl Query
|
|
89
128
|
*
|
|
90
|
-
* @param query the default export from a graphql file
|
|
129
|
+
* @param query the default export from a graphql file or the gql`query {}`
|
|
130
|
+
* function
|
|
91
131
|
* @param variables variables that should be passed to the
|
|
92
132
|
* graphql query
|
|
93
|
-
* @param options opts `{ caching: true, previewToken: string,
|
|
94
|
-
* siteToken: string, ignoreStatusCode: false, headers: {} }`
|
|
95
133
|
*/
|
|
96
134
|
async query(query, variables = {}, opts = {}) {
|
|
97
135
|
// this function is added as convenience
|
|
98
|
-
return this.
|
|
136
|
+
return this.graphQl.query(query, variables, {
|
|
137
|
+
route: this.router.route.get(),
|
|
138
|
+
...opts,
|
|
139
|
+
});
|
|
99
140
|
}
|
|
100
|
-
|
|
141
|
+
/** @hidden */
|
|
101
142
|
_getContext() {
|
|
102
143
|
const map = new Map();
|
|
103
144
|
map.set('crelte', this);
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import Crelte, { QueryOptions } from './Crelte.js';
|
|
2
|
+
import { GraphQlQuery } from './graphql/GraphQl.js';
|
|
3
|
+
import Site from './routing/Site.js';
|
|
4
|
+
import Request from './routing/Request.js';
|
|
5
|
+
import Route from './routing/Route.js';
|
|
6
|
+
import { GlobalData } from './loadData/Globals.js';
|
|
7
|
+
export default class CrelteRequest extends Crelte {
|
|
8
|
+
/**
|
|
9
|
+
* The current request
|
|
10
|
+
*/
|
|
11
|
+
req: Request;
|
|
12
|
+
/**
|
|
13
|
+
* The current site
|
|
14
|
+
*/
|
|
15
|
+
site: Site;
|
|
16
|
+
private innerGlobals;
|
|
17
|
+
constructor(inner: Crelte, req: Request, site: Site);
|
|
18
|
+
/**
|
|
19
|
+
* Create a CrelteRequest from a Crelte instance
|
|
20
|
+
*
|
|
21
|
+
* If you don't provide a route or request the current route
|
|
22
|
+
* will be used.
|
|
23
|
+
*
|
|
24
|
+
* ## Note
|
|
25
|
+
* If you provide a route it must contain a site or you must
|
|
26
|
+
* provide one,
|
|
27
|
+
*/
|
|
28
|
+
static fromCrelte(inner: Crelte, req?: Route | Request, site?: Site): CrelteRequest;
|
|
29
|
+
/**
|
|
30
|
+
* Get the current request
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
33
|
+
get route(): Request;
|
|
34
|
+
/**
|
|
35
|
+
* returns a globalSet
|
|
36
|
+
*
|
|
37
|
+
* ## Note
|
|
38
|
+
* This only works in loadData, in loadGlobalData this will
|
|
39
|
+
* always return null. In that context you should use
|
|
40
|
+
* `.getGlobalAsync`
|
|
41
|
+
*/
|
|
42
|
+
getGlobal<T extends GlobalData>(name: string): T | null;
|
|
43
|
+
/**
|
|
44
|
+
* Get a globalSet and wait until it is loaded
|
|
45
|
+
*
|
|
46
|
+
* ## Note
|
|
47
|
+
* This is only useful in loadGlobalData in all other cases
|
|
48
|
+
* you can use `.getGlobal` which does return a Promise
|
|
49
|
+
*/
|
|
50
|
+
getGlobalAsync<T extends GlobalData>(name: string): Promise<T | null>;
|
|
51
|
+
/**
|
|
52
|
+
* Run a GraphQl Query
|
|
53
|
+
*
|
|
54
|
+
* @param query the default export from a graphql file or the gql`query {}`
|
|
55
|
+
* function
|
|
56
|
+
* @param variables variables that should be passed to the
|
|
57
|
+
* graphql query
|
|
58
|
+
*/
|
|
59
|
+
query(query: GraphQlQuery, variables?: Record<string, unknown>, opts?: QueryOptions): Promise<unknown>;
|
|
60
|
+
/** @hidden */
|
|
61
|
+
_globalDataLoaded(): void;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=CrelteRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CrelteRequest.d.ts","sourceRoot":"","sources":["../../../src/CrelteRequest.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,MAAM;IAChD;;OAEG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX,OAAO,CAAC,YAAY,CAAmB;gBAG3B,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI;IAQnD;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAChB,KAAK,EAAE,MAAM,EACb,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,EACrB,IAAI,CAAC,EAAE,IAAI,GACT,aAAa;IAiBhB;;;OAGG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAIvD;;;;;;OAMG;IACG,cAAc,CAAC,CAAC,SAAS,UAAU,EACxC,IAAI,EAAE,MAAM,GACV,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAUpB;;;;;;;OAOG;IACG,KAAK,CACV,KAAK,EAAE,YAAY,EACnB,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACvC,IAAI,GAAE,YAAiB,GACrB,OAAO,CAAC,OAAO,CAAC;IAQnB,cAAc;IACd,iBAAiB;CAGjB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Crelte from './Crelte.js';
|
|
2
|
+
import Request from './routing/Request.js';
|
|
3
|
+
export default class CrelteRequest extends Crelte {
|
|
4
|
+
/**
|
|
5
|
+
* The current request
|
|
6
|
+
*/
|
|
7
|
+
req;
|
|
8
|
+
/**
|
|
9
|
+
* The current site
|
|
10
|
+
*/
|
|
11
|
+
site;
|
|
12
|
+
innerGlobals;
|
|
13
|
+
/// requires a site if the route does not contain a site
|
|
14
|
+
constructor(inner, req, site) {
|
|
15
|
+
super(inner);
|
|
16
|
+
this.req = req;
|
|
17
|
+
this.site = site;
|
|
18
|
+
this.innerGlobals = new Map();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a CrelteRequest from a Crelte instance
|
|
22
|
+
*
|
|
23
|
+
* If you don't provide a route or request the current route
|
|
24
|
+
* will be used.
|
|
25
|
+
*
|
|
26
|
+
* ## Note
|
|
27
|
+
* If you provide a route it must contain a site or you must
|
|
28
|
+
* provide one,
|
|
29
|
+
*/
|
|
30
|
+
static fromCrelte(inner, req, site) {
|
|
31
|
+
if (!req) {
|
|
32
|
+
req = inner.router.route.get();
|
|
33
|
+
}
|
|
34
|
+
if (!site) {
|
|
35
|
+
if (!req.site)
|
|
36
|
+
throw new Error('site is required');
|
|
37
|
+
site = req.site;
|
|
38
|
+
}
|
|
39
|
+
return new CrelteRequest(inner, req instanceof Request ? req : Request.fromRoute(req), site);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the current request
|
|
43
|
+
* @deprecated
|
|
44
|
+
*/
|
|
45
|
+
get route() {
|
|
46
|
+
return this.req;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* returns a globalSet
|
|
50
|
+
*
|
|
51
|
+
* ## Note
|
|
52
|
+
* This only works in loadData, in loadGlobalData this will
|
|
53
|
+
* always return null. In that context you should use
|
|
54
|
+
* `.getGlobalAsync`
|
|
55
|
+
*/
|
|
56
|
+
getGlobal(name) {
|
|
57
|
+
return this.innerGlobals.get(name) ?? null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get a globalSet and wait until it is loaded
|
|
61
|
+
*
|
|
62
|
+
* ## Note
|
|
63
|
+
* This is only useful in loadGlobalData in all other cases
|
|
64
|
+
* you can use `.getGlobal` which does return a Promise
|
|
65
|
+
*/
|
|
66
|
+
async getGlobalAsync(name) {
|
|
67
|
+
const global = this.innerGlobals.get(name);
|
|
68
|
+
if (global)
|
|
69
|
+
return global;
|
|
70
|
+
const r = await this.globals.getAsync(name);
|
|
71
|
+
if (!r)
|
|
72
|
+
return null;
|
|
73
|
+
return r.bySiteId(this.site.id);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Run a GraphQl Query
|
|
77
|
+
*
|
|
78
|
+
* @param query the default export from a graphql file or the gql`query {}`
|
|
79
|
+
* function
|
|
80
|
+
* @param variables variables that should be passed to the
|
|
81
|
+
* graphql query
|
|
82
|
+
*/
|
|
83
|
+
async query(query, variables = {}, opts = {}) {
|
|
84
|
+
// this function is added as convenience
|
|
85
|
+
return this.graphQl.query(query, variables, {
|
|
86
|
+
route: this.req,
|
|
87
|
+
...opts,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** @hidden */
|
|
91
|
+
_globalDataLoaded() {
|
|
92
|
+
this.innerGlobals = this.globals._globalsBySite(this.site.id);
|
|
93
|
+
}
|
|
94
|
+
}
|
package/dist/blocks/Blocks.d.ts
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CrelteRequest } from '../index.js';
|
|
2
2
|
export interface Module {
|
|
3
|
+
/** Svelte component */
|
|
3
4
|
default: any;
|
|
5
|
+
/** Handle of the block, this only works with { eager: true } */
|
|
4
6
|
handle?: string | string[];
|
|
7
|
+
/** If true the typeHandle will be avaiable for this component */
|
|
5
8
|
keepTypeHandle?: boolean;
|
|
6
|
-
loadData?: (block: any) => Promise<any>;
|
|
9
|
+
loadData?: (cr: CrelteRequest, block: any, opts: BlockOptions) => Promise<any>;
|
|
7
10
|
}
|
|
11
|
+
export type BlockOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* The returns the sibling block or null if it does not exist
|
|
14
|
+
*
|
|
15
|
+
* -1 = previous block
|
|
16
|
+
* 0 = current block
|
|
17
|
+
* 1 = next block
|
|
18
|
+
*/
|
|
19
|
+
getSibling: (offset: number) => Record<string, any> | null;
|
|
20
|
+
};
|
|
8
21
|
export type AsyncModule = (() => Promise<Module>) | Module;
|
|
9
22
|
export type BlockModulesOptions = {
|
|
23
|
+
/**
|
|
24
|
+
* If a block should handle multiple typehandles
|
|
25
|
+
*/
|
|
10
26
|
alias?: Record<string, string>;
|
|
11
27
|
};
|
|
12
28
|
export declare class BlockModules {
|
|
@@ -20,13 +36,21 @@ export declare class BlockModules {
|
|
|
20
36
|
*/
|
|
21
37
|
load(requiredModules: Set<string>): Promise<Map<string, Module>>;
|
|
22
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new Blocks instance
|
|
41
|
+
*
|
|
42
|
+
* Consider using the Blocks component instead
|
|
43
|
+
*
|
|
44
|
+
* @param blocks the blocks data each block must have a typeHandle
|
|
45
|
+
* @param modules the modules created with `blockModules`
|
|
46
|
+
*/
|
|
23
47
|
export declare function newBlocks(blocks: any[], modules: BlockModules): Promise<Blocks>;
|
|
24
48
|
export default class Blocks {
|
|
25
49
|
blocks: any[];
|
|
26
50
|
data: any[];
|
|
27
51
|
modules: Map<string, Module>;
|
|
28
52
|
constructor(blocks: any[], modules: Map<string, Module>);
|
|
29
|
-
loadData(cr:
|
|
53
|
+
loadData(cr: CrelteRequest): Promise<void>;
|
|
30
54
|
each(): {
|
|
31
55
|
mod: any;
|
|
32
56
|
props: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.d.ts","sourceRoot":"","sources":["../../../../src/blocks/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Blocks.d.ts","sourceRoot":"","sources":["../../../../src/blocks/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,WAAW,MAAM;IACtB,uBAAuB;IACvB,OAAO,EAAE,GAAG,CAAC;IAEb,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,iEAAiE;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,CACV,EAAE,EAAE,aAAa,EACjB,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,YAAY,KACd,OAAO,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG;IAC1B;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,qBAAa,YAAY;IACxB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAG1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACpC,IAAI,GAAE,mBAAwB;IAgC/B;;;;OAIG;IACG,IAAI,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAmBtE;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC9B,MAAM,EAAE,GAAG,EAAE,EACb,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,MAAM,CAAC,OAAO,OAAO,MAAM;IAC1B,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEjB,MAAM,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAMjD,QAAQ,CAAC,EAAE,EAAE,aAAa;IAkBhC,IAAI,IAAI;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,EAAE;CAclC"}
|
package/dist/blocks/Blocks.js
CHANGED
|
@@ -42,6 +42,14 @@ export class BlockModules {
|
|
|
42
42
|
return new Map([...requiredModules.keys()].map((mod, i) => [mod, loaded[i]]));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new Blocks instance
|
|
47
|
+
*
|
|
48
|
+
* Consider using the Blocks component instead
|
|
49
|
+
*
|
|
50
|
+
* @param blocks the blocks data each block must have a typeHandle
|
|
51
|
+
* @param modules the modules created with `blockModules`
|
|
52
|
+
*/
|
|
45
53
|
export async function newBlocks(blocks, modules) {
|
|
46
54
|
// define all required modules
|
|
47
55
|
const requiredModules = new Set();
|
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import
|
|
3
|
-
import Blocks, { type AsyncModule, type
|
|
4
|
-
|
|
2
|
+
import CrelteRequest from '../CrelteRequest.js';
|
|
3
|
+
import Blocks, { type AsyncModule, type BlockModulesOptions, BlockModules } from './Blocks.js';
|
|
4
|
+
/**
|
|
5
|
+
* Create a BlockModules instance from modules
|
|
6
|
+
*
|
|
7
|
+
* ## Example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const mods = blockModules(
|
|
10
|
+
* import.meta.glob('./contentDetail/*.svelte', { eager: true })
|
|
11
|
+
);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* ## Example with alias
|
|
15
|
+
* ```ts
|
|
16
|
+
* const mods = blockModules(
|
|
17
|
+
* import.meta.glob('./contentDetail/*.svelte'),
|
|
18
|
+
* {
|
|
19
|
+
* alias: {
|
|
20
|
+
* fakename: 'filename',
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* );
|
|
24
|
+
*/
|
|
5
25
|
export declare function blockModules(modules: Record<string, AsyncModule>, opts?: BlockModulesOptions): BlockModules;
|
|
6
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Load blocks data
|
|
28
|
+
*
|
|
29
|
+
* ## Example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const mods = blockModules(import.meta.glob('./contentDetail/*.svelte'));
|
|
32
|
+
*
|
|
33
|
+
* export const loadData = {
|
|
34
|
+
* blocks: (cr, entry) => loadBlocksData(cr, entry.blocks, mods)
|
|
35
|
+
* };
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadBlocksData(cr: CrelteRequest, blocks: any[], modules: BlockModules): Promise<Blocks>;
|
|
7
38
|
declare const __propDef: {
|
|
8
39
|
props: {
|
|
9
40
|
[x: string]: any;
|
|
@@ -21,4 +52,5 @@ export type BlocksEvents = typeof __propDef.events;
|
|
|
21
52
|
export type BlocksSlots = typeof __propDef.slots;
|
|
22
53
|
export default class Blocks extends SvelteComponent<BlocksProps, BlocksEvents, BlocksSlots> {
|
|
23
54
|
}
|
|
55
|
+
export {};
|
|
24
56
|
//# sourceMappingURL=Blocks.svelte.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.svelte.d.ts","sourceRoot":"","sources":["../../../../src/blocks/Blocks.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Blocks.svelte.d.ts","sourceRoot":"","sources":["../../../../src/blocks/Blocks.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACA,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAkBhD,OAAO,MAAM,EAAE,EACd,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,YAAY,EAEZ,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACpC,IAAI,GAAE,mBAAwB,GAC5B,YAAY,CAEd;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,aAAa,EACjB,MAAM,EAAE,GAAG,EAAE,EACb,OAAO,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,CAMjB;AAcF,QAAA,MAAM,SAAS;;;gBAD8B,MAAM;;;;;;;;CAC2B,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEjD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;CAC1F"}
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import Blocks, {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import Blocks, { blockModules, loadBlocksData } from './Blocks.svelte';
|
|
2
|
+
import type { BlockModules, BlockModulesOptions, AsyncModule, Module, BlockOptions } from './Blocks.js';
|
|
3
|
+
import type BlocksInstance from './Blocks.js';
|
|
4
|
+
import { newBlocks } from './Blocks.js';
|
|
5
|
+
export type { BlocksInstance, BlockModules, BlockModulesOptions, AsyncModule, Module, BlockOptions, };
|
|
6
|
+
export { newBlocks, Blocks, blockModules, loadBlocksData };
|
|
4
7
|
export default Blocks;
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EACX,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,cAAc,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,YAAY,EACX,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,MAAM,EACN,YAAY,GACZ,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE3D,eAAe,MAAM,CAAC"}
|
package/dist/blocks/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import Blocks, { blockModules, loadBlocksData
|
|
2
|
-
|
|
1
|
+
import Blocks, { blockModules, loadBlocksData } from './Blocks.svelte';
|
|
2
|
+
import { newBlocks } from './Blocks.js';
|
|
3
|
+
export { newBlocks, Blocks, blockModules, loadBlocksData };
|
|
3
4
|
export default Blocks;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cookies, SetOptions } from './index.js';
|
|
2
|
-
import { SetCookie } from './utils.js';
|
|
2
|
+
import { type SetCookie } from './utils.js';
|
|
3
3
|
export default class ServerCookies implements Cookies {
|
|
4
4
|
requestCookies: Map<string, string>;
|
|
5
5
|
setCookies: Map<string, SetCookie>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerCookies.d.ts","sourceRoot":"","sources":["../../../../src/cookies/ServerCookies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAgB,SAAS,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ServerCookies.d.ts","sourceRoot":"","sources":["../../../../src/cookies/ServerCookies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAgB,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE7E,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,OAAO;IACpD,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;;IAOnC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM5B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAUhC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAIzD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI1B,qBAAqB,IAAI,MAAM,EAAE;CAKjC"}
|