diff --git a/src/_components/facets/grid.vto b/src/_components/facets/grid.vto index c057add2..4fecfdfb 100644 --- a/src/_components/facets/grid.vto +++ b/src/_components/facets/grid.vto @@ -1,11 +1,33 @@
+
+ +
@@ -61,6 +67,8 @@ examples: {{- echo -}} import foundation from "common/facets/foundation.js" {{ /echo }} +{{ echo -}}await foundation.configurator.scrobbles(){{- /echo }} + {{ echo -}}await foundation.engine.audio(){{- /echo }} {{ echo -}}await foundation.engine.queue(){{- /echo }} {{ echo -}}await foundation.engine.repeatShuffle(){{- /echo }} @@ -69,10 +77,12 @@ examples: {{ echo -}}await foundation.orchestrator.autoQueue(){{- /echo }} {{ echo -}}await foundation.orchestrator.favourites(){{- /echo }} {{ echo -}}await foundation.orchestrator.input(){{- /echo }} +{{ echo -}}await foundation.orchestrator.mediaSession(){{- /echo }} {{ echo -}}await foundation.orchestrator.output(){{- /echo }} {{ echo -}}await foundation.orchestrator.queueAudio(){{- /echo }} {{ echo -}}await foundation.orchestrator.processTracks(){{- /echo }} {{ echo -}}await foundation.orchestrator.scopedTracks(){{- /echo }} +{{ echo -}}await foundation.orchestrator.scrobbleAudio(){{- /echo }} {{ echo -}}await foundation.orchestrator.sources(){{- /echo }} {{ echo -}}await foundation.processor.artwork(){{- /echo }} diff --git a/src/facets/common/build.js b/src/facets/common/build.js index 882e1614..47b042f9 100644 --- a/src/facets/common/build.js +++ b/src/facets/common/build.js @@ -97,10 +97,15 @@ async (event) => { document.querySelector("#description-input") ); + const kindEl = /** @type {HTMLSelectElement | null} */ ( + document.querySelector("#kind-input") + ); + const html = editor.state.doc.toString(); const cid = await CID.create(0x55, new TextEncoder().encode(html)); const name = nameEl?.value ?? "nameless"; const description = descriptionEl?.value ?? ""; + const kind = /** @type {"interactive" | "prelude"} */ (kindEl?.value ?? "interactive"); /** @type {Facet} */ const facet = $editingFacet.value @@ -109,6 +114,7 @@ async (event) => { cid, description, html, + kind, name, } : { @@ -117,6 +123,7 @@ async (event) => { cid, description, html, + kind, name, }; @@ -144,6 +151,10 @@ async function editFacet(ogFacet) { document.querySelector("#description-input") ); + const kindEl = /** @type {HTMLSelectElement | null} */ ( + document.querySelector("#kind-input") + ); + if (!nameEl) return; // Reset url — remove `id` param if not matching the facet @@ -170,6 +181,10 @@ async function editFacet(ogFacet) { $editingFacet.value = facet; nameEl.value = facet.name; + if (kindEl) { + kindEl.value = facet.kind ?? "interactive"; + } + if (descriptionEl) { descriptionEl.value = facet.description ?? ""; } diff --git a/src/facets/common/grid.js b/src/facets/common/grid.js index c6bf6536..cd3178f0 100644 --- a/src/facets/common/grid.js +++ b/src/facets/common/grid.js @@ -82,7 +82,7 @@ export async function monitorToggleButtonStates() { ? "ph-fill ph-toggle-right" : "ph-fill ph-toggle-left"; /** @type {HTMLElement} */ (icon).style.color = isActive - ? "var(--accent-twist-2)" + ? li.getAttribute("data-active-color") ?? "var(--accent-twist-2)" : ""; } }); diff --git a/src/facets/common/you.js b/src/facets/common/you.js index 95b11b23..8b7ea9b5 100644 --- a/src/facets/common/you.js +++ b/src/facets/common/you.js @@ -3,6 +3,7 @@ import { keyed } from "lit-html/directives/keyed.js"; import { marked } from "marked"; import { unsafeHTML } from "lit-html/directives/unsafe-html.js"; +import * as FacetCategory from "~/common/facets/category.js"; import foundation from "~/common/facets/foundation.js"; import { effect } from "~/common/signal.js"; import { facetFromURI } from "~/common/facets/utils.js"; @@ -202,13 +203,16 @@ function _renderList(output, listEl) { const h = col.length ? html`