Skip to content

Commit

Permalink
Update JS dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Jun 3, 2024
1 parent 7186ffb commit 8225807
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
7 changes: 3 additions & 4 deletions adit_radis_shared/common/static/vendor/alpine-morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
return;
if (from2.nodeType === 1 && window.Alpine) {
window.Alpine.cloneNode(from2, to);
if (from2._x_teleport && to._x_teleport) {
patch(from2._x_teleport, to._x_teleport);
}
}
if (textOrComment(to)) {
patchNodeValue(from2, to);
Expand Down Expand Up @@ -84,10 +87,6 @@
}
}
function patchChildren(from2, to) {
if (from2._x_teleport)
from2 = from2._x_teleport;
if (to._x_teleport)
to = to._x_teleport;
let fromKeys = keyToMap(from2.children);
let fromKeyHoldovers = {};
let currentTo = getFirstNode(to);
Expand Down
34 changes: 21 additions & 13 deletions adit_radis_shared/common/static/vendor/alpine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
let carry = Promise.all([
el2._x_hidePromise,
...(el2._x_hideChildren || []).map(hideAfterChildren)
]).then(([i]) => i());
]).then(([i]) => i?.());
delete el2._x_hidePromise;
delete el2._x_hideChildren;
return carry;
Expand Down Expand Up @@ -1642,7 +1642,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
get raw() {
return raw;
},
version: "3.13.9",
version: "3.14.0",
flushAndStopDeferringMutations,
dontAutoEvaluateFunctions,
disableEffectScheduling,
Expand Down Expand Up @@ -2581,8 +2581,10 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
};
mutateDom(() => {
placeInDom(clone2, target, modifiers);
initTree(clone2);
clone2._x_ignore = true;
skipDuringClone(() => {
initTree(clone2);
clone2._x_ignore = true;
})();
});
el._x_teleportPutBack = () => {
let target2 = getTarget(expression);
Expand Down Expand Up @@ -2682,14 +2684,14 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
handler4 = wrapHandler(handler4, (next, e) => {
e.target === el && next(e);
});
handler4 = wrapHandler(handler4, (next, e) => {
if (isKeyEvent(event)) {
if (isKeyEvent(event) || isClickEvent(event)) {
handler4 = wrapHandler(handler4, (next, e) => {
if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {
return;
}
}
next(e);
});
next(e);
});
}
listenerTarget.addEventListener(event, handler4, options);
return () => {
listenerTarget.removeEventListener(event, handler4, options);
Expand All @@ -2714,9 +2716,12 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
function isKeyEvent(event) {
return ["keydown", "keyup"].includes(event);
}
function isClickEvent(event) {
return ["contextmenu", "click", "mouse"].some((i) => event.includes(i));
}
function isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {
let keyModifiers = modifiers.filter((i) => {
return !["window", "document", "prevent", "stop", "once", "capture"].includes(i);
return !["window", "document", "prevent", "stop", "once", "capture", "self", "away", "outside", "passive"].includes(i);
});
if (keyModifiers.includes("debounce")) {
let debounceIndex = keyModifiers.indexOf("debounce");
Expand All @@ -2740,6 +2745,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
return e[`${modifier}Key`];
});
if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {
if (isClickEvent(e.type))
return false;
if (keyToModifiers(e.key).includes(keyModifiers[0]))
return false;
}
Expand All @@ -2762,6 +2769,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
"left": "arrow-left",
"right": "arrow-right",
"period": ".",
"comma": ",",
"equal": "=",
"minus": "-",
"underscore": "_"
Expand Down Expand Up @@ -2818,7 +2826,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
setValue(getInputValue(el, modifiers, e, getValue()));
});
if (modifiers.includes("fill")) {
if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) {
if ([void 0, null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue()) || el.tagName.toLowerCase() === "select" && el.multiple) {
setValue(
getInputValue(el, modifiers, { target: el }, getValue())
);
Expand All @@ -2830,7 +2838,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
cleanup2(() => el._x_removeModelListeners["default"]());
if (el.form) {
let removeResetListener = on(el.form, "reset", [], (e) => {
nextTick(() => el._x_model && el._x_model.set(el.value));
nextTick(() => el._x_model && el._x_model.set(getInputValue(el, modifiers, { target: el }, getValue())));
});
cleanup2(() => removeResetListener());
}
Expand Down Expand Up @@ -2870,7 +2878,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
} else {
newValue = event.target.value;
}
return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
return event.target.checked ? currentValue.includes(newValue) ? currentValue : currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));
} else {
return event.target.checked;
}
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dependencies": {
"@alpinejs/morph": "^3.13.0",
"@alpinejs/morph": "^3.14.0",
"@popperjs/core": "^2.11.8",
"alpinejs": "^3.13.0",
"alpinejs": "^3.14.0",
"bootstrap": "^5.3.2",
"bootstrap-icons": "^1.11.1",
"bootswatch": "^5.3.2",
Expand Down

0 comments on commit 8225807

Please sign in to comment.