@lukso/transaction-view-core 0.7.0 → 0.7.1-dev.169c8ba

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 +16 -16
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukso/transaction-view-core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1-dev.169c8ba",
4
4
  "description": "Core components and hooks for LUKSO transaction display",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -38,8 +38,9 @@
38
38
  "@preact/signals-core": "^1.13.0",
39
39
  "ethereum-blockies-base64": "^1.0.2",
40
40
  "viem": "^2.46.1",
41
- "@lukso/transaction-view-headless": "0.4.9",
42
- "@lukso/transaction-decoder": "1.3.8"
41
+ "@lukso/core": "1.5.0-dev.169c8ba",
42
+ "@lukso/transaction-decoder": "1.3.8-dev.169c8ba",
43
+ "@lukso/transaction-view-headless": "0.4.9-dev.169c8ba"
43
44
  },
44
45
  "peerDependencies": {
45
46
  "@lit/task": "^1.0.3",
@@ -10,11 +10,11 @@ import '../shared/image-list.js'
10
10
  // Import LUKSO web components
11
11
  import '@lukso/web-components/components'
12
12
  import { Task } from '@lit/task'
13
+ import { safeCustomElement } from '@lukso/core/utils'
13
14
  import {
14
15
  type ResolvedAddress,
15
16
  useAddressResolver,
16
17
  } from '@lukso/transaction-view-headless'
17
- import { safeCustomElement } from '../shared/safe-custom-element.js'
18
18
  import { CoreLitElement } from '../styles'
19
19
  import { formatUnits, parseBigInt } from '../utils.js'
20
20
 
@@ -1,7 +1,7 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import type { ResolvedAddress } from '@lukso/transaction-view-headless'
2
3
  import { css, html, LitElement } from 'lit'
3
4
  import { property, state } from 'lit/decorators.js'
4
- import { safeCustomElement } from '../shared/safe-custom-element'
5
5
  import '../shared/load-web-components'
6
6
 
7
7
  /**
@@ -1,8 +1,8 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { css, html, LitElement } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
4
  import { repeat } from 'lit/directives/repeat.js'
4
5
  import { when } from 'lit/directives/when.js'
5
- import { safeCustomElement } from '../shared/safe-custom-element'
6
6
 
7
7
  // Import the EnhancedInfo type from the decoder package
8
8
  type EnhancedInfo = {
@@ -1,10 +1,10 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import type { ResolvedAddress } from '@lukso/transaction-view-headless'
2
3
  import { css, html, LitElement } from 'lit'
3
4
  import { property, state } from 'lit/decorators.js'
4
5
  import { classMap } from 'lit/directives/class-map.js'
5
6
  import { repeat } from 'lit/directives/repeat.js'
6
7
  import { when } from 'lit/directives/when.js'
7
- import { safeCustomElement } from '../shared/safe-custom-element'
8
8
  import '../shared/icon-view.js'
9
9
  import '../shared/address-view.js'
10
10
  import '../shared/image-list.js'
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html, nothing } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
- import { safeCustomElement } from '../shared/safe-custom-element'
4
4
  import { CoreLitElement } from '../styles'
5
5
  import '../shared/load-web-components'
6
6
 
@@ -1,3 +1,4 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import {
2
3
  type DecoderResult,
3
4
  decodeTransaction,
@@ -19,7 +20,6 @@ import { createRef, type Ref, ref } from 'lit/directives/ref.js'
19
20
  import { when } from 'lit/directives/when.js'
20
21
  import type { Chain, Transaction } from 'viem'
21
22
  import { getGlobalLitLoader } from '../registry/lit-view-loader'
22
- import { safeCustomElement } from '../shared/safe-custom-element'
23
23
  import { CoreLitElement } from '../styles'
24
24
 
25
25
  /**
@@ -1,7 +1,7 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { css, html, LitElement } from 'lit'
2
3
  import { property, state } from 'lit/decorators.js'
3
4
  import { when } from 'lit/directives/when.js'
4
- import { safeCustomElement } from '../shared/safe-custom-element'
5
5
  import './asset-card.js'
6
6
  import './description-view.js'
7
7
  import './info-panel.js'
@@ -1,11 +1,11 @@
1
1
  import { Task } from '@lit/task'
2
+ import { safeCustomElement } from '@lukso/core/utils'
2
3
  import {
3
4
  useAddressResolver,
4
5
  useImageLoader,
5
6
  } from '@lukso/transaction-view-headless'
6
7
  import { css, html, LitElement } from 'lit'
7
8
  import { property } from 'lit/decorators.js'
8
- import { safeCustomElement } from './safe-custom-element'
9
9
 
10
10
  // LUKSO web components are loaded dynamically via plugin
11
11
 
@@ -1,9 +1,9 @@
1
1
  import { Task } from '@lit/task'
2
+ import { safeCustomElement } from '@lukso/core/utils'
2
3
  import { useAddressResolver } from '@lukso/transaction-view-headless'
3
4
  import makeBlockie from 'ethereum-blockies-base64'
4
5
  import { html } from 'lit'
5
6
  import { property, state } from 'lit/decorators.js'
6
- import { safeCustomElement } from './safe-custom-element'
7
7
 
8
8
  // Import LUKSO web components
9
9
  import './load-web-components'
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
- import { safeCustomElement } from './safe-custom-element'
4
4
  import './load-web-components'
5
5
  import makeBlockie from 'ethereum-blockies-base64'
6
6
  import { CoreLitElement } from '../styles'
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
- import { safeCustomElement } from './safe-custom-element'
4
4
  import './load-web-components'
5
5
  import { CoreLitElement } from '../styles'
6
6
 
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
- import { safeCustomElement } from './safe-custom-element'
4
4
  import './load-web-components'
5
5
  import { CoreLitElement } from '../styles'
6
6
 
@@ -1,4 +1,5 @@
1
1
  import { Task } from '@lit/task'
2
+ import { safeCustomElement } from '@lukso/core/utils'
2
3
  import {
3
4
  type ImageResult,
4
5
  useAddressResolver,
@@ -7,7 +8,6 @@ import {
7
8
  import { html } from 'lit'
8
9
  import { property } from 'lit/decorators.js'
9
10
  import { CoreLitElement } from '../styles'
10
- import { safeCustomElement } from './safe-custom-element'
11
11
 
12
12
  // LUKSO web components are loaded dynamically via plugin
13
13
 
@@ -1,9 +1,9 @@
1
1
  import { Task } from '@lit/task'
2
+ import { safeCustomElement } from '@lukso/core/utils'
2
3
  import { useAddressResolver } from '@lukso/transaction-view-headless'
3
4
  import { html } from 'lit'
4
5
  import { property, state } from 'lit/decorators.js'
5
6
  import { repeat } from 'lit/directives/repeat.js'
6
- import { safeCustomElement } from './safe-custom-element'
7
7
  import './icon-view.js'
8
8
  import { CoreLitElement } from '../styles'
9
9
 
@@ -1,5 +1,7 @@
1
1
  // Shared atomic components
2
2
 
3
+ export { safeCustomElement } from '@lukso/core/utils'
4
+
3
5
  export * from './address-display'
4
6
  // Export types
5
7
  export type { AddressData } from './address-display.js'
@@ -15,7 +17,6 @@ export {
15
17
  } from './image-loader-controller.js'
16
18
  export * from './notification-view'
17
19
  export * from './progress-view'
18
- export * from './safe-custom-element'
19
20
  export * from './scroll-to-bottom-button'
20
21
  // Export signal integration controllers and utilities
21
22
  export {
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property, state } from 'lit/decorators.js'
3
- import { safeCustomElement } from './safe-custom-element'
4
4
  import './load-web-components'
5
5
  import { CoreLitElement } from '../styles'
6
6
 
@@ -1,7 +1,7 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
4
  import { CoreLitElement } from '../styles'
4
- import { safeCustomElement } from './safe-custom-element'
5
5
 
6
6
  export type ProgressSegment = {
7
7
  value: number
@@ -1,7 +1,7 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property } from 'lit/decorators.js'
3
4
  import { CoreLitElement } from '../styles'
4
- import { safeCustomElement } from './safe-custom-element'
5
5
 
6
6
  /**
7
7
  * ScrollToBottomButton (core) - reusable scroll helper.
@@ -1,6 +1,6 @@
1
+ import { safeCustomElement } from '@lukso/core/utils'
1
2
  import { html } from 'lit'
2
3
  import { property, state } from 'lit/decorators.js'
3
- import { safeCustomElement } from './safe-custom-element'
4
4
  import './load-web-components'
5
5
  import { CoreLitElement } from '../styles'
6
6
 
@@ -1,9 +1,9 @@
1
1
  import { Task } from '@lit/task'
2
+ import { safeCustomElement } from '@lukso/core/utils'
2
3
  import { useAddressResolver } from '@lukso/transaction-view-headless'
3
4
  import { html, type TemplateResult } from 'lit'
4
5
  import { property, state } from 'lit/decorators.js'
5
6
  import { when } from 'lit/directives/when.js'
6
- import { safeCustomElement } from './safe-custom-element'
7
7
 
8
8
  // Import LUKSO web components
9
9
  import './load-web-components'
package/tsup.config.ts CHANGED
@@ -80,6 +80,7 @@ export default defineConfig({
80
80
  },
81
81
  ],
82
82
  external: [
83
+ '@lukso/core',
83
84
  '@lukso/transaction-view-headless',
84
85
  '@lukso/transaction-decoder',
85
86
  '@lukso/web-components',
@@ -1,36 +0,0 @@
1
- /**
2
- * SSR-safe custom element decorator that prevents duplicate registration errors.
3
- *
4
- * ## Why this exists
5
- *
6
- * The standard `@customElement()` decorator from Lit will throw an error if
7
- * a component is registered twice. This can happen in SSR environments where:
8
- * - Components are dynamically imported via multiple paths
9
- * - HMR causes modules to be re-executed during development
10
- * - Server and client bundles both try to register components
11
- *
12
- * ## Usage
13
- *
14
- * Use this instead of `@customElement()`:
15
- * ```ts
16
- * import { safeCustomElement } from './safe-custom-element'
17
- *
18
- * @safeCustomElement('my-component')
19
- * export class MyComponent extends LitElement {
20
- * // ...
21
- * }
22
- * ```
23
- *
24
- * @param tagName - The custom element tag name (must contain a hyphen)
25
- * @returns A class decorator that safely registers the element
26
- */
27
- export function safeCustomElement(tagName: string) {
28
- return <T extends CustomElementConstructor>(classOrDescriptor: T): T => {
29
- // Only register if not already defined
30
- if (typeof customElements !== 'undefined' && !customElements.get(tagName)) {
31
- customElements.define(tagName, classOrDescriptor)
32
- }
33
-
34
- return classOrDescriptor
35
- }
36
- }