web-component-wrapper 0.0.601 → 0.0.604
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/dist/ReactWeb.d.ts +4 -3
- package/dist/ReactWeb.js +857 -1
- package/dist/Web.d.ts +3 -2
- package/dist/Web.js +615 -1
- package/dist/bundle/ReactWeb.js +23014 -7
- package/dist/bundle/Web.js +5555 -3
- package/dist/bundle/compatible/ReactWeb.js +22994 -7
- package/dist/bundle/compatible/Web.js +5545 -3
- package/dist/bundle/compatible/decorator.js +5038 -3
- package/dist/bundle/compatible/index.js +23048 -7
- package/dist/bundle/compatible/test.js +23079 -7
- package/dist/bundle/compatible/type.js +16 -1
- package/dist/bundle/decorator.js +5039 -3
- package/dist/bundle/index.js +23066 -7
- package/dist/bundle/test.js +23103 -7
- package/dist/bundle/type.js +16 -1
- package/dist/compatible/ReactWeb.js +841 -1
- package/dist/compatible/Web.js +605 -1
- package/dist/compatible/decorator.js +131 -1
- package/dist/compatible/index.js +909 -1
- package/dist/compatible/test.js +941 -1
- package/dist/compatible/type.js +16 -1
- package/dist/decorator.d.ts +1 -1
- package/dist/decorator.js +132 -1
- package/dist/index.js +925 -1
- package/dist/test.js +961 -1
- package/dist/type.d.ts +4 -4
- package/dist/type.js +16 -1
- package/package.json +32 -19
- package/readme.md +37 -15
package/dist/type.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Mapping, TemplateFunction, UTILITY_SCOPE, ValueOf } from 'clientnode';
|
|
2
|
-
import PropertyTypes,
|
|
3
|
-
import React,
|
|
4
|
-
import Web from './Web';
|
|
1
|
+
import type { Mapping, TemplateFunction, UTILITY_SCOPE, ValueOf } from 'clientnode';
|
|
2
|
+
import type { default as PropertyTypes, ValidationMap } from 'clientnode/property-types';
|
|
3
|
+
import type { default as React, ComponentType as ReactComponentType, HTMLAttributes, ReactElement } from 'react';
|
|
4
|
+
import type Web from './Web';
|
|
5
5
|
export interface RenderState {
|
|
6
6
|
promise: Promise<string>;
|
|
7
7
|
pending: boolean;
|
package/dist/type.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;// -*- coding: utf-8 -*-
|
|
2
|
+
/** @module type *//* !
|
|
3
|
+
region header
|
|
4
|
+
[Project page](https://torben.website/storelocator)
|
|
5
|
+
|
|
6
|
+
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
7
|
+
|
|
8
|
+
License
|
|
9
|
+
-------
|
|
10
|
+
|
|
11
|
+
This library written by Torben Sickert stands under a creative commons
|
|
12
|
+
naming 3.0 unported license.
|
|
13
|
+
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
14
|
+
endregion
|
|
15
|
+
*/// region imports
|
|
16
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-component-wrapper",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.604",
|
|
4
4
|
"description": "Generic web-component base class and framework specific wrapper.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -24,11 +24,16 @@
|
|
|
24
24
|
"url": "https://torben.website"
|
|
25
25
|
},
|
|
26
26
|
"main": "dist/index.js",
|
|
27
|
+
"type": "module",
|
|
27
28
|
"exports": {
|
|
28
29
|
".": "./dist/index.js",
|
|
30
|
+
"./compatible": "./dist/compatible/index.js",
|
|
29
31
|
"./decorator": "./dist/decorator.js",
|
|
32
|
+
"./compatible/decorator": "./dist/compatible/decorator.js",
|
|
30
33
|
"./ReactWeb": "./dist/ReactWeb.js",
|
|
34
|
+
"./compatible/ReactWeb": "./dist/compatible/ReactWeb.js",
|
|
31
35
|
"./Web": "./dist/Web.js",
|
|
36
|
+
"./compatible/Web": "./dist/compatible/Web.js",
|
|
32
37
|
"./type": "./dist/type.js"
|
|
33
38
|
},
|
|
34
39
|
"typesVersions": {
|
|
@@ -69,33 +74,33 @@
|
|
|
69
74
|
"watch": "weboptimizer build --watch"
|
|
70
75
|
},
|
|
71
76
|
"devDependencies": {
|
|
72
|
-
"@babel/eslint-parser": "^
|
|
73
|
-
"@babel/runtime": "^
|
|
77
|
+
"@babel/eslint-parser": "^8.0.1",
|
|
78
|
+
"@babel/runtime": "^8.0.0",
|
|
74
79
|
"@eslint/js": "^10.0.1",
|
|
75
80
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
76
81
|
"@types/ejs": "^3.1.5",
|
|
77
82
|
"@types/html-minifier": "^4.0.6",
|
|
78
83
|
"@types/jsdom": "^28.0.3",
|
|
79
|
-
"@types/node": "^
|
|
84
|
+
"@types/node": "^26.1.1",
|
|
80
85
|
"@types/react": "^19.2.17",
|
|
81
86
|
"@types/react-dom": "^19.2.3",
|
|
82
87
|
"@types/webpack-env": "^1.18.8",
|
|
83
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
84
|
-
"@typescript-eslint/parser": "^8.
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
89
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
85
90
|
"@webcomponents/webcomponentsjs": "^2.8.0",
|
|
86
|
-
"clientnode": "^4.0.
|
|
87
|
-
"eslint": "^10.
|
|
91
|
+
"clientnode": "^4.0.1467",
|
|
92
|
+
"eslint": "^10.7.0",
|
|
88
93
|
"eslint-config-google": "^0.14.0",
|
|
89
|
-
"eslint-plugin-jsdoc": "^63.0
|
|
94
|
+
"eslint-plugin-jsdoc": "^63.2.0",
|
|
90
95
|
"jest": "30.4.2",
|
|
91
96
|
"jsdoc": "^4.0.5",
|
|
92
97
|
"prop-types": "^15.8.1",
|
|
93
|
-
"react": "^19.2.
|
|
94
|
-
"react-dom": "^19.2.
|
|
95
|
-
"typescript-eslint": "^8.
|
|
96
|
-
"web-documentation": "^1.0.
|
|
97
|
-
"weboptimizer": "^
|
|
98
|
-
"webpack-dev-server": "^
|
|
98
|
+
"react": "^19.2.8",
|
|
99
|
+
"react-dom": "^19.2.8",
|
|
100
|
+
"typescript-eslint": "^8.65.0",
|
|
101
|
+
"web-documentation": "^1.0.42",
|
|
102
|
+
"weboptimizer": "^4.0.34",
|
|
103
|
+
"webpack-dev-server": "^6.0.0"
|
|
99
104
|
},
|
|
100
105
|
"peerDependencies": {
|
|
101
106
|
"@babel/runtime": "*",
|
|
@@ -162,9 +167,18 @@
|
|
|
162
167
|
},
|
|
163
168
|
"module": {
|
|
164
169
|
"optimizer": {
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
|
|
170
|
+
"terser": {
|
|
171
|
+
"terserOptions": {
|
|
172
|
+
"compress": {
|
|
173
|
+
"#": "To provide a logging output we need to exclude this feature.",
|
|
174
|
+
"drop_console": {
|
|
175
|
+
"__evaluate__": "false"
|
|
176
|
+
},
|
|
177
|
+
"drop_debugger": {
|
|
178
|
+
"__evaluate__": "false"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
168
182
|
}
|
|
169
183
|
}
|
|
170
184
|
},
|
|
@@ -183,7 +197,6 @@
|
|
|
183
197
|
"normal": true
|
|
184
198
|
}
|
|
185
199
|
},
|
|
186
|
-
"libraryName": "webComponentWrapper",
|
|
187
200
|
"module": {
|
|
188
201
|
"preprocessor": {
|
|
189
202
|
"javaScript": {
|
package/readme.md
CHANGED
|
@@ -127,29 +127,35 @@ export class MyWebComponent<
|
|
|
127
127
|
customElements.define('my-web-component', MyWebComponent)
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
+
<!--|deDE:Beispiele-->
|
|
131
|
+
Examples
|
|
132
|
+
--------
|
|
133
|
+
|
|
134
|
+
<!--|deDE:Lade via CDN-->
|
|
135
|
+
### Load via CDN
|
|
136
|
+
|
|
130
137
|
<!--showExample:hidden-->
|
|
131
138
|
|
|
132
139
|
```HTML
|
|
133
140
|
<script
|
|
134
|
-
src="https://unpkg.com/web-component-wrapper@latest/dist/bundle/
|
|
135
|
-
></script>
|
|
136
|
-
<script
|
|
137
|
-
src="https://unpkg.com/web-component-wrapper@latest/dist/bundle/decorator.js"
|
|
141
|
+
src="https://unpkg.com/web-component-wrapper@latest/dist/bundle/index.js"
|
|
138
142
|
></script>
|
|
139
143
|
```
|
|
140
144
|
|
|
145
|
+
<!--|deDE:Einfaches Web-Component Beispiel-->
|
|
146
|
+
### Simple Web-Component
|
|
147
|
+
|
|
141
148
|
<!--showExample:JavaScript-->
|
|
142
149
|
|
|
143
150
|
```JavaScript
|
|
144
151
|
class MyGreeting extends webComponentWrapper.Web {
|
|
145
|
-
static doRender
|
|
146
|
-
static evaluateSlots
|
|
147
|
-
static
|
|
148
|
-
static content = '<div>Hello ${
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
};
|
|
152
|
+
static doRender = true
|
|
153
|
+
static evaluateSlots = true
|
|
154
|
+
static determineRootBinding = false
|
|
155
|
+
static content = '<div>Hello ${rootInstance.greetingName}</div>'
|
|
156
|
+
}
|
|
157
|
+
// Alternative to the decorator syntax:
|
|
158
|
+
webComponentWrapper.property()({self: MyGreeting}, 'greetingName')
|
|
153
159
|
|
|
154
160
|
customElements.define('my-greeting', MyGreeting)
|
|
155
161
|
```
|
|
@@ -157,10 +163,26 @@ customElements.define('my-greeting', MyGreeting)
|
|
|
157
163
|
<!--showExample-->
|
|
158
164
|
|
|
159
165
|
```HTML
|
|
160
|
-
<my-greeting name="World"></my-greeting>
|
|
166
|
+
<my-greeting greeting-name="World"></my-greeting>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
<!--|deDE:Einfaches React-Web-Component Beispiel-->
|
|
170
|
+
### Simple React-Web-Component
|
|
171
|
+
|
|
172
|
+
```JavaScript
|
|
173
|
+
class MyReactGreeting extends webComponentWrapper.ReactWeb {
|
|
174
|
+
static doRender = true
|
|
175
|
+
static evaluateSlots = true
|
|
176
|
+
// Content has a react component to wrap.
|
|
177
|
+
static content = ({name}) => <div>Hello {name}</div>
|
|
178
|
+
}
|
|
179
|
+
// Alternative to the decorator syntax:
|
|
180
|
+
webComponentWrapper.property()({self: MyReactGreeting}, 'name')
|
|
181
|
+
|
|
182
|
+
customElements.define('my-react-greeting', MyReactGreeting)
|
|
161
183
|
```
|
|
162
184
|
|
|
163
|
-
|
|
185
|
+
### Data-Flow
|
|
164
186
|
|
|
165
187
|
Data can flow into a component via
|
|
166
188
|
|
|
@@ -172,7 +194,7 @@ Data can be communicated back via:
|
|
|
172
194
|
- Properties `log.info(instance.value)`
|
|
173
195
|
- Observable events `instance.addEventListener('click', (event) => console.log(event.detail.value))`
|
|
174
196
|
|
|
175
|
-
|
|
197
|
+
#### Configuring Data-Flow
|
|
176
198
|
|
|
177
199
|
A Web-Component-Wrapper component forwards (transformed) given properties into
|
|
178
200
|
a wrapped React component via `props` and reads data via provided callbacks
|