@oktis-works/admin 0.4.6 → 0.4.8
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/dist/client/_astro/{AdminBar.CUVES5PS.js → AdminBar.DzMuNBYF.js} +1 -1
- package/dist/client/_astro/{AtGlanceWidget.Cq8OOJPG.js → AtGlanceWidget.BOjFuQS7.js} +1 -1
- package/dist/client/_astro/{Footer.BU0nQfsj.js → Footer.BtxRVJ1P.js} +1 -1
- package/dist/client/_astro/LanguageSelector.C-0zi24B.js +14 -0
- package/dist/client/_astro/{QuickDraftWidget.BklxPtXw.js → QuickDraftWidget.CF4qa2KP.js} +1 -1
- package/dist/client/_astro/{version.BBlB8V1z.js → version.BmMvDG5R.js} +1 -1
- package/dist/server/chunks/{ContentEditor_BIKFMKGc.mjs → ContentEditor_paUr0WB0.mjs} +2 -1
- package/dist/server/chunks/{DashboardLayout_DvpIbi-L.mjs → DashboardLayout_bJMTo5_t.mjs} +14 -521
- package/dist/server/chunks/{MediaLibrary_ayG_it4q.mjs → MediaLibrary_BgM0qDjE.mjs} +2 -1
- package/dist/server/chunks/{_slug__DGHktOQk.mjs → _slug__BVdYTmDk.mjs} +1 -1
- package/dist/server/chunks/{edit_zoYziljx.mjs → edit_Df3nKxDA.mjs} +2 -2
- package/dist/server/chunks/{general_CBOFvXp5.mjs → general_B2QOFsrL.mjs} +2 -1
- package/dist/server/chunks/i18n_DnHqy5K-.mjs +527 -0
- package/dist/server/chunks/{index_D6HRv5gR.mjs → index_BXSf628c.mjs} +2 -1
- package/dist/server/chunks/{index_B0Kv_zY5.mjs → index_BZSR2FuR.mjs} +2 -2
- package/dist/server/chunks/{index_B9j_Mdp1.mjs → index_CbvRfl4k.mjs} +1 -1
- package/dist/server/chunks/{index_BGAjNTWX.mjs → index__tMy7i2U.mjs} +2 -1
- package/dist/server/chunks/{index_DXH9TpQZ.mjs → index_tLDxAm-6.mjs} +2 -1
- package/dist/server/chunks/{new_1yZE_PrZ.mjs → new_BLRYsqbT.mjs} +2 -1
- package/dist/server/chunks/{new_BGsvWic-.mjs → new_Bj2fuXfp.mjs} +2 -2
- package/dist/server/chunks/{node_BafXIcNi.mjs → node_kWZa8y--.mjs} +3 -3
- package/dist/server/chunks/{post-types_9hCXqS5l.mjs → post-types_oVrKZTG4.mjs} +2 -1
- package/dist/server/chunks/remote_ByPF9VwL.mjs +49 -0
- package/dist/server/chunks/sequence_CQpaaIXP.mjs +1420 -0
- package/dist/server/chunks/{sharp_C91d8fsK.mjs → sharp_37gnUicY.mjs} +1 -1
- package/dist/server/chunks/{taxonomies_CzecicEb.mjs → taxonomies_Bmea7Rdp.mjs} +2 -1
- package/dist/server/chunks/{upload_BaboNcp0.mjs → upload_CFm-6KN9.mjs} +2 -2
- package/dist/server/entry.mjs +23 -1151
- package/dist/server/virtual_astro_middleware.mjs +56 -2
- package/package.json +1 -1
- package/dist/client/_astro/LanguageSelector.Q7Z9r8MH.js +0 -14
- package/dist/server/chunks/console_B_CnzVJ2.mjs +0 -170
- package/dist/server/chunks/remote_DUw5DMmE.mjs +0 -169
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region ../../node_modules/.bun/@astrojs+internal-helpers@0.11.0/node_modules/@astrojs/internal-helpers/dist/remote.js
|
|
2
|
+
function matchPattern(url, remotePattern) {
|
|
3
|
+
return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);
|
|
4
|
+
}
|
|
5
|
+
function matchPort(url, port) {
|
|
6
|
+
return !port || port === url.port;
|
|
7
|
+
}
|
|
8
|
+
function matchProtocol(url, protocol) {
|
|
9
|
+
return !protocol || protocol === url.protocol.slice(0, -1);
|
|
10
|
+
}
|
|
11
|
+
function matchHostname(url, hostname, allowWildcard = false) {
|
|
12
|
+
if (!hostname) return true;
|
|
13
|
+
else if (!allowWildcard || !hostname.startsWith("*")) return hostname === url.hostname;
|
|
14
|
+
else if (hostname.startsWith("**.")) {
|
|
15
|
+
const slicedHostname = hostname.slice(2);
|
|
16
|
+
return slicedHostname !== url.hostname && url.hostname.endsWith(slicedHostname);
|
|
17
|
+
} else if (hostname.startsWith("*.")) {
|
|
18
|
+
const slicedHostname = hostname.slice(1);
|
|
19
|
+
if (!url.hostname.endsWith(slicedHostname)) return false;
|
|
20
|
+
const subdomainWithDot = url.hostname.slice(0, -(slicedHostname.length - 1));
|
|
21
|
+
return subdomainWithDot.endsWith(".") && !subdomainWithDot.slice(0, -1).includes(".");
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
function matchPathname(url, pathname, allowWildcard = false) {
|
|
26
|
+
if (!pathname) return true;
|
|
27
|
+
else if (!allowWildcard || !pathname.endsWith("*")) return pathname === url.pathname;
|
|
28
|
+
else if (pathname.endsWith("/**")) {
|
|
29
|
+
const slicedPathname = pathname.slice(0, -2);
|
|
30
|
+
return slicedPathname !== url.pathname && url.pathname.startsWith(slicedPathname);
|
|
31
|
+
} else if (pathname.endsWith("/*")) {
|
|
32
|
+
const slicedPathname = pathname.slice(0, -1);
|
|
33
|
+
if (!url.pathname.startsWith(slicedPathname)) return false;
|
|
34
|
+
return url.pathname.slice(slicedPathname.length).split("/").filter(Boolean).length === 1;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
function isRemoteAllowed(src, { domains, remotePatterns }) {
|
|
39
|
+
if (!URL.canParse(src)) return false;
|
|
40
|
+
const url = new URL(src);
|
|
41
|
+
if (![
|
|
42
|
+
"http:",
|
|
43
|
+
"https:",
|
|
44
|
+
"data:"
|
|
45
|
+
].includes(url.protocol)) return false;
|
|
46
|
+
return domains.some((domain) => matchHostname(url, domain)) || remotePatterns.some((remotePattern) => matchPattern(url, remotePattern));
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { matchPattern as n, isRemoteAllowed as t };
|