@webtides/element-js 1.0.0-alpha.9 → 1.1.0
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/CHANGELOG.md +369 -0
- package/README.md +3 -3
- package/docs/README.md +70 -89
- package/docs/concepts/classes.md +37 -66
- package/docs/concepts/hierarchy.md +29 -31
- package/docs/concepts/lifecycle.md +9 -23
- package/docs/concepts/reactivity.md +1 -3
- package/docs/features/computed-properties.md +13 -16
- package/docs/features/dependency-injection-context-protocol.md +75 -87
- package/docs/features/global-styles.md +1 -1
- package/docs/features/methods.md +14 -15
- package/docs/features/properties.md +21 -33
- package/docs/features/refs.md +23 -31
- package/docs/features/renderless.md +31 -37
- package/docs/features/store.md +63 -78
- package/docs/features/templates.md +4 -1
- package/docs/features/watch.md +28 -35
- package/docs/getting-started/upgrade-to-v1.md +16 -0
- package/docs/guide/guide.md +10 -22
- package/index.js +29 -2
- package/package.json +62 -62
- package/src/BaseElement.js +637 -632
- package/src/StyledElement.js +104 -104
- package/src/TemplateElement.js +53 -58
- package/src/dom-parts/AttributePart.js +116 -116
- package/src/dom-parts/ChildNodePart.js +288 -288
- package/src/dom-parts/NodePart.js +27 -27
- package/src/dom-parts/Part.js +6 -6
- package/src/dom-parts/TemplatePart.js +119 -119
- package/src/dom-parts/TemplateResult.js +274 -267
- package/src/dom-parts/directives.js +105 -48
- package/src/dom-parts/html.js +2 -2
- package/src/dom-parts/render.js +6 -1
- package/src/util/AttributeParser.js +47 -47
- package/src/util/DOMHelper.js +190 -191
- package/src/util/Directive.js +31 -24
- package/src/util/GlobalStylesStore.js +56 -49
- package/src/util/SerializeStateHelper.js +56 -56
- package/src/util/Store.js +174 -174
- package/src/util/defineElement.js +5 -5
- package/src/util/toString.js +5 -5
package/index.js
CHANGED
|
@@ -4,7 +4,17 @@ import { TemplateElement, html } from './src/TemplateElement.js';
|
|
|
4
4
|
import { toString } from './src/util/toString.js';
|
|
5
5
|
import { defineElement } from './src/util/defineElement.js';
|
|
6
6
|
import { Store } from './src/util/Store.js';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
defineDirective,
|
|
9
|
+
Directive,
|
|
10
|
+
classMap,
|
|
11
|
+
styleMap,
|
|
12
|
+
when,
|
|
13
|
+
choose,
|
|
14
|
+
unsafeHTML,
|
|
15
|
+
spreadAttributes,
|
|
16
|
+
optionalAttribute,
|
|
17
|
+
} from './src/dom-parts/directives.js';
|
|
8
18
|
|
|
9
19
|
/**
|
|
10
20
|
* Options object for element-js
|
|
@@ -13,4 +23,21 @@ import { Directive } from './src/util/Directive.js';
|
|
|
13
23
|
* @property {boolean} [observeGlobalStyles] - By default element-js will look for all style elements in the global document and apply them before any custom/element styles inside the shadow DOM. When set to true element-js will also observe the document for any changes regarding styles. This is needed if styles will get added async or late.
|
|
14
24
|
*/
|
|
15
25
|
|
|
16
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
BaseElement,
|
|
28
|
+
StyledElement,
|
|
29
|
+
TemplateElement,
|
|
30
|
+
Store,
|
|
31
|
+
html,
|
|
32
|
+
toString,
|
|
33
|
+
defineElement,
|
|
34
|
+
defineDirective,
|
|
35
|
+
Directive,
|
|
36
|
+
classMap,
|
|
37
|
+
styleMap,
|
|
38
|
+
when,
|
|
39
|
+
choose,
|
|
40
|
+
unsafeHTML,
|
|
41
|
+
spreadAttributes,
|
|
42
|
+
optionalAttribute,
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
2
|
+
"name": "@webtides/element-js",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"module": "index.js",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"/docs",
|
|
9
|
+
"/src",
|
|
10
|
+
"index.js"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"browser": "./index.js",
|
|
15
|
+
"import": "./index.js",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"./src/*": "./src/*.js",
|
|
19
|
+
"./src/util/*": "./src/util/*.js",
|
|
20
|
+
"./src/dom-parts/*": "./src/dom-parts/*.js"
|
|
21
|
+
},
|
|
22
|
+
"repository": "https://github.com/webtides/element-js.git",
|
|
23
|
+
"author": "@webtides",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"web components",
|
|
27
|
+
"web component",
|
|
28
|
+
"components",
|
|
29
|
+
"component",
|
|
30
|
+
"custom elements",
|
|
31
|
+
"elements",
|
|
32
|
+
"element",
|
|
33
|
+
"element-js",
|
|
34
|
+
"shadow-dom"
|
|
35
|
+
],
|
|
36
|
+
"dependencies": {},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@babel/eslint-parser": "^7.23.3",
|
|
39
|
+
"@open-wc/testing": "^4.0.0",
|
|
40
|
+
"@web/dev-server": "^0.4.1",
|
|
41
|
+
"@web/test-runner": "^0.14.1",
|
|
42
|
+
"babel-eslint": "^10.1.0",
|
|
43
|
+
"eslint": "8.55.0",
|
|
44
|
+
"eslint-config-prettier": "^9.1.0",
|
|
45
|
+
"eslint-plugin-import": "^2.29.0",
|
|
46
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
47
|
+
"husky": "^8.0.3",
|
|
48
|
+
"lint-staged": "^15.1.0",
|
|
49
|
+
"prettier": "^3.1.0"
|
|
50
|
+
},
|
|
51
|
+
"lint-staged": {
|
|
52
|
+
"*.{js,json}": [
|
|
53
|
+
"prettier --write",
|
|
54
|
+
"git add"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"lint": "eslint index.js 'src/**/*.js'",
|
|
59
|
+
"test": "web-test-runner test/**/*.test.{html,js} --node-resolve",
|
|
60
|
+
"test:coverage": "web-test-runner test/**/*.test.{html,js} --node-resolve --coverage",
|
|
61
|
+
"test:watch": "web-test-runner test/**/*.test.{html,js} --node-resolve --watch",
|
|
62
|
+
"start": "web-dev-server --config web-dev-server.config.mjs"
|
|
63
|
+
}
|
|
64
64
|
}
|