update to v2.2.0

add library version getter
fix demo issues
This commit is contained in:
2025-09-13 01:55:41 -04:00
parent c10e8cd345
commit c9de0883eb
10 changed files with 151 additions and 58 deletions

View File

@@ -1,16 +1,16 @@
/**
* fluent-dom-esm v2.1.0
* fluent-dom-esm v2.2.0
*
* Fluent DOM Manipulation, adapted to ESM and cranked up to v2.1(.0).
*
* https://git.itsericwoodward.com/eric/fluent-dom-esm
*
* v2.1.0 Copyright (c) 2025 Eric Woodward
* v2.2.0 Copyright (c) 2025 Eric Woodward
* Original copyright (c) 2009 Tommy Montgomery (https://glacius.tmont.com/articles/fluent-dom-manipulation-in-javascript)
*
* Released under the WTFPL (Do What the Fuck You Want to Public License)
*
* @author Eric Woodward (v2.1.0 update)
* @author Eric Woodward (v2 update)
* @author Tommy Montgomery (original)
* @license http://sam.zoy.org/wtfpl/
*/
@@ -24,7 +24,7 @@ import {
isString,
} from "./fluent-dom-esm.type-guards";
const APP_VERSION = "2.1.0";
const APP_VERSION = "2.2.0";
/**
* IIFE that creates the FluentDomObject as default export
@@ -45,12 +45,19 @@ export default (function () {
/**
* Creates a new HTML element which is wrapped in a FluentDomObject and returned
*/
FluentDom.create = FluentDom.c = function (tagName: string) {
FluentDom.c = FluentDom.create = function (tagName: string) {
const f = new (FluentDomInternal as any)();
f.create(tagName);
return f;
};
/**
* Returns library version
*/
FluentDom.v = FluentDom.version = function () {
return APP_VERSION;
};
/**
* The internal representation of the FluentDomObject
*/
@@ -260,6 +267,13 @@ export default (function () {
root.removeEventListener(...props);
return this;
};
/**
* Returns library version
*/
this.v = this.version = function () {
return APP_VERSION;
};
};
return FluentDom;

View File

@@ -5,13 +5,13 @@ export interface FluentDomObject {
app: (obj: FluentDomObject | HTMLElement | string) => FluentDomObject;
append: (obj: FluentDomObject | HTMLElement | string) => FluentDomObject;
attr: (name: string, value: string) => FluentDomObject;
c: (tagName: string) => FluentDomObject;
create: (tagName: string) => FluentDomObject;
c: (tagName: string) => FluentDomObject;
className: (className: string) => FluentDomObject;
clear: () => FluentDomObject;
cls: (className: string) => FluentDomObject;
clr: () => FluentDomObject;
cls: (className: string) => FluentDomObject;
create: (tagName: string) => FluentDomObject;
h: (url: string) => FluentDomObject;
href: (url: string) => FluentDomObject;
@@ -51,4 +51,7 @@ export interface FluentDomObject {
listener: () => {},
optionsOrUseCapture?: boolean | object,
) => FluentDomObject;
v: () => string;
version: () => string;
}