@gravito/ion 2.0.0 → 3.0.0
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/index.cjs +7 -3
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,6 +116,7 @@ var InertiaService = class {
|
|
|
116
116
|
)
|
|
117
117
|
);
|
|
118
118
|
}
|
|
119
|
+
// ...
|
|
119
120
|
/**
|
|
120
121
|
* Share data with all Inertia responses
|
|
121
122
|
*
|
|
@@ -154,18 +155,21 @@ var InertiaService = class {
|
|
|
154
155
|
|
|
155
156
|
// src/index.ts
|
|
156
157
|
var OrbitIon = class {
|
|
158
|
+
constructor(options = {}) {
|
|
159
|
+
this.options = options;
|
|
160
|
+
}
|
|
157
161
|
/**
|
|
158
162
|
* Install the Inertia orbit into PlanetCore
|
|
159
163
|
*/
|
|
160
164
|
install(core) {
|
|
161
165
|
core.logger.info("\u{1F6F0}\uFE0F Orbit Inertia installed");
|
|
162
|
-
const appVersion = core.config.get("APP_VERSION", "1.0.0");
|
|
166
|
+
const appVersion = this.options.version ?? core.config.get("APP_VERSION", "1.0.0");
|
|
167
|
+
const rootView = this.options.rootView ?? "app";
|
|
163
168
|
core.adapter.use("*", async (c, next) => {
|
|
164
169
|
const gravitoCtx = c;
|
|
165
170
|
const inertia = new InertiaService(gravitoCtx, {
|
|
166
171
|
version: String(appVersion),
|
|
167
|
-
rootView
|
|
168
|
-
// Default to src/views/app.html
|
|
172
|
+
rootView
|
|
169
173
|
});
|
|
170
174
|
c.set("inertia", inertia);
|
|
171
175
|
await next();
|
package/dist/index.d.cts
CHANGED
|
@@ -144,11 +144,17 @@ declare module '@gravito/core' {
|
|
|
144
144
|
* }))
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
+
interface OrbitIonOptions {
|
|
148
|
+
version?: string;
|
|
149
|
+
rootView?: string;
|
|
150
|
+
}
|
|
147
151
|
declare class OrbitIon implements GravitoOrbit {
|
|
152
|
+
private options;
|
|
153
|
+
constructor(options?: OrbitIonOptions);
|
|
148
154
|
/**
|
|
149
155
|
* Install the Inertia orbit into PlanetCore
|
|
150
156
|
*/
|
|
151
157
|
install(core: PlanetCore): void;
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
export { type InertiaConfig, InertiaService, OrbitIon, OrbitIon as default };
|
|
160
|
+
export { type InertiaConfig, InertiaService, OrbitIon, type OrbitIonOptions, OrbitIon as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -144,11 +144,17 @@ declare module '@gravito/core' {
|
|
|
144
144
|
* }))
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
+
interface OrbitIonOptions {
|
|
148
|
+
version?: string;
|
|
149
|
+
rootView?: string;
|
|
150
|
+
}
|
|
147
151
|
declare class OrbitIon implements GravitoOrbit {
|
|
152
|
+
private options;
|
|
153
|
+
constructor(options?: OrbitIonOptions);
|
|
148
154
|
/**
|
|
149
155
|
* Install the Inertia orbit into PlanetCore
|
|
150
156
|
*/
|
|
151
157
|
install(core: PlanetCore): void;
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
export { type InertiaConfig, InertiaService, OrbitIon, OrbitIon as default };
|
|
160
|
+
export { type InertiaConfig, InertiaService, OrbitIon, type OrbitIonOptions, OrbitIon as default };
|
package/dist/index.js
CHANGED
|
@@ -88,6 +88,7 @@ var InertiaService = class {
|
|
|
88
88
|
)
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
+
// ...
|
|
91
92
|
/**
|
|
92
93
|
* Share data with all Inertia responses
|
|
93
94
|
*
|
|
@@ -126,18 +127,21 @@ var InertiaService = class {
|
|
|
126
127
|
|
|
127
128
|
// src/index.ts
|
|
128
129
|
var OrbitIon = class {
|
|
130
|
+
constructor(options = {}) {
|
|
131
|
+
this.options = options;
|
|
132
|
+
}
|
|
129
133
|
/**
|
|
130
134
|
* Install the Inertia orbit into PlanetCore
|
|
131
135
|
*/
|
|
132
136
|
install(core) {
|
|
133
137
|
core.logger.info("\u{1F6F0}\uFE0F Orbit Inertia installed");
|
|
134
|
-
const appVersion = core.config.get("APP_VERSION", "1.0.0");
|
|
138
|
+
const appVersion = this.options.version ?? core.config.get("APP_VERSION", "1.0.0");
|
|
139
|
+
const rootView = this.options.rootView ?? "app";
|
|
135
140
|
core.adapter.use("*", async (c, next) => {
|
|
136
141
|
const gravitoCtx = c;
|
|
137
142
|
const inertia = new InertiaService(gravitoCtx, {
|
|
138
143
|
version: String(appVersion),
|
|
139
|
-
rootView
|
|
140
|
-
// Default to src/views/app.html
|
|
144
|
+
rootView
|
|
141
145
|
});
|
|
142
146
|
c.set("inertia", inertia);
|
|
143
147
|
await next();
|