1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-24 17:39:36 +01:00
This commit is contained in:
Jan Andrle 2023-09-13 21:37:00 +02:00
parent dfcb98bfbe
commit 9c5ac96ab8
Signed by: jaandrle
GPG Key ID: B3A25AED155AFFAB
2 changed files with 21 additions and 17 deletions

View File

@ -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(){

View File

@ -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 <andrle.jan@centrum.cz>",
"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
},