@webqit/oohtml 2.1.40 → 2.1.42

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.
@@ -18,16 +18,15 @@ import { _, _init } from '../util.js';
18
18
  */
19
19
  export default function init( $config = {} ) {
20
20
  const { config, realdom, window } = _init.call( this, 'html-imports', $config, {
21
- export: { attr: { exportid: 'def' }, },
22
- template: { attr: { exportid: 'def', extends: 'extends', inherits: 'inherits' }, api: { modules: 'modules', exportid: 'exportid' }, },
23
- context: { attr: { importscontext: 'importscontext', contextname: 'contextname' }, api: { modules: 'modules' }, },
21
+ template: { attr: { moduledef: 'def', fragmentdef: 'def', extends: 'extends', inherits: 'inherits' }, api: { modules: 'modules', moduledef: 'def' }, },
22
+ context: { attr: { importscontext: 'importscontext', contextname: 'contextname' }, api: { import: 'import' }, },
24
23
  import: { tagName: 'import', attr: { moduleref: 'ref' }, },
25
24
  staticsensitivity: true,
26
25
  isomorphic: true,
27
26
  } );
28
- config.templateSelector = `template[${ window.CSS.escape( config.template.attr.exportid ) }]`;
27
+ config.templateSelector = `template[${ window.CSS.escape( config.template.attr.moduledef ) }]`;
29
28
  config.ownerContextSelector = [ config.context.attr.contextname, config.context.attr.importscontext ].map( a => `[${ window.CSS.escape( a ) }]` ).join( ',' );
30
- config.slottedElementsSelector = `[${ window.CSS.escape( config.export.attr.exportid ) }]`;
29
+ config.slottedElementsSelector = `[${ window.CSS.escape( config.template.attr.fragmentdef ) }]`;
31
30
  window.webqit.HTMLImportElement = _HTMLImportElement.call( window, config );
32
31
  window.webqit.HTMLImportsProvider = class extends _HTMLImportsProvider {
33
32
  static get config() { return config; }
@@ -67,15 +66,15 @@ function exposeModulesObjects( config ) {
67
66
  const window = this;
68
67
  // Assertions
69
68
  if ( config.template.api.modules in window.HTMLTemplateElement.prototype ) { throw new Error( `The "HTMLTemplateElement" class already has a "${ config.template.api.modules }" property!` ); }
70
- if ( config.template.api.exportid in window.HTMLTemplateElement.prototype ) { throw new Error( `The "HTMLTemplateElement" class already has a "${ config.template.api.exportid }" property!` ); }
69
+ if ( config.template.api.moduledef in window.HTMLTemplateElement.prototype ) { throw new Error( `The "HTMLTemplateElement" class already has a "${ config.template.api.moduledef }" property!` ); }
71
70
  if ( config.context.api.import in window.document ) { throw new Error( `document already has a "${ config.context.api.import }" property!` ); }
72
71
  if ( config.context.api.import in window.HTMLElement.prototype ) { throw new Error( `The "HTMLElement" class already has a "${ config.context.api.import }" property!` ); }
73
72
  // Definitions
74
73
  Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.modules, { get: function() {
75
74
  return getModulesObject( this );
76
75
  } } );
77
- Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.exportid, { get: function() {
78
- return this.getAttribute( config.template.attr.exportid );
76
+ Object.defineProperty( window.HTMLTemplateElement.prototype, config.template.api.moduledef, { get: function() {
77
+ return this.getAttribute( config.template.attr.moduledef );
79
78
  } } );
80
79
  Object.defineProperty( window.document, config.context.api.import, { value: function( ref, callback, options = {} ) {
81
80
  return importRequest( window.document, ref, callback, options );
@@ -30,6 +30,7 @@ export default function init( { advanced = {}, ...$config } ) {
30
30
  function realtime( config ) {
31
31
  const window = this, { realdom } = window.webqit;
32
32
  if ( !window.HTMLScriptElement.supports ) { window.HTMLScriptElement.supports = () => false; }
33
+ const handled = () => {};
33
34
  realdom.realtime( window.document ).subtree/*instead of observe(); reason: jsdom timing*/( config.styleSelector, record => {
34
35
  record.entrants.forEach( style => {
35
36
  if ( 'scoped' in style ) return handled( style );