From a874d0a3fe43d98419f09de3c1956075b3a3f1bb Mon Sep 17 00:00:00 2001 From: lelanthran Date: Sun, 6 Apr 2025 10:23:23 +0200 Subject: [PATCH] Updates docs. --- README.md | 4 ++- ZjsComponent/README.md | 55 +++++++++++++++++++++++++++++++++--------- 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index f51ae08..1becfef 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,8 @@ doubtful that the testing process will remain dependency-free, but we'll see. ## License -MIT. This means that when it breaks you get to keep *all* the pieces. +[MIT...ish](LICENSE) + +This means that when it breaks you get to keep *all* the pieces. Good luck. diff --git a/ZjsComponent/README.md b/ZjsComponent/README.md index 1d14787..b86563b 100644 --- a/ZjsComponent/README.md +++ b/ZjsComponent/README.md @@ -5,6 +5,18 @@ modular, reusable front-end UI components. It allows dynamic loading of HTML+JS fragments with local script scoping, simple lifecycle hooks, and isolated DOM composition without needing a full framework. +A single component is simply a fragment of valid HTML that s downloaded and +inserted into the DOM. Scripts in that fragment are scoped to that fragment +alone. An instance of a **ZjsComponent** is created for that fragment which +will have specific functions (identified by the component author) created as +methods on that instance. + +To insert a component, which can be a full and rich component containing +complex sub-DOM and methods on the object, do this: +```html + +``` + A single component is a fragment of valid HTML that contains: 1. Zero or more HTML elements, @@ -18,7 +30,17 @@ closest **ZjsComponent** ancestor and execute the method on that instance. At it's minimal usage, **ZjsComponent** can simply be used for client-side includes of HTML. With full leverage of all it's features, **ZjsComponent** can be used to create reusable HTML web components in the simplest way -possible. +possible while allowing the component developer to: + +1. Scope access to DOM elements to only those in the HTML fragment that is + loaded. +2. Scope access to Javascript to only that **ZjsComponent** instance + represented by the fragment of HTML. + +> **NOTE** Not scoping the CSS is a deliberate decision. CSS within the +> fragment *is not scoped*, to allow usage of site-wide and global theming by +> the site author. This dual-cutting sword also means that `