@lukso/transaction-view-core 0.7.0 → 0.7.1-dev.4e0de64

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.
Files changed (38) hide show
  1. package/.turbo/turbo-build.log +18 -18
  2. package/.turbo/turbo-typecheck.log +1 -1
  3. package/CHANGELOG.md +9 -0
  4. package/dist/index.cjs +43 -33
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +2 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +42 -32
  9. package/dist/index.js.map +1 -1
  10. package/dist/shared/index.cjs +25 -25
  11. package/dist/shared/index.cjs.map +1 -1
  12. package/dist/shared/index.d.cts +2 -29
  13. package/dist/shared/index.d.ts +2 -29
  14. package/dist/shared/index.js +26 -24
  15. package/dist/shared/index.js.map +1 -1
  16. package/package.json +4 -3
  17. package/src/components/asset-card.ts +1 -1
  18. package/src/components/contract-card.ts +1 -1
  19. package/src/components/description-view.ts +1 -1
  20. package/src/components/info-panel.ts +1 -1
  21. package/src/components/permissions-block.ts +1 -1
  22. package/src/components/transaction-playback.ts +1 -1
  23. package/src/components/universal-token-view.ts +1 -1
  24. package/src/shared/address-display.ts +1 -1
  25. package/src/shared/address-view.ts +1 -1
  26. package/src/shared/custom-select.ts +1 -1
  27. package/src/shared/function-name-view.ts +1 -1
  28. package/src/shared/gas-provider-view.ts +1 -1
  29. package/src/shared/icon-view.ts +1 -1
  30. package/src/shared/image-list.ts +1 -1
  31. package/src/shared/index.ts +2 -1
  32. package/src/shared/notification-view.ts +1 -1
  33. package/src/shared/progress-view.ts +1 -1
  34. package/src/shared/scroll-to-bottom-button.ts +1 -1
  35. package/src/shared/url-view.ts +1 -1
  36. package/src/shared/value-view.ts +1 -1
  37. package/tsup.config.ts +1 -0
  38. package/src/shared/safe-custom-element.ts +0 -36
@@ -1,3 +1,4 @@
1
+ export { safeCustomElement } from '@lukso/core/utils';
1
2
  import * as lit from 'lit';
2
3
  import { LitElement, ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit';
3
4
  import { CoreLitElement } from '../styles/index.cjs';
@@ -559,34 +560,6 @@ declare global {
559
560
  }
560
561
  }
561
562
 
562
- /**
563
- * SSR-safe custom element decorator that prevents duplicate registration errors.
564
- *
565
- * ## Why this exists
566
- *
567
- * The standard `@customElement()` decorator from Lit will throw an error if
568
- * a component is registered twice. This can happen in SSR environments where:
569
- * - Components are dynamically imported via multiple paths
570
- * - HMR causes modules to be re-executed during development
571
- * - Server and client bundles both try to register components
572
- *
573
- * ## Usage
574
- *
575
- * Use this instead of `@customElement()`:
576
- * ```ts
577
- * import { safeCustomElement } from './safe-custom-element'
578
- *
579
- * @safeCustomElement('my-component')
580
- * export class MyComponent extends LitElement {
581
- * // ...
582
- * }
583
- * ```
584
- *
585
- * @param tagName - The custom element tag name (must contain a hyphen)
586
- * @returns A class decorator that safely registers the element
587
- */
588
- declare function safeCustomElement(tagName: string): <T extends CustomElementConstructor>(classOrDescriptor: T) => T;
589
-
590
563
  /**
591
564
  * ScrollToBottomButton (core) - reusable scroll helper.
592
565
  * Emits `scroll-to-bottom` when clicked.
@@ -900,4 +873,4 @@ declare global {
900
873
  }
901
874
  }
902
875
 
903
- export { type AddressData$1 as AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, type ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, type ProgressSegment, ProgressView, ScrollToBottomButton, type SelectOption, SignalController, TransactionSignalController, TransactionViewController, type TransactionViewState, UrlView, ValueView, safeCustomElement, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView };
876
+ export { type AddressData$1 as AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, type ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, type ProgressSegment, ProgressView, ScrollToBottomButton, type SelectOption, SignalController, TransactionSignalController, TransactionViewController, type TransactionViewState, UrlView, ValueView, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView };
@@ -1,3 +1,4 @@
1
+ export { safeCustomElement } from '@lukso/core/utils';
1
2
  import * as lit from 'lit';
2
3
  import { LitElement, ReactiveController, ReactiveControllerHost, TemplateResult } from 'lit';
3
4
  import { CoreLitElement } from '../styles/index.js';
@@ -559,34 +560,6 @@ declare global {
559
560
  }
560
561
  }
561
562
 
562
- /**
563
- * SSR-safe custom element decorator that prevents duplicate registration errors.
564
- *
565
- * ## Why this exists
566
- *
567
- * The standard `@customElement()` decorator from Lit will throw an error if
568
- * a component is registered twice. This can happen in SSR environments where:
569
- * - Components are dynamically imported via multiple paths
570
- * - HMR causes modules to be re-executed during development
571
- * - Server and client bundles both try to register components
572
- *
573
- * ## Usage
574
- *
575
- * Use this instead of `@customElement()`:
576
- * ```ts
577
- * import { safeCustomElement } from './safe-custom-element'
578
- *
579
- * @safeCustomElement('my-component')
580
- * export class MyComponent extends LitElement {
581
- * // ...
582
- * }
583
- * ```
584
- *
585
- * @param tagName - The custom element tag name (must contain a hyphen)
586
- * @returns A class decorator that safely registers the element
587
- */
588
- declare function safeCustomElement(tagName: string): <T extends CustomElementConstructor>(classOrDescriptor: T) => T;
589
-
590
563
  /**
591
564
  * ScrollToBottomButton (core) - reusable scroll helper.
592
565
  * Emits `scroll-to-bottom` when clicked.
@@ -900,4 +873,4 @@ declare global {
900
873
  }
901
874
  }
902
875
 
903
- export { type AddressData$1 as AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, type ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, type ProgressSegment, ProgressView, ScrollToBottomButton, type SelectOption, SignalController, TransactionSignalController, TransactionViewController, type TransactionViewState, UrlView, ValueView, safeCustomElement, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView };
876
+ export { type AddressData$1 as AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, type ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, type ProgressSegment, ProgressView, ScrollToBottomButton, type SelectOption, SignalController, TransactionSignalController, TransactionViewController, type TransactionViewState, UrlView, ValueView, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView };
@@ -9,26 +9,18 @@ var __decorateClass = (decorators, target, key, kind) => {
9
9
  return result;
10
10
  };
11
11
 
12
+ // src/shared/index.ts
13
+ import { safeCustomElement as safeCustomElement12 } from "@lukso/core/utils";
14
+
12
15
  // src/shared/address-display.ts
13
16
  import { Task } from "@lit/task";
17
+ import { safeCustomElement } from "@lukso/core/utils";
14
18
  import {
15
19
  useAddressResolver,
16
20
  useImageLoader
17
21
  } from "@lukso/transaction-view-headless";
18
22
  import { css, html, LitElement } from "lit";
19
23
  import { property } from "lit/decorators.js";
20
-
21
- // src/shared/safe-custom-element.ts
22
- function safeCustomElement(tagName) {
23
- return (classOrDescriptor) => {
24
- if (typeof customElements !== "undefined" && !customElements.get(tagName)) {
25
- customElements.define(tagName, classOrDescriptor);
26
- }
27
- return classOrDescriptor;
28
- };
29
- }
30
-
31
- // src/shared/address-display.ts
32
24
  var AddressDisplay = class extends LitElement {
33
25
  constructor() {
34
26
  super(...arguments);
@@ -303,6 +295,7 @@ AddressDisplay = __decorateClass([
303
295
 
304
296
  // src/shared/address-view.ts
305
297
  import { Task as Task2 } from "@lit/task";
298
+ import { safeCustomElement as safeCustomElement2 } from "@lukso/core/utils";
306
299
  import { useAddressResolver as useAddressResolver2 } from "@lukso/transaction-view-headless";
307
300
  import makeBlockie from "ethereum-blockies-base64";
308
301
  import { html as html2 } from "lit";
@@ -643,10 +636,11 @@ __decorateClass([
643
636
  state()
644
637
  ], AddressView.prototype, "identicon", 2);
645
638
  AddressView = __decorateClass([
646
- safeCustomElement("address-view")
639
+ safeCustomElement2("address-view")
647
640
  ], AddressView);
648
641
 
649
642
  // src/shared/custom-select.ts
643
+ import { safeCustomElement as safeCustomElement3 } from "@lukso/core/utils";
650
644
  import { html as html3 } from "lit";
651
645
  import { property as property3 } from "lit/decorators.js";
652
646
  import makeBlockie2 from "ethereum-blockies-base64";
@@ -675,7 +669,7 @@ __decorateClass([
675
669
  property3({ type: Boolean, reflect: true })
676
670
  ], CustomOption.prototype, "hoverable", 2);
677
671
  CustomOption = __decorateClass([
678
- safeCustomElement("custom-option")
672
+ safeCustomElement3("custom-option")
679
673
  ], CustomOption);
680
674
  var CustomSelect = class extends CoreLitElement {
681
675
  constructor() {
@@ -792,10 +786,11 @@ __decorateClass([
792
786
  property3({ type: String })
793
787
  ], CustomSelect.prototype, "size", 2);
794
788
  CustomSelect = __decorateClass([
795
- safeCustomElement("custom-select")
789
+ safeCustomElement3("custom-select")
796
790
  ], CustomSelect);
797
791
 
798
792
  // src/shared/function-name-view.ts
793
+ import { safeCustomElement as safeCustomElement4 } from "@lukso/core/utils";
799
794
  import { html as html4 } from "lit";
800
795
  import { property as property4 } from "lit/decorators.js";
801
796
  var FunctionNameView = class extends CoreLitElement {
@@ -872,10 +867,11 @@ __decorateClass([
872
867
  property4({ attribute: "color" })
873
868
  ], FunctionNameView.prototype, "color", 2);
874
869
  FunctionNameView = __decorateClass([
875
- safeCustomElement("function-name-view")
870
+ safeCustomElement4("function-name-view")
876
871
  ], FunctionNameView);
877
872
 
878
873
  // src/shared/gas-provider-view.ts
874
+ import { safeCustomElement as safeCustomElement5 } from "@lukso/core/utils";
879
875
  import { html as html5 } from "lit";
880
876
  import { property as property5 } from "lit/decorators.js";
881
877
  var GasProviderView = class extends CoreLitElement {
@@ -1049,11 +1045,12 @@ __decorateClass([
1049
1045
  property5({ attribute: "relayer-reset-date", reflect: true })
1050
1046
  ], GasProviderView.prototype, "relayerResetDate", 2);
1051
1047
  GasProviderView = __decorateClass([
1052
- safeCustomElement("gas-provider-view")
1048
+ safeCustomElement5("gas-provider-view")
1053
1049
  ], GasProviderView);
1054
1050
 
1055
1051
  // src/shared/icon-view.ts
1056
1052
  import { Task as Task3 } from "@lit/task";
1053
+ import { safeCustomElement as safeCustomElement6 } from "@lukso/core/utils";
1057
1054
  import {
1058
1055
  useAddressResolver as useAddressResolver3,
1059
1056
  useImageLoader as useImageLoader2
@@ -1238,7 +1235,7 @@ __decorateClass([
1238
1235
  property6({ type: Number, attribute: "image-index" })
1239
1236
  ], IconView.prototype, "imageIndex", 2);
1240
1237
  IconView = __decorateClass([
1241
- safeCustomElement("icon-view")
1238
+ safeCustomElement6("icon-view")
1242
1239
  ], IconView);
1243
1240
 
1244
1241
  // src/shared/image-loader-controller.ts
@@ -1344,6 +1341,7 @@ function useImageLoader3(host) {
1344
1341
  }
1345
1342
 
1346
1343
  // src/shared/notification-view.ts
1344
+ import { safeCustomElement as safeCustomElement7 } from "@lukso/core/utils";
1347
1345
  import { html as html7 } from "lit";
1348
1346
  import { property as property7, state as state2 } from "lit/decorators.js";
1349
1347
  var NotificationView = class extends CoreLitElement {
@@ -1461,10 +1459,11 @@ __decorateClass([
1461
1459
  property7({ type: Boolean, reflect: true })
1462
1460
  ], NotificationView.prototype, "checked", 2);
1463
1461
  NotificationView = __decorateClass([
1464
- safeCustomElement("notification-view")
1462
+ safeCustomElement7("notification-view")
1465
1463
  ], NotificationView);
1466
1464
 
1467
1465
  // src/shared/progress-view.ts
1466
+ import { safeCustomElement as safeCustomElement8 } from "@lukso/core/utils";
1468
1467
  import { html as html8 } from "lit";
1469
1468
  import { property as property8 } from "lit/decorators.js";
1470
1469
  var ProgressView = class extends CoreLitElement {
@@ -1525,10 +1524,11 @@ __decorateClass([
1525
1524
  property8({ attribute: "label-position" })
1526
1525
  ], ProgressView.prototype, "labelPosition", 2);
1527
1526
  ProgressView = __decorateClass([
1528
- safeCustomElement("progress-view")
1527
+ safeCustomElement8("progress-view")
1529
1528
  ], ProgressView);
1530
1529
 
1531
1530
  // src/shared/scroll-to-bottom-button.ts
1531
+ import { safeCustomElement as safeCustomElement9 } from "@lukso/core/utils";
1532
1532
  import { html as html9 } from "lit";
1533
1533
  import { property as property9 } from "lit/decorators.js";
1534
1534
  var ScrollToBottomButton = class extends CoreLitElement {
@@ -1569,7 +1569,7 @@ __decorateClass([
1569
1569
  property9({ attribute: "icon-name" })
1570
1570
  ], ScrollToBottomButton.prototype, "iconName", 2);
1571
1571
  ScrollToBottomButton = __decorateClass([
1572
- safeCustomElement("scroll-to-bottom-button")
1572
+ safeCustomElement9("scroll-to-bottom-button")
1573
1573
  ], ScrollToBottomButton);
1574
1574
 
1575
1575
  // src/shared/signal-controller.ts
@@ -1877,6 +1877,7 @@ function useTransactionSignal(host, signal) {
1877
1877
  }
1878
1878
 
1879
1879
  // src/shared/url-view.ts
1880
+ import { safeCustomElement as safeCustomElement10 } from "@lukso/core/utils";
1880
1881
  import { html as html10 } from "lit";
1881
1882
  import { property as property10, state as state3 } from "lit/decorators.js";
1882
1883
  var UrlView = class extends CoreLitElement {
@@ -1986,11 +1987,12 @@ __decorateClass([
1986
1987
  state3()
1987
1988
  ], UrlView.prototype, "displayName", 2);
1988
1989
  UrlView = __decorateClass([
1989
- safeCustomElement("url-view")
1990
+ safeCustomElement10("url-view")
1990
1991
  ], UrlView);
1991
1992
 
1992
1993
  // src/shared/value-view.ts
1993
1994
  import { Task as Task4 } from "@lit/task";
1995
+ import { safeCustomElement as safeCustomElement11 } from "@lukso/core/utils";
1994
1996
  import { useAddressResolver as useAddressResolver4 } from "@lukso/transaction-view-headless";
1995
1997
  import { html as html11 } from "lit";
1996
1998
  import { property as property11, state as state4 } from "lit/decorators.js";
@@ -2375,7 +2377,7 @@ __decorateClass([
2375
2377
  state4()
2376
2378
  ], ValueView.prototype, "_hasSlotContent", 2);
2377
2379
  ValueView = __decorateClass([
2378
- safeCustomElement("value-view")
2380
+ safeCustomElement11("value-view")
2379
2381
  ], ValueView);
2380
2382
  export {
2381
2383
  AddressDisplay,
@@ -2395,7 +2397,7 @@ export {
2395
2397
  TransactionViewController,
2396
2398
  UrlView,
2397
2399
  ValueView,
2398
- safeCustomElement,
2400
+ safeCustomElement12 as safeCustomElement,
2399
2401
  useImageLoader3 as useImageLoader,
2400
2402
  useSignal,
2401
2403
  useSignals,