be-hive 0.0.223 → 0.0.224

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/be-hive.js CHANGED
@@ -128,7 +128,7 @@ export class BeHive extends Synthesizer {
128
128
  }
129
129
  initialPropValues.customHandlers = registeredHandlers.get(synConfig.top)?.get(enhPropKey);
130
130
  if (ws !== undefined) {
131
- (await import('./e.js')).e(mountedElement, ws);
131
+ (await import('./e.js')).e(mountedElement, ws, initialPropValues);
132
132
  }
133
133
  //initialPropValues.scopedCustomHandlers = scopedHandlers.get(synConfig.top)?.get(enhPropKey);
134
134
  enhancementInstance.attach(mountedElement, {
package/be-hive.ts CHANGED
@@ -150,7 +150,7 @@ export class BeHive extends Synthesizer {
150
150
  initialPropValues.customHandlers = registeredHandlers.get(synConfig.top)?.get(enhPropKey);
151
151
 
152
152
  if(ws !== undefined){
153
- (await import('./e.js')).e(mountedElement, ws);
153
+ (await import('./e.js')).e(mountedElement, ws, initialPropValues);
154
154
  }
155
155
  //initialPropValues.scopedCustomHandlers = scopedHandlers.get(synConfig.top)?.get(enhPropKey);
156
156
  enhancementInstance.attach(mountedElement, {
package/e.js CHANGED
@@ -1,8 +1,8 @@
1
- export function e(matchingElement, ws, ac) {
1
+ export function e(matchingElement, ws, initialPropVals, ac) {
2
2
  for (const w of ws) {
3
3
  if (!matchingElement.matches(w.q))
4
4
  continue;
5
- const { listeners } = w;
5
+ const { listeners, props } = w;
6
6
  for (const key in listeners) {
7
7
  let listener = listeners[key];
8
8
  if (listener.toString().substring(0, 5) === 'class') {
@@ -10,5 +10,6 @@ export function e(matchingElement, ws, ac) {
10
10
  }
11
11
  matchingElement.addEventListener(key, listener, { signal: ac?.signal });
12
12
  }
13
+ Object.assign(initialPropVals, props);
13
14
  }
14
15
  }
package/e.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  import { EventListenerClass, EventListenerOrFn, IW } from "./ts-refs/trans-render/be/types";
2
2
 
3
- export function e(matchingElement: Element, ws: Array<IW>, ac?: AbortController){
3
+
4
+ export function e(matchingElement: Element, ws: Array<IW>, initialPropVals: any, ac?: AbortController){
4
5
  for(const w of ws){
5
6
  if(!matchingElement.matches(w.q)) continue;
6
- const {listeners} = w;
7
+ const {listeners, props} = w;
7
8
  for(const key in listeners){
8
9
  let listener = listeners[key] as any;
9
10
  if(listener.toString().substring(0, 5) === 'class'){
10
11
  listener = new (<EventListenerClass>listener)() as any as EventListenerOrFn;
11
12
  }
12
13
  matchingElement.addEventListener(key, listener, {signal: ac?.signal});
13
-
14
14
  }
15
+ Object.assign(initialPropVals, props);
15
16
  }
16
17
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "be-hive",
3
- "version": "0.0.223",
3
+ "version": "0.0.224",
4
4
  "keywords": [
5
5
  "web-components",
6
6
  "web-component",
7
7
  "custom-element",
8
8
  "custom-elements"
9
9
  ],
10
- "description": "Specify that ShadowDOM should inherit be-haviors from parent Shadow DOM",
10
+ "description": "Specify that ShadowDOM should inherit be-hiviors from the parent Shadow DOM",
11
11
  "main": "be-hive.js",
12
12
  "module": "be-hive.js",
13
13
  "exports": {
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "./Registry.js": {
31
31
  "default": "./Registry.js",
32
- "types": "./Registry.Ts"
32
+ "types": "./Registry.ts"
33
33
  },
34
34
  "./w.js": {
35
35
  "default": "./w.js",
@@ -41,16 +41,16 @@
41
41
  "*.ts"
42
42
  ],
43
43
  "scripts": {
44
- "serve": "node node_modules/may-it-serve/serve.js",
44
+ "serve": "python3 ./node_modules/ssi-server/ssi_server.py",
45
45
  "update": "ncu -u && npm install"
46
46
  },
47
47
  "dependencies": {
48
- "be-enhanced": "0.0.146",
49
- "mount-observer": "0.0.38",
50
- "trans-render": "0.0.847"
48
+ "be-enhanced": "0.0.147",
49
+ "mount-observer": "0.0.39",
50
+ "trans-render": "0.0.848"
51
51
  },
52
52
  "devDependencies": {
53
- "may-it-serve": "0.0.8"
53
+ "ssi-server": "0.0.1"
54
54
  },
55
55
  "repository": {
56
56
  "type": "git",
package/w.js CHANGED
@@ -12,8 +12,16 @@ export class W {
12
12
  get listeners() {
13
13
  return this.#listeners;
14
14
  }
15
+ #props = {};
16
+ get props() {
17
+ return this.#props;
18
+ }
15
19
  a(eventsToAdd) {
16
20
  this.#listeners = { ...this.#listeners, ...eventsToAdd };
17
21
  return this;
18
22
  }
23
+ s(props) {
24
+ this.#props = { ...this.#props, ...props };
25
+ return this;
26
+ }
19
27
  }
package/w.ts CHANGED
@@ -6,15 +6,23 @@ export function w(q: CSSQuery, ws: Array<IW>){
6
6
  return returnObj;
7
7
  }
8
8
 
9
- export class W implements IW{
9
+ export class W<T = EventTarget> implements IW<T>{
10
10
  constructor(public q: CSSQuery){}
11
11
  #listeners: MappedListeners = {};
12
12
  get listeners(){
13
13
  return this.#listeners;
14
14
  }
15
+ #props: Partial<T> = {};
16
+ get props(){
17
+ return this.#props;
18
+ }
15
19
  a(eventsToAdd: {[key: string]: EventListenerOrFn}){
16
20
  this.#listeners = {...this.#listeners, ...eventsToAdd};
17
21
  return this;
18
22
  }
23
+ s(props: Partial<T>){
24
+ this.#props = {...this.#props, ...props};
25
+ return this;
26
+ }
19
27
 
20
28
  }