@lisergia/core 15.0.0 → 16.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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @lisergia/core@14.0.0 build
3
+ > @lisergia/core@15.0.0 build
4
4
  > tsup src/index.ts --format cjs,esm --dts
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -9,12 +9,12 @@
9
9
  CLI Target: node16
10
10
  CJS Build start
11
11
  ESM Build start
12
- CJS dist/index.cjs 16.00 KB
13
- CJS ⚡️ Build success in 34ms
14
12
  ESM dist/index.js 13.77 KB
15
- ESM ⚡️ Build success in 34ms
13
+ ESM ⚡️ Build success in 131ms
14
+ CJS dist/index.cjs 15.99 KB
15
+ CJS ⚡️ Build success in 131ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 825ms
17
+ DTS ⚡️ Build success in 840ms
18
18
  DTS dist/index.d.cts 5.76 KB
19
19
  DTS dist/index.d.ts 5.76 KB
20
20
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @lisergia/core
2
2
 
3
+ ## 16.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Update routing popState logic.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @lisergia/config-tsconfig@16.0.0
13
+
3
14
  ## 15.0.0
4
15
 
5
16
  ### Major Changes
package/dist/index.cjs CHANGED
@@ -403,6 +403,7 @@ var ApplicationManager = class extends Component {
403
403
  nextPage = {};
404
404
  async onRequest({ href, response, pushState }) {
405
405
  var _a, _b;
406
+ console.log(pushState, href);
406
407
  const domParser = new DOMParser();
407
408
  const dom = domParser.parseFromString(response, "text/html");
408
409
  const html = dom.querySelector("html");
@@ -440,8 +441,7 @@ var ApplicationManager = class extends Component {
440
441
  // Scroll.
441
442
  //
442
443
  get scroll() {
443
- var _a;
444
- return ((_a = this.currentPage) == null ? void 0 : _a.scroll) ?? 0;
444
+ return this.currentPage.scroll ?? 0;
445
445
  }
446
446
  //
447
447
  // Listeners.
package/dist/index.js CHANGED
@@ -360,6 +360,7 @@ var ApplicationManager = class extends Component {
360
360
  nextPage = {};
361
361
  async onRequest({ href, response, pushState }) {
362
362
  var _a, _b;
363
+ console.log(pushState, href);
363
364
  const domParser = new DOMParser();
364
365
  const dom = domParser.parseFromString(response, "text/html");
365
366
  const html = dom.querySelector("html");
@@ -397,8 +398,7 @@ var ApplicationManager = class extends Component {
397
398
  // Scroll.
398
399
  //
399
400
  get scroll() {
400
- var _a;
401
- return ((_a = this.currentPage) == null ? void 0 : _a.scroll) ?? 0;
401
+ return this.currentPage.scroll ?? 0;
402
402
  }
403
403
  //
404
404
  // Listeners.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisergia/core",
3
- "version": "15.0.0",
3
+ "version": "16.0.0",
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": "15.0.0",
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: true,
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.onRouteChangeRequest({
275
- href: document.location.pathname,
276
- pushState: false,
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?.scroll ?? 0
288
+ return this.currentPage!.scroll ?? 0
285
289
  }
286
290
 
287
291
  //