@thestarweb/star-framework-app-web-vue 1.0.12 → 1.0.17
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/CHANGELOG.md +40 -0
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/data-context/context-helper.js +2 -2
- package/dist/data-context/context-helper.js.map +1 -1
- package/dist/data-context/index.js +1 -1
- package/dist/data-context/index.js.map +1 -1
- package/dist/render.js +6 -3
- package/dist/render.js.map +1 -1
- package/package.json +7 -4
- package/src/cli/index.ts +9 -9
- package/src/data-context/base-url.ts +5 -5
- package/src/data-context/context-helper.ts +46 -46
- package/src/data-context/index.ts +13 -13
- package/src/data-context/request.ts +6 -6
- package/src/data-context/route.ts +9 -9
- package/src/index.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.17](https://github.com/star-ss-qaq/star-node-framework/compare/%40thestarweb%2Fstar-framework-app-web-vue%401.0.16...%40thestarweb%2Fstar-framework-app-web-vue%401.0.17) (2026-11-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @thestarweb/star-framework-app-web-vue
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.0.16](https://github.com/star-ss-qaq/star-node-framework/compare/%40thestarweb%2Fstar-framework-app-web-vue%401.0.15...%40thestarweb%2Fstar-framework-app-web-vue%401.0.16) (2026-11-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @thestarweb/star-framework-app-web-vue
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.0.15](https://github.com/star-ss-qaq/star-node-framework/compare/@thestarweb/star-framework-app-web-vue@1.0.14...@thestarweb/star-framework-app-web-vue@1.0.15) (2026-11-25)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @thestarweb/star-framework-app-web-vue
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.0.14](https://github.com/star-ss-qaq/star-node-framework/compare/@thestarweb/star-framework-app-web-vue@1.0.13...@thestarweb/star-framework-app-web-vue@1.0.14) (2026-11-25)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @thestarweb/star-framework-app-web-vue
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [1.0.13](https://github.com/star-ss-qaq/star-node-framework/compare/@thestarweb/star-framework-app-web-vue@1.0.12...@thestarweb/star-framework-app-web-vue@1.0.13) (2026-11-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @thestarweb/star-framework-app-web-vue
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
## [1.0.12](https://github.com/star-ss-qaq/star-node-framework/compare/@thestarweb/star-framework-app-web-vue@1.0.10...@thestarweb/star-framework-app-web-vue@1.0.12) (2026-11-20)
|
|
7
47
|
|
|
8
48
|
|
package/dist/cli/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
SFWebVuePlugin.__type = ['SFPluging', 'SFWebVuePlugin', 'P"w!/"'];
|
|
1
2
|
import vuePlugin from "@vitejs/plugin-vue";
|
|
2
3
|
export function SFWebVuePlugin() {
|
|
3
4
|
return {
|
|
@@ -5,5 +6,4 @@ export function SFWebVuePlugin() {
|
|
|
5
6
|
vitePlugin: vuePlugin(),
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
|
-
SFWebVuePlugin.__type = ['SFPluging', 'SFWebVuePlugin', 'P"w!/"'];
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,SAAS,EAAE;KACvB,CAAC;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,cAAc;IAC7B,OAAO;QACN,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,SAAS,EAAE;KACvB,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,8 @@ function __assignType(fn, args) {
|
|
|
2
2
|
fn.__type = args;
|
|
3
3
|
return fn;
|
|
4
4
|
}
|
|
5
|
+
sfContextToRef.__type = ['context', 'ComputedRef', 'sfContextToRef', 'P"2!"w"/#'];
|
|
6
|
+
createSystemProvide.__type = ['path', () => __ΩGetPType, 'defaultValue', 'createSystemProvide', 'P"2!"o""2#"/$'];
|
|
5
7
|
import { SFDataContext, } from "@thestarweb/star-framework-app-web";
|
|
6
8
|
import { computed, inject, shallowRef, } from "vue";
|
|
7
9
|
const __ΩGetSFDataContextType = ['T', () => SFDataContext, 'GetSFDataContextType', 'l:e"!R#RPde#!Ph"!7"qk#\'QRb!Pde"!p)w#y'];
|
|
@@ -13,7 +15,6 @@ export function sfContextToRef(context) {
|
|
|
13
15
|
}, ['newValue', '', 'P"2!"/"']));
|
|
14
16
|
return computed(() => r.value);
|
|
15
17
|
}
|
|
16
|
-
sfContextToRef.__type = ['context', 'ComputedRef', 'sfContextToRef', 'P"2!"w"/#'];
|
|
17
18
|
const __ΩGetPType = ['P', 'RenderDataContext', "system", () => SFDataContext, 'ComputedRef', "system", 'GetPType', 'l2"w%R"w".&fe#!fRb!Pd"w".#fe"!fPh"!7$qk#\'Qw\'y'];
|
|
18
19
|
export function createSystemProvide(path, defaultValue) {
|
|
19
20
|
const provideKey = Symbol();
|
|
@@ -27,5 +28,4 @@ export function createSystemProvide(path, defaultValue) {
|
|
|
27
28
|
},
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
createSystemProvide.__type = ['path', () => __ΩGetPType, 'defaultValue', 'createSystemProvide', 'P"2!"o""2#"/$'];
|
|
31
31
|
//# sourceMappingURL=context-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-helper.js","sourceRoot":"","sources":["../../src/data-context/context-helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context-helper.js","sourceRoot":"","sources":["../../src/data-context/context-helper.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAEN,aAAa,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEN,QAAQ,EAER,MAAM,EAEN,UAAU,GACV,MAAM,KAAK,CAAC;;;AAKb,MAAM,UAAU,cAAc,CAC7B,OAAU;IAEV,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,OAAO,CAAC,KAAK,cAAC,CAAC,QAAQ,EAAE,EAAE;QAC1B,CAAC,CAAC,KAAK,GAAG,QAAQ,CAAC;IACpB,CAAC,+BAAC,CAAC;IACH,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;;AAKD,MAAM,UAAU,mBAAmB,CAEjC,IAAO,EAAE,YAAyB;IACnC,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;IAC5B,OAAO;QACN,OAAO,wBAAP,OAAO,CAAC,OAA0B,EAAE,GAAQ;YAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,GAAG,CAAC,OAAO,CACV,UAAU,EACV,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAC9D,CAAC;QACH,CAAC;QACD,GAAG;YACF,QAAO,MAAM,mHAAN,MAAM,CAAc,UAAU,EAAE,YAAY,CAAC,EAAC;QACtD,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -2,6 +2,7 @@ function __assignType(fn, args) {
|
|
|
2
2
|
fn.__type = args;
|
|
3
3
|
return fn;
|
|
4
4
|
}
|
|
5
|
+
provideSystemContext.__type = ['RenderDataContext', 'context', 'App', 'app', 'provideSystemContext', 'P"w!2""w#2$"/%'];
|
|
5
6
|
import { provideRequest } from "./request.js";
|
|
6
7
|
import { provideRoute } from "./route.js";
|
|
7
8
|
export * from "./context-helper.js";
|
|
@@ -11,5 +12,4 @@ export * from "./base-url.js";
|
|
|
11
12
|
export function provideSystemContext(context, app) {
|
|
12
13
|
[provideRoute, provideRequest].forEach(__assignType((fn) => fn(context, app), ['fn', '', 'P"2!"/"']));
|
|
13
14
|
}
|
|
14
|
-
provideSystemContext.__type = ['RenderDataContext', 'context', 'App', 'app', 'provideSystemContext', 'P"w!2""w#2$"/%'];
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-context/index.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,MAAM,UAAU,oBAAoB,CAAC,OAA0B,EAAE,GAAQ;IACxE,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,OAAO,cAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,yBAAC,CAAC;AAClE,CAAC"}
|
package/dist/render.js
CHANGED
|
@@ -2,6 +2,9 @@ function __assignType(fn, args) {
|
|
|
2
2
|
fn.__type = args;
|
|
3
3
|
return fn;
|
|
4
4
|
}
|
|
5
|
+
const Ωt0 = ['RenderContext', '"w!'];
|
|
6
|
+
const Ωt1 = ['Ref', '"w!'];
|
|
7
|
+
const Ωt2 = ['!'];
|
|
5
8
|
import { createApp, createSSRApp, h, inject, onMounted, onUpdated, provide, ref, shallowRef, watch, } from "vue";
|
|
6
9
|
import { renderToString } from "vue/server-renderer";
|
|
7
10
|
/*@ts-ignore*/
|
|
@@ -27,7 +30,7 @@ export class VueRender {
|
|
|
27
30
|
app.provide(routeProvideKey, child);
|
|
28
31
|
app.component("sf-route", {
|
|
29
32
|
setup() {
|
|
30
|
-
const child = (inject.Ω = [
|
|
33
|
+
const child = (inject.Ω = [Ωt0], inject(routeProvideKey));
|
|
31
34
|
provide(routeProvideKey, child.child);
|
|
32
35
|
const subRender = child.render;
|
|
33
36
|
if (subRender instanceof VueRender) {
|
|
@@ -55,7 +58,7 @@ export class VueRender {
|
|
|
55
58
|
this._makeContext(context, app);
|
|
56
59
|
app.component("sf-route", {
|
|
57
60
|
setup: () => {
|
|
58
|
-
const refChild = (inject.Ω = [
|
|
61
|
+
const refChild = (inject.Ω = [Ωt1], inject(routeProvideKey));
|
|
59
62
|
const refSubChild = shallowRef(refChild.value.child);
|
|
60
63
|
watch(refChild, __assignType((newValue, _, onCleanup) => {
|
|
61
64
|
refSubChild.value = newValue.child;
|
|
@@ -64,7 +67,7 @@ export class VueRender {
|
|
|
64
67
|
}));
|
|
65
68
|
}, ['newValue', '_', 'onCleanup', '', 'P"2!"2""2#"/$']), { immediate: true });
|
|
66
69
|
provide(routeProvideKey, refSubChild);
|
|
67
|
-
const divRef = (ref.Ω = [
|
|
70
|
+
const divRef = (ref.Ω = [Ωt2], ref());
|
|
68
71
|
let ins = null;
|
|
69
72
|
const render = __assignType((hydrate = false) => {
|
|
70
73
|
ins?.unMount();
|
package/dist/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":";;;;;;;AAOA,OAAO,EAGN,SAAS,EACT,YAAY,EAEZ,CAAC,EACD,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EAEP,GAAG,EACH,UAAU,EACV,KAAK,GACL,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;;gCAClB,kCAAkC;AAArE,OAAO,EAAE,IAAI,EAAgB,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,eAAe,GAAG,MAAM,EAAE,CAAC;AACjC,MAAM,OAAO,SAAS;IAED;IADpB,IAAI,CAAa;IACjB,YAAoB,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;IAAG,CAAC;IAC3D,KAAK,CAAC,aAAa;QAClB,IAAI,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IACD,YAAY,CAAC,OAA0B,EAAE,GAAQ;QAChD,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IACD,KAAK,CAAC,cAAc,CACnB,OAA0B,EAC1B,IAAS,EACT,KAAoB;QAEpB,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACpC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
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thestarweb/star-framework-app-web-vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Star Framework Web App VUE plugin",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
9
|
+
"repository": {
|
|
10
|
+
"url": "https://github.com/star-ss-qaq/star-node-framework"
|
|
11
|
+
},
|
|
9
12
|
"publishConfig": {
|
|
10
13
|
"access": "public"
|
|
11
14
|
},
|
|
@@ -15,8 +18,8 @@
|
|
|
15
18
|
"test": "vitest"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"@thestarweb/star-framework-app-web": "^1.2.
|
|
19
|
-
"@thestarweb/star-framework-utils": "^1.0.
|
|
21
|
+
"@thestarweb/star-framework-app-web": "^1.2.9",
|
|
22
|
+
"@thestarweb/star-framework-utils": "^1.0.5",
|
|
20
23
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
21
24
|
"tslib": "^2.8.1"
|
|
22
25
|
},
|
|
@@ -36,5 +39,5 @@
|
|
|
36
39
|
"README.md"
|
|
37
40
|
],
|
|
38
41
|
"license": "ISC",
|
|
39
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "adf3256b302c09f1ab9ef9139481959e08c22f11"
|
|
40
43
|
}
|
package/src/cli/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { SFPluging } from "@thestarweb/star-framework-cli";
|
|
2
|
-
import vuePlugin from "@vitejs/plugin-vue";
|
|
3
|
-
|
|
4
|
-
export function SFWebVuePlugin(): SFPluging {
|
|
5
|
-
return {
|
|
6
|
-
name: "sf-web-vue",
|
|
7
|
-
vitePlugin: vuePlugin(),
|
|
8
|
-
};
|
|
9
|
-
}
|
|
1
|
+
import type { SFPluging } from "@thestarweb/star-framework-cli";
|
|
2
|
+
import vuePlugin from "@vitejs/plugin-vue";
|
|
3
|
+
|
|
4
|
+
export function SFWebVuePlugin(): SFPluging {
|
|
5
|
+
return {
|
|
6
|
+
name: "sf-web-vue",
|
|
7
|
+
vitePlugin: vuePlugin(),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createSystemProvide } from "./context-helper.js";
|
|
2
|
-
|
|
3
|
-
const base = createSystemProvide("baseUrl", "/");
|
|
4
|
-
export const provideBaseUrl = base.provide;
|
|
5
|
-
export const useBaseUrl = base.use;
|
|
1
|
+
import { createSystemProvide } from "./context-helper.js";
|
|
2
|
+
|
|
3
|
+
const base = createSystemProvide("baseUrl", "/");
|
|
4
|
+
export const provideBaseUrl = base.provide;
|
|
5
|
+
export const useBaseUrl = base.use;
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type RenderDataContext,
|
|
3
|
-
SFDataContext,
|
|
4
|
-
} from "@thestarweb/star-framework-app-web";
|
|
5
|
-
import {
|
|
6
|
-
App,
|
|
7
|
-
computed,
|
|
8
|
-
ComputedRef,
|
|
9
|
-
inject,
|
|
10
|
-
ShallowRef,
|
|
11
|
-
shallowRef,
|
|
12
|
-
} from "vue";
|
|
13
|
-
|
|
14
|
-
export type GetSFDataContextType<T extends SFDataContext<any>> =
|
|
15
|
-
T extends SFDataContext<infer R> ? R : unknown;
|
|
16
|
-
|
|
17
|
-
export function sfContextToRef<T extends SFDataContext<any>>(
|
|
18
|
-
context: T,
|
|
19
|
-
): ComputedRef<GetSFDataContextType<T>> {
|
|
20
|
-
const r = shallowRef(context.value);
|
|
21
|
-
context.watch((newValue) => {
|
|
22
|
-
r.value = newValue;
|
|
23
|
-
});
|
|
24
|
-
return computed(() => r.value);
|
|
25
|
-
}
|
|
26
|
-
type GetPType<P extends keyof RenderDataContext["system"]> =
|
|
27
|
-
RenderDataContext["system"][P] extends SFDataContext<infer TT>
|
|
28
|
-
? ComputedRef<TT>
|
|
29
|
-
: RenderDataContext["system"][P];
|
|
30
|
-
export function createSystemProvide<
|
|
31
|
-
P extends keyof RenderDataContext["system"],
|
|
32
|
-
>(path: P, defaultValue: GetPType<P>) {
|
|
33
|
-
const provideKey = Symbol();
|
|
34
|
-
return {
|
|
35
|
-
provide(context: RenderDataContext, app: App) {
|
|
36
|
-
const value = context.system[path];
|
|
37
|
-
app.provide(
|
|
38
|
-
provideKey,
|
|
39
|
-
value instanceof SFDataContext ? sfContextToRef(value) : value,
|
|
40
|
-
);
|
|
41
|
-
},
|
|
42
|
-
use() {
|
|
43
|
-
return inject<GetPType<P>>(provideKey, defaultValue);
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
type RenderDataContext,
|
|
3
|
+
SFDataContext,
|
|
4
|
+
} from "@thestarweb/star-framework-app-web";
|
|
5
|
+
import {
|
|
6
|
+
App,
|
|
7
|
+
computed,
|
|
8
|
+
ComputedRef,
|
|
9
|
+
inject,
|
|
10
|
+
ShallowRef,
|
|
11
|
+
shallowRef,
|
|
12
|
+
} from "vue";
|
|
13
|
+
|
|
14
|
+
export type GetSFDataContextType<T extends SFDataContext<any>> =
|
|
15
|
+
T extends SFDataContext<infer R> ? R : unknown;
|
|
16
|
+
|
|
17
|
+
export function sfContextToRef<T extends SFDataContext<any>>(
|
|
18
|
+
context: T,
|
|
19
|
+
): ComputedRef<GetSFDataContextType<T>> {
|
|
20
|
+
const r = shallowRef(context.value);
|
|
21
|
+
context.watch((newValue) => {
|
|
22
|
+
r.value = newValue;
|
|
23
|
+
});
|
|
24
|
+
return computed(() => r.value);
|
|
25
|
+
}
|
|
26
|
+
type GetPType<P extends keyof RenderDataContext["system"]> =
|
|
27
|
+
RenderDataContext["system"][P] extends SFDataContext<infer TT>
|
|
28
|
+
? ComputedRef<TT>
|
|
29
|
+
: RenderDataContext["system"][P];
|
|
30
|
+
export function createSystemProvide<
|
|
31
|
+
P extends keyof RenderDataContext["system"],
|
|
32
|
+
>(path: P, defaultValue: GetPType<P>) {
|
|
33
|
+
const provideKey = Symbol();
|
|
34
|
+
return {
|
|
35
|
+
provide(context: RenderDataContext, app: App) {
|
|
36
|
+
const value = context.system[path];
|
|
37
|
+
app.provide(
|
|
38
|
+
provideKey,
|
|
39
|
+
value instanceof SFDataContext ? sfContextToRef(value) : value,
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
use() {
|
|
43
|
+
return inject<GetPType<P>>(provideKey, defaultValue);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type RenderDataContext } from "@thestarweb/star-framework-app-web";
|
|
2
|
-
import { provideRequest } from "./request.js";
|
|
3
|
-
import { App } from "vue";
|
|
4
|
-
import { provideRoute } from "./route.js";
|
|
5
|
-
|
|
6
|
-
export * from "./context-helper.js";
|
|
7
|
-
export * from "./route.js";
|
|
8
|
-
export * from "./request.js";
|
|
9
|
-
export * from "./base-url.js";
|
|
10
|
-
|
|
11
|
-
export function provideSystemContext(context: RenderDataContext, app: App) {
|
|
12
|
-
[provideRoute, provideRequest].forEach((fn) => fn(context, app));
|
|
13
|
-
}
|
|
1
|
+
import { type RenderDataContext } from "@thestarweb/star-framework-app-web";
|
|
2
|
+
import { provideRequest } from "./request.js";
|
|
3
|
+
import { App } from "vue";
|
|
4
|
+
import { provideRoute } from "./route.js";
|
|
5
|
+
|
|
6
|
+
export * from "./context-helper.js";
|
|
7
|
+
export * from "./route.js";
|
|
8
|
+
export * from "./request.js";
|
|
9
|
+
export * from "./base-url.js";
|
|
10
|
+
|
|
11
|
+
export function provideSystemContext(context: RenderDataContext, app: App) {
|
|
12
|
+
[provideRoute, provideRequest].forEach((fn) => fn(context, app));
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createSystemProvide } from "./context-helper.js";
|
|
2
|
-
import { SFWebRequest } from "@thestarweb/star-framework-app-web";
|
|
3
|
-
|
|
4
|
-
const base = createSystemProvide("request", null as any as SFWebRequest);
|
|
5
|
-
export const provideRequest = base.provide;
|
|
6
|
-
export const useRequest = base.use;
|
|
1
|
+
import { createSystemProvide } from "./context-helper.js";
|
|
2
|
+
import { SFWebRequest } from "@thestarweb/star-framework-app-web";
|
|
3
|
+
|
|
4
|
+
const base = createSystemProvide("request", null as any as SFWebRequest);
|
|
5
|
+
export const provideRequest = base.provide;
|
|
6
|
+
export const useRequest = base.use;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { createSystemProvide } from "./context-helper.js";
|
|
3
|
-
|
|
4
|
-
const base = createSystemProvide(
|
|
5
|
-
"route",
|
|
6
|
-
computed(() => ({ allRoute: [] })),
|
|
7
|
-
);
|
|
8
|
-
export const provideRoute = base.provide;
|
|
9
|
-
export const useRoute = base.use;
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { createSystemProvide } from "./context-helper.js";
|
|
3
|
+
|
|
4
|
+
const base = createSystemProvide(
|
|
5
|
+
"route",
|
|
6
|
+
computed(() => ({ allRoute: [] })),
|
|
7
|
+
);
|
|
8
|
+
export const provideRoute = base.provide;
|
|
9
|
+
export const useRoute = base.use;
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./render.js";
|
|
2
|
-
// @side-only server
|
|
3
|
-
export * from "./cli/index.js";
|
|
4
|
-
export { useRoute, useRequest, useBaseUrl } from "./data-context/index.js";
|
|
1
|
+
export * from "./render.js";
|
|
2
|
+
// @side-only server
|
|
3
|
+
export * from "./cli/index.js";
|
|
4
|
+
export { useRoute, useRequest, useBaseUrl } from "./data-context/index.js";
|