remove unwanted changes to livewire

This commit is contained in:
Godfrey M 2025-02-26 11:31:41 -08:00
parent cc26aa02b2
commit fd0174ff32
7 changed files with 624 additions and 829 deletions

1106
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2863,7 +2863,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
});
return obj;
}
var Alpine23 = {
var Alpine20 = {
get reactive() {
return reactive;
},
@ -2929,7 +2929,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
data,
bind: bind2
};
var alpine_default = Alpine23;
var alpine_default = Alpine20;
var import_reactivity10 = __toESM2(require_reactivity());
magic("nextTick", () => nextTick);
magic("dispatch", (el) => dispatch3.bind(dispatch3, el));
@ -3857,8 +3857,8 @@ var require_module_cjs2 = __commonJS({
default: () => module_default
});
module.exports = __toCommonJS(module_exports);
function src_default(Alpine23) {
Alpine23.directive("collapse", collapse3);
function src_default(Alpine20) {
Alpine20.directive("collapse", collapse3);
collapse3.inline = (el, { modifiers }) => {
if (!modifiers.includes("min"))
return;
@ -3878,7 +3878,7 @@ var require_module_cjs2 = __commonJS({
if (!el._x_isShown)
el.style.overflow = "hidden";
let setFunction = (el2, styles) => {
let revertFunction = Alpine23.setStyles(el2, styles);
let revertFunction = Alpine20.setStyles(el2, styles);
return styles.height ? () => {
} : revertFunction;
};
@ -3901,7 +3901,7 @@ var require_module_cjs2 = __commonJS({
if (current === full) {
current = floor;
}
Alpine23.transition(el, Alpine23.setStyles, {
Alpine20.transition(el, Alpine20.setStyles, {
during: transitionStyles,
start: { height: current + "px" },
end: { height: full + "px" }
@ -3915,7 +3915,7 @@ var require_module_cjs2 = __commonJS({
}, after = () => {
}) {
let full = el.getBoundingClientRect().height;
Alpine23.transition(el, setFunction, {
Alpine20.transition(el, setFunction, {
during: transitionStyles,
start: { height: full + "px" },
end: { height: floor + "px" }
@ -4751,14 +4751,14 @@ var require_module_cjs3 = __commonJS({
module.exports = __toCommonJS(module_exports);
var import_focus_trap = __toESM2(require_focus_trap());
var import_tabbable = __toESM2(require_dist());
function src_default(Alpine23) {
function src_default(Alpine20) {
let lastFocused;
let currentFocused;
window.addEventListener("focusin", () => {
lastFocused = currentFocused;
currentFocused = document.activeElement;
});
Alpine23.magic("focus", (el) => {
Alpine20.magic("focus", (el) => {
let within = el;
return {
__noscroll: false,
@ -4862,7 +4862,7 @@ var require_module_cjs3 = __commonJS({
}
};
});
Alpine23.directive("trap", Alpine23.skipDuringClone((el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => {
Alpine20.directive("trap", Alpine20.skipDuringClone((el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => {
let evaluator = evaluateLater(expression);
let oldValue = false;
let options = {
@ -4980,7 +4980,7 @@ var require_module_cjs4 = __commonJS({
persist: () => src_default
});
module.exports = __toCommonJS(module_exports);
function src_default(Alpine23) {
function src_default(Alpine20) {
let persist3 = () => {
let alias;
let storage;
@ -4995,11 +4995,11 @@ var require_module_cjs4 = __commonJS({
setItem: dummy.set.bind(dummy)
};
}
return Alpine23.interceptor((initialValue, getter, setter, path, key) => {
return Alpine20.interceptor((initialValue, getter, setter, path, key) => {
let lookup = alias || `_x_${path}`;
let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue;
setter(initial);
Alpine23.effect(() => {
Alpine20.effect(() => {
let value = getter();
storageSet(lookup, value, storage);
setter(value);
@ -5015,12 +5015,12 @@ var require_module_cjs4 = __commonJS({
};
});
};
Object.defineProperty(Alpine23, "$persist", { get: () => persist3() });
Alpine23.magic("persist", persist3);
Alpine23.persist = (key, { get, set }, storage = localStorage) => {
Object.defineProperty(Alpine20, "$persist", { get: () => persist3() });
Alpine20.magic("persist", persist3);
Alpine20.persist = (key, { get, set }, storage = localStorage) => {
let initial = storageHas(key, storage) ? storageGet(key, storage) : get();
set(initial);
Alpine23.effect(() => {
Alpine20.effect(() => {
let value = get();
storageSet(key, value, storage);
set(value);
@ -5069,8 +5069,8 @@ var require_module_cjs5 = __commonJS({
intersect: () => src_default
});
module.exports = __toCommonJS(module_exports);
function src_default(Alpine23) {
Alpine23.directive("intersect", Alpine23.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
function src_default(Alpine20) {
Alpine20.directive("intersect", Alpine20.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
let evaluate = evaluateLater(expression);
let options = {
rootMargin: getRootMargin(modifiers),
@ -5151,8 +5151,8 @@ var require_module_cjs6 = __commonJS({
resize: () => src_default
});
module.exports = __toCommonJS(module_exports);
function src_default(Alpine23) {
Alpine23.directive("resize", Alpine23.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
function src_default(Alpine20) {
Alpine20.directive("resize", Alpine20.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
let evaluator = evaluateLater(expression);
let evaluate = (width, height) => {
evaluator(() => {
@ -6396,20 +6396,20 @@ var require_module_cjs7 = __commonJS({
platform: platformWithCache
});
};
function src_default(Alpine23) {
Alpine23.magic("anchor", (el) => {
function src_default(Alpine20) {
Alpine20.magic("anchor", (el) => {
if (!el._x_anchor)
throw "Alpine: No x-anchor directive found on element using $anchor...";
return el._x_anchor;
});
Alpine23.interceptClone((from, to) => {
Alpine20.interceptClone((from, to) => {
if (from && from._x_anchor && !to._x_anchor) {
to._x_anchor = from._x_anchor;
}
});
Alpine23.directive("anchor", Alpine23.skipDuringClone((el, { expression, modifiers, value }, { cleanup, evaluate: evaluate2 }) => {
Alpine20.directive("anchor", Alpine20.skipDuringClone((el, { expression, modifiers, value }, { cleanup, evaluate: evaluate2 }) => {
let { placement, offsetValue, unstyled } = getOptions(modifiers);
el._x_anchor = Alpine23.reactive({ x: 0, y: 0 });
el._x_anchor = Alpine20.reactive({ x: 0, y: 0 });
let reference = evaluate2(expression);
if (!reference)
throw "Alpine: no element provided to x-anchor...";
@ -7095,8 +7095,8 @@ var require_module_cjs8 = __commonJS({
to.setAttribute("id", fromId);
to.id = fromId;
}
function src_default(Alpine23) {
Alpine23.morph = morph3;
function src_default(Alpine20) {
Alpine20.morph = morph3;
}
var module_default = src_default;
}
@ -7129,8 +7129,8 @@ var require_module_cjs9 = __commonJS({
stripDown: () => stripDown
});
module.exports = __toCommonJS(module_exports);
function src_default(Alpine23) {
Alpine23.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => {
function src_default(Alpine20) {
Alpine20.directive("mask", (el, { value, expression }, { effect, evaluateLater, cleanup }) => {
let templateFn = () => expression;
let lastInputValue = "";
queueMicrotask(() => {
@ -7139,7 +7139,7 @@ var require_module_cjs9 = __commonJS({
effect(() => {
templateFn = (input) => {
let result;
Alpine23.dontAutoEvaluateFunctions(() => {
Alpine20.dontAutoEvaluateFunctions(() => {
evaluator((value2) => {
result = typeof value2 === "function" ? value2(input) : value2;
}, { scope: {
@ -8188,7 +8188,6 @@ var aliases = {
"on": "$on",
"el": "$el",
"id": "$id",
"js": "$js",
"get": "$get",
"set": "$set",
"call": "$call",
@ -8260,14 +8259,6 @@ wireProperty("$el", (component) => {
wireProperty("$id", (component) => {
return component.id;
});
wireProperty("$js", (component) => {
let fn = component.addJsAction.bind(component);
let jsActions = component.getJsActions();
Object.keys(jsActions).forEach((name) => {
fn[name] = component.getJsAction(name);
});
return fn;
});
wireProperty("$set", (component) => async (property, value, live = true) => {
dataSet(component.reactive, property, value);
if (live) {
@ -8363,7 +8354,6 @@ var Component = class {
this.ephemeral = extractData(deepClone(this.snapshot.data));
this.reactive = Alpine.reactive(this.ephemeral);
this.queuedUpdates = {};
this.jsActions = {};
this.$wire = generateWireObject(this, this.reactive);
this.cleanups = [];
this.processEffects(this.effects);
@ -8439,18 +8429,6 @@ var Component = class {
}
el.setAttribute("wire:effects", JSON.stringify(effects));
}
addJsAction(name, action) {
this.jsActions[name] = action;
}
hasJsAction(name) {
return this.jsActions[name] !== void 0;
}
getJsAction(name) {
return this.jsActions[name].bind(this.$wire);
}
getJsActions() {
return this.jsActions;
}
addCleanup(cleanup) {
this.cleanups.push(cleanup);
}
@ -9133,7 +9111,6 @@ var attributesExemptFromScriptTagHashing = [
];
function swapCurrentPageWithNewHtml(html, andThen) {
let newDocument = new DOMParser().parseFromString(html, "text/html");
let newHtml = newDocument.documentElement;
let newBody = document.adoptNode(newDocument.body);
let newHead = document.adoptNode(newDocument.head);
oldBodyScriptTagHashes = oldBodyScriptTagHashes.concat(Array.from(document.body.querySelectorAll("script")).map((i) => {
@ -9141,7 +9118,6 @@ function swapCurrentPageWithNewHtml(html, andThen) {
}));
let afterRemoteScriptsHaveLoaded = () => {
};
replaceHtmlAttributes(newHtml);
mergeNewHead(newHead).finally(() => {
afterRemoteScriptsHaveLoaded();
});
@ -9161,21 +9137,6 @@ function prepNewBodyScriptTagsToRun(newBody, oldBodyScriptTagHashes2) {
i.replaceWith(cloneScriptTag(i));
});
}
function replaceHtmlAttributes(newHtmlElement) {
let currentHtmlElement = document.documentElement;
Array.from(newHtmlElement.attributes).forEach((attr) => {
const name = attr.name;
const value = attr.value;
if (currentHtmlElement.getAttribute(name) !== value) {
currentHtmlElement.setAttribute(name, value);
}
});
Array.from(currentHtmlElement.attributes).forEach((attr) => {
if (!newHtmlElement.hasAttribute(attr.name)) {
currentHtmlElement.removeAttribute(attr.name);
}
});
}
function mergeNewHead(newHead) {
let children = Array.from(document.head.children);
let headChildrenHtmlLookup = children.map((i) => i.outerHTML);
@ -9279,8 +9240,8 @@ var enablePersist = true;
var showProgressBar = true;
var restoreScroll = true;
var autofocus = false;
function navigate_default(Alpine23) {
Alpine23.navigate = (url) => {
function navigate_default(Alpine20) {
Alpine20.navigate = (url) => {
let destination = createUrlObjectFromString(url);
let prevented = fireEventForOtherLibrariesToHookInto("alpine:navigate", {
url: destination,
@ -9291,11 +9252,11 @@ function navigate_default(Alpine23) {
return;
navigateTo(destination);
};
Alpine23.navigate.disableProgressBar = () => {
Alpine20.navigate.disableProgressBar = () => {
showProgressBar = false;
};
Alpine23.addInitSelector(() => `[${Alpine23.prefixed("navigate")}]`);
Alpine23.directive("navigate", (el, { modifiers }) => {
Alpine20.addInitSelector(() => `[${Alpine20.prefixed("navigate")}]`);
Alpine20.directive("navigate", (el, { modifiers }) => {
let shouldPrefetchOnHover = modifiers.includes("hover");
shouldPrefetchOnHover && whenThisLinkIsHoveredFor(el, 60, () => {
let destination = extractDestinationFromLink(el);
@ -9332,7 +9293,7 @@ function navigate_default(Alpine23) {
showProgressBar && finishAndHideProgressBar();
cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement();
updateCurrentPageHtmlInHistoryStateForLaterBackButtonClicks();
preventAlpineFromPickingUpDomChanges(Alpine23, (andAfterAllThis) => {
preventAlpineFromPickingUpDomChanges(Alpine20, (andAfterAllThis) => {
enablePersist && storePersistantElementsForLater((persistedEl) => {
packUpPersistedTeleports(persistedEl);
packUpPersistedPopovers(persistedEl);
@ -9354,7 +9315,7 @@ function navigate_default(Alpine23) {
setTimeout(() => {
autofocus && autofocusElementsWithTheAutofocusAttribute();
});
nowInitializeAlpineOnTheNewPage(Alpine23);
nowInitializeAlpineOnTheNewPage(Alpine20);
fireEventForOtherLibrariesToHookInto("alpine:navigated");
});
});
@ -9387,7 +9348,7 @@ function navigate_default(Alpine23) {
storeScrollInformationInHtmlBeforeNavigatingAway();
fireEventForOtherLibrariesToHookInto("alpine:navigating");
updateCurrentPageHtmlInSnapshotCacheForLaterBackButtonClicks(currentPageUrl, currentPageKey);
preventAlpineFromPickingUpDomChanges(Alpine23, (andAfterAllThis) => {
preventAlpineFromPickingUpDomChanges(Alpine20, (andAfterAllThis) => {
enablePersist && storePersistantElementsForLater((persistedEl) => {
packUpPersistedTeleports(persistedEl);
packUpPersistedPopovers(persistedEl);
@ -9402,7 +9363,7 @@ function navigate_default(Alpine23) {
restoreScrollPositionOrScrollToTop();
andAfterAllThis(() => {
autofocus && autofocusElementsWithTheAutofocusAttribute();
nowInitializeAlpineOnTheNewPage(Alpine23);
nowInitializeAlpineOnTheNewPage(Alpine20);
fireEventForOtherLibrariesToHookInto("alpine:navigated");
});
});
@ -9417,10 +9378,10 @@ function fetchHtmlOrUsePrefetchedHtml(fromDestination, callback) {
fetchHtml(fromDestination, callback);
});
}
function preventAlpineFromPickingUpDomChanges(Alpine23, callback) {
Alpine23.stopObservingMutations();
function preventAlpineFromPickingUpDomChanges(Alpine20, callback) {
Alpine20.stopObservingMutations();
callback((afterAllThis) => {
Alpine23.startObservingMutations();
Alpine20.startObservingMutations();
queueMicrotask(() => {
afterAllThis();
});
@ -9435,8 +9396,8 @@ function fireEventForOtherLibrariesToHookInto(name, detail) {
document.dispatchEvent(event);
return event.defaultPrevented;
}
function nowInitializeAlpineOnTheNewPage(Alpine23) {
Alpine23.initTree(document.body, void 0, (el, skip) => {
function nowInitializeAlpineOnTheNewPage(Alpine20) {
Alpine20.initTree(document.body, void 0, (el, skip) => {
if (el._x_wasPersisted)
skip();
});
@ -9459,8 +9420,8 @@ function cleanupAlpineElementsOnThePageThatArentInsideAPersistedElement() {
}
// js/plugins/history/index.js
function history2(Alpine23) {
Alpine23.magic("queryString", (el, { interceptor }) => {
function history2(Alpine20) {
Alpine20.magic("queryString", (el, { interceptor }) => {
let alias;
let alwaysShow = false;
let usePush = false;
@ -9469,9 +9430,9 @@ function history2(Alpine23) {
let { initial, replace: replace2, push: push2, pop } = track(queryKey, initialSeedValue, alwaysShow);
setter(initial);
if (!usePush) {
Alpine23.effect(() => replace2(getter()));
Alpine20.effect(() => replace2(getter()));
} else {
Alpine23.effect(() => push2(getter()));
Alpine20.effect(() => push2(getter()));
pop(async (newValue) => {
setter(newValue);
let tillTheEndOfTheMicrotaskQueue = () => Promise.resolve();
@ -9494,7 +9455,7 @@ function history2(Alpine23) {
};
});
});
Alpine23.history = { track };
Alpine20.history = { track };
}
function track(name, initialSeedValue, alwaysShow = false, except = null) {
let { has, get, set, remove } = queryStringUtils();
@ -9736,7 +9697,7 @@ function ensureLivewireScriptIsntMisplaced() {
}
// js/index.js
var import_alpinejs21 = __toESM(require_module_cjs());
var import_alpinejs18 = __toESM(require_module_cjs());
// js/features/supportListeners.js
on("effect", ({ component, effects }) => {
@ -9793,7 +9754,7 @@ on("effect", ({ component, effects }) => {
onlyIfScriptHasntBeenRunAlreadyForThisComponent(component, key, () => {
let scriptContent = extractScriptTagContent(content);
import_alpinejs6.default.dontAutoEvaluateFunctions(() => {
import_alpinejs6.default.evaluate(component.el, scriptContent, { "$wire": component.$wire, "$js": component.$wire.$js });
import_alpinejs6.default.evaluate(component.el, scriptContent, { "$wire": component.$wire });
});
});
});
@ -9866,10 +9827,6 @@ function cloneScriptTag2(el) {
// js/features/supportJsEvaluation.js
var import_alpinejs7 = __toESM(require_module_cjs());
import_alpinejs7.default.magic("js", (el) => {
let component = closestComponent(el);
return component.$wire.js;
});
on("effect", ({ component, effects }) => {
let js = effects.js;
let xjs = effects.xjs;
@ -9881,9 +9838,8 @@ on("effect", ({ component, effects }) => {
});
}
if (xjs) {
xjs.forEach(({ expression, params }) => {
params = Object.values(params);
import_alpinejs7.default.evaluate(component.el, expression, { scope: component.jsActions, params });
xjs.forEach((expression) => {
import_alpinejs7.default.evaluate(component.el, expression);
});
}
});
@ -10353,14 +10309,6 @@ on("morph.added", ({ el }) => {
el.__addedByMorph = true;
});
directive("transition", ({ el, directive: directive2, component, cleanup }) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:show")) {
import_alpinejs11.default.bind(el, {
[directive2.rawName.replace("wire:transition", "x-transition")]: directive2.expression
});
return;
}
}
let visibility = import_alpinejs11.default.reactive({ state: el.__addedByMorph ? false : true });
import_alpinejs11.default.bind(el, {
[directive2.rawName.replace("wire:", "x-")]: "",
@ -10498,10 +10446,8 @@ globalDirective("current", ({ el, directive: directive2, cleanup }) => {
let refreshCurrent = (url) => {
if (pathMatches(hrefUrl, url, options)) {
el.classList.add(...classes);
el.setAttribute("data-current", "");
} else {
el.classList.remove(...classes);
el.removeAttribute("data-current");
}
};
refreshCurrent(new URL(window.location.href));
@ -10794,14 +10740,6 @@ directive("ignore", ({ el, directive: directive2 }) => {
}
});
// js/directives/wire-cloak.js
var import_alpinejs15 = __toESM(require_module_cjs());
import_alpinejs15.default.interceptInit((el) => {
if (el.hasAttribute("wire:cloak")) {
import_alpinejs15.default.mutateDom(() => el.removeAttribute("wire:cloak"));
}
});
// js/directives/wire-dirty.js
var refreshDirtyStatesByComponent = new WeakBag();
on("commit", ({ component, succeed }) => {
@ -10852,7 +10790,7 @@ function dirtyTargets(el) {
}
// js/directives/wire-model.js
var import_alpinejs16 = __toESM(require_module_cjs());
var import_alpinejs15 = __toESM(require_module_cjs());
directive("model", ({ el, directive: directive2, component, cleanup }) => {
let { expression, modifiers } = directive2;
if (!expression) {
@ -10870,7 +10808,7 @@ directive("model", ({ el, directive: directive2, component, cleanup }) => {
let isDebounced = modifiers.includes("debounce");
let update = expression.startsWith("$parent") ? () => component.$wire.$parent.$commit() : () => component.$wire.$commit();
let debouncedUpdate = isTextInput(el) && !isDebounced && isLive ? debounce(update, 150) : update;
import_alpinejs16.default.bind(el, {
import_alpinejs15.default.bind(el, {
["@change"]() {
isLazy && update();
},
@ -10926,14 +10864,14 @@ function debounce(func, wait) {
}
// js/directives/wire-init.js
var import_alpinejs17 = __toESM(require_module_cjs());
var import_alpinejs16 = __toESM(require_module_cjs());
directive("init", ({ el, directive: directive2 }) => {
let fullMethod = directive2.expression ?? "$refresh";
import_alpinejs17.default.evaluate(el, `$wire.${fullMethod}`);
import_alpinejs16.default.evaluate(el, `$wire.${fullMethod}`);
});
// js/directives/wire-poll.js
var import_alpinejs18 = __toESM(require_module_cjs());
var import_alpinejs17 = __toESM(require_module_cjs());
directive("poll", ({ el, directive: directive2 }) => {
let interval = extractDurationFrom(directive2.modifiers, 2e3);
let { start: start2, pauseWhile, throttleWhile, stopWhen } = poll(() => {
@ -10947,7 +10885,7 @@ directive("poll", ({ el, directive: directive2 }) => {
stopWhen(() => theElementIsDisconnected(el));
});
function triggerComponentRequest(el, directive2) {
import_alpinejs18.default.evaluate(el, directive2.expression ? "$wire." + directive2.expression : "$wire.$commit()");
import_alpinejs17.default.evaluate(el, directive2.expression ? "$wire." + directive2.expression : "$wire.$commit()");
}
function poll(callback, interval = 2e3) {
let pauseConditions = [];
@ -11035,40 +10973,6 @@ function extractDurationFrom(modifiers, defaultDuration) {
return durationInMilliSeconds || defaultDuration;
}
// js/directives/wire-show.js
var import_alpinejs19 = __toESM(require_module_cjs());
import_alpinejs19.default.interceptInit((el) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:show")) {
let { name, value } = el.attributes[i];
let modifierString = name.split("wire:show")[1];
let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim();
import_alpinejs19.default.bind(el, {
["x-show" + modifierString]() {
return import_alpinejs19.default.evaluate(el, expression);
}
});
}
}
});
// js/directives/wire-text.js
var import_alpinejs20 = __toESM(require_module_cjs());
import_alpinejs20.default.interceptInit((el) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:text")) {
let { name, value } = el.attributes[i];
let modifierString = name.split("wire:text")[1];
let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim();
import_alpinejs20.default.bind(el, {
["x-text" + modifierString]() {
return import_alpinejs20.default.evaluate(el, expression);
}
});
}
}
});
// js/index.js
var Livewire2 = {
directive,
@ -11084,7 +10988,7 @@ var Livewire2 = {
dispatch: dispatchGlobal,
on: on2,
get navigate() {
return import_alpinejs21.default.navigate;
return import_alpinejs18.default.navigate;
}
};
var warnAboutMultipleInstancesOf = (entity) => console.warn(`Detected multiple instances of ${entity} running`);
@ -11093,7 +10997,7 @@ if (window.Livewire)
if (window.Alpine)
warnAboutMultipleInstancesOf("Alpine");
window.Livewire = Livewire2;
window.Alpine = import_alpinejs21.default;
window.Alpine = import_alpinejs18.default;
if (window.livewireScriptConfig === void 0) {
window.Alpine.__fromLivewire = true;
document.addEventListener("DOMContentLoaded", () => {
@ -11103,7 +11007,7 @@ if (window.livewireScriptConfig === void 0) {
Livewire2.start();
});
}
var export_Alpine = import_alpinejs21.default;
var export_Alpine = import_alpinejs18.default;
export {
export_Alpine as Alpine,
Livewire2 as Livewire

File diff suppressed because one or more lines are too long

View file

@ -4363,7 +4363,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
"on": "$on",
"el": "$el",
"id": "$id",
"js": "$js",
"get": "$get",
"set": "$set",
"call": "$call",
@ -4435,14 +4434,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
wireProperty("$id", (component) => {
return component.id;
});
wireProperty("$js", (component) => {
let fn = component.addJsAction.bind(component);
let jsActions = component.getJsActions();
Object.keys(jsActions).forEach((name) => {
fn[name] = component.getJsAction(name);
});
return fn;
});
wireProperty("$set", (component) => async (property, value, live = true) => {
dataSet(component.reactive, property, value);
if (live) {
@ -4538,7 +4529,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
this.ephemeral = extractData(deepClone(this.snapshot.data));
this.reactive = Alpine.reactive(this.ephemeral);
this.queuedUpdates = {};
this.jsActions = {};
this.$wire = generateWireObject(this, this.reactive);
this.cleanups = [];
this.processEffects(this.effects);
@ -4614,18 +4604,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
}
el.setAttribute("wire:effects", JSON.stringify(effects));
}
addJsAction(name, action) {
this.jsActions[name] = action;
}
hasJsAction(name) {
return this.jsActions[name] !== void 0;
}
getJsAction(name) {
return this.jsActions[name].bind(this.$wire);
}
getJsActions() {
return this.jsActions;
}
addCleanup(cleanup2) {
this.cleanups.push(cleanup2);
}
@ -7737,7 +7715,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
];
function swapCurrentPageWithNewHtml(html, andThen) {
let newDocument = new DOMParser().parseFromString(html, "text/html");
let newHtml = newDocument.documentElement;
let newBody = document.adoptNode(newDocument.body);
let newHead = document.adoptNode(newDocument.head);
oldBodyScriptTagHashes = oldBodyScriptTagHashes.concat(Array.from(document.body.querySelectorAll("script")).map((i) => {
@ -7745,7 +7722,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
}));
let afterRemoteScriptsHaveLoaded = () => {
};
replaceHtmlAttributes(newHtml);
mergeNewHead(newHead).finally(() => {
afterRemoteScriptsHaveLoaded();
});
@ -7765,21 +7741,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
i.replaceWith(cloneScriptTag(i));
});
}
function replaceHtmlAttributes(newHtmlElement) {
let currentHtmlElement = document.documentElement;
Array.from(newHtmlElement.attributes).forEach((attr) => {
const name = attr.name;
const value = attr.value;
if (currentHtmlElement.getAttribute(name) !== value) {
currentHtmlElement.setAttribute(name, value);
}
});
Array.from(currentHtmlElement.attributes).forEach((attr) => {
if (!newHtmlElement.hasAttribute(attr.name)) {
currentHtmlElement.removeAttribute(attr.name);
}
});
}
function mergeNewHead(newHead) {
let children = Array.from(document.head.children);
let headChildrenHtmlLookup = children.map((i) => i.outerHTML);
@ -8900,7 +8861,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
onlyIfScriptHasntBeenRunAlreadyForThisComponent(component, key, () => {
let scriptContent = extractScriptTagContent(content);
module_default.dontAutoEvaluateFunctions(() => {
module_default.evaluate(component.el, scriptContent, { "$wire": component.$wire, "$js": component.$wire.$js });
module_default.evaluate(component.el, scriptContent, { "$wire": component.$wire });
});
});
});
@ -8972,10 +8933,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
}
// js/features/supportJsEvaluation.js
module_default.magic("js", (el) => {
let component = closestComponent(el);
return component.$wire.js;
});
on2("effect", ({ component, effects }) => {
let js = effects.js;
let xjs = effects.xjs;
@ -8987,9 +8944,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
});
}
if (xjs) {
xjs.forEach(({ expression, params }) => {
params = Object.values(params);
module_default.evaluate(component.el, expression, { scope: component.jsActions, params });
xjs.forEach((expression) => {
module_default.evaluate(component.el, expression);
});
}
});
@ -9455,14 +9411,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
el.__addedByMorph = true;
});
directive2("transition", ({ el, directive: directive3, component, cleanup: cleanup2 }) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:show")) {
module_default.bind(el, {
[directive3.rawName.replace("wire:transition", "x-transition")]: directive3.expression
});
return;
}
}
let visibility = module_default.reactive({ state: el.__addedByMorph ? false : true });
module_default.bind(el, {
[directive3.rawName.replace("wire:", "x-")]: "",
@ -9597,10 +9545,8 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
let refreshCurrent = (url) => {
if (pathMatches(hrefUrl, url, options)) {
el.classList.add(...classes);
el.setAttribute("data-current", "");
} else {
el.classList.remove(...classes);
el.removeAttribute("data-current");
}
};
refreshCurrent(new URL(window.location.href));
@ -9893,13 +9839,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
}
});
// js/directives/wire-cloak.js
module_default.interceptInit((el) => {
if (el.hasAttribute("wire:cloak")) {
module_default.mutateDom(() => el.removeAttribute("wire:cloak"));
}
});
// js/directives/wire-dirty.js
var refreshDirtyStatesByComponent = new WeakBag();
on2("commit", ({ component, succeed }) => {
@ -10130,38 +10069,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
return durationInMilliSeconds || defaultDuration;
}
// js/directives/wire-show.js
module_default.interceptInit((el) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:show")) {
let { name, value } = el.attributes[i];
let modifierString = name.split("wire:show")[1];
let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim();
module_default.bind(el, {
["x-show" + modifierString]() {
return module_default.evaluate(el, expression);
}
});
}
}
});
// js/directives/wire-text.js
module_default.interceptInit((el) => {
for (let i = 0; i < el.attributes.length; i++) {
if (el.attributes[i].name.startsWith("wire:text")) {
let { name, value } = el.attributes[i];
let modifierString = name.split("wire:text")[1];
let expression = value.startsWith("!") ? "!$wire." + value.slice(1).trim() : "$wire." + value.trim();
module_default.bind(el, {
["x-text" + modifierString]() {
return module_default.evaluate(el, expression);
}
});
}
}
});
// js/index.js
var Livewire2 = {
directive: directive2,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,2 @@
{"/livewire.js":"65f3e655"}
{"/livewire.js":"951e6947"}