+
+
+
{{ await comp.diffuse.status() }}
-
- Kitchen
-
-
- {{ await comp.facets.nav({ url, facets }) }}
+ {{ await comp.nav({ url, facets }) }}
{{ content }}
diff --git a/src/kitchen/build.vto b/src/build.vto
similarity index 97%
rename from src/kitchen/build.vto
rename to src/build.vto
index 166dd80f..39fc2c00 100644
--- a/src/kitchen/build.vto
+++ b/src/build.vto
@@ -1,7 +1,7 @@
---
layout: layouts/kitchen.vto
-base: ../../
-title: Build | Kitchen | Diffuse
+base: ../
+title: Build | Diffuse
examples:
- url: "facets/examples/now-playing/index.html"
@@ -99,7 +99,7 @@ examples:
Some simple examples to help you understand how to build your own facet. Click the edit button to load them into the code editor above.
- {{ await comp.facets.examples({ id: "examples", items: examples }) }}
+ {{ await comp.examples({ id: "examples", items: examples }) }}
Notes
diff --git a/src/kitchen/category.page.ts b/src/category.page.ts
similarity index 86%
rename from src/kitchen/category.page.ts
rename to src/category.page.ts
index 580e2c89..23aa0d94 100644
--- a/src/kitchen/category.page.ts
+++ b/src/category.page.ts
@@ -14,8 +14,8 @@ export default function* ({ facets }: { facets: Facet[] }) {
for (const category of categories) {
const slug = category.toLowerCase().replace(/\s+/g, "-");
yield {
- url: `/kitchen/${slug}/`,
- title: `${category} | Kitchen | Diffuse`,
+ url: `/${slug}/`,
+ title: `${category} | Diffuse`,
category,
slug,
categoryFacets: facets.filter((f) => f.category === category),
diff --git a/src/kitchen/common/build.js b/src/common/pages/build.js
similarity index 98%
rename from src/kitchen/common/build.js
rename to src/common/pages/build.js
index b596ec61..b1005d4a 100644
--- a/src/kitchen/common/build.js
+++ b/src/common/pages/build.js
@@ -114,7 +114,7 @@ async (event) => {
break;
case "save+open":
await saveFacet(facet);
- globalThis.open(`./facets/l/?id=${facet.id}`, "blank");
+ globalThis.open(`./l/?id=${facet.id}`, "blank");
break;
}
};
diff --git a/src/kitchen/common/crud.js b/src/common/pages/crud.js
similarity index 100%
rename from src/kitchen/common/crud.js
rename to src/common/pages/crud.js
diff --git a/src/kitchen/common/you.js b/src/common/pages/dashboard.js
similarity index 98%
rename from src/kitchen/common/you.js
rename to src/common/pages/dashboard.js
index 0866d254..925b849e 100644
--- a/src/kitchen/common/you.js
+++ b/src/common/pages/dashboard.js
@@ -40,7 +40,7 @@ const EMPTY_FACETS_LIST = html`
You haven't saved anything yet. Add a facet by browsing the featured ones or any of the other categories. You can click the toggle
to quickly add or remove from your collection. Alternatively, add one using
an URI:
@@ -207,7 +207,7 @@ function _renderList(output, listEl) {
const loading = html`
- Loading items
+ Loading your software
`;
@@ -238,7 +238,7 @@ function _renderList(output, listEl) {
`
: html`
@@ -287,7 +287,7 @@ function _renderList(output, listEl) {
diff --git a/src/kitchen/common/grid.js b/src/common/pages/grid.js
similarity index 100%
rename from src/kitchen/common/grid.js
rename to src/common/pages/grid.js
diff --git a/src/index.js b/src/common/pages/guide.js
similarity index 82%
rename from src/index.js
rename to src/common/pages/guide.js
index 266a221c..b7d4c5a3 100644
--- a/src/index.js
+++ b/src/common/pages/guide.js
@@ -1,12 +1,11 @@
+import { insertPreludes } from "../facets/prelude.js";
+
////////////////////////////////////////////
// DEMO
////////////////////////////////////////////
-import { insertPreludes } from "./common/facets/prelude.js";
-
-const addDemoBtn = document.querySelector("#add-sample-content");
-
async function addSampleContent() {
+ const addDemoBtn = document.querySelector("#add-sample-content");
if (!addDemoBtn) return;
addDemoBtn.setAttribute("disabled", "");
@@ -60,4 +59,7 @@ async function addSampleContent() {
`;
}
-addDemoBtn?.addEventListener("click", addSampleContent);
+export function setupSampleButton() {
+ const addDemoBtn = document.querySelector("#add-sample-content");
+ addDemoBtn?.addEventListener("click", addSampleContent);
+}
diff --git a/src/kitchen/common/output.js b/src/common/pages/output.js
similarity index 100%
rename from src/kitchen/common/output.js
rename to src/common/pages/output.js
diff --git a/src/kitchen/common/ppr.js b/src/common/pages/ppr.js
similarity index 89%
rename from src/kitchen/common/ppr.js
rename to src/common/pages/ppr.js
index 8568217d..7ff55946 100644
--- a/src/kitchen/common/ppr.js
+++ b/src/common/pages/ppr.js
@@ -1,13 +1,14 @@
import * as Build from "./build.js";
+import * as Dashboard from "./dashboard.js";
import * as Grid from "./grid.js";
-import * as You from "./you.js";
+import * as Guide from "./guide.js";
/** Base pathname of the app (e.g. "/" at root, "/diffuse/" in a subdirectory). */
const BASE_PATHNAME = new URL(document.baseURI).pathname;
/**
* Strips the app's base path prefix from an absolute pathname,
- * returning a root-relative path like "/kitchen/build".
+ * returning a root-relative path like "/build".
*
* @param {string} pathname
*/
@@ -29,15 +30,17 @@ async function initJsBasedOnPage(url) {
await Grid.monitorToggleButtonStates();
switch (path) {
- case "/kitchen/build":
+ case "/build":
Build.renderEditor();
Build.handleBuildFormSubmit();
Build.listenForExamplesEdit();
await Build.editFacetFromURL();
break;
- case "/kitchen/you":
- await You.renderList();
+ case "/dashboard":
+ await Dashboard.renderList();
break;
+ case "/guide":
+ Guide.setupSampleButton();
default:
break;
}
@@ -63,10 +66,10 @@ function navigateHandler(event) {
const url = new URL(event.destination.url);
if (url.origin !== location.origin) return;
- // Only intercept /kitchen/[section]/ paths (not deeper sub-paths like /kitchen/misc/*)
+ // Only intercept paths one level deep
const relative = relativePathname(url.pathname);
const parts = relative.split("/").filter(Boolean);
- if (parts[0] !== "kitchen") return;
+ if (parts.length === 0) return;
if (parts.length > 2) return;
// Skip the loader page
diff --git a/src/kitchen/you.vto b/src/dashboard.vto
similarity index 78%
rename from src/kitchen/you.vto
rename to src/dashboard.vto
index b4edeccb..d8ddde5e 100644
--- a/src/kitchen/you.vto
+++ b/src/dashboard.vto
@@ -1,7 +1,7 @@
---
layout: layouts/kitchen.vto
-base: ../../
-title: Your collection | Kitchen | Diffuse
+base: ../
+title: Your collection | Diffuse
---
Your collection
@@ -11,7 +11,7 @@ title: Your collection | Kitchen | Diffuse
- Loading items
+ Loading your software
diff --git a/src/elements.vto b/src/elements.vto
new file mode 100644
index 00000000..61ff88f5
--- /dev/null
+++ b/src/elements.vto
@@ -0,0 +1,315 @@
+---
+layout: layouts/diffuse.vto
+base: ../
+title: Elements | Diffuse
+
+styles:
+ - styles/base.css
+ - styles/diffuse/page.css
+ - vendor/@phosphor-icons/bold/style.css
+ - vendor/@phosphor-icons/fill/style.css
+
+scripts:
+ - index.js
+ - common/pages/version-upgrade.js
+
+# ELEMENTS
+
+configurators:
+ - url: "components/configurator/input/element.js"
+ title: "Input"
+ desc: "Allows for multiple inputs to be used at once."
+ - url: "components/configurator/output/element.js"
+ title: "Output"
+ desc: "Enables the user to configure a specific output. If no default output is set, it creates a temporary session by storing everything in memory."
+ - url: "components/configurator/scrobbles/element.js"
+ title: "Scrobbles"
+ desc: "Configure multiple scrobblers (music trackers)."
+
+engines:
+ - url: "components/engine/audio/element.js"
+ title: "Audio"
+ desc: "Plays audio through audio elements."
+ - url: "components/engine/queue/element.js"
+ title: "Queue"
+ desc: "A queue for tracks."
+ - url: "components/engine/repeat-shuffle/element.js"
+ title: "Repeat & Shuffle"
+ desc: "Signals synced with local storage (classified by group) that decide if audio should be repeated and if the queue should be shuffled when filling it."
+ - url: "components/engine/scope/element.js"
+ title: "Scope"
+ desc: >
+ Signals that could influence the scope of a set of tracks.
+
+input:
+ - url: "components/input/https/element.js"
+ title: "HTTPS"
+ desc: >
+ HTTPS URLs to audio files or streams.
+ - title: "HTTPS (JSON)"
+ desc: >
+ Generate tracks based on HTTPS servers that provide JSON (directory) listings.
+ todo: true
+ - url: "components/input/icecast/element.js"
+ title: "Icecast"
+ desc: >
+ Icecast internet radio streams. Fetches ICY metadata to populate track information.
+ - url: "components/input/local/element.js"
+ title: "Local"
+ desc: >
+ Audio files or directories from your local device, using the browser's File System Access API.
+ - url: "components/input/opensubsonic/element.js"
+ title: "Opensubsonic"
+ desc: >
+ Add any (open)subsonic server.
+ - url: "components/input/s3/element.js"
+ title: "S3"
+ desc: >
+ AWS S3 and services that provide the same surface API such as Cloudflare R2.
+ - title: "WebDAV"
+ desc: >
+ Add any WebDAV server.
+ todo: true
+
+orchestrators:
+ - url: "components/orchestrator/auto-queue/element.js"
+ title: "Automatic Queue"
+ desc: >
+ Fill the queue automatically with non-manual items (shuffled or regular, based on repeat-shuffle engine).
+ - url: "components/orchestrator/favourites/element.js"
+ title: "Favourites"
+ desc: >
+ Mark tracks as favourites. Automatically creates an unordered 'Favourites' playlist.
+ - url: "components/orchestrator/input/element.js"
+ title: "Input"
+ desc: "**A default input configuration.** Contains all the inputs provided here."
+ - url: "components/orchestrator/media-session/element.js"
+ title: "Media Session"
+ desc: "Keeps the browser/os media session in sync with queue and audio state. Adds handlers for previous, next, seek to, etc."
+ - url: "components/orchestrator/offline/element.js"
+ title: "Offline"
+ desc: "Registers a service worker that makes the page available offline. Resources (except audio & video) are cached as they load and served from cache when offline."
+ - url: "components/orchestrator/output/element.js"
+ title: "Output"
+ desc: "**A default output configuration.** Contains all the outputs provided here along with the relevant transformers."
+ - url: "components/orchestrator/path-collections/element.js"
+ title: "Path Collections"
+ desc: "Wraps an output element to generate ephemeral playlists based on the first path segment of each track's URI. Ephemeral items are excluded from storage."
+ - url: "components/orchestrator/process-tracks/element.js"
+ title: "Process Inputs Into Tracks"
+ desc: "Whenever the cached tracks are initially loaded through the passed output element it will list tracks by using the passed input element. Afterwards it loops over all tracks and checks if metadata needs to be fetched. If anything has changed, it'll pass the results to the output element."
+ - url: "components/orchestrator/queue-audio/element.js"
+ title: "Queue ⭤ Audio"
+ desc: "Connects the given queue engine to the given audio engine."
+ - url: "components/orchestrator/scrobble-audio/element.js"
+ title: "Scrobble ⭤ Audio"
+ desc: "Connects the audio engine with a scrobbler element. Calls `nowPlaying` when a track starts playing and `scrobble` once the user has listened long enough."
+ - url: "components/orchestrator/sources/element.js"
+ title: "Sources"
+ desc: "Monitor tracks from the given output to form a list of sources based on the input's sources return value."
+ - url: "components/orchestrator/scoped-tracks/element.js"
+ title: "Scoped Tracks"
+ desc: "Supplies the tracks from the given output to the given search processor whenever the tracks collection changes. Additionally it can perform a search and other ways to reduce the scope of tracks based on the given scope engine. Provides a `tracks` signal similar to `output.tracks.collection`"
+
+output:
+ - url: "components/output/polymorphic/indexed-db/element.js"
+ title: "Polymorphic / IndexedDB"
+ desc: "Stores output into the local indexedDB. Supports any type of data that indexedDB supports."
+ - url: "components/output/bytes/s3/element.js"
+ title: "Bytes / S3"
+ desc: >
+ Store output data on AWS S3 or compatible services such as Cloudflare R2.
+ - url: "components/output/raw/atproto/element.js"
+ title: "Raw / AT Protocol"
+ desc: >
+ Store your user data on the storage associated with your ATProtocol identity. Data is lexicon shaped by default so this element takes in that data directly without any transformations.
+
+processors:
+ - url: "components/processor/artwork/element.js"
+ title: "Artwork"
+ desc: "Fetches cover art for a given set of tracks, stored locally in indexedDB. Checks the audio metadata first, then MusicBrainz and uses Last.fm as the fallback."
+ - url: "components/processor/metadata/element.js"
+ title: "Metadata"
+ desc: "Fetch audio metadata for a given set of tracks, adding to the `Track` object."
+ - url: "components/processor/search/element.js"
+ title: "Search"
+ desc: "Provides a way to search through a collection of tracks, powered by orama.js"
+
+supplements:
+ - url: "components/supplement/last.fm/element.js"
+ title: "Last.fm Scrobbler"
+ - title: "ListenBrainz Scrobbler"
+ todo: true
+ - title: "Rocksky Scrobbler"
+ todo: true
+ - title: "Teal.fm Scrobbler"
+ todo: true
+
+transformers:
+ - title: "Output / Bytes / Automerge"
+ desc: "Translate data to and from an Automerge CRDT."
+ url: "components/transformer/output/bytes/automerge/element.js"
+ todo: true
+ - title: "Output / Bytes / Cambria Lenses"
+ desc: "Uses the Cambria library to seamlessly translate between data schemas so that no data migration is needed."
+ todo: true
+ - title: "Output / Bytes / DASL Sync"
+ desc: "Syncs data between local and remote using CID-based diffing and performs union merges with tombstone tracking when both sides have diverged."
+ url: "components/transformer/output/bytes/dasl-sync/element.js"
+ - title: "Output / Bytes / JSON"
+ desc: "Raw data schema output ⇄ JSON Uint8Array."
+ url: "components/transformer/output/bytes/json/element.js"
+ - title: "Output / Raw / AT Protocol Sync"
+ desc: "Wraps an AT Protocol output with a local IndexedDB cache. Uses the repo revision to skip unnecessary fetches and performs union merges with tombstone tracking when both local and remote have diverged."
+ url: "components/transformer/output/raw/atproto-sync/element.js"
+ - title: "Output / Refiner / Default"
+ desc: "The task of a refiner transformer is to remove the output state that is not meant to be saved to storage. For example, ephemeral tracks; this transformer will keep them in memory, but they will not be present in the output. **Ideally this is part of every theme, but you may swap it out with another transformer that might provide better defaults.**"
+ url: "components/transformer/output/refiner/default/element.js"
+ - title: "Output / Refiner / Track URI Passkey"
+ desc: "Encrypts track URIs using a passkey-derived PRF key. On read, decrypts `encrypted://` URIs transparently; on write, re-encrypts all URIs before passing downstream. Tracks that cannot be decrypted are held separately and excluded from the visible collection."
+ url: "components/transformer/output/refiner/track-uri-passkey/element.js"
+ - title: "Output / String / JSON"
+ desc: "Raw data schema output ⇄ JSON UTF8 string."
+ url: "components/transformer/output/string/json/element.js"
+
+# DEFINITIONS
+
+definitions:
+ - title: "Output / Collaboration"
+ desc: >
+ Represents a collaboration between multiple collaborators on a subject, such as a playlist.
+ url: "definitions/output/collaboration.json"
+ - title: "Output / Facet"
+ desc: >
+ Facet pointer or HTML snippet.
+ url: "definitions/output/facet.json"
+ - title: "Output / Playlist Item"
+ desc: >
+ Represents a single item in a playlist. Tracks are matched based on the given criteria. A playlist is formed by grouping items by their playlist property.
+ url: "definitions/output/playlistItem.json"
+ - title: "Output / Playlist Item Bundle"
+ desc: >
+ A bundle of playlist items.
+ url: "definitions/output/playlistItemBundle.json"
+ - title: "Output / Progress"
+ desc: >
+ Used to track progress of (long) audio playback.
+ todo: true
+ - title: "Output / Track"
+ desc: >
+ Represents audio that can be played, or a placeholder for a source of tracks. Contains a URI that will resolve to the audio.
+ url: "definitions/output/track.json"
+ - title: "Output / Track Bundle"
+ desc: >
+ A bundle of tracks.
+ url: "definitions/output/trackBundle.json"
+
+---
+
+
+
+
+
+
+ {{ await comp.element({
+ title: "Configurators",
+ items: configurators,
+ content: `
+ Elements that serve as an intermediate in order to make a particular kind of element configurable. In other words, these allow for an element to be swapped out with another that takes the same set of the actions and data output.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Engines",
+ items: engines,
+ content: `
+ Elements with each a singular purpose and don't have any UI. There are specialised UI and orchestrator elements that control these.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Input",
+ items: input,
+ content: `
+ Inputs are sources of audio tracks. Each track is an entry in the list of possible items to play. These can be files or streams, static or dynamic.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Orchestrators",
+ items: orchestrators,
+ content: `
+ These too are element compositions. However, unlike themes, these are purely logical. Mostly exist in order to construct sensible defaults to use across themes and other compositions.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Output",
+ items: output,
+ content: `
+ Output is application-derived data such as playlists. These elements can receive such data and keep it around. These are categorised by the type of data they ingest, or many types in the case of polymorphic. Optionally use transformers to convert output into the expected format.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Processors",
+ items: processors,
+ content: `
+ These elements work with the output generated by the input elements to add more data to them, or process them in some other way.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Supplements",
+ items: supplements,
+ content: `
+ Additional elements, such as scrobblers.
+ `
+ }) }}
+
+ {{ await comp.element({
+ title: "Transformers",
+ items: transformers,
+ content: `
+ Transform data from one format or schema into another. See schema section below for more information. Just as configurators, these are intermediates and require to have the same set of actions as the element it targets.
+ `
+ }) }}
+
+
+
+
+
+ Definitions
+
+ All of the elements here are built with these data definitions in mind. That said, you can mix elements that use different definitions; you just have to put a transformer between them in order to translate between them, if needed.
+
+ {{ await comp.list({ items: definitions }) }}
+
+
diff --git a/src/facets/misc/split-view/index.inline.js b/src/facets/misc/split-view/index.inline.js
index 29a74ef7..e0c85645 100644
--- a/src/facets/misc/split-view/index.inline.js
+++ b/src/facets/misc/split-view/index.inline.js
@@ -186,7 +186,7 @@ function renderNode(node, path, isRoot) {
const uri = node.facet.includes("://")
? node.facet
: `diffuse://${node.facet}`;
- iframe.src = "facets/l/?uri=" + encodeURIComponent(uri);
+ iframe.src = "l/?uri=" + encodeURIComponent(uri);
iframe.allow = "autoplay";
pane.appendChild(iframe);
}
@@ -359,7 +359,7 @@ ${indent}`;
const uri = node.facet.includes("://")
? node.facet
: `diffuse://${node.facet}`;
- const src = "facets/l/?uri=" + encodeURIComponent(uri);
+ const src = "l/?uri=" + encodeURIComponent(uri);
return `${indent}
${inner}
${indent}
`;
diff --git a/src/featured.vto b/src/featured.vto
new file mode 100644
index 00000000..06e78ec0
--- /dev/null
+++ b/src/featured.vto
@@ -0,0 +1,11 @@
+---
+layout: layouts/kitchen.vto
+base: ../
+title: Featured | Diffuse
+---
+
+
Featured
+
+
+ {{ await comp.grid({ id: "featured", items: facets.filter(f => f.featured) }) }}
+
diff --git a/src/guide.vto b/src/guide.vto
new file mode 100644
index 00000000..0fb13039
--- /dev/null
+++ b/src/guide.vto
@@ -0,0 +1,84 @@
+---
+layout: layouts/kitchen.vto
+base: ../
+title: Guide | Diffuse
+---
+
+
Guide
+
+
+
+ Tutorial
+
+
+ Diffuse is not your typical streaming service, we have to add sources of audio so we have stuff to play. This button below adds some demo content, so you can experiment with the software right away.
+
+
+
+
+ Add sample content
+
+
+
+
+ Now we should explore what is possible with our audio. Because Diffuse is cooperative and malleable software, our interface can look like anything, and we can pick the features we like. That might sound overwhelming, so let's keep it simple for now.
+
+
+
+ Let's pick an interface that automatically puts audio from our collection into the queue, and another to play what got put into the queue.
+
+
+
+
+
+
+
+ Fill up queue
+
+
+
+
+
+ Play audio
+
+
+
+
+
+
+ So you said I could pick the features and interfaces that I liked, how does that work?
+
+
+
+ To do that, we have to look at the other pages shown in the navigation here, such as the featured page . There you'll be able to browse through all the features and interfaces that are provided by Diffuse.
+
+
+
+ To use a feature, you click the toggle to enable it , this will add it to your software. Interfaces can be added too, but it's not required, you can try them out right away by clicking the link in their title. For interfaces that are more like traditional web applications, delivering more encompassing experiences, look at themes .
+
+
+
+ TODO: explain adding your own inputs, syncing user data, etc.
+
+
+
+
+ Concept
+
+
+ Diffuse is unlike traditional software; instead of combining several features into a single user interface and producing data output, we do the opposite, we start with the data and work our way up from there.
+
+
+
+ It provides every user the ability to choose which features and interfaces they want to layer on top of their data.
+
+
+
+ These features and interfaces are housed into units that we call "facets". They consist of Diffuse elements that are connected, they broadcast their state and your data that has been updated.
+
+
+
+ Finally, facets are just regular web pages so they can live wherever. We save them to the user-data storage that's configured and give the user the option to share it. This means that you can load features and interfaces from other people, building software cooperatively .
+
+
+
diff --git a/src/index.vto b/src/index.vto
index ef41dce5..6f30c296 100644
--- a/src/index.vto
+++ b/src/index.vto
@@ -11,197 +11,6 @@ scripts:
- index.js
- common/pages/version-upgrade.js
-# ELEMENTS
-
-configurators:
- - url: "components/configurator/input/element.js"
- title: "Input"
- desc: "Allows for multiple inputs to be used at once."
- - url: "components/configurator/output/element.js"
- title: "Output"
- desc: "Enables the user to configure a specific output. If no default output is set, it creates a temporary session by storing everything in memory."
- - url: "components/configurator/scrobbles/element.js"
- title: "Scrobbles"
- desc: "Configure multiple scrobblers (music trackers)."
-
-engines:
- - url: "components/engine/audio/element.js"
- title: "Audio"
- desc: "Plays audio through audio elements."
- - url: "components/engine/queue/element.js"
- title: "Queue"
- desc: "A queue for tracks."
- - url: "components/engine/repeat-shuffle/element.js"
- title: "Repeat & Shuffle"
- desc: "Signals synced with local storage (classified by group) that decide if audio should be repeated and if the queue should be shuffled when filling it."
- - url: "components/engine/scope/element.js"
- title: "Scope"
- desc: >
- Signals that could influence the scope of a set of tracks.
-
-input:
- - url: "components/input/https/element.js"
- title: "HTTPS"
- desc: >
- HTTPS URLs to audio files or streams.
- - title: "HTTPS (JSON)"
- desc: >
- Generate tracks based on HTTPS servers that provide JSON (directory) listings.
- todo: true
- - url: "components/input/icecast/element.js"
- title: "Icecast"
- desc: >
- Icecast internet radio streams. Fetches ICY metadata to populate track information.
- - url: "components/input/local/element.js"
- title: "Local"
- desc: >
- Audio files or directories from your local device, using the browser's File System Access API.
- - url: "components/input/opensubsonic/element.js"
- title: "Opensubsonic"
- desc: >
- Add any (open)subsonic server.
- - url: "components/input/s3/element.js"
- title: "S3"
- desc: >
- AWS S3 and services that provide the same surface API such as Cloudflare R2.
- - title: "WebDAV"
- desc: >
- Add any WebDAV server.
- todo: true
-
-orchestrators:
- - url: "components/orchestrator/auto-queue/element.js"
- title: "Automatic Queue"
- desc: >
- Fill the queue automatically with non-manual items (shuffled or regular, based on repeat-shuffle engine).
- - url: "components/orchestrator/favourites/element.js"
- title: "Favourites"
- desc: >
- Mark tracks as favourites. Automatically creates an unordered 'Favourites' playlist.
- - url: "components/orchestrator/input/element.js"
- title: "Input"
- desc: "**A default input configuration.** Contains all the inputs provided here."
- - url: "components/orchestrator/media-session/element.js"
- title: "Media Session"
- desc: "Keeps the browser/os media session in sync with queue and audio state. Adds handlers for previous, next, seek to, etc."
- - url: "components/orchestrator/offline/element.js"
- title: "Offline"
- desc: "Registers a service worker that makes the page available offline. Resources (except audio & video) are cached as they load and served from cache when offline."
- - url: "components/orchestrator/output/element.js"
- title: "Output"
- desc: "**A default output configuration.** Contains all the outputs provided here along with the relevant transformers."
- - url: "components/orchestrator/path-collections/element.js"
- title: "Path Collections"
- desc: "Wraps an output element to generate ephemeral playlists based on the first path segment of each track's URI. Ephemeral items are excluded from storage."
- - url: "components/orchestrator/process-tracks/element.js"
- title: "Process Inputs Into Tracks"
- desc: "Whenever the cached tracks are initially loaded through the passed output element it will list tracks by using the passed input element. Afterwards it loops over all tracks and checks if metadata needs to be fetched. If anything has changed, it'll pass the results to the output element."
- - url: "components/orchestrator/queue-audio/element.js"
- title: "Queue ⭤ Audio"
- desc: "Connects the given queue engine to the given audio engine."
- - url: "components/orchestrator/scrobble-audio/element.js"
- title: "Scrobble ⭤ Audio"
- desc: "Connects the audio engine with a scrobbler element. Calls `nowPlaying` when a track starts playing and `scrobble` once the user has listened long enough."
- - url: "components/orchestrator/sources/element.js"
- title: "Sources"
- desc: "Monitor tracks from the given output to form a list of sources based on the input's sources return value."
- - url: "components/orchestrator/scoped-tracks/element.js"
- title: "Scoped Tracks"
- desc: "Supplies the tracks from the given output to the given search processor whenever the tracks collection changes. Additionally it can perform a search and other ways to reduce the scope of tracks based on the given scope engine. Provides a `tracks` signal similar to `output.tracks.collection`"
-
-output:
- - url: "components/output/polymorphic/indexed-db/element.js"
- title: "Polymorphic / IndexedDB"
- desc: "Stores output into the local indexedDB. Supports any type of data that indexedDB supports."
- - url: "components/output/bytes/s3/element.js"
- title: "Bytes / S3"
- desc: >
- Store output data on AWS S3 or compatible services such as Cloudflare R2.
- - url: "components/output/raw/atproto/element.js"
- title: "Raw / AT Protocol"
- desc: >
- Store your user data on the storage associated with your ATProtocol identity. Data is lexicon shaped by default so this element takes in that data directly without any transformations.
-
-processors:
- - url: "components/processor/artwork/element.js"
- title: "Artwork"
- desc: "Fetches cover art for a given set of tracks, stored locally in indexedDB. Checks the audio metadata first, then MusicBrainz and uses Last.fm as the fallback."
- - url: "components/processor/metadata/element.js"
- title: "Metadata"
- desc: "Fetch audio metadata for a given set of tracks, adding to the `Track` object."
- - url: "components/processor/search/element.js"
- title: "Search"
- desc: "Provides a way to search through a collection of tracks, powered by orama.js"
-
-supplements:
- - url: "components/supplement/last.fm/element.js"
- title: "Last.fm Scrobbler"
- - title: "ListenBrainz Scrobbler"
- todo: true
- - title: "Rocksky Scrobbler"
- todo: true
- - title: "Teal.fm Scrobbler"
- todo: true
-
-transformers:
- - title: "Output / Bytes / Automerge"
- desc: "Translate data to and from an Automerge CRDT."
- url: "components/transformer/output/bytes/automerge/element.js"
- todo: true
- - title: "Output / Bytes / Cambria Lenses"
- desc: "Uses the Cambria library to seamlessly translate between data schemas so that no data migration is needed."
- todo: true
- - title: "Output / Bytes / DASL Sync"
- desc: "Syncs data between local and remote using CID-based diffing and performs union merges with tombstone tracking when both sides have diverged."
- url: "components/transformer/output/bytes/dasl-sync/element.js"
- - title: "Output / Bytes / JSON"
- desc: "Raw data schema output ⇄ JSON Uint8Array."
- url: "components/transformer/output/bytes/json/element.js"
- - title: "Output / Raw / AT Protocol Sync"
- desc: "Wraps an AT Protocol output with a local IndexedDB cache. Uses the repo revision to skip unnecessary fetches and performs union merges with tombstone tracking when both local and remote have diverged."
- url: "components/transformer/output/raw/atproto-sync/element.js"
- - title: "Output / Refiner / Default"
- desc: "The task of a refiner transformer is to remove the output state that is not meant to be saved to storage. For example, ephemeral tracks; this transformer will keep them in memory, but they will not be present in the output. **Ideally this is part of every theme, but you may swap it out with another transformer that might provide better defaults.**"
- url: "components/transformer/output/refiner/default/element.js"
- - title: "Output / Refiner / Track URI Passkey"
- desc: "Encrypts track URIs using a passkey-derived PRF key. On read, decrypts `encrypted://` URIs transparently; on write, re-encrypts all URIs before passing downstream. Tracks that cannot be decrypted are held separately and excluded from the visible collection."
- url: "components/transformer/output/refiner/track-uri-passkey/element.js"
- - title: "Output / String / JSON"
- desc: "Raw data schema output ⇄ JSON UTF8 string."
- url: "components/transformer/output/string/json/element.js"
-
-# DEFINITIONS
-
-definitions:
- - title: "Output / Collaboration"
- desc: >
- Represents a collaboration between multiple collaborators on a subject, such as a playlist.
- url: "definitions/output/collaboration.json"
- - title: "Output / Facet"
- desc: >
- Facet pointer or HTML snippet.
- url: "definitions/output/facet.json"
- - title: "Output / Playlist Item"
- desc: >
- Represents a single item in a playlist. Tracks are matched based on the given criteria. A playlist is formed by grouping items by their playlist property.
- url: "definitions/output/playlistItem.json"
- - title: "Output / Playlist Item Bundle"
- desc: >
- A bundle of playlist items.
- url: "definitions/output/playlistItemBundle.json"
- - title: "Output / Progress"
- desc: >
- Used to track progress of (long) audio playback.
- todo: true
- - title: "Output / Track"
- desc: >
- Represents audio that can be played, or a placeholder for a source of tracks. Contains a URI that will resolve to the audio.
- url: "definitions/output/track.json"
- - title: "Output / Track Bundle"
- desc: >
- A bundle of tracks.
- url: "definitions/output/trackBundle.json"
-
# LINKS
links:
@@ -237,234 +46,21 @@ links:
WORK IN PROGRESS
+
+ Open Diffuse
+
+
Guide
+
Featured
+
- Built by tokono.ma
+
+ Built with Diffuse elements
+ Created by tokono.ma
+
diff --git a/src/kitchen/guide.vto b/src/kitchen/guide.vto
deleted file mode 100644
index f07763cb..00000000
--- a/src/kitchen/guide.vto
+++ /dev/null
@@ -1,46 +0,0 @@
----
-layout: layouts/kitchen.vto
-base: ../../
-title: Guide | Kitchen | Diffuse
----
-
-
diff --git a/src/kitchen/index.vto b/src/kitchen/index.vto
deleted file mode 100644
index c60c5be7..00000000
--- a/src/kitchen/index.vto
+++ /dev/null
@@ -1,11 +0,0 @@
----
-layout: layouts/kitchen.vto
-base: ../
-title: Featured | Kitchen | Diffuse
----
-
-
diff --git a/src/kitchen/l/index.js b/src/l/index.js
similarity index 100%
rename from src/kitchen/l/index.js
rename to src/l/index.js
diff --git a/src/kitchen/l/index.vto b/src/l/index.vto
similarity index 93%
rename from src/kitchen/l/index.vto
rename to src/l/index.vto
index b2863bdc..5014a0a0 100644
--- a/src/kitchen/l/index.vto
+++ b/src/l/index.vto
@@ -8,7 +8,7 @@ styles:
- styles/loader.css
scripts:
- - facets/l/index.js
+ - l/index.js
---
diff --git a/src/styles/diffuse/colors.css b/src/styles/diffuse/colors.css
index c225886d..188a8ddd 100644
--- a/src/styles/diffuse/colors.css
+++ b/src/styles/diffuse/colors.css
@@ -4,8 +4,8 @@
--color-2: oklch(98.369% 0.01834 67.664);
--color-3: oklch(26.787% 0.00168 186.65);
- /* Green */
- --accent: hsl(82, 39%, 30.2%);
+ /* Accent */
+ --accent: oklch(0.49552082493478433 0.08959833768631711 126.18581796616421);
/* Based on accent */
--accent-twist-1: oklch(0.4394087182327507 0.07236154661033459 126.18581796616421);
@@ -28,14 +28,14 @@
@media (prefers-color-scheme: dark) {
:root {
- --accent: #9e86b8;
+ --accent: oklch(0.9588262863391736 0.06116191577190922 140.4794385054261);
/* Based on accent */
- --accent-twist-1: oklch(0.8304625409973806 0.04463693607878053 306.25919097736113);
- --accent-twist-2: oklch(0.8598598403285739 0.0562638076130437 71.2592389751063);
- --accent-twist-3: oklch(0.9098598401854464 0.04000001621772218 71.25925756817853);
- --accent-twist-4: oklch(0.759859834391464 0.0968658786601377 181.2591638095228);
- --accent-twist-5: oklch(0.5798598316017731 0.08000002153797516 181.25916489227464);
+ --accent-twist-1: oklch(0.990000017539932 0.040000057532729824 140.4794373213467);
+ --accent-twist-2: oklch(0.8588262791075975 0.05264925002780416 250.47942154450243);
+ --accent-twist-3: oklch(0.6788262741405414 0.07999998302468042 250.47944272057788);
+ --accent-twist-4: oklch(0.758826283102734 0.08415801238169258 15.479456004219076);
+ --accent-twist-5: oklch(0.4288262770395823 0.05680666043681931 15.47945273215004);
/* Derivatives */
--bg-color: var(--color-3);
diff --git a/src/styles/diffuse/page.css b/src/styles/diffuse/page.css
index 1c4ce119..9b07ab5a 100644
--- a/src/styles/diffuse/page.css
+++ b/src/styles/diffuse/page.css
@@ -459,6 +459,10 @@ a.button {
small {
font-size: var(--fs-xs);
+
+ a {
+ text-underline-offset: 3px;
+ }
}
.button-col {
@@ -576,6 +580,10 @@ ul li::marker {
opacity: 0.25;
}
}
+
+ &.diffuse-logo-container--condensed {
+ margin-bottom: var(--space-lg);
+ }
}
/**
@@ -614,6 +622,11 @@ nav {
text-decoration: none;
transition-duration: 250ms;
transition-property: opacity;
+
+ &:hover,
+ &:focus {
+ opacity: 1;
+ }
}
a.hidden {
@@ -627,6 +640,14 @@ nav {
}
}
+#status--filler-container {
+ align-items: center;
+ display: flex;
+ height: 100%;
+ justify-content: end;
+ padding: 0 var(--space-lg);
+}
+
/**
* 😶🌫️
*/
diff --git a/src/themes/index.js b/src/themes/index.js
deleted file mode 100644
index eb689063..00000000
--- a/src/themes/index.js
+++ /dev/null
@@ -1,291 +0,0 @@
-import { html, render } from "lit-html";
-import { keyed } from "lit-html/directives/keyed.js";
-
-import { basicSetup, EditorView } from "codemirror";
-import { css as langCss } from "@codemirror/lang-css";
-import { html as langHtml } from "@codemirror/lang-html";
-import { javascript as langJs } from "@codemirror/lang-javascript";
-import { autocompletion } from "@codemirror/autocomplete";
-
-import * as TID from "@atcute/tid";
-
-import * as CID from "~/common/cid.js";
-import foundation from "~/common/facets/foundation.js";
-import { effect, signal } from "~/common/signal.js";
-import { themeFromURI } from "~/common/themes/utils.js";
-import { loadURI } from "~/common/loader.js";
-
-/**
- * @import {Theme} from "~/definitions/types.d.ts"
- */
-
-////////////////////////////////////////////
-// SAVE & FORK
-////////////////////////////////////////////
-
-document.body.addEventListener(
- "click",
- /**
- * @param {MouseEvent} event
- */
- async (event) => {
- const target = /** @type {HTMLElement} */ (event.target);
- const rel = target.getAttribute("rel");
- if (!rel) return;
-
- const uri = target.closest("li")?.getAttribute("data-uri");
- if (!uri) return;
-
- const name = target.closest("li")?.getAttribute("data-name");
- if (!name) return;
-
- switch (rel) {
- case "fork": {
- const theme = await themeFromURI({ name, uri }, { fetchHTML: true });
- editTheme(theme);
- document.querySelector("#build")?.scrollIntoView();
- break;
- }
- case "save": {
- const theme = await themeFromURI({ name, uri }, { fetchHTML: false });
- const out = await foundation.orchestrator.output();
-
- const col = out.themes.collection();
- out.themes.save([
- ...(col.state === "loaded" ? col.data : []),
- theme,
- ]);
- break;
- }
- }
- },
-);
-
-////////////////////////////////////////////
-// YOUR COLLECTION
-////////////////////////////////////////////
-
-/** @type {HTMLElement | null} */
-const listEl = document.querySelector("#list");
-if (!listEl) throw new Error("List element not found");
-
-listEl.innerHTML = "";
-
-const output = await foundation.orchestrator.output();
-
-effect(() => {
- const themesCol = output.themes.collection();
- const col = themesCol.state === "loaded"
- ? [...themesCol.data].sort((a, b) => {
- return a.name.toLocaleLowerCase().localeCompare(b.name.toLocaleLowerCase());
- })
- : [];
-
- const h = col.length && themesCol.state === "loaded"
- ? html`
-
- ${col.map((c) =>
- keyed(
- c.id,
- html`
-
-
-
- ${c.uri && !c.html
- ? html`
-
-
- Tracking the original URI
-
- `
- : html`
-
-
- Custom code
-
- `}
-
-
-
-
-
- `,
- )
- )}
-
- `
- : themesCol.state === "loaded"
- ? emptyThemesList
- : html`
-
-
- Loading items
-
- `;
-
- render(h, listEl);
-});
-
-const emptyThemesList = html`
-
- You have not saved any themes yet.
-
-`;
-
-/**
- * @param {{ id: string }} _
- */
-function deleteTheme({ id }) {
- return () => {
- const c = confirm("Are you sure you want to delete this theme?");
- if (!c) return;
-
- const col = output.themes.collection();
- if (col.state !== "loaded") return;
- output.themes.save(col.data.filter((c) => !(c.id === id)));
- };
-}
-
-////////////////////////////////////////////
-// BUILD
-////////////////////////////////////////////
-
-const $editingTheme = signal(/** @type {Theme | null} */ (null));
-
-// Code editor
-const editorContainer = document.body.querySelector("#html-input-container");
-if (!editorContainer) throw new Error("Editor container not found");
-
-const editor = new EditorView({
- parent: editorContainer,
- doc: ``.trim(),
- extensions: [
- basicSetup,
- langHtml(),
- langCss(),
- langJs(),
- autocompletion(),
- ],
-});
-
-// Form submit
-document.querySelector("#build-form")?.addEventListener(
- "submit",
- onBuildSubmit,
-);
-
-/**
- * @param {Event} event
- */
-async function onBuildSubmit(event) {
- event.preventDefault();
-
- const nameEl = /** @type {HTMLInputElement | null} */ (document.querySelector(
- "#name-input",
- ));
-
- const html = editor.state.doc.toString();
- const cid = await CID.create(0x55, new TextEncoder().encode(html));
- const name = nameEl?.value ?? "nameless";
-
- /** @type {Theme} */
- const theme = $editingTheme.value
- ? {
- ...$editingTheme.value,
- cid,
- html,
- name,
- }
- : {
- $type: "sh.diffuse.output.theme",
- id: TID.now(),
- cid,
- html,
- name,
- };
-
- switch (/** @type {any} */ (event).submitter.name) {
- case "save":
- await saveTheme(theme);
- break;
- case "save+open":
- await saveTheme(theme);
- globalThis.open(`./themes/l/?id=${theme.id}`, "blank");
- break;
- }
-}
-
-/**
- * @param {Theme} ogTheme
- */
-async function editTheme(ogTheme) {
- const theme = { ...ogTheme };
- const nameEl = /** @type {HTMLInputElement | null} */ (document.querySelector(
- "#name-input",
- ));
-
- if (!nameEl) return;
-
- // Make sure HTML is loaded
- if (!theme.html && theme.uri) {
- const html = await loadURI(theme.uri);
- const cid = await CID.create(0x55, new TextEncoder().encode(html));
-
- theme.html = html;
- theme.cid = cid;
- }
-
- $editingTheme.value = theme;
- nameEl.value = theme.name;
-
- editor.dispatch({
- changes: { from: 0, to: editor.state.doc.length, insert: theme.html },
- });
-}
-
-/**
- * @param {Theme} theme
- */
-async function saveTheme(theme) {
- const col = output.themes.collection();
- const data = col.state === "loaded" ? col.data : [];
- const colWithoutId = data.filter((c) => c.id !== theme.id);
- await output.themes.save([...colWithoutId, {
- ...theme,
- updatedAt: new Date().toISOString(),
- }]);
-}
diff --git a/src/themes/index.vto b/src/themes/index.vto
deleted file mode 100644
index 534f9079..00000000
--- a/src/themes/index.vto
+++ /dev/null
@@ -1,130 +0,0 @@
----
-layout: layouts/diffuse.vto
-base: ../
-
-styles:
- - styles/base.css
- - styles/diffuse/page.css
- - vendor/@phosphor-icons/bold/style.css
- - vendor/@phosphor-icons/fill/style.css
-
-scripts:
- - themes/index.js
- - common/pages/version-upgrade.js
-
-# THEMES
-
-builtIn:
- - url: "themes/blur/"
- title: "Blur"
- todo: true
- desc: >
- **A theme with an Apple-inspired playback view.** Features two audio players instead of the usual one.
- - url: "themes/webamp/"
- title: "Webamp"
- desc: >
- **Winamp 2 + Windows 98**. Uses Webamp as the audio player connected to various Diffuse elements. Also features a desktop-like Windows 98 environment in which you can open "programs" that control the used Diffuse elements.
----
-
-
-
-
-
-
- Themes
-
-
-
- Themes are element compositions and provide a traditional browser web application way of
- using them. In other words, pretty much the whole thing, besides your data, lives inside a single browser tab.
-
-
-
-
-
- Each theme is unique, not just a skin; each one might have a totally different feature set.
-
-
-
-
-
-
-
-
-
-
-
- Built-in
-
- {{ await comp.list({ items: builtIn }) }}
-
-
-
-
-
- Check out some themes from the community and load them here.
-
-
- Nothing here yet, too early.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/themes/l/index.css b/src/themes/l/index.css
deleted file mode 100644
index db9d60f7..00000000
--- a/src/themes/l/index.css
+++ /dev/null
@@ -1,12 +0,0 @@
-body {
- margin: 0;
- overflow: hidden;
- padding: 0;
-}
-
-iframe {
- border: 0;
- display: block;
- height: 100dvh;
- width: 100%;
-}
diff --git a/src/themes/l/index.js b/src/themes/l/index.js
deleted file mode 100644
index 93db84f8..00000000
--- a/src/themes/l/index.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import foundation from "~/common/facets/foundation.js";
-import * as CID from "~/common/cid.js";
-import { createLoader, renderError } from "~/common/loader.js";
-
-const output = await foundation.orchestrator.output();
-
-createLoader({
- $type: "sh.diffuse.output.theme",
- label: "Theme",
- source: () => output.themes,
- async render(theme) {
- if (theme.cid) {
- const valid = await CID.verify(
- new TextEncoder().encode(theme.html ?? ""),
- theme.cid,
- );
-
- if (!valid) {
- renderError(
- document.body,
- "CID mismatch: HTML content does not match the CID",
- );
- return;
- }
- }
-
- const iframe = document.createElement("iframe");
- iframe.srcdoc = theme.html ?? "";
-
- document.body.innerHTML = "";
- document.body.append(iframe);
- },
-});
diff --git a/src/themes/l/index.vto b/src/themes/l/index.vto
deleted file mode 100644
index f4fa9bdf..00000000
--- a/src/themes/l/index.vto
+++ /dev/null
@@ -1,21 +0,0 @@
----
-layout: layouts/diffuse.vto
-base: ../../
-
-styles:
- - vendor/@phosphor-icons/fill/style.css
- - styles/base.css
- - styles/loader.css
- - themes/l/index.css
-
-scripts:
- - themes/l/index.js
----
-
-