ghost 5.85.2 → 5.86.0
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/components/tryghost-adapter-cache-memory-ttl-5.86.0.tgz +0 -0
- package/components/{tryghost-adapter-cache-redis-5.85.2.tgz → tryghost-adapter-cache-redis-5.86.0.tgz} +0 -0
- package/components/{tryghost-adapter-manager-5.85.2.tgz → tryghost-adapter-manager-5.86.0.tgz} +0 -0
- package/components/tryghost-announcement-bar-settings-5.86.0.tgz +0 -0
- package/components/{tryghost-api-framework-5.85.2.tgz → tryghost-api-framework-5.86.0.tgz} +0 -0
- package/components/tryghost-api-version-compatibility-service-5.86.0.tgz +0 -0
- package/components/tryghost-audience-feedback-5.86.0.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.86.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.86.0.tgz +0 -0
- package/components/tryghost-collections-5.86.0.tgz +0 -0
- package/components/tryghost-constants-5.86.0.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.86.0.tgz +0 -0
- package/components/tryghost-data-generator-5.86.0.tgz +0 -0
- package/components/tryghost-domain-events-5.86.0.tgz +0 -0
- package/components/tryghost-donations-5.86.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.86.0.tgz +0 -0
- package/components/{tryghost-email-addresses-5.85.2.tgz → tryghost-email-addresses-5.86.0.tgz} +0 -0
- package/components/{tryghost-email-analytics-provider-mailgun-5.85.2.tgz → tryghost-email-analytics-provider-mailgun-5.86.0.tgz} +0 -0
- package/components/tryghost-email-analytics-service-5.86.0.tgz +0 -0
- package/components/tryghost-email-content-generator-5.86.0.tgz +0 -0
- package/components/{tryghost-email-events-5.85.2.tgz → tryghost-email-events-5.86.0.tgz} +0 -0
- package/components/tryghost-email-service-5.86.0.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.86.0.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.86.0.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.86.0.tgz +0 -0
- package/components/tryghost-extract-api-key-5.86.0.tgz +0 -0
- package/components/tryghost-ghost-5.86.0.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.86.0.tgz +0 -0
- package/components/tryghost-i18n-5.86.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.86.0.tgz +0 -0
- package/components/tryghost-importer-revue-5.86.0.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.86.0.tgz +0 -0
- package/components/{tryghost-job-manager-5.85.2.tgz → tryghost-job-manager-5.86.0.tgz} +0 -0
- package/components/tryghost-link-redirects-5.86.0.tgz +0 -0
- package/components/{tryghost-link-replacer-5.85.2.tgz → tryghost-link-replacer-5.86.0.tgz} +0 -0
- package/components/tryghost-link-tracking-5.86.0.tgz +0 -0
- package/components/tryghost-magic-link-5.86.0.tgz +0 -0
- package/components/tryghost-mail-events-5.86.0.tgz +0 -0
- package/components/{tryghost-mailgun-client-5.85.2.tgz → tryghost-mailgun-client-5.86.0.tgz} +0 -0
- package/components/{tryghost-member-attribution-5.85.2.tgz → tryghost-member-attribution-5.86.0.tgz} +0 -0
- package/components/{tryghost-member-events-5.85.2.tgz → tryghost-member-events-5.86.0.tgz} +0 -0
- package/components/{tryghost-members-api-5.85.2.tgz → tryghost-members-api-5.86.0.tgz} +0 -0
- package/components/tryghost-members-csv-5.86.0.tgz +0 -0
- package/components/tryghost-members-events-service-5.86.0.tgz +0 -0
- package/components/tryghost-members-importer-5.86.0.tgz +0 -0
- package/components/{tryghost-members-offers-5.85.2.tgz → tryghost-members-offers-5.86.0.tgz} +0 -0
- package/components/tryghost-members-payments-5.86.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.86.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.86.0.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.86.0.tgz +0 -0
- package/components/tryghost-milestones-5.86.0.tgz +0 -0
- package/components/{tryghost-minifier-5.85.2.tgz → tryghost-minifier-5.86.0.tgz} +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.86.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.86.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.86.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.86.0.tgz +0 -0
- package/components/{tryghost-mw-session-from-token-5.85.2.tgz → tryghost-mw-session-from-token-5.86.0.tgz} +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.86.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.86.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.86.0.tgz +0 -0
- package/components/{tryghost-nql-filter-expansions-5.85.2.tgz → tryghost-nql-filter-expansions-5.86.0.tgz} +0 -0
- package/components/tryghost-oembed-service-5.86.0.tgz +0 -0
- package/components/tryghost-package-json-5.86.0.tgz +0 -0
- package/components/tryghost-post-events-5.86.0.tgz +0 -0
- package/components/tryghost-post-revisions-5.86.0.tgz +0 -0
- package/components/tryghost-posts-service-5.86.0.tgz +0 -0
- package/components/tryghost-recommendations-5.86.0.tgz +0 -0
- package/components/tryghost-referrers-5.86.0.tgz +0 -0
- package/components/{tryghost-security-5.85.2.tgz → tryghost-security-5.86.0.tgz} +0 -0
- package/components/{tryghost-session-service-5.85.2.tgz → tryghost-session-service-5.86.0.tgz} +0 -0
- package/components/tryghost-settings-path-manager-5.86.0.tgz +0 -0
- package/components/tryghost-slack-notifications-5.86.0.tgz +0 -0
- package/components/{tryghost-staff-service-5.85.2.tgz → tryghost-staff-service-5.86.0.tgz} +0 -0
- package/components/tryghost-stats-service-5.86.0.tgz +0 -0
- package/components/{tryghost-tiers-5.85.2.tgz → tryghost-tiers-5.86.0.tgz} +0 -0
- package/components/{tryghost-update-check-service-5.85.2.tgz → tryghost-update-check-service-5.86.0.tgz} +0 -0
- package/components/tryghost-verification-trigger-5.86.0.tgz +0 -0
- package/components/{tryghost-version-notifications-data-service-5.85.2.tgz → tryghost-version-notifications-data-service-5.86.0.tgz} +0 -0
- package/components/{tryghost-webmentions-5.85.2.tgz → tryghost-webmentions-5.86.0.tgz} +0 -0
- package/core/boot.js +7 -6
- package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +3 -6989
- package/core/built/admin/assets/admin-x-activitypub/index-8aaa062c.mjs +14980 -0
- package/core/built/admin/assets/admin-x-activitypub/modals-124e649f.mjs +521 -0
- package/core/built/admin/assets/admin-x-activitypub/styles/reader.css +1928 -0
- package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +1 -1
- package/core/built/admin/assets/admin-x-demo/{index-76afb59a.mjs → index-ea257d67.mjs} +4 -4
- package/core/built/admin/assets/admin-x-demo/{modals-e22a0556.mjs → modals-0790023d.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{CodeEditorView-bc39a650.mjs → CodeEditorView-7dd72fff.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-ab51beed.mjs → index-3b15dfb3.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-f1611931.mjs → index-8b8bf7d6.mjs} +2254 -2270
- package/core/built/admin/assets/admin-x-settings/{modals-7d0e7ce5.mjs → modals-71f5a60d.mjs} +10 -6
- package/core/built/admin/assets/{chunk.216.700faeec5043322dc8d5.js → chunk.216.1641331b33471771559d.js} +3 -3
- package/core/built/admin/assets/{chunk.524.c89bfae0cab046c8c5a4.js → chunk.524.c7b0bf99001aaf59b891.js} +5 -5
- package/core/built/admin/assets/{chunk.582.9dd2b9a65b048e650888.js → chunk.582.727d60402bc9ff454dfa.js} +6 -6
- package/core/built/admin/assets/{ghost-da719d2c50388e7f72e596e1a8b99e80.css → ghost-117facae643a21dde076079b84fce471.css} +1 -1
- package/core/built/admin/assets/{ghost-648739878fcdb7a22ab135757c8e3fab.js → ghost-cc7512accd98e0fa3cc0906c52204a55.js} +120 -129
- package/core/built/admin/assets/{ghost-dark-3cbc750010886456986b77ff03283139.css → ghost-dark-031957661056b00048f03aac0618c480.css} +1 -1
- package/core/built/admin/assets/koenig-lexical/index.css +1 -1
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +8740 -8715
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +110 -108
- package/core/built/admin/index.html +5 -5
- package/core/frontend/helpers/ghost_head.js +12 -13
- package/core/frontend/web/site.js +0 -33
- package/core/server/GhostServer.js +2 -2
- package/core/server/data/db/index.js +0 -9
- package/core/server/web/api/endpoints/admin/app.js +1 -1
- package/core/server/web/api/middleware/upload.js +9 -5
- package/core/shared/instrumentation.js +33 -0
- package/core/shared/labs.js +2 -4
- package/package.json +165 -156
- package/yarn.lock +1354 -300
- package/components/tryghost-adapter-cache-memory-ttl-5.85.2.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.85.2.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-5.85.2.tgz +0 -0
- package/components/tryghost-audience-feedback-5.85.2.tgz +0 -0
- package/components/tryghost-bookshelf-repository-5.85.2.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.85.2.tgz +0 -0
- package/components/tryghost-collections-5.85.2.tgz +0 -0
- package/components/tryghost-constants-5.85.2.tgz +0 -0
- package/components/tryghost-custom-theme-settings-service-5.85.2.tgz +0 -0
- package/components/tryghost-data-generator-5.85.2.tgz +0 -0
- package/components/tryghost-domain-events-5.85.2.tgz +0 -0
- package/components/tryghost-donations-5.85.2.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.85.2.tgz +0 -0
- package/components/tryghost-email-analytics-service-5.85.2.tgz +0 -0
- package/components/tryghost-email-content-generator-5.85.2.tgz +0 -0
- package/components/tryghost-email-service-5.85.2.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.85.2.tgz +0 -0
- package/components/tryghost-express-dynamic-redirects-5.85.2.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.85.2.tgz +0 -0
- package/components/tryghost-extract-api-key-5.85.2.tgz +0 -0
- package/components/tryghost-ghost-5.85.2.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.85.2.tgz +0 -0
- package/components/tryghost-i18n-5.85.2.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.85.2.tgz +0 -0
- package/components/tryghost-importer-revue-5.85.2.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.85.2.tgz +0 -0
- package/components/tryghost-link-redirects-5.85.2.tgz +0 -0
- package/components/tryghost-link-tracking-5.85.2.tgz +0 -0
- package/components/tryghost-magic-link-5.85.2.tgz +0 -0
- package/components/tryghost-mail-events-5.85.2.tgz +0 -0
- package/components/tryghost-members-csv-5.85.2.tgz +0 -0
- package/components/tryghost-members-events-service-5.85.2.tgz +0 -0
- package/components/tryghost-members-importer-5.85.2.tgz +0 -0
- package/components/tryghost-members-payments-5.85.2.tgz +0 -0
- package/components/tryghost-members-ssr-5.85.2.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.85.2.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.85.2.tgz +0 -0
- package/components/tryghost-milestones-5.85.2.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.85.2.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.85.2.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.85.2.tgz +0 -0
- package/components/tryghost-mw-error-handler-5.85.2.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.85.2.tgz +0 -0
- package/components/tryghost-mw-version-match-5.85.2.tgz +0 -0
- package/components/tryghost-mw-vhost-5.85.2.tgz +0 -0
- package/components/tryghost-oembed-service-5.85.2.tgz +0 -0
- package/components/tryghost-package-json-5.85.2.tgz +0 -0
- package/components/tryghost-post-events-5.85.2.tgz +0 -0
- package/components/tryghost-post-revisions-5.85.2.tgz +0 -0
- package/components/tryghost-posts-service-5.85.2.tgz +0 -0
- package/components/tryghost-recommendations-5.85.2.tgz +0 -0
- package/components/tryghost-referrers-5.85.2.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.85.2.tgz +0 -0
- package/components/tryghost-slack-notifications-5.85.2.tgz +0 -0
- package/components/tryghost-stats-service-5.85.2.tgz +0 -0
- package/components/tryghost-verification-trigger-5.85.2.tgz +0 -0
- /package/core/built/admin/assets/{chunk.216.700faeec5043322dc8d5.js.LICENSE.txt → chunk.216.1641331b33471771559d.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { u as ce, a as ie, c as s, j as e, H as J, b as de, B as H, d as ee, e as ue, f as I, g as K, N as B, h as X, i as me, k as xe, s as pe, l as se, m as be, L as te, n as oe, A as ae, o as fe } from "./index-8aaa062c.mjs";
|
|
2
|
+
const ge = ({
|
|
3
|
+
type: t = "text",
|
|
4
|
+
inputRef: l,
|
|
5
|
+
title: a,
|
|
6
|
+
hideTitle: o,
|
|
7
|
+
value: d,
|
|
8
|
+
error: m,
|
|
9
|
+
placeholder: x,
|
|
10
|
+
rightPlaceholder: n,
|
|
11
|
+
hint: i,
|
|
12
|
+
onChange: p,
|
|
13
|
+
onFocus: y,
|
|
14
|
+
onBlur: f,
|
|
15
|
+
clearBg: j = !1,
|
|
16
|
+
className: g = "",
|
|
17
|
+
maxLength: _,
|
|
18
|
+
containerClassName: v = "",
|
|
19
|
+
hintClassName: h = "",
|
|
20
|
+
unstyled: L = !1,
|
|
21
|
+
disabled: k,
|
|
22
|
+
...G
|
|
23
|
+
}) => {
|
|
24
|
+
const T = ce(), { setFocusState: U } = ie(), A = (E) => {
|
|
25
|
+
y == null || y(E), U(!0);
|
|
26
|
+
}, V = (E) => {
|
|
27
|
+
f == null || f(E), U(!1);
|
|
28
|
+
}, O = s(
|
|
29
|
+
"relative order-2 flex w-full items-center",
|
|
30
|
+
a && !o && "mt-1.5"
|
|
31
|
+
), F = !L && s(
|
|
32
|
+
"absolute inset-0 rounded-lg border text-grey-300 transition-colors peer-hover:bg-grey-100 peer-focus:border-green peer-focus:bg-white peer-focus:shadow-[0_0_0_2px_rgba(48,207,67,.25)] dark:peer-hover:bg-grey-925 dark:peer-focus:bg-grey-950",
|
|
33
|
+
m ? "border-red bg-white dark:bg-grey-925" : "border-transparent bg-grey-150 dark:bg-grey-900",
|
|
34
|
+
k && "bg-grey-50 peer-hover:bg-grey-50 dark:bg-grey-950 dark:peer-hover:bg-grey-950"
|
|
35
|
+
), Q = !L && s(
|
|
36
|
+
"peer z-[1] order-2 h-9 w-full bg-transparent px-3 py-1.5 text-sm placeholder:text-grey-500 dark:placeholder:text-grey-700 md:h-[38px] md:py-2 md:text-md",
|
|
37
|
+
k ? "cursor-not-allowed text-grey-600 opacity-60 dark:text-grey-800" : "dark:text-white",
|
|
38
|
+
n ? "w-0 grow rounded-l-lg" : "rounded-lg",
|
|
39
|
+
g
|
|
40
|
+
), C = !L && s(
|
|
41
|
+
"z-[1] order-3 rounded-r-lg",
|
|
42
|
+
n ? typeof n == "string" ? "flex h-8 items-center py-1 pr-3 text-right text-sm text-grey-500 md:h-9 md:text-base" : "h-9 pr-1" : "pr-2"
|
|
43
|
+
);
|
|
44
|
+
let $ = /* @__PURE__ */ e.jsx(e.Fragment, {});
|
|
45
|
+
const z = /* @__PURE__ */ e.jsx(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
ref: l,
|
|
49
|
+
className: Q || g,
|
|
50
|
+
disabled: k,
|
|
51
|
+
id: T,
|
|
52
|
+
maxLength: _,
|
|
53
|
+
placeholder: x,
|
|
54
|
+
type: t,
|
|
55
|
+
value: d,
|
|
56
|
+
onBlur: V,
|
|
57
|
+
onChange: p,
|
|
58
|
+
onFocus: A,
|
|
59
|
+
...G
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
return $ = /* @__PURE__ */ e.jsxs("div", { className: O, children: [
|
|
63
|
+
z,
|
|
64
|
+
!L && !j && /* @__PURE__ */ e.jsx("div", { className: F || "" }),
|
|
65
|
+
n && /* @__PURE__ */ e.jsx("span", { className: C || "", children: n })
|
|
66
|
+
] }), h = s(
|
|
67
|
+
"order-3",
|
|
68
|
+
h
|
|
69
|
+
), v = s(
|
|
70
|
+
"flex flex-col",
|
|
71
|
+
v
|
|
72
|
+
), a || i ? /* @__PURE__ */ e.jsxs("div", { className: v, children: [
|
|
73
|
+
$,
|
|
74
|
+
a && /* @__PURE__ */ e.jsx(J, { className: o ? "sr-only" : "order-1", htmlFor: T, useLabelTag: !0, children: a }),
|
|
75
|
+
i && /* @__PURE__ */ e.jsx(de, { className: h, color: m ? "red" : "default", children: i })
|
|
76
|
+
] }) : $;
|
|
77
|
+
}, he = ({ size: t = "md", buttons: l, link: a, linkWithPadding: o, clearBg: d = !0, outlineOnMobile: m, className: x }) => {
|
|
78
|
+
let n = s(
|
|
79
|
+
"flex items-center justify-start rounded",
|
|
80
|
+
a ? "gap-4" : "gap-2",
|
|
81
|
+
x
|
|
82
|
+
);
|
|
83
|
+
return a && !d && (n = s(
|
|
84
|
+
"transition-all hover:bg-grey-200 dark:hover:bg-grey-900",
|
|
85
|
+
t === "sm" ? "h-7 px-3" : "h-[34px] px-4",
|
|
86
|
+
m && "border border-grey-300 hover:border-transparent md:border-transparent",
|
|
87
|
+
n
|
|
88
|
+
)), /* @__PURE__ */ e.jsx("div", { className: n, children: l.map(({ key: i, ...p }) => /* @__PURE__ */ e.jsx(H, { link: a, linkWithPadding: o, size: t, ...p }, i)) });
|
|
89
|
+
}, we = ({
|
|
90
|
+
shiftY: t,
|
|
91
|
+
footerBgColorClass: l = "bg-white dark:bg-black",
|
|
92
|
+
contentBgColorClass: a = "bg-white dark:bg-black",
|
|
93
|
+
height: o = 96,
|
|
94
|
+
children: d
|
|
95
|
+
}) => {
|
|
96
|
+
const m = s(
|
|
97
|
+
"w-100 sticky bottom-[-24px] z-[297] m-0 box-border p-0"
|
|
98
|
+
), x = t ? `calc(${t} - 24px)` : "-24px", n = `${o + 24}px`, i = s(
|
|
99
|
+
"sticky z-[298] block h-[24px]",
|
|
100
|
+
a
|
|
101
|
+
), p = "0", y = s(
|
|
102
|
+
"sticky z-[299] mb-[-24px] flex items-center justify-between",
|
|
103
|
+
"h-[96px]",
|
|
104
|
+
l
|
|
105
|
+
), f = "0", j = `${o}px`, g = "sticky mx-2 block h-[24px] rounded-full shadow-[0_0_0_1px_rgba(0,0,0,.025),0_-8px_16px_-3px_rgba(0,0,0,.08)]", _ = t ? `calc(${t} + ${o - 24}px)` : `${o - 24}px`;
|
|
106
|
+
return /* @__PURE__ */ e.jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: m,
|
|
110
|
+
style: {
|
|
111
|
+
bottom: x,
|
|
112
|
+
height: n
|
|
113
|
+
},
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ e.jsx(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: i,
|
|
119
|
+
style: {
|
|
120
|
+
bottom: p
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ e.jsx(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: y,
|
|
128
|
+
style: {
|
|
129
|
+
bottom: f,
|
|
130
|
+
height: j
|
|
131
|
+
},
|
|
132
|
+
children: d
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ e.jsx(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
className: g,
|
|
139
|
+
style: {
|
|
140
|
+
bottom: _
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
function Y(t, l, a = {}) {
|
|
149
|
+
t ? B.show(ke, {
|
|
150
|
+
title: "Are you sure you want to leave this page?",
|
|
151
|
+
prompt: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
152
|
+
/* @__PURE__ */ e.jsx("p", { children: "Hey there! It looks like you didn't save the changes you made." }),
|
|
153
|
+
/* @__PURE__ */ e.jsx("p", { children: "Save before you go!" })
|
|
154
|
+
] }),
|
|
155
|
+
okLabel: "Leave",
|
|
156
|
+
cancelLabel: "Stay",
|
|
157
|
+
okColor: "red",
|
|
158
|
+
onOk: (o) => {
|
|
159
|
+
l(), o == null || o.remove();
|
|
160
|
+
},
|
|
161
|
+
...a
|
|
162
|
+
}) : l();
|
|
163
|
+
}
|
|
164
|
+
const ye = "bg-[rgba(98,109,121,0.2)] backdrop-blur-[3px]", R = ({
|
|
165
|
+
size: t = "md",
|
|
166
|
+
width: l,
|
|
167
|
+
height: a,
|
|
168
|
+
testId: o,
|
|
169
|
+
title: d,
|
|
170
|
+
okLabel: m = "OK",
|
|
171
|
+
okLoading: x = !1,
|
|
172
|
+
cancelLabel: n = "Cancel",
|
|
173
|
+
footer: i,
|
|
174
|
+
header: p,
|
|
175
|
+
leftButtonProps: y,
|
|
176
|
+
buttonsDisabled: f,
|
|
177
|
+
padding: j = !0,
|
|
178
|
+
onOk: g,
|
|
179
|
+
okColor: _ = "black",
|
|
180
|
+
onCancel: v,
|
|
181
|
+
topRightContent: h,
|
|
182
|
+
hideXOnMobile: L = !1,
|
|
183
|
+
afterClose: k,
|
|
184
|
+
children: G,
|
|
185
|
+
backDrop: T = !0,
|
|
186
|
+
backDropClick: U = !0,
|
|
187
|
+
stickyFooter: A = !1,
|
|
188
|
+
stickyHeader: V = !1,
|
|
189
|
+
scrolling: O = !0,
|
|
190
|
+
dirty: F = !1,
|
|
191
|
+
animate: Q = !0,
|
|
192
|
+
formSheet: C = !1,
|
|
193
|
+
enableCMDS: $ = !0
|
|
194
|
+
}) => {
|
|
195
|
+
const z = ee(), { setGlobalDirtyState: E } = ue(), [Z, le] = I(!1);
|
|
196
|
+
K(() => {
|
|
197
|
+
E(F);
|
|
198
|
+
}, [F, E]), K(() => {
|
|
199
|
+
const w = (N) => {
|
|
200
|
+
N.key === "Escape" && (document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), setTimeout(() => {
|
|
201
|
+
v ? v() : Y(F, () => {
|
|
202
|
+
z.remove(), k == null || k();
|
|
203
|
+
});
|
|
204
|
+
}), N.stopPropagation());
|
|
205
|
+
};
|
|
206
|
+
return document.addEventListener("keydown", w), () => {
|
|
207
|
+
document.removeEventListener("keydown", w);
|
|
208
|
+
};
|
|
209
|
+
}, [z, F, k, v]), K(() => {
|
|
210
|
+
const w = setTimeout(() => {
|
|
211
|
+
le(!0);
|
|
212
|
+
}, 250);
|
|
213
|
+
return () => clearTimeout(w);
|
|
214
|
+
}, []), K(() => {
|
|
215
|
+
if (g) {
|
|
216
|
+
const w = (N) => {
|
|
217
|
+
(N.metaKey || N.ctrlKey) && N.key === "s" && (N.preventDefault(), g());
|
|
218
|
+
};
|
|
219
|
+
if ($)
|
|
220
|
+
return window.addEventListener("keydown", w), () => {
|
|
221
|
+
window.removeEventListener("keydown", w);
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
const q = [];
|
|
226
|
+
let S;
|
|
227
|
+
const W = () => {
|
|
228
|
+
Y(F, () => {
|
|
229
|
+
z.remove(), k == null || k();
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
i || (n && q.push({
|
|
233
|
+
key: "cancel-modal",
|
|
234
|
+
label: n,
|
|
235
|
+
color: "outline",
|
|
236
|
+
onClick: v || (() => {
|
|
237
|
+
W();
|
|
238
|
+
}),
|
|
239
|
+
disabled: f
|
|
240
|
+
}), m && q.push({
|
|
241
|
+
key: "ok-modal",
|
|
242
|
+
label: m,
|
|
243
|
+
color: _,
|
|
244
|
+
className: "min-w-[80px]",
|
|
245
|
+
onClick: g,
|
|
246
|
+
disabled: f,
|
|
247
|
+
loading: x
|
|
248
|
+
}));
|
|
249
|
+
let c = s(
|
|
250
|
+
"relative z-50 mx-auto flex max-h-[100%] w-full flex-col justify-between overflow-x-hidden bg-white dark:bg-black",
|
|
251
|
+
t !== "bleed" && "rounded",
|
|
252
|
+
C ? "shadow-md" : "shadow-xl",
|
|
253
|
+
Q && !C && !Z && "animate-modal-in",
|
|
254
|
+
C && !Z && "animate-modal-in-reverse",
|
|
255
|
+
O ? "overflow-y-auto" : "overflow-y-hidden"
|
|
256
|
+
), u = s(
|
|
257
|
+
"fixed inset-0 z-[1000] h-[100vh] w-[100vw]"
|
|
258
|
+
), b = "", r = s(
|
|
259
|
+
!h || h === "close" ? "" : "flex items-center justify-between gap-5"
|
|
260
|
+
);
|
|
261
|
+
switch (V && (r = s(
|
|
262
|
+
r,
|
|
263
|
+
"sticky top-0 z-[200] -mb-4 bg-white !pb-4 dark:bg-black"
|
|
264
|
+
)), t) {
|
|
265
|
+
case "sm":
|
|
266
|
+
c = s(
|
|
267
|
+
c,
|
|
268
|
+
"max-w-[480px]"
|
|
269
|
+
), u = s(
|
|
270
|
+
u,
|
|
271
|
+
"p-4 md:p-[8vmin]"
|
|
272
|
+
), b = "p-8", r = s(
|
|
273
|
+
r,
|
|
274
|
+
"-inset-x-8"
|
|
275
|
+
);
|
|
276
|
+
break;
|
|
277
|
+
case "md":
|
|
278
|
+
c = s(
|
|
279
|
+
c,
|
|
280
|
+
"max-w-[720px]"
|
|
281
|
+
), u = s(
|
|
282
|
+
u,
|
|
283
|
+
"p-4 md:p-[8vmin]"
|
|
284
|
+
), b = "p-8", r = s(
|
|
285
|
+
r,
|
|
286
|
+
"-inset-x-8"
|
|
287
|
+
);
|
|
288
|
+
break;
|
|
289
|
+
case "lg":
|
|
290
|
+
c = s(
|
|
291
|
+
c,
|
|
292
|
+
"max-w-[1020px]"
|
|
293
|
+
), u = s(
|
|
294
|
+
u,
|
|
295
|
+
"p-4 md:p-[4vmin]"
|
|
296
|
+
), b = "p-7", r = s(
|
|
297
|
+
r,
|
|
298
|
+
"-inset-x-8"
|
|
299
|
+
);
|
|
300
|
+
break;
|
|
301
|
+
case "xl":
|
|
302
|
+
c = s(
|
|
303
|
+
c,
|
|
304
|
+
"max-w-[1240px]0"
|
|
305
|
+
), u = s(
|
|
306
|
+
u,
|
|
307
|
+
"p-4 md:p-[3vmin]"
|
|
308
|
+
), b = "p-10", r = s(
|
|
309
|
+
r,
|
|
310
|
+
"-inset-x-10 -top-10"
|
|
311
|
+
);
|
|
312
|
+
break;
|
|
313
|
+
case "full":
|
|
314
|
+
c = s(
|
|
315
|
+
c,
|
|
316
|
+
"h-full"
|
|
317
|
+
), u = s(
|
|
318
|
+
u,
|
|
319
|
+
"p-4 md:p-[3vmin]"
|
|
320
|
+
), b = "p-10", r = s(
|
|
321
|
+
r,
|
|
322
|
+
"-inset-x-10"
|
|
323
|
+
);
|
|
324
|
+
break;
|
|
325
|
+
case "bleed":
|
|
326
|
+
c = s(
|
|
327
|
+
c,
|
|
328
|
+
"h-full"
|
|
329
|
+
), b = "p-10", r = s(
|
|
330
|
+
r,
|
|
331
|
+
"-inset-x-10"
|
|
332
|
+
);
|
|
333
|
+
break;
|
|
334
|
+
default:
|
|
335
|
+
u = s(
|
|
336
|
+
u,
|
|
337
|
+
"p-4 md:p-[8vmin]"
|
|
338
|
+
), b = "p-8", r = s(
|
|
339
|
+
r,
|
|
340
|
+
"-inset-x-8"
|
|
341
|
+
);
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
j || (b = "p-0"), c = s(
|
|
345
|
+
c
|
|
346
|
+
), r = s(
|
|
347
|
+
r,
|
|
348
|
+
b,
|
|
349
|
+
"pb-0"
|
|
350
|
+
), S = s(
|
|
351
|
+
b,
|
|
352
|
+
"py-0"
|
|
353
|
+
), u = s(
|
|
354
|
+
u,
|
|
355
|
+
"max-[800px]:!pb-20"
|
|
356
|
+
);
|
|
357
|
+
const re = s(
|
|
358
|
+
`${b} ${A ? "py-6" : ""}`,
|
|
359
|
+
"flex w-full items-center justify-between"
|
|
360
|
+
);
|
|
361
|
+
S = s(
|
|
362
|
+
S,
|
|
363
|
+
(t === "full" || t === "bleed" || a === "full" || typeof a == "number") && "grow"
|
|
364
|
+
);
|
|
365
|
+
const ne = (w) => {
|
|
366
|
+
w.target === w.currentTarget && U && W();
|
|
367
|
+
}, D = {};
|
|
368
|
+
typeof l == "number" ? (D.width = "100%", D.maxWidth = l + "px") : l === "full" && (c = s(
|
|
369
|
+
c,
|
|
370
|
+
"w-full"
|
|
371
|
+
)), typeof a == "number" ? (D.height = "100%", D.maxHeight = a + "px") : a === "full" && (c = s(
|
|
372
|
+
c,
|
|
373
|
+
"h-full"
|
|
374
|
+
));
|
|
375
|
+
let M;
|
|
376
|
+
return i ? M = i : i === !1 ? S += " pb-0 " : M = /* @__PURE__ */ e.jsxs("div", { className: re, children: [
|
|
377
|
+
/* @__PURE__ */ e.jsx("div", { children: y && /* @__PURE__ */ e.jsx(H, { ...y }) }),
|
|
378
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ e.jsx(he, { buttons: q }) })
|
|
379
|
+
] }), M = A ? /* @__PURE__ */ e.jsx(we, { height: 84, children: M }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: M }), /* @__PURE__ */ e.jsxs("div", { className: u, id: "modal-backdrop", onMouseDown: ne, children: [
|
|
380
|
+
/* @__PURE__ */ e.jsx("div", { className: s(
|
|
381
|
+
"pointer-events-none fixed inset-0 z-0",
|
|
382
|
+
T && !C && ye,
|
|
383
|
+
C && "bg-[rgba(98,109,121,0.08)]"
|
|
384
|
+
) }),
|
|
385
|
+
/* @__PURE__ */ e.jsxs("section", { className: c, "data-testid": o, style: D, children: [
|
|
386
|
+
p === !1 ? "" : !h || h === "close" ? /* @__PURE__ */ e.jsxs("header", { className: r, children: [
|
|
387
|
+
d && /* @__PURE__ */ e.jsx(J, { level: 3, children: d }),
|
|
388
|
+
/* @__PURE__ */ e.jsx("div", { className: `${h !== "close" && "md:!invisible md:!hidden"} ${L && "hidden"} absolute right-6 top-6`, children: /* @__PURE__ */ e.jsx(H, { className: "-m-2 cursor-pointer p-2 opacity-50 hover:opacity-100", icon: "close", iconColorClass: "text-black dark:text-white", size: "sm", testId: "close-modal", unstyled: !0, onClick: W }) })
|
|
389
|
+
] }) : /* @__PURE__ */ e.jsxs("header", { className: r, children: [
|
|
390
|
+
d && /* @__PURE__ */ e.jsx(J, { level: 3, children: d }),
|
|
391
|
+
h
|
|
392
|
+
] }),
|
|
393
|
+
/* @__PURE__ */ e.jsx("div", { className: S, children: G }),
|
|
394
|
+
M
|
|
395
|
+
] })
|
|
396
|
+
] });
|
|
397
|
+
}, ve = ({
|
|
398
|
+
title: t = "Are you sure?",
|
|
399
|
+
prompt: l,
|
|
400
|
+
cancelLabel: a = "Cancel",
|
|
401
|
+
okLabel: o = "OK",
|
|
402
|
+
okRunningLabel: d = "...",
|
|
403
|
+
okColor: m = "black",
|
|
404
|
+
onCancel: x,
|
|
405
|
+
onOk: n,
|
|
406
|
+
customFooter: i,
|
|
407
|
+
formSheet: p = !0
|
|
408
|
+
}) => {
|
|
409
|
+
const y = ee(), [f, j] = I("");
|
|
410
|
+
return /* @__PURE__ */ e.jsx(
|
|
411
|
+
R,
|
|
412
|
+
{
|
|
413
|
+
backDropClick: !1,
|
|
414
|
+
buttonsDisabled: f === "running",
|
|
415
|
+
cancelLabel: a,
|
|
416
|
+
footer: i,
|
|
417
|
+
formSheet: p,
|
|
418
|
+
okColor: m,
|
|
419
|
+
okLabel: f === "running" ? d : o,
|
|
420
|
+
testId: "confirmation-modal",
|
|
421
|
+
title: t,
|
|
422
|
+
width: 540,
|
|
423
|
+
onCancel: x,
|
|
424
|
+
onOk: async () => {
|
|
425
|
+
j("running");
|
|
426
|
+
try {
|
|
427
|
+
await (n == null ? void 0 : n(y));
|
|
428
|
+
} catch (g) {
|
|
429
|
+
console.error("Unhandled Promise Rejection. Make sure you catch errors in your onOk handler.", g);
|
|
430
|
+
}
|
|
431
|
+
j("");
|
|
432
|
+
},
|
|
433
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "py-4 leading-9", children: l })
|
|
434
|
+
}
|
|
435
|
+
);
|
|
436
|
+
}, ke = B.create(ve), je = B.create(() => {
|
|
437
|
+
const { updateRoute: t } = X(), l = B.useModal(), a = me(), o = xe(), [d, m] = I(""), [x, n] = I(null), i = async () => {
|
|
438
|
+
try {
|
|
439
|
+
await a.mutateAsync({ username: d }), pe({
|
|
440
|
+
message: "Site followed",
|
|
441
|
+
type: "success"
|
|
442
|
+
}), l.remove(), await o.refetchQueries({ queryKey: ["FollowingResponseData"], type: "active" }), t("");
|
|
443
|
+
} catch {
|
|
444
|
+
n(x);
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
return /* @__PURE__ */ e.jsx(
|
|
448
|
+
R,
|
|
449
|
+
{
|
|
450
|
+
afterClose: () => {
|
|
451
|
+
a.reset(), t("");
|
|
452
|
+
},
|
|
453
|
+
cancelLabel: "Cancel",
|
|
454
|
+
okLabel: "Follow",
|
|
455
|
+
size: "sm",
|
|
456
|
+
title: "Follow a Ghost site",
|
|
457
|
+
onOk: i,
|
|
458
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-4", children: /* @__PURE__ */ e.jsx(
|
|
459
|
+
ge,
|
|
460
|
+
{
|
|
461
|
+
autoFocus: !0,
|
|
462
|
+
error: !!x,
|
|
463
|
+
hint: x,
|
|
464
|
+
placeholder: "@username@hostname",
|
|
465
|
+
title: "Profile name",
|
|
466
|
+
value: d,
|
|
467
|
+
"data-test-new-follower": !0,
|
|
468
|
+
onChange: (p) => m(p.target.value)
|
|
469
|
+
}
|
|
470
|
+
) })
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
});
|
|
474
|
+
function P(t) {
|
|
475
|
+
if (!t.username || !t.id)
|
|
476
|
+
return "@unknown@unknown";
|
|
477
|
+
try {
|
|
478
|
+
return `@${t.username}@${new URL(t.id).hostname}`;
|
|
479
|
+
} catch {
|
|
480
|
+
return "@unknown@unknown";
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
const Fe = ({}) => {
|
|
484
|
+
const { updateRoute: t } = X(), l = se(), { data: { orderedItems: a = [] } = {} } = be("inbox");
|
|
485
|
+
return /* @__PURE__ */ e.jsx(
|
|
486
|
+
R,
|
|
487
|
+
{
|
|
488
|
+
afterClose: () => {
|
|
489
|
+
l.reset(), t("");
|
|
490
|
+
},
|
|
491
|
+
cancelLabel: "",
|
|
492
|
+
footer: !1,
|
|
493
|
+
okLabel: "",
|
|
494
|
+
size: "md",
|
|
495
|
+
title: "Followers",
|
|
496
|
+
topRightContent: "close",
|
|
497
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ e.jsx(te, { children: a.map((o) => /* @__PURE__ */ e.jsx(oe, { action: /* @__PURE__ */ e.jsx(H, { color: "grey", label: "Follow back", link: !0, onClick: () => l.mutate({ username: o.username }) }), avatar: /* @__PURE__ */ e.jsx(ae, { image: o.icon, size: "sm" }), detail: P(o), id: "list-item", title: o.name })) }) })
|
|
498
|
+
}
|
|
499
|
+
);
|
|
500
|
+
}, Ce = B.create(Fe), Ne = ({}) => {
|
|
501
|
+
const { updateRoute: t } = X(), l = se(), { data: { orderedItems: a = [] } = {} } = fe("inbox");
|
|
502
|
+
return /* @__PURE__ */ e.jsx(
|
|
503
|
+
R,
|
|
504
|
+
{
|
|
505
|
+
afterClose: () => {
|
|
506
|
+
l.reset(), t("");
|
|
507
|
+
},
|
|
508
|
+
cancelLabel: "",
|
|
509
|
+
footer: !1,
|
|
510
|
+
okLabel: "",
|
|
511
|
+
size: "md",
|
|
512
|
+
title: "Following",
|
|
513
|
+
topRightContent: "close",
|
|
514
|
+
children: /* @__PURE__ */ e.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ e.jsx(te, { children: a.map((o) => /* @__PURE__ */ e.jsx(oe, { action: /* @__PURE__ */ e.jsx(H, { color: "grey", label: "Unfollow", link: !0, onClick: () => l.mutate({ username: P(o) }) }), avatar: /* @__PURE__ */ e.jsx(ae, { image: o.icon, size: "sm" }), detail: P(o), id: "list-item", title: o.name })) }) })
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
}, Le = B.create(Ne), Me = { FollowSite: je, ViewFollowing: Le, ViewFollowers: Ce };
|
|
518
|
+
export {
|
|
519
|
+
Me as default
|
|
520
|
+
};
|
|
521
|
+
//# sourceMappingURL=modals-124e649f.mjs.map
|