ghost 5.89.1 → 5.89.2

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 (151) hide show
  1. package/components/tryghost-adapter-cache-memory-ttl-5.89.2.tgz +0 -0
  2. package/components/{tryghost-adapter-cache-redis-5.89.1.tgz → tryghost-adapter-cache-redis-5.89.2.tgz} +0 -0
  3. package/components/{tryghost-adapter-manager-5.89.1.tgz → tryghost-adapter-manager-5.89.2.tgz} +0 -0
  4. package/components/{tryghost-announcement-bar-settings-5.89.1.tgz → tryghost-announcement-bar-settings-5.89.2.tgz} +0 -0
  5. package/components/{tryghost-api-framework-5.89.1.tgz → tryghost-api-framework-5.89.2.tgz} +0 -0
  6. package/components/{tryghost-api-version-compatibility-service-5.89.1.tgz → tryghost-api-version-compatibility-service-5.89.2.tgz} +0 -0
  7. package/components/tryghost-audience-feedback-5.89.2.tgz +0 -0
  8. package/components/tryghost-bookshelf-repository-5.89.2.tgz +0 -0
  9. package/components/{tryghost-bootstrap-socket-5.89.1.tgz → tryghost-bootstrap-socket-5.89.2.tgz} +0 -0
  10. package/components/tryghost-collections-5.89.2.tgz +0 -0
  11. package/components/tryghost-constants-5.89.2.tgz +0 -0
  12. package/components/{tryghost-custom-theme-settings-service-5.89.1.tgz → tryghost-custom-theme-settings-service-5.89.2.tgz} +0 -0
  13. package/components/{tryghost-data-generator-5.89.1.tgz → tryghost-data-generator-5.89.2.tgz} +0 -0
  14. package/components/tryghost-domain-events-5.89.2.tgz +0 -0
  15. package/components/tryghost-donations-5.89.2.tgz +0 -0
  16. package/components/tryghost-dynamic-routing-events-5.89.2.tgz +0 -0
  17. package/components/tryghost-email-addresses-5.89.2.tgz +0 -0
  18. package/components/tryghost-email-analytics-provider-mailgun-5.89.2.tgz +0 -0
  19. package/components/tryghost-email-analytics-service-5.89.2.tgz +0 -0
  20. package/components/{tryghost-email-content-generator-5.89.1.tgz → tryghost-email-content-generator-5.89.2.tgz} +0 -0
  21. package/components/tryghost-email-events-5.89.2.tgz +0 -0
  22. package/components/{tryghost-email-service-5.89.1.tgz → tryghost-email-service-5.89.2.tgz} +0 -0
  23. package/components/tryghost-email-suppression-list-5.89.2.tgz +0 -0
  24. package/components/tryghost-express-dynamic-redirects-5.89.2.tgz +0 -0
  25. package/components/tryghost-external-media-inliner-5.89.2.tgz +0 -0
  26. package/components/tryghost-extract-api-key-5.89.2.tgz +0 -0
  27. package/components/{tryghost-ghost-5.89.1.tgz → tryghost-ghost-5.89.2.tgz} +0 -0
  28. package/components/tryghost-html-to-plaintext-5.89.2.tgz +0 -0
  29. package/components/tryghost-i18n-5.89.2.tgz +0 -0
  30. package/components/tryghost-importer-handler-content-files-5.89.2.tgz +0 -0
  31. package/components/tryghost-importer-revue-5.89.2.tgz +0 -0
  32. package/components/tryghost-in-memory-repository-5.89.2.tgz +0 -0
  33. package/components/{tryghost-job-manager-5.89.1.tgz → tryghost-job-manager-5.89.2.tgz} +0 -0
  34. package/components/tryghost-link-redirects-5.89.2.tgz +0 -0
  35. package/components/tryghost-link-replacer-5.89.2.tgz +0 -0
  36. package/components/{tryghost-link-tracking-5.89.1.tgz → tryghost-link-tracking-5.89.2.tgz} +0 -0
  37. package/components/{tryghost-magic-link-5.89.1.tgz → tryghost-magic-link-5.89.2.tgz} +0 -0
  38. package/components/{tryghost-mail-events-5.89.1.tgz → tryghost-mail-events-5.89.2.tgz} +0 -0
  39. package/components/{tryghost-mailgun-client-5.89.1.tgz → tryghost-mailgun-client-5.89.2.tgz} +0 -0
  40. package/components/{tryghost-member-attribution-5.89.1.tgz → tryghost-member-attribution-5.89.2.tgz} +0 -0
  41. package/components/{tryghost-member-events-5.89.1.tgz → tryghost-member-events-5.89.2.tgz} +0 -0
  42. package/components/{tryghost-members-api-5.89.1.tgz → tryghost-members-api-5.89.2.tgz} +0 -0
  43. package/components/tryghost-members-csv-5.89.2.tgz +0 -0
  44. package/components/tryghost-members-events-service-5.89.2.tgz +0 -0
  45. package/components/{tryghost-members-importer-5.89.1.tgz → tryghost-members-importer-5.89.2.tgz} +0 -0
  46. package/components/{tryghost-members-offers-5.89.1.tgz → tryghost-members-offers-5.89.2.tgz} +0 -0
  47. package/components/tryghost-members-payments-5.89.2.tgz +0 -0
  48. package/components/{tryghost-members-ssr-5.89.1.tgz → tryghost-members-ssr-5.89.2.tgz} +0 -0
  49. package/components/{tryghost-members-stripe-service-5.89.1.tgz → tryghost-members-stripe-service-5.89.2.tgz} +0 -0
  50. package/components/{tryghost-mentions-email-report-5.89.1.tgz → tryghost-mentions-email-report-5.89.2.tgz} +0 -0
  51. package/components/{tryghost-milestones-5.89.1.tgz → tryghost-milestones-5.89.2.tgz} +0 -0
  52. package/components/{tryghost-minifier-5.89.1.tgz → tryghost-minifier-5.89.2.tgz} +0 -0
  53. package/components/{tryghost-model-to-domain-event-interceptor-5.89.1.tgz → tryghost-model-to-domain-event-interceptor-5.89.2.tgz} +0 -0
  54. package/components/tryghost-mw-api-version-mismatch-5.89.2.tgz +0 -0
  55. package/components/tryghost-mw-cache-control-5.89.2.tgz +0 -0
  56. package/components/tryghost-mw-error-handler-5.89.2.tgz +0 -0
  57. package/components/tryghost-mw-session-from-token-5.89.2.tgz +0 -0
  58. package/components/tryghost-mw-update-user-last-seen-5.89.2.tgz +0 -0
  59. package/components/tryghost-mw-version-match-5.89.2.tgz +0 -0
  60. package/components/tryghost-mw-vhost-5.89.2.tgz +0 -0
  61. package/components/{tryghost-nql-filter-expansions-5.89.1.tgz → tryghost-nql-filter-expansions-5.89.2.tgz} +0 -0
  62. package/components/{tryghost-oembed-service-5.89.1.tgz → tryghost-oembed-service-5.89.2.tgz} +0 -0
  63. package/components/{tryghost-package-json-5.89.1.tgz → tryghost-package-json-5.89.2.tgz} +0 -0
  64. package/components/{tryghost-post-events-5.89.1.tgz → tryghost-post-events-5.89.2.tgz} +0 -0
  65. package/components/tryghost-post-revisions-5.89.2.tgz +0 -0
  66. package/components/{tryghost-posts-service-5.89.1.tgz → tryghost-posts-service-5.89.2.tgz} +0 -0
  67. package/components/tryghost-recommendations-5.89.2.tgz +0 -0
  68. package/components/tryghost-referrers-5.89.2.tgz +0 -0
  69. package/components/{tryghost-security-5.89.1.tgz → tryghost-security-5.89.2.tgz} +0 -0
  70. package/components/tryghost-session-service-5.89.2.tgz +0 -0
  71. package/components/tryghost-settings-path-manager-5.89.2.tgz +0 -0
  72. package/components/{tryghost-slack-notifications-5.89.1.tgz → tryghost-slack-notifications-5.89.2.tgz} +0 -0
  73. package/components/tryghost-staff-service-5.89.2.tgz +0 -0
  74. package/components/{tryghost-stats-service-5.89.1.tgz → tryghost-stats-service-5.89.2.tgz} +0 -0
  75. package/components/{tryghost-tiers-5.89.1.tgz → tryghost-tiers-5.89.2.tgz} +0 -0
  76. package/components/tryghost-update-check-service-5.89.2.tgz +0 -0
  77. package/components/{tryghost-verification-trigger-5.89.1.tgz → tryghost-verification-trigger-5.89.2.tgz} +0 -0
  78. package/components/tryghost-version-notifications-data-service-5.89.2.tgz +0 -0
  79. package/components/tryghost-webmentions-5.89.2.tgz +0 -0
  80. package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +2 -2
  81. package/core/built/admin/assets/admin-x-activitypub/{index-980aeac1.mjs → index-e318fbcd.mjs} +16908 -17046
  82. package/core/built/admin/assets/admin-x-activitypub/modals-a6e383d4.mjs +422 -0
  83. package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +2 -2
  84. package/core/built/admin/assets/admin-x-demo/{index-71687654.mjs → index-116afae1.mjs} +1972 -1953
  85. package/core/built/admin/assets/admin-x-demo/{modals-4b59bbd8.mjs → modals-c17f9071.mjs} +171 -166
  86. package/core/built/admin/assets/admin-x-settings/{CodeEditorView-8dcd0ded.mjs → CodeEditorView-511c0703.mjs} +2 -2
  87. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  88. package/core/built/admin/assets/admin-x-settings/{index-01e25660.mjs → index-5941f1da.mjs} +5734 -5702
  89. package/core/built/admin/assets/admin-x-settings/{index-541636a3.mjs → index-a33217a0.mjs} +2 -2
  90. package/core/built/admin/assets/admin-x-settings/{modals-172c4d1c.mjs → modals-434ac8fd.mjs} +3 -3
  91. package/core/built/admin/assets/{chunk.42.a0b3ca84230d788d0e11.js → chunk.42.90f279da5ca389af68b9.js} +424 -422
  92. package/core/built/admin/assets/{chunk.524.e09e59707739cbab5488.js → chunk.524.fb82017fc304c64f1cab.js} +5 -5
  93. package/core/built/admin/assets/{chunk.582.8aa2a0331d317e552bbe.js → chunk.582.a9620f67df902832f07e.js} +6 -6
  94. package/core/built/admin/assets/{ghost-b5e602d62644bd997ce54c647953f437.js → ghost-ab064d1be3ae3f712cf329fa5766eeb2.js} +162 -130
  95. package/core/built/admin/assets/{ghost-dark-f0b3a9ea961171ad4f736edbab905a0c.css → ghost-dark-f9c5f2aae7d01ae36bd6932c0abf683a.css} +1 -1
  96. package/core/built/admin/assets/{ghost-87438e5801b7bb0f2e3497a68572a529.css → ghost-f627cc6acd7574a7bdbf2f2988365c78.css} +1 -1
  97. package/core/built/admin/assets/koenig-lexical/index.css +1 -1
  98. package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +19003 -18821
  99. package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +138 -142
  100. package/core/built/admin/assets/{vendor-35f20b2f9b6201dcd4a00c8acac98aa6.js → vendor-eb806b4d193377b9b4bbf885840bfdc2.js} +23 -19
  101. package/core/built/admin/index.html +6 -6
  102. package/core/server/lib/lexical.js +5 -1
  103. package/core/shared/config/defaults.json +1 -1
  104. package/core/shared/labs.js +4 -3
  105. package/core/shared/settings-cache/public.js +2 -1
  106. package/package.json +156 -156
  107. package/yarn.lock +231 -226
  108. package/components/tryghost-adapter-cache-memory-ttl-5.89.1.tgz +0 -0
  109. package/components/tryghost-audience-feedback-5.89.1.tgz +0 -0
  110. package/components/tryghost-bookshelf-repository-5.89.1.tgz +0 -0
  111. package/components/tryghost-collections-5.89.1.tgz +0 -0
  112. package/components/tryghost-constants-5.89.1.tgz +0 -0
  113. package/components/tryghost-domain-events-5.89.1.tgz +0 -0
  114. package/components/tryghost-donations-5.89.1.tgz +0 -0
  115. package/components/tryghost-dynamic-routing-events-5.89.1.tgz +0 -0
  116. package/components/tryghost-email-addresses-5.89.1.tgz +0 -0
  117. package/components/tryghost-email-analytics-provider-mailgun-5.89.1.tgz +0 -0
  118. package/components/tryghost-email-analytics-service-5.89.1.tgz +0 -0
  119. package/components/tryghost-email-events-5.89.1.tgz +0 -0
  120. package/components/tryghost-email-suppression-list-5.89.1.tgz +0 -0
  121. package/components/tryghost-express-dynamic-redirects-5.89.1.tgz +0 -0
  122. package/components/tryghost-external-media-inliner-5.89.1.tgz +0 -0
  123. package/components/tryghost-extract-api-key-5.89.1.tgz +0 -0
  124. package/components/tryghost-html-to-plaintext-5.89.1.tgz +0 -0
  125. package/components/tryghost-i18n-5.89.1.tgz +0 -0
  126. package/components/tryghost-importer-handler-content-files-5.89.1.tgz +0 -0
  127. package/components/tryghost-importer-revue-5.89.1.tgz +0 -0
  128. package/components/tryghost-in-memory-repository-5.89.1.tgz +0 -0
  129. package/components/tryghost-link-redirects-5.89.1.tgz +0 -0
  130. package/components/tryghost-link-replacer-5.89.1.tgz +0 -0
  131. package/components/tryghost-members-csv-5.89.1.tgz +0 -0
  132. package/components/tryghost-members-events-service-5.89.1.tgz +0 -0
  133. package/components/tryghost-members-payments-5.89.1.tgz +0 -0
  134. package/components/tryghost-mw-api-version-mismatch-5.89.1.tgz +0 -0
  135. package/components/tryghost-mw-cache-control-5.89.1.tgz +0 -0
  136. package/components/tryghost-mw-error-handler-5.89.1.tgz +0 -0
  137. package/components/tryghost-mw-session-from-token-5.89.1.tgz +0 -0
  138. package/components/tryghost-mw-update-user-last-seen-5.89.1.tgz +0 -0
  139. package/components/tryghost-mw-version-match-5.89.1.tgz +0 -0
  140. package/components/tryghost-mw-vhost-5.89.1.tgz +0 -0
  141. package/components/tryghost-post-revisions-5.89.1.tgz +0 -0
  142. package/components/tryghost-recommendations-5.89.1.tgz +0 -0
  143. package/components/tryghost-referrers-5.89.1.tgz +0 -0
  144. package/components/tryghost-session-service-5.89.1.tgz +0 -0
  145. package/components/tryghost-settings-path-manager-5.89.1.tgz +0 -0
  146. package/components/tryghost-staff-service-5.89.1.tgz +0 -0
  147. package/components/tryghost-update-check-service-5.89.1.tgz +0 -0
  148. package/components/tryghost-version-notifications-data-service-5.89.1.tgz +0 -0
  149. package/components/tryghost-webmentions-5.89.1.tgz +0 -0
  150. package/core/built/admin/assets/admin-x-activitypub/modals-e013f67b.mjs +0 -654
  151. /package/core/built/admin/assets/{chunk.42.a0b3ca84230d788d0e11.js.LICENSE.txt → chunk.42.90f279da5ca389af68b9.js.LICENSE.txt} +0 -0
@@ -1,654 +0,0 @@
1
- import { u as he, a as xe, c as o, j as t, H as X, b as fe, d as ne, e as be, f as B, g as z, B as K, h as we, N as E, S as ge, s as ye, i as ve, n as re, p as ke, k as je, l as Fe, m as se, o as Me, q as Y, r as D, A as G, t as Re, L as ie, v as ae, w as Z, x as le, y as ce } from "./index-980aeac1.mjs";
2
- const Ce = ({
3
- type: r = "text",
4
- inputRef: s,
5
- title: e,
6
- hideTitle: n,
7
- value: a,
8
- error: i,
9
- placeholder: u,
10
- rightPlaceholder: c,
11
- hint: l,
12
- onChange: h,
13
- onFocus: x,
14
- onBlur: w,
15
- clearBg: k = !1,
16
- className: j = "",
17
- maxLength: F,
18
- containerClassName: S = "",
19
- hintClassName: y = "",
20
- unstyled: f = !1,
21
- disabled: U,
22
- ...M
23
- }) => {
24
- const T = he(), { setFocusState: H } = xe(), _ = (C) => {
25
- x == null || x(C), H(!0);
26
- }, I = (C) => {
27
- w == null || w(C), H(!1);
28
- }, P = o(
29
- "relative order-2 flex w-full items-center",
30
- e && !n && "mt-1.5"
31
- ), q = !f && o(
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
- i ? "border-red bg-white dark:bg-grey-925" : "border-transparent bg-grey-150 dark:bg-grey-900",
34
- U && "bg-grey-50 peer-hover:bg-grey-50 dark:bg-grey-950 dark:peer-hover:bg-grey-950"
35
- ), R = !f && o(
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
- U ? "cursor-not-allowed text-grey-600 opacity-60 dark:text-grey-800" : "dark:text-white",
38
- c ? "w-0 grow rounded-l-lg" : "rounded-lg",
39
- j
40
- ), Q = !f && o(
41
- "z-[1] order-3 rounded-r-lg",
42
- c ? typeof c == "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 v = /* @__PURE__ */ t.jsx(t.Fragment, {});
45
- const W = /* @__PURE__ */ t.jsx(
46
- "input",
47
- {
48
- ref: s,
49
- className: R || j,
50
- disabled: U,
51
- id: T,
52
- maxLength: F,
53
- placeholder: u,
54
- type: r,
55
- value: a,
56
- onBlur: I,
57
- onChange: h,
58
- onFocus: _,
59
- ...M
60
- }
61
- );
62
- return v = /* @__PURE__ */ t.jsxs("div", { className: P, children: [
63
- W,
64
- !f && !k && /* @__PURE__ */ t.jsx("div", { className: q || "" }),
65
- c && /* @__PURE__ */ t.jsx("span", { className: Q || "", children: c })
66
- ] }), y = o(
67
- "order-3",
68
- y
69
- ), S = o(
70
- "flex flex-col",
71
- S
72
- ), e || l ? /* @__PURE__ */ t.jsxs("div", { className: S, children: [
73
- v,
74
- e && /* @__PURE__ */ t.jsx(X, { className: n ? "sr-only" : "order-1", htmlFor: T, useLabelTag: !0, children: e }),
75
- l && /* @__PURE__ */ t.jsx(fe, { className: y, color: i ? "red" : "default", children: l })
76
- ] }) : v;
77
- }, Le = ({
78
- shiftY: r,
79
- footerBgColorClass: s = "bg-white dark:bg-black",
80
- contentBgColorClass: e = "bg-white dark:bg-black",
81
- height: n = 96,
82
- children: a
83
- }) => {
84
- const i = o(
85
- "w-100 sticky bottom-[-24px] z-[297] m-0 box-border p-0"
86
- ), u = r ? `calc(${r} - 24px)` : "-24px", c = `${n + 24}px`, l = o(
87
- "sticky z-[298] block h-[24px]",
88
- e
89
- ), h = "0", x = o(
90
- "sticky z-[299] mb-[-24px] flex items-center justify-between",
91
- "h-[96px]",
92
- s
93
- ), w = "0", k = `${n}px`, j = "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 = r ? `calc(${r} + ${n - 24}px)` : `${n - 24}px`;
94
- return /* @__PURE__ */ t.jsxs(
95
- "div",
96
- {
97
- className: i,
98
- style: {
99
- bottom: u,
100
- height: c
101
- },
102
- children: [
103
- /* @__PURE__ */ t.jsx(
104
- "div",
105
- {
106
- className: l,
107
- style: {
108
- bottom: h
109
- }
110
- }
111
- ),
112
- /* @__PURE__ */ t.jsx(
113
- "div",
114
- {
115
- className: x,
116
- style: {
117
- bottom: w,
118
- height: k
119
- },
120
- children: a
121
- }
122
- ),
123
- /* @__PURE__ */ t.jsx(
124
- "div",
125
- {
126
- className: j,
127
- style: {
128
- bottom: F
129
- }
130
- }
131
- )
132
- ]
133
- }
134
- );
135
- };
136
- function oe(r, s, e = {}) {
137
- r ? E.show(Se, {
138
- title: "Are you sure you want to leave this page?",
139
- prompt: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
140
- /* @__PURE__ */ t.jsx("p", { children: "Hey there! It looks like you didn't save the changes you made." }),
141
- /* @__PURE__ */ t.jsx("p", { children: "Save before you go!" })
142
- ] }),
143
- okLabel: "Leave",
144
- cancelLabel: "Stay",
145
- okColor: "red",
146
- onOk: (n) => {
147
- s(), n == null || n.remove();
148
- },
149
- ...e
150
- }) : s();
151
- }
152
- const Ne = "bg-[rgba(98,109,121,0.2)] backdrop-blur-[3px]", V = ({
153
- size: r = "md",
154
- width: s,
155
- height: e,
156
- testId: n,
157
- title: a,
158
- okLabel: i = "OK",
159
- okLoading: u = !1,
160
- cancelLabel: c = "Cancel",
161
- footer: l,
162
- header: h,
163
- leftButtonProps: x,
164
- buttonsDisabled: w,
165
- okDisabled: k,
166
- padding: j = !0,
167
- onOk: F,
168
- okColor: S = "black",
169
- onCancel: y,
170
- topRightContent: f,
171
- hideXOnMobile: U = !1,
172
- afterClose: M,
173
- children: T,
174
- backDrop: H = !0,
175
- backDropClick: _ = !0,
176
- stickyFooter: I = !1,
177
- stickyHeader: P = !1,
178
- scrolling: q = !0,
179
- dirty: R = !1,
180
- animate: Q = !0,
181
- formSheet: v = !1,
182
- enableCMDS: W = !0
183
- }) => {
184
- const C = ne(), { setGlobalDirtyState: ee } = be(), [te, de] = B(!1);
185
- z(() => {
186
- ee(R);
187
- }, [R, ee]), z(() => {
188
- const g = (L) => {
189
- L.key === "Escape" && (document.activeElement && document.activeElement instanceof HTMLElement && document.activeElement.blur(), setTimeout(() => {
190
- y ? y() : oe(R, () => {
191
- C.remove(), M == null || M();
192
- });
193
- }), L.stopPropagation());
194
- };
195
- return document.addEventListener("keydown", g), () => {
196
- document.removeEventListener("keydown", g);
197
- };
198
- }, [C, R, M, y]), z(() => {
199
- const g = setTimeout(() => {
200
- de(!0);
201
- }, 250);
202
- return () => clearTimeout(g);
203
- }, []), z(() => {
204
- if (F) {
205
- const g = (L) => {
206
- (L.metaKey || L.ctrlKey) && L.key === "s" && (L.preventDefault(), F());
207
- };
208
- if (W)
209
- return window.addEventListener("keydown", g), () => {
210
- window.removeEventListener("keydown", g);
211
- };
212
- }
213
- });
214
- const $ = [];
215
- let O;
216
- const J = () => {
217
- oe(R, () => {
218
- C.remove(), M == null || M();
219
- });
220
- };
221
- l || (c && $.push({
222
- key: "cancel-modal",
223
- label: c,
224
- color: "outline",
225
- onClick: y || (() => {
226
- J();
227
- }),
228
- disabled: w
229
- }), i && $.push({
230
- key: "ok-modal",
231
- label: i,
232
- color: S,
233
- className: "min-w-[80px]",
234
- onClick: F,
235
- disabled: w || k,
236
- loading: u
237
- }));
238
- let m = o(
239
- "relative z-50 mx-auto flex max-h-[100%] w-full flex-col justify-between overflow-x-hidden bg-white dark:bg-black",
240
- r !== "bleed" && "rounded",
241
- v ? "shadow-md" : "shadow-xl",
242
- Q && !v && !te && "animate-modal-in",
243
- v && !te && "animate-modal-in-reverse",
244
- q ? "overflow-y-auto" : "overflow-y-hidden"
245
- ), p = o(
246
- "fixed inset-0 z-[1000] h-[100vh] w-[100vw]"
247
- ), b = "", d = o(
248
- !f || f === "close" ? "" : "flex items-center justify-between gap-5"
249
- );
250
- switch (P && (d = o(
251
- d,
252
- "sticky top-0 z-[200] -mb-4 bg-white !pb-4 dark:bg-black"
253
- )), r) {
254
- case "sm":
255
- m = o(
256
- m,
257
- "max-w-[480px]"
258
- ), p = o(
259
- p,
260
- "p-4 md:p-[8vmin]"
261
- ), b = "p-8", d = o(
262
- d,
263
- "-inset-x-8"
264
- );
265
- break;
266
- case "md":
267
- m = o(
268
- m,
269
- "max-w-[720px]"
270
- ), p = o(
271
- p,
272
- "p-4 md:p-[8vmin]"
273
- ), b = "p-8", d = o(
274
- d,
275
- "-inset-x-8"
276
- );
277
- break;
278
- case "lg":
279
- m = o(
280
- m,
281
- "max-w-[1020px]"
282
- ), p = o(
283
- p,
284
- "p-4 md:p-[4vmin]"
285
- ), b = "p-7", d = o(
286
- d,
287
- "-inset-x-8"
288
- );
289
- break;
290
- case "xl":
291
- m = o(
292
- m,
293
- "max-w-[1240px]0"
294
- ), p = o(
295
- p,
296
- "p-4 md:p-[3vmin]"
297
- ), b = "p-10", d = o(
298
- d,
299
- "-inset-x-10 -top-10"
300
- );
301
- break;
302
- case "full":
303
- m = o(
304
- m,
305
- "h-full"
306
- ), p = o(
307
- p,
308
- "p-4 md:p-[3vmin]"
309
- ), b = "p-10", d = o(
310
- d,
311
- "-inset-x-10"
312
- );
313
- break;
314
- case "bleed":
315
- m = o(
316
- m,
317
- "h-full"
318
- ), b = "p-10", d = o(
319
- d,
320
- "-inset-x-10"
321
- );
322
- break;
323
- default:
324
- p = o(
325
- p,
326
- "p-4 md:p-[8vmin]"
327
- ), b = "p-8", d = o(
328
- d,
329
- "-inset-x-8"
330
- );
331
- break;
332
- }
333
- j || (b = "p-0"), m = o(
334
- m
335
- ), d = o(
336
- d,
337
- b,
338
- "pb-0"
339
- ), O = o(
340
- b,
341
- "py-0"
342
- ), p = o(
343
- p,
344
- "max-[800px]:!pb-20"
345
- );
346
- const me = o(
347
- `${b} ${I ? "py-6" : ""}`,
348
- "flex w-full items-center justify-between"
349
- );
350
- O = o(
351
- O,
352
- (r === "full" || r === "bleed" || e === "full" || typeof e == "number") && "grow"
353
- );
354
- const pe = (g) => {
355
- g.target === g.currentTarget && _ && J();
356
- }, A = {};
357
- typeof s == "number" ? (A.width = "100%", A.maxWidth = s + "px") : s === "full" && (m = o(
358
- m,
359
- "w-full"
360
- )), typeof e == "number" ? (A.height = "100%", A.maxHeight = e + "px") : e === "full" && (m = o(
361
- m,
362
- "h-full"
363
- ));
364
- let N;
365
- return l ? N = l : l === !1 ? O += " pb-0 " : N = /* @__PURE__ */ t.jsxs("div", { className: me, children: [
366
- /* @__PURE__ */ t.jsx("div", { children: x && /* @__PURE__ */ t.jsx(K, { ...x }) }),
367
- /* @__PURE__ */ t.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ t.jsx(we, { buttons: $ }) })
368
- ] }), N = I ? /* @__PURE__ */ t.jsx(Le, { height: 84, children: N }) : /* @__PURE__ */ t.jsx(t.Fragment, { children: N }), /* @__PURE__ */ t.jsxs("div", { className: p, id: "modal-backdrop", onMouseDown: pe, children: [
369
- /* @__PURE__ */ t.jsx("div", { className: o(
370
- "pointer-events-none fixed inset-0 z-0",
371
- H && !v && Ne,
372
- v && "bg-[rgba(98,109,121,0.08)]"
373
- ) }),
374
- /* @__PURE__ */ t.jsxs("section", { className: m, "data-testid": n, style: A, children: [
375
- h === !1 ? "" : !f || f === "close" ? /* @__PURE__ */ t.jsxs("header", { className: d, children: [
376
- a && /* @__PURE__ */ t.jsx(X, { level: 3, children: a }),
377
- /* @__PURE__ */ t.jsx("div", { className: `${f !== "close" && "md:!invisible md:!hidden"} ${U && "hidden"} absolute right-6 top-6`, children: /* @__PURE__ */ t.jsx(K, { 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: J }) })
378
- ] }) : /* @__PURE__ */ t.jsxs("header", { className: d, children: [
379
- a && /* @__PURE__ */ t.jsx(X, { level: 3, children: a }),
380
- f
381
- ] }),
382
- /* @__PURE__ */ t.jsx("div", { className: O, children: T }),
383
- N
384
- ] })
385
- ] });
386
- }, Ee = ({
387
- title: r = "Are you sure?",
388
- prompt: s,
389
- cancelLabel: e = "Cancel",
390
- okLabel: n = "OK",
391
- okRunningLabel: a = "...",
392
- okColor: i = "black",
393
- onCancel: u,
394
- onOk: c,
395
- customFooter: l,
396
- formSheet: h = !0
397
- }) => {
398
- const x = ne(), [w, k] = B("");
399
- return /* @__PURE__ */ t.jsx(
400
- V,
401
- {
402
- backDropClick: !1,
403
- buttonsDisabled: w === "running",
404
- cancelLabel: e,
405
- footer: l,
406
- formSheet: h,
407
- okColor: i,
408
- okLabel: w === "running" ? a : n,
409
- testId: "confirmation-modal",
410
- title: r,
411
- width: 540,
412
- onCancel: u,
413
- onOk: async () => {
414
- k("running");
415
- try {
416
- await (c == null ? void 0 : c(x));
417
- } catch (j) {
418
- console.error("Unhandled Promise Rejection. Make sure you catch errors in your onOk handler.", j);
419
- }
420
- k("");
421
- },
422
- children: /* @__PURE__ */ t.jsx("div", { className: "py-4 leading-9", children: s })
423
- }
424
- );
425
- }, Se = E.create(Ee);
426
- class Ue extends ge {
427
- constructor(s, e) {
428
- super(), this.client = s, this.setOptions(e), this.bindMethods(), this.updateResult();
429
- }
430
- bindMethods() {
431
- this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
432
- }
433
- setOptions(s) {
434
- var e;
435
- const n = this.options;
436
- this.options = this.client.defaultMutationOptions(s), ye(n, this.options) || this.client.getMutationCache().notify({
437
- type: "observerOptionsUpdated",
438
- mutation: this.currentMutation,
439
- observer: this
440
- }), (e = this.currentMutation) == null || e.setOptions(this.options);
441
- }
442
- onUnsubscribe() {
443
- if (!this.hasListeners()) {
444
- var s;
445
- (s = this.currentMutation) == null || s.removeObserver(this);
446
- }
447
- }
448
- onMutationUpdate(s) {
449
- this.updateResult();
450
- const e = {
451
- listeners: !0
452
- };
453
- s.type === "success" ? e.onSuccess = !0 : s.type === "error" && (e.onError = !0), this.notify(e);
454
- }
455
- getCurrentResult() {
456
- return this.currentResult;
457
- }
458
- reset() {
459
- this.currentMutation = void 0, this.updateResult(), this.notify({
460
- listeners: !0
461
- });
462
- }
463
- mutate(s, e) {
464
- return this.mutateOptions = e, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, {
465
- ...this.options,
466
- variables: typeof s < "u" ? s : this.options.variables
467
- }), this.currentMutation.addObserver(this), this.currentMutation.execute();
468
- }
469
- updateResult() {
470
- const s = this.currentMutation ? this.currentMutation.state : ve(), e = {
471
- ...s,
472
- isLoading: s.status === "loading",
473
- isSuccess: s.status === "success",
474
- isError: s.status === "error",
475
- isIdle: s.status === "idle",
476
- mutate: this.mutate,
477
- reset: this.reset
478
- };
479
- this.currentResult = e;
480
- }
481
- notify(s) {
482
- re.batch(() => {
483
- if (this.mutateOptions && this.hasListeners()) {
484
- if (s.onSuccess) {
485
- var e, n, a, i;
486
- (e = (n = this.mutateOptions).onSuccess) == null || e.call(n, this.currentResult.data, this.currentResult.variables, this.currentResult.context), (a = (i = this.mutateOptions).onSettled) == null || a.call(i, this.currentResult.data, null, this.currentResult.variables, this.currentResult.context);
487
- } else if (s.onError) {
488
- var u, c, l, h;
489
- (u = (c = this.mutateOptions).onError) == null || u.call(c, this.currentResult.error, this.currentResult.variables, this.currentResult.context), (l = (h = this.mutateOptions).onSettled) == null || l.call(h, void 0, this.currentResult.error, this.currentResult.variables, this.currentResult.context);
490
- }
491
- }
492
- s.listeners && this.listeners.forEach(({
493
- listener: x
494
- }) => {
495
- x(this.currentResult);
496
- });
497
- });
498
- }
499
- }
500
- function ue(r, s, e) {
501
- const n = ke(r, s, e), a = je({
502
- context: n.context
503
- }), [i] = B(() => new Ue(a, n));
504
- z(() => {
505
- i.setOptions(n);
506
- }, [i, n]);
507
- const u = Fe(se((l) => i.subscribe(re.batchCalls(l)), [i]), () => i.getCurrentResult(), () => i.getCurrentResult()), c = se((l, h) => {
508
- i.mutate(l, h).catch(Oe);
509
- }, [i]);
510
- if (u.error && Me(i.options.useErrorBoundary, [u.error]))
511
- throw u.error;
512
- return {
513
- ...u,
514
- mutate: c,
515
- mutateAsync: u.mutate
516
- };
517
- }
518
- function Oe() {
519
- }
520
- function Ae(r, s, e) {
521
- var c;
522
- const a = (c = D().data) == null ? void 0 : c.site, i = (a == null ? void 0 : a.url) ?? window.location.origin, u = new G(
523
- new URL(i),
524
- new URL("/ghost/api/admin/identities/", window.location.origin),
525
- r
526
- );
527
- return ue({
528
- async mutationFn(l) {
529
- return u.follow(l);
530
- },
531
- onSuccess: s,
532
- onError: e
533
- });
534
- }
535
- const ze = E.create(() => {
536
- const { updateRoute: r } = Y(), s = E.useModal(), [e, n] = B(""), [a, i] = B(null);
537
- async function u() {
538
- Re({
539
- message: "Site followed",
540
- type: "success"
541
- }), s.remove(), r("");
542
- }
543
- async function c() {
544
- i(a);
545
- }
546
- const l = Ae("index", u, c);
547
- return /* @__PURE__ */ t.jsx(
548
- V,
549
- {
550
- afterClose: () => {
551
- l.reset(), r("");
552
- },
553
- cancelLabel: "Cancel",
554
- okLabel: "Follow",
555
- size: "sm",
556
- title: "Follow a Ghost site",
557
- onOk: () => l.mutate(e),
558
- children: /* @__PURE__ */ t.jsx("div", { className: "mt-3 flex flex-col gap-4", children: /* @__PURE__ */ t.jsx(
559
- Ce,
560
- {
561
- autoFocus: !0,
562
- error: !!a,
563
- hint: a,
564
- placeholder: "@username@hostname",
565
- title: "Profile name",
566
- value: e,
567
- "data-test-new-follower": !0,
568
- onChange: (h) => n(h.target.value)
569
- }
570
- ) })
571
- }
572
- );
573
- });
574
- function Be(r) {
575
- var i;
576
- const e = (i = D().data) == null ? void 0 : i.site, n = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
577
- new URL(n),
578
- new URL("/ghost/api/admin/identities/", window.location.origin),
579
- r
580
- );
581
- return ce({
582
- queryKey: [`followers:${r}`],
583
- async queryFn() {
584
- return a.getFollowers();
585
- }
586
- });
587
- }
588
- function Te(r) {
589
- var i;
590
- const e = (i = D().data) == null ? void 0 : i.site, n = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
591
- new URL(n),
592
- new URL("/ghost/api/admin/identities/", window.location.origin),
593
- r
594
- );
595
- return ue({
596
- async mutationFn(u) {
597
- return a.follow(u);
598
- }
599
- });
600
- }
601
- const He = ({}) => {
602
- const { updateRoute: r } = Y(), s = Te("index"), { data: e = [] } = Be("index"), n = Array.isArray(e) ? e : [e];
603
- return /* @__PURE__ */ t.jsx(
604
- V,
605
- {
606
- afterClose: () => {
607
- s.reset(), r("");
608
- },
609
- cancelLabel: "",
610
- footer: !1,
611
- okLabel: "",
612
- size: "md",
613
- title: "Followers",
614
- topRightContent: "close",
615
- children: /* @__PURE__ */ t.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ t.jsx(ie, { children: n.map((a) => /* @__PURE__ */ t.jsx(ae, { action: /* @__PURE__ */ t.jsx(K, { color: "grey", label: "Follow back", link: !0, onClick: () => s.mutate(Z(a)) }), avatar: /* @__PURE__ */ t.jsx(le, { image: a.icon, size: "sm" }), detail: Z(a), id: "list-item", title: a.name })) }) })
616
- }
617
- );
618
- }, Ie = E.create(He);
619
- function qe(r) {
620
- var i;
621
- const e = (i = D().data) == null ? void 0 : i.site, n = (e == null ? void 0 : e.url) ?? window.location.origin, a = new G(
622
- new URL(n),
623
- new URL("/ghost/api/admin/identities/", window.location.origin),
624
- r
625
- );
626
- return ce({
627
- queryKey: [`following:${r}`],
628
- async queryFn() {
629
- return a.getFollowing();
630
- }
631
- });
632
- }
633
- const Ke = ({}) => {
634
- const { updateRoute: r } = Y(), { data: s = [] } = qe("index"), e = Array.isArray(s) ? s : [s];
635
- return /* @__PURE__ */ t.jsx(
636
- V,
637
- {
638
- afterClose: () => {
639
- r("");
640
- },
641
- cancelLabel: "",
642
- footer: !1,
643
- okLabel: "",
644
- size: "md",
645
- title: "Following",
646
- topRightContent: "close",
647
- children: /* @__PURE__ */ t.jsx("div", { className: "mt-3 flex flex-col gap-4 pb-12", children: /* @__PURE__ */ t.jsx(ie, { children: e.map((n) => /* @__PURE__ */ t.jsx(ae, { action: /* @__PURE__ */ t.jsx(K, { color: "grey", label: "Unfollow", link: !0 }), avatar: /* @__PURE__ */ t.jsx(le, { image: n.icon, size: "sm" }), detail: Z(n), id: "list-item", title: n.name })) }) })
648
- }
649
- );
650
- }, De = E.create(Ke), Ve = { FollowSite: ze, ViewFollowing: De, ViewFollowers: Ie };
651
- export {
652
- Ve as default
653
- };
654
- //# sourceMappingURL=modals-e013f67b.mjs.map