luciddom 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -5
- package/lucidDOM.js +797 -0
- package/package.json +13 -14
- package/dist/luciddom.min.js +0 -2
- package/styles.css +0 -739
package/README.md
CHANGED
|
@@ -2,9 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
LucidDOM.js is a lightweight browser-side DOM helper. It wraps a parent element and provides methods for creating elements, selecting descendants, updating content, handling events, applying inline styles, and removing elements.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### npm
|
|
8
|
+
|
|
9
|
+
Install LucidDOM from npm:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install luciddom
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Import the default export in your app. Use a bundler that resolves npm packages:
|
|
8
16
|
|
|
9
17
|
```html
|
|
10
18
|
<div id="app"></div>
|
|
@@ -13,7 +21,7 @@ Copy `lucidDOM.js` into your project and import its default export from a JavaSc
|
|
|
13
21
|
|
|
14
22
|
```js
|
|
15
23
|
// app.js
|
|
16
|
-
import LucidDOM from '
|
|
24
|
+
import LucidDOM from 'luciddom';
|
|
17
25
|
|
|
18
26
|
const app = new LucidDOM(document.querySelector('#app'));
|
|
19
27
|
|
|
@@ -26,6 +34,23 @@ const message = app.addElement({
|
|
|
26
34
|
message.styles({ color: 'darkslateblue', fontWeight: 'bold' });
|
|
27
35
|
```
|
|
28
36
|
|
|
37
|
+
### unpkg CDN
|
|
38
|
+
|
|
39
|
+
For a browser module without an npm install or bundler, import the package directly from unpkg:
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<div id="app"></div>
|
|
43
|
+
<script type="module">
|
|
44
|
+
import LucidDOM from 'https://unpkg.com/luciddom@1.0.1/lucidDOM.js';
|
|
45
|
+
|
|
46
|
+
const app = new LucidDOM(document.querySelector('#app'));
|
|
47
|
+
app.addElement({
|
|
48
|
+
tag: 'p',
|
|
49
|
+
value: 'Hello from LucidDOM!'
|
|
50
|
+
});
|
|
51
|
+
</script>
|
|
52
|
+
```
|
|
53
|
+
|
|
29
54
|
The constructor accepts a DOM element and scopes queries and element creation to it. If no parent is passed, it defaults to `document.body`.
|
|
30
55
|
|
|
31
56
|
## Common operations
|
|
@@ -114,14 +139,14 @@ When nothing matches, `current` is an empty NodeList and helper methods do nothi
|
|
|
114
139
|
|
|
115
140
|
## Build
|
|
116
141
|
|
|
117
|
-
The package includes an esbuild script to create a minified
|
|
142
|
+
The package includes an esbuild script to create a minified browser bundle:
|
|
118
143
|
|
|
119
144
|
```sh
|
|
120
145
|
npm install
|
|
121
146
|
npm run build
|
|
122
147
|
```
|
|
123
148
|
|
|
124
|
-
The output is written to `dist/
|
|
149
|
+
The output is written to `dist/luciddom.min.js`.
|
|
125
150
|
|
|
126
151
|
## Documentation
|
|
127
152
|
|