From 9c5ac96ab849af8c097aeb0cb1a8f46ba8829d3f Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Wed, 13 Sep 2023 21:37:00 +0200 Subject: [PATCH] :truck: --- jsdom.js | 13 +++++++++++++ package.json | 25 ++++++++----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/jsdom.js b/jsdom.js index 7c159fe..4128fe0 100644 --- a/jsdom.js +++ b/jsdom.js @@ -1,3 +1,4 @@ +//TODO: https://www.npmjs.com/package/html-element import { prop_process } from './src/dom-common.js'; const { setDelete }= prop_process; /** @param {HTMLElement} obj */ @@ -8,9 +9,16 @@ prop_process.setDelete= function(obj, prop, value){ }; const keys= [ "HTMLElement", "SVGElement", "DocumentFragment", "MutationObserver", "document" ]; let dom_last; + +export let namespace; +export let createElement; export let el; export let assign; +export let classListDeclarative; +export let empty; export let on; +export let dispatchEvent; + export async function register(dom, keys_aditional= []){ if(dom_last===dom) return import("./index.js"); @@ -22,9 +30,14 @@ export async function register(dom, keys_aditional= []){ w.console= globalThis.console; const m= await import("./index.js"); + namespace= m.namespace; + createElement= m.createElement; el= m.el; assign= m.assign; + classListDeclarative= m.classListDeclarative; + empty= m.empty; on= m.on; + dispatchEvent= m.dispatchEvent; return m; } export function unregister(){ diff --git a/package.json b/package.json index 6920447..8f8bde2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deka-dom-el", - "version": "0.1.3", + "version": "0.2.0", "description": "A low-code library that simplifies the creation of native DOM elements/components using small wrappers and tweaks.", "author": "Jan Andrle ", "license": "MIT", @@ -16,6 +16,10 @@ "types": "./index.d.ts", "type": "module", "exports": { + ".": { + "import": "./index.js", + "types": "./index.d.ts" + }, "./jsdom": { "import": "./jsdom.js", "types": "./jsdom.d.ts" @@ -24,24 +28,11 @@ "import": "./signals.js", "types": "./signals.d.ts" }, - "./signals-lib": { + "./src/signals-lib": { "import": "./src/signals-lib.js", "types": "./src/signals.d.ts" } }, - "typesVersions": { - "*": { - "./jsdom": [ - "./jsdom.d.ts" - ], - "./signals": [ - "./signals.d.ts" - ], - "./signals-lib": [ - "./src/signals.d.ts" - ] - } - }, "files": [ "*.js", "*.d.ts", @@ -70,12 +61,12 @@ "gzip": false }, { - "path": "./src/signals.js", + "path": "./signals.js", "limit": "4 kB", "gzip": false }, { - "path": "./src/jsdom.js", + "path": "./jsdom.js", "limit": "8 kB", "gzip": false },