@webqit/oohtml 2.1.44 → 2.1.45

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": "2.1.44",
17
+ "version": "2.1.45",
18
18
  "license": "MIT",
19
19
  "repository": {
20
20
  "type": "git",
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@webqit/observer": "^2.1.4",
42
- "@webqit/realdom": "^2.1.11",
43
- "@webqit/subscript": "^2.1.40",
42
+ "@webqit/realdom": "^2.1.12",
43
+ "@webqit/subscript": "^2.1.41",
44
44
  "@webqit/util": "^0.8.11"
45
45
  },
46
46
  "devDependencies": {
@@ -51,29 +51,28 @@ export function execute( compiledScript, thisContext, script ) {
51
51
  // Rerending processes,,,
52
52
  Object.defineProperty( script, 'rerender', { value: ( ...args ) => _await( returnValue, ( [ , rerender ] ) => rerender( ...args ) ) } );
53
53
  _await( script.properties, properties => {
54
+ const _env = { 'this': thisContext };
55
+ const getPaths = ( base, record_s ) => ( Array.isArray( record_s ) ? record_s : [ record_s ] ).map( record => [ ...base, ...( record.path || [ record.key ] ) ] );
54
56
  properties.processes = properties.dependencies.map( path => {
55
- const _env = { 'this': thisContext, 'globalThis': globalThis, 'window': globalThis.window, 'self': globalThis.self };
56
- const getPaths = ( base, record_s ) => ( Array.isArray( record_s ) ? record_s : [ record_s ] ).map( record => [ ...base, ...( record.path || [ record.key ] ) ] );
57
- properties.processes = properties.dependencies.map( path => {
58
- if ( _isTypeObject( _env[ path[ 0 ] ] ) ) {
59
- if ( path.length === 1 ) return;
60
- return Observer.deep( _env[ path[ 0 ] ], path.slice( 1 ), Observer.observe, record_s => {
61
- script.rerender( ...getPaths( [ path[ 0 ] ], record_s ) );
62
- } );
63
- }
64
- return Observer.deep( globalThis, path, Observer.observe, record_s => {
65
- script.rerender( ...getPaths( [], record_s ) );
57
+ if ( _isTypeObject( _env[ path[ 0 ] ] ) ) {
58
+ if ( path.length === 1 ) return;
59
+ return Observer.deep( _env[ path[ 0 ] ], path.slice( 1 ), Observer.observe, record_s => {
60
+ script.rerender( ...getPaths( [ path[ 0 ] ], record_s ) );
66
61
  } );
62
+ }
63
+ return Observer.deep( globalThis, path, Observer.observe, record_s => {
64
+ script.rerender( ...getPaths( [], record_s ) );
67
65
  } );
68
66
  } );
69
67
  } );
70
68
  }
71
69
  const window = this, { realdom } = window.webqit;
70
+ if ( !( thisContext instanceof window.Node ) ) return script;
72
71
  realdom.realtime( window.document ).observe( thisContext, () => {
73
72
  if ( script.contract ) {
74
73
  // Rerending processes,,,
75
74
  _await( script.properties, properties => {
76
- properties.processes.forEach( process => process.abort() );
75
+ properties.processes.forEach( process => process?.abort() );
77
76
  } );
78
77
  }
79
78
  thisContext.dispatchEvent( new window.CustomEvent( 'remove' ) );