@webqit/oohtml 4.5.0 → 4.5.1

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.5.0",
17
+ "version": "4.5.1",
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.30",
42
+ "@webqit/quantum-js": "^4.5.31",
43
43
  "@webqit/realdom": "^2.1.34",
44
44
  "@webqit/util": "^0.8.16"
45
45
  },
@@ -99,7 +99,7 @@ function applyBindings( config, target, bindings, { merge, diff, publish, namesp
99
99
  const window = this, { webqit: { Observer } } = window;
100
100
  const bindingsObj = getBindings.call( this, config, target );
101
101
  const $params = { diff, namespace, detail: { publish } };
102
- const exitingKeys = merge ? [] : Object.keys( bindingsObj, $params ).filter( key => !( key in bindings ) );
102
+ const exitingKeys = merge ? [] : Object.keys( bindingsObj ).filter( key => !( key in bindings ) );
103
103
  return Observer.batch( bindingsObj, () => {
104
104
  if ( exitingKeys.length ) { Observer.deleteProperties( bindingsObj, exitingKeys, $params ); }
105
105
  return Observer.set( bindingsObj, bindings, $params );
@@ -155,8 +155,8 @@ const discreteParseCache = new Map;
155
155
  function compileDiscreteBindings( config, str ) {
156
156
  if ( discreteParseCache.has( str ) ) return discreteParseCache.get( str );
157
157
  let source = `let content = ((${ str }) ?? '') + '';`;
158
- source += `$assign__wq(this, 'nodeValue', content);`;
159
- source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__wq(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }" + content.length + "${ config.tokens.stateEnd } ${ config.tokens.tagEnd }"); }`;
158
+ source += `$assign__(this, 'nodeValue', content);`;
159
+ source += `if ( this.$oohtml_internal_databinding_anchorNode ) { $assign__(this.$oohtml_internal_databinding_anchorNode, 'nodeValue', "${ config.tokens.tagStart }${ escDouble( str ) }${ config.tokens.stateStart }" + content.length + "${ config.tokens.stateEnd } ${ config.tokens.tagEnd }"); }`;
160
160
  const { webqit: { QuantumModule } } = this;
161
161
  const { parserParams, compilerParams, runtimeParams } = config.advanced;
162
162
  const compiled = new QuantumModule( source, { parserParams, compilerParams, runtimeParams } );
@@ -189,22 +189,22 @@ function compileInlineBindings( config, str ) {
189
189
  const arg = `(${ right })`, $arg = `(${ arg } ?? '')`;
190
190
  // CSS
191
191
  if ( directive === '&' ) {
192
- if ( param.startsWith( '--' ) ) return `$exec__wq(this.style, 'setProperty', "${ escDouble( param ) }", ${ $arg });`;
193
- return `$assign__wq(this.style, "${ escDouble( param ) }", ${ $arg });`;
192
+ if ( param.startsWith( '--' ) ) return `$exec__(this.style, 'setProperty', "${ escDouble( param ) }", ${ $arg });`;
193
+ return `$assign__(this.style, "${ escDouble( param ) }", ${ $arg });`;
194
194
  }
195
195
  // Class list
196
- if ( directive === '%' ) return `$exec__wq(this.classList, 'toggle', "${ escDouble( param ) }", !!${ arg });`;
196
+ if ( directive === '%' ) return `$exec__(this.classList, 'toggle', "${ escDouble( param ) }", !!${ arg });`;
197
197
  // Attribute
198
198
  if ( directive === '~' ) {
199
- if ( param.startsWith( '?' ) ) return `$exec__wq(this, 'toggleAttribute', "${ escDouble( param.substring( 1 ).trim() ) }", !!${ arg });`;
200
- return `$exec__wq(this, 'setAttribute', "${ escDouble( param ) }", ${ $arg });`;
199
+ if ( param.startsWith( '?' ) ) return `$exec__(this, 'toggleAttribute', "${ escDouble( param.substring( 1 ).trim() ) }", !!${ arg });`;
200
+ return `$exec__(this, 'setAttribute', "${ escDouble( param ) }", ${ $arg });`;
201
201
  }
202
202
  // Structure
203
203
  if ( directive === '#' ) {
204
204
  if ( validation[ param ] ) throw new Error( `Duplicate binding: ${ left }.` );
205
205
  validation[ param ] = true;
206
- if ( param === 'text' ) return `$assign__wq(this, 'textContent', ${ $arg });`;
207
- if ( param === 'html' ) return `$assign__wq(this, 'innerHTML', ${ $arg });`;
206
+ if ( param === 'text' ) return `$assign__(this, 'textContent', ${ $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.` );
@@ -235,12 +235,12 @@ function compileInlineBindings( config, str ) {
235
235
  let $itemNode__ = $existing__.get( $key___ );
236
236
  if ( $itemNode__ ) {
237
237
  $existing__.delete( $key___ );
238
- $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );
238
+ $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );
239
239
  } else {
240
240
  $itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value instanceof window.HTMLTemplateElement ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );
241
241
  $itemNode__.setAttribute( "${ config.attr.itemIndex }", $key___ );
242
- $exec__wq($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );
243
- $exec__wq(this, 'appendChild', $itemNode__ );
242
+ $exec__($itemNode__, '${ config.BINDINGS_API.api.bind }', $itemBinding__ );
243
+ $exec__(this, 'appendChild', $itemNode__ );
244
244
  }
245
245
 
246
246
  if ( ${ kind === 'in' ? `!( ${ production[ 0 ] } in $iteratee__ )` : `typeof ${ production[ 0 ] } === 'undefined'` } ) { $itemNode__.remove(); }
@@ -262,7 +262,7 @@ function compileInlineBindings( config, str ) {
262
262
  }
263
263
  // Functions
264
264
  if ( directive === '$' ) {
265
- return `$exec__wq(this, '${ param }', ${ arg });`;
265
+ return `$exec__(this, '${ param }', ${ arg });`;
266
266
  }
267
267
  if ( str.trim() ) throw new Error( `Invalid binding: ${ str }.` );
268
268
  } ).join( `\n` );