ghost 5.86.2 → 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 (207) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +6 -5
  3. package/components/tryghost-adapter-cache-memory-ttl-5.87.1.tgz +0 -0
  4. package/components/{tryghost-adapter-cache-redis-5.86.2.tgz → tryghost-adapter-cache-redis-5.87.1.tgz} +0 -0
  5. package/components/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.86.2.tgz → tryghost-api-framework-5.87.1.tgz} +0 -0
  8. package/components/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.1.tgz +0 -0
  12. package/components/tryghost-collections-5.87.1.tgz +0 -0
  13. package/components/{tryghost-constants-5.86.2.tgz → tryghost-constants-5.87.1.tgz} +0 -0
  14. package/components/{tryghost-custom-theme-settings-service-5.86.2.tgz → tryghost-custom-theme-settings-service-5.87.1.tgz} +0 -0
  15. package/components/{tryghost-data-generator-5.86.2.tgz → tryghost-data-generator-5.87.1.tgz} +0 -0
  16. package/components/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.1.tgz +0 -0
  19. package/components/{tryghost-email-addresses-5.86.2.tgz → tryghost-email-addresses-5.87.1.tgz} +0 -0
  20. package/components/tryghost-email-analytics-provider-mailgun-5.87.1.tgz +0 -0
  21. package/components/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.86.2.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.1.tgz +0 -0
  27. package/components/tryghost-external-media-inliner-5.87.1.tgz +0 -0
  28. package/components/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.1.tgz +0 -0
  33. package/components/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.86.2.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.1.tgz +0 -0
  40. package/components/{tryghost-mail-events-5.86.2.tgz → tryghost-mail-events-5.87.1.tgz} +0 -0
  41. package/components/{tryghost-mailgun-client-5.86.2.tgz → tryghost-mailgun-client-5.87.1.tgz} +0 -0
  42. package/components/tryghost-member-attribution-5.87.1.tgz +0 -0
  43. package/components/{tryghost-member-events-5.86.2.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.86.2.tgz → 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.1.tgz +0 -0
  48. package/components/{tryghost-members-offers-5.86.2.tgz → tryghost-members-offers-5.87.1.tgz} +0 -0
  49. package/components/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.1.tgz +0 -0
  52. package/components/tryghost-mentions-email-report-5.87.1.tgz +0 -0
  53. package/components/tryghost-milestones-5.87.1.tgz +0 -0
  54. package/components/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.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.1.tgz +0 -0
  60. package/components/tryghost-mw-update-user-last-seen-5.87.1.tgz +0 -0
  61. package/components/tryghost-mw-version-match-5.87.1.tgz +0 -0
  62. package/components/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.1.tgz +0 -0
  66. package/components/tryghost-post-events-5.87.1.tgz +0 -0
  67. package/components/tryghost-post-revisions-5.87.1.tgz +0 -0
  68. package/components/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.86.2.tgz → tryghost-security-5.87.1.tgz} +0 -0
  72. package/components/tryghost-session-service-5.87.1.tgz +0 -0
  73. package/components/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.1.tgz +0 -0
  76. package/components/tryghost-stats-service-5.87.1.tgz +0 -0
  77. package/components/{tryghost-tiers-5.86.2.tgz → tryghost-tiers-5.87.1.tgz} +0 -0
  78. package/components/{tryghost-update-check-service-5.86.2.tgz → tryghost-update-check-service-5.87.1.tgz} +0 -0
  79. package/components/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.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 +3 -3
  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-7dd72fff.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-3b15dfb3.mjs → index-1caa03f1.mjs} +2 -2
  109. package/core/built/admin/assets/admin-x-settings/{index-8b8bf7d6.mjs → index-bb355172.mjs} +14004 -10340
  110. package/core/built/admin/assets/admin-x-settings/{modals-71f5a60d.mjs → modals-f496bf28.mjs} +10881 -14500
  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.6932df81384274864737.js → chunk.524.a032fbf6d6bbe20b0eb3.js} +5 -5
  114. package/core/built/admin/assets/{chunk.582.8f5385ac30ddd4826b66.js → chunk.582.bc65953e4022c385c144.js} +11 -11
  115. package/core/built/admin/assets/{ghost-cc7512accd98e0fa3cc0906c52204a55.js → ghost-b645099f33022aa37d96a2be8d8ddad1.js} +115 -130
  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 +30259 -29018
  120. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +167 -182
  121. package/core/built/admin/assets/{vendor-232fd88c6ffbd896b34c449112793e93.js → vendor-4e0f92ca2b1c0850606b912c70852e32.js} +505 -929
  122. package/core/built/admin/index.html +6 -6
  123. package/core/frontend/helpers/get.js +7 -5
  124. package/core/frontend/src/cards/css/bookmark.css +2 -0
  125. package/core/server/api/endpoints/utils/serializers/input/pages.js +32 -1
  126. package/core/server/api/endpoints/utils/serializers/input/posts.js +2 -2
  127. package/core/server/api/endpoints/utils/serializers/output/authentication.js +1 -1
  128. package/core/server/data/migrations/versions/5.87/2024-06-25-12-08-20-add-posts-tags-post-tag-index.js +26 -0
  129. package/core/server/data/migrations/versions/5.87/2024-06-25-12-08-45-add-posts-type-status-updated-at-index.js +4 -0
  130. package/core/server/data/schema/schema.js +7 -1
  131. package/core/server/models/base/plugins/crud.js +5 -0
  132. package/core/server/services/custom-redirects/validation.js +21 -3
  133. package/core/server/services/webhooks/WebhookTrigger.js +2 -1
  134. package/core/server/web/parent/app.js +1 -1
  135. package/core/shared/labs.js +0 -3
  136. package/package.json +158 -160
  137. package/yarn.lock +625 -892
  138. package/components/tryghost-adapter-cache-memory-ttl-5.86.2.tgz +0 -0
  139. package/components/tryghost-adapter-manager-5.86.2.tgz +0 -0
  140. package/components/tryghost-announcement-bar-settings-5.86.2.tgz +0 -0
  141. package/components/tryghost-api-version-compatibility-service-5.86.2.tgz +0 -0
  142. package/components/tryghost-audience-feedback-5.86.2.tgz +0 -0
  143. package/components/tryghost-bookshelf-repository-5.86.2.tgz +0 -0
  144. package/components/tryghost-bootstrap-socket-5.86.2.tgz +0 -0
  145. package/components/tryghost-collections-5.86.2.tgz +0 -0
  146. package/components/tryghost-domain-events-5.86.2.tgz +0 -0
  147. package/components/tryghost-donations-5.86.2.tgz +0 -0
  148. package/components/tryghost-dynamic-routing-events-5.86.2.tgz +0 -0
  149. package/components/tryghost-email-analytics-provider-mailgun-5.86.2.tgz +0 -0
  150. package/components/tryghost-email-analytics-service-5.86.2.tgz +0 -0
  151. package/components/tryghost-email-content-generator-5.86.2.tgz +0 -0
  152. package/components/tryghost-email-service-5.86.2.tgz +0 -0
  153. package/components/tryghost-email-suppression-list-5.86.2.tgz +0 -0
  154. package/components/tryghost-express-dynamic-redirects-5.86.2.tgz +0 -0
  155. package/components/tryghost-external-media-inliner-5.86.2.tgz +0 -0
  156. package/components/tryghost-extract-api-key-5.86.2.tgz +0 -0
  157. package/components/tryghost-ghost-5.86.2.tgz +0 -0
  158. package/components/tryghost-html-to-plaintext-5.86.2.tgz +0 -0
  159. package/components/tryghost-i18n-5.86.2.tgz +0 -0
  160. package/components/tryghost-importer-handler-content-files-5.86.2.tgz +0 -0
  161. package/components/tryghost-importer-revue-5.86.2.tgz +0 -0
  162. package/components/tryghost-in-memory-repository-5.86.2.tgz +0 -0
  163. package/components/tryghost-link-redirects-5.86.2.tgz +0 -0
  164. package/components/tryghost-link-replacer-5.86.2.tgz +0 -0
  165. package/components/tryghost-link-tracking-5.86.2.tgz +0 -0
  166. package/components/tryghost-magic-link-5.86.2.tgz +0 -0
  167. package/components/tryghost-member-attribution-5.86.2.tgz +0 -0
  168. package/components/tryghost-members-api-5.86.2.tgz +0 -0
  169. package/components/tryghost-members-events-service-5.86.2.tgz +0 -0
  170. package/components/tryghost-members-importer-5.86.2.tgz +0 -0
  171. package/components/tryghost-members-payments-5.86.2.tgz +0 -0
  172. package/components/tryghost-members-ssr-5.86.2.tgz +0 -0
  173. package/components/tryghost-members-stripe-service-5.86.2.tgz +0 -0
  174. package/components/tryghost-mentions-email-report-5.86.2.tgz +0 -0
  175. package/components/tryghost-milestones-5.86.2.tgz +0 -0
  176. package/components/tryghost-minifier-5.86.2.tgz +0 -0
  177. package/components/tryghost-model-to-domain-event-interceptor-5.86.2.tgz +0 -0
  178. package/components/tryghost-mw-api-version-mismatch-5.86.2.tgz +0 -0
  179. package/components/tryghost-mw-cache-control-5.86.2.tgz +0 -0
  180. package/components/tryghost-mw-error-handler-5.86.2.tgz +0 -0
  181. package/components/tryghost-mw-session-from-token-5.86.2.tgz +0 -0
  182. package/components/tryghost-mw-update-user-last-seen-5.86.2.tgz +0 -0
  183. package/components/tryghost-mw-version-match-5.86.2.tgz +0 -0
  184. package/components/tryghost-mw-vhost-5.86.2.tgz +0 -0
  185. package/components/tryghost-nql-filter-expansions-5.86.2.tgz +0 -0
  186. package/components/tryghost-oembed-service-5.86.2.tgz +0 -0
  187. package/components/tryghost-package-json-5.86.2.tgz +0 -0
  188. package/components/tryghost-post-events-5.86.2.tgz +0 -0
  189. package/components/tryghost-post-revisions-5.86.2.tgz +0 -0
  190. package/components/tryghost-posts-service-5.86.2.tgz +0 -0
  191. package/components/tryghost-recommendations-5.86.2.tgz +0 -0
  192. package/components/tryghost-referrers-5.86.2.tgz +0 -0
  193. package/components/tryghost-session-service-5.86.2.tgz +0 -0
  194. package/components/tryghost-settings-path-manager-5.86.2.tgz +0 -0
  195. package/components/tryghost-slack-notifications-5.86.2.tgz +0 -0
  196. package/components/tryghost-staff-service-5.86.2.tgz +0 -0
  197. package/components/tryghost-stats-service-5.86.2.tgz +0 -0
  198. package/components/tryghost-verification-trigger-5.86.2.tgz +0 -0
  199. package/components/tryghost-version-notifications-data-service-5.86.2.tgz +0 -0
  200. package/components/tryghost-webmentions-5.86.2.tgz +0 -0
  201. package/core/built/admin/assets/admin-x-activitypub/index-8aaa062c.mjs +0 -14980
  202. package/core/built/admin/assets/admin-x-activitypub/modals-124e649f.mjs +0 -521
  203. package/core/built/admin/assets/admin-x-demo/index-ea257d67.mjs +0 -8664
  204. package/core/built/admin/assets/ghost-117facae643a21dde076079b84fce471.css +0 -1
  205. package/core/built/admin/assets/ghost-dark-031957661056b00048f03aac0618c480.css +0 -1
  206. package/core/server/services/websockets/index.js +0 -1
  207. package/core/server/services/websockets/service.js +0 -38
@@ -1,521 +0,0 @@
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