ghost 5.87.0 → 5.87.1

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