@webqit/oohtml 4.1.3 → 4.1.5
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/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +14 -14
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +12 -12
- package/dist/main.lite.js.map +2 -2
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +1 -1
- package/dist/scoped-css.js.map +2 -2
- package/package.json +2 -2
- package/src/context-api/DOMContexts.js +3 -1
- package/src/html-imports/index.js +3 -3
- package/src/namespaced-html/index.js +19 -4
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"wicg-proposal"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://webqit.io/tooling/oohtml",
|
|
17
|
-
"version": "4.1.
|
|
17
|
+
"version": "4.1.5",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"postpublish": "git push && git push --tags"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@webqit/quantum-js": "^4.5.
|
|
42
|
+
"@webqit/quantum-js": "^4.5.8",
|
|
43
43
|
"@webqit/realdom": "^2.1.24",
|
|
44
44
|
"@webqit/util": "^0.8.11"
|
|
45
45
|
},
|
|
@@ -87,8 +87,10 @@ export default class DOMContexts {
|
|
|
87
87
|
|
|
88
88
|
const rootNode = this[ '#' ].host.getRootNode();
|
|
89
89
|
const temp = event => {
|
|
90
|
-
|
|
90
|
+
event.stopImmediatePropagation();
|
|
91
|
+
// Always set thus whether answered or not
|
|
91
92
|
event.meta.target = event.target;
|
|
93
|
+
if ( event.answered ) return;
|
|
92
94
|
if ( !waitListMappings.get( rootNode ) ) { waitListMappings.set( rootNode, new Set ); }
|
|
93
95
|
if ( event.type === 'contextrequest' && event.live ) {
|
|
94
96
|
waitListMappings.get( rootNode ).add( event );
|
|
@@ -134,7 +134,7 @@ function realtime( config ) {
|
|
|
134
134
|
record.entrants.forEach( entry => {
|
|
135
135
|
if ( entry.matches( config.templateSelector ) ) {
|
|
136
136
|
const htmlModule = HTMLModule.instance( entry );
|
|
137
|
-
htmlModule.ownerContext = entry.scoped ?
|
|
137
|
+
htmlModule.ownerContext = entry.scoped ? entry.parentNode : entry.getRootNode();
|
|
138
138
|
const ownerContextModulesObj = getDefs( htmlModule.ownerContext );
|
|
139
139
|
if ( htmlModule.defId ) { Observer.set( ownerContextModulesObj, htmlModule.defId, entry ); }
|
|
140
140
|
// The ownerContext's defs - ownerContextModulesObj - has to be populated
|
|
@@ -149,13 +149,13 @@ function realtime( config ) {
|
|
|
149
149
|
if ( entry.matches( config.templateSelector ) ) {
|
|
150
150
|
const htmlModule = HTMLModule.instance( entry );
|
|
151
151
|
const ownerContextModulesObj = getDefs( htmlModule.ownerContext );
|
|
152
|
-
if ( htmlModule.defId ) { Observer.deleteProperty( ownerContextModulesObj, htmlModule.defId ); }
|
|
152
|
+
if ( htmlModule.defId && htmlModule.ownerContext.isConnected ) { Observer.deleteProperty( ownerContextModulesObj, htmlModule.defId ); }
|
|
153
153
|
detachImportsContext( htmlModule.ownerContext );
|
|
154
154
|
} else {
|
|
155
155
|
detachImportsContext( entry );
|
|
156
156
|
}
|
|
157
157
|
} );
|
|
158
|
-
}, { live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true } );
|
|
158
|
+
}, { live: true, subtree: 'cross-roots', timing: 'sync', staticSensitivity: true, eventDetails: true } );
|
|
159
159
|
|
|
160
160
|
// ------------
|
|
161
161
|
// IMPORTS
|
|
@@ -313,10 +313,12 @@ function realtime( config ) {
|
|
|
313
313
|
if ( entry.isConnected ) { setupBinding( entry, attrName, _( entry, 'attrOriginals' ).get( attrName )/* Saved original value */ || attrValue/* Lest it's ID */, newNamespaceObj ); }
|
|
314
314
|
};
|
|
315
315
|
record.exits.forEach( entry => {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
for ( const
|
|
316
|
+
if ( entry.isConnected ) {
|
|
317
|
+
const namespaceObj = getOwnNamespaceObject.call( window, entry );
|
|
318
|
+
// Detach ID and IDREF associations
|
|
319
|
+
for ( const node of new Set( [ ...Object.values( namespaceObj ), ...( _( namespaceObj ).get( 'idrefs' ) || [] ) ] ) ) {
|
|
320
|
+
for ( const attrName of attrList ) { reAssociate( node, attrName, namespaceObj ); }
|
|
321
|
+
}
|
|
320
322
|
}
|
|
321
323
|
// Detach ID associations
|
|
322
324
|
const contextsApi = entry[ configs.CONTEXT_API.api.contexts ];
|
|
@@ -340,9 +342,20 @@ function realtime( config ) {
|
|
|
340
342
|
|
|
341
343
|
// DOM realtime
|
|
342
344
|
realdom.realtime( window.document ).query( `[${ attrList.map( attrName => window.CSS.escape( attrName ) ).join( '],[' ) }]`, record => {
|
|
345
|
+
// We do some caching to prevent redundanct lookups
|
|
346
|
+
const namespaceNodesToTest = { forID: new Map, forOther: new Map, };
|
|
343
347
|
for ( const attrName of attrList ) {
|
|
348
|
+
// Point to the right cache
|
|
349
|
+
const _namespaceNodesToTest = attrName === config.attr.lid ? namespaceNodesToTest.forID : namespaceNodesToTest.forOther;
|
|
344
350
|
record.exits.forEach( entry => {
|
|
345
351
|
if ( !entry.hasAttribute( attrName ) ) return;
|
|
352
|
+
// Point to the right namespace node
|
|
353
|
+
let namespaceNodeToTest = _namespaceNodesToTest.get( entry );
|
|
354
|
+
if ( typeof namespaceNodeToTest === 'undefined' ) {
|
|
355
|
+
namespaceNodeToTest = ( attrName === config.attr.lid ? entry.parentNode : entry )?.closest/*can be documentFragment when Shadow DOM*/?.( config.namespaceSelector ) || entry.getRootNode().host;
|
|
356
|
+
_namespaceNodesToTest.set( entry, namespaceNodeToTest );
|
|
357
|
+
}
|
|
358
|
+
if ( namespaceNodeToTest && !namespaceNodeToTest.isConnected ) return;
|
|
346
359
|
cleanupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Current resolved value as-is */ );
|
|
347
360
|
} );
|
|
348
361
|
record.entrants.forEach( entry => {
|
|
@@ -350,6 +363,8 @@ function realtime( config ) {
|
|
|
350
363
|
setupBinding( entry, attrName, () => entry.getAttribute( attrName )/* Raw value (as-is) that will be saved as original */ );
|
|
351
364
|
} );
|
|
352
365
|
}
|
|
366
|
+
namespaceNodesToTest.forID.clear();
|
|
367
|
+
namespaceNodesToTest.forOther.clear();
|
|
353
368
|
}, { live: true, subtree: 'cross-roots', timing: 'sync' } );
|
|
354
369
|
// Attr realtime
|
|
355
370
|
realdom.realtime( window.document, 'attr' ).observe( attrList, records => {
|