@webqit/oohtml 4.3.11 → 4.3.13
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/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +21 -21
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +15 -15
- package/dist/main.lite.js.map +2 -2
- package/package.json +1 -1
- package/src/html-imports/HTMLImportsContext.js +23 -9
- package/src/html-imports/HTMLModule.js +3 -3
package/package.json
CHANGED
|
@@ -52,11 +52,17 @@ export default class HTMLImportsContext extends DOMContext {
|
|
|
52
52
|
const options = { live: event.live, signal: event.signal, descripted: true };
|
|
53
53
|
event.meta.controller = Observer.reduce( this.#modules, path, Observer.get, ( m ) => {
|
|
54
54
|
if ( Array.isArray( m ) ) {
|
|
55
|
+
if ( !m.length ) {
|
|
56
|
+
event.respondWith( undefined );
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
55
59
|
// Paths with wildcard
|
|
56
60
|
for ( const n of m ) {
|
|
57
61
|
event.respondWith( n );
|
|
58
62
|
}
|
|
59
|
-
} else
|
|
63
|
+
} else {
|
|
64
|
+
event.respondWith( m.value );
|
|
65
|
+
}
|
|
60
66
|
}, options );
|
|
61
67
|
}
|
|
62
68
|
|
|
@@ -101,16 +107,24 @@ export default class HTMLImportsContext extends DOMContext {
|
|
|
101
107
|
// This superModules contextrequest is automatically aborted by the injected signal below
|
|
102
108
|
const request = { ...this.constructor.createRequest( moduleRef ? `${moduleRef}/*` : '*' ), live: true, signal, diff: true };
|
|
103
109
|
this.host.parentNode[ this.configs.CONTEXT_API.api.contexts ].request( request, ( m ) => {
|
|
104
|
-
|
|
105
|
-
Reflect.deleteProperty( this.inheritedModules,
|
|
106
|
-
if ( !Observer.has( this.localModules,
|
|
107
|
-
Observer.deleteProperty( this.#modules,
|
|
110
|
+
const _delete = ( key ) => {
|
|
111
|
+
Reflect.deleteProperty( this.inheritedModules, key );
|
|
112
|
+
if ( !Observer.has( this.localModules, key ) ) {
|
|
113
|
+
Observer.deleteProperty( this.#modules, key );
|
|
108
114
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
};
|
|
116
|
+
const _set = ( key, value ) => {
|
|
117
|
+
Reflect.set( this.inheritedModules, key, value );
|
|
118
|
+
if ( !Observer.has( this.localModules, key ) ) {
|
|
119
|
+
Observer.set( this.#modules, key, value );
|
|
113
120
|
}
|
|
121
|
+
};
|
|
122
|
+
if ( !m ) {
|
|
123
|
+
Object.keys( this.inheritedModules ).forEach( _delete );
|
|
124
|
+
} else {
|
|
125
|
+
if ( m.type === 'delete' ) {
|
|
126
|
+
_delete( m.key );
|
|
127
|
+
} else _set( m.key, m.value );
|
|
114
128
|
}
|
|
115
129
|
} );
|
|
116
130
|
}, { live: true, timing: 'sync', oldValue: true, lifecycleSignals: true } );
|
|
@@ -168,7 +168,7 @@ export default class HTMLModule {
|
|
|
168
168
|
if ( !this.parent ) return [];
|
|
169
169
|
const { window: { webqit: { Observer } } } = env;
|
|
170
170
|
let extendedId = ( this.host.getAttribute( this.config.attr.extends ) || '' ).trim();
|
|
171
|
-
let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim();
|
|
171
|
+
let inheritedIds = ( this.host.getAttribute( this.config.attr.inherits ) || '' ).trim().split( ' ' ).map( id => id.trim() ).filter( x => x );
|
|
172
172
|
const handleInherited = records => {
|
|
173
173
|
records.forEach( record => {
|
|
174
174
|
if ( Observer.get( this.defs, record.key ) !== record.oldValue ) return;
|
|
@@ -184,8 +184,8 @@ export default class HTMLModule {
|
|
|
184
184
|
if ( extendedId ) {
|
|
185
185
|
realtimes.push( Observer.reduce( parentDefsObj, [ extendedId, this.config.api.defs, Infinity ], Observer.get, handleInherited, { live: true } ) );
|
|
186
186
|
}
|
|
187
|
-
if (
|
|
188
|
-
realtimes.push( Observer.get( parentDefsObj, inheritedIds, handleInherited, { live: true } ) );
|
|
187
|
+
if ( inheritedIds.length ) {
|
|
188
|
+
realtimes.push( Observer.get( parentDefsObj, inheritedIds.includes( '*' ) ? Infinity : inheritedIds, handleInherited, { live: true } ) );
|
|
189
189
|
}
|
|
190
190
|
return realtimes;
|
|
191
191
|
}
|