@lisergia/core 3.0.0 → 5.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@2.0.0 build
3
+ > @lisergia/core@4.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.31 KB
13
- ESM ⚡️ Build success in 17ms
14
- CJS dist/index.cjs 15.43 KB
15
- CJS ⚡️ Build success in 17ms
12
+ ESM dist/index.js 13.37 KB
13
+ ESM ⚡️ Build success in 24ms
14
+ CJS dist/index.cjs 15.51 KB
15
+ CJS ⚡️ Build success in 24ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 1072ms
17
+ DTS ⚡️ Build success in 876ms
18
18
  DTS dist/index.d.cts 5.74 KB
19
19
  DTS dist/index.d.ts 5.74 KB
20
20
  ⠙
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @lisergia/core
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - - Add Tempus utilities.
8
+ - Remove module type from packages.
9
+ - Add Prettier configuration as dependency.
10
+ - Move Front End and Back End packages to separate repositories.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @lisergia/config-tsconfig@5.0.0
16
+
17
+ ## 4.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - Update build.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @lisergia/config-tsconfig@4.0.0
27
+
3
28
  ## 3.0.0
4
29
 
5
30
  ### Major Changes
package/dist/index.cjs CHANGED
@@ -479,6 +479,8 @@ var Page = class extends Component {
479
479
  this.scrollEnabled = scrollEnabled;
480
480
  this.scrollOptions = scrollOptions;
481
481
  (0, import_mobx3.makeObservable)(this, {
482
+ element: import_mobx3.observable,
483
+ elements: import_mobx3.observable,
482
484
  components: import_mobx3.observable,
483
485
  scroll: import_mobx3.observable
484
486
  });
package/dist/index.js CHANGED
@@ -436,6 +436,8 @@ var Page = class extends Component {
436
436
  this.scrollEnabled = scrollEnabled;
437
437
  this.scrollOptions = scrollOptions;
438
438
  makeObservable2(this, {
439
+ element: observable2,
440
+ elements: observable2,
439
441
  components: observable2,
440
442
  scroll: observable2
441
443
  });
package/dist/index.mjs CHANGED
@@ -176,7 +176,8 @@ var Links = class extends EventEmitter {
176
176
  );
177
177
  }
178
178
  addEventListeners() {
179
- this.links?.forEach((link) => link.destroy());
179
+ var _a;
180
+ (_a = this.links) == null ? void 0 : _a.forEach((link) => link.destroy());
180
181
  const links = document.querySelectorAll("a");
181
182
  this.links = Array.from(links).map((element) => {
182
183
  const link = new Link({
@@ -226,13 +227,15 @@ var ApplicationManager = class extends Component {
226
227
  this.addEventListeners();
227
228
  }
228
229
  onTitleUpdate() {
229
- const title = this.nextPage?.title;
230
+ var _a;
231
+ const title = (_a = this.nextPage) == null ? void 0 : _a.title;
230
232
  if (title) {
231
233
  document.title = title;
232
234
  }
233
235
  }
234
236
  onTemplateUpdate() {
235
- const template = this.nextPage?.template;
237
+ var _a;
238
+ const template = (_a = this.nextPage) == null ? void 0 : _a.template;
236
239
  if (template) {
237
240
  document.documentElement.dataset.template = template;
238
241
  this.template = template;
@@ -353,6 +356,7 @@ var ApplicationManager = class extends Component {
353
356
  //
354
357
  nextPage = {};
355
358
  async onRequest({ href, response, pushState }) {
359
+ var _a, _b;
356
360
  const domParser = new DOMParser();
357
361
  const dom = domParser.parseFromString(response, "text/html");
358
362
  const html = dom.querySelector("html");
@@ -363,7 +367,7 @@ var ApplicationManager = class extends Component {
363
367
  title: dom.title ?? document.title
364
368
  };
365
369
  if (this.transition) {
366
- await this.transition.onTransition?.(this);
370
+ await ((_b = (_a = this.transition).onTransition) == null ? void 0 : _b.call(_a, this));
367
371
  } else {
368
372
  this.currentPage.element.remove();
369
373
  this.currentPage.destroy();
@@ -387,7 +391,8 @@ var ApplicationManager = class extends Component {
387
391
  // Scroll.
388
392
  //
389
393
  get scroll() {
390
- return this.currentPage?.scroll ?? 0;
394
+ var _a;
395
+ return ((_a = this.currentPage) == null ? void 0 : _a.scroll) ?? 0;
391
396
  }
392
397
  //
393
398
  // Listeners.
@@ -431,6 +436,8 @@ var Page = class extends Component {
431
436
  this.scrollEnabled = scrollEnabled;
432
437
  this.scrollOptions = scrollOptions;
433
438
  makeObservable2(this, {
439
+ element: observable2,
440
+ elements: observable2,
434
441
  components: observable2,
435
442
  scroll: observable2
436
443
  });
@@ -493,20 +500,23 @@ var Page = class extends Component {
493
500
  });
494
501
  }
495
502
  destroyScroll() {
503
+ var _a;
496
504
  if (!this.scrollEnabled) {
497
505
  this.element.removeEventListener("scroll", this.onScrollFallback);
498
506
  return;
499
507
  }
500
- this.lenis?.destroy();
508
+ (_a = this.lenis) == null ? void 0 : _a.destroy();
501
509
  }
502
510
  //
503
511
  // Events.
504
512
  //
505
513
  onResize() {
506
- this.lenis?.resize();
514
+ var _a;
515
+ (_a = this.lenis) == null ? void 0 : _a.resize();
507
516
  }
508
517
  onRAF(time) {
509
- this.lenis?.raf(time);
518
+ var _a;
519
+ (_a = this.lenis) == null ? void 0 : _a.raf(time);
510
520
  }
511
521
  onScroll(scroll) {
512
522
  this.scroll = scroll;
@@ -523,8 +533,9 @@ var Page = class extends Component {
523
533
  this.unsubscribeRaf = Tempus.add(this.onRAF);
524
534
  }
525
535
  removeEventListeners() {
536
+ var _a;
526
537
  super.removeEventListeners();
527
- this.unsubscribeRaf?.();
538
+ (_a = this.unsubscribeRaf) == null ? void 0 : _a.call(this);
528
539
  this.unsubscribeRaf = void 0;
529
540
  }
530
541
  //
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@lisergia/core",
3
- "version": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "main": "./dist/index.js",
5
- "module": "./dist/index.mjs",
6
5
  "types": "./dist/index.d.ts",
7
6
  "type": "module",
8
7
  "scripts": {
@@ -10,11 +9,12 @@
10
9
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch"
11
10
  },
12
11
  "dependencies": {
13
- "@lisergia/config-tsconfig": "3.0.0",
12
+ "@lisergia/config-tsconfig": "5.0.0",
14
13
  "auto-bind": "^5.0.1",
15
14
  "lenis": "^1.3.1",
16
15
  "mobx": "^6.13.7",
17
16
  "nanoevents": "^9.1.0",
18
- "tempus": "^1.0.0-dev.10"
17
+ "tempus": "^1.0.0-dev.10",
18
+ "tsup": "^8.5.0"
19
19
  }
20
20
  }
package/src/Page.ts CHANGED
@@ -58,6 +58,8 @@ export class Page extends Component {
58
58
  this.scrollOptions = scrollOptions
59
59
 
60
60
  makeObservable(this, {
61
+ element: observable,
62
+ elements: observable,
61
63
  components: observable,
62
64
  scroll: observable,
63
65
  })