@stencil/core 4.35.1-dev.1750395747.dcb189d → 4.35.1-dev.1750455125.b359bb3
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +4 -4
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +148 -4
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +148 -4
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/testing/index.js +147 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +8 -8
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.35.1-dev.
|
|
2
|
+
Stencil Hydrate Platform v4.35.1-dev.1750455125.b359bb3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -411,8 +411,19 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
411
411
|
};
|
|
412
412
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
413
413
|
function patchSlotNode(node) {
|
|
414
|
-
|
|
414
|
+
console.log("\u{1F527} patchSlotNode called for:", node);
|
|
415
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) {
|
|
416
|
+
console.log("\u274C patchSlotNode: already patched or not a slot reference");
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
console.log("\u2705 patchSlotNode: proceeding with patching");
|
|
415
420
|
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
421
|
+
var _a, _b;
|
|
422
|
+
console.log("\u{1F3ED} assignedFactory called:", {
|
|
423
|
+
elementsOnly,
|
|
424
|
+
slotName: this["s-sn"],
|
|
425
|
+
parentElement: (_b = (_a = this["s-cr"]) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.tagName
|
|
426
|
+
});
|
|
416
427
|
const toReturn = [];
|
|
417
428
|
const slotName = this["s-sn"];
|
|
418
429
|
if (opts == null ? void 0 : opts.flatten) {
|
|
@@ -424,11 +435,30 @@ function patchSlotNode(node) {
|
|
|
424
435
|
}
|
|
425
436
|
const parent = this["s-cr"].parentElement;
|
|
426
437
|
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
438
|
+
console.log("\u{1F50D} Processing slotted nodes:", {
|
|
439
|
+
count: slottedNodes.length,
|
|
440
|
+
nodes: Array.from(slottedNodes).map((n) => ({ tagName: n.tagName, nodeType: n.nodeType }))
|
|
441
|
+
});
|
|
427
442
|
slottedNodes.forEach((n) => {
|
|
443
|
+
console.log("\u{1F50D} Checking node:", {
|
|
444
|
+
tagName: n.tagName,
|
|
445
|
+
nodeType: n.nodeType,
|
|
446
|
+
slotName: getSlotName(n),
|
|
447
|
+
targetSlotName: slotName
|
|
448
|
+
});
|
|
428
449
|
if (slotName === getSlotName(n)) {
|
|
450
|
+
console.log("\u2705 Node matches slot, adding to return array");
|
|
429
451
|
toReturn.push(n);
|
|
452
|
+
patchSlottedShadowDomEvents(n, parent);
|
|
453
|
+
} else {
|
|
454
|
+
console.log("\u274C Node does not match slot");
|
|
430
455
|
}
|
|
431
456
|
});
|
|
457
|
+
console.log("\u{1F3ED} assignedFactory returning:", {
|
|
458
|
+
count: toReturn.length,
|
|
459
|
+
elementsOnly,
|
|
460
|
+
nodes: toReturn.map((n) => ({ tagName: n.tagName, nodeType: n.nodeType }))
|
|
461
|
+
});
|
|
432
462
|
if (elementsOnly) {
|
|
433
463
|
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
434
464
|
}
|
|
@@ -437,6 +467,70 @@ function patchSlotNode(node) {
|
|
|
437
467
|
node.assignedElements = assignedFactory(true);
|
|
438
468
|
node.assignedNodes = assignedFactory(false);
|
|
439
469
|
}
|
|
470
|
+
function patchSlottedShadowDomEvents(slottedNode, parentHost) {
|
|
471
|
+
var _a, _b, _c;
|
|
472
|
+
console.log("\u{1F50D} patchSlottedShadowDomEvents called:", {
|
|
473
|
+
slottedNode: slottedNode.tagName,
|
|
474
|
+
parentHost: parentHost.tagName,
|
|
475
|
+
nodeType: slottedNode.nodeType,
|
|
476
|
+
isElement: slottedNode.nodeType === 1 /* ElementNode */
|
|
477
|
+
});
|
|
478
|
+
if (slottedNode.nodeType !== 1 /* ElementNode */) {
|
|
479
|
+
console.log("\u274C Not an element node, skipping");
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const element = slottedNode;
|
|
483
|
+
console.log("\u{1F50D} Element details:", {
|
|
484
|
+
tagName: element.tagName,
|
|
485
|
+
hasHyphen: (_a = element.tagName) == null ? void 0 : _a.includes("-"),
|
|
486
|
+
hasShadowRoot: !!element.shadowRoot,
|
|
487
|
+
parentHasShadowRoot: !!parentHost.shadowRoot
|
|
488
|
+
});
|
|
489
|
+
if (!((_b = element.tagName) == null ? void 0 : _b.includes("-")) || !element.shadowRoot || parentHost.shadowRoot) {
|
|
490
|
+
console.log("\u274C Conditions not met for patching:", {
|
|
491
|
+
hasHyphen: (_c = element.tagName) == null ? void 0 : _c.includes("-"),
|
|
492
|
+
hasShadowRoot: !!element.shadowRoot,
|
|
493
|
+
parentHasShadowRoot: !!parentHost.shadowRoot
|
|
494
|
+
});
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
if (element.__stencilSlotEventPatched) {
|
|
498
|
+
console.log("\u26A0\uFE0F Already patched, skipping");
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
console.log("\u2705 Patching element:", element.tagName);
|
|
502
|
+
element.__stencilSlotEventPatched = true;
|
|
503
|
+
const originalDispatchEvent = element.dispatchEvent;
|
|
504
|
+
element.dispatchEvent = function(event) {
|
|
505
|
+
var _a2;
|
|
506
|
+
console.log("\u{1F3AF} dispatchEvent called:", {
|
|
507
|
+
type: event.type,
|
|
508
|
+
target: (_a2 = event.target) == null ? void 0 : _a2.tagName,
|
|
509
|
+
bubbles: event.bubbles,
|
|
510
|
+
composed: event.composed
|
|
511
|
+
});
|
|
512
|
+
if ((event.type === "focus" || event.type === "blur") && event.bubbles) {
|
|
513
|
+
console.log("\u{1F6D1} Intercepting focus/blur event, creating non-bubbling version");
|
|
514
|
+
const nonBubblingEvent = new event.constructor(event.type, {
|
|
515
|
+
...event,
|
|
516
|
+
bubbles: false,
|
|
517
|
+
composed: event.composed
|
|
518
|
+
});
|
|
519
|
+
Object.keys(event).forEach((key) => {
|
|
520
|
+
if (key !== "bubbles" && key !== "type") {
|
|
521
|
+
try {
|
|
522
|
+
nonBubblingEvent[key] = event[key];
|
|
523
|
+
} catch (e) {
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
console.log("\u{1F4E4} Dispatching non-bubbling event");
|
|
528
|
+
return originalDispatchEvent.call(this, nonBubblingEvent);
|
|
529
|
+
}
|
|
530
|
+
console.log("\u{1F4E4} Dispatching original event");
|
|
531
|
+
return originalDispatchEvent.call(this, event);
|
|
532
|
+
};
|
|
533
|
+
}
|
|
440
534
|
function dispatchSlotChangeEvent(elm) {
|
|
441
535
|
elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
|
|
442
536
|
}
|
|
@@ -781,17 +875,67 @@ var patchPreviousElementSibling = (element) => {
|
|
|
781
875
|
});
|
|
782
876
|
};
|
|
783
877
|
var patchParentNode = (node) => {
|
|
878
|
+
var _a;
|
|
784
879
|
if (!node || node.__parentNode) return;
|
|
785
880
|
patchHostOriginalAccessor("parentNode", node);
|
|
786
881
|
Object.defineProperty(node, "parentNode", {
|
|
787
882
|
get: function() {
|
|
788
|
-
var
|
|
789
|
-
return ((
|
|
883
|
+
var _a2;
|
|
884
|
+
return ((_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode) || this.__parentNode;
|
|
790
885
|
},
|
|
791
886
|
set: function(value) {
|
|
792
887
|
this.__parentNode = value;
|
|
793
888
|
}
|
|
794
889
|
});
|
|
890
|
+
if (node.nodeType === 1 /* ELEMENT_NODE */) {
|
|
891
|
+
const element = node;
|
|
892
|
+
if (((_a = element.tagName) == null ? void 0 : _a.includes("-")) && element.shadowRoot) {
|
|
893
|
+
if (BUILD4.isDev) {
|
|
894
|
+
console.log("\u{1F527} Patching focus method for slotted shadow DOM element:", element.tagName);
|
|
895
|
+
}
|
|
896
|
+
const originalFocus = element.focus.bind(element);
|
|
897
|
+
const originalDispatchEvent = element.dispatchEvent.bind(element);
|
|
898
|
+
const originalAddEventListener = element.addEventListener.bind(element);
|
|
899
|
+
let lastFocusTime = 0;
|
|
900
|
+
const blurSuppressionWindow = 200;
|
|
901
|
+
const blurListeners = [];
|
|
902
|
+
element.focus = function(options) {
|
|
903
|
+
lastFocusTime = Date.now();
|
|
904
|
+
originalFocus(options);
|
|
905
|
+
};
|
|
906
|
+
element.addEventListener = function(type, listener, options) {
|
|
907
|
+
if (type === "blur") {
|
|
908
|
+
const wrappedListener = function(event) {
|
|
909
|
+
const now = Date.now();
|
|
910
|
+
const timeSinceFocus = now - lastFocusTime;
|
|
911
|
+
if (timeSinceFocus < blurSuppressionWindow && lastFocusTime > 0) {
|
|
912
|
+
if (BUILD4.isDev) {
|
|
913
|
+
console.log("\u{1F6D1} Suppressing erroneous blur event - happened too soon after focus");
|
|
914
|
+
}
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
listener.call(this, event);
|
|
918
|
+
};
|
|
919
|
+
blurListeners.push({ listener, options });
|
|
920
|
+
return originalAddEventListener.call(this, type, wrappedListener, options);
|
|
921
|
+
}
|
|
922
|
+
return originalAddEventListener.call(this, type, listener, options);
|
|
923
|
+
};
|
|
924
|
+
element.dispatchEvent = function(event) {
|
|
925
|
+
if (event.type === "blur") {
|
|
926
|
+
const now = Date.now();
|
|
927
|
+
const timeSinceFocus = now - lastFocusTime;
|
|
928
|
+
if (timeSinceFocus < blurSuppressionWindow && lastFocusTime > 0) {
|
|
929
|
+
if (BUILD4.isDev) {
|
|
930
|
+
console.log("\u{1F6D1} Preventing erroneous blur dispatchEvent - happened too soon after focus");
|
|
931
|
+
}
|
|
932
|
+
return true;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return originalDispatchEvent(event);
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
}
|
|
795
939
|
};
|
|
796
940
|
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
797
941
|
var validNodesPatches = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "4.35.1-dev.
|
|
3
|
+
"version": "4.35.1-dev.1750455125.b359bb3",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil 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
|
-
Stencil Hydrate Runner v4.35.1-dev.
|
|
2
|
+
Stencil Hydrate Runner v4.35.1-dev.1750455125.b359bb3 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "4.35.1-dev.
|
|
3
|
+
"version": "4.35.1-dev.1750455125.b359bb3",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -756,8 +756,19 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
756
756
|
};
|
|
757
757
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
758
758
|
function patchSlotNode(node) {
|
|
759
|
-
|
|
759
|
+
console.log("\u{1F527} patchSlotNode called for:", node);
|
|
760
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) {
|
|
761
|
+
console.log("\u274C patchSlotNode: already patched or not a slot reference");
|
|
762
|
+
return;
|
|
763
|
+
}
|
|
764
|
+
console.log("\u2705 patchSlotNode: proceeding with patching");
|
|
760
765
|
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
766
|
+
var _a, _b;
|
|
767
|
+
console.log("\u{1F3ED} assignedFactory called:", {
|
|
768
|
+
elementsOnly,
|
|
769
|
+
slotName: this["s-sn"],
|
|
770
|
+
parentElement: (_b = (_a = this["s-cr"]) == null ? void 0 : _a.parentElement) == null ? void 0 : _b.tagName
|
|
771
|
+
});
|
|
761
772
|
const toReturn = [];
|
|
762
773
|
const slotName = this["s-sn"];
|
|
763
774
|
if (opts == null ? void 0 : opts.flatten) {
|
|
@@ -769,11 +780,30 @@ function patchSlotNode(node) {
|
|
|
769
780
|
}
|
|
770
781
|
const parent = this["s-cr"].parentElement;
|
|
771
782
|
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
783
|
+
console.log("\u{1F50D} Processing slotted nodes:", {
|
|
784
|
+
count: slottedNodes.length,
|
|
785
|
+
nodes: Array.from(slottedNodes).map((n) => ({ tagName: n.tagName, nodeType: n.nodeType }))
|
|
786
|
+
});
|
|
772
787
|
slottedNodes.forEach((n) => {
|
|
788
|
+
console.log("\u{1F50D} Checking node:", {
|
|
789
|
+
tagName: n.tagName,
|
|
790
|
+
nodeType: n.nodeType,
|
|
791
|
+
slotName: getSlotName(n),
|
|
792
|
+
targetSlotName: slotName
|
|
793
|
+
});
|
|
773
794
|
if (slotName === getSlotName(n)) {
|
|
795
|
+
console.log("\u2705 Node matches slot, adding to return array");
|
|
774
796
|
toReturn.push(n);
|
|
797
|
+
patchSlottedShadowDomEvents(n, parent);
|
|
798
|
+
} else {
|
|
799
|
+
console.log("\u274C Node does not match slot");
|
|
775
800
|
}
|
|
776
801
|
});
|
|
802
|
+
console.log("\u{1F3ED} assignedFactory returning:", {
|
|
803
|
+
count: toReturn.length,
|
|
804
|
+
elementsOnly,
|
|
805
|
+
nodes: toReturn.map((n) => ({ tagName: n.tagName, nodeType: n.nodeType }))
|
|
806
|
+
});
|
|
777
807
|
if (elementsOnly) {
|
|
778
808
|
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
779
809
|
}
|
|
@@ -782,6 +812,70 @@ function patchSlotNode(node) {
|
|
|
782
812
|
node.assignedElements = assignedFactory(true);
|
|
783
813
|
node.assignedNodes = assignedFactory(false);
|
|
784
814
|
}
|
|
815
|
+
function patchSlottedShadowDomEvents(slottedNode, parentHost) {
|
|
816
|
+
var _a, _b, _c;
|
|
817
|
+
console.log("\u{1F50D} patchSlottedShadowDomEvents called:", {
|
|
818
|
+
slottedNode: slottedNode.tagName,
|
|
819
|
+
parentHost: parentHost.tagName,
|
|
820
|
+
nodeType: slottedNode.nodeType,
|
|
821
|
+
isElement: slottedNode.nodeType === 1 /* ElementNode */
|
|
822
|
+
});
|
|
823
|
+
if (slottedNode.nodeType !== 1 /* ElementNode */) {
|
|
824
|
+
console.log("\u274C Not an element node, skipping");
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
const element = slottedNode;
|
|
828
|
+
console.log("\u{1F50D} Element details:", {
|
|
829
|
+
tagName: element.tagName,
|
|
830
|
+
hasHyphen: (_a = element.tagName) == null ? void 0 : _a.includes("-"),
|
|
831
|
+
hasShadowRoot: !!element.shadowRoot,
|
|
832
|
+
parentHasShadowRoot: !!parentHost.shadowRoot
|
|
833
|
+
});
|
|
834
|
+
if (!((_b = element.tagName) == null ? void 0 : _b.includes("-")) || !element.shadowRoot || parentHost.shadowRoot) {
|
|
835
|
+
console.log("\u274C Conditions not met for patching:", {
|
|
836
|
+
hasHyphen: (_c = element.tagName) == null ? void 0 : _c.includes("-"),
|
|
837
|
+
hasShadowRoot: !!element.shadowRoot,
|
|
838
|
+
parentHasShadowRoot: !!parentHost.shadowRoot
|
|
839
|
+
});
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
if (element.__stencilSlotEventPatched) {
|
|
843
|
+
console.log("\u26A0\uFE0F Already patched, skipping");
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
console.log("\u2705 Patching element:", element.tagName);
|
|
847
|
+
element.__stencilSlotEventPatched = true;
|
|
848
|
+
const originalDispatchEvent = element.dispatchEvent;
|
|
849
|
+
element.dispatchEvent = function(event) {
|
|
850
|
+
var _a2;
|
|
851
|
+
console.log("\u{1F3AF} dispatchEvent called:", {
|
|
852
|
+
type: event.type,
|
|
853
|
+
target: (_a2 = event.target) == null ? void 0 : _a2.tagName,
|
|
854
|
+
bubbles: event.bubbles,
|
|
855
|
+
composed: event.composed
|
|
856
|
+
});
|
|
857
|
+
if ((event.type === "focus" || event.type === "blur") && event.bubbles) {
|
|
858
|
+
console.log("\u{1F6D1} Intercepting focus/blur event, creating non-bubbling version");
|
|
859
|
+
const nonBubblingEvent = new event.constructor(event.type, {
|
|
860
|
+
...event,
|
|
861
|
+
bubbles: false,
|
|
862
|
+
composed: event.composed
|
|
863
|
+
});
|
|
864
|
+
Object.keys(event).forEach((key) => {
|
|
865
|
+
if (key !== "bubbles" && key !== "type") {
|
|
866
|
+
try {
|
|
867
|
+
nonBubblingEvent[key] = event[key];
|
|
868
|
+
} catch (e) {
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
});
|
|
872
|
+
console.log("\u{1F4E4} Dispatching non-bubbling event");
|
|
873
|
+
return originalDispatchEvent.call(this, nonBubblingEvent);
|
|
874
|
+
}
|
|
875
|
+
console.log("\u{1F4E4} Dispatching original event");
|
|
876
|
+
return originalDispatchEvent.call(this, event);
|
|
877
|
+
};
|
|
878
|
+
}
|
|
785
879
|
function dispatchSlotChangeEvent(elm) {
|
|
786
880
|
elm.dispatchEvent(new CustomEvent("slotchange", { bubbles: false, cancelable: false, composed: false }));
|
|
787
881
|
}
|
|
@@ -1126,17 +1220,67 @@ var patchPreviousElementSibling = (element) => {
|
|
|
1126
1220
|
});
|
|
1127
1221
|
};
|
|
1128
1222
|
var patchParentNode = (node) => {
|
|
1223
|
+
var _a;
|
|
1129
1224
|
if (!node || node.__parentNode) return;
|
|
1130
1225
|
patchHostOriginalAccessor("parentNode", node);
|
|
1131
1226
|
Object.defineProperty(node, "parentNode", {
|
|
1132
1227
|
get: function() {
|
|
1133
|
-
var
|
|
1134
|
-
return ((
|
|
1228
|
+
var _a2;
|
|
1229
|
+
return ((_a2 = this["s-ol"]) == null ? void 0 : _a2.parentNode) || this.__parentNode;
|
|
1135
1230
|
},
|
|
1136
1231
|
set: function(value) {
|
|
1137
1232
|
this.__parentNode = value;
|
|
1138
1233
|
}
|
|
1139
1234
|
});
|
|
1235
|
+
if (node.nodeType === 1 /* ELEMENT_NODE */) {
|
|
1236
|
+
const element = node;
|
|
1237
|
+
if (((_a = element.tagName) == null ? void 0 : _a.includes("-")) && element.shadowRoot) {
|
|
1238
|
+
if (import_app_data3.BUILD.isDev) {
|
|
1239
|
+
console.log("\u{1F527} Patching focus method for slotted shadow DOM element:", element.tagName);
|
|
1240
|
+
}
|
|
1241
|
+
const originalFocus = element.focus.bind(element);
|
|
1242
|
+
const originalDispatchEvent = element.dispatchEvent.bind(element);
|
|
1243
|
+
const originalAddEventListener = element.addEventListener.bind(element);
|
|
1244
|
+
let lastFocusTime = 0;
|
|
1245
|
+
const blurSuppressionWindow = 200;
|
|
1246
|
+
const blurListeners = [];
|
|
1247
|
+
element.focus = function(options) {
|
|
1248
|
+
lastFocusTime = Date.now();
|
|
1249
|
+
originalFocus(options);
|
|
1250
|
+
};
|
|
1251
|
+
element.addEventListener = function(type, listener, options) {
|
|
1252
|
+
if (type === "blur") {
|
|
1253
|
+
const wrappedListener = function(event) {
|
|
1254
|
+
const now = Date.now();
|
|
1255
|
+
const timeSinceFocus = now - lastFocusTime;
|
|
1256
|
+
if (timeSinceFocus < blurSuppressionWindow && lastFocusTime > 0) {
|
|
1257
|
+
if (import_app_data3.BUILD.isDev) {
|
|
1258
|
+
console.log("\u{1F6D1} Suppressing erroneous blur event - happened too soon after focus");
|
|
1259
|
+
}
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
listener.call(this, event);
|
|
1263
|
+
};
|
|
1264
|
+
blurListeners.push({ listener, options });
|
|
1265
|
+
return originalAddEventListener.call(this, type, wrappedListener, options);
|
|
1266
|
+
}
|
|
1267
|
+
return originalAddEventListener.call(this, type, listener, options);
|
|
1268
|
+
};
|
|
1269
|
+
element.dispatchEvent = function(event) {
|
|
1270
|
+
if (event.type === "blur") {
|
|
1271
|
+
const now = Date.now();
|
|
1272
|
+
const timeSinceFocus = now - lastFocusTime;
|
|
1273
|
+
if (timeSinceFocus < blurSuppressionWindow && lastFocusTime > 0) {
|
|
1274
|
+
if (import_app_data3.BUILD.isDev) {
|
|
1275
|
+
console.log("\u{1F6D1} Preventing erroneous blur dispatchEvent - happened too soon after focus");
|
|
1276
|
+
}
|
|
1277
|
+
return true;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
return originalDispatchEvent(event);
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1140
1284
|
};
|
|
1141
1285
|
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
1142
1286
|
var validNodesPatches = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "4.35.1-dev.
|
|
3
|
+
"version": "4.35.1-dev.1750455125.b359bb3",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
package/screenshot/index.js
CHANGED
package/screenshot/package.json
CHANGED