@lisergia/core 15.0.0 → 16.0.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/CHANGELOG.md +11 -0
- package/dist/index.cjs +9 -7
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -7
- package/package.json +2 -2
- package/src/App.ts +10 -6
- package/.turbo/turbo-build.log +0 -20
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -260,6 +260,7 @@ var ApplicationManager = class extends Component {
|
|
|
260
260
|
nextPage: import_mobx2.observable,
|
|
261
261
|
// Route Information.
|
|
262
262
|
route: import_mobx2.observable,
|
|
263
|
+
routeHistory: import_mobx2.observable,
|
|
263
264
|
// Template Information.
|
|
264
265
|
template: import_mobx2.observable,
|
|
265
266
|
// Page Scroll.
|
|
@@ -381,11 +382,13 @@ var ApplicationManager = class extends Component {
|
|
|
381
382
|
// Navigate.
|
|
382
383
|
//
|
|
383
384
|
route = window.location.pathname;
|
|
385
|
+
routeHistory = [this.route];
|
|
386
|
+
routePushState = true;
|
|
384
387
|
onRouteChange({ oldValue, newValue }) {
|
|
385
388
|
const href = newValue.replace(window.location.origin, "");
|
|
386
389
|
this.onRouteChangeRequest({
|
|
387
390
|
href,
|
|
388
|
-
pushState:
|
|
391
|
+
pushState: this.routePushState
|
|
389
392
|
});
|
|
390
393
|
}
|
|
391
394
|
async onRouteChangeRequest({ href, pushState = true }) {
|
|
@@ -423,6 +426,7 @@ var ApplicationManager = class extends Component {
|
|
|
423
426
|
if (pushState) {
|
|
424
427
|
window.history.pushState({}, this.nextPage.title, href);
|
|
425
428
|
}
|
|
429
|
+
this.routeHistory.push(href);
|
|
426
430
|
}
|
|
427
431
|
//
|
|
428
432
|
// Pop State.
|
|
@@ -431,17 +435,15 @@ var ApplicationManager = class extends Component {
|
|
|
431
435
|
if (event.state === null) {
|
|
432
436
|
return event.preventDefault();
|
|
433
437
|
}
|
|
434
|
-
this.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
});
|
|
438
|
+
this.routePushState = false;
|
|
439
|
+
this.route = document.location.pathname;
|
|
440
|
+
this.routePushState = false;
|
|
438
441
|
}
|
|
439
442
|
//
|
|
440
443
|
// Scroll.
|
|
441
444
|
//
|
|
442
445
|
get scroll() {
|
|
443
|
-
|
|
444
|
-
return ((_a = this.currentPage) == null ? void 0 : _a.scroll) ?? 0;
|
|
446
|
+
return this.currentPage.scroll ?? 0;
|
|
445
447
|
}
|
|
446
448
|
//
|
|
447
449
|
// Listeners.
|
package/dist/index.d.cts
CHANGED
|
@@ -153,6 +153,8 @@ declare class ApplicationManager extends Component {
|
|
|
153
153
|
createPage(template?: string): void;
|
|
154
154
|
destroyPage(): void;
|
|
155
155
|
route: string;
|
|
156
|
+
routeHistory: Array<string>;
|
|
157
|
+
routePushState: boolean;
|
|
156
158
|
onRouteChange({ oldValue, newValue }: IValueDidChange<string>): void;
|
|
157
159
|
onRouteChangeRequest({ href, pushState }: {
|
|
158
160
|
href: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -153,6 +153,8 @@ declare class ApplicationManager extends Component {
|
|
|
153
153
|
createPage(template?: string): void;
|
|
154
154
|
destroyPage(): void;
|
|
155
155
|
route: string;
|
|
156
|
+
routeHistory: Array<string>;
|
|
157
|
+
routePushState: boolean;
|
|
156
158
|
onRouteChange({ oldValue, newValue }: IValueDidChange<string>): void;
|
|
157
159
|
onRouteChangeRequest({ href, pushState }: {
|
|
158
160
|
href: string;
|
package/dist/index.js
CHANGED
|
@@ -217,6 +217,7 @@ var ApplicationManager = class extends Component {
|
|
|
217
217
|
nextPage: observable,
|
|
218
218
|
// Route Information.
|
|
219
219
|
route: observable,
|
|
220
|
+
routeHistory: observable,
|
|
220
221
|
// Template Information.
|
|
221
222
|
template: observable,
|
|
222
223
|
// Page Scroll.
|
|
@@ -338,11 +339,13 @@ var ApplicationManager = class extends Component {
|
|
|
338
339
|
// Navigate.
|
|
339
340
|
//
|
|
340
341
|
route = window.location.pathname;
|
|
342
|
+
routeHistory = [this.route];
|
|
343
|
+
routePushState = true;
|
|
341
344
|
onRouteChange({ oldValue, newValue }) {
|
|
342
345
|
const href = newValue.replace(window.location.origin, "");
|
|
343
346
|
this.onRouteChangeRequest({
|
|
344
347
|
href,
|
|
345
|
-
pushState:
|
|
348
|
+
pushState: this.routePushState
|
|
346
349
|
});
|
|
347
350
|
}
|
|
348
351
|
async onRouteChangeRequest({ href, pushState = true }) {
|
|
@@ -380,6 +383,7 @@ var ApplicationManager = class extends Component {
|
|
|
380
383
|
if (pushState) {
|
|
381
384
|
window.history.pushState({}, this.nextPage.title, href);
|
|
382
385
|
}
|
|
386
|
+
this.routeHistory.push(href);
|
|
383
387
|
}
|
|
384
388
|
//
|
|
385
389
|
// Pop State.
|
|
@@ -388,17 +392,15 @@ var ApplicationManager = class extends Component {
|
|
|
388
392
|
if (event.state === null) {
|
|
389
393
|
return event.preventDefault();
|
|
390
394
|
}
|
|
391
|
-
this.
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
});
|
|
395
|
+
this.routePushState = false;
|
|
396
|
+
this.route = document.location.pathname;
|
|
397
|
+
this.routePushState = false;
|
|
395
398
|
}
|
|
396
399
|
//
|
|
397
400
|
// Scroll.
|
|
398
401
|
//
|
|
399
402
|
get scroll() {
|
|
400
|
-
|
|
401
|
-
return ((_a = this.currentPage) == null ? void 0 : _a.scroll) ?? 0;
|
|
403
|
+
return this.currentPage.scroll ?? 0;
|
|
402
404
|
}
|
|
403
405
|
//
|
|
404
406
|
// Listeners.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lisergia/core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@lisergia/config-tsconfig": "
|
|
12
|
+
"@lisergia/config-tsconfig": "16.0.0",
|
|
13
13
|
"auto-bind": "^5.0.1",
|
|
14
14
|
"gsap": "^3.13.0",
|
|
15
15
|
"lenis": "^1.3.1",
|
package/src/App.ts
CHANGED
|
@@ -43,6 +43,7 @@ export class ApplicationManager extends Component {
|
|
|
43
43
|
|
|
44
44
|
// Route Information.
|
|
45
45
|
route: observable,
|
|
46
|
+
routeHistory: observable,
|
|
46
47
|
|
|
47
48
|
// Template Information.
|
|
48
49
|
template: observable,
|
|
@@ -204,13 +205,15 @@ export class ApplicationManager extends Component {
|
|
|
204
205
|
// Navigate.
|
|
205
206
|
//
|
|
206
207
|
route: string = window.location.pathname
|
|
208
|
+
routeHistory: Array<string> = [this.route]
|
|
209
|
+
routePushState: boolean = true
|
|
207
210
|
|
|
208
211
|
onRouteChange({ oldValue, newValue }: IValueDidChange<string>) {
|
|
209
212
|
const href = newValue.replace(window.location.origin, '')
|
|
210
213
|
|
|
211
214
|
this.onRouteChangeRequest({
|
|
212
215
|
href,
|
|
213
|
-
pushState:
|
|
216
|
+
pushState: this.routePushState,
|
|
214
217
|
})
|
|
215
218
|
}
|
|
216
219
|
|
|
@@ -261,6 +264,8 @@ export class ApplicationManager extends Component {
|
|
|
261
264
|
if (pushState) {
|
|
262
265
|
window.history.pushState({}, this.nextPage.title!, href)
|
|
263
266
|
}
|
|
267
|
+
|
|
268
|
+
this.routeHistory.push(href)
|
|
264
269
|
}
|
|
265
270
|
|
|
266
271
|
//
|
|
@@ -271,17 +276,16 @@ export class ApplicationManager extends Component {
|
|
|
271
276
|
return event.preventDefault()
|
|
272
277
|
}
|
|
273
278
|
|
|
274
|
-
this.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
})
|
|
279
|
+
this.routePushState = false
|
|
280
|
+
this.route = document.location.pathname
|
|
281
|
+
this.routePushState = false
|
|
278
282
|
}
|
|
279
283
|
|
|
280
284
|
//
|
|
281
285
|
// Scroll.
|
|
282
286
|
//
|
|
283
287
|
get scroll() {
|
|
284
|
-
return this.currentPage
|
|
288
|
+
return this.currentPage!.scroll ?? 0
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
//
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
> @lisergia/core@14.0.0 build
|
|
4
|
-
> tsup src/index.ts --format cjs,esm --dts
|
|
5
|
-
|
|
6
|
-
[1G[0K[34mCLI[39m Building entry: src/index.ts
|
|
7
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
-
[34mCLI[39m tsup v8.5.0
|
|
9
|
-
[34mCLI[39m Target: node16
|
|
10
|
-
[34mCJS[39m Build start
|
|
11
|
-
[34mESM[39m Build start
|
|
12
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m16.00 KB[39m
|
|
13
|
-
[32mCJS[39m ⚡️ Build success in 34ms
|
|
14
|
-
[32mESM[39m [1mdist/index.js [22m[32m13.77 KB[39m
|
|
15
|
-
[32mESM[39m ⚡️ Build success in 34ms
|
|
16
|
-
DTS Build start
|
|
17
|
-
DTS ⚡️ Build success in 825ms
|
|
18
|
-
DTS dist/index.d.cts 5.76 KB
|
|
19
|
-
DTS dist/index.d.ts 5.76 KB
|
|
20
|
-
[1G[0K⠙[1G[0K
|