fix acceptance reminder command no email list

This commit is contained in:
Godfrey M 2025-02-26 11:25:21 -08:00
parent 31516d7f24
commit cc26aa02b2
8 changed files with 839 additions and 625 deletions

View file

@ -64,6 +64,7 @@ class SendAcceptanceReminder extends Command
->groupBy(function($item) { ->groupBy(function($item) {
return $item['acceptance']->assignedTo ? $item['acceptance']->assignedTo->id : ''; return $item['acceptance']->assignedTo ? $item['acceptance']->assignedTo->id : '';
}); });
$no_email_list= [];
foreach($unacceptedAssetGroups as $unacceptedAssetGroup) { foreach($unacceptedAssetGroups as $unacceptedAssetGroup) {
// The [0] is weird, but it allows for the item_count to work and grabs the appropriate info for each user. // The [0] is weird, but it allows for the item_count to work and grabs the appropriate info for each user.
@ -72,7 +73,10 @@ class SendAcceptanceReminder extends Command
$locale = $acceptance->assignedTo?->locale; $locale = $acceptance->assignedTo?->locale;
$email = $acceptance->assignedTo?->email; $email = $acceptance->assignedTo?->email;
if(!$email){ if(!$email){
$this->info($acceptance->assignedTo?->present()->fullName().' has no email address.'); $no_email_list[] = [
'id' => $acceptance->assignedTo->id,
'name' => $acceptance->assignedTo->present()->fullName(),
];
} }
$item_count = $unacceptedAssetGroup->count(); $item_count = $unacceptedAssetGroup->count();
@ -86,6 +90,11 @@ class SendAcceptanceReminder extends Command
} }
$this->info($count.' users notified.'); $this->info($count.' users notified.');
$output = "The following users do not have an email address:\n";
foreach ($no_email_list as $user) {
$output .= "ID: {$user['id']}, Name: {$user['name']}\n";
}
$this->info($output);
return 0; return 0;
} }

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

File diff suppressed because one or more lines are too long

View file

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