From 2fcec0551ce81872a1d925317bf3731e07986121 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Fri, 14 Mar 2025 20:43:30 +0100 Subject: [PATCH] :zap: :abc: --- README.md | 3 ++- .../{getLibraryUrl.css.js => getLibraryUrl.html.js} | 11 +++++++++++ .../{scrollTop.css.js => scrollTop.html.js} | 11 +++++++++++ docs/index.html.js | 10 +++------- docs/layout/simplePage.html.js | 7 ++----- docs/p03-events.html.js | 5 +++-- docs/{p14-convertor.html.js => p14-converter.html.js} | 0 7 files changed, 32 insertions(+), 15 deletions(-) rename docs/components/{getLibraryUrl.css.js => getLibraryUrl.html.js} (82%) rename docs/components/{scrollTop.css.js => scrollTop.html.js} (75%) rename docs/{p14-convertor.html.js => p14-converter.html.js} (100%) diff --git a/README.md b/README.md index 701c34a..ad1001b 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,8 @@ into existing projects. #### CDN / Direct Script -For CDN links and various build formats (ESM/IIFE, with/without signals, minified/unminified), see the [interactive format selector](https://jaandrle.github.io/deka-dom-el/) on the documentation site. +For CDN links and various build formats (ESM/IIFE, with/without signals, minified/unminified), see the [interactive +format selector](https://jaandrle.github.io/deka-dom-el/) on the documentation site. ```html diff --git a/docs/components/getLibraryUrl.css.js b/docs/components/getLibraryUrl.html.js similarity index 82% rename from docs/components/getLibraryUrl.css.js rename to docs/components/getLibraryUrl.html.js index 4c23d59..9f02992 100644 --- a/docs/components/getLibraryUrl.css.js +++ b/docs/components/getLibraryUrl.html.js @@ -70,3 +70,14 @@ styles.css` } } `; + +import { el } from "deka-dom-el"; +import { ireland } from "./ireland.html.js"; + +export function getLibraryUrl({ page_id }){ + return el(ireland, { + src: new URL("./getLibraryUrl.js.js", import.meta.url), + exportName: "getLibraryUrl", + page_id, + }); +} diff --git a/docs/components/scrollTop.css.js b/docs/components/scrollTop.html.js similarity index 75% rename from docs/components/scrollTop.css.js rename to docs/components/scrollTop.html.js index da37671..152b851 100644 --- a/docs/components/scrollTop.css.js +++ b/docs/components/scrollTop.html.js @@ -37,3 +37,14 @@ styles.css` } } `; + +import { el } from "deka-dom-el"; +import { ireland } from "./ireland.html.js"; + +export function scrollTop(){ + return el(ireland, { + src: new URL("./scrollTop.js.js", import.meta.url), + exportName: "scrollTop", + page_id: "*", + }); +} diff --git a/docs/index.html.js b/docs/index.html.js index ddb4cb5..b0bec30 100644 --- a/docs/index.html.js +++ b/docs/index.html.js @@ -1,4 +1,4 @@ -import "./components/getLibraryUrl.css.js"; +import "./components/getLibraryUrl.html.js"; import { t, T } from "./utils/index.js"; export const info= { href: "./", @@ -12,7 +12,7 @@ import { simplePage } from "./layout/simplePage.html.js"; import { h3 } from "./components/pageUtils.html.js"; import { example } from "./components/example.html.js"; import { code } from "./components/code.html.js"; -import { ireland } from "./components/ireland.html.js"; +import { getLibraryUrl } from "./components/getLibraryUrl.html.js"; /** @param {string} url */ const fileURL= url=> new URL(url, import.meta.url); const references= { @@ -110,11 +110,7 @@ export function page({ pkg, info }){ el("p").append(T` Use the interactive selector below to choose your preferred format: `), - el(ireland, { - src: fileURL("./components/getLibraryUrl.js.js"), - exportName: "getLibraryUrl", - page_id, - }), + el(getLibraryUrl, { page_id }), el("div", { className: "note" }).append( el("p").append(T` Based on your selection, you can use dd in your project like this: diff --git a/docs/layout/simplePage.html.js b/docs/layout/simplePage.html.js index 1a603b0..328d469 100644 --- a/docs/layout/simplePage.html.js +++ b/docs/layout/simplePage.html.js @@ -3,10 +3,7 @@ import { el, simulateSlots } from "deka-dom-el"; import { header } from "./head.html.js"; import { prevNext } from "../components/pageUtils.html.js"; -import { ireland } from "../components/ireland.html.js"; -import "../components/scrollTop.css.js"; -/** @param {string} url */ -const fileURL= url=> new URL(url, import.meta.url); +import { scrollTop } from "../components/scrollTop.html.js"; /** @param {Pick} attrs */ export function simplePage({ pkg, info }){ @@ -33,6 +30,6 @@ export function simplePage({ pkg, info }){ ), // Scroll to top button - el(ireland, { src: fileURL("../components/scrollTop.js.js"), exportName: "scrollTop" }) + el(scrollTop), )); } diff --git a/docs/p03-events.html.js b/docs/p03-events.html.js index 150b3f5..554ca7e 100644 --- a/docs/p03-events.html.js +++ b/docs/p03-events.html.js @@ -165,9 +165,10 @@ export function page({ pkg, info }){ el("dt", t`on.disconnected(callback)`), el("dd", t`Fires when the element is removed from the DOM`), - + el("dt", t`on.host(callback, host?)`), - el("dd", t`Fires when the host element is "ready" and allows applying properties based on the fully built template`), + el("dd", t`Fires when the host element is "ready" and allows applying properties based on the fully + built template`), ) ), el(example, { src: fileURL("./components/examples/events/live-cycle.js"), page_id }), diff --git a/docs/p14-convertor.html.js b/docs/p14-converter.html.js similarity index 100% rename from docs/p14-convertor.html.js rename to docs/p14-converter.html.js