A music player that connects to your cloud/distributed storage.
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: prevent double custom element registration

+117 -90
+10
src/common/element.js
··· 502 502 } 503 503 504 504 /** 505 + * Defines a custom element, guarding against double-registration. 506 + * 507 + * @param {string} name 508 + * @param {CustomElementConstructor} constructor 509 + */ 510 + export function defineElement(name, constructor) { 511 + if (!customElements.get(name)) customElements.define(name, constructor); 512 + } 513 + 514 + /** 505 515 * @template {HTMLElement} T 506 516 * @param {DiffuseElement} parent 507 517 * @param {string} attribute
+2 -2
src/components/artwork/audio-metadata/element.js
··· 1 - import { DiffuseElement, query } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 58 58 export const CLASS = AudioMetadataArtwork; 59 59 export const NAME = "da-audio-metadata"; 60 60 61 - customElements.define(NAME, AudioMetadataArtwork); 61 + defineElement(NAME, AudioMetadataArtwork);
+2 -2
src/components/artwork/input/element.js
··· 1 - import { DiffuseElement, query } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 58 58 export const CLASS = InputArtwork; 59 59 export const NAME = "da-input"; 60 60 61 - customElements.define(NAME, InputArtwork); 61 + defineElement(NAME, InputArtwork);
+2 -2
src/components/artwork/last.fm/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 35 35 export const CLASS = LastFmArtwork; 36 36 export const NAME = "da-lastfm"; 37 37 38 - customElements.define(NAME, LastFmArtwork); 38 + defineElement(NAME, LastFmArtwork);
+2 -2
src/components/artwork/musicbrainz/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 35 35 export const CLASS = MusicBrainzArtwork; 36 36 export const NAME = "da-musicbrainz"; 37 37 38 - customElements.define(NAME, MusicBrainzArtwork); 38 + defineElement(NAME, MusicBrainzArtwork);
+2 -2
src/components/configurator/artwork/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 50 50 export const CLASS = ArtworkConfigurator; 51 51 export const NAME = "dc-artwork"; 52 52 53 - customElements.define(NAME, ArtworkConfigurator); 53 + defineElement(NAME, ArtworkConfigurator);
+2 -2
src/components/configurator/input/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions, Tunnel} from "~/common/worker.d.ts" ··· 68 68 export const CLASS = InputConfigurator; 69 69 export const NAME = "dc-input"; 70 70 71 - customElements.define(NAME, CLASS); 71 + defineElement(NAME, CLASS);
+2 -2
src/components/configurator/metadata/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 50 50 export const CLASS = MetadataConfigurator; 51 51 export const NAME = "dc-metadata"; 52 52 53 - customElements.define(NAME, MetadataConfigurator); 53 + defineElement(NAME, MetadataConfigurator);
+2 -2
src/components/configurator/output/element.js
··· 1 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 2 2 import { batch, computed, signal } from "~/common/signal.js"; 3 3 4 4 /** ··· 419 419 export const CLASS = OutputConfigurator; 420 420 export const NAME = "dc-output"; 421 421 422 - customElements.define(NAME, CLASS); 422 + defineElement(NAME, CLASS);
+2 -2
src/components/configurator/scrobbles/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {Track} from "~/definitions/types.d.ts" ··· 69 69 export const CLASS = ScrobblesConfigurator; 70 70 export const NAME = "dc-scrobbles"; 71 71 72 - customElements.define(NAME, CLASS); 72 + defineElement(NAME, CLASS);
+3 -3
src/components/engine/audio/element.js
··· 1 1 import { keyed } from "lit-html/directives/keyed.js"; 2 2 3 - import { BroadcastableDiffuseElement, nothing } from "~/common/element.js"; 3 + import { BroadcastableDiffuseElement, defineElement, nothing } from "~/common/element.js"; 4 4 import { computed, signal, untracked } from "~/common/signal.js"; 5 5 6 6 /** ··· 885 885 export const NAME = "de-audio"; 886 886 export const NAME_ITEM = "de-audio-item"; 887 887 888 - customElements.define(NAME, AudioEngine); 889 - customElements.define(NAME_ITEM, AudioEngineItem); 888 + defineElement(NAME, AudioEngine); 889 + defineElement(NAME_ITEM, AudioEngineItem);
+2 -2
src/components/engine/queue/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { signal } from "~/common/signal.js"; 3 3 import { listen } from "~/common/worker.js"; 4 4 ··· 81 81 export const CLASS = QueueEngine; 82 82 export const NAME = "de-queue"; 83 83 84 - customElements.define(NAME, QueueEngine); 84 + defineElement(NAME, QueueEngine);
+2 -2
src/components/engine/repeat-shuffle/element.js
··· 1 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 2 2 import { signal } from "~/common/signal.js"; 3 3 4 4 //////////////////////////////////////////// ··· 83 83 export const CLASS = RepeatShuffleEngine; 84 84 export const NAME = "de-repeat-shuffle"; 85 85 86 - customElements.define(NAME, CLASS); 86 + defineElement(NAME, CLASS);
+2 -2
src/components/engine/scope/element.js
··· 1 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 2 2 import { signal } from "~/common/signal.js"; 3 3 4 4 //////////////////////////////////////////// ··· 147 147 export const CLASS = ScopeEngine; 148 148 export const NAME = "de-scope"; 149 149 150 - customElements.define(NAME, CLASS); 150 + defineElement(NAME, CLASS);
+2 -2
src/components/input/ephemeral-cache/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { SCHEME } from "./constants.js"; 3 3 4 4 /** ··· 55 55 export const CLASS = EphemeralCacheInput; 56 56 export const NAME = "di-ephemeral-cache"; 57 57 58 - customElements.define(NAME, CLASS); 58 + defineElement(NAME, CLASS);
+2 -2
src/components/input/https/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { SCHEME } from "./constants.js"; 3 3 import { hostsFromTracks } from "./common.js"; 4 4 ··· 58 58 export const CLASS = HttpsInput; 59 59 export const NAME = "di-https"; 60 60 61 - customElements.define(NAME, CLASS); 61 + defineElement(NAME, CLASS);
+2 -2
src/components/input/icecast/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { hostsFromTracks } from "./common.js"; 3 3 import { SCHEME } from "./constants.js"; 4 4 ··· 58 58 export const CLASS = IcecastInput; 59 59 export const NAME = "di-icecast"; 60 60 61 - customElements.define(NAME, CLASS); 61 + defineElement(NAME, CLASS);
+2 -2
src/components/input/local/element.js
··· 1 1 import * as TID from "@atcute/tid"; 2 - import { DiffuseElement } from "~/common/element.js"; 2 + import { defineElement, DiffuseElement } from "~/common/element.js"; 3 3 import { SCHEME } from "./constants.js"; 4 4 import { 5 5 buildURI, ··· 118 118 export const CLASS = LocalInput; 119 119 export const NAME = "di-local"; 120 120 121 - customElements.define(NAME, CLASS); 121 + defineElement(NAME, CLASS);
+2 -2
src/components/input/opensubsonic/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { SCHEME } from "./constants.js"; 3 3 import { buildURI, serversFromTracks } from "./common.js"; 4 4 ··· 58 58 export const CLASS = OpensubsonicInput; 59 59 export const NAME = "di-opensubsonic"; 60 60 61 - customElements.define(NAME, CLASS); 61 + defineElement(NAME, CLASS);
+2 -2
src/components/input/s3/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { SCHEME } from "./constants.js"; 3 3 import { bucketsFromTracks, buildURI } from "./common.js"; 4 4 ··· 61 61 export const CLASS = S3Input; 62 62 export const NAME = "di-s3"; 63 63 64 - customElements.define(NAME, CLASS); 64 + defineElement(NAME, CLASS);
+2 -2
src/components/metadata/audio-file/element.js
··· 1 - import { DiffuseElement, query } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 58 58 export const CLASS = AudioFileMetadata; 59 59 export const NAME = "dm-audio-file"; 60 60 61 - customElements.define(NAME, AudioFileMetadata); 61 + defineElement(NAME, AudioFileMetadata);
+2 -2
src/components/orchestrator/artwork/element.js
··· 1 - import { DiffuseElement, query } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ProxiedActions} from "~/common/worker.d.ts" ··· 59 59 export const CLASS = ArtworkOrchestrator; 60 60 export const NAME = "do-artwork"; 61 61 62 - customElements.define(NAME, ArtworkOrchestrator); 62 + defineElement(NAME, ArtworkOrchestrator);
+2 -2
src/components/orchestrator/auto-queue/element.js
··· 1 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {DiffuseElement} from "~/common/element.js"; ··· 95 95 export const CLASS = AutoTracksOrchestrator; 96 96 export const NAME = "do-auto-queue"; 97 97 98 - customElements.define(NAME, CLASS); 98 + defineElement(NAME, CLASS);
+2 -2
src/components/orchestrator/controller/element.js
··· 1 - import { DiffuseElement, query, whenElementsDefined } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement, query, whenElementsDefined } from "~/common/element.js"; 2 2 import { computed, signal } from "~/common/signal.js"; 3 3 4 4 /** ··· 77 77 export const CLASS = ControllerOrchestrator; 78 78 export const NAME = "do-controller"; 79 79 80 - customElements.define(NAME, CLASS); 80 + defineElement(NAME, CLASS);
+2 -2
src/components/orchestrator/favourites/element.js
··· 1 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 2 2 import { match as matchPlaylistItem } from "~/common/playlist.js"; 3 3 import { computed, signal } from "~/common/signal.js"; 4 4 import { filterFavourites } from "./common.js"; ··· 181 181 export const CLASS = FavouritesOrchestrator; 182 182 export const NAME = "do-favourites"; 183 183 184 - customElements.define(NAME, CLASS); 184 + defineElement(NAME, CLASS);
+2 -1
src/components/orchestrator/media-session/element.js
··· 1 1 import { 2 2 BroadcastableDiffuseElement, 3 + defineElement, 3 4 query, 4 5 queryOptional, 5 6 } from "~/common/element.js"; ··· 222 223 export const CLASS = MediaSessionOrchestrator; 223 224 export const NAME = "do-media-session"; 224 225 225 - customElements.define(NAME, MediaSessionOrchestrator); 226 + defineElement(NAME, MediaSessionOrchestrator);
+2 -2
src/components/orchestrator/offline/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 //////////////////////////////////////////// 4 4 // ELEMENT ··· 60 60 export const CLASS = OfflineOrchestrator; 61 61 export const NAME = "do-offline"; 62 62 63 - customElements.define(NAME, OfflineOrchestrator); 63 + defineElement(NAME, OfflineOrchestrator);
+2 -2
src/components/orchestrator/output/element.js
··· 1 1 import { ifDefined } from "lit-html/directives/if-defined.js"; 2 - import { DEFAULT_GROUP, DiffuseElement } from "~/common/element.js"; 2 + import { DEFAULT_GROUP, defineElement, DiffuseElement } from "~/common/element.js"; 3 3 4 4 import "~/components/configurator/output/element.js"; 5 5 import "~/components/transformer/output/refiner/default/element.js"; ··· 163 163 export const CLASS = OutputOrchestrator; 164 164 export const NAME = "do-output"; 165 165 166 - customElements.define(NAME, CLASS); 166 + defineElement(NAME, CLASS);
+2 -1
src/components/orchestrator/path-collections/element.js
··· 1 1 import { computed } from "~/common/signal.js"; 2 2 import { OutputTransformer } from "~/components/transformer/output/base.js"; 3 + import { defineElement } from "~/common/element.js"; 3 4 4 5 /** 5 6 * @import {PlaylistItem, Track} from "~/definitions/types.d.ts" ··· 100 101 export const CLASS = PathCollectionsOrchestrator; 101 102 export const NAME = "do-path-collections"; 102 103 103 - customElements.define(NAME, CLASS); 104 + defineElement(NAME, CLASS);
+2 -2
src/components/orchestrator/process-tracks/element.js
··· 1 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 2 2 import { signal, untracked } from "~/common/signal.js"; 3 3 import { listen } from "~/common/worker.js"; 4 4 ··· 200 200 export const CLASS = ProcessTracksOrchestrator; 201 201 export const NAME = "do-process-tracks"; 202 202 203 - customElements.define(NAME, ProcessTracksOrchestrator); 203 + defineElement(NAME, ProcessTracksOrchestrator);
+2 -2
src/components/orchestrator/queue-audio/element.js
··· 1 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 2 2 import { untracked } from "~/common/signal.js"; 3 3 4 4 /** ··· 139 139 export const CLASS = QueueAudioOrchestrator; 140 140 export const NAME = "do-queue-audio"; 141 141 142 - customElements.define(NAME, QueueAudioOrchestrator); 142 + defineElement(NAME, QueueAudioOrchestrator);
+2 -1
src/components/orchestrator/scoped-tracks/element.js
··· 1 1 import { 2 2 BroadcastableDiffuseElement, 3 + defineElement, 3 4 query, 4 5 queryOptional, 5 6 } from "~/common/element.js"; ··· 281 282 export const CLASS = ScopedTracksOrchestrator; 282 283 export const NAME = "do-scoped-tracks"; 283 284 284 - customElements.define(NAME, CLASS); 285 + defineElement(NAME, CLASS);
+2 -2
src/components/orchestrator/scrobble-audio/element.js
··· 1 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {ScrobbleElement} from "~/components/supplement/types.d.ts" ··· 218 218 export const CLASS = ScrobbleAudioOrchestrator; 219 219 export const NAME = "do-scrobble-audio"; 220 220 221 - customElements.define(NAME, ScrobbleAudioOrchestrator); 221 + defineElement(NAME, ScrobbleAudioOrchestrator);
+2 -2
src/components/orchestrator/sources/element.js
··· 1 1 import deepDiff from "@fry69/deep-diff"; 2 2 3 3 import * as Output from "~/common/output.js"; 4 - import { BroadcastableDiffuseElement, query } from "~/common/element.js"; 4 + import { BroadcastableDiffuseElement, defineElement, query } from "~/common/element.js"; 5 5 import { groupTracksPerScheme } from "~/common/utils.js"; 6 6 import { signal } from "~/common/signal.js"; 7 7 ··· 155 155 export const CLASS = Sources; 156 156 export const NAME = "do-sources"; 157 157 158 - customElements.define(NAME, CLASS); 158 + defineElement(NAME, CLASS);
+2 -1
src/components/output/bytes/s3/element.js
··· 2 2 3 3 import { computed, signal } from "~/common/signal.js"; 4 4 import { BroadcastedOutputElement, outputManager } from "../../common.js"; 5 + import { defineElement } from "~/common/element.js"; 5 6 6 7 const STORAGE_PREFIX = "diffuse/output/bytes/s3"; 7 8 ··· 165 166 export const CLASS = S3Output; 166 167 export const NAME = "dob-s3"; 167 168 168 - customElements.define(NAME, S3Output); 169 + defineElement(NAME, S3Output);
+2 -1
src/components/output/polymorphic/indexed-db/element.js
··· 2 2 3 3 import { IDB_PREFIX } from "./constants.js"; 4 4 import { BroadcastedOutputElement, outputManager } from "../../common.js"; 5 + import { defineElement } from "~/common/element.js"; 5 6 6 7 /** 7 8 * @import {OutputElement, OutputManager, OutputWorkerActions} from "../../types.d.ts" ··· 90 91 export const CLASS = IndexedDBOutput; 91 92 export const NAME = "dop-indexed-db"; 92 93 93 - if (!customElements.get(NAME)) customElements.define(NAME, IndexedDBOutput); 94 + defineElement(NAME, IndexedDBOutput);
+2 -1
src/components/output/raw/atproto/element.js
··· 7 7 8 8 import { computed, signal } from "~/common/signal.js"; 9 9 import { BroadcastedOutputElement, outputManager } from "../../common.js"; 10 + import { defineElement } from "~/common/element.js"; 10 11 11 12 import { 12 13 clearStoredSession, ··· 668 669 export const CLASS = ATProtoOutput; 669 670 export const NAME = "dor-atproto"; 670 671 671 - customElements.define(NAME, ATProtoOutput); 672 + defineElement(NAME, ATProtoOutput);
+2 -2
src/components/supplement/last.fm/element.js
··· 1 1 import { md5 } from "@noble/hashes/legacy.js"; 2 2 import { bytesToHex, utf8ToBytes } from "@noble/hashes/utils.js"; 3 3 4 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 4 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 5 5 import { computed, signal } from "~/common/signal.js"; 6 6 7 7 /** ··· 270 270 export const CLASS = LastFmScrobbler; 271 271 export const NAME = "ds-lastfm-scrobbler"; 272 272 273 - customElements.define(NAME, CLASS); 273 + defineElement(NAME, CLASS);
+2 -2
src/components/supplement/listenbrainz/element.js
··· 1 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 2 2 import { computed, signal } from "~/common/signal.js"; 3 3 4 4 /** ··· 223 223 export const CLASS = ListenBrainzScrobbler; 224 224 export const NAME = "ds-listenbrainz-scrobbler"; 225 225 226 - customElements.define(NAME, CLASS); 226 + defineElement(NAME, CLASS);
+2 -2
src/components/supplement/rocksky/element.js
··· 3 3 4 4 import { getSession } from "@atcute/oauth-browser-client"; 5 5 6 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 6 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 7 7 import { computed, signal } from "~/common/signal.js"; 8 8 9 9 /** ··· 247 247 export const CLASS = RockskyScrobbler; 248 248 export const NAME = "ds-rocksky-scrobbler"; 249 249 250 - customElements.define(NAME, CLASS); 250 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/bytes/automerge/element.js
··· 10 10 removeUndefinedValuesFromRecord, 11 11 } from "~/common/utils.js"; 12 12 import { OutputTransformer } from "../../base.js"; 13 + import { defineElement } from "~/common/element.js"; 13 14 import { 14 15 INITIAL_FACETS_DOCUMENT, 15 16 INITIAL_PLAYLIST_ITEMS_DOCUMENT, ··· 292 293 export const CLASS = AutomergeBytesOutputTransformer; 293 294 export const NAME = "dtob-automerge"; 294 295 295 - customElements.define(NAME, CLASS); 296 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/bytes/dasl-sync/element.js
··· 9 9 import { computed, signal } from "~/common/signal.js"; 10 10 import { compareTimestamps } from "~/common/temporal.js"; 11 11 import { OutputTransformer } from "../../base.js"; 12 + import { defineElement } from "~/common/element.js"; 12 13 13 14 /** 14 15 * @import { SignalReader } from "~/common/signal.d.ts"; ··· 465 466 export const CLASS = DaslBytesSyncOutputTransformer; 466 467 export const NAME = "dtob-dasl-sync"; 467 468 468 - customElements.define(NAME, CLASS); 469 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/bytes/json/element.js
··· 1 1 import { computed } from "~/common/signal.js"; 2 2 import { OutputTransformer } from "../../base.js"; 3 + import { defineElement } from "~/common/element.js"; 3 4 4 5 /** 5 6 * @import { OutputManagerDeputy } from "~/components/output/types.d.ts" ··· 127 128 export const CLASS = JsonStringOutputTransformer; 128 129 export const NAME = "dtos-json"; 129 130 130 - customElements.define(NAME, CLASS); 131 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/raw/atproto-sync/element.js
··· 4 4 5 5 import { computed, signal } from "~/common/signal.js"; 6 6 import { OutputTransformer } from "../../base.js"; 7 + import { defineElement } from "~/common/element.js"; 7 8 import * as Output from "~/common/output.js"; 8 9 9 10 /** ··· 390 391 export const CLASS = ATProtoOutputSyncTransformer; 391 392 export const NAME = "dtor-atproto-sync"; 392 393 393 - customElements.define(NAME, CLASS); 394 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/refiner/default/element.js
··· 2 2 3 3 import { computed, signal } from "~/common/signal.js"; 4 4 import { OutputTransformer } from "../../base.js"; 5 + import { defineElement } from "~/common/element.js"; 5 6 6 7 const IDB_KEY_PLAYLISTS = 7 8 "diffuse/transformer/output/refiner/default/playlistItems/ephemeral"; ··· 170 171 export const CLASS = DefaultOutputRefinerTransformer; 171 172 export const NAME = "dtor-default"; 172 173 173 - if (!customElements.get(NAME)) customElements.define(NAME, CLASS); 174 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/refiner/initial-contents/element.js
··· 3 3 4 4 import { batch, computed, signal, untracked } from "~/common/signal.js"; 5 5 import { OutputTransformer } from "../../base.js"; 6 + import { defineElement } from "~/common/element.js"; 6 7 7 8 import { STARTING_SET_URIS, TYPE } from "~/common/facets/constants.js"; 8 9 import facets from "~/_data/facets.json" with { ··· 133 134 export const CLASS = InitialContentsTransformer; 134 135 export const NAME = "dtor-initial-contents"; 135 136 136 - customElements.define(NAME, CLASS); 137 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/refiner/passkey-encryption/element.js
··· 1 1 import { computed, signal } from "~/common/signal.js"; 2 2 import { OutputTransformer } from "../../base.js"; 3 + import { defineElement } from "~/common/element.js"; 3 4 4 5 import { 5 6 adoptPasskeyPrfResult, ··· 347 348 export const CLASS = PasskeyEncryptionTransformer; 348 349 export const NAME = "dtor-passkey-encryption"; 349 350 350 - customElements.define(NAME, CLASS); 351 + defineElement(NAME, CLASS);
+2 -1
src/components/transformer/output/string/json/element.js
··· 1 1 import { computed } from "~/common/signal.js"; 2 2 import { OutputTransformer } from "../../base.js"; 3 + import { defineElement } from "~/common/element.js"; 3 4 4 5 /** 5 6 * @import { OutputManagerDeputy } from "~/components/output/types.d.ts" ··· 111 112 export const CLASS = JsonStringOutputTransformer; 112 113 export const NAME = "dtos-json"; 113 114 114 - customElements.define(NAME, CLASS); 115 + defineElement(NAME, CLASS);
+2 -2
src/facets/data/cache-tracks/index.inline.js
··· 1 - import { BroadcastableDiffuseElement } from "~/common/element.js"; 1 + import { BroadcastableDiffuseElement, defineElement } from "~/common/element.js"; 2 2 import { effect, signal } from "~/common/signal.js"; 3 3 import foundation from "~/common/foundation.js"; 4 4 ··· 73 73 } 74 74 } 75 75 76 - customElements.define("dct-scrobbler", PretendScrobbler); 76 + defineElement("dct-scrobbler", PretendScrobbler);
+2 -1
src/themes/blur/artwork-controller/element.js
··· 6 6 7 7 import { 8 8 DEFAULT_GROUP, 9 + defineElement, 9 10 DiffuseElement, 10 11 query, 11 12 whenElementsDefined, ··· 569 570 export const CLASS = ArtworkController; 570 571 export const NAME = "db-artwork-controller"; 571 572 572 - customElements.define(NAME, CLASS); 573 + defineElement(NAME, CLASS);
+2 -1
src/themes/winamp/browser/element.js
··· 1 1 import { 2 + defineElement, 2 3 DiffuseElement, 3 4 query, 4 5 whenElementsDefined, ··· 482 483 export const CLASS = Browser; 483 484 export const NAME = "dtw-browser"; 484 485 485 - customElements.define(NAME, CLASS); 486 + defineElement(NAME, CLASS);
+2 -1
src/themes/winamp/winamp/element.js
··· 1 1 import { 2 + defineElement, 2 3 DiffuseElement, 3 4 query, 4 5 whenElementsDefined, ··· 2343 2344 export const CLASS = WinampElement; 2344 2345 export const NAME = "dtw-winamp"; 2345 2346 2346 - customElements.define(NAME, WinampElement); 2347 + defineElement(NAME, WinampElement);
+2 -2
src/themes/winamp/window-manager/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 import { signal } from "~/common/signal.js"; 3 3 import { debounceMicrotask } from "@vicary/debounce-microtask"; 4 4 ··· 197 197 export const CLASS = WindowManager; 198 198 export const NAME = "dtw-window-manager"; 199 199 200 - customElements.define(NAME, WindowManager); 200 + defineElement(NAME, WindowManager);
+2 -2
src/themes/winamp/window/element.js
··· 1 - import { DiffuseElement } from "~/common/element.js"; 1 + import { defineElement, DiffuseElement } from "~/common/element.js"; 2 2 3 3 /** 4 4 * @import {RenderArg} from "~/common/element.d.ts" ··· 123 123 export const CLASS = WindowElement; 124 124 export const NAME = "dtw-window"; 125 125 126 - customElements.define(NAME, WindowElement); 126 + defineElement(NAME, WindowElement);