@webqit/oohtml 4.3.14 → 4.3.16

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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "wicg-proposal"
15
15
  ],
16
16
  "homepage": "https://webqit.io/tooling/oohtml",
17
- "version": "4.3.14",
17
+ "version": "4.3.16",
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.26",
42
+ "@webqit/quantum-js": "^4.5.27",
43
43
  "@webqit/realdom": "^2.1.33",
44
44
  "@webqit/util": "^0.8.11"
45
45
  },
@@ -204,7 +204,7 @@ function compileInlineBindings( config, str ) {
204
204
  if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );
205
205
  validation[ param ] = true;
206
206
  if ( param === 'text' ) return `$assign__(this, 'textContent', ${ $arg });`;
207
- if ( param === 'html' ) return `$exec__(this, 'setHTMLUnsafe', ${ $arg });`;
207
+ if ( param === 'html' ) return `$assign__(this, 'innerHTML', ${ $arg });`;
208
208
  if ( param === 'items' ) {
209
209
  const [ iterationSpec, importSpec ] = _splitOuter( right, '/' );
210
210
  if ( !importSpec ) throw new Error( `Invalid ${ directive }items spec: ${ str }; no import specifier.` );
@@ -91,12 +91,13 @@ async function execute( config, execHash ) {
91
91
  * @return Void
92
92
  */
93
93
  function realtime( config ) {
94
+ const inBrowser = Object.getOwnPropertyDescriptor( globalThis, 'window' )?.get?.toString().includes( '[native code]' ) ?? false;
94
95
  const window = this, { webqit: { oohtml, realdom } } = window;
95
96
  if ( !window.HTMLScriptElement.supports ) { window.HTMLScriptElement.supports = type => [ 'text/javascript', 'application/javascript' ].includes( type ); }
96
97
  const handled = new WeakSet;
97
98
  realdom.realtime( window.document ).query( config.scriptSelector, record => {
98
99
  record.entrants.forEach( script => {
99
- if ( handled.has( script ) ) return;
100
+ if ( handled.has( script ) || (!inBrowser && !script.hasAttribute('ssr')) ) return;
100
101
  // Do compilation
101
102
  const compiledScript = compileScript.call( window, config, script );
102
103
  if ( !compiledScript ) return;
@@ -13,7 +13,7 @@ describe(`Test: Scoped JS`, function() {
13
13
  const head = ``;
14
14
  const body = `
15
15
  <h1>Hello World!</h1>
16
- <script scoped quantum>
16
+ <script scoped quantum ssr>
17
17
  testRecords.push( this );
18
18
  console.log('-------scoped JS here.', this);
19
19
  </script>`;