@lisergia/core 10.0.0 → 12.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@6.0.0 build
3
+ > @lisergia/core@11.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
- ESM dist/index.js 13.40 KB
13
- ESM ⚡️ Build success in 117ms
14
- CJS dist/index.cjs 15.54 KB
15
- CJS ⚡️ Build success in 117ms
12
+ CJS dist/index.cjs 15.83 KB
13
+ CJS ⚡️ Build success in 17ms
14
+ ESM dist/index.js 13.64 KB
15
+ ESM ⚡️ Build success in 18ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 835ms
18
- DTS dist/index.d.cts 5.74 KB
19
- DTS dist/index.d.ts 5.74 KB
17
+ DTS ⚡️ Build success in 783ms
18
+ DTS dist/index.d.cts 5.76 KB
19
+ DTS dist/index.d.ts 5.76 KB
20
20
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @lisergia/core
2
2
 
3
+ ## 12.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Fix hashchange and popstate conflict.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @lisergia/config-tsconfig@12.0.0
13
+
14
+ ## 11.0.0
15
+
16
+ ### Major Changes
17
+
18
+ - Add GSAP with lagSmoothing fix.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @lisergia/config-tsconfig@11.0.0
24
+
3
25
  ## 10.0.0
4
26
 
5
27
  ### Major Changes
package/dist/index.cjs CHANGED
@@ -426,7 +426,10 @@ var ApplicationManager = class extends Component {
426
426
  //
427
427
  // Pop State.
428
428
  //
429
- onPopState() {
429
+ onPopState(event) {
430
+ if (event.state === null) {
431
+ return event.preventDefault();
432
+ }
430
433
  this.onRouteChangeRequest({
431
434
  href: document.location.pathname,
432
435
  pushState: false
@@ -454,6 +457,7 @@ var Application = new ApplicationManager();
454
457
  // src/Page.ts
455
458
  var import_lenis = __toESM(require("lenis"), 1);
456
459
  var import_mobx3 = require("mobx");
460
+ var import_gsap = __toESM(require("gsap"), 1);
457
461
  var import_tempus = __toESM(require("tempus"), 1);
458
462
  var Page = class extends Component {
459
463
  datasets = [];
@@ -539,7 +543,12 @@ var Page = class extends Component {
539
543
  wrapper: this.element,
540
544
  ...this.scrollOptions
541
545
  });
546
+ import_gsap.default.ticker.add((time) => {
547
+ this.lenis.raf(time * 1e3);
548
+ });
549
+ import_gsap.default.ticker.lagSmoothing(0);
542
550
  this.lenis.on("scroll", (event) => {
551
+ ScrollTrigger.update();
543
552
  this.onScroll(event.scroll);
544
553
  this.emitter.emit("scroll", event);
545
554
  });
package/dist/index.d.cts CHANGED
@@ -168,7 +168,7 @@ declare class ApplicationManager extends Component {
168
168
  response: string;
169
169
  pushState: boolean;
170
170
  }): Promise<void>;
171
- onPopState(): void;
171
+ onPopState(event: PopStateEvent): void;
172
172
  get scroll(): number;
173
173
  addEventListeners(): void;
174
174
  removeEventListeners(): void;
package/dist/index.d.ts CHANGED
@@ -168,7 +168,7 @@ declare class ApplicationManager extends Component {
168
168
  response: string;
169
169
  pushState: boolean;
170
170
  }): Promise<void>;
171
- onPopState(): void;
171
+ onPopState(event: PopStateEvent): void;
172
172
  get scroll(): number;
173
173
  addEventListeners(): void;
174
174
  removeEventListeners(): void;
package/dist/index.js CHANGED
@@ -383,7 +383,10 @@ var ApplicationManager = class extends Component {
383
383
  //
384
384
  // Pop State.
385
385
  //
386
- onPopState() {
386
+ onPopState(event) {
387
+ if (event.state === null) {
388
+ return event.preventDefault();
389
+ }
387
390
  this.onRouteChangeRequest({
388
391
  href: document.location.pathname,
389
392
  pushState: false
@@ -411,6 +414,7 @@ var Application = new ApplicationManager();
411
414
  // src/Page.ts
412
415
  import Lenis from "lenis";
413
416
  import { makeObservable as makeObservable2, observable as observable2 } from "mobx";
417
+ import GSAP from "gsap";
414
418
  import Tempus from "tempus";
415
419
  var Page = class extends Component {
416
420
  datasets = [];
@@ -496,7 +500,12 @@ var Page = class extends Component {
496
500
  wrapper: this.element,
497
501
  ...this.scrollOptions
498
502
  });
503
+ GSAP.ticker.add((time) => {
504
+ this.lenis.raf(time * 1e3);
505
+ });
506
+ GSAP.ticker.lagSmoothing(0);
499
507
  this.lenis.on("scroll", (event) => {
508
+ ScrollTrigger.update();
500
509
  this.onScroll(event.scroll);
501
510
  this.emitter.emit("scroll", event);
502
511
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lisergia/core",
3
- "version": "10.0.0",
3
+ "version": "12.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -9,8 +9,9 @@
9
9
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch"
10
10
  },
11
11
  "dependencies": {
12
- "@lisergia/config-tsconfig": "10.0.0",
12
+ "@lisergia/config-tsconfig": "12.0.0",
13
13
  "auto-bind": "^5.0.1",
14
+ "gsap": "^3.13.0",
14
15
  "lenis": "^1.3.1",
15
16
  "mobx": "^6.13.7",
16
17
  "nanoevents": "^9.1.0",
package/src/App.ts CHANGED
@@ -264,7 +264,11 @@ export class ApplicationManager extends Component {
264
264
  //
265
265
  // Pop State.
266
266
  //
267
- onPopState() {
267
+ onPopState(event: PopStateEvent) {
268
+ if (event.state === null) {
269
+ return event.preventDefault()
270
+ }
271
+
268
272
  this.onRouteChangeRequest({
269
273
  href: document.location.pathname,
270
274
  pushState: false,
package/src/Page.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import Lenis, { LenisOptions } from 'lenis'
2
2
  import { makeObservable, observable } from 'mobx'
3
+ import GSAP from 'gsap'
3
4
  import Tempus from 'tempus'
4
5
 
5
6
  import { ApplicationManager } from './App'
@@ -144,7 +145,15 @@ export class Page extends Component {
144
145
  ...this.scrollOptions,
145
146
  })
146
147
 
148
+ GSAP.ticker.add((time) => {
149
+ this.lenis.raf(time * 1000)
150
+ })
151
+
152
+ GSAP.ticker.lagSmoothing(0)
153
+
147
154
  this.lenis.on('scroll', (event) => {
155
+ ScrollTrigger.update()
156
+
148
157
  this.onScroll(event.scroll)
149
158
 
150
159
  this.emitter.emit('scroll', event)