From fcc960472697419548ab02d6de50b154bdd15b07 Mon Sep 17 00:00:00 2001 From: Stephen Date: Sun, 4 Aug 2024 02:56:06 +0200 Subject: [PATCH] =?UTF-8?q?Adds=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- literal-html/module.js | 67 ++--- literal-html/test.html | 86 ++++-- literal-shadow/README.md | 37 +++ literal-shadow/index.html | 465 ++++++++++++++++++++++++++++++ literal-shadow/index.html.literal | 26 ++ literal-shadow/module.js | 160 ++++++++++ literal-shadow/test.html | 198 +++++++++++++ scope/location.js | 110 ------- scope/navigate.js | 108 ------- scope/scope-dom-ext.js | 19 +- scope/scope-fns.js | 2 - 11 files changed, 979 insertions(+), 299 deletions(-) create mode 100644 literal-shadow/README.md create mode 100644 literal-shadow/index.html create mode 100644 literal-shadow/index.html.literal create mode 100644 literal-shadow/module.js create mode 100644 literal-shadow/test.html delete mode 100644 scope/location.js delete mode 100644 scope/navigate.js diff --git a/literal-html/module.js b/literal-html/module.js index 7f4855a..6556c77 100644 --- a/literal-html/module.js +++ b/literal-html/module.js @@ -3,58 +3,54 @@ A `literal-html` template may be placed anywhere in your HTML. It is designed to make it easy to mix islands of dynamically rendered content into static content. -**/ +A `literal-html` template is replaced in the DOM with it's own rendered content. -import noop from 'fn/noop.js'; -import Signal from 'fn/signal.js'; -import element, { getInternals as Internals } from 'dom/element.js'; -import assignDataset from '../modules/dom/assign-dataset.js'; -import requestData from '../modules/request-data.js'; -import DOMRenderer from '../modules/template.js'; -import { printError } from '../modules/print.js'; +Note that templates declared as shadow roots with the `shadowrootmode="open"` or +`shadowrootmode="closed"` attribute cannot also be `is="literal-html"` templates: +the HTML parser picks them up and treats them as shadows before the custom +element registry can upgrade them: they cannot be enhanced, sadly. However this +library provides another template, `