@rindo/core 4.18.2 → 4.18.3

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.
Files changed (40) hide show
  1. package/cli/index.cjs +27 -12
  2. package/cli/index.js +27 -12
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/rindo.js +828 -662
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +52 -40
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/client/index.js +34 -16
  14. package/internal/client/package.json +1 -1
  15. package/internal/client/patch-browser.js +1 -1
  16. package/internal/hydrate/index.js +32 -16
  17. package/internal/hydrate/package.json +1 -1
  18. package/internal/hydrate/runner.js +66 -58
  19. package/internal/package.json +1 -1
  20. package/internal/rindo-private.d.ts +3 -3
  21. package/internal/rindo-public-compiler.d.ts +3 -3
  22. package/internal/testing/index.js +31 -15
  23. package/internal/testing/package.json +1 -1
  24. package/mock-doc/index.cjs +66 -58
  25. package/mock-doc/index.d.ts +36 -30
  26. package/mock-doc/index.js +66 -58
  27. package/mock-doc/package.json +1 -1
  28. package/package.json +14 -17
  29. package/screenshot/index.js +1 -1
  30. package/screenshot/package.json +1 -1
  31. package/screenshot/pixel-match.js +4 -1
  32. package/sys/node/autoprefixer.js +2 -2
  33. package/sys/node/glob.js +1 -1
  34. package/sys/node/index.js +2 -2
  35. package/sys/node/node-fetch.js +10 -2
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +6 -3
  39. package/testing/mock-fetch.d.ts +4 -4
  40. package/testing/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Client Platform v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Client Platform v4.18.3 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -885,6 +885,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
885
885
  if ((BUILD11.shadowDom || BUILD11.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
886
886
  elm.classList.add(elm["s-si"] = scopeId);
887
887
  }
888
+ if (BUILD11.scoped) {
889
+ updateElementScopeIds(elm, parentElm);
890
+ }
888
891
  if (newVNode2.$children$) {
889
892
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
890
893
  childNode = createElm(oldParentVNode, newVNode2, i2, elm);
@@ -1246,22 +1249,33 @@ var nullifyVNodeRefs = (vNode) => {
1246
1249
  var insertBefore = (parent, newNode, reference) => {
1247
1250
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1248
1251
  if (BUILD11.scoped) {
1249
- setParentScopeIdAsClassName(newNode, parent);
1252
+ updateElementScopeIds(newNode, parent);
1250
1253
  }
1251
1254
  return inserted;
1252
1255
  };
1253
- var findParentScopeId = (element) => {
1254
- return element ? element["s-rsc"] || element["s-si"] || element["s-sc"] || findParentScopeId(element.parentElement) : void 0;
1256
+ var findScopeIds = (element) => {
1257
+ const scopeIds = [];
1258
+ if (element) {
1259
+ scopeIds.push(
1260
+ ...element["s-scs"] || [],
1261
+ element["s-si"],
1262
+ element["s-sc"],
1263
+ ...findScopeIds(element.parentElement)
1264
+ );
1265
+ }
1266
+ return scopeIds;
1255
1267
  };
1256
- var setParentScopeIdAsClassName = (element, parent) => {
1257
- var _a, _b, _c;
1258
- if (element && parent) {
1259
- const oldRootScopeId = element["s-rsc"];
1260
- const newRootScopeId = findParentScopeId(parent);
1261
- oldRootScopeId && ((_a = element.classList) == null ? void 0 : _a.contains(oldRootScopeId)) && element.classList.remove(oldRootScopeId);
1262
- if (newRootScopeId) {
1263
- element["s-rsc"] = newRootScopeId;
1264
- !((_b = element.classList) == null ? void 0 : _b.contains(newRootScopeId)) && ((_c = element.classList) == null ? void 0 : _c.add(newRootScopeId));
1268
+ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1269
+ var _a;
1270
+ if (element && parent && element.nodeType === 1 /* ElementNode */) {
1271
+ const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
1272
+ if (scopeIds.size) {
1273
+ (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]);
1274
+ if (element["s-ol"] || iterateChildNodes) {
1275
+ for (const childNode of Array.from(element.childNodes)) {
1276
+ updateElementScopeIds(childNode, element, true);
1277
+ }
1278
+ }
1265
1279
  }
1266
1280
  }
1267
1281
  };
@@ -2075,7 +2089,7 @@ var patchCloneNode = (HostElementPrototype) => {
2075
2089
  "s-nr",
2076
2090
  "s-si",
2077
2091
  "s-rf",
2078
- "s-rsc"
2092
+ "s-scs"
2079
2093
  ];
2080
2094
  for (; i2 < srcNode.childNodes.length; i2++) {
2081
2095
  slotted = srcNode.childNodes[i2]["s-nr"];
@@ -2652,10 +2666,11 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2652
2666
  }
2653
2667
  };
2654
2668
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2669
+ var _a;
2655
2670
  try {
2656
2671
  if (BUILD21.lazyLoad) {
2657
2672
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2658
- hostRef.$lazyInstance$[methodName](ev);
2673
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2659
2674
  } else {
2660
2675
  (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2661
2676
  }
@@ -2670,7 +2685,8 @@ var getHostListenerTarget = (elm, flags) => {
2670
2685
  if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2671
2686
  if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2672
2687
  if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2673
- if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */) return elm.parentElement;
2688
+ if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2689
+ return elm.parentElement;
2674
2690
  return elm;
2675
2691
  };
2676
2692
  var hostListenerOpts = (flags) => supportsListenerOptions ? {
@@ -2874,6 +2890,8 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2874
2890
  `Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
2875
2891
  );
2876
2892
  return void 0;
2893
+ } else if (!bundleId) {
2894
+ return void 0;
2877
2895
  }
2878
2896
  const module = !BUILD24.hotModuleReplacement ? cmpModules.get(bundleId) : false;
2879
2897
  if (module) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/client",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Rindo internal client platform to be imported by the Rindo Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true,
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Client Patch Browser v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Client Patch Browser v4.18.3 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Platform v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Platform v4.18.3 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -874,6 +874,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
874
874
  if ((BUILD10.shadowDom || BUILD10.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
875
875
  elm.classList.add(elm["s-si"] = scopeId);
876
876
  }
877
+ if (BUILD10.scoped) {
878
+ updateElementScopeIds(elm, parentElm);
879
+ }
877
880
  if (newVNode2.$children$) {
878
881
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
879
882
  childNode = createElm(oldParentVNode, newVNode2, i2, elm);
@@ -1235,22 +1238,33 @@ var nullifyVNodeRefs = (vNode) => {
1235
1238
  var insertBefore = (parent, newNode, reference) => {
1236
1239
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1237
1240
  if (BUILD10.scoped) {
1238
- setParentScopeIdAsClassName(newNode, parent);
1241
+ updateElementScopeIds(newNode, parent);
1239
1242
  }
1240
1243
  return inserted;
1241
1244
  };
1242
- var findParentScopeId = (element) => {
1243
- return element ? element["s-rsc"] || element["s-si"] || element["s-sc"] || findParentScopeId(element.parentElement) : void 0;
1245
+ var findScopeIds = (element) => {
1246
+ const scopeIds = [];
1247
+ if (element) {
1248
+ scopeIds.push(
1249
+ ...element["s-scs"] || [],
1250
+ element["s-si"],
1251
+ element["s-sc"],
1252
+ ...findScopeIds(element.parentElement)
1253
+ );
1254
+ }
1255
+ return scopeIds;
1244
1256
  };
1245
- var setParentScopeIdAsClassName = (element, parent) => {
1246
- var _a, _b, _c;
1247
- if (element && parent) {
1248
- const oldRootScopeId = element["s-rsc"];
1249
- const newRootScopeId = findParentScopeId(parent);
1250
- oldRootScopeId && ((_a = element.classList) == null ? void 0 : _a.contains(oldRootScopeId)) && element.classList.remove(oldRootScopeId);
1251
- if (newRootScopeId) {
1252
- element["s-rsc"] = newRootScopeId;
1253
- !((_b = element.classList) == null ? void 0 : _b.contains(newRootScopeId)) && ((_c = element.classList) == null ? void 0 : _c.add(newRootScopeId));
1257
+ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1258
+ var _a;
1259
+ if (element && parent && element.nodeType === 1 /* ElementNode */) {
1260
+ const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
1261
+ if (scopeIds.size) {
1262
+ (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]);
1263
+ if (element["s-ol"] || iterateChildNodes) {
1264
+ for (const childNode of Array.from(element.childNodes)) {
1265
+ updateElementScopeIds(childNode, element, true);
1266
+ }
1267
+ }
1254
1268
  }
1255
1269
  }
1256
1270
  };
@@ -2064,7 +2078,7 @@ var patchCloneNode = (HostElementPrototype) => {
2064
2078
  "s-nr",
2065
2079
  "s-si",
2066
2080
  "s-rf",
2067
- "s-rsc"
2081
+ "s-scs"
2068
2082
  ];
2069
2083
  for (; i2 < srcNode.childNodes.length; i2++) {
2070
2084
  slotted = srcNode.childNodes[i2]["s-nr"];
@@ -2641,10 +2655,11 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2641
2655
  }
2642
2656
  };
2643
2657
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2658
+ var _a;
2644
2659
  try {
2645
2660
  if (BUILD20.lazyLoad) {
2646
2661
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2647
- hostRef.$lazyInstance$[methodName](ev);
2662
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2648
2663
  } else {
2649
2664
  (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2650
2665
  }
@@ -2659,7 +2674,8 @@ var getHostListenerTarget = (elm, flags) => {
2659
2674
  if (BUILD20.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2660
2675
  if (BUILD20.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2661
2676
  if (BUILD20.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2662
- if (BUILD20.hostListenerTargetParent && flags & 32 /* TargetParent */) return elm.parentElement;
2677
+ if (BUILD20.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2678
+ return elm.parentElement;
2663
2679
  return elm;
2664
2680
  };
2665
2681
  var hostListenerOpts = (flags) => supportsListenerOptions ? {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/hydrate",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Rindo internal hydrate platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Runner v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Runner v4.18.3 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -12329,67 +12329,75 @@ var MockUListElement = class extends MockHTMLElement {
12329
12329
  super(ownerDocument, "ul");
12330
12330
  }
12331
12331
  };
12332
+ var CanvasRenderingContext = class {
12333
+ constructor(context, contextAttributes) {
12334
+ this.context = context;
12335
+ this.contextAttributes = contextAttributes;
12336
+ }
12337
+ fillRect() {
12338
+ return;
12339
+ }
12340
+ clearRect() {
12341
+ }
12342
+ getImageData(_, __, w, h) {
12343
+ return {
12344
+ data: new Array(w * h * 4)
12345
+ };
12346
+ }
12347
+ toDataURL() {
12348
+ return "data:,";
12349
+ }
12350
+ putImageData() {
12351
+ }
12352
+ createImageData() {
12353
+ return {};
12354
+ }
12355
+ setTransform() {
12356
+ }
12357
+ drawImage() {
12358
+ }
12359
+ save() {
12360
+ }
12361
+ fillText() {
12362
+ }
12363
+ restore() {
12364
+ }
12365
+ beginPath() {
12366
+ }
12367
+ moveTo() {
12368
+ }
12369
+ lineTo() {
12370
+ }
12371
+ closePath() {
12372
+ }
12373
+ stroke() {
12374
+ }
12375
+ translate() {
12376
+ }
12377
+ scale() {
12378
+ }
12379
+ rotate() {
12380
+ }
12381
+ arc() {
12382
+ }
12383
+ fill() {
12384
+ }
12385
+ measureText() {
12386
+ return { width: 0 };
12387
+ }
12388
+ transform() {
12389
+ }
12390
+ rect() {
12391
+ }
12392
+ clip() {
12393
+ }
12394
+ };
12332
12395
  var MockCanvasElement = class extends MockHTMLElement {
12333
12396
  constructor(ownerDocument) {
12334
12397
  super(ownerDocument, "canvas");
12335
12398
  }
12336
- getContext() {
12337
- return {
12338
- fillRect() {
12339
- return;
12340
- },
12341
- clearRect() {
12342
- },
12343
- getImageData: function(_, __, w, h) {
12344
- return {
12345
- data: new Array(w * h * 4)
12346
- };
12347
- },
12348
- putImageData() {
12349
- },
12350
- createImageData: function() {
12351
- return [];
12352
- },
12353
- setTransform() {
12354
- },
12355
- drawImage() {
12356
- },
12357
- save() {
12358
- },
12359
- fillText() {
12360
- },
12361
- restore() {
12362
- },
12363
- beginPath() {
12364
- },
12365
- moveTo() {
12366
- },
12367
- lineTo() {
12368
- },
12369
- closePath() {
12370
- },
12371
- stroke() {
12372
- },
12373
- translate() {
12374
- },
12375
- scale() {
12376
- },
12377
- rotate() {
12378
- },
12379
- arc() {
12380
- },
12381
- fill() {
12382
- },
12383
- measureText() {
12384
- return { width: 0 };
12385
- },
12386
- transform() {
12387
- },
12388
- rect() {
12389
- },
12390
- clip() {
12391
- }
12392
- };
12399
+ getContext(context, contextAttributes) {
12400
+ return new CanvasRenderingContext(context, contextAttributes);
12393
12401
  }
12394
12402
  };
12395
12403
  function fullUrl(elm, attrName) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Rindo internals only to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -964,11 +964,11 @@ export interface HostElement extends HTMLElement {
964
964
  */
965
965
  ['s-sc']?: string;
966
966
  /**
967
- * Root Scope Id
968
- * The scope id of the root component when using scoped css encapsulation
967
+ * Scope Ids
968
+ * All the possible scope ids of this component when using scoped css encapsulation
969
969
  * or using shadow dom but the browser doesn't support it
970
970
  */
971
- ['s-rsc']?: string;
971
+ ['s-scs']?: string[];
972
972
  /**
973
973
  * Hot Module Replacement, dev mode only
974
974
  *
@@ -2370,9 +2370,9 @@ export interface ResolveModuleOptions {
2370
2370
  }
2371
2371
  export interface PrerenderStartOptions {
2372
2372
  buildId?: string;
2373
- hydrateAppFilePath: string;
2374
- componentGraph: BuildResultsComponentGraph;
2375
- srcIndexHtmlPath: string;
2373
+ hydrateAppFilePath?: string;
2374
+ componentGraph?: BuildResultsComponentGraph;
2375
+ srcIndexHtmlPath?: string;
2376
2376
  }
2377
2377
  export interface PrerenderResults {
2378
2378
  buildId: string;
@@ -979,6 +979,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
979
979
  if ((import_app_data10.BUILD.shadowDom || import_app_data10.BUILD.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
980
980
  elm.classList.add(elm["s-si"] = scopeId);
981
981
  }
982
+ if (import_app_data10.BUILD.scoped) {
983
+ updateElementScopeIds(elm, parentElm);
984
+ }
982
985
  if (newVNode2.$children$) {
983
986
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
984
987
  childNode = createElm(oldParentVNode, newVNode2, i2, elm);
@@ -1340,22 +1343,33 @@ var nullifyVNodeRefs = (vNode) => {
1340
1343
  var insertBefore = (parent, newNode, reference) => {
1341
1344
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1342
1345
  if (import_app_data10.BUILD.scoped) {
1343
- setParentScopeIdAsClassName(newNode, parent);
1346
+ updateElementScopeIds(newNode, parent);
1344
1347
  }
1345
1348
  return inserted;
1346
1349
  };
1347
- var findParentScopeId = (element) => {
1348
- return element ? element["s-rsc"] || element["s-si"] || element["s-sc"] || findParentScopeId(element.parentElement) : void 0;
1350
+ var findScopeIds = (element) => {
1351
+ const scopeIds = [];
1352
+ if (element) {
1353
+ scopeIds.push(
1354
+ ...element["s-scs"] || [],
1355
+ element["s-si"],
1356
+ element["s-sc"],
1357
+ ...findScopeIds(element.parentElement)
1358
+ );
1359
+ }
1360
+ return scopeIds;
1349
1361
  };
1350
- var setParentScopeIdAsClassName = (element, parent) => {
1351
- var _a, _b, _c;
1352
- if (element && parent) {
1353
- const oldRootScopeId = element["s-rsc"];
1354
- const newRootScopeId = findParentScopeId(parent);
1355
- oldRootScopeId && ((_a = element.classList) == null ? void 0 : _a.contains(oldRootScopeId)) && element.classList.remove(oldRootScopeId);
1356
- if (newRootScopeId) {
1357
- element["s-rsc"] = newRootScopeId;
1358
- !((_b = element.classList) == null ? void 0 : _b.contains(newRootScopeId)) && ((_c = element.classList) == null ? void 0 : _c.add(newRootScopeId));
1362
+ var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
1363
+ var _a;
1364
+ if (element && parent && element.nodeType === 1 /* ElementNode */) {
1365
+ const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
1366
+ if (scopeIds.size) {
1367
+ (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = [...scopeIds]);
1368
+ if (element["s-ol"] || iterateChildNodes) {
1369
+ for (const childNode of Array.from(element.childNodes)) {
1370
+ updateElementScopeIds(childNode, element, true);
1371
+ }
1372
+ }
1359
1373
  }
1360
1374
  }
1361
1375
  };
@@ -2169,7 +2183,7 @@ var patchCloneNode = (HostElementPrototype) => {
2169
2183
  "s-nr",
2170
2184
  "s-si",
2171
2185
  "s-rf",
2172
- "s-rsc"
2186
+ "s-scs"
2173
2187
  ];
2174
2188
  for (; i2 < srcNode.childNodes.length; i2++) {
2175
2189
  slotted = srcNode.childNodes[i2]["s-nr"];
@@ -2746,10 +2760,11 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2746
2760
  }
2747
2761
  };
2748
2762
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2763
+ var _a;
2749
2764
  try {
2750
2765
  if (import_app_data20.BUILD.lazyLoad) {
2751
2766
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2752
- hostRef.$lazyInstance$[methodName](ev);
2767
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2753
2768
  } else {
2754
2769
  (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2755
2770
  }
@@ -2764,7 +2779,8 @@ var getHostListenerTarget = (elm, flags) => {
2764
2779
  if (import_app_data20.BUILD.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2765
2780
  if (import_app_data20.BUILD.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2766
2781
  if (import_app_data20.BUILD.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2767
- if (import_app_data20.BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */) return elm.parentElement;
2782
+ if (import_app_data20.BUILD.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2783
+ return elm.parentElement;
2768
2784
  return elm;
2769
2785
  };
2770
2786
  var hostListenerOpts = (flags) => supportsListenerOptions ? {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rindo/core/internal/testing",
3
- "version": "4.18.2",
3
+ "version": "4.18.3",
4
4
  "description": "Rindo internal testing platform to be imported by the Rindo Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Rindo Mock Doc (CommonJS) v4.18.2 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Mock Doc (CommonJS) v4.18.3 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
@@ -8202,67 +8202,75 @@ var MockUListElement = class extends MockHTMLElement {
8202
8202
  super(ownerDocument, "ul");
8203
8203
  }
8204
8204
  };
8205
+ var CanvasRenderingContext = class {
8206
+ constructor(context, contextAttributes) {
8207
+ this.context = context;
8208
+ this.contextAttributes = contextAttributes;
8209
+ }
8210
+ fillRect() {
8211
+ return;
8212
+ }
8213
+ clearRect() {
8214
+ }
8215
+ getImageData(_, __, w, h) {
8216
+ return {
8217
+ data: new Array(w * h * 4)
8218
+ };
8219
+ }
8220
+ toDataURL() {
8221
+ return "data:,";
8222
+ }
8223
+ putImageData() {
8224
+ }
8225
+ createImageData() {
8226
+ return {};
8227
+ }
8228
+ setTransform() {
8229
+ }
8230
+ drawImage() {
8231
+ }
8232
+ save() {
8233
+ }
8234
+ fillText() {
8235
+ }
8236
+ restore() {
8237
+ }
8238
+ beginPath() {
8239
+ }
8240
+ moveTo() {
8241
+ }
8242
+ lineTo() {
8243
+ }
8244
+ closePath() {
8245
+ }
8246
+ stroke() {
8247
+ }
8248
+ translate() {
8249
+ }
8250
+ scale() {
8251
+ }
8252
+ rotate() {
8253
+ }
8254
+ arc() {
8255
+ }
8256
+ fill() {
8257
+ }
8258
+ measureText() {
8259
+ return { width: 0 };
8260
+ }
8261
+ transform() {
8262
+ }
8263
+ rect() {
8264
+ }
8265
+ clip() {
8266
+ }
8267
+ };
8205
8268
  var MockCanvasElement = class extends MockHTMLElement {
8206
8269
  constructor(ownerDocument) {
8207
8270
  super(ownerDocument, "canvas");
8208
8271
  }
8209
- getContext() {
8210
- return {
8211
- fillRect() {
8212
- return;
8213
- },
8214
- clearRect() {
8215
- },
8216
- getImageData: function(_, __, w, h) {
8217
- return {
8218
- data: new Array(w * h * 4)
8219
- };
8220
- },
8221
- putImageData() {
8222
- },
8223
- createImageData: function() {
8224
- return [];
8225
- },
8226
- setTransform() {
8227
- },
8228
- drawImage() {
8229
- },
8230
- save() {
8231
- },
8232
- fillText() {
8233
- },
8234
- restore() {
8235
- },
8236
- beginPath() {
8237
- },
8238
- moveTo() {
8239
- },
8240
- lineTo() {
8241
- },
8242
- closePath() {
8243
- },
8244
- stroke() {
8245
- },
8246
- translate() {
8247
- },
8248
- scale() {
8249
- },
8250
- rotate() {
8251
- },
8252
- arc() {
8253
- },
8254
- fill() {
8255
- },
8256
- measureText() {
8257
- return { width: 0 };
8258
- },
8259
- transform() {
8260
- },
8261
- rect() {
8262
- },
8263
- clip() {
8264
- }
8265
- };
8272
+ getContext(context, contextAttributes) {
8273
+ return new CanvasRenderingContext(context, contextAttributes);
8266
8274
  }
8267
8275
  };
8268
8276
  function fullUrl(elm, attrName) {