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/type.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Mapping, TemplateFunction, UTILITY_SCOPE, ValueOf } from 'clientnode';
2
- import PropertyTypes, { ValidationMap } from 'clientnode/property-types';
3
- import React, { ComponentType as ReactComponentType, HTMLAttributes, ReactElement } from '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
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter((function(path){return eval("require.main.paths").includes(path)}))))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var i=n();for(var l in i)("object"==typeof exports?exports:e)[l]=i[l]}}(this,(()=>{return{r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}.r(e={}),e;var e}));
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.601",
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": "^7.29.7",
73
- "@babel/runtime": "^7.29.7",
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": "^25.9.3",
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.61.0",
84
- "@typescript-eslint/parser": "^8.61.0",
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.1423",
87
- "eslint": "^10.5.0",
91
+ "clientnode": "^4.0.1467",
92
+ "eslint": "^10.7.0",
88
93
  "eslint-config-google": "^0.14.0",
89
- "eslint-plugin-jsdoc": "^63.0.2",
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.7",
94
- "react-dom": "^19.2.7",
95
- "typescript-eslint": "^8.61.0",
96
- "web-documentation": "^1.0.39",
97
- "weboptimizer": "^3.0.24",
98
- "webpack-dev-server": "^5.2.5"
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
- "babelMinify": {
166
- "#": "To provide a logging output we need to exclude this feature.",
167
- "__evaluate__": "self.debug ? {bundle: null, module: null} : {bundle: {transform: {removeConsole: false}}, module: /*NOTE: Wrongly produces a void function around 'getAttributeNames': {removeConsole: false}*/null}"
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/Web.js"
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: true
146
- static evaluateSlots: true
147
- static observedAttributes = ['name']
148
- static content = '<div>Hello ${name}</div>'
149
-
150
- @property()
151
- name = 'string'
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
- ## Data-Flow
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
- ### Configuring Data-Flow
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