Fixed deps
This commit is contained in:
parent
f20addee50
commit
ee9fcfd41c
5 changed files with 25 additions and 22 deletions
4
go.mod
4
go.mod
|
@ -37,10 +37,10 @@ require (
|
||||||
github.com/labstack/echo/v4 v4.11.4
|
github.com/labstack/echo/v4 v4.11.4
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/redis/go-redis/v9 v9.5.0
|
github.com/redis/go-redis/v9 v9.5.1
|
||||||
github.com/resendlabs/resend-go v1.7.0
|
github.com/resendlabs/resend-go v1.7.0
|
||||||
github.com/stripe/stripe-go/v76 v76.17.0
|
github.com/stripe/stripe-go/v76 v76.17.0
|
||||||
github.com/svix/svix-webhooks v1.18.0
|
github.com/svix/svix-webhooks v1.19.0
|
||||||
github.com/yuin/goldmark v1.7.0
|
github.com/yuin/goldmark v1.7.0
|
||||||
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
|
||||||
github.com/zmb3/spotify v1.3.0
|
github.com/zmb3/spotify v1.3.0
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -65,6 +65,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/redis/go-redis/v9 v9.5.0 h1:Xe9TKMmZv939gwTBcvc0n1tzK5l2re0pKw/W/tN3amw=
|
github.com/redis/go-redis/v9 v9.5.0 h1:Xe9TKMmZv939gwTBcvc0n1tzK5l2re0pKw/W/tN3amw=
|
||||||
github.com/redis/go-redis/v9 v9.5.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
github.com/redis/go-redis/v9 v9.5.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
||||||
|
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
|
||||||
|
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
||||||
github.com/resendlabs/resend-go v1.7.0 h1:DycOqSXtw2q7aB+Nt9DDJUDtaYcrNPGn1t5RFposas0=
|
github.com/resendlabs/resend-go v1.7.0 h1:DycOqSXtw2q7aB+Nt9DDJUDtaYcrNPGn1t5RFposas0=
|
||||||
github.com/resendlabs/resend-go v1.7.0/go.mod h1:yip1STH7Bqfm4fD0So5HgyNbt5taG5Cplc4xXxETyLI=
|
github.com/resendlabs/resend-go v1.7.0/go.mod h1:yip1STH7Bqfm4fD0So5HgyNbt5taG5Cplc4xXxETyLI=
|
||||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
@ -78,6 +80,8 @@ github.com/stripe/stripe-go/v76 v76.17.0 h1:/a5B21zNiSjx283dvmhclH410+RaefkYo0Qx
|
||||||
github.com/stripe/stripe-go/v76 v76.17.0/go.mod h1:rw1MxjlAKKcZ+3FOXgTHgwiOa2ya6CPq6ykpJ0Q6Po4=
|
github.com/stripe/stripe-go/v76 v76.17.0/go.mod h1:rw1MxjlAKKcZ+3FOXgTHgwiOa2ya6CPq6ykpJ0Q6Po4=
|
||||||
github.com/svix/svix-webhooks v1.18.0 h1:gcMrTpbyyN/Y2XP+8dEpQCDrMKu63R+a4W+EENpOUZA=
|
github.com/svix/svix-webhooks v1.18.0 h1:gcMrTpbyyN/Y2XP+8dEpQCDrMKu63R+a4W+EENpOUZA=
|
||||||
github.com/svix/svix-webhooks v1.18.0/go.mod h1:qGeiECF5WRQElyfF0i2CqUtWk2GQJTgL+EJZ/WRCxok=
|
github.com/svix/svix-webhooks v1.18.0/go.mod h1:qGeiECF5WRQElyfF0i2CqUtWk2GQJTgL+EJZ/WRCxok=
|
||||||
|
github.com/svix/svix-webhooks v1.19.0 h1:Uu9FsV0uMeo4E0d7c/gc+CwqIlc17ZvDEjTh5ts5jS0=
|
||||||
|
github.com/svix/svix-webhooks v1.19.0/go.mod h1:qGeiECF5WRQElyfF0i2CqUtWk2GQJTgL+EJZ/WRCxok=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||||
|
|
1
main.go
1
main.go
|
@ -7,7 +7,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path/filepath"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"atri.dad/api"
|
"atri.dad/api"
|
||||||
|
|
2
public/js/htmx.base.js
vendored
2
public/js/htmx.base.js
vendored
File diff suppressed because one or more lines are too long
36
public/js/htmx.sse.js
vendored
36
public/js/htmx.sse.js
vendored
|
@ -5,7 +5,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function () {
|
||||||
|
|
||||||
/** @type {import("../htmx").HtmxInternalApi} */
|
/** @type {import("../htmx").HtmxInternalApi} */
|
||||||
var api;
|
var api;
|
||||||
|
@ -18,7 +18,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
* @param {import("../htmx").HtmxInternalApi} api
|
* @param {import("../htmx").HtmxInternalApi} api
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
init: function(apiRef) {
|
init: function (apiRef) {
|
||||||
// store a reference to the internal API.
|
// store a reference to the internal API.
|
||||||
api = apiRef;
|
api = apiRef;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
* @returns void
|
* @returns void
|
||||||
*/
|
*/
|
||||||
onEvent: function(name, evt) {
|
onEvent: function (name, evt) {
|
||||||
|
|
||||||
switch (name) {
|
switch (name) {
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
var source = internalData.sseEventSource;
|
var source = internalData.sseEventSource;
|
||||||
|
|
||||||
// Add message handlers for every `sse-swap` attribute
|
// Add message handlers for every `sse-swap` attribute
|
||||||
queryAttributeOnThisOrChildren(elt, "sse-swap").forEach(function(child) {
|
queryAttributeOnThisOrChildren(elt, "sse-swap").forEach(function (child) {
|
||||||
|
|
||||||
var sseSwapAttr = api.getAttributeValue(child, "sse-swap");
|
var sseSwapAttr = api.getAttributeValue(child, "sse-swap");
|
||||||
if (sseSwapAttr) {
|
if (sseSwapAttr) {
|
||||||
|
@ -135,7 +135,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
|
|
||||||
for (var i = 0; i < sseEventNames.length; i++) {
|
for (var i = 0; i < sseEventNames.length; i++) {
|
||||||
var sseEventName = sseEventNames[i].trim();
|
var sseEventName = sseEventNames[i].trim();
|
||||||
var listener = function(event) {
|
var listener = function (event) {
|
||||||
|
|
||||||
// If the source is missing then close SSE
|
// If the source is missing then close SSE
|
||||||
if (maybeCloseSSESource(sourceElement)) {
|
if (maybeCloseSSESource(sourceElement)) {
|
||||||
|
@ -159,7 +159,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add message handlers for every `hx-trigger="sse:*"` attribute
|
// Add message handlers for every `hx-trigger="sse:*"` attribute
|
||||||
queryAttributeOnThisOrChildren(elt, "hx-trigger").forEach(function(child) {
|
queryAttributeOnThisOrChildren(elt, "hx-trigger").forEach(function (child) {
|
||||||
|
|
||||||
var sseEventName = api.getAttributeValue(child, "hx-trigger");
|
var sseEventName = api.getAttributeValue(child, "hx-trigger");
|
||||||
if (sseEventName == null) {
|
if (sseEventName == null) {
|
||||||
|
@ -174,7 +174,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
// remove the sse: prefix from here on out
|
// remove the sse: prefix from here on out
|
||||||
sseEventName = sseEventName.substr(4);
|
sseEventName = sseEventName.substr(4);
|
||||||
|
|
||||||
var listener = function() {
|
var listener = function () {
|
||||||
if (maybeCloseSSESource(sourceElement)) {
|
if (maybeCloseSSESource(sourceElement)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle extension source creation attribute
|
// handle extension source creation attribute
|
||||||
queryAttributeOnThisOrChildren(elt, "sse-connect").forEach(function(child) {
|
queryAttributeOnThisOrChildren(elt, "sse-connect").forEach(function (child) {
|
||||||
var sseURL = api.getAttributeValue(child, "sse-connect");
|
var sseURL = api.getAttributeValue(child, "sse-connect");
|
||||||
if (sseURL == null) {
|
if (sseURL == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -211,7 +211,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
});
|
});
|
||||||
|
|
||||||
// handle legacy sse, remove for HTMX2
|
// handle legacy sse, remove for HTMX2
|
||||||
queryAttributeOnThisOrChildren(elt, "hx-sse").forEach(function(child) {
|
queryAttributeOnThisOrChildren(elt, "hx-sse").forEach(function (child) {
|
||||||
var sseURL = getLegacySSEURL(child);
|
var sseURL = getLegacySSEURL(child);
|
||||||
if (sseURL == null) {
|
if (sseURL == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -225,7 +225,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
function ensureEventSource(elt, url, retryCount) {
|
function ensureEventSource(elt, url, retryCount) {
|
||||||
var source = htmx.createEventSource(url);
|
var source = htmx.createEventSource(url);
|
||||||
|
|
||||||
source.onerror = function(err) {
|
source.onerror = function (err) {
|
||||||
|
|
||||||
// Log an error event
|
// Log an error event
|
||||||
api.triggerErrorEvent(elt, "htmx:sseError", { error: err, source: source });
|
api.triggerErrorEvent(elt, "htmx:sseError", { error: err, source: source });
|
||||||
|
@ -239,13 +239,13 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
if (source.readyState === EventSource.CLOSED) {
|
if (source.readyState === EventSource.CLOSED) {
|
||||||
retryCount = retryCount || 0;
|
retryCount = retryCount || 0;
|
||||||
var timeout = Math.random() * (2 ^ retryCount) * 500;
|
var timeout = Math.random() * (2 ^ retryCount) * 500;
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function () {
|
||||||
ensureEventSourceOnElement(elt, Math.min(7, retryCount + 1));
|
ensureEventSourceOnElement(elt, Math.min(7, retryCount + 1));
|
||||||
}, timeout);
|
}, timeout);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
source.onopen = function(evt) {
|
source.onopen = function (evt) {
|
||||||
api.triggerEvent(elt, "htmx:sseOpen", { source: source });
|
api.triggerEvent(elt, "htmx:sseOpen", { source: source });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search all child nodes that match the requested attribute
|
// Search all child nodes that match the requested attribute
|
||||||
elt.querySelectorAll("[" + attributeName + "], [data-" + attributeName + "]").forEach(function(node) {
|
elt.querySelectorAll("[" + attributeName + "], [data-" + attributeName + "]").forEach(function (node) {
|
||||||
result.push(node);
|
result.push(node);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
*/
|
*/
|
||||||
function swap(elt, content) {
|
function swap(elt, content) {
|
||||||
|
|
||||||
api.withExtensions(elt, function(extension) {
|
api.withExtensions(elt, function (extension) {
|
||||||
content = extension.transformResponse(content, null, elt);
|
content = extension.transformResponse(content, null, elt);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
|
|
||||||
api.selectAndSwap(swapSpec.swapStyle, target, elt, content, settleInfo);
|
api.selectAndSwap(swapSpec.swapStyle, target, elt, content, settleInfo);
|
||||||
|
|
||||||
settleInfo.elts.forEach(function(elt) {
|
settleInfo.elts.forEach(function (elt) {
|
||||||
if (elt.classList) {
|
if (elt.classList) {
|
||||||
elt.classList.add(htmx.config.settlingClass);
|
elt.classList.add(htmx.config.settlingClass);
|
||||||
}
|
}
|
||||||
|
@ -334,12 +334,12 @@ This extension adds support for Server Sent Events to htmx. See /www/extensions
|
||||||
*/
|
*/
|
||||||
function doSettle(settleInfo) {
|
function doSettle(settleInfo) {
|
||||||
|
|
||||||
return function() {
|
return function () {
|
||||||
settleInfo.tasks.forEach(function(task) {
|
settleInfo.tasks.forEach(function (task) {
|
||||||
task.call();
|
task.call();
|
||||||
});
|
});
|
||||||
|
|
||||||
settleInfo.elts.forEach(function(elt) {
|
settleInfo.elts.forEach(function (elt) {
|
||||||
if (elt.classList) {
|
if (elt.classList) {
|
||||||
elt.classList.remove(htmx.config.settlingClass);
|
elt.classList.remove(htmx.config.settlingClass);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue