@lukso/transaction-view-core 0.6.3-dev.e33b252 → 0.6.4-dev.ba618e9

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.
package/dist/index.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, ProgressSegment, ProgressView, ScrollToBottomButton, SelectOption, SignalController, TransactionSignalController, TransactionViewController, TransactionViewState, UrlView, ValueView, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView } from './shared/index.cjs';
2
2
  import * as lit from 'lit';
3
- import { LitElement } from 'lit';
3
+ import { LitElement, PropertyValues } from 'lit';
4
4
  import { CoreLitElement } from './styles/index.cjs';
5
- import { ResolvedAddress, ViewMatch, FrameworkViewConfig } from '@lukso/transaction-view-headless';
5
+ import { ResolvedAddress, ViewContext, ViewVariant, ViewMatch, FrameworkViewConfig } from '@lukso/transaction-view-headless';
6
6
  export { DecoderRecordForSelection, DefaultViewRegistry, FrameworkSupport, FrameworkViewConfig, ViewContext, ViewDefinition, ViewLoader, ViewMatch, ViewMatchOptions, ViewRegistry, getGlobalRegistry, resetGlobalRegistry, setGlobalRegistry } from '@lukso/transaction-view-headless';
7
+ import { DecoderResult } from '@lukso/transaction-decoder';
7
8
  export { DecoderResult } from '@lukso/transaction-decoder';
8
9
  import '@preact/signals-core';
9
10
 
@@ -433,6 +434,96 @@ declare global {
433
434
  }
434
435
  }
435
436
 
437
+ /**
438
+ * Lit Transaction Playback Component
439
+ *
440
+ * Provides index-based rendering of transactions with support for batch navigation
441
+ * and context-aware view matching.
442
+ *
443
+ * **Single Transaction:**
444
+ * - index="0" → renders the transaction
445
+ * - index="1" → renders the transaction (same)
446
+ * - index="2" → null/error
447
+ *
448
+ * **Batch Transaction:**
449
+ * - index="0" → renders batch summary/expandable view
450
+ * - index="1" → renders first child transaction
451
+ * - index="2" → renders second child transaction
452
+ * - etc.
453
+ *
454
+ * **Context & Variant:**
455
+ * - context: WHERE the transaction is displayed (approval, feed, list, detail, etc.)
456
+ * - variant: HOW the transaction should be rendered (full, collapsed, minimal, etc.)
457
+ *
458
+ * **Header Events:**
459
+ * - Listens for 'header-info' events from child views
460
+ * - Child views can emit header-info to override default from/to addresses
461
+ * - Example: Transfer view can show transfer's from/to instead of execute's from/to
462
+ *
463
+ * @example
464
+ * ```html
465
+ * <!-- Activity feed: compact view -->
466
+ * <transaction-playback
467
+ * .transaction="${transaction}"
468
+ * index="1"
469
+ * context="feed"
470
+ * variant="compact"
471
+ * @header-info="${(e) => console.log('Header:', e.detail)}"
472
+ * ></transaction-playback>
473
+ *
474
+ * <!-- Approval flow: full detailed view -->
475
+ * <transaction-playback
476
+ * .transaction="${transaction}"
477
+ * index="1"
478
+ * context="approval"
479
+ * variant="full"
480
+ * ></transaction-playback>
481
+ *
482
+ * <!-- Batch summary: collapsed view -->
483
+ * <transaction-playback
484
+ * .transaction="${transaction}"
485
+ * index="0"
486
+ * context="batch-summary"
487
+ * variant="collapsed"
488
+ * ></transaction-playback>
489
+ * ```
490
+ */
491
+ declare class TransactionPlayback extends CoreLitElement {
492
+ /** The root transaction to display */
493
+ transaction?: DecoderResult;
494
+ /** Index to display (0, 1, 2, ...) */
495
+ index: number;
496
+ /** Fallback view ID if no match found (optional - fallback-screen is registered with lowest priority) */
497
+ fallbackViewId?: string;
498
+ /** Context: WHERE the transaction is displayed */
499
+ context?: ViewContext;
500
+ /** Variant: HOW the transaction should be rendered */
501
+ variant?: ViewVariant;
502
+ /** Show debug information */
503
+ debug: boolean;
504
+ private playbackState?;
505
+ private currentResult?;
506
+ private isLoading;
507
+ private error?;
508
+ private loadedComponent?;
509
+ private headerInfo?;
510
+ private componentContainerRef;
511
+ private loader;
512
+ protected willUpdate(changedProperties: PropertyValues): void;
513
+ protected updated(_changedProperties: PropertyValues): void;
514
+ connectedCallback(): void;
515
+ disconnectedCallback(): void;
516
+ private handleHeaderInfo;
517
+ private loadView;
518
+ private renderDebugPanel;
519
+ render(): lit.TemplateResult<1>;
520
+ }
521
+ declare global {
522
+ interface HTMLElementTagNameMap {
523
+ 'transaction-playback': TransactionPlayback;
524
+ }
525
+ }
526
+
436
527
  /**
437
528
  * Lit component view loader
438
529
  * Handles loading of Lit web components for transaction views
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { AddressData, AddressDisplay, AddressView, CustomOption, CustomSelect, FunctionNameView, GasProviderView, IconView, ImageLoadState, ImageLoaderController, MultiSignalController, NotificationView, ProgressSegment, ProgressView, ScrollToBottomButton, SelectOption, SignalController, TransactionSignalController, TransactionViewController, TransactionViewState, UrlView, ValueView, useImageLoader, useSignal, useSignals, useTransactionSignal, useTransactionView } from './shared/index.js';
2
2
  import * as lit from 'lit';
3
- import { LitElement } from 'lit';
3
+ import { LitElement, PropertyValues } from 'lit';
4
4
  import { CoreLitElement } from './styles/index.js';
5
- import { ResolvedAddress, ViewMatch, FrameworkViewConfig } from '@lukso/transaction-view-headless';
5
+ import { ResolvedAddress, ViewContext, ViewVariant, ViewMatch, FrameworkViewConfig } from '@lukso/transaction-view-headless';
6
6
  export { DecoderRecordForSelection, DefaultViewRegistry, FrameworkSupport, FrameworkViewConfig, ViewContext, ViewDefinition, ViewLoader, ViewMatch, ViewMatchOptions, ViewRegistry, getGlobalRegistry, resetGlobalRegistry, setGlobalRegistry } from '@lukso/transaction-view-headless';
7
+ import { DecoderResult } from '@lukso/transaction-decoder';
7
8
  export { DecoderResult } from '@lukso/transaction-decoder';
8
9
  import '@preact/signals-core';
9
10
 
@@ -433,6 +434,96 @@ declare global {
433
434
  }
434
435
  }
435
436
 
437
+ /**
438
+ * Lit Transaction Playback Component
439
+ *
440
+ * Provides index-based rendering of transactions with support for batch navigation
441
+ * and context-aware view matching.
442
+ *
443
+ * **Single Transaction:**
444
+ * - index="0" → renders the transaction
445
+ * - index="1" → renders the transaction (same)
446
+ * - index="2" → null/error
447
+ *
448
+ * **Batch Transaction:**
449
+ * - index="0" → renders batch summary/expandable view
450
+ * - index="1" → renders first child transaction
451
+ * - index="2" → renders second child transaction
452
+ * - etc.
453
+ *
454
+ * **Context & Variant:**
455
+ * - context: WHERE the transaction is displayed (approval, feed, list, detail, etc.)
456
+ * - variant: HOW the transaction should be rendered (full, collapsed, minimal, etc.)
457
+ *
458
+ * **Header Events:**
459
+ * - Listens for 'header-info' events from child views
460
+ * - Child views can emit header-info to override default from/to addresses
461
+ * - Example: Transfer view can show transfer's from/to instead of execute's from/to
462
+ *
463
+ * @example
464
+ * ```html
465
+ * <!-- Activity feed: compact view -->
466
+ * <transaction-playback
467
+ * .transaction="${transaction}"
468
+ * index="1"
469
+ * context="feed"
470
+ * variant="compact"
471
+ * @header-info="${(e) => console.log('Header:', e.detail)}"
472
+ * ></transaction-playback>
473
+ *
474
+ * <!-- Approval flow: full detailed view -->
475
+ * <transaction-playback
476
+ * .transaction="${transaction}"
477
+ * index="1"
478
+ * context="approval"
479
+ * variant="full"
480
+ * ></transaction-playback>
481
+ *
482
+ * <!-- Batch summary: collapsed view -->
483
+ * <transaction-playback
484
+ * .transaction="${transaction}"
485
+ * index="0"
486
+ * context="batch-summary"
487
+ * variant="collapsed"
488
+ * ></transaction-playback>
489
+ * ```
490
+ */
491
+ declare class TransactionPlayback extends CoreLitElement {
492
+ /** The root transaction to display */
493
+ transaction?: DecoderResult;
494
+ /** Index to display (0, 1, 2, ...) */
495
+ index: number;
496
+ /** Fallback view ID if no match found (optional - fallback-screen is registered with lowest priority) */
497
+ fallbackViewId?: string;
498
+ /** Context: WHERE the transaction is displayed */
499
+ context?: ViewContext;
500
+ /** Variant: HOW the transaction should be rendered */
501
+ variant?: ViewVariant;
502
+ /** Show debug information */
503
+ debug: boolean;
504
+ private playbackState?;
505
+ private currentResult?;
506
+ private isLoading;
507
+ private error?;
508
+ private loadedComponent?;
509
+ private headerInfo?;
510
+ private componentContainerRef;
511
+ private loader;
512
+ protected willUpdate(changedProperties: PropertyValues): void;
513
+ protected updated(_changedProperties: PropertyValues): void;
514
+ connectedCallback(): void;
515
+ disconnectedCallback(): void;
516
+ private handleHeaderInfo;
517
+ private loadView;
518
+ private renderDebugPanel;
519
+ render(): lit.TemplateResult<1>;
520
+ }
521
+ declare global {
522
+ interface HTMLElementTagNameMap {
523
+ 'transaction-playback': TransactionPlayback;
524
+ }
525
+ }
526
+
436
527
  /**
437
528
  * Lit component view loader
438
529
  * Handles loading of Lit web components for transaction views