@automattic/social-previews 3.2.5 → 3.3.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.
package/dist/index.js DELETED
@@ -1,2519 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/helpers.tsx
2
- var _element = require('@wordpress/element');
3
- var _i18n = require('@wordpress/i18n');
4
- var _jsxruntime = require('react/jsx-runtime');
5
- var baseDomain = (url) => {
6
- const withoutProtocol = url.replace(/^[^/]+:\/\//, "");
7
- const slashIndex = withoutProtocol.indexOf("/");
8
- return slashIndex === -1 ? withoutProtocol : withoutProtocol.substring(0, slashIndex);
9
- };
10
- var codepointLength = (text) => Array.from(text).length;
11
- var codepointSlice = (text, start, end) => Array.from(text).slice(start, end).join("");
12
- var shortEnough = (limit) => (title) => codepointLength(title) <= limit ? title : false;
13
- var truncatedAtSpace = (lower, upper) => (fullTitle) => {
14
- const title = fullTitle.slice(0, upper);
15
- const lastSpace = title.lastIndexOf(" ");
16
- return lastSpace > lower && lastSpace < upper ? title.slice(0, lastSpace).concat("\u2026") : false;
17
- };
18
- var hardTruncation = (limit) => (title) => codepointSlice(title, 0, limit).concat("\u2026");
19
- var firstValid = (...predicates) => (a) => _optionalChain([predicates, 'access', _ => _.find, 'call', _2 => _2((p) => false !== p(a)), 'optionalCall', _3 => _3(a)]);
20
- var stripHtmlTags = (description, allowedTags = []) => {
21
- const pattern = new RegExp(`(<([^${allowedTags.join("")}>]+)>)`, "gi");
22
- return description ? description.replace(pattern, "") : "";
23
- };
24
- var getTitleFromDescription = (description) => {
25
- return stripHtmlTags(description).substring(0, 50);
26
- };
27
- var hasTag = (text, tag) => {
28
- const pattern = new RegExp(`<${tag}[^>]*>`, "gi");
29
- return pattern.test(text);
30
- };
31
- var formatNextdoorDate = new Intl.DateTimeFormat("en-GB", {
32
- // Result: "7 Oct", "31 Dec"
33
- day: "numeric",
34
- month: "short"
35
- }).format;
36
- var formatThreadsDate = new Intl.DateTimeFormat("en-US", {
37
- // Result: "'06/21/2024"
38
- day: "2-digit",
39
- month: "2-digit",
40
- year: "numeric"
41
- }).format;
42
- var formatTweetDate = new Intl.DateTimeFormat("en-US", {
43
- // Result: "Apr 7", "Dec 31"
44
- month: "short",
45
- day: "numeric"
46
- }).format;
47
- var formatMastodonDate = new Intl.DateTimeFormat("en-US", {
48
- // Result: "Apr 7, 2024", "Dec 31, 2023"
49
- month: "short",
50
- day: "numeric",
51
- year: "numeric"
52
- }).format;
53
- var collapseWhitespace = (text) => text.replace(/\s+/g, " ").trim();
54
- var countOccurrences = (haystack, needle) => {
55
- let count = 0;
56
- for (let pos = haystack.indexOf(needle); pos !== -1; pos = haystack.indexOf(needle, pos + 1)) {
57
- count++;
58
- }
59
- return count;
60
- };
61
- var nthIndexOf = (haystack, needle, n) => {
62
- let pos = haystack.indexOf(needle);
63
- while (pos !== -1 && n > 0) {
64
- n--;
65
- pos = haystack.indexOf(needle, pos + 1);
66
- }
67
- return pos;
68
- };
69
- function parseHyperlinks(html) {
70
- if (!html) {
71
- return [];
72
- }
73
- const doc = document.implementation.createHTMLDocument("");
74
- doc.body.innerHTML = html;
75
- const links = [];
76
- for (const anchor of Array.from(doc.body.querySelectorAll("a[href]"))) {
77
- const href = _nullishCoalesce(anchor.getAttribute("href"), () => ( ""));
78
- const text = collapseWhitespace(_nullishCoalesce(anchor.textContent, () => ( "")));
79
- if (!/^https?:\/\//i.test(href) || "" === text || text === href) {
80
- continue;
81
- }
82
- const range = doc.createRange();
83
- range.selectNodeContents(doc.body);
84
- range.setEndBefore(anchor);
85
- const occurrence = countOccurrences(collapseWhitespace(range.toString()), text);
86
- links.push({ text, href, occurrence });
87
- }
88
- return links;
89
- }
90
- var hashtagUrlMap = {
91
- twitter: "https://twitter.com/hashtag/%1$s",
92
- facebook: "https://www.facebook.com/hashtag/%1$s",
93
- linkedin: "https://www.linkedin.com/feed/hashtag/?keywords=%1$s",
94
- instagram: "https://www.instagram.com/explore/tags/%1$s",
95
- mastodon: "https://%2$s/tags/%1$s",
96
- nextdoor: "https://nextdoor.com/hashtag/%1$s",
97
- threads: "https://www.threads.net/search?q=%1$s&serp_type=tags",
98
- tumblr: "https://www.tumblr.com/tagged/%1$s",
99
- bluesky: "https://bsky.app/hashtag/%1$s"
100
- };
101
- function preparePreviewText(text, options) {
102
- const {
103
- platform,
104
- maxChars,
105
- maxLines,
106
- hyperlinkHashtags = true,
107
- // Instagram doesn't support hyperlink URLs at the moment.
108
- hyperlinkUrls = "instagram" !== platform,
109
- hyperlinks
110
- } = options;
111
- let result = stripHtmlTags(text);
112
- result = result.replaceAll(/(?:\s*[\n\r]){2,}/g, "\n\n");
113
- if (maxChars && codepointLength(result) > maxChars) {
114
- result = hardTruncation(maxChars)(result);
115
- }
116
- if (maxLines) {
117
- const lines = result.split("\n");
118
- if (lines.length > maxLines) {
119
- result = lines.slice(0, maxLines).join("\n");
120
- }
121
- }
122
- const componentMap = {};
123
- if (hyperlinkUrls) {
124
- const urls = result.match(/(https?:\/\/\S+)/g) || [];
125
- urls.forEach((url, index) => {
126
- componentMap[`Link${index}`] = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: url, rel: "noopener noreferrer", target: "_blank", children: url });
127
- result = result.replace(url, `<Link${index} />`);
128
- });
129
- }
130
- if (hyperlinkHashtags && hashtagUrlMap[platform]) {
131
- const hashtags = result.matchAll(/(^|\s)#(\w+)/g);
132
- const hashtagUrl = hashtagUrlMap[platform];
133
- [...hashtags].forEach(([fullMatch, whitespace, hashtag], index) => {
134
- const url = _i18n.sprintf.call(void 0, hashtagUrl, hashtag, options.hashtagDomain);
135
- componentMap[`Hashtag${index}`] = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: url, rel: "noopener noreferrer", target: "_blank", children: `#${hashtag}` });
136
- result = result.replace(fullMatch, `${whitespace}<Hashtag${index} />`);
137
- });
138
- }
139
- if (_optionalChain([hyperlinks, 'optionalAccess', _4 => _4.length])) {
140
- const matches = [];
141
- hyperlinks.forEach(({ text: anchorText, href, occurrence = 0 }, index) => {
142
- if (!anchorText) {
143
- return;
144
- }
145
- const pos = nthIndexOf(result, anchorText, occurrence);
146
- if (pos === -1) {
147
- return;
148
- }
149
- const overlaps = matches.some(
150
- (match) => pos < match.pos + match.text.length && match.pos < pos + anchorText.length
151
- );
152
- if (!overlaps) {
153
- matches.push({ pos, text: anchorText, href, index });
154
- }
155
- });
156
- matches.sort((a, b) => b.pos - a.pos);
157
- for (const { pos, text: anchorText, href, index } of matches) {
158
- const token = `Hyperlink${index}`;
159
- componentMap[token] = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href, rel: "noopener noreferrer", target: "_blank" });
160
- const wrapped = `<${token}>${anchorText}</${token}>`;
161
- result = result.slice(0, pos) + wrapped + result.slice(pos + anchorText.length);
162
- }
163
- }
164
- result = result.replace(/\n/g, "<br />");
165
- componentMap.br = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {});
166
- return _element.createInterpolateElement.call(void 0, result, componentMap);
167
- }
168
-
169
- // src/site-icon-with-fallback.tsx
170
- var _react = require('react');
171
-
172
- // src/icons/globe-icon.tsx
173
-
174
- function GlobeIcon(props) {
175
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
176
- "svg",
177
- {
178
- focusable: "false",
179
- "aria-hidden": "true",
180
- xmlns: "http://www.w3.org/2000/svg",
181
- viewBox: "0 0 24 24",
182
- width: "14",
183
- height: "14",
184
- ...props,
185
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
186
- "path",
187
- {
188
- fill: "currentColor",
189
- d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"
190
- }
191
- )
192
- }
193
- );
194
- }
195
-
196
- // src/site-icon-with-fallback.tsx
197
-
198
- function DefaultSiteIcon({ className }) {
199
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
200
- "span",
201
- {
202
- className,
203
- "aria-hidden": "true",
204
- style: {
205
- display: "inline-flex",
206
- alignItems: "center",
207
- justifyContent: "center",
208
- backgroundColor: "#e8eaed",
209
- color: "#5f6368",
210
- borderRadius: "50%"
211
- },
212
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GlobeIcon, { style: { width: "60%", height: "60%" } })
213
- }
214
- );
215
- }
216
- function SiteIconWithFallback({
217
- src: siteIconUrl,
218
- alt = "",
219
- className,
220
- fallback = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DefaultSiteIcon, { className })
221
- }) {
222
- const [imageUrlWithError, setImageUrlWithError] = _react.useState.call(void 0, "");
223
- const onError = _react.useCallback.call(void 0, (event) => {
224
- setImageUrlWithError(event.target.src);
225
- }, []);
226
- const showIcon = siteIconUrl && // Check if the image URL with error is different from the provided site icon URL
227
- // to ensure that a change in siteIconUrl resets the error state
228
- imageUrlWithError !== siteIconUrl;
229
- return showIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: siteIconUrl, alt, onError, className }) : fallback;
230
- }
231
-
232
- // src/google-search-preview/index.tsx
233
-
234
- var URL_LENGTH = 68;
235
- var TITLE_LENGTH = 63;
236
- var DESCRIPTION_LENGTH = 160;
237
- var googleUrl = (url) => {
238
- const protocol = url.startsWith("https://") ? "https://" : "http://";
239
- const breadcrumb = protocol + url.replace(protocol, "").split("/").join(" \u203A ");
240
- const truncateBreadcrumb = firstValid(shortEnough(URL_LENGTH), hardTruncation(URL_LENGTH));
241
- return truncateBreadcrumb(breadcrumb);
242
- };
243
- var googleTitle = firstValid(
244
- shortEnough(TITLE_LENGTH),
245
- truncatedAtSpace(TITLE_LENGTH - 40, TITLE_LENGTH + 10),
246
- hardTruncation(TITLE_LENGTH)
247
- );
248
- var googleDescription = firstValid(
249
- shortEnough(DESCRIPTION_LENGTH),
250
- truncatedAtSpace(DESCRIPTION_LENGTH - 80, DESCRIPTION_LENGTH + 10),
251
- hardTruncation(DESCRIPTION_LENGTH)
252
- );
253
- var GoogleSearchPreview = ({
254
- description = "",
255
- siteIcon,
256
- siteTitle,
257
- title = "",
258
- url = ""
259
- }) => {
260
- const domain = baseDomain(url);
261
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "search-preview__display", children: [
262
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "search-preview__header", children: [
263
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "search-preview__branding", children: [
264
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SiteIconWithFallback, { className: "search-preview__icon", src: siteIcon }),
265
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "search-preview__site", children: [
266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview__site--title", children: siteTitle || domain }),
267
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview__url", children: googleUrl(url) })
268
- ] })
269
- ] }),
270
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview__menu", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }) })
271
- ] }),
272
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview__title", children: googleTitle(title) }),
273
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "search-preview__description", children: googleDescription(stripHtmlTags(description)) })
274
- ] }) });
275
- };
276
-
277
- // src/twitter-preview/card.tsx
278
- var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);
279
-
280
- var DESCRIPTION_LENGTH2 = 280;
281
- var twitterDescription = firstValid(
282
- shortEnough(DESCRIPTION_LENGTH2),
283
- hardTruncation(DESCRIPTION_LENGTH2)
284
- );
285
- var Card = ({
286
- description,
287
- image,
288
- title,
289
- cardType,
290
- url
291
- }) => {
292
- const cardClassNames = _clsx2.default.call(void 0, `twitter-preview__card-${cardType}`, {
293
- "twitter-preview__card-has-image": !!image
294
- });
295
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__card", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: cardClassNames, children: [
296
- image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "twitter-preview__card-image", src: image, alt: "" }),
297
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__card-body", children: [
298
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__card-url", children: baseDomain(url || "") }),
299
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__card-title", children: title }),
300
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__card-description", children: twitterDescription(stripHtmlTags(description)) })
301
- ] })
302
- ] }) });
303
- };
304
-
305
- // src/twitter-preview/footer.tsx
306
-
307
- var Footer = () => {
308
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__footer", children: [
309
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__icon-replies", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z" }) }) }),
310
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__icon-retweets", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4.5 3.88l4.432 4.14-1.364 1.46L5.5 7.55V16c0 1.1.896 2 2 2H13v2H7.5c-2.209 0-4-1.79-4-4V7.55L1.432 9.48.068 8.02 4.5 3.88zM16.5 6H11V4h5.5c2.209 0 4 1.79 4 4v8.45l2.068-1.93 1.364 1.46-4.432 4.14-4.432-4.14 1.364-1.46 2.068 1.93V8c0-1.1-.896-2-2-2z" }) }) }),
311
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__icon-likes", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M16.697 5.5c-1.222-.06-2.679.51-3.89 2.16l-.805 1.09-.806-1.09C9.984 6.01 8.526 5.44 7.304 5.5c-1.243.07-2.349.78-2.91 1.91-.552 1.12-.633 2.78.479 4.82 1.074 1.97 3.257 4.27 7.129 6.61 3.87-2.34 6.052-4.64 7.126-6.61 1.111-2.04 1.03-3.7.477-4.82-.561-1.13-1.666-1.84-2.908-1.91zm4.187 7.69c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z" }) }) }),
312
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__icon-analytics", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z" }) }) }),
313
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__icon-share", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 2.59l5.7 5.7-1.41 1.42L13 6.41V16h-2V6.41l-3.3 3.3-1.41-1.42L12 2.59zM21 15l-.02 3.51c0 1.38-1.12 2.49-2.5 2.49H5.5C4.11 21 3 19.88 3 18.5V15h2v3.5c0 .28.22.5.5.5h12.98c.28 0 .5-.22.5-.5L19 15h2z" }) }) })
314
- ] });
315
- };
316
-
317
- // src/twitter-preview/header.tsx
318
-
319
-
320
- var Header = ({ name, screenName, date }) => {
321
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__header", children: [
322
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__name", children: name || _i18n.__.call(void 0, "Account Name", "social-previews") }),
323
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__screen-name", children: screenName || "@account" }),
324
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\xB7" }),
325
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "twitter-preview__date", children: formatTweetDate(date || Date.now()) })
326
- ] });
327
- };
328
-
329
- // src/twitter-preview/media.tsx
330
-
331
-
332
-
333
- var Media = ({ media }) => {
334
- const filteredMedia = media.filter(
335
- (mediaItem) => mediaItem.type.startsWith("image/") || mediaItem.type.startsWith("video/")
336
- ).filter((mediaItem, idx, array) => {
337
- if (0 === idx) {
338
- return true;
339
- }
340
- if (array[0].type.startsWith("video/") || "image/gif" === array[0].type) {
341
- return false;
342
- }
343
- if (mediaItem.type.startsWith("video/") || "image/gif" === mediaItem.type) {
344
- return false;
345
- }
346
- return true;
347
- }).slice(0, 4);
348
- if (0 === filteredMedia.length) {
349
- return null;
350
- }
351
- const isVideo = filteredMedia[0].type.startsWith("video/");
352
- const mediaClasses = _clsx2.default.call(void 0, [
353
- "twitter-preview__media",
354
- "twitter-preview__media-children-" + filteredMedia.length
355
- ]);
356
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: mediaClasses, children: filteredMedia.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: isVideo ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url }) }, `twitter-preview__media-item-${index}`)) });
357
- };
358
-
359
- // src/twitter-preview/quote-tweet.tsx
360
- var _components = require('@wordpress/components');
361
-
362
- var QuoteTweet = ({ tweetUrl }) => {
363
- if (!tweetUrl) {
364
- return null;
365
- }
366
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__quote-tweet", children: [
367
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
368
- _components.SandBox,
369
- {
370
- html: `<blockquote class="twitter-tweet" data-conversation="none" data-dnt="true"><a href="${tweetUrl}"></a></blockquote>`,
371
- scripts: ["https://platform.twitter.com/widgets.js"],
372
- title: "Embedded tweet"
373
- }
374
- ),
375
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__quote-tweet-overlay" })
376
- ] });
377
- };
378
-
379
- // src/avatar-with-fallback.tsx
380
-
381
-
382
- function DefaultAvatar(props) {
383
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
384
- "svg",
385
- {
386
- xmlns: "http://www.w3.org/2000/svg",
387
- viewBox: "0 0 340 340",
388
- width: "36",
389
- height: "36",
390
- "aria-hidden": "true",
391
- ...props,
392
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
393
- "path",
394
- {
395
- fill: "#DDD",
396
- d: "m169,.5a169,169 0 1,0 2,0zm0,86a76,76 0 1 1-2,0zM57,287q27-35 67-35h92q40,0 67,35a164,164 0 0,1-226,0"
397
- }
398
- )
399
- }
400
- );
401
- }
402
- function AvatarWithFallback({
403
- src: avatarUrl,
404
- alt = "",
405
- className,
406
- fallback = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DefaultAvatar, { className })
407
- }) {
408
- const [imageUrlWithError, setImageUrlWithError] = _react.useState.call(void 0, "");
409
- const onError = _react.useCallback.call(void 0, (event) => {
410
- setImageUrlWithError(event.target.src);
411
- }, []);
412
- const showAvatar = !!avatarUrl && // Check if the image URL with error is different from the provided avatar URL
413
- // to ensure that a change in avatarUrl resets the error state
414
- imageUrlWithError !== avatarUrl;
415
- return showAvatar ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: avatarUrl, alt, onError, className }) : fallback;
416
- }
417
-
418
- // src/twitter-preview/sidebar.tsx
419
-
420
- var Sidebar = ({ profileImage, showThreadConnector }) => {
421
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__sidebar", children: [
422
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__profile-image", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { src: profileImage }) }),
423
- showThreadConnector && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__connector" })
424
- ] });
425
- };
426
-
427
- // src/twitter-preview/text.tsx
428
-
429
- var Text = ({ text }) => {
430
- if (!text) {
431
- return null;
432
- }
433
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__text", children: preparePreviewText(text, { platform: "twitter" }) });
434
- };
435
-
436
- // src/twitter-preview/post-preview.tsx
437
-
438
- var TwitterPostPreview = ({
439
- date,
440
- description,
441
- image,
442
- media,
443
- name,
444
- profileImage,
445
- screenName,
446
- showThreadConnector,
447
- text,
448
- title,
449
- tweetUrl,
450
- cardType,
451
- url
452
- }) => {
453
- const hasMedia = !!_optionalChain([media, 'optionalAccess', _5 => _5.length]);
454
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "twitter-preview__wrapper", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__container", children: [
455
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Sidebar, { profileImage, showThreadConnector }),
456
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__main", children: [
457
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Header, { name, screenName, date }),
458
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "twitter-preview__content", children: [
459
- text ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { text }) : null,
460
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Media, { media }) : null,
461
- tweetUrl ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuoteTweet, { tweetUrl }) : null,
462
- !hasMedia && url && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
463
- Card,
464
- {
465
- description: description || "",
466
- image,
467
- title: title || "",
468
- cardType: cardType || "",
469
- url
470
- }
471
- )
472
- ] }),
473
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Footer, {})
474
- ] })
475
- ] }) });
476
- };
477
-
478
- // src/twitter-preview/link-preview.tsx
479
-
480
- var TwitterLinkPreview = (props) => {
481
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
482
- TwitterPostPreview,
483
- {
484
- ...props,
485
- text: "",
486
- media: void 0
487
- }
488
- );
489
- };
490
-
491
- // src/twitter-preview/previews.tsx
492
-
493
-
494
- // src/shared/section-heading/index.tsx
495
-
496
- var HEADING_LEVELS = [2, 3, 4, 5, 6];
497
- var SectionHeading = ({
498
- className,
499
- level,
500
- children
501
- }) => {
502
- const Tag = `h${level && HEADING_LEVELS.includes(level) ? level : 3}`;
503
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tag, { className: `social-preview__section-heading ${_nullishCoalesce(className, () => ( ""))}`, children });
504
- };
505
- var section_heading_default = SectionHeading;
506
-
507
- // src/twitter-preview/previews.tsx
508
-
509
- var TwitterPreviews = ({
510
- headingLevel,
511
- hideLinkPreview,
512
- hidePostPreview,
513
- tweets
514
- }) => {
515
- if (!_optionalChain([tweets, 'optionalAccess', _6 => _6.length])) {
516
- return null;
517
- }
518
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview twitter-preview", children: [
519
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section twitter-preview__section", children: [
520
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
521
- level: headingLevel,
522
- // translators: refers to a social post on Twitter
523
- children: _i18n.__.call(void 0, "Your post", "social-previews")
524
- }),
525
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on X:", "social-previews") }),
526
- tweets.map((tweet, index) => {
527
- const isLast = index + 1 === tweets.length;
528
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
529
- TwitterPostPreview,
530
- {
531
- ...tweet,
532
- showThreadConnector: !isLast
533
- },
534
- `twitter-preview__tweet-${index}`
535
- );
536
- })
537
- ] }),
538
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section twitter-preview__section", children: [
539
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
540
- level: headingLevel,
541
- // translators: refers to a link to a Twitter post
542
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
543
- }),
544
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
545
- "This is what it will look like when someone shares the link to your WordPress post on X.",
546
- "social-previews"
547
- ) }),
548
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TwitterLinkPreview, { ...tweets[0], name: "", profileImage: "", screenName: "" })
549
- ] })
550
- ] });
551
- };
552
-
553
- // src/linkedin-preview/post-preview.tsx
554
-
555
-
556
- // src/shared/expandable-text/index.tsx
557
-
558
-
559
-
560
-
561
- var EXPAND_THRESHOLD_CHARS = 400;
562
- function codepointLength2(text) {
563
- return Array.from(text).length;
564
- }
565
- function truncateAtWordBoundary(text, limit) {
566
- const codepoints = Array.from(text);
567
- if (codepoints.length <= limit) {
568
- return text;
569
- }
570
- const slice = codepoints.slice(0, limit).join("");
571
- const lastSpace = slice.lastIndexOf(" ");
572
- const cut = lastSpace > limit - 80 ? lastSpace : slice.length;
573
- return slice.slice(0, cut);
574
- }
575
- function ExpandableText(props) {
576
- const { text, children } = props;
577
- const [expanded, toggle] = _react.useReducer.call(void 0, (state) => !state, false);
578
- const stripped = stripHtmlTags(text);
579
- if (codepointLength2(stripped) <= EXPAND_THRESHOLD_CHARS) {
580
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: children(text) });
581
- }
582
- if (expanded) {
583
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
584
- children(text),
585
- " ",
586
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.Button, { variant: "link", className: "social-previews__expand-toggle", onClick: toggle, children: _i18n.__.call(void 0, "See less", "social-previews") })
587
- ] });
588
- }
589
- const truncated = truncateAtWordBoundary(stripped, EXPAND_THRESHOLD_CHARS);
590
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
591
- children(truncated),
592
- "\u2026 ",
593
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _components.Button, { variant: "link", className: "social-previews__expand-toggle", onClick: toggle, children: _i18n.__.call(void 0, "See more", "social-previews") })
594
- ] });
595
- }
596
-
597
- // src/linkedin-preview/constants.ts
598
- var FEED_TEXT_MAX_LENGTH = 3e3;
599
-
600
- // src/linkedin-preview/post-preview.tsx
601
-
602
- function LinkedInPostPreview({
603
- articleReadTime = 5,
604
- image,
605
- jobTitle,
606
- name,
607
- profileImage,
608
- description,
609
- media,
610
- title,
611
- url
612
- }) {
613
- const hasMedia = !!_optionalChain([media, 'optionalAccess', _7 => _7.length]);
614
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "linkedin-preview__wrapper", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: `linkedin-preview__container ${hasMedia ? "has-media" : ""}`, children: [
615
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__header", children: [
616
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "linkedin-preview__header--avatar", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { src: profileImage }) }),
617
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__header--profile", children: [
618
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__header--profile-info", children: [
619
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "linkedin-preview__header--profile-name", children: name || _i18n.__.call(void 0, "Account Name", "social-previews") }),
620
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2022" }),
621
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
622
- className: "linkedin-preview__header--profile-actor",
623
- // translators: refers to the actor level of the post being shared, e.g. "1st", "2nd", "3rd", etc.
624
- children: _i18n.__.call(void 0, "1st", "social-previews")
625
- })
626
- ] }),
627
- jobTitle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "linkedin-preview__header--profile-title", children: jobTitle }) : null,
628
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__header--profile-meta", children: [
629
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", {
630
- // translators: refers to the time since the post was published, e.g. "1h"
631
- children: _i18n.__.call(void 0, "1h", "social-previews")
632
- }),
633
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2022" }),
634
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 16 16", fill: "currentColor", width: "16", height: "16", focusable: "false", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 1a7 7 0 107 7 7 7 0 00-7-7zM3 8a5 5 0 011-3l.55.55A1.5 1.5 0 015 6.62v1.07a.75.75 0 00.22.53l.56.56a.75.75 0 00.53.22H7v.69a.75.75 0 00.22.53l.56.56a.75.75 0 01.22.53V13a5 5 0 01-5-5zm6.24 4.83l2-2.46a.75.75 0 00.09-.8l-.58-1.16A.76.76 0 0010 8H7v-.19a.51.51 0 01.28-.45l.38-.19a.74.74 0 01.68 0L9 7.5l.38-.7a1 1 0 00.12-.48v-.85a.78.78 0 01.21-.53l1.07-1.09a5 5 0 01-1.54 9z" }) })
635
- ] })
636
- ] })
637
- ] }),
638
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__content", children: [
639
- description ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__caption", children: [
640
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: description, children: (visibleText) => preparePreviewText(visibleText, {
641
- platform: "linkedin",
642
- maxChars: FEED_TEXT_MAX_LENGTH
643
- }) }) }),
644
- hasMedia && url && !description.includes(url) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
645
- " - ",
646
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: url, rel: "nofollow noopener noreferrer", target: "_blank", children: url })
647
- ] })
648
- ] }) : null,
649
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "linkedin-preview__media", children: media.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
650
- "div",
651
- {
652
- className: "linkedin-preview__media-item",
653
- children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url })
654
- },
655
- `linkedin-preview__media-item-${index}`
656
- )) }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { children: [
657
- image ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "linkedin-preview__image", src: image, alt: "" }) : null,
658
- url ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__description", children: [
659
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "linkedin-preview__description--title", children: title || getTitleFromDescription(description) }),
660
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "linkedin-preview__description--meta", children: [
661
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "linkedin-preview__description--url", children: baseDomain(url) }),
662
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2022" }),
663
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _i18n.sprintf.call(void 0,
664
- // translators: %d is the number of minutes it takes to read the article
665
- _i18n.__.call(void 0, "%d min read", "social-previews"),
666
- articleReadTime
667
- ) })
668
- ] })
669
- ] }) : null
670
- ] })
671
- ] })
672
- ] }) });
673
- }
674
-
675
- // src/linkedin-preview/link-preview.tsx
676
-
677
- function LinkedInLinkPreview(props) {
678
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
679
- LinkedInPostPreview,
680
- {
681
- name: "",
682
- profileImage: "",
683
- ...props,
684
- description: "",
685
- media: void 0,
686
- title: props.title || getTitleFromDescription(props.description)
687
- }
688
- );
689
- }
690
-
691
- // src/linkedin-preview/previews.tsx
692
-
693
-
694
- var LinkedInPreviews = ({
695
- headingLevel,
696
- hideLinkPreview,
697
- hidePostPreview,
698
- ...props
699
- }) => {
700
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview linkedin-preview", children: [
701
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section linkedin-preview__section", children: [
702
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
703
- level: headingLevel,
704
- // translators: refers to a social post on LinkedIn
705
- children: _i18n.__.call(void 0, "Your post", "social-previews")
706
- }),
707
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on LinkedIn:", "social-previews") }),
708
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkedInPostPreview, { ...props })
709
- ] }),
710
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section linkedin-preview__section", children: [
711
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
712
- level: headingLevel,
713
- // translators: refers to a link to a LinkedIn post
714
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
715
- }),
716
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
717
- "This is what it will look like when someone shares the link to your WordPress post on LinkedIn.",
718
- "social-previews"
719
- ) }),
720
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkedInLinkPreview, { ...props, name: "", profileImage: "" })
721
- ] })
722
- ] });
723
- };
724
-
725
- // src/tumblr-preview/link-preview.tsx
726
-
727
-
728
- // src/tumblr-preview/helpers.ts
729
- var TITLE_LENGTH2 = 1e3;
730
- var DESCRIPTION_LENGTH3 = 4096;
731
- var tumblrTitle = (text) => firstValid(
732
- shortEnough(TITLE_LENGTH2),
733
- hardTruncation(TITLE_LENGTH2)
734
- )(stripHtmlTags(text)) || "";
735
- var tumblrDescription = (text) => {
736
- let processedText = text;
737
- let startIndex = processedText.indexOf("<!--");
738
- while (startIndex !== -1) {
739
- const endIndex = processedText.indexOf("-->", startIndex);
740
- if (endIndex === -1) {
741
- processedText = processedText.substring(0, startIndex);
742
- break;
743
- }
744
- processedText = processedText.substring(0, startIndex) + processedText.substring(endIndex + 3);
745
- startIndex = processedText.indexOf("<!--");
746
- }
747
- processedText = processedText.replace(/<\/p>/g, "</p>\n\n");
748
- return firstValid(
749
- shortEnough(DESCRIPTION_LENGTH3),
750
- hardTruncation(DESCRIPTION_LENGTH3)
751
- )(stripHtmlTags(processedText)) || "";
752
- };
753
-
754
- // src/tumblr-preview/post/actions/index.tsx
755
-
756
-
757
- // src/tumblr-preview/post/icons/index.tsx
758
-
759
- var TumblrPostIcon = ({ name }) => {
760
- let svg;
761
- switch (name) {
762
- case "blaze":
763
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 25 22", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "m7.5059-0.24414c-0.79843 0.057223-1.2169 0.88587-1.1635 1.6128-0.2266 2.0449-1.4898 3.8696-3.1975 4.9778-3.0182 2.414-4.2201 6.8066-2.8033 10.411 0.92417 2.4679 2.9589 4.5674 5.4768 5.3928 0.95914 0.16102 1.7233-0.94358 1.3074-1.8059-0.11578-0.51062-0.17482-0.96516-0.17845-1.487 1.0413 1.5607 2.5484 2.8986 4.341 3.4975 1.0396-0.0154 1.98-0.64458 2.8516-1.1608 3.3821-2.1786 4.9604-6.7097 3.6597-10.518-0.49144-1.4599-1.2948-2.8935-2.5028-3.8698-0.7512-0.45498-1.661 0.09677-1.9202 0.86038-0.12274 0.16822-0.70352 1.1955-0.6191 0.61976 0.25488-3.4397-1.6789-7.0066-4.8123-8.4958-0.14322-0.037843-0.292-0.049464-0.43945-0.035156zm1.0586 3.5605c1.8947 2.0016 2.2326 5.1984 0.89062 7.5879-0.38498 0.96148 0.71762 2.0063 1.6567 1.5681 1.4159-0.4624 2.6998-1.3259 3.6577-2.4665 1.6442 2.5888 1.1465 6.2819-1.0629 8.3379-0.62378 0.60782-1.3666 1.0945-2.1754 1.4179-1.9543-0.989-3.3534-3.0966-3.5625-5.3125-0.25636-1.0253-1.81-1.2013-2.2852-0.25781-0.75058 1.3054-1.1846 2.7948-1.2305 4.3008-2.2396-1.9852-2.8468-5.4435-1.4609-8.0527 0.58926-1.239 1.651-2.13 2.724-2.9329 1.2958-1.1271 2.2791-2.62 2.7682-4.2683l0.071578 0.069832z" }) });
764
- break;
765
- case "delete":
766
- svg = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 14 17", children: [
767
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 5v9c.1.7-.3 1-1 1H3c-.5 0-.9-.3-1-1V5c0-.6-.4-1-1-1-.5 0-1 .4-1 1v9.5C0 16.1 1.4 17 3 17h8c1.8 0 3-.8 3-2.5V5c0-.6-.5-1-1-1-.6 0-1 .5-1 1z" }),
768
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4 12s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm4 0s0 1 1 1 1-1 1-1V5c0-.5-.4-1-1-1-.5 0-1 .5-1 1v7zm5-10c.5 0 1-.4 1-1 0-.5-.4-.9-1-1H1C.5.1 0 .5 0 1c0 .6.6 1 1.1 1H13z" })
769
- ] });
770
- break;
771
- case "edit":
772
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 17.6 17.6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M5.3 13.8l-2.1.7.7-2.1L10.3 6l1.4 1.4-6.4 6.4zm6.4-9.3l-1.4-1.4-1.4 1.4-6.7 6.7-.2.5-2 5.9 3.8-1.3 2.1-.7.4-.1.3-.3 7.8-7.8c.1 0-2.7-2.9-2.7-2.9zm5.6-1.4L14.5.3c-.4-.4-1-.4-1.4 0l-1.4 1.4L15.9 6l1.4-1.4c.4-.5.4-1.1 0-1.5" }) });
773
- break;
774
- case "share":
775
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12.6173 1.07612C12.991 0.921338 13.4211 1.00689 13.7071 1.29289L22.7071 10.2929C23.0832 10.669 23.0991 11.2736 22.7433 11.669L13.7433 21.669C13.4663 21.9767 13.0283 22.082 12.6417 21.9336C12.2552 21.7853 12 21.414 12 21V16H11.5C7.31775 16 3.92896 18.2486 2.95256 21.3044C2.80256 21.7738 2.33292 22.064 1.84598 21.9881C1.35904 21.9122 1 21.4928 1 21V18.5C1 12.3162 5.88069 7.27245 12 7.01067V2C12 1.59554 12.2436 1.2309 12.6173 1.07612ZM14 4.41421V8C14 8.55228 13.5523 9 13 9H12.5C7.64534 9 3.64117 12.6414 3.06988 17.3419C5.09636 15.2366 8.18218 14 11.5 14H13C13.5523 14 14 14.4477 14 15V18.394L20.622 11.0362L14 4.41421Z" }) });
776
- break;
777
- case "reply":
778
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 17 17", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8.7 0C4.1 0 .4 3.7.4 8.3c0 1.2.2 2.3.7 3.4-.2.6-.4 1.5-.7 2.5L0 15.8c-.2.7.5 1.4 1.2 1.2l1.6-.4 2.4-.7c1.1.5 2.2.7 3.4.7 4.6 0 8.3-3.7 8.3-8.3C17 3.7 13.3 0 8.7 0zM15 8.3c0 3.5-2.8 6.3-6.4 6.3-1.2 0-2.3-.3-3.2-.9l-3.2.9.9-3.2c-.5-.9-.9-2-.9-3.2.1-3.4 3-6.2 6.5-6.2S15 4.8 15 8.3z" }) });
779
- break;
780
- case "reblog":
781
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 17 18.1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12.8.2c-.4-.4-.8-.2-.8.4v2H2c-2 0-2 2-2 2v5s0 1 1 1 1-1 1-1v-4c0-1 .5-1 1-1h9v2c0 .6.3.7.8.4L17 3.6 12.8.2zM4.2 17.9c.5.4.8.2.8-.3v-2h10c2 0 2-2 2-2v-5s0-1-1-1-1 1-1 1v4c0 1-.5 1-1 1H5v-2c0-.6-.3-.7-.8-.4L0 14.6l4.2 3.3z" }) });
782
- break;
783
- case "like":
784
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 20 18", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14.658 0c-1.625 0-3.21.767-4.463 2.156-.06.064-.127.138-.197.225-.074-.085-.137-.159-.196-.225C8.547.766 6.966 0 5.35 0 4.215 0 3.114.387 2.162 1.117c-2.773 2.13-2.611 5.89-1.017 8.5 2.158 3.535 6.556 7.18 7.416 7.875A2.3 2.3 0 0 0 9.998 18c.519 0 1.028-.18 1.436-.508.859-.695 5.257-4.34 7.416-7.875 1.595-2.616 1.765-6.376-1-8.5C16.895.387 15.792 0 14.657 0h.001zm0 2.124c.645 0 1.298.208 1.916.683 1.903 1.461 1.457 4.099.484 5.695-1.973 3.23-6.16 6.7-6.94 7.331a.191.191 0 0 1-.241 0c-.779-.631-4.966-4.101-6.94-7.332-.972-1.595-1.4-4.233.5-5.694.619-.475 1.27-.683 1.911-.683 1.064 0 2.095.574 2.898 1.461.495.549 1.658 2.082 1.753 2.203.095-.12 1.259-1.654 1.752-2.203.8-.887 1.842-1.461 2.908-1.461h-.001z" }) });
785
- break;
786
- case "ellipsis":
787
- svg = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 17.5 3.9", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M17.5 1.9c0 1.1-.9 1.9-1.9 1.9-1.1 0-1.9-.9-1.9-1.9S14.5 0 15.6 0c1 0 1.9.9 1.9 1.9m-6.8 0c0 1.1-.9 1.9-1.9 1.9-1.1.1-2-.8-2-1.9 0-1 .9-1.9 2-1.9s1.9.9 1.9 1.9m-6.8 0c0 1.1-.9 2-2 2-1 0-1.9-.9-1.9-2S.9 0 1.9 0c1.1 0 2 .9 2 1.9" }) });
788
- break;
789
- }
790
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `tumblr-preview__post-icon tumblr-preview__post-icon-${name}`, children: svg });
791
- };
792
- var icons_default = TumblrPostIcon;
793
-
794
- // src/tumblr-preview/post/actions/index.tsx
795
-
796
- var TumblrPostActions = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post-actions", children: [
797
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post-manage-actions", children: [
798
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post-actions-blaze", children: [
799
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default, { name: "blaze" }),
800
- "\xA0Blaze"
801
- ] }),
802
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { children: [
803
- {
804
- icon: "delete",
805
- // translators: "Delete" action on a Tumblr post
806
- label: _i18n.__.call(void 0, "Delete", "social-previews")
807
- },
808
- {
809
- icon: "edit",
810
- // translators: "Edit" action on a Tumblr post
811
- label: _i18n.__.call(void 0, "Edit", "social-previews")
812
- }
813
- ].map(({ icon, label }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { "aria-label": label, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default, { name: icon }) }, icon)) })
814
- ] }),
815
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post-social-actions", children: [
816
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", {
817
- // translators: count of notes on a Tumblr post
818
- children: _i18n.__.call(void 0, "0 notes", "social-previews")
819
- }),
820
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { children: [
821
- {
822
- icon: "share",
823
- // translators: "Share" action on a Tumblr post
824
- label: _i18n.__.call(void 0, "Share", "social-previews")
825
- },
826
- {
827
- icon: "reply",
828
- // translators: "Reply" action on a Tumblr post
829
- label: _i18n.__.call(void 0, "Reply", "social-previews")
830
- },
831
- {
832
- icon: "reblog",
833
- // translators: "Reblog" action on a Tumblr post
834
- label: _i18n.__.call(void 0, "Reblog", "social-previews")
835
- },
836
- {
837
- icon: "like",
838
- // translators: "Like" action on a Tumblr post
839
- label: _i18n.__.call(void 0, "Like", "social-previews")
840
- }
841
- ].map(({ icon, label }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { "aria-label": label, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default, { name: icon }) }, icon)) })
842
- ] })
843
- ] });
844
- var actions_default = TumblrPostActions;
845
-
846
- // src/tumblr-preview/post/header/index.tsx
847
-
848
-
849
- var TumblrPostHeader = ({ user }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post-header", children: [
850
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__post-header-username", children: _optionalChain([user, 'optionalAccess', _8 => _8.displayName]) || // translators: username of a fictional Tumblr User
851
- _i18n.__.call(void 0, "anonymous-user", "social-previews") }),
852
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default, { name: "ellipsis" })
853
- ] });
854
- var header_default = TumblrPostHeader;
855
-
856
- // src/tumblr-preview/link-preview.tsx
857
-
858
- var TumblrLinkPreview = ({
859
- title,
860
- description,
861
- image,
862
- user,
863
- url
864
- }) => {
865
- const avatarUrl = _optionalChain([user, 'optionalAccess', _9 => _9.avatarUrl]);
866
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post", children: [
867
- avatarUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "tumblr-preview__avatar", src: avatarUrl, alt: "" }),
868
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__card", children: [
869
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default, { user }),
870
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__window", children: [
871
- image && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__window-top", children: [
872
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__overlay", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__title", children: tumblrTitle(title) }) }),
873
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
874
- "img",
875
- {
876
- className: "tumblr-preview__image",
877
- src: image,
878
- alt: _i18n.__.call(void 0, "Tumblr preview thumbnail", "social-previews")
879
- }
880
- )
881
- ] }),
882
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `tumblr-preview__window-bottom ${!image ? "is-full" : ""}`, children: [
883
- !image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__title", children: tumblrTitle(title) }),
884
- description && image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__description", children: tumblrDescription(description) }),
885
- url && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__site-name", children: baseDomain(url) })
886
- ] })
887
- ] }),
888
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default, {})
889
- ] })
890
- ] });
891
- };
892
-
893
- // src/tumblr-preview/post-preview.tsx
894
-
895
-
896
- var TumblrPostPreview = ({
897
- title,
898
- description,
899
- image,
900
- user,
901
- url,
902
- media,
903
- hyperlinks
904
- }) => {
905
- const avatarUrl = _optionalChain([user, 'optionalAccess', _10 => _10.avatarUrl]);
906
- const mediaItem = _optionalChain([media, 'optionalAccess', _11 => _11[0]]);
907
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__post", children: [
908
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { className: "tumblr-preview__avatar", src: avatarUrl }),
909
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__card", children: [
910
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default, { user }),
911
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tumblr-preview__body", children: [
912
- title ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__title", children: tumblrTitle(title) }) : null,
913
- description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__description", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: description, children: (visibleText) => preparePreviewText(tumblrDescription(visibleText), {
914
- platform: "tumblr",
915
- hyperlinks
916
- }) }) }),
917
- mediaItem ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tumblr-preview__media-item", children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, className: "tumblr-preview__media--video", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "tumblr-preview__image", src: mediaItem.url, alt: "" }) }) : image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
918
- "img",
919
- {
920
- className: "tumblr-preview__image",
921
- src: image,
922
- alt: _i18n.__.call(void 0, "Tumblr preview thumbnail", "social-previews")
923
- }
924
- ),
925
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className: "tumblr-preview__url", href: url, target: "_blank", rel: "noreferrer", children: _i18n.__.call(void 0, "View On WordPress", "social-previews") })
926
- ] }),
927
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default, {})
928
- ] })
929
- ] });
930
- };
931
-
932
- // src/tumblr-preview/previews.tsx
933
-
934
-
935
- var TumblrPreviews = ({
936
- headingLevel,
937
- hideLinkPreview,
938
- hidePostPreview,
939
- ...props
940
- }) => {
941
- const hasMedia = !!_optionalChain([props, 'access', _12 => _12.media, 'optionalAccess', _13 => _13.length]);
942
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview tumblr-preview", children: [
943
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section tumblr-preview__section", children: [
944
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
945
- level: headingLevel,
946
- // translators: refers to a social post on Tumblr
947
- children: _i18n.__.call(void 0, "Your post", "social-previews")
948
- }),
949
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Tumblr:", "social-previews") }),
950
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TumblrPostPreview, { ...props }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TumblrLinkPreview, { ...props })
951
- ] }),
952
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section tumblr-preview__section", children: [
953
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
954
- level: headingLevel,
955
- // translators: refers to a link on Tumblr
956
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
957
- }),
958
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
959
- "This is what it will look like when someone shares the link to your WordPress post on Tumblr.",
960
- "social-previews"
961
- ) }),
962
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TumblrLinkPreview, { ...props, user: void 0 })
963
- ] })
964
- ] });
965
- };
966
-
967
- // src/facebook-preview/previews.tsx
968
-
969
-
970
- // src/facebook-preview/link-preview.tsx
971
-
972
-
973
- // src/constants.ts
974
- var AUTO_SHARED_SOCIAL_POST_PREVIEW = "AUTO_SHARED_SOCIAL_POST_PREVIEW";
975
- var AUTO_SHARED_LINK_PREVIEW = "AUTO_SHARED_LINK_PREVIEW";
976
- var DEFAULT_LINK_PREVIEW = "DEFAULT_LINK_PREVIEW";
977
- var TYPE_WEBSITE = "website";
978
- var TYPE_ARTICLE = "article";
979
- var LANDSCAPE_MODE = "landscape";
980
- var PORTRAIT_MODE = "portrait";
981
-
982
- // src/facebook-preview/helpers.ts
983
- var TITLE_LENGTH3 = 110;
984
- var DESCRIPTION_LENGTH4 = 200;
985
- var CUSTOM_TEXT_LENGTH = 63206;
986
- var facebookTitle = (text) => firstValid(
987
- shortEnough(TITLE_LENGTH3),
988
- hardTruncation(TITLE_LENGTH3)
989
- )(stripHtmlTags(text)) || "";
990
- var facebookDescription = (text) => firstValid(
991
- shortEnough(DESCRIPTION_LENGTH4),
992
- hardTruncation(DESCRIPTION_LENGTH4)
993
- )(stripHtmlTags(text)) || "";
994
-
995
- // src/facebook-preview/custom-text.tsx
996
-
997
- var CustomText = ({ text, url, forceUrlDisplay }) => {
998
- let postLink;
999
- const showPostLink = hasTag(text, "a") || forceUrlDisplay && !!url && !text.includes(url);
1000
- if (showPostLink) {
1001
- postLink = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1002
- "a",
1003
- {
1004
- className: "facebook-preview__custom-text-post-url",
1005
- href: url,
1006
- rel: "nofollow noopener noreferrer",
1007
- target: "_blank",
1008
- children: url
1009
- }
1010
- );
1011
- }
1012
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "facebook-preview__custom-text", children: [
1013
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text, children: (visibleText) => preparePreviewText(visibleText, {
1014
- platform: "facebook",
1015
- maxChars: CUSTOM_TEXT_LENGTH
1016
- }) }) }),
1017
- postLink
1018
- ] });
1019
- };
1020
- var custom_text_default = CustomText;
1021
-
1022
- // src/facebook-preview/hooks/use-image-hook.ts
1023
-
1024
-
1025
- var useImage = ({ mode: initialMode }) => {
1026
- const [mode, setMode] = _react.useState.call(void 0, initialMode);
1027
- const [isLoadingImage, setLoadingImage] = _react.useState.call(void 0, true);
1028
- const onLoad = _react.useCallback.call(void 0,
1029
- ({ target }) => {
1030
- if (!mode) {
1031
- const image = target;
1032
- setMode(image.naturalWidth > image.naturalHeight ? LANDSCAPE_MODE : PORTRAIT_MODE);
1033
- }
1034
- setLoadingImage(false);
1035
- },
1036
- [mode]
1037
- );
1038
- const onError = _react.useCallback.call(void 0, () => setLoadingImage(false), []);
1039
- return [
1040
- mode,
1041
- isLoadingImage,
1042
- {
1043
- alt: _i18n.__.call(void 0, "Facebook Preview Thumbnail", "social-previews"),
1044
- onLoad,
1045
- onError
1046
- }
1047
- ];
1048
- };
1049
- var use_image_hook_default = useImage;
1050
-
1051
- // src/facebook-preview/post/actions/index.tsx
1052
-
1053
-
1054
- // src/facebook-preview/post/icons/index.tsx
1055
-
1056
- var FacebookPostIcon = ({ name }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "i", { className: `facebook-preview__post-icon facebook-preview__post-icon-${name}` });
1057
- var icons_default2 = FacebookPostIcon;
1058
-
1059
- // src/facebook-preview/post/actions/index.tsx
1060
-
1061
- var FacebookPostActions = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "facebook-preview__post-actions", children: [
1062
- {
1063
- icon: "like",
1064
- // translators: Facebook "Like" action
1065
- label: _i18n.__.call(void 0, "Like", "social-previews")
1066
- },
1067
- {
1068
- icon: "comment",
1069
- // translators: Facebook "Comment" action
1070
- label: _i18n.__.call(void 0, "Comment", "social-previews")
1071
- },
1072
- {
1073
- icon: "share",
1074
- // translators: Facebook "Share" action
1075
- label: _i18n.__.call(void 0, "Share", "social-previews")
1076
- }
1077
- ].map(({ icon, label }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { children: [
1078
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default2, { name: icon }),
1079
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: label })
1080
- ] }, icon)) });
1081
- var actions_default2 = FacebookPostActions;
1082
-
1083
- // src/facebook-preview/post/header/index.tsx
1084
-
1085
-
1086
- var FacebookPostHeader = ({ user, timeElapsed, hideOptions }) => {
1087
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post-header", children: [
1088
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post-header-content", children: [
1089
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1090
- AvatarWithFallback,
1091
- {
1092
- className: "facebook-preview__post-header-avatar",
1093
- src: _optionalChain([user, 'optionalAccess', _14 => _14.avatarUrl])
1094
- }
1095
- ),
1096
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1097
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__post-header-name", children: _optionalChain([user, 'optionalAccess', _15 => _15.displayName]) || // translators: name of a fictional Facebook User
1098
- _i18n.__.call(void 0, "Anonymous User", "social-previews") }),
1099
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post-header-share", children: [
1100
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "facebook-preview__post-header-time", children: timeElapsed ? _i18n.__.call(void 0,
1101
- // translators: short version of `1 hour`
1102
- "1h",
1103
- "social-previews"
1104
- ) : _i18n._x.call(void 0,
1105
- // translators: temporal indication of when a post was published
1106
- "Just now",
1107
- "",
1108
- "social-previews"
1109
- ) }),
1110
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "facebook-preview__post-header-dot", "aria-hidden": "true", children: "\xB7" }),
1111
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default2, { name: "public" })
1112
- ] })
1113
- ] })
1114
- ] }),
1115
- !hideOptions && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__post-header-more" })
1116
- ] });
1117
- };
1118
- var header_default2 = FacebookPostHeader;
1119
-
1120
- // src/facebook-preview/link-preview.tsx
1121
-
1122
- var FacebookLinkPreview = ({
1123
- url,
1124
- title,
1125
- description,
1126
- image,
1127
- user,
1128
- customText,
1129
- type,
1130
- imageMode,
1131
- compactDescription
1132
- }) => {
1133
- const [mode, isLoadingImage, imgProps] = use_image_hook_default({ mode: imageMode });
1134
- const isArticle = type === TYPE_ARTICLE;
1135
- const portraitMode = isArticle && !image || mode === PORTRAIT_MODE;
1136
- const modeClass = `is-${portraitMode ? "portrait" : "landscape"}`;
1137
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post", children: [
1138
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default2, { user }),
1139
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__content", children: [
1140
- customText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, custom_text_default, { text: customText, url }),
1141
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1142
- "div",
1143
- {
1144
- className: `facebook-preview__body ${modeClass} ${image && isLoadingImage ? "is-loading" : ""}`,
1145
- children: [
1146
- (image || isArticle) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1147
- "div",
1148
- {
1149
- className: `facebook-preview__image ${image ? "" : "is-empty"} ${modeClass}`,
1150
- children: image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: image, ...imgProps })
1151
- }
1152
- ),
1153
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__text", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__text-wrapper", children: [
1154
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__url", children: baseDomain(url) }),
1155
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__title", children: facebookTitle(title) || baseDomain(url) }),
1156
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1157
- "div",
1158
- {
1159
- className: `facebook-preview__description ${compactDescription ? "is-compact" : ""}`,
1160
- children: [
1161
- description && facebookDescription(description),
1162
- isArticle && !description && // translators: Default description for a Facebook post
1163
- _i18n.__.call(void 0, "Visit the post for more.", "social-previews")
1164
- ]
1165
- }
1166
- ),
1167
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, icons_default2, { name: "info" }) })
1168
- ] }) })
1169
- ]
1170
- }
1171
- )
1172
- ] }),
1173
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default2, {})
1174
- ] });
1175
- };
1176
-
1177
- // src/facebook-preview/link-preview-details.tsx
1178
-
1179
- var LinkPreviewDetails = ({
1180
- url,
1181
- customImage,
1182
- user,
1183
- customText,
1184
- imageMode
1185
- }) => {
1186
- const [mode, isLoadingImage, imgProps] = use_image_hook_default({ mode: imageMode });
1187
- const modeClass = `is-${mode === PORTRAIT_MODE ? "portrait" : "landscape"}`;
1188
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post", children: [
1189
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default2, { user: void 0 }),
1190
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__content", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1191
- "div",
1192
- {
1193
- className: `facebook-preview__window ${modeClass} ${customImage && isLoadingImage ? "is-loading" : ""}`,
1194
- children: [
1195
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `facebook-preview__custom-image ${modeClass}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: customImage, ...imgProps }) }),
1196
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default2, { user, timeElapsed: true, hideOptions: true }),
1197
- customText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, custom_text_default, { text: customText, url, forceUrlDisplay: true })
1198
- ]
1199
- }
1200
- ) }),
1201
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default2, {})
1202
- ] });
1203
- };
1204
-
1205
- // src/facebook-preview/post-preview.tsx
1206
-
1207
- var FacebookPostPreview = ({
1208
- url,
1209
- user,
1210
- customText,
1211
- media,
1212
- imageMode
1213
- }) => {
1214
- const [mode] = use_image_hook_default({ mode: imageMode });
1215
- const modeClass = `is-${mode === PORTRAIT_MODE ? "portrait" : "landscape"}`;
1216
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__post", children: [
1217
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default2, { user }),
1218
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "facebook-preview__content", children: [
1219
- customText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, custom_text_default, { text: customText, url, forceUrlDisplay: true }),
1220
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "facebook-preview__body", children: media ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `facebook-preview__media ${modeClass}`, children: media.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1221
- "div",
1222
- {
1223
- className: `facebook-preview__media-item ${modeClass}`,
1224
- children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url })
1225
- },
1226
- `facebook-preview__media-item-${index}`
1227
- )) }) : null })
1228
- ] }),
1229
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default2, {})
1230
- ] });
1231
- };
1232
-
1233
- // src/facebook-preview/previews.tsx
1234
-
1235
- var FacebookPreviews = ({
1236
- headingLevel,
1237
- hideLinkPreview,
1238
- hidePostPreview,
1239
- ...props
1240
- }) => {
1241
- const hasMedia = !!_optionalChain([props, 'access', _16 => _16.media, 'optionalAccess', _17 => _17.length]);
1242
- const hasCustomImage = !!props.customImage;
1243
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview facebook-preview", children: [
1244
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section facebook-preview__section", children: [
1245
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
1246
- level: headingLevel,
1247
- // translators: refers to a social post on Facebook
1248
- children: _i18n.__.call(void 0, "Your post", "social-previews")
1249
- }),
1250
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Facebook:", "social-previews") }),
1251
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FacebookPostPreview, { ...props }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FacebookLinkPreview, { ...props })
1252
- ] }),
1253
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section facebook-preview__section", children: [
1254
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
1255
- level: headingLevel,
1256
- // translators: refers to a link to a Facebook post
1257
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
1258
- }),
1259
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
1260
- "This is what it will look like when someone shares the link to your WordPress post on Facebook.",
1261
- "social-previews"
1262
- ) }),
1263
- hasCustomImage ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LinkPreviewDetails, { ...props }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FacebookLinkPreview, { ...props, compactDescription: true, customText: "", user: void 0 })
1264
- ] })
1265
- ] });
1266
- };
1267
-
1268
- // src/mastodon-preview/post/actions/index.tsx
1269
-
1270
- var MastodonPostActions = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post-actions", children: [
1271
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1272
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1273
- "svg",
1274
- {
1275
- xmlns: "http://www.w3.org/2000/svg",
1276
- height: "24",
1277
- viewBox: "0 -960 960 960",
1278
- width: "24",
1279
- "aria-hidden": "true",
1280
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z" })
1281
- }
1282
- ),
1283
- "\xA0",
1284
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: 0 })
1285
- ] }),
1286
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1287
- "svg",
1288
- {
1289
- xmlns: "http://www.w3.org/2000/svg",
1290
- height: "24",
1291
- viewBox: "0 -960 960 960",
1292
- width: "24",
1293
- "aria-hidden": "true",
1294
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M280-80 120-240l160-160 56 58-62 62h406v-160h80v240H274l62 62-56 58Zm-80-440v-240h486l-62-62 56-58 160 160-160 160-56-58 62-62H280v160h-80Z" })
1295
- }
1296
- ) }),
1297
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1298
- "svg",
1299
- {
1300
- xmlns: "http://www.w3.org/2000/svg",
1301
- height: "24",
1302
- viewBox: "0 -960 960 960",
1303
- width: "24",
1304
- "aria-hidden": "true",
1305
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z" })
1306
- }
1307
- ) }),
1308
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1309
- "svg",
1310
- {
1311
- xmlns: "http://www.w3.org/2000/svg",
1312
- height: "24",
1313
- viewBox: "0 -960 960 960",
1314
- width: "24",
1315
- "aria-hidden": "true",
1316
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z" })
1317
- }
1318
- ) }),
1319
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1320
- "svg",
1321
- {
1322
- xmlns: "http://www.w3.org/2000/svg",
1323
- height: "24",
1324
- viewBox: "0 -960 960 960",
1325
- width: "24",
1326
- "aria-hidden": "true",
1327
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M240-400q-33 0-56.5-23.5T160-480q0-33 23.5-56.5T240-560q33 0 56.5 23.5T320-480q0 33-23.5 56.5T240-400Zm240 0q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm240 0q-33 0-56.5-23.5T640-480q0-33 23.5-56.5T720-560q33 0 56.5 23.5T800-480q0 33-23.5 56.5T720-400Z" })
1328
- }
1329
- ) })
1330
- ] });
1331
- var actions_default3 = MastodonPostActions;
1332
-
1333
- // src/mastodon-preview/post/card/index.tsx
1334
-
1335
-
1336
-
1337
- // src/mastodon-preview/constants.ts
1338
- var DEFAULT_MASTODON_INSTANCE = "mastodon.social";
1339
-
1340
- // src/mastodon-preview/helpers.ts
1341
- var TITLE_LENGTH4 = 200;
1342
- var BODY_LENGTH = 500;
1343
- var ADDRESS_PATTERN = /^@([^@]*)@([^@]*)$/i;
1344
- var mastodonTitle = (text) => firstValid(
1345
- shortEnough(TITLE_LENGTH4),
1346
- hardTruncation(TITLE_LENGTH4)
1347
- )(stripHtmlTags(text)) || "";
1348
- var mastodonBody = (text, options) => {
1349
- const { instance, offset } = options;
1350
- return preparePreviewText(text, {
1351
- platform: "mastodon",
1352
- maxChars: BODY_LENGTH - offset,
1353
- hashtagDomain: instance
1354
- });
1355
- };
1356
- var getMastodonAddressDetails = (address) => {
1357
- const matches = address.match(ADDRESS_PATTERN);
1358
- return {
1359
- username: _optionalChain([matches, 'optionalAccess', _18 => _18[1]]) || "",
1360
- instance: _optionalChain([matches, 'optionalAccess', _19 => _19[2]]) || DEFAULT_MASTODON_INSTANCE
1361
- };
1362
- };
1363
-
1364
- // src/mastodon-preview/post/card/index.tsx
1365
-
1366
- var MastodonPostCard = ({
1367
- siteName,
1368
- title,
1369
- description,
1370
- url,
1371
- image,
1372
- customImage
1373
- }) => {
1374
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _clsx2.default.call(void 0, "mastodon-preview__card", { "has-image": image }), children: [
1375
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mastodon-preview__card-img", children: image || customImage ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1376
- "img",
1377
- {
1378
- src: image || customImage,
1379
- alt: _i18n.__.call(void 0, "Mastodon preview thumbnail", "social-previews")
1380
- }
1381
- ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mastodon-preview__card-img--fallback", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1382
- "svg",
1383
- {
1384
- xmlns: "http://www.w3.org/2000/svg",
1385
- height: "24",
1386
- viewBox: "0 -960 960 960",
1387
- width: "24",
1388
- "aria-hidden": "true",
1389
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M320-240h320v-80H320v80Zm0-160h320v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520h200L520-800v200Z" })
1390
- }
1391
- ) }) }),
1392
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__card-text", children: [
1393
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mastodon-preview__card-site", children: siteName || baseDomain(url) }),
1394
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mastodon-preview__card-title", children: mastodonTitle(title) || getTitleFromDescription(description) }),
1395
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "mastodon-preview__card-description", children: stripHtmlTags(description) })
1396
- ] })
1397
- ] });
1398
- };
1399
- var card_default = MastodonPostCard;
1400
-
1401
- // src/mastodon-preview/post/header/index.tsx
1402
-
1403
-
1404
- // src/mastodon-preview/post/icons/index.tsx
1405
-
1406
- function GlobeIcon2() {
1407
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1408
- "svg",
1409
- {
1410
- xmlns: "http://www.w3.org/2000/svg",
1411
- height: "15",
1412
- viewBox: "0 -960 960 960",
1413
- width: "15",
1414
- role: "img",
1415
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm-40-82v-78q-33 0-56.5-23.5T360-320v-40L168-552q-3 18-5.5 36t-2.5 36q0 121 79.5 212T440-162Zm276-102q20-22 36-47.5t26.5-53q10.5-27.5 16-56.5t5.5-59q0-98-54.5-179T600-776v16q0 33-23.5 56.5T520-680h-80v80q0 17-11.5 28.5T400-560h-80v80h240q17 0 28.5 11.5T600-440v120h40q26 0 47 15.5t29 40.5Z" })
1416
- }
1417
- );
1418
- }
1419
-
1420
- // src/mastodon-preview/post/header/index.tsx
1421
-
1422
- var MastodonPostHeader = ({ user }) => {
1423
- const { displayName, address, avatarUrl } = user || {};
1424
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post-header", children: [
1425
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post-header-user", children: [
1426
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { className: "mastodon-preview__post-avatar", src: avatarUrl }),
1427
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1428
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mastodon-preview__post-header-displayname", children: displayName || // translators: username of a fictional Mastodon User
1429
- _i18n.__.call(void 0, "anonymous-user", "social-previews") }),
1430
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mastodon-preview__post-header-username", children: _optionalChain([address, 'optionalAccess', _20 => _20.replace, 'call', _21 => _21(`@${DEFAULT_MASTODON_INSTANCE}`, "")]) || "@username" })
1431
- ] })
1432
- ] }),
1433
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post-header-audience", children: [
1434
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GlobeIcon2, {}),
1435
- formatMastodonDate(/* @__PURE__ */ new Date())
1436
- ] })
1437
- ] });
1438
- };
1439
- var header_default3 = MastodonPostHeader;
1440
-
1441
- // src/mastodon-preview/link-preview.tsx
1442
-
1443
- var MastodonLinkPreview = (props) => {
1444
- const { user } = props;
1445
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post", children: [
1446
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default3, { user }),
1447
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, card_default, { ...props, customImage: "" }),
1448
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default3, {})
1449
- ] });
1450
- };
1451
-
1452
- // src/mastodon-preview/post-preview.tsx
1453
-
1454
-
1455
- // src/mastodon-preview/post/body/index.tsx
1456
-
1457
- var MastonPostBody = (props) => {
1458
- const { title, description, customText, user, children } = props;
1459
- const instance = _optionalChain([user, 'optionalAccess', _22 => _22.address]) ? getMastodonAddressDetails(user.address).instance : "";
1460
- const options = {
1461
- instance,
1462
- offset: 0
1463
- };
1464
- let bodyTxt;
1465
- if (customText) {
1466
- bodyTxt = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: customText, children: (visibleText) => mastodonBody(visibleText, options) }) });
1467
- } else if (description) {
1468
- if (title) {
1469
- const renderedTitle = stripHtmlTags(title);
1470
- options.offset = renderedTitle.length;
1471
- bodyTxt = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1472
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: renderedTitle }),
1473
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: description, children: (visibleText) => mastodonBody(visibleText, options) }) })
1474
- ] });
1475
- } else {
1476
- bodyTxt = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: description, children: (visibleText) => mastodonBody(visibleText, options) }) });
1477
- }
1478
- } else {
1479
- bodyTxt = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: mastodonBody(title, options) });
1480
- }
1481
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__body", children: [
1482
- bodyTxt,
1483
- children
1484
- ] });
1485
- };
1486
- var body_default = MastonPostBody;
1487
-
1488
- // src/mastodon-preview/post-preview.tsx
1489
-
1490
- var MastodonPostPreview = (props) => {
1491
- const { user, media } = props;
1492
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mastodon-preview__post", children: [
1493
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default3, { user }),
1494
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, body_default, { ...props, children: _optionalChain([media, 'optionalAccess', _23 => _23.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _clsx2.default.call(void 0, "mastodon-preview__media", { "as-grid": media.length > 1 }), children: media.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1495
- "div",
1496
- {
1497
- className: "mastodon-preview__media-item",
1498
- children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url })
1499
- },
1500
- `mastodon-preview__media-item-${index}`
1501
- )) }) : null }),
1502
- !_optionalChain([media, 'optionalAccess', _24 => _24.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, card_default, { ...props }) : null,
1503
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default3, {})
1504
- ] });
1505
- };
1506
-
1507
- // src/mastodon-preview/previews.tsx
1508
-
1509
-
1510
- var MastodonPreviews = ({
1511
- headingLevel,
1512
- hidePostPreview,
1513
- hideLinkPreview,
1514
- ...props
1515
- }) => {
1516
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview mastodon-preview", children: [
1517
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section mastodon-preview__section", children: [
1518
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
1519
- level: headingLevel,
1520
- // translators: refers to a social post on Mastodon
1521
- children: _i18n.__.call(void 0, "Your post", "social-previews")
1522
- }),
1523
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Mastodon:", "social-previews") }),
1524
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MastodonPostPreview, { ...props })
1525
- ] }),
1526
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section mastodon-preview__section", children: [
1527
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
1528
- level: headingLevel,
1529
- // translators: refers to a link to a Mastodon post
1530
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
1531
- }),
1532
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
1533
- "This is what it will look like when someone shares the link to your WordPress post on Mastodon.",
1534
- "social-previews"
1535
- ) }),
1536
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MastodonLinkPreview, { ...props, user: void 0 })
1537
- ] })
1538
- ] });
1539
- };
1540
-
1541
- // src/nextdoor-preview/post-preview.tsx
1542
-
1543
-
1544
-
1545
- // src/nextdoor-preview/constants.ts
1546
- var FEED_TEXT_MAX_LENGTH2 = 65e3;
1547
-
1548
- // src/nextdoor-preview/footer-actions.tsx
1549
-
1550
-
1551
- // src/nextdoor-preview/icons/comment-icon.tsx
1552
-
1553
- function CommentIcon() {
1554
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1555
- "path",
1556
- {
1557
- fill: "currentColor",
1558
- fillRule: "evenodd",
1559
- d: "M2 10.031C2 5.596 5.574 2 10 2h4c4.427 0 8 3.596 8 8.031 0 4.435-3.573 8.031-8 8.031h-1.52a17.033 17.033 0 0 1-1.377 1.467c-.991.938-2.456 2.079-4.086 2.437a1.403 1.403 0 0 1-1.458-.565 1.55 1.55 0 0 1-.195-1.394c.28-.823.395-1.734.434-2.464.014-.257.018-.485.018-.672A8.017 8.017 0 0 1 2 10.031Zm5.798 6.178a7.02 7.02 0 0 1 .016.418c.005.252.004.606-.019 1.023-.03.573-.103 1.285-.266 2.024.775-.377 1.54-.974 2.202-1.598a15.066 15.066 0 0 0 1.448-1.586l.017-.022.003-.004a1 1 0 0 1 .801-.402h2c3.314 0 6-2.692 6-6.03C20 6.691 17.314 4 14 4h-4c-3.314 0-6 2.692-6 6.031 0 2.336 1.32 4.36 3.258 5.359.308.159.515.474.54.82Z",
1560
- clipRule: "evenodd"
1561
- }
1562
- ) });
1563
- }
1564
-
1565
- // src/nextdoor-preview/icons/like-icon.tsx
1566
-
1567
- function LikeIcon() {
1568
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1569
- "path",
1570
- {
1571
- fill: "currentColor",
1572
- fillRule: "evenodd",
1573
- d: "M13.275 8.752a1.5 1.5 0 0 1-2.55 0C9.75 7.18 8.719 5.617 6.565 6.074 5.248 6.352 4 7.433 4 9.644c0 2.153 1.348 4.592 4.259 7.236A28.475 28.475 0 0 0 12 19.74a28.475 28.475 0 0 0 3.741-2.86C18.651 14.236 20 11.797 20 9.643c0-2.21-1.25-3.29-2.564-3.57-2.155-.456-3.187 1.106-4.16 2.68Zm-2.581-3.48C7.634 2.58 2 4.217 2 9.643c0 2.996 1.85 5.934 4.914 8.717 1.478 1.343 3.1 2.585 4.839 3.575a.5.5 0 0 0 .494 0c1.739-.99 3.361-2.232 4.84-3.575C20.148 15.577 22 12.64 22 9.643c0-5.426-5.634-7.062-8.694-4.371A5.287 5.287 0 0 0 12 7.04a5.287 5.287 0 0 0-1.306-1.77Z",
1574
- clipRule: "evenodd"
1575
- }
1576
- ) });
1577
- }
1578
-
1579
- // src/nextdoor-preview/icons/share-icon.tsx
1580
-
1581
- function ShareIcon() {
1582
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1583
- "path",
1584
- {
1585
- fill: "currentColor",
1586
- fillRule: "evenodd",
1587
- d: "M11.617 2.076a1 1 0 0 1 1.09.217l9 9a1 1 0 0 1 0 1.414l-9 9A1 1 0 0 1 11 21v-4.436c-2.849.366-5.261 2.271-6.384 4.837a1 1 0 0 1-1.856-.06C2.338 20.182 2 18.86 2 17.5a9.959 9.959 0 0 1 9-9.951V3a1 1 0 0 1 .617-.924ZM13 5.414V8.5a1 1 0 0 1-1 1c-4.448 0-8 3.552-8 8 0 .31.023.625.066.94C5.905 16.067 8.776 14.5 12 14.5a1 1 0 0 1 1 1v3.086L19.586 12 13 5.414Z",
1588
- clipRule: "evenodd"
1589
- }
1590
- ) });
1591
- }
1592
-
1593
- // src/nextdoor-preview/footer-actions.tsx
1594
-
1595
- function FooterActions() {
1596
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__footer--actions", children: [
1597
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__footer--actions-item", children: [
1598
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LikeIcon, {}),
1599
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _i18n.__.call(void 0, "Like", "social-previews") })
1600
- ] }),
1601
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__footer--actions-item", children: [
1602
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CommentIcon, {}),
1603
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _i18n.__.call(void 0, "Comment", "social-previews") })
1604
- ] }),
1605
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__footer--actions-item", children: [
1606
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ShareIcon, {}),
1607
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _i18n.__.call(void 0, "Share", "social-previews") })
1608
- ] })
1609
- ] });
1610
- }
1611
-
1612
- // src/nextdoor-preview/icons/chevron-icon.tsx
1613
-
1614
- function ChevronIcon() {
1615
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1616
- "path",
1617
- {
1618
- fill: "#dfe1e4",
1619
- fillRule: "evenodd",
1620
- d: "M7.127 13.876a.732.732 0 1 0 1.035 1.035l4.75-4.749a.732.732 0 0 0 0-1.035L8.123 4.34A.732.732 0 0 0 7.09 5.375l4.27 4.27-4.232 4.23Z"
1621
- }
1622
- ) });
1623
- }
1624
-
1625
- // src/nextdoor-preview/icons/default-image.tsx
1626
-
1627
- function DefaultImage() {
1628
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__default-image", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1629
- "svg",
1630
- {
1631
- width: "24",
1632
- height: "24",
1633
- fill: "none",
1634
- viewBox: "0 0 24 24",
1635
- "aria-hidden": "true",
1636
- color: "#055c00",
1637
- children: [
1638
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1639
- "path",
1640
- {
1641
- fill: "currentColor",
1642
- d: "M13.207 5.207c1.51-1.51 4.076-1.51 5.586 0 1.51 1.51 1.51 4.076 0 5.586l-2.1 2.1c-1.51 1.51-4.077 1.51-5.586 0a1 1 0 1 0-1.414 1.414c2.29 2.29 6.123 2.29 8.414 0l2.1-2.1c2.29-2.29 2.29-6.124 0-8.414s-6.124-2.29-8.414 0l-.7.7a1 1 0 0 0 1.414 1.414l.7-.7Z"
1643
- }
1644
- ),
1645
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1646
- "path",
1647
- {
1648
- fill: "currentColor",
1649
- d: "M7.307 11.107c1.51-1.51 4.076-1.51 5.586 0a1 1 0 0 0 1.414-1.414c-2.29-2.29-6.124-2.29-8.414 0l-2.1 2.1c-2.29 2.29-2.29 6.123 0 8.414 2.29 2.29 6.124 2.29 8.414 0l.7-.7a1 1 0 0 0-1.414-1.414l-.7.7c-1.51 1.51-4.076 1.51-5.586 0-1.51-1.51-1.51-4.076 0-5.586l2.1-2.1Z"
1650
- }
1651
- )
1652
- ]
1653
- }
1654
- ) });
1655
- }
1656
-
1657
- // src/nextdoor-preview/icons/globe-icon.tsx
1658
-
1659
- function GlobeIcon3() {
1660
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "14", height: "14", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1661
- "path",
1662
- {
1663
- fill: "currentColor",
1664
- fillRule: "evenodd",
1665
- d: "M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Zm9.495-7.643c.286-.335.46-.357.505-.357.045 0 .219.022.505.357.282.33.581.868.852 1.619.464 1.283.79 3.034.872 5.024H9.771c.082-1.99.408-3.741.871-5.024.272-.751.571-1.289.854-1.62ZM7.77 11c.084-2.181.439-4.171.992-5.704.093-.255.192-.502.298-.738A8.009 8.009 0 0 0 4.062 11h3.707Zm-3.707 2h3.707c.084 2.181.439 4.171.992 5.704.093.255.192.502.298.738A8.009 8.009 0 0 1 4.062 13Zm15.876-2a8.009 8.009 0 0 0-4.997-6.442c.106.236.205.483.298.738.553 1.533.908 3.523.992 5.704h3.707Zm-3.707 2h3.707a8.009 8.009 0 0 1-4.997 6.442c.106-.236.205-.483.298-.738.553-1.533.908-3.523.992-5.704Zm-2.002 0c-.082 1.99-.408 3.741-.871 5.024-.272.751-.571 1.289-.854 1.62-.285.334-.46.356-.504.356-.045 0-.219-.022-.505-.357-.282-.33-.581-.868-.852-1.619-.464-1.283-.79-3.034-.872-5.024h4.458Z",
1666
- clipRule: "evenodd"
1667
- }
1668
- ) });
1669
- }
1670
-
1671
- // src/nextdoor-preview/post-preview.tsx
1672
-
1673
- function NextdoorPostPreview({
1674
- image,
1675
- name,
1676
- profileImage,
1677
- description,
1678
- neighborhood,
1679
- media,
1680
- title,
1681
- url
1682
- }) {
1683
- const hasMedia = !!_optionalChain([media, 'optionalAccess', _25 => _25.length]);
1684
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__wrapper", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "section", { className: `nextdoor-preview__container ${hasMedia ? "has-media" : ""}`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__content", children: [
1685
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__header", children: [
1686
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__header--avatar", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { src: profileImage }) }),
1687
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__header--details", children: [
1688
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__header--name", children: name || _i18n.__.call(void 0, "Account Name", "social-previews") }),
1689
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__header--meta", children: [
1690
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: neighborhood || _i18n.__.call(void 0, "Neighborhood", "social-previews") }),
1691
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2022" }),
1692
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: formatNextdoorDate(Date.now()) }),
1693
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "\u2022" }),
1694
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, GlobeIcon3, {})
1695
- ] })
1696
- ] })
1697
- ] }),
1698
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__body", children: [
1699
- description ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__caption", children: [
1700
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: description, children: (visibleText) => preparePreviewText(visibleText, {
1701
- platform: "nextdoor",
1702
- maxChars: FEED_TEXT_MAX_LENGTH2
1703
- }) }) }),
1704
- !hasMedia && url && !description.includes(url) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1705
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
1706
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
1707
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: url, rel: "nofollow noopener noreferrer", target: "_blank", children: url })
1708
- ] })
1709
- ] }) : null,
1710
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__media", children: media.map((mediaItem, index) => {
1711
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1712
- "div",
1713
- {
1714
- className: "nextdoor-preview__media-item",
1715
- children: _optionalChain([mediaItem, 'optionalAccess', _26 => _26.type, 'optionalAccess', _27 => _27.startsWith, 'call', _28 => _28("video/")]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url })
1716
- },
1717
- `nextdoor-preview__media-item-${index}`
1718
- );
1719
- }) }) : null,
1720
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1721
- "article",
1722
- {
1723
- className: _clsx2.default.call(void 0, "nextdoor-preview__card", {
1724
- "small-preview": !image || hasMedia
1725
- }),
1726
- children: [
1727
- image ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "nextdoor-preview__image", src: image, alt: "" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DefaultImage, {}),
1728
- url ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "nextdoor-preview__description", children: [
1729
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "nextdoor-preview__description--title", children: title || getTitleFromDescription(description) }),
1730
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "nextdoor-preview__description--url", children: baseDomain(url) })
1731
- ] }) : null,
1732
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__card--chevron-wrapper", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronIcon, {}) }) : null
1733
- ]
1734
- }
1735
- )
1736
- ] }),
1737
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "nextdoor-preview__footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FooterActions, {}) })
1738
- ] }) }) });
1739
- }
1740
-
1741
- // src/nextdoor-preview/link-preview.tsx
1742
-
1743
- function NextdoorLinkPreview(props) {
1744
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1745
- NextdoorPostPreview,
1746
- {
1747
- name: "",
1748
- profileImage: "",
1749
- ...props,
1750
- description: "",
1751
- media: void 0,
1752
- title: props.title || getTitleFromDescription(props.description)
1753
- }
1754
- );
1755
- }
1756
-
1757
- // src/nextdoor-preview/previews.tsx
1758
-
1759
-
1760
- var NextdoorPreviews = ({
1761
- headingLevel,
1762
- hideLinkPreview,
1763
- hidePostPreview,
1764
- ...props
1765
- }) => {
1766
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview nextdoor-preview", children: [
1767
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section nextdoor-preview__section", children: [
1768
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
1769
- level: headingLevel,
1770
- // translators: refers to a social post on Nextdoor
1771
- children: _i18n.__.call(void 0, "Your post", "social-previews")
1772
- }),
1773
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Nextdoor:", "social-previews") }),
1774
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NextdoorPostPreview, { ...props })
1775
- ] }),
1776
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section nextdoor-preview__section", children: [
1777
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
1778
- level: headingLevel,
1779
- // translators: refers to a link to a Nextdoor post
1780
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
1781
- }),
1782
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
1783
- "This is what it will look like when someone shares the link to your WordPress post on Nextdoor.",
1784
- "social-previews"
1785
- ) }),
1786
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, NextdoorLinkPreview, { ...props, name: "", profileImage: "" })
1787
- ] })
1788
- ] });
1789
- };
1790
-
1791
- // src/bluesky-preview/post-preview.tsx
1792
-
1793
-
1794
- // src/bluesky-preview/post/actions/index.tsx
1795
-
1796
- var BlueskyPostActions = () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__post-actions", children: [
1797
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1798
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1799
- "svg",
1800
- {
1801
- fill: "none",
1802
- width: "18",
1803
- viewBox: "0 0 24 24",
1804
- height: "18",
1805
- style: { color: "rgb(111, 134, 159)" },
1806
- "aria-hidden": "true",
1807
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1808
- "path",
1809
- {
1810
- fill: "hsl(211, 20%, 53%)",
1811
- fillRule: "evenodd",
1812
- clipRule: "evenodd",
1813
- d: "M2.002 6a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H12.28l-4.762 2.858A1 1 0 0 1 6.002 21v-2h-1a3 3 0 0 1-3-3V6Zm3-1a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2a1 1 0 0 1 1 1v1.234l3.486-2.092a1 1 0 0 1 .514-.142h7a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-14Z"
1814
- }
1815
- )
1816
- }
1817
- ),
1818
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: 0 })
1819
- ] }),
1820
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1821
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1822
- "svg",
1823
- {
1824
- fill: "none",
1825
- width: "18",
1826
- viewBox: "0 0 24 24",
1827
- height: "18",
1828
- style: { color: "rgb(111, 134, 159)" },
1829
- "aria-hidden": "true",
1830
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1831
- "path",
1832
- {
1833
- fill: "hsl(211, 20%, 53%)",
1834
- fillRule: "evenodd",
1835
- clipRule: "evenodd",
1836
- d: "M17.957 2.293a1 1 0 1 0-1.414 1.414L17.836 5H6a3 3 0 0 0-3 3v3a1 1 0 1 0 2 0V8a1 1 0 0 1 1-1h11.836l-1.293 1.293a1 1 0 0 0 1.414 1.414l2.47-2.47a1.75 1.75 0 0 0 0-2.474l-2.47-2.47ZM20 12a1 1 0 0 1 1 1v3a3 3 0 0 1-3 3H6.164l1.293 1.293a1 1 0 1 1-1.414 1.414l-2.47-2.47a1.75 1.75 0 0 1 0-2.474l2.47-2.47a1 1 0 0 1 1.414 1.414L6.164 17H18a1 1 0 0 0 1-1v-3a1 1 0 0 1 1-1Z"
1837
- }
1838
- )
1839
- }
1840
- ),
1841
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: 0 })
1842
- ] }),
1843
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1844
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1845
- "svg",
1846
- {
1847
- fill: "none",
1848
- width: "18",
1849
- viewBox: "0 0 24 24",
1850
- height: "18",
1851
- style: { color: "rgb(111, 134, 159)" },
1852
- "aria-hidden": "true",
1853
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1854
- "path",
1855
- {
1856
- fill: "hsl(211, 20%, 53%)",
1857
- fillRule: "evenodd",
1858
- clipRule: "evenodd",
1859
- d: "M16.734 5.091c-1.238-.276-2.708.047-4.022 1.38a1 1 0 0 1-1.424 0C9.974 5.137 8.504 4.814 7.266 5.09c-1.263.282-2.379 1.206-2.92 2.556C3.33 10.18 4.252 14.84 12 19.348c7.747-4.508 8.67-9.168 7.654-11.7-.541-1.351-1.657-2.275-2.92-2.557Zm4.777 1.812c1.604 4-.494 9.69-9.022 14.47a1 1 0 0 1-.978 0C2.983 16.592.885 10.902 2.49 6.902c.779-1.942 2.414-3.334 4.342-3.764 1.697-.378 3.552.003 5.169 1.286 1.617-1.283 3.472-1.664 5.17-1.286 1.927.43 3.562 1.822 4.34 3.764Z"
1860
- }
1861
- )
1862
- }
1863
- ),
1864
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: 0 })
1865
- ] }),
1866
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { fill: "none", viewBox: "0 0 24 24", width: "20", height: "20", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1867
- "path",
1868
- {
1869
- fill: "hsl(211, 20%, 53%)",
1870
- fillRule: "evenodd",
1871
- clipRule: "evenodd",
1872
- d: "M2 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm16 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0Zm-6-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4Z"
1873
- }
1874
- ) }) })
1875
- ] });
1876
- var actions_default4 = BlueskyPostActions;
1877
-
1878
- // src/bluesky-preview/helpers.ts
1879
- var TITLE_LENGTH5 = 200;
1880
- var BODY_LENGTH2 = 300;
1881
- var URL_LENGTH2 = 40;
1882
- var BODY_CHAR_LIMIT = BODY_LENGTH2 - URL_LENGTH2;
1883
- var blueskyTitle = (text) => firstValid(
1884
- shortEnough(TITLE_LENGTH5),
1885
- hardTruncation(TITLE_LENGTH5)
1886
- )(stripHtmlTags(text)) || "";
1887
- var blueskyBody = (text, options = {}) => {
1888
- const { offset = 0, reserveUrlSpace = true, hyperlinks } = options;
1889
- return preparePreviewText(text, {
1890
- platform: "bluesky",
1891
- maxChars: BODY_LENGTH2 - (reserveUrlSpace ? URL_LENGTH2 : 0) - offset,
1892
- hyperlinks
1893
- });
1894
- };
1895
- var blueskyUrl = (text) => firstValid(shortEnough(URL_LENGTH2), hardTruncation(URL_LENGTH2))(stripHtmlTags(text)) || "";
1896
-
1897
- // src/bluesky-preview/post/body/index.tsx
1898
-
1899
- var BlueskyPostBody = ({
1900
- customText,
1901
- url,
1902
- children,
1903
- appendUrl,
1904
- hyperlinks
1905
- }) => {
1906
- const showUrl = appendUrl && !!url && !_optionalChain([customText, 'optionalAccess', _29 => _29.includes, 'call', _30 => _30(url)]);
1907
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__body", children: [
1908
- customText ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1909
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: blueskyBody(customText, { reserveUrlSpace: showUrl, hyperlinks }) }),
1910
- showUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1911
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
1912
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: url, target: "_blank", rel: "noreferrer noopener", children: blueskyUrl(url.replace(/^https?:\/\//, "")) })
1913
- ] }) : null
1914
- ] }) : null,
1915
- children
1916
- ] });
1917
- };
1918
- var body_default2 = BlueskyPostBody;
1919
-
1920
- // src/bluesky-preview/post/card/index.tsx
1921
-
1922
- var BlueskyPostCard = ({ title, description, url, image }) => {
1923
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__card", children: [
1924
- image ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__card-image", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: image, alt: "" }) }) : null,
1925
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__card-text", children: [
1926
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__card-site", children: baseDomain(url) }),
1927
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__card-title", children: blueskyTitle(title) || getTitleFromDescription(description) }),
1928
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__card-description", children: stripHtmlTags(description) })
1929
- ] })
1930
- ] });
1931
- };
1932
- var card_default2 = BlueskyPostCard;
1933
-
1934
- // src/bluesky-preview/post/header/index.tsx
1935
-
1936
-
1937
- var BlueskyPostHeader = ({ user }) => {
1938
- const { displayName, address } = user || {};
1939
- let handle = address || "username.bsky.social";
1940
- if (!handle.startsWith("@")) {
1941
- handle = "@" + handle;
1942
- }
1943
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__post-header", children: [
1944
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__post-header-user", children: [
1945
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "bluesky-preview__post-header--displayname", children: displayName || _i18n.__.call(void 0, "Account name", "social-previews") }),
1946
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "bluesky-preview__post-header--username", children: handle })
1947
- ] }),
1948
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__post-header--separator", children: "\xB7" }),
1949
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__post-header--date", children: _i18n._x.call(void 0,
1950
- "1h",
1951
- 'refers to the time since the post was published, e.g. "1h"',
1952
- "social-previews"
1953
- ) })
1954
- ] });
1955
- };
1956
- var header_default4 = BlueskyPostHeader;
1957
-
1958
- // src/bluesky-preview/post/sidebar/index.tsx
1959
-
1960
- var BlueskyPostSidebar = ({ user }) => {
1961
- const { avatarUrl } = user || {};
1962
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__post-sidebar", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bluesky-preview__post-sidebar-user", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { className: "bluesky-preview__post-avatar", src: avatarUrl }) }) });
1963
- };
1964
-
1965
- // src/bluesky-preview/post-preview.tsx
1966
-
1967
- var BlueskyPostPreview = (props) => {
1968
- const { user, media, appendUrl } = props;
1969
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "bluesky-preview__post", children: [
1970
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlueskyPostSidebar, { user }),
1971
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
1972
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, header_default4, { user }),
1973
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, body_default2, { ...props, appendUrl: _nullishCoalesce(appendUrl, () => ( Boolean(_optionalChain([media, 'optionalAccess', _31 => _31.length])))), children: _optionalChain([media, 'optionalAccess', _32 => _32.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _clsx2.default.call(void 0, "bluesky-preview__media", { "as-grid": media.length > 1 }), children: media.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1974
- "div",
1975
- {
1976
- className: "bluesky-preview__media-item",
1977
- children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url })
1978
- },
1979
- `bluesky-preview__media-item-${index}`
1980
- )) }) : null }),
1981
- !_optionalChain([media, 'optionalAccess', _33 => _33.length]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, card_default2, { ...props }) : null,
1982
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, actions_default4, {})
1983
- ] })
1984
- ] });
1985
- };
1986
-
1987
- // src/bluesky-preview/link-preview.tsx
1988
-
1989
- var BlueskyLinkPreview = (props) => {
1990
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlueskyPostPreview, { ...props, user: void 0, media: void 0, customText: "" });
1991
- };
1992
-
1993
- // src/bluesky-preview/previews.tsx
1994
-
1995
-
1996
- var BlueskyPreviews = ({
1997
- headingLevel,
1998
- hidePostPreview,
1999
- hideLinkPreview,
2000
- ...props
2001
- }) => {
2002
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview bluesky-preview", children: [
2003
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section bluesky-preview__section", children: [
2004
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
2005
- level: headingLevel,
2006
- // translators: refers to a social post on Bluesky
2007
- children: _i18n.__.call(void 0, "Your post", "social-previews")
2008
- }),
2009
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Bluesky:", "social-previews") }),
2010
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlueskyPostPreview, { ...props })
2011
- ] }),
2012
- !hideLinkPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section bluesky-preview__section", children: [
2013
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SectionHeading, {
2014
- level: headingLevel,
2015
- // translators: refers to a link to a Bluesky post
2016
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
2017
- }),
2018
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
2019
- "This is what it will look like when someone shares the link to your WordPress post on Bluesky.",
2020
- "social-previews"
2021
- ) }),
2022
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BlueskyLinkPreview, { ...props })
2023
- ] })
2024
- ] });
2025
- };
2026
-
2027
- // src/threads-preview/link-preview.tsx
2028
-
2029
-
2030
- // src/threads-preview/card.tsx
2031
-
2032
-
2033
- // src/threads-preview/helpers.ts
2034
- var TITLE_LENGTH6 = 120;
2035
- var CAPTION_MAX_CHARS = 500;
2036
- var threadsTitle = (text) => firstValid(
2037
- shortEnough(TITLE_LENGTH6),
2038
- hardTruncation(TITLE_LENGTH6)
2039
- )(stripHtmlTags(text)) || "";
2040
-
2041
- // src/threads-preview/card.tsx
2042
-
2043
- var Card2 = ({ image, title, url }) => {
2044
- const cardClassNames = _clsx2.default.call(void 0, {
2045
- "threads-preview__card-has-image": !!image
2046
- });
2047
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__card", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: cardClassNames, children: [
2048
- image && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "threads-preview__card-image", src: image, alt: "" }),
2049
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__card-body", children: [
2050
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__card-url", children: baseDomain(url || "") }),
2051
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__card-title", children: threadsTitle(title) })
2052
- ] })
2053
- ] }) });
2054
- };
2055
-
2056
- // src/threads-preview/footer.tsx
2057
-
2058
- var Footer2 = () => {
2059
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__footer", children: [
2060
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "threads-preview__icon--like", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { role: "img", viewBox: "0 0 18 18", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2061
- "path",
2062
- {
2063
- d: "M1.34375 7.53125L1.34375 7.54043C1.34374 8.04211 1.34372 8.76295 1.6611 9.65585C1.9795 10.5516 2.60026 11.5779 3.77681 12.7544C5.59273 14.5704 7.58105 16.0215 8.33387 16.5497C8.73525 16.8313 9.26573 16.8313 9.66705 16.5496C10.4197 16.0213 12.4074 14.5703 14.2232 12.7544C15.3997 11.5779 16.0205 10.5516 16.3389 9.65585C16.6563 8.76296 16.6563 8.04211 16.6562 7.54043V7.53125C16.6562 5.23466 15.0849 3.25 12.6562 3.25C11.5214 3.25 10.6433 3.78244 9.99228 4.45476C9.59009 4.87012 9.26356 5.3491 9 5.81533C8.73645 5.3491 8.40991 4.87012 8.00772 4.45476C7.35672 3.78244 6.47861 3.25 5.34375 3.25C2.9151 3.25 1.34375 5.23466 1.34375 7.53125Z",
2064
- strokeWidth: "1.25"
2065
- }
2066
- ) }) }),
2067
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "threads-preview__icon--reply", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { role: "img", viewBox: "0 0 18 18", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2068
- "path",
2069
- {
2070
- d: "M15.376 13.2177L16.2861 16.7955L12.7106 15.8848C12.6781 15.8848 12.6131 15.8848 12.5806 15.8848C11.3779 16.5678 9.94767 16.8931 8.41995 16.7955C4.94194 16.5353 2.08152 13.7381 1.72397 10.2578C1.2689 5.63919 5.13697 1.76863 9.75264 2.22399C13.2307 2.58177 16.0261 5.41151 16.2861 8.92429C16.4161 10.453 16.0586 11.8841 15.376 13.0876C15.376 13.1526 15.376 13.1852 15.376 13.2177Z",
2071
- strokeLinejoin: "round",
2072
- strokeWidth: "1.25"
2073
- }
2074
- ) }) }),
2075
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "threads-preview__icon--repost", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { role: "img", viewBox: "0 0 18 18", children: [
2076
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M6.41256 1.23531C6.6349 0.971277 7.02918 0.937481 7.29321 1.15982L9.96509 3.40982C10.1022 3.52528 10.1831 3.69404 10.1873 3.87324C10.1915 4.05243 10.1186 4.2248 9.98706 4.34656L7.31518 6.81971C7.06186 7.05419 6.66643 7.03892 6.43196 6.7856C6.19748 6.53228 6.21275 6.13685 6.46607 5.90237L7.9672 4.51289H5.20312C3.68434 4.51289 2.45312 5.74411 2.45312 7.26289V9.51289V11.7629C2.45312 13.2817 3.68434 14.5129 5.20312 14.5129C5.5483 14.5129 5.82812 14.7927 5.82812 15.1379C5.82812 15.4831 5.5483 15.7629 5.20312 15.7629C2.99399 15.7629 1.20312 13.972 1.20312 11.7629V9.51289V7.26289C1.20312 5.05375 2.99399 3.26289 5.20312 3.26289H7.85002L6.48804 2.11596C6.22401 1.89362 6.19021 1.49934 6.41256 1.23531Z" }),
2077
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M11.5874 17.7904C11.3651 18.0545 10.9708 18.0883 10.7068 17.8659L8.03491 15.6159C7.89781 15.5005 7.81687 15.3317 7.81267 15.1525C7.80847 14.9733 7.8814 14.801 8.01294 14.6792L10.6848 12.206C10.9381 11.9716 11.3336 11.9868 11.568 12.2402C11.8025 12.4935 11.7872 12.8889 11.5339 13.1234L10.0328 14.5129H12.7969C14.3157 14.5129 15.5469 13.2816 15.5469 11.7629V9.51286V7.26286C15.5469 5.74408 14.3157 4.51286 12.7969 4.51286C12.4517 4.51286 12.1719 4.23304 12.1719 3.88786C12.1719 3.54269 12.4517 3.26286 12.7969 3.26286C15.006 3.26286 16.7969 5.05373 16.7969 7.26286V9.51286V11.7629C16.7969 13.972 15.006 15.7629 12.7969 15.7629H10.15L11.512 16.9098C11.776 17.1321 11.8098 17.5264 11.5874 17.7904Z" })
2078
- ] }) }),
2079
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "threads-preview__icon--share", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { role: "img", viewBox: "0 0 18 18", children: [
2080
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2081
- "path",
2082
- {
2083
- d: "M15.6097 4.09082L6.65039 9.11104",
2084
- strokeLinejoin: "round",
2085
- strokeWidth: "1.25"
2086
- }
2087
- ),
2088
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2089
- "path",
2090
- {
2091
- d: "M7.79128 14.439C8.00463 15.3275 8.11131 15.7718 8.33426 15.932C8.52764 16.071 8.77617 16.1081 9.00173 16.0318C9.26179 15.9438 9.49373 15.5501 9.95761 14.7628L15.5444 5.2809C15.8883 4.69727 16.0603 4.40546 16.0365 4.16566C16.0159 3.95653 15.9071 3.76612 15.7374 3.64215C15.5428 3.5 15.2041 3.5 14.5267 3.5H3.71404C2.81451 3.5 2.36474 3.5 2.15744 3.67754C1.97758 3.83158 1.88253 4.06254 1.90186 4.29856C1.92415 4.57059 2.24363 4.88716 2.88259 5.52032L6.11593 8.7243C6.26394 8.87097 6.33795 8.94431 6.39784 9.02755C6.451 9.10144 6.4958 9.18101 6.53142 9.26479C6.57153 9.35916 6.59586 9.46047 6.64451 9.66309L7.79128 14.439Z",
2092
- strokeLinejoin: "round",
2093
- strokeWidth: "1.25"
2094
- }
2095
- )
2096
- ] }) })
2097
- ] });
2098
- };
2099
-
2100
- // src/threads-preview/header.tsx
2101
-
2102
-
2103
- var Header2 = ({ name, date }) => {
2104
- const postDate = date || /* @__PURE__ */ new Date();
2105
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__header", children: [
2106
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "threads-preview__name", children: name || _i18n.__.call(void 0, "Account Name", "social-previews") }),
2107
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "time", { className: "threads-preview__date", dateTime: postDate.toISOString(), children: formatThreadsDate(postDate) })
2108
- ] });
2109
- };
2110
-
2111
- // src/threads-preview/media.tsx
2112
-
2113
-
2114
-
2115
- var Media2 = ({ media }) => {
2116
- const filteredMedia = media.filter(
2117
- (mediaItem) => mediaItem.type.startsWith("image/") || mediaItem.type.startsWith("video/")
2118
- ).filter((mediaItem, idx, array) => {
2119
- if (0 === idx) {
2120
- return true;
2121
- }
2122
- if (array[0].type.startsWith("video/") || "image/gif" === array[0].type) {
2123
- return false;
2124
- }
2125
- if (mediaItem.type.startsWith("video/") || "image/gif" === mediaItem.type) {
2126
- return false;
2127
- }
2128
- return true;
2129
- }).slice(0, 4);
2130
- if (0 === filteredMedia.length) {
2131
- return null;
2132
- }
2133
- const isVideo = filteredMedia[0].type.startsWith("video/");
2134
- const mediaClasses = _clsx2.default.call(void 0, [
2135
- "threads-preview__media",
2136
- "threads-preview__media-children-" + filteredMedia.length
2137
- ]);
2138
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: mediaClasses, children: filteredMedia.map((mediaItem, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: isVideo ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { alt: mediaItem.alt || "", src: mediaItem.url }) }, `threads-preview__media-item-${index}`)) });
2139
- };
2140
-
2141
- // src/threads-preview/sidebar.tsx
2142
-
2143
-
2144
- var Sidebar2 = ({ profileImage, showThreadConnector }) => {
2145
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__sidebar", children: [
2146
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__profile-image", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2147
- AvatarWithFallback,
2148
- {
2149
- alt: _i18n.__.call(void 0, "Threads profile image", "social-previews"),
2150
- src: profileImage
2151
- }
2152
- ) }),
2153
- showThreadConnector && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__connector" })
2154
- ] });
2155
- };
2156
-
2157
- // src/threads-preview/post-preview.tsx
2158
-
2159
- var ThreadsPostPreview = ({
2160
- caption,
2161
- date,
2162
- image,
2163
- media,
2164
- name,
2165
- profileImage,
2166
- showThreadConnector,
2167
- title,
2168
- url
2169
- }) => {
2170
- const hasMedia = !!_optionalChain([media, 'optionalAccess', _34 => _34.length]);
2171
- const displayAsCard = url && image && !hasMedia;
2172
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__wrapper", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__container", children: [
2173
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Sidebar2, { profileImage, showThreadConnector }),
2174
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__main", children: [
2175
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Header2, { name, date }),
2176
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "threads-preview__content", children: [
2177
- caption ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "threads-preview__text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: caption, children: (visibleText) => preparePreviewText(visibleText, {
2178
- platform: "threads",
2179
- maxChars: CAPTION_MAX_CHARS
2180
- }) }) }) : null,
2181
- hasMedia ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Media2, { media }) : null,
2182
- displayAsCard ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card2, { image, title: title || "", url }) : null
2183
- ] }),
2184
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Footer2, {})
2185
- ] })
2186
- ] }) });
2187
- };
2188
-
2189
- // src/threads-preview/link-preview.tsx
2190
-
2191
- var ThreadsLinkPreview = (props) => {
2192
- if (!props.image) {
2193
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
2194
- "Threads link preview requires an image to be set for the post. Please add an image to see the preview.",
2195
- "social-previews"
2196
- ) });
2197
- }
2198
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2199
- ThreadsPostPreview,
2200
- {
2201
- ...props,
2202
- caption: "",
2203
- media: void 0
2204
- }
2205
- );
2206
- };
2207
-
2208
- // src/threads-preview/previews.tsx
2209
-
2210
-
2211
- var ThreadsPreviews = ({
2212
- headingLevel,
2213
- hideLinkPreview,
2214
- hidePostPreview,
2215
- posts
2216
- }) => {
2217
- if (!_optionalChain([posts, 'optionalAccess', _35 => _35.length])) {
2218
- return null;
2219
- }
2220
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "social-preview threads-preview", children: [
2221
- !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section threads-preview__section", children: [
2222
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
2223
- level: headingLevel,
2224
- // translators: refers to a social post on Threads
2225
- children: _i18n.__.call(void 0, "Your post", "social-previews")
2226
- }),
2227
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0, "This is what your social post will look like on Threads:", "social-previews") }),
2228
- posts.map((post, index) => {
2229
- const isLast = index + 1 === posts.length;
2230
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2231
- ThreadsPostPreview,
2232
- {
2233
- ...post,
2234
- showThreadConnector: !isLast
2235
- },
2236
- `threads-preview__post-${index}`
2237
- );
2238
- })
2239
- ] }),
2240
- !hideLinkPreview ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section threads-preview__section", children: [
2241
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
2242
- level: headingLevel,
2243
- // translators: refers to a link to a Threads post
2244
- children: _i18n.__.call(void 0, "Link preview", "social-previews")
2245
- }),
2246
- posts[0].image ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2247
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
2248
- "This is what it will look like when someone shares the link to your WordPress post on Threads.",
2249
- "social-previews"
2250
- ) }),
2251
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ThreadsLinkPreview, { ...posts[0], name: "", profileImage: "" })
2252
- ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
2253
- "Threads link preview requires an image to be set for the post. Please add an image to see the preview.",
2254
- "social-previews"
2255
- ) })
2256
- ] }) : null
2257
- ] });
2258
- };
2259
-
2260
- // src/instagram-preview/post-preview.tsx
2261
-
2262
-
2263
- // src/instagram-preview/constants.tsx
2264
- var FEED_TEXT_MAX_LENGTH3 = 2200;
2265
-
2266
- // src/instagram-preview/icons/bookmark.tsx
2267
-
2268
- var Bookmark = () => {
2269
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2270
- "svg",
2271
- {
2272
- color: "rgb(38, 38, 38)",
2273
- fill: "rgb(38, 38, 38)",
2274
- height: "24",
2275
- role: "img",
2276
- viewBox: "0 0 24 24",
2277
- width: "24",
2278
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2279
- "polygon",
2280
- {
2281
- fill: "none",
2282
- points: "20 21 12 13.44 4 21 4 3 20 3 20 21",
2283
- stroke: "currentColor",
2284
- strokeLinecap: "round",
2285
- strokeLinejoin: "round",
2286
- strokeWidth: "2"
2287
- }
2288
- )
2289
- }
2290
- );
2291
- };
2292
-
2293
- // src/instagram-preview/icons/comment.tsx
2294
-
2295
- var Comment = () => {
2296
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2297
- "svg",
2298
- {
2299
- color: "rgb(38, 38, 38)",
2300
- fill: "rgb(38, 38, 38)",
2301
- height: "24",
2302
- role: "img",
2303
- viewBox: "0 0 24 24",
2304
- width: "24",
2305
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2306
- "path",
2307
- {
2308
- d: "M20.656 17.008a9.993 9.993 0 1 0-3.59 3.615L22 22Z",
2309
- fill: "none",
2310
- stroke: "currentColor",
2311
- strokeLinejoin: "round",
2312
- strokeWidth: "2"
2313
- }
2314
- )
2315
- }
2316
- );
2317
- };
2318
-
2319
- // src/instagram-preview/icons/heart.tsx
2320
-
2321
- var Heart = () => {
2322
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2323
- "svg",
2324
- {
2325
- color: "rgb(38, 38, 38)",
2326
- fill: "rgb(38, 38, 38)",
2327
- height: "24",
2328
- role: "img",
2329
- viewBox: "0 0 24 24",
2330
- width: "24",
2331
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M16.792 3.904A4.989 4.989 0 0 1 21.5 9.122c0 3.072-2.652 4.959-5.197 7.222-2.512 2.243-3.865 3.469-4.303 3.752-.477-.309-2.143-1.823-4.303-3.752C5.141 14.072 2.5 12.167 2.5 9.122a4.989 4.989 0 0 1 4.708-5.218 4.21 4.21 0 0 1 3.675 1.941c.84 1.175.98 1.763 1.12 1.763s.278-.588 1.11-1.766a4.17 4.17 0 0 1 3.679-1.938m0-2a6.04 6.04 0 0 0-4.797 2.127 6.052 6.052 0 0 0-4.787-2.127A6.985 6.985 0 0 0 .5 9.122c0 3.61 2.55 5.827 5.015 7.97.283.246.569.494.853.747l1.027.918a44.998 44.998 0 0 0 3.518 3.018 2 2 0 0 0 2.174 0 45.263 45.263 0 0 0 3.626-3.115l.922-.824c.293-.26.59-.519.885-.774 2.334-2.025 4.98-4.32 4.98-7.94a6.985 6.985 0 0 0-6.708-7.218Z" })
2332
- }
2333
- );
2334
- };
2335
-
2336
- // src/instagram-preview/icons/menu.tsx
2337
-
2338
- var Menu = () => {
2339
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { width: "17", height: "5", viewBox: "0 0 17 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
2340
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2341
- "path",
2342
- {
2343
- d: "M2.11865 3.5C2.67094 3.5 3.11865 3.05228 3.11865 2.5C3.11865 1.94772 2.67094 1.5 2.11865 1.5C1.56637 1.5 1.11865 1.94772 1.11865 2.5C1.11865 3.05228 1.56637 3.5 2.11865 3.5Z",
2344
- fill: "black",
2345
- stroke: "black",
2346
- strokeWidth: "2"
2347
- }
2348
- ),
2349
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2350
- "path",
2351
- {
2352
- d: "M8.55933 3.5C9.11161 3.5 9.55933 3.05228 9.55933 2.5C9.55933 1.94772 9.11161 1.5 8.55933 1.5C8.00704 1.5 7.55933 1.94772 7.55933 2.5C7.55933 3.05228 8.00704 3.5 8.55933 3.5Z",
2353
- fill: "black",
2354
- stroke: "black",
2355
- strokeWidth: "2"
2356
- }
2357
- ),
2358
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2359
- "path",
2360
- {
2361
- d: "M15 3.5C15.5523 3.5 16 3.05228 16 2.5C16 1.94772 15.5523 1.5 15 1.5C14.4477 1.5 14 1.94772 14 2.5C14 3.05228 14.4477 3.5 15 3.5Z",
2362
- fill: "black",
2363
- stroke: "black",
2364
- strokeWidth: "2"
2365
- }
2366
- )
2367
- ] });
2368
- };
2369
-
2370
- // src/instagram-preview/icons/share.tsx
2371
-
2372
- var Share = () => {
2373
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2374
- "svg",
2375
- {
2376
- color: "rgb(38, 38, 38)",
2377
- fill: "rgb(38, 38, 38)",
2378
- height: "24",
2379
- role: "img",
2380
- viewBox: "0 0 24 24",
2381
- width: "24",
2382
- children: [
2383
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2384
- "line",
2385
- {
2386
- fill: "none",
2387
- stroke: "currentColor",
2388
- strokeLinejoin: "round",
2389
- strokeWidth: "2",
2390
- x1: "22",
2391
- x2: "9.218",
2392
- y1: "3",
2393
- y2: "10.083"
2394
- }
2395
- ),
2396
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2397
- "polygon",
2398
- {
2399
- fill: "none",
2400
- points: "11.698 20.334 22 3.001 2 3.001 9.218 10.084 11.698 20.334",
2401
- stroke: "currentColor",
2402
- strokeLinejoin: "round",
2403
- strokeWidth: "2"
2404
- }
2405
- )
2406
- ]
2407
- }
2408
- );
2409
- };
2410
-
2411
- // src/instagram-preview/post-preview.tsx
2412
-
2413
- function InstagramPostPreview({
2414
- image,
2415
- media,
2416
- name,
2417
- profileImage,
2418
- caption,
2419
- url
2420
- }) {
2421
- const username = name || "username";
2422
- const mediaItem = _optionalChain([media, 'optionalAccess', _36 => _36[0]]);
2423
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__wrapper", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "instagram-preview__container", children: [
2424
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__header", children: [
2425
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__header--avatar", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AvatarWithFallback, { src: profileImage }) }),
2426
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__header--profile", children: [
2427
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__header--profile-name", children: username }),
2428
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__header--profile-menu", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Menu, {}) })
2429
- ] })
2430
- ] }),
2431
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__media", children: mediaItem ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__media-item", children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { controls: false, className: "instagram-preview__media--video", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "instagram-preview__media--image", src: mediaItem.url, alt: "" }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { className: "instagram-preview__media--image", src: image, alt: "" }) }),
2432
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__content", children: [
2433
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "instagram-preview__content--actions", children: [
2434
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__content--actions-primary", children: [
2435
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Heart, {}),
2436
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Comment, {}),
2437
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Share, {})
2438
- ] }),
2439
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__content--actions-secondary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Bookmark, {}) })
2440
- ] }),
2441
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__content--body", children: [
2442
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__content--name", children: username }),
2443
- "\xA0",
2444
- caption ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "instagram-preview__content--text", children: [
2445
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExpandableText, { text: caption, children: (visibleText) => preparePreviewText(visibleText, {
2446
- platform: "instagram",
2447
- maxChars: FEED_TEXT_MAX_LENGTH3
2448
- }) }),
2449
- media && url && !caption.includes(url) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2450
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
2451
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
2452
- url
2453
- ] })
2454
- ] }) : null
2455
- ] }),
2456
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "instagram-preview__content--footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _i18n.__.call(void 0, "View one comment", "social-previews") }) })
2457
- ] })
2458
- ] }) });
2459
- }
2460
-
2461
- // src/instagram-preview/previews.tsx
2462
-
2463
-
2464
- var InstagramPreviews = ({
2465
- headingLevel,
2466
- hidePostPreview,
2467
- ...props
2468
- }) => {
2469
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "social-preview instagram-preview", children: !hidePostPreview && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "social-preview__section instagram-preview__section", children: [
2470
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, section_heading_default, {
2471
- level: headingLevel,
2472
- // translators: refers to a social post on Instagram
2473
- children: _i18n.__.call(void 0, "Your post", "social-previews")
2474
- }),
2475
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "social-preview__section-desc", children: _i18n.__.call(void 0,
2476
- "This is what your social post will look like on Instagram:",
2477
- "social-previews"
2478
- ) }),
2479
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InstagramPostPreview, { ...props })
2480
- ] }) });
2481
- };
2482
-
2483
-
2484
-
2485
-
2486
-
2487
-
2488
-
2489
-
2490
-
2491
-
2492
-
2493
-
2494
-
2495
-
2496
-
2497
-
2498
-
2499
-
2500
-
2501
-
2502
-
2503
-
2504
-
2505
-
2506
-
2507
-
2508
-
2509
-
2510
-
2511
-
2512
-
2513
-
2514
-
2515
-
2516
-
2517
-
2518
- exports.AUTO_SHARED_LINK_PREVIEW = AUTO_SHARED_LINK_PREVIEW; exports.AUTO_SHARED_SOCIAL_POST_PREVIEW = AUTO_SHARED_SOCIAL_POST_PREVIEW; exports.BlueskyLinkPreview = BlueskyLinkPreview; exports.BlueskyPostPreview = BlueskyPostPreview; exports.BlueskyPreviews = BlueskyPreviews; exports.DEFAULT_LINK_PREVIEW = DEFAULT_LINK_PREVIEW; exports.FacebookLinkPreview = FacebookLinkPreview; exports.FacebookPostPreview = FacebookPostPreview; exports.FacebookPreviews = FacebookPreviews; exports.GoogleSearchPreview = GoogleSearchPreview; exports.InstagramPostPreview = InstagramPostPreview; exports.InstagramPreviews = InstagramPreviews; exports.LANDSCAPE_MODE = LANDSCAPE_MODE; exports.LinkedInLinkPreview = LinkedInLinkPreview; exports.LinkedInPostPreview = LinkedInPostPreview; exports.LinkedInPreviews = LinkedInPreviews; exports.MastodonLinkPreview = MastodonLinkPreview; exports.MastodonPostPreview = MastodonPostPreview; exports.MastodonPreviews = MastodonPreviews; exports.NextdoorLinkPreview = NextdoorLinkPreview; exports.NextdoorPostPreview = NextdoorPostPreview; exports.NextdoorPreviews = NextdoorPreviews; exports.PORTRAIT_MODE = PORTRAIT_MODE; exports.TYPE_ARTICLE = TYPE_ARTICLE; exports.TYPE_WEBSITE = TYPE_WEBSITE; exports.ThreadsLinkPreview = ThreadsLinkPreview; exports.ThreadsPostPreview = ThreadsPostPreview; exports.ThreadsPreviews = ThreadsPreviews; exports.TumblrLinkPreview = TumblrLinkPreview; exports.TumblrPostPreview = TumblrPostPreview; exports.TumblrPreviews = TumblrPreviews; exports.TwitterLinkPreview = TwitterLinkPreview; exports.TwitterPostPreview = TwitterPostPreview; exports.TwitterPreviews = TwitterPreviews; exports.parseHyperlinks = parseHyperlinks;
2519
- //# sourceMappingURL=index.js.map