@automattic/social-previews 3.1.2 → 3.1.4
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/CHANGELOG.md +13 -0
- package/dist/index.js +69 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +473 -417
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -101,8 +101,71 @@ function preparePreviewText(text, options) {
|
|
|
101
101
|
return createInterpolateElement(result, componentMap);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// src/site-icon-with-fallback.tsx
|
|
105
|
+
import { useCallback, useState } from "react";
|
|
106
|
+
|
|
107
|
+
// src/icons/globe-icon.tsx
|
|
108
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
109
|
+
function GlobeIcon(props) {
|
|
110
|
+
return /* @__PURE__ */ jsx2(
|
|
111
|
+
"svg",
|
|
112
|
+
{
|
|
113
|
+
focusable: "false",
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
width: "14",
|
|
118
|
+
height: "14",
|
|
119
|
+
...props,
|
|
120
|
+
children: /* @__PURE__ */ jsx2(
|
|
121
|
+
"path",
|
|
122
|
+
{
|
|
123
|
+
fill: "currentColor",
|
|
124
|
+
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"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// src/site-icon-with-fallback.tsx
|
|
132
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
133
|
+
function DefaultSiteIcon({ className }) {
|
|
134
|
+
return /* @__PURE__ */ jsx3(
|
|
135
|
+
"span",
|
|
136
|
+
{
|
|
137
|
+
className,
|
|
138
|
+
"aria-hidden": "true",
|
|
139
|
+
style: {
|
|
140
|
+
display: "inline-flex",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
justifyContent: "center",
|
|
143
|
+
backgroundColor: "#e8eaed",
|
|
144
|
+
color: "#5f6368",
|
|
145
|
+
borderRadius: "50%"
|
|
146
|
+
},
|
|
147
|
+
children: /* @__PURE__ */ jsx3(GlobeIcon, { style: { width: "60%", height: "60%" } })
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function SiteIconWithFallback({
|
|
152
|
+
src: siteIconUrl,
|
|
153
|
+
alt = "",
|
|
154
|
+
className,
|
|
155
|
+
fallback = /* @__PURE__ */ jsx3(DefaultSiteIcon, { className })
|
|
156
|
+
}) {
|
|
157
|
+
const [imageUrlWithError, setImageUrlWithError] = useState("");
|
|
158
|
+
const onError = useCallback((event) => {
|
|
159
|
+
setImageUrlWithError(event.target.src);
|
|
160
|
+
}, []);
|
|
161
|
+
const showIcon = siteIconUrl && // Check if the image URL with error is different from the provided site icon URL
|
|
162
|
+
// to ensure that a change in siteIconUrl resets the error state
|
|
163
|
+
imageUrlWithError !== siteIconUrl;
|
|
164
|
+
return showIcon ? /* @__PURE__ */ jsx3("img", { src: siteIconUrl, alt, onError, className }) : fallback;
|
|
165
|
+
}
|
|
166
|
+
|
|
104
167
|
// src/google-search-preview/index.tsx
|
|
105
|
-
import { jsx as
|
|
168
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
106
169
|
var URL_LENGTH = 68;
|
|
107
170
|
var TITLE_LENGTH = 63;
|
|
108
171
|
var DESCRIPTION_LENGTH = 160;
|
|
@@ -130,32 +193,25 @@ var GoogleSearchPreview = ({
|
|
|
130
193
|
url = ""
|
|
131
194
|
}) => {
|
|
132
195
|
const domain = baseDomain(url);
|
|
133
|
-
return /* @__PURE__ */
|
|
196
|
+
return /* @__PURE__ */ jsx4("div", { className: "search-preview", children: /* @__PURE__ */ jsxs("div", { className: "search-preview__display", children: [
|
|
134
197
|
/* @__PURE__ */ jsxs("div", { className: "search-preview__header", children: [
|
|
135
198
|
/* @__PURE__ */ jsxs("div", { className: "search-preview__branding", children: [
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
"img",
|
|
138
|
-
{
|
|
139
|
-
className: "search-preview__icon",
|
|
140
|
-
src: siteIcon || `https://www.google.com/s2/favicons?sz=128&domain_url=${domain}`,
|
|
141
|
-
alt: ""
|
|
142
|
-
}
|
|
143
|
-
),
|
|
199
|
+
/* @__PURE__ */ jsx4(SiteIconWithFallback, { className: "search-preview__icon", src: siteIcon }),
|
|
144
200
|
/* @__PURE__ */ jsxs("div", { className: "search-preview__site", children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ jsx4("div", { className: "search-preview__site--title", children: siteTitle || domain }),
|
|
202
|
+
/* @__PURE__ */ jsx4("div", { className: "search-preview__url", children: googleUrl(url) })
|
|
147
203
|
] })
|
|
148
204
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ jsx4("div", { className: "search-preview__menu", children: /* @__PURE__ */ jsx4("svg", { focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("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" }) }) })
|
|
150
206
|
] }),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ jsx4("div", { className: "search-preview__title", children: googleTitle(title) }),
|
|
208
|
+
/* @__PURE__ */ jsx4("div", { className: "search-preview__description", children: googleDescription(stripHtmlTags(description)) })
|
|
153
209
|
] }) });
|
|
154
210
|
};
|
|
155
211
|
|
|
156
212
|
// src/twitter-preview/card.tsx
|
|
157
213
|
import clsx from "clsx";
|
|
158
|
-
import { jsx as
|
|
214
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
159
215
|
var DESCRIPTION_LENGTH2 = 200;
|
|
160
216
|
var twitterDescription = firstValid(
|
|
161
217
|
shortEnough(DESCRIPTION_LENGTH2),
|
|
@@ -171,44 +227,44 @@ var Card = ({
|
|
|
171
227
|
const cardClassNames = clsx(`twitter-preview__card-${cardType}`, {
|
|
172
228
|
"twitter-preview__card-has-image": !!image
|
|
173
229
|
});
|
|
174
|
-
return /* @__PURE__ */
|
|
175
|
-
image && /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ jsx5("div", { className: "twitter-preview__card", children: /* @__PURE__ */ jsxs2("div", { className: cardClassNames, children: [
|
|
231
|
+
image && /* @__PURE__ */ jsx5("img", { className: "twitter-preview__card-image", src: image, alt: "" }),
|
|
176
232
|
/* @__PURE__ */ jsxs2("div", { className: "twitter-preview__card-body", children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ jsx5("div", { className: "twitter-preview__card-url", children: baseDomain(url || "") }),
|
|
234
|
+
/* @__PURE__ */ jsx5("div", { className: "twitter-preview__card-title", children: title }),
|
|
235
|
+
/* @__PURE__ */ jsx5("div", { className: "twitter-preview__card-description", children: twitterDescription(stripHtmlTags(description)) })
|
|
180
236
|
] })
|
|
181
237
|
] }) });
|
|
182
238
|
};
|
|
183
239
|
|
|
184
240
|
// src/twitter-preview/footer.tsx
|
|
185
|
-
import { jsx as
|
|
241
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
186
242
|
var Footer = () => {
|
|
187
243
|
return /* @__PURE__ */ jsxs3("div", { className: "twitter-preview__footer", children: [
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ jsx6("span", { className: "twitter-preview__icon-replies", children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("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" }) }) }),
|
|
245
|
+
/* @__PURE__ */ jsx6("span", { className: "twitter-preview__icon-retweets", children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("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" }) }) }),
|
|
246
|
+
/* @__PURE__ */ jsx6("span", { className: "twitter-preview__icon-likes", children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("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" }) }) }),
|
|
247
|
+
/* @__PURE__ */ jsx6("span", { className: "twitter-preview__icon-analytics", children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("path", { d: "M8.75 21V3h2v18h-2zM18 21V8.5h2V21h-2zM4 21l.004-10h2L6 21H4zm9.248 0v-7h2v7h-2z" }) }) }),
|
|
248
|
+
/* @__PURE__ */ jsx6("span", { className: "twitter-preview__icon-share", children: /* @__PURE__ */ jsx6("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx6("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" }) }) })
|
|
193
249
|
] });
|
|
194
250
|
};
|
|
195
251
|
|
|
196
252
|
// src/twitter-preview/header.tsx
|
|
197
253
|
import { __ } from "@wordpress/i18n";
|
|
198
|
-
import { jsx as
|
|
254
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
199
255
|
var Header = ({ name, screenName, date }) => {
|
|
200
256
|
return /* @__PURE__ */ jsxs4("div", { className: "twitter-preview__header", children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ jsx7("span", { className: "twitter-preview__name", children: name || __("Account Name", "social-previews") }),
|
|
258
|
+
/* @__PURE__ */ jsx7("span", { className: "twitter-preview__screen-name", children: screenName || "@account" }),
|
|
259
|
+
/* @__PURE__ */ jsx7("span", { children: "\xB7" }),
|
|
260
|
+
/* @__PURE__ */ jsx7("span", { className: "twitter-preview__date", children: formatTweetDate(date || Date.now()) })
|
|
205
261
|
] });
|
|
206
262
|
};
|
|
207
263
|
|
|
208
264
|
// src/twitter-preview/media.tsx
|
|
209
265
|
import clsx2 from "clsx";
|
|
210
266
|
import { Fragment } from "react";
|
|
211
|
-
import { jsx as
|
|
267
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
212
268
|
var Media = ({ media }) => {
|
|
213
269
|
const filteredMedia = media.filter(
|
|
214
270
|
(mediaItem) => mediaItem.type.startsWith("image/") || mediaItem.type.startsWith("video/")
|
|
@@ -232,18 +288,18 @@ var Media = ({ media }) => {
|
|
|
232
288
|
"twitter-preview__media",
|
|
233
289
|
"twitter-preview__media-children-" + filteredMedia.length
|
|
234
290
|
]);
|
|
235
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ jsx8("div", { className: mediaClasses, children: filteredMedia.map((mediaItem, index) => /* @__PURE__ */ jsx8(Fragment, { children: isVideo ? /* @__PURE__ */ jsx8("video", { controls: true, children: /* @__PURE__ */ jsx8("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx8("img", { alt: mediaItem.alt || "", src: mediaItem.url }) }, `twitter-preview__media-item-${index}`)) });
|
|
236
292
|
};
|
|
237
293
|
|
|
238
294
|
// src/twitter-preview/quote-tweet.tsx
|
|
239
295
|
import { SandBox } from "@wordpress/components";
|
|
240
|
-
import { jsx as
|
|
296
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
241
297
|
var QuoteTweet = ({ tweetUrl }) => {
|
|
242
298
|
if (!tweetUrl) {
|
|
243
299
|
return null;
|
|
244
300
|
}
|
|
245
301
|
return /* @__PURE__ */ jsxs5("div", { className: "twitter-preview__quote-tweet", children: [
|
|
246
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ jsx9(
|
|
247
303
|
SandBox,
|
|
248
304
|
{
|
|
249
305
|
html: `<blockquote class="twitter-tweet" data-conversation="none" data-dnt="true"><a href="${tweetUrl}"></a></blockquote>`,
|
|
@@ -251,15 +307,15 @@ var QuoteTweet = ({ tweetUrl }) => {
|
|
|
251
307
|
title: "Embedded tweet"
|
|
252
308
|
}
|
|
253
309
|
),
|
|
254
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ jsx9("div", { className: "twitter-preview__quote-tweet-overlay" })
|
|
255
311
|
] });
|
|
256
312
|
};
|
|
257
313
|
|
|
258
314
|
// src/avatar-with-fallback.tsx
|
|
259
|
-
import { useCallback, useState } from "react";
|
|
260
|
-
import { jsx as
|
|
315
|
+
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
316
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
261
317
|
function DefaultAvatar(props) {
|
|
262
|
-
return /* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ jsx10(
|
|
263
319
|
"svg",
|
|
264
320
|
{
|
|
265
321
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -268,7 +324,7 @@ function DefaultAvatar(props) {
|
|
|
268
324
|
height: "36",
|
|
269
325
|
"aria-hidden": "true",
|
|
270
326
|
...props,
|
|
271
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ jsx10(
|
|
272
328
|
"path",
|
|
273
329
|
{
|
|
274
330
|
fill: "#DDD",
|
|
@@ -282,39 +338,39 @@ function AvatarWithFallback({
|
|
|
282
338
|
src: avatarUrl,
|
|
283
339
|
alt = "",
|
|
284
340
|
className,
|
|
285
|
-
fallback = /* @__PURE__ */
|
|
341
|
+
fallback = /* @__PURE__ */ jsx10(DefaultAvatar, { className })
|
|
286
342
|
}) {
|
|
287
|
-
const [imageUrlWithError, setImageUrlWithError] =
|
|
288
|
-
const onError =
|
|
343
|
+
const [imageUrlWithError, setImageUrlWithError] = useState2("");
|
|
344
|
+
const onError = useCallback2((event) => {
|
|
289
345
|
setImageUrlWithError(event.target.src);
|
|
290
346
|
}, []);
|
|
291
347
|
const showAvatar = !!avatarUrl && // Check if the image URL with error is different from the provided avatar URL
|
|
292
348
|
// to ensure that a change in avatarUrl resets the error state
|
|
293
349
|
imageUrlWithError !== avatarUrl;
|
|
294
|
-
return showAvatar ? /* @__PURE__ */
|
|
350
|
+
return showAvatar ? /* @__PURE__ */ jsx10("img", { src: avatarUrl, alt, onError, className }) : fallback;
|
|
295
351
|
}
|
|
296
352
|
|
|
297
353
|
// src/twitter-preview/sidebar.tsx
|
|
298
|
-
import { jsx as
|
|
354
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
299
355
|
var Sidebar = ({ profileImage, showThreadConnector }) => {
|
|
300
356
|
return /* @__PURE__ */ jsxs6("div", { className: "twitter-preview__sidebar", children: [
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
showThreadConnector && /* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ jsx11("div", { className: "twitter-preview__profile-image", children: /* @__PURE__ */ jsx11(AvatarWithFallback, { src: profileImage }) }),
|
|
358
|
+
showThreadConnector && /* @__PURE__ */ jsx11("div", { className: "twitter-preview__connector" })
|
|
303
359
|
] });
|
|
304
360
|
};
|
|
305
361
|
|
|
306
362
|
// src/twitter-preview/text.tsx
|
|
307
|
-
import { jsx as
|
|
363
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
308
364
|
var Text = ({ text, url, retainUrl }) => {
|
|
309
365
|
if (!text) {
|
|
310
366
|
return null;
|
|
311
367
|
}
|
|
312
368
|
const tweetText = url && !retainUrl && text.endsWith(url) ? text.substring(0, text.lastIndexOf(url)) : text;
|
|
313
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ jsx12("div", { className: "twitter-preview__text", children: preparePreviewText(tweetText, { platform: "twitter" }) });
|
|
314
370
|
};
|
|
315
371
|
|
|
316
372
|
// src/twitter-preview/post-preview.tsx
|
|
317
|
-
import { jsx as
|
|
373
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
318
374
|
var TwitterPostPreview = ({
|
|
319
375
|
date,
|
|
320
376
|
description,
|
|
@@ -331,15 +387,15 @@ var TwitterPostPreview = ({
|
|
|
331
387
|
url
|
|
332
388
|
}) => {
|
|
333
389
|
const hasMedia = !!media?.length;
|
|
334
|
-
return /* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsx13("div", { className: "twitter-preview__wrapper", children: /* @__PURE__ */ jsxs7("div", { className: "twitter-preview__container", children: [
|
|
391
|
+
/* @__PURE__ */ jsx13(Sidebar, { profileImage, showThreadConnector }),
|
|
336
392
|
/* @__PURE__ */ jsxs7("div", { className: "twitter-preview__main", children: [
|
|
337
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsx13(Header, { name, screenName, date }),
|
|
338
394
|
/* @__PURE__ */ jsxs7("div", { className: "twitter-preview__content", children: [
|
|
339
|
-
text ? /* @__PURE__ */
|
|
340
|
-
hasMedia ? /* @__PURE__ */
|
|
341
|
-
tweetUrl ? /* @__PURE__ */
|
|
342
|
-
!hasMedia && url && /* @__PURE__ */
|
|
395
|
+
text ? /* @__PURE__ */ jsx13(Text, { text, url: url || "", retainUrl: hasMedia }) : null,
|
|
396
|
+
hasMedia ? /* @__PURE__ */ jsx13(Media, { media }) : null,
|
|
397
|
+
tweetUrl ? /* @__PURE__ */ jsx13(QuoteTweet, { tweetUrl }) : null,
|
|
398
|
+
!hasMedia && url && /* @__PURE__ */ jsx13(
|
|
343
399
|
Card,
|
|
344
400
|
{
|
|
345
401
|
description: description || "",
|
|
@@ -350,15 +406,15 @@ var TwitterPostPreview = ({
|
|
|
350
406
|
}
|
|
351
407
|
)
|
|
352
408
|
] }),
|
|
353
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ jsx13(Footer, {})
|
|
354
410
|
] })
|
|
355
411
|
] }) });
|
|
356
412
|
};
|
|
357
413
|
|
|
358
414
|
// src/twitter-preview/link-preview.tsx
|
|
359
|
-
import { jsx as
|
|
415
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
360
416
|
var TwitterLinkPreview = (props) => {
|
|
361
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ jsx14(
|
|
362
418
|
TwitterPostPreview,
|
|
363
419
|
{
|
|
364
420
|
...props,
|
|
@@ -372,7 +428,7 @@ var TwitterLinkPreview = (props) => {
|
|
|
372
428
|
import { __ as __2 } from "@wordpress/i18n";
|
|
373
429
|
|
|
374
430
|
// src/shared/section-heading/index.tsx
|
|
375
|
-
import { jsx as
|
|
431
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
376
432
|
var HEADING_LEVELS = [2, 3, 4, 5, 6];
|
|
377
433
|
var SectionHeading = ({
|
|
378
434
|
className,
|
|
@@ -380,12 +436,12 @@ var SectionHeading = ({
|
|
|
380
436
|
children
|
|
381
437
|
}) => {
|
|
382
438
|
const Tag = `h${level && HEADING_LEVELS.includes(level) ? level : 3}`;
|
|
383
|
-
return /* @__PURE__ */
|
|
439
|
+
return /* @__PURE__ */ jsx15(Tag, { className: `social-preview__section-heading ${className ?? ""}`, children });
|
|
384
440
|
};
|
|
385
441
|
var section_heading_default = SectionHeading;
|
|
386
442
|
|
|
387
443
|
// src/twitter-preview/previews.tsx
|
|
388
|
-
import { jsx as
|
|
444
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
389
445
|
var TwitterPreviews = ({
|
|
390
446
|
headingLevel,
|
|
391
447
|
hideLinkPreview,
|
|
@@ -397,15 +453,15 @@ var TwitterPreviews = ({
|
|
|
397
453
|
}
|
|
398
454
|
return /* @__PURE__ */ jsxs8("div", { className: "social-preview twitter-preview", children: [
|
|
399
455
|
!hidePostPreview && /* @__PURE__ */ jsxs8("section", { className: "social-preview__section twitter-preview__section", children: [
|
|
400
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ jsx16(section_heading_default, {
|
|
401
457
|
level: headingLevel,
|
|
402
458
|
// translators: refers to a social post on Twitter
|
|
403
459
|
children: __2("Your post", "social-previews")
|
|
404
460
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ jsx16("p", { className: "social-preview__section-desc", children: __2("This is what your social post will look like on X:", "social-previews") }),
|
|
406
462
|
tweets.map((tweet, index) => {
|
|
407
463
|
const isLast = index + 1 === tweets.length;
|
|
408
|
-
return /* @__PURE__ */
|
|
464
|
+
return /* @__PURE__ */ jsx16(
|
|
409
465
|
TwitterPostPreview,
|
|
410
466
|
{
|
|
411
467
|
...tweet,
|
|
@@ -416,16 +472,16 @@ var TwitterPreviews = ({
|
|
|
416
472
|
})
|
|
417
473
|
] }),
|
|
418
474
|
!hideLinkPreview && /* @__PURE__ */ jsxs8("section", { className: "social-preview__section twitter-preview__section", children: [
|
|
419
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ jsx16(section_heading_default, {
|
|
420
476
|
level: headingLevel,
|
|
421
477
|
// translators: refers to a link to a Twitter post
|
|
422
478
|
children: __2("Link preview", "social-previews")
|
|
423
479
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ jsx16("p", { className: "social-preview__section-desc", children: __2(
|
|
425
481
|
"This is what it will look like when someone shares the link to your WordPress post on X.",
|
|
426
482
|
"social-previews"
|
|
427
483
|
) }),
|
|
428
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ jsx16(TwitterLinkPreview, { ...tweets[0], name: "", profileImage: "", screenName: "" })
|
|
429
485
|
] })
|
|
430
486
|
] });
|
|
431
487
|
};
|
|
@@ -437,7 +493,7 @@ import { __ as __3, sprintf as sprintf2 } from "@wordpress/i18n";
|
|
|
437
493
|
var FEED_TEXT_MAX_LENGTH = 550;
|
|
438
494
|
|
|
439
495
|
// src/linkedin-preview/post-preview.tsx
|
|
440
|
-
import { Fragment as Fragment2, jsx as
|
|
496
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
441
497
|
function LinkedInPostPreview({
|
|
442
498
|
articleReadTime = 5,
|
|
443
499
|
image,
|
|
@@ -450,56 +506,56 @@ function LinkedInPostPreview({
|
|
|
450
506
|
url
|
|
451
507
|
}) {
|
|
452
508
|
const hasMedia = !!media?.length;
|
|
453
|
-
return /* @__PURE__ */
|
|
509
|
+
return /* @__PURE__ */ jsx17("div", { className: "linkedin-preview__wrapper", children: /* @__PURE__ */ jsxs9("section", { className: `linkedin-preview__container ${hasMedia ? "has-media" : ""}`, children: [
|
|
454
510
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__header", children: [
|
|
455
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ jsx17("div", { className: "linkedin-preview__header--avatar", children: /* @__PURE__ */ jsx17(AvatarWithFallback, { src: profileImage }) }),
|
|
456
512
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__header--profile", children: [
|
|
457
513
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__header--profile-info", children: [
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ jsx17("div", { className: "linkedin-preview__header--profile-name", children: name || __3("Account Name", "social-previews") }),
|
|
515
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022" }),
|
|
516
|
+
/* @__PURE__ */ jsx17("div", {
|
|
461
517
|
className: "linkedin-preview__header--profile-actor",
|
|
462
518
|
// translators: refers to the actor level of the post being shared, e.g. "1st", "2nd", "3rd", etc.
|
|
463
519
|
children: __3("1st", "social-previews")
|
|
464
520
|
})
|
|
465
521
|
] }),
|
|
466
|
-
jobTitle ? /* @__PURE__ */
|
|
522
|
+
jobTitle ? /* @__PURE__ */ jsx17("div", { className: "linkedin-preview__header--profile-title", children: jobTitle }) : null,
|
|
467
523
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__header--profile-meta", children: [
|
|
468
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ jsx17("span", {
|
|
469
525
|
// translators: refers to the time since the post was published, e.g. "1h"
|
|
470
526
|
children: __3("1h", "social-previews")
|
|
471
527
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022" }),
|
|
529
|
+
/* @__PURE__ */ jsx17("svg", { viewBox: "0 0 16 16", fill: "currentColor", width: "16", height: "16", focusable: "false", children: /* @__PURE__ */ jsx17("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" }) })
|
|
474
530
|
] })
|
|
475
531
|
] })
|
|
476
532
|
] }),
|
|
477
533
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__content", children: [
|
|
478
534
|
description ? /* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__caption", children: [
|
|
479
|
-
/* @__PURE__ */
|
|
535
|
+
/* @__PURE__ */ jsx17("span", { children: preparePreviewText(description, {
|
|
480
536
|
platform: "linkedin",
|
|
481
537
|
maxChars: FEED_TEXT_MAX_LENGTH
|
|
482
538
|
}) }),
|
|
483
539
|
hasMedia && url && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
484
540
|
" - ",
|
|
485
|
-
/* @__PURE__ */
|
|
541
|
+
/* @__PURE__ */ jsx17("a", { href: url, rel: "nofollow noopener noreferrer", target: "_blank", children: url })
|
|
486
542
|
] })
|
|
487
543
|
] }) : null,
|
|
488
|
-
hasMedia ? /* @__PURE__ */
|
|
544
|
+
hasMedia ? /* @__PURE__ */ jsx17("div", { className: "linkedin-preview__media", children: media.map((mediaItem, index) => /* @__PURE__ */ jsx17(
|
|
489
545
|
"div",
|
|
490
546
|
{
|
|
491
547
|
className: "linkedin-preview__media-item",
|
|
492
|
-
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */
|
|
548
|
+
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx17("video", { controls: true, children: /* @__PURE__ */ jsx17("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx17("img", { alt: mediaItem.alt || "", src: mediaItem.url })
|
|
493
549
|
},
|
|
494
550
|
`linkedin-preview__media-item-${index}`
|
|
495
551
|
)) }) : /* @__PURE__ */ jsxs9("article", { children: [
|
|
496
|
-
image ? /* @__PURE__ */
|
|
552
|
+
image ? /* @__PURE__ */ jsx17("img", { className: "linkedin-preview__image", src: image, alt: "" }) : null,
|
|
497
553
|
url ? /* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__description", children: [
|
|
498
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ jsx17("h2", { className: "linkedin-preview__description--title", children: title || getTitleFromDescription(description) }),
|
|
499
555
|
/* @__PURE__ */ jsxs9("div", { className: "linkedin-preview__description--meta", children: [
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
556
|
+
/* @__PURE__ */ jsx17("span", { className: "linkedin-preview__description--url", children: baseDomain(url) }),
|
|
557
|
+
/* @__PURE__ */ jsx17("span", { children: "\u2022" }),
|
|
558
|
+
/* @__PURE__ */ jsx17("span", { children: sprintf2(
|
|
503
559
|
// translators: %d is the number of minutes it takes to read the article
|
|
504
560
|
__3("%d min read", "social-previews"),
|
|
505
561
|
articleReadTime
|
|
@@ -512,9 +568,9 @@ function LinkedInPostPreview({
|
|
|
512
568
|
}
|
|
513
569
|
|
|
514
570
|
// src/linkedin-preview/link-preview.tsx
|
|
515
|
-
import { jsx as
|
|
571
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
516
572
|
function LinkedInLinkPreview(props) {
|
|
517
|
-
return /* @__PURE__ */
|
|
573
|
+
return /* @__PURE__ */ jsx18(
|
|
518
574
|
LinkedInPostPreview,
|
|
519
575
|
{
|
|
520
576
|
name: "",
|
|
@@ -529,7 +585,7 @@ function LinkedInLinkPreview(props) {
|
|
|
529
585
|
|
|
530
586
|
// src/linkedin-preview/previews.tsx
|
|
531
587
|
import { __ as __4 } from "@wordpress/i18n";
|
|
532
|
-
import { jsx as
|
|
588
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
533
589
|
var LinkedInPreviews = ({
|
|
534
590
|
headingLevel,
|
|
535
591
|
hideLinkPreview,
|
|
@@ -538,25 +594,25 @@ var LinkedInPreviews = ({
|
|
|
538
594
|
}) => {
|
|
539
595
|
return /* @__PURE__ */ jsxs10("div", { className: "social-preview linkedin-preview", children: [
|
|
540
596
|
!hidePostPreview && /* @__PURE__ */ jsxs10("section", { className: "social-preview__section linkedin-preview__section", children: [
|
|
541
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ jsx19(section_heading_default, {
|
|
542
598
|
level: headingLevel,
|
|
543
599
|
// translators: refers to a social post on LinkedIn
|
|
544
600
|
children: __4("Your post", "social-previews")
|
|
545
601
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ jsx19("p", { className: "social-preview__section-desc", children: __4("This is what your social post will look like on LinkedIn:", "social-previews") }),
|
|
603
|
+
/* @__PURE__ */ jsx19(LinkedInPostPreview, { ...props })
|
|
548
604
|
] }),
|
|
549
605
|
!hideLinkPreview && /* @__PURE__ */ jsxs10("section", { className: "social-preview__section linkedin-preview__section", children: [
|
|
550
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ jsx19(section_heading_default, {
|
|
551
607
|
level: headingLevel,
|
|
552
608
|
// translators: refers to a link to a LinkedIn post
|
|
553
609
|
children: __4("Link preview", "social-previews")
|
|
554
610
|
}),
|
|
555
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ jsx19("p", { className: "social-preview__section-desc", children: __4(
|
|
556
612
|
"This is what it will look like when someone shares the link to your WordPress post on LinkedIn.",
|
|
557
613
|
"social-previews"
|
|
558
614
|
) }),
|
|
559
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ jsx19(LinkedInLinkPreview, { ...props, name: "", profileImage: "" })
|
|
560
616
|
] })
|
|
561
617
|
] });
|
|
562
618
|
};
|
|
@@ -594,51 +650,51 @@ var tumblrDescription = (text) => {
|
|
|
594
650
|
import { __ as __5 } from "@wordpress/i18n";
|
|
595
651
|
|
|
596
652
|
// src/tumblr-preview/post/icons/index.tsx
|
|
597
|
-
import { jsx as
|
|
653
|
+
import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
598
654
|
var TumblrPostIcon = ({ name }) => {
|
|
599
655
|
let svg;
|
|
600
656
|
switch (name) {
|
|
601
657
|
case "blaze":
|
|
602
|
-
svg = /* @__PURE__ */
|
|
658
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 25 22", children: /* @__PURE__ */ jsx20("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" }) });
|
|
603
659
|
break;
|
|
604
660
|
case "delete":
|
|
605
661
|
svg = /* @__PURE__ */ jsxs11("svg", { viewBox: "0 0 14 17", children: [
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ jsx20("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" }),
|
|
663
|
+
/* @__PURE__ */ jsx20("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" })
|
|
608
664
|
] });
|
|
609
665
|
break;
|
|
610
666
|
case "edit":
|
|
611
|
-
svg = /* @__PURE__ */
|
|
667
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 17.6 17.6", children: /* @__PURE__ */ jsx20("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" }) });
|
|
612
668
|
break;
|
|
613
669
|
case "share":
|
|
614
|
-
svg = /* @__PURE__ */
|
|
670
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx20("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" }) });
|
|
615
671
|
break;
|
|
616
672
|
case "reply":
|
|
617
|
-
svg = /* @__PURE__ */
|
|
673
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 17 17", children: /* @__PURE__ */ jsx20("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" }) });
|
|
618
674
|
break;
|
|
619
675
|
case "reblog":
|
|
620
|
-
svg = /* @__PURE__ */
|
|
676
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 17 18.1", children: /* @__PURE__ */ jsx20("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" }) });
|
|
621
677
|
break;
|
|
622
678
|
case "like":
|
|
623
|
-
svg = /* @__PURE__ */
|
|
679
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 20 18", children: /* @__PURE__ */ jsx20("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" }) });
|
|
624
680
|
break;
|
|
625
681
|
case "ellipsis":
|
|
626
|
-
svg = /* @__PURE__ */
|
|
682
|
+
svg = /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 17.5 3.9", children: /* @__PURE__ */ jsx20("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" }) });
|
|
627
683
|
break;
|
|
628
684
|
}
|
|
629
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ jsx20("span", { className: `tumblr-preview__post-icon tumblr-preview__post-icon-${name}`, children: svg });
|
|
630
686
|
};
|
|
631
687
|
var icons_default = TumblrPostIcon;
|
|
632
688
|
|
|
633
689
|
// src/tumblr-preview/post/actions/index.tsx
|
|
634
|
-
import { jsx as
|
|
690
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
635
691
|
var TumblrPostActions = () => /* @__PURE__ */ jsxs12("div", { className: "tumblr-preview__post-actions", children: [
|
|
636
692
|
/* @__PURE__ */ jsxs12("div", { className: "tumblr-preview__post-manage-actions", children: [
|
|
637
693
|
/* @__PURE__ */ jsxs12("div", { className: "tumblr-preview__post-actions-blaze", children: [
|
|
638
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ jsx21(icons_default, { name: "blaze" }),
|
|
639
695
|
"\xA0Blaze"
|
|
640
696
|
] }),
|
|
641
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ jsx21("ul", { children: [
|
|
642
698
|
{
|
|
643
699
|
icon: "delete",
|
|
644
700
|
// translators: "Delete" action on a Tumblr post
|
|
@@ -649,14 +705,14 @@ var TumblrPostActions = () => /* @__PURE__ */ jsxs12("div", { className: "tumblr
|
|
|
649
705
|
// translators: "Edit" action on a Tumblr post
|
|
650
706
|
label: __5("Edit", "social-previews")
|
|
651
707
|
}
|
|
652
|
-
].map(({ icon, label }) => /* @__PURE__ */
|
|
708
|
+
].map(({ icon, label }) => /* @__PURE__ */ jsx21("li", { "aria-label": label, children: /* @__PURE__ */ jsx21(icons_default, { name: icon }) }, icon)) })
|
|
653
709
|
] }),
|
|
654
710
|
/* @__PURE__ */ jsxs12("div", { className: "tumblr-preview__post-social-actions", children: [
|
|
655
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ jsx21("div", {
|
|
656
712
|
// translators: count of notes on a Tumblr post
|
|
657
713
|
children: __5("0 notes", "social-previews")
|
|
658
714
|
}),
|
|
659
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ jsx21("ul", { children: [
|
|
660
716
|
{
|
|
661
717
|
icon: "share",
|
|
662
718
|
// translators: "Share" action on a Tumblr post
|
|
@@ -677,23 +733,23 @@ var TumblrPostActions = () => /* @__PURE__ */ jsxs12("div", { className: "tumblr
|
|
|
677
733
|
// translators: "Like" action on a Tumblr post
|
|
678
734
|
label: __5("Like", "social-previews")
|
|
679
735
|
}
|
|
680
|
-
].map(({ icon, label }) => /* @__PURE__ */
|
|
736
|
+
].map(({ icon, label }) => /* @__PURE__ */ jsx21("li", { "aria-label": label, children: /* @__PURE__ */ jsx21(icons_default, { name: icon }) }, icon)) })
|
|
681
737
|
] })
|
|
682
738
|
] });
|
|
683
739
|
var actions_default = TumblrPostActions;
|
|
684
740
|
|
|
685
741
|
// src/tumblr-preview/post/header/index.tsx
|
|
686
742
|
import { __ as __6 } from "@wordpress/i18n";
|
|
687
|
-
import { jsx as
|
|
743
|
+
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
688
744
|
var TumblrPostHeader = ({ user }) => /* @__PURE__ */ jsxs13("div", { className: "tumblr-preview__post-header", children: [
|
|
689
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ jsx22("div", { className: "tumblr-preview__post-header-username", children: user?.displayName || // translators: username of a fictional Tumblr User
|
|
690
746
|
__6("anonymous-user", "social-previews") }),
|
|
691
|
-
/* @__PURE__ */
|
|
747
|
+
/* @__PURE__ */ jsx22(icons_default, { name: "ellipsis" })
|
|
692
748
|
] });
|
|
693
749
|
var header_default = TumblrPostHeader;
|
|
694
750
|
|
|
695
751
|
// src/tumblr-preview/link-preview.tsx
|
|
696
|
-
import { jsx as
|
|
752
|
+
import { jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
697
753
|
var TumblrLinkPreview = ({
|
|
698
754
|
title,
|
|
699
755
|
description,
|
|
@@ -703,13 +759,13 @@ var TumblrLinkPreview = ({
|
|
|
703
759
|
}) => {
|
|
704
760
|
const avatarUrl = user?.avatarUrl;
|
|
705
761
|
return /* @__PURE__ */ jsxs14("div", { className: "tumblr-preview__post", children: [
|
|
706
|
-
avatarUrl && /* @__PURE__ */
|
|
762
|
+
avatarUrl && /* @__PURE__ */ jsx23("img", { className: "tumblr-preview__avatar", src: avatarUrl, alt: "" }),
|
|
707
763
|
/* @__PURE__ */ jsxs14("div", { className: "tumblr-preview__card", children: [
|
|
708
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx23(header_default, { user }),
|
|
709
765
|
/* @__PURE__ */ jsxs14("div", { className: "tumblr-preview__window", children: [
|
|
710
766
|
image && /* @__PURE__ */ jsxs14("div", { className: "tumblr-preview__window-top", children: [
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ jsx23("div", { className: "tumblr-preview__overlay", children: /* @__PURE__ */ jsx23("div", { className: "tumblr-preview__title", children: tumblrTitle(title) }) }),
|
|
768
|
+
/* @__PURE__ */ jsx23(
|
|
713
769
|
"img",
|
|
714
770
|
{
|
|
715
771
|
className: "tumblr-preview__image",
|
|
@@ -719,19 +775,19 @@ var TumblrLinkPreview = ({
|
|
|
719
775
|
)
|
|
720
776
|
] }),
|
|
721
777
|
/* @__PURE__ */ jsxs14("div", { className: `tumblr-preview__window-bottom ${!image ? "is-full" : ""}`, children: [
|
|
722
|
-
!image && /* @__PURE__ */
|
|
723
|
-
description && image && /* @__PURE__ */
|
|
724
|
-
url && /* @__PURE__ */
|
|
778
|
+
!image && /* @__PURE__ */ jsx23("div", { className: "tumblr-preview__title", children: tumblrTitle(title) }),
|
|
779
|
+
description && image && /* @__PURE__ */ jsx23("div", { className: "tumblr-preview__description", children: tumblrDescription(description) }),
|
|
780
|
+
url && /* @__PURE__ */ jsx23("div", { className: "tumblr-preview__site-name", children: baseDomain(url) })
|
|
725
781
|
] })
|
|
726
782
|
] }),
|
|
727
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ jsx23(actions_default, {})
|
|
728
784
|
] })
|
|
729
785
|
] });
|
|
730
786
|
};
|
|
731
787
|
|
|
732
788
|
// src/tumblr-preview/post-preview.tsx
|
|
733
789
|
import { __ as __8 } from "@wordpress/i18n";
|
|
734
|
-
import { jsx as
|
|
790
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
735
791
|
var TumblrPostPreview = ({
|
|
736
792
|
title,
|
|
737
793
|
description,
|
|
@@ -743,15 +799,15 @@ var TumblrPostPreview = ({
|
|
|
743
799
|
const avatarUrl = user?.avatarUrl;
|
|
744
800
|
const mediaItem = media?.[0];
|
|
745
801
|
return /* @__PURE__ */ jsxs15("div", { className: "tumblr-preview__post", children: [
|
|
746
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ jsx24(AvatarWithFallback, { className: "tumblr-preview__avatar", src: avatarUrl }),
|
|
747
803
|
/* @__PURE__ */ jsxs15("div", { className: "tumblr-preview__card", children: [
|
|
748
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsx24(header_default, { user }),
|
|
749
805
|
/* @__PURE__ */ jsxs15("div", { className: "tumblr-preview__body", children: [
|
|
750
|
-
title ? /* @__PURE__ */
|
|
751
|
-
description && /* @__PURE__ */
|
|
806
|
+
title ? /* @__PURE__ */ jsx24("div", { className: "tumblr-preview__title", children: tumblrTitle(title) }) : null,
|
|
807
|
+
description && /* @__PURE__ */ jsx24("div", { className: "tumblr-preview__description", children: preparePreviewText(tumblrDescription(description), {
|
|
752
808
|
platform: "tumblr"
|
|
753
809
|
}) }),
|
|
754
|
-
mediaItem ? /* @__PURE__ */
|
|
810
|
+
mediaItem ? /* @__PURE__ */ jsx24("div", { className: "tumblr-preview__media-item", children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx24("video", { controls: true, className: "tumblr-preview__media--video", children: /* @__PURE__ */ jsx24("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx24("img", { className: "tumblr-preview__image", src: mediaItem.url, alt: "" }) }) : image && /* @__PURE__ */ jsx24(
|
|
755
811
|
"img",
|
|
756
812
|
{
|
|
757
813
|
className: "tumblr-preview__image",
|
|
@@ -759,16 +815,16 @@ var TumblrPostPreview = ({
|
|
|
759
815
|
alt: __8("Tumblr preview thumbnail", "social-previews")
|
|
760
816
|
}
|
|
761
817
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ jsx24("a", { className: "tumblr-preview__url", href: url, target: "_blank", rel: "noreferrer", children: __8("View On WordPress", "social-previews") })
|
|
763
819
|
] }),
|
|
764
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ jsx24(actions_default, {})
|
|
765
821
|
] })
|
|
766
822
|
] });
|
|
767
823
|
};
|
|
768
824
|
|
|
769
825
|
// src/tumblr-preview/previews.tsx
|
|
770
826
|
import { __ as __9 } from "@wordpress/i18n";
|
|
771
|
-
import { jsx as
|
|
827
|
+
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
772
828
|
var TumblrPreviews = ({
|
|
773
829
|
headingLevel,
|
|
774
830
|
hideLinkPreview,
|
|
@@ -778,25 +834,25 @@ var TumblrPreviews = ({
|
|
|
778
834
|
const hasMedia = !!props.media?.length;
|
|
779
835
|
return /* @__PURE__ */ jsxs16("div", { className: "social-preview tumblr-preview", children: [
|
|
780
836
|
!hidePostPreview && /* @__PURE__ */ jsxs16("section", { className: "social-preview__section tumblr-preview__section", children: [
|
|
781
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ jsx25(SectionHeading, {
|
|
782
838
|
level: headingLevel,
|
|
783
839
|
// translators: refers to a social post on Tumblr
|
|
784
840
|
children: __9("Your post", "social-previews")
|
|
785
841
|
}),
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
hasMedia ? /* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsx25("p", { className: "social-preview__section-desc", children: __9("This is what your social post will look like on Tumblr:", "social-previews") }),
|
|
843
|
+
hasMedia ? /* @__PURE__ */ jsx25(TumblrPostPreview, { ...props }) : /* @__PURE__ */ jsx25(TumblrLinkPreview, { ...props })
|
|
788
844
|
] }),
|
|
789
845
|
!hideLinkPreview && /* @__PURE__ */ jsxs16("section", { className: "social-preview__section tumblr-preview__section", children: [
|
|
790
|
-
/* @__PURE__ */
|
|
846
|
+
/* @__PURE__ */ jsx25(SectionHeading, {
|
|
791
847
|
level: headingLevel,
|
|
792
848
|
// translators: refers to a link on Tumblr
|
|
793
849
|
children: __9("Link preview", "social-previews")
|
|
794
850
|
}),
|
|
795
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ jsx25("p", { className: "social-preview__section-desc", children: __9(
|
|
796
852
|
"This is what it will look like when someone shares the link to your WordPress post on Tumblr.",
|
|
797
853
|
"social-previews"
|
|
798
854
|
) }),
|
|
799
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ jsx25(TumblrLinkPreview, { ...props, user: void 0 })
|
|
800
856
|
] })
|
|
801
857
|
] });
|
|
802
858
|
};
|
|
@@ -830,11 +886,11 @@ var facebookDescription = (text) => firstValid(
|
|
|
830
886
|
)(stripHtmlTags(text)) || "";
|
|
831
887
|
|
|
832
888
|
// src/facebook-preview/custom-text.tsx
|
|
833
|
-
import { jsx as
|
|
889
|
+
import { jsx as jsx26, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
834
890
|
var CustomText = ({ text, url, forceUrlDisplay }) => {
|
|
835
891
|
let postLink;
|
|
836
892
|
if (forceUrlDisplay || hasTag(text, "a")) {
|
|
837
|
-
postLink = /* @__PURE__ */
|
|
893
|
+
postLink = /* @__PURE__ */ jsx26(
|
|
838
894
|
"a",
|
|
839
895
|
{
|
|
840
896
|
className: "facebook-preview__custom-text-post-url",
|
|
@@ -846,7 +902,7 @@ var CustomText = ({ text, url, forceUrlDisplay }) => {
|
|
|
846
902
|
);
|
|
847
903
|
}
|
|
848
904
|
return /* @__PURE__ */ jsxs17("p", { className: "facebook-preview__custom-text", children: [
|
|
849
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx26("span", { children: preparePreviewText(text, {
|
|
850
906
|
platform: "facebook",
|
|
851
907
|
maxChars: CUSTOM_TEXT_LENGTH
|
|
852
908
|
}) }),
|
|
@@ -857,11 +913,11 @@ var custom_text_default = CustomText;
|
|
|
857
913
|
|
|
858
914
|
// src/facebook-preview/hooks/use-image-hook.ts
|
|
859
915
|
import { __ as __10 } from "@wordpress/i18n";
|
|
860
|
-
import { useCallback as
|
|
916
|
+
import { useCallback as useCallback3, useState as useState3 } from "react";
|
|
861
917
|
var useImage = ({ mode: initialMode }) => {
|
|
862
|
-
const [mode, setMode] =
|
|
863
|
-
const [isLoadingImage, setLoadingImage] =
|
|
864
|
-
const onLoad =
|
|
918
|
+
const [mode, setMode] = useState3(initialMode);
|
|
919
|
+
const [isLoadingImage, setLoadingImage] = useState3(true);
|
|
920
|
+
const onLoad = useCallback3(
|
|
865
921
|
({ target }) => {
|
|
866
922
|
if (!mode) {
|
|
867
923
|
const image = target;
|
|
@@ -871,7 +927,7 @@ var useImage = ({ mode: initialMode }) => {
|
|
|
871
927
|
},
|
|
872
928
|
[mode]
|
|
873
929
|
);
|
|
874
|
-
const onError =
|
|
930
|
+
const onError = useCallback3(() => setLoadingImage(false), []);
|
|
875
931
|
return [
|
|
876
932
|
mode,
|
|
877
933
|
isLoadingImage,
|
|
@@ -888,13 +944,13 @@ var use_image_hook_default = useImage;
|
|
|
888
944
|
import { __ as __11 } from "@wordpress/i18n";
|
|
889
945
|
|
|
890
946
|
// src/facebook-preview/post/icons/index.tsx
|
|
891
|
-
import { jsx as
|
|
892
|
-
var FacebookPostIcon = ({ name }) => /* @__PURE__ */
|
|
947
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
948
|
+
var FacebookPostIcon = ({ name }) => /* @__PURE__ */ jsx27("i", { className: `facebook-preview__post-icon facebook-preview__post-icon-${name}` });
|
|
893
949
|
var icons_default2 = FacebookPostIcon;
|
|
894
950
|
|
|
895
951
|
// src/facebook-preview/post/actions/index.tsx
|
|
896
|
-
import { jsx as
|
|
897
|
-
var FacebookPostActions = () => /* @__PURE__ */
|
|
952
|
+
import { jsx as jsx28, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
953
|
+
var FacebookPostActions = () => /* @__PURE__ */ jsx28("ul", { className: "facebook-preview__post-actions", children: [
|
|
898
954
|
{
|
|
899
955
|
icon: "like",
|
|
900
956
|
// translators: Facebook "Like" action
|
|
@@ -911,18 +967,18 @@ var FacebookPostActions = () => /* @__PURE__ */ jsx26("ul", { className: "facebo
|
|
|
911
967
|
label: __11("Share", "social-previews")
|
|
912
968
|
}
|
|
913
969
|
].map(({ icon, label }) => /* @__PURE__ */ jsxs18("li", { children: [
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ jsx28(icons_default2, { name: icon }),
|
|
971
|
+
/* @__PURE__ */ jsx28("span", { children: label })
|
|
916
972
|
] }, icon)) });
|
|
917
973
|
var actions_default2 = FacebookPostActions;
|
|
918
974
|
|
|
919
975
|
// src/facebook-preview/post/header/index.tsx
|
|
920
976
|
import { __ as __12, _x } from "@wordpress/i18n";
|
|
921
|
-
import { jsx as
|
|
977
|
+
import { jsx as jsx29, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
922
978
|
var FacebookPostHeader = ({ user, timeElapsed, hideOptions }) => {
|
|
923
979
|
return /* @__PURE__ */ jsxs19("div", { className: "facebook-preview__post-header", children: [
|
|
924
980
|
/* @__PURE__ */ jsxs19("div", { className: "facebook-preview__post-header-content", children: [
|
|
925
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ jsx29(
|
|
926
982
|
AvatarWithFallback,
|
|
927
983
|
{
|
|
928
984
|
className: "facebook-preview__post-header-avatar",
|
|
@@ -930,10 +986,10 @@ var FacebookPostHeader = ({ user, timeElapsed, hideOptions }) => {
|
|
|
930
986
|
}
|
|
931
987
|
),
|
|
932
988
|
/* @__PURE__ */ jsxs19("div", { children: [
|
|
933
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ jsx29("div", { className: "facebook-preview__post-header-name", children: user?.displayName || // translators: name of a fictional Facebook User
|
|
934
990
|
__12("Anonymous User", "social-previews") }),
|
|
935
991
|
/* @__PURE__ */ jsxs19("div", { className: "facebook-preview__post-header-share", children: [
|
|
936
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ jsx29("span", { className: "facebook-preview__post-header-time", children: timeElapsed ? __12(
|
|
937
993
|
// translators: short version of `1 hour`
|
|
938
994
|
"1h",
|
|
939
995
|
"social-previews"
|
|
@@ -943,18 +999,18 @@ var FacebookPostHeader = ({ user, timeElapsed, hideOptions }) => {
|
|
|
943
999
|
"",
|
|
944
1000
|
"social-previews"
|
|
945
1001
|
) }),
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ jsx29("span", { className: "facebook-preview__post-header-dot", "aria-hidden": "true", children: "\xB7" }),
|
|
1003
|
+
/* @__PURE__ */ jsx29(icons_default2, { name: "public" })
|
|
948
1004
|
] })
|
|
949
1005
|
] })
|
|
950
1006
|
] }),
|
|
951
|
-
!hideOptions && /* @__PURE__ */
|
|
1007
|
+
!hideOptions && /* @__PURE__ */ jsx29("div", { className: "facebook-preview__post-header-more" })
|
|
952
1008
|
] });
|
|
953
1009
|
};
|
|
954
1010
|
var header_default2 = FacebookPostHeader;
|
|
955
1011
|
|
|
956
1012
|
// src/facebook-preview/link-preview.tsx
|
|
957
|
-
import { jsx as
|
|
1013
|
+
import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
958
1014
|
var FacebookLinkPreview = ({
|
|
959
1015
|
url,
|
|
960
1016
|
title,
|
|
@@ -971,24 +1027,24 @@ var FacebookLinkPreview = ({
|
|
|
971
1027
|
const portraitMode = isArticle && !image || mode === PORTRAIT_MODE;
|
|
972
1028
|
const modeClass = `is-${portraitMode ? "portrait" : "landscape"}`;
|
|
973
1029
|
return /* @__PURE__ */ jsxs20("div", { className: "facebook-preview__post", children: [
|
|
974
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ jsx30(header_default2, { user }),
|
|
975
1031
|
/* @__PURE__ */ jsxs20("div", { className: "facebook-preview__content", children: [
|
|
976
|
-
customText && /* @__PURE__ */
|
|
1032
|
+
customText && /* @__PURE__ */ jsx30(custom_text_default, { text: customText, url }),
|
|
977
1033
|
/* @__PURE__ */ jsxs20(
|
|
978
1034
|
"div",
|
|
979
1035
|
{
|
|
980
1036
|
className: `facebook-preview__body ${modeClass} ${image && isLoadingImage ? "is-loading" : ""}`,
|
|
981
1037
|
children: [
|
|
982
|
-
(image || isArticle) && /* @__PURE__ */
|
|
1038
|
+
(image || isArticle) && /* @__PURE__ */ jsx30(
|
|
983
1039
|
"div",
|
|
984
1040
|
{
|
|
985
1041
|
className: `facebook-preview__image ${image ? "" : "is-empty"} ${modeClass}`,
|
|
986
|
-
children: image && /* @__PURE__ */
|
|
1042
|
+
children: image && /* @__PURE__ */ jsx30("img", { src: image, ...imgProps })
|
|
987
1043
|
}
|
|
988
1044
|
),
|
|
989
|
-
/* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx30("div", { className: "facebook-preview__text", children: /* @__PURE__ */ jsxs20("div", { className: "facebook-preview__text-wrapper", children: [
|
|
1046
|
+
/* @__PURE__ */ jsx30("div", { className: "facebook-preview__url", children: baseDomain(url) }),
|
|
1047
|
+
/* @__PURE__ */ jsx30("div", { className: "facebook-preview__title", children: facebookTitle(title) || baseDomain(url) }),
|
|
992
1048
|
/* @__PURE__ */ jsxs20(
|
|
993
1049
|
"div",
|
|
994
1050
|
{
|
|
@@ -1000,18 +1056,18 @@ var FacebookLinkPreview = ({
|
|
|
1000
1056
|
]
|
|
1001
1057
|
}
|
|
1002
1058
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ jsx30("div", { className: "facebook-preview__info", children: /* @__PURE__ */ jsx30(icons_default2, { name: "info" }) })
|
|
1004
1060
|
] }) })
|
|
1005
1061
|
]
|
|
1006
1062
|
}
|
|
1007
1063
|
)
|
|
1008
1064
|
] }),
|
|
1009
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ jsx30(actions_default2, {})
|
|
1010
1066
|
] });
|
|
1011
1067
|
};
|
|
1012
1068
|
|
|
1013
1069
|
// src/facebook-preview/link-preview-details.tsx
|
|
1014
|
-
import { jsx as
|
|
1070
|
+
import { jsx as jsx31, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1015
1071
|
var LinkPreviewDetails = ({
|
|
1016
1072
|
url,
|
|
1017
1073
|
customImage,
|
|
@@ -1022,24 +1078,24 @@ var LinkPreviewDetails = ({
|
|
|
1022
1078
|
const [mode, isLoadingImage, imgProps] = use_image_hook_default({ mode: imageMode });
|
|
1023
1079
|
const modeClass = `is-${mode === PORTRAIT_MODE ? "portrait" : "landscape"}`;
|
|
1024
1080
|
return /* @__PURE__ */ jsxs21("div", { className: "facebook-preview__post", children: [
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx31(header_default2, { user: void 0 }),
|
|
1082
|
+
/* @__PURE__ */ jsx31("div", { className: "facebook-preview__content", children: /* @__PURE__ */ jsxs21(
|
|
1027
1083
|
"div",
|
|
1028
1084
|
{
|
|
1029
1085
|
className: `facebook-preview__window ${modeClass} ${customImage && isLoadingImage ? "is-loading" : ""}`,
|
|
1030
1086
|
children: [
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
customText && /* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ jsx31("div", { className: `facebook-preview__custom-image ${modeClass}`, children: /* @__PURE__ */ jsx31("img", { src: customImage, ...imgProps }) }),
|
|
1088
|
+
/* @__PURE__ */ jsx31(header_default2, { user, timeElapsed: true, hideOptions: true }),
|
|
1089
|
+
customText && /* @__PURE__ */ jsx31(custom_text_default, { text: customText, url, forceUrlDisplay: true })
|
|
1034
1090
|
]
|
|
1035
1091
|
}
|
|
1036
1092
|
) }),
|
|
1037
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ jsx31(actions_default2, {})
|
|
1038
1094
|
] });
|
|
1039
1095
|
};
|
|
1040
1096
|
|
|
1041
1097
|
// src/facebook-preview/post-preview.tsx
|
|
1042
|
-
import { jsx as
|
|
1098
|
+
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1043
1099
|
var FacebookPostPreview = ({
|
|
1044
1100
|
url,
|
|
1045
1101
|
user,
|
|
@@ -1050,24 +1106,24 @@ var FacebookPostPreview = ({
|
|
|
1050
1106
|
const [mode] = use_image_hook_default({ mode: imageMode });
|
|
1051
1107
|
const modeClass = `is-${mode === PORTRAIT_MODE ? "portrait" : "landscape"}`;
|
|
1052
1108
|
return /* @__PURE__ */ jsxs22("div", { className: "facebook-preview__post", children: [
|
|
1053
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ jsx32(header_default2, { user }),
|
|
1054
1110
|
/* @__PURE__ */ jsxs22("div", { className: "facebook-preview__content", children: [
|
|
1055
|
-
customText && /* @__PURE__ */
|
|
1056
|
-
/* @__PURE__ */
|
|
1111
|
+
customText && /* @__PURE__ */ jsx32(custom_text_default, { text: customText, url, forceUrlDisplay: true }),
|
|
1112
|
+
/* @__PURE__ */ jsx32("div", { className: "facebook-preview__body", children: media ? /* @__PURE__ */ jsx32("div", { className: `facebook-preview__media ${modeClass}`, children: media.map((mediaItem, index) => /* @__PURE__ */ jsx32(
|
|
1057
1113
|
"div",
|
|
1058
1114
|
{
|
|
1059
1115
|
className: `facebook-preview__media-item ${modeClass}`,
|
|
1060
|
-
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */
|
|
1116
|
+
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx32("video", { controls: true, children: /* @__PURE__ */ jsx32("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx32("img", { alt: mediaItem.alt || "", src: mediaItem.url })
|
|
1061
1117
|
},
|
|
1062
1118
|
`facebook-preview__media-item-${index}`
|
|
1063
1119
|
)) }) : null })
|
|
1064
1120
|
] }),
|
|
1065
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ jsx32(actions_default2, {})
|
|
1066
1122
|
] });
|
|
1067
1123
|
};
|
|
1068
1124
|
|
|
1069
1125
|
// src/facebook-preview/previews.tsx
|
|
1070
|
-
import { jsx as
|
|
1126
|
+
import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1071
1127
|
var FacebookPreviews = ({
|
|
1072
1128
|
headingLevel,
|
|
1073
1129
|
hideLinkPreview,
|
|
@@ -1078,34 +1134,34 @@ var FacebookPreviews = ({
|
|
|
1078
1134
|
const hasCustomImage = !!props.customImage;
|
|
1079
1135
|
return /* @__PURE__ */ jsxs23("div", { className: "social-preview facebook-preview", children: [
|
|
1080
1136
|
!hidePostPreview && /* @__PURE__ */ jsxs23("section", { className: "social-preview__section facebook-preview__section", children: [
|
|
1081
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ jsx33(section_heading_default, {
|
|
1082
1138
|
level: headingLevel,
|
|
1083
1139
|
// translators: refers to a social post on Facebook
|
|
1084
1140
|
children: __14("Your post", "social-previews")
|
|
1085
1141
|
}),
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
hasMedia ? /* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ jsx33("p", { className: "social-preview__section-desc", children: __14("This is what your social post will look like on Facebook:", "social-previews") }),
|
|
1143
|
+
hasMedia ? /* @__PURE__ */ jsx33(FacebookPostPreview, { ...props }) : /* @__PURE__ */ jsx33(FacebookLinkPreview, { ...props })
|
|
1088
1144
|
] }),
|
|
1089
1145
|
!hideLinkPreview && /* @__PURE__ */ jsxs23("section", { className: "social-preview__section facebook-preview__section", children: [
|
|
1090
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ jsx33(section_heading_default, {
|
|
1091
1147
|
level: headingLevel,
|
|
1092
1148
|
// translators: refers to a link to a Facebook post
|
|
1093
1149
|
children: __14("Link preview", "social-previews")
|
|
1094
1150
|
}),
|
|
1095
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ jsx33("p", { className: "social-preview__section-desc", children: __14(
|
|
1096
1152
|
"This is what it will look like when someone shares the link to your WordPress post on Facebook.",
|
|
1097
1153
|
"social-previews"
|
|
1098
1154
|
) }),
|
|
1099
|
-
hasCustomImage ? /* @__PURE__ */
|
|
1155
|
+
hasCustomImage ? /* @__PURE__ */ jsx33(LinkPreviewDetails, { ...props }) : /* @__PURE__ */ jsx33(FacebookLinkPreview, { ...props, compactDescription: true, customText: "", user: void 0 })
|
|
1100
1156
|
] })
|
|
1101
1157
|
] });
|
|
1102
1158
|
};
|
|
1103
1159
|
|
|
1104
1160
|
// src/mastodon-preview/post/actions/index.tsx
|
|
1105
|
-
import { jsx as
|
|
1161
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1106
1162
|
var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mastodon-preview__post-actions", children: [
|
|
1107
1163
|
/* @__PURE__ */ jsxs24("div", { children: [
|
|
1108
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ jsx34(
|
|
1109
1165
|
"svg",
|
|
1110
1166
|
{
|
|
1111
1167
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1113,13 +1169,13 @@ var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mast
|
|
|
1113
1169
|
viewBox: "0 -960 960 960",
|
|
1114
1170
|
width: "24",
|
|
1115
1171
|
"aria-hidden": "true",
|
|
1116
|
-
children: /* @__PURE__ */
|
|
1172
|
+
children: /* @__PURE__ */ jsx34("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" })
|
|
1117
1173
|
}
|
|
1118
1174
|
),
|
|
1119
1175
|
"\xA0",
|
|
1120
|
-
/* @__PURE__ */
|
|
1176
|
+
/* @__PURE__ */ jsx34("span", { children: 0 })
|
|
1121
1177
|
] }),
|
|
1122
|
-
/* @__PURE__ */
|
|
1178
|
+
/* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(
|
|
1123
1179
|
"svg",
|
|
1124
1180
|
{
|
|
1125
1181
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1127,10 +1183,10 @@ var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mast
|
|
|
1127
1183
|
viewBox: "0 -960 960 960",
|
|
1128
1184
|
width: "24",
|
|
1129
1185
|
"aria-hidden": "true",
|
|
1130
|
-
children: /* @__PURE__ */
|
|
1186
|
+
children: /* @__PURE__ */ jsx34("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" })
|
|
1131
1187
|
}
|
|
1132
1188
|
) }),
|
|
1133
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(
|
|
1134
1190
|
"svg",
|
|
1135
1191
|
{
|
|
1136
1192
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1138,10 +1194,10 @@ var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mast
|
|
|
1138
1194
|
viewBox: "0 -960 960 960",
|
|
1139
1195
|
width: "24",
|
|
1140
1196
|
"aria-hidden": "true",
|
|
1141
|
-
children: /* @__PURE__ */
|
|
1197
|
+
children: /* @__PURE__ */ jsx34("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" })
|
|
1142
1198
|
}
|
|
1143
1199
|
) }),
|
|
1144
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(
|
|
1145
1201
|
"svg",
|
|
1146
1202
|
{
|
|
1147
1203
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1149,10 +1205,10 @@ var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mast
|
|
|
1149
1205
|
viewBox: "0 -960 960 960",
|
|
1150
1206
|
width: "24",
|
|
1151
1207
|
"aria-hidden": "true",
|
|
1152
|
-
children: /* @__PURE__ */
|
|
1208
|
+
children: /* @__PURE__ */ jsx34("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" })
|
|
1153
1209
|
}
|
|
1154
1210
|
) }),
|
|
1155
|
-
/* @__PURE__ */
|
|
1211
|
+
/* @__PURE__ */ jsx34("div", { children: /* @__PURE__ */ jsx34(
|
|
1156
1212
|
"svg",
|
|
1157
1213
|
{
|
|
1158
1214
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1160,7 +1216,7 @@ var MastodonPostActions = () => /* @__PURE__ */ jsxs24("div", { className: "mast
|
|
|
1160
1216
|
viewBox: "0 -960 960 960",
|
|
1161
1217
|
width: "24",
|
|
1162
1218
|
"aria-hidden": "true",
|
|
1163
|
-
children: /* @__PURE__ */
|
|
1219
|
+
children: /* @__PURE__ */ jsx34("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" })
|
|
1164
1220
|
}
|
|
1165
1221
|
) })
|
|
1166
1222
|
] });
|
|
@@ -1200,7 +1256,7 @@ var getMastodonAddressDetails = (address) => {
|
|
|
1200
1256
|
};
|
|
1201
1257
|
|
|
1202
1258
|
// src/mastodon-preview/post/card/index.tsx
|
|
1203
|
-
import { jsx as
|
|
1259
|
+
import { jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1204
1260
|
var MastodonPostCard = ({
|
|
1205
1261
|
siteName,
|
|
1206
1262
|
title,
|
|
@@ -1210,13 +1266,13 @@ var MastodonPostCard = ({
|
|
|
1210
1266
|
customImage
|
|
1211
1267
|
}) => {
|
|
1212
1268
|
return /* @__PURE__ */ jsxs25("div", { className: clsx3("mastodon-preview__card", { "has-image": image }), children: [
|
|
1213
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ jsx35("div", { className: "mastodon-preview__card-img", children: image || customImage ? /* @__PURE__ */ jsx35(
|
|
1214
1270
|
"img",
|
|
1215
1271
|
{
|
|
1216
1272
|
src: image || customImage,
|
|
1217
1273
|
alt: __15("Mastodon preview thumbnail", "social-previews")
|
|
1218
1274
|
}
|
|
1219
|
-
) : /* @__PURE__ */
|
|
1275
|
+
) : /* @__PURE__ */ jsx35("div", { className: "mastodon-preview__card-img--fallback", children: /* @__PURE__ */ jsx35(
|
|
1220
1276
|
"svg",
|
|
1221
1277
|
{
|
|
1222
1278
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1224,13 +1280,13 @@ var MastodonPostCard = ({
|
|
|
1224
1280
|
viewBox: "0 -960 960 960",
|
|
1225
1281
|
width: "24",
|
|
1226
1282
|
"aria-hidden": "true",
|
|
1227
|
-
children: /* @__PURE__ */
|
|
1283
|
+
children: /* @__PURE__ */ jsx35("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" })
|
|
1228
1284
|
}
|
|
1229
1285
|
) }) }),
|
|
1230
1286
|
/* @__PURE__ */ jsxs25("div", { className: "mastodon-preview__card-text", children: [
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ jsx35("span", { className: "mastodon-preview__card-site", children: siteName || baseDomain(url) }),
|
|
1288
|
+
/* @__PURE__ */ jsx35("span", { className: "mastodon-preview__card-title", children: mastodonTitle(title) || getTitleFromDescription(description) }),
|
|
1289
|
+
/* @__PURE__ */ jsx35("span", { className: "mastodon-preview__card-description", children: stripHtmlTags(description) })
|
|
1234
1290
|
] })
|
|
1235
1291
|
] });
|
|
1236
1292
|
};
|
|
@@ -1240,9 +1296,9 @@ var card_default = MastodonPostCard;
|
|
|
1240
1296
|
import { __ as __16 } from "@wordpress/i18n";
|
|
1241
1297
|
|
|
1242
1298
|
// src/mastodon-preview/post/icons/index.tsx
|
|
1243
|
-
import { jsx as
|
|
1244
|
-
function
|
|
1245
|
-
return /* @__PURE__ */
|
|
1299
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1300
|
+
function GlobeIcon2() {
|
|
1301
|
+
return /* @__PURE__ */ jsx36(
|
|
1246
1302
|
"svg",
|
|
1247
1303
|
{
|
|
1248
1304
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1250,26 +1306,26 @@ function GlobeIcon() {
|
|
|
1250
1306
|
viewBox: "0 -960 960 960",
|
|
1251
1307
|
width: "15",
|
|
1252
1308
|
role: "img",
|
|
1253
|
-
children: /* @__PURE__ */
|
|
1309
|
+
children: /* @__PURE__ */ jsx36("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" })
|
|
1254
1310
|
}
|
|
1255
1311
|
);
|
|
1256
1312
|
}
|
|
1257
1313
|
|
|
1258
1314
|
// src/mastodon-preview/post/header/index.tsx
|
|
1259
|
-
import { jsx as
|
|
1315
|
+
import { jsx as jsx37, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1260
1316
|
var MastodonPostHeader = ({ user }) => {
|
|
1261
1317
|
const { displayName, address, avatarUrl } = user || {};
|
|
1262
1318
|
return /* @__PURE__ */ jsxs26("div", { className: "mastodon-preview__post-header", children: [
|
|
1263
1319
|
/* @__PURE__ */ jsxs26("div", { className: "mastodon-preview__post-header-user", children: [
|
|
1264
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ jsx37(AvatarWithFallback, { className: "mastodon-preview__post-avatar", src: avatarUrl }),
|
|
1265
1321
|
/* @__PURE__ */ jsxs26("div", { children: [
|
|
1266
|
-
/* @__PURE__ */
|
|
1322
|
+
/* @__PURE__ */ jsx37("div", { className: "mastodon-preview__post-header-displayname", children: displayName || // translators: username of a fictional Mastodon User
|
|
1267
1323
|
__16("anonymous-user", "social-previews") }),
|
|
1268
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ jsx37("div", { className: "mastodon-preview__post-header-username", children: address?.replace(`@${DEFAULT_MASTODON_INSTANCE}`, "") || "@username" })
|
|
1269
1325
|
] })
|
|
1270
1326
|
] }),
|
|
1271
1327
|
/* @__PURE__ */ jsxs26("div", { className: "mastodon-preview__post-header-audience", children: [
|
|
1272
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ jsx37(GlobeIcon2, {}),
|
|
1273
1329
|
formatMastodonDate(/* @__PURE__ */ new Date())
|
|
1274
1330
|
] })
|
|
1275
1331
|
] });
|
|
@@ -1277,13 +1333,13 @@ var MastodonPostHeader = ({ user }) => {
|
|
|
1277
1333
|
var header_default3 = MastodonPostHeader;
|
|
1278
1334
|
|
|
1279
1335
|
// src/mastodon-preview/link-preview.tsx
|
|
1280
|
-
import { jsx as
|
|
1336
|
+
import { jsx as jsx38, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1281
1337
|
var MastodonLinkPreview = (props) => {
|
|
1282
1338
|
const { user } = props;
|
|
1283
1339
|
return /* @__PURE__ */ jsxs27("div", { className: "mastodon-preview__post", children: [
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ jsx38(header_default3, { user }),
|
|
1341
|
+
/* @__PURE__ */ jsx38(card_default, { ...props, customImage: "" }),
|
|
1342
|
+
/* @__PURE__ */ jsx38(actions_default3, {})
|
|
1287
1343
|
] });
|
|
1288
1344
|
};
|
|
1289
1345
|
|
|
@@ -1291,7 +1347,7 @@ var MastodonLinkPreview = (props) => {
|
|
|
1291
1347
|
import clsx4 from "clsx";
|
|
1292
1348
|
|
|
1293
1349
|
// src/mastodon-preview/post/body/index.tsx
|
|
1294
|
-
import { Fragment as Fragment3, jsx as
|
|
1350
|
+
import { Fragment as Fragment3, jsx as jsx39, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1295
1351
|
var MastonPostBody = (props) => {
|
|
1296
1352
|
const { title, description, customText, url, user, children } = props;
|
|
1297
1353
|
const instance = user?.address ? getMastodonAddressDetails(user.address).instance : "";
|
|
@@ -1301,51 +1357,51 @@ var MastonPostBody = (props) => {
|
|
|
1301
1357
|
};
|
|
1302
1358
|
let bodyTxt;
|
|
1303
1359
|
if (customText) {
|
|
1304
|
-
bodyTxt = /* @__PURE__ */
|
|
1360
|
+
bodyTxt = /* @__PURE__ */ jsx39("p", { children: mastodonBody(customText, options) });
|
|
1305
1361
|
} else if (description) {
|
|
1306
1362
|
if (title) {
|
|
1307
1363
|
const renderedTitle = stripHtmlTags(title);
|
|
1308
1364
|
options.offset = renderedTitle.length;
|
|
1309
1365
|
bodyTxt = /* @__PURE__ */ jsxs28(Fragment3, { children: [
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ jsx39("p", { children: renderedTitle }),
|
|
1367
|
+
/* @__PURE__ */ jsx39("p", { children: mastodonBody(description, options) })
|
|
1312
1368
|
] });
|
|
1313
1369
|
} else {
|
|
1314
|
-
bodyTxt = /* @__PURE__ */
|
|
1370
|
+
bodyTxt = /* @__PURE__ */ jsx39("p", { children: mastodonBody(description, options) });
|
|
1315
1371
|
}
|
|
1316
1372
|
} else {
|
|
1317
|
-
bodyTxt = /* @__PURE__ */
|
|
1373
|
+
bodyTxt = /* @__PURE__ */ jsx39("p", { children: mastodonBody(title, options) });
|
|
1318
1374
|
}
|
|
1319
1375
|
return /* @__PURE__ */ jsxs28("div", { className: "mastodon-preview__body", children: [
|
|
1320
1376
|
bodyTxt,
|
|
1321
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ jsx39("a", { href: url, target: "_blank", rel: "noreferrer noopener", children: mastodonUrl(url.replace(/^https?:\/\//, "")) }),
|
|
1322
1378
|
children
|
|
1323
1379
|
] });
|
|
1324
1380
|
};
|
|
1325
1381
|
var body_default = MastonPostBody;
|
|
1326
1382
|
|
|
1327
1383
|
// src/mastodon-preview/post-preview.tsx
|
|
1328
|
-
import { jsx as
|
|
1384
|
+
import { jsx as jsx40, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1329
1385
|
var MastodonPostPreview = (props) => {
|
|
1330
1386
|
const { user, media } = props;
|
|
1331
1387
|
return /* @__PURE__ */ jsxs29("div", { className: "mastodon-preview__post", children: [
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ jsx40(header_default3, { user }),
|
|
1389
|
+
/* @__PURE__ */ jsx40(body_default, { ...props, children: media?.length ? /* @__PURE__ */ jsx40("div", { className: clsx4("mastodon-preview__media", { "as-grid": media.length > 1 }), children: media.map((mediaItem, index) => /* @__PURE__ */ jsx40(
|
|
1334
1390
|
"div",
|
|
1335
1391
|
{
|
|
1336
1392
|
className: "mastodon-preview__media-item",
|
|
1337
|
-
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */
|
|
1393
|
+
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx40("video", { controls: true, children: /* @__PURE__ */ jsx40("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx40("img", { alt: mediaItem.alt || "", src: mediaItem.url })
|
|
1338
1394
|
},
|
|
1339
1395
|
`mastodon-preview__media-item-${index}`
|
|
1340
1396
|
)) }) : null }),
|
|
1341
|
-
!media?.length ? /* @__PURE__ */
|
|
1342
|
-
/* @__PURE__ */
|
|
1397
|
+
!media?.length ? /* @__PURE__ */ jsx40(card_default, { ...props }) : null,
|
|
1398
|
+
/* @__PURE__ */ jsx40(actions_default3, {})
|
|
1343
1399
|
] });
|
|
1344
1400
|
};
|
|
1345
1401
|
|
|
1346
1402
|
// src/mastodon-preview/previews.tsx
|
|
1347
1403
|
import { __ as __17 } from "@wordpress/i18n";
|
|
1348
|
-
import { jsx as
|
|
1404
|
+
import { jsx as jsx41, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1349
1405
|
var MastodonPreviews = ({
|
|
1350
1406
|
headingLevel,
|
|
1351
1407
|
hidePostPreview,
|
|
@@ -1354,25 +1410,25 @@ var MastodonPreviews = ({
|
|
|
1354
1410
|
}) => {
|
|
1355
1411
|
return /* @__PURE__ */ jsxs30("div", { className: "social-preview mastodon-preview", children: [
|
|
1356
1412
|
!hidePostPreview && /* @__PURE__ */ jsxs30("section", { className: "social-preview__section mastodon-preview__section", children: [
|
|
1357
|
-
/* @__PURE__ */
|
|
1413
|
+
/* @__PURE__ */ jsx41(SectionHeading, {
|
|
1358
1414
|
level: headingLevel,
|
|
1359
1415
|
// translators: refers to a social post on Mastodon
|
|
1360
1416
|
children: __17("Your post", "social-previews")
|
|
1361
1417
|
}),
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ jsx41("p", { className: "social-preview__section-desc", children: __17("This is what your social post will look like on Mastodon:", "social-previews") }),
|
|
1419
|
+
/* @__PURE__ */ jsx41(MastodonPostPreview, { ...props })
|
|
1364
1420
|
] }),
|
|
1365
1421
|
!hideLinkPreview && /* @__PURE__ */ jsxs30("section", { className: "social-preview__section mastodon-preview__section", children: [
|
|
1366
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ jsx41(SectionHeading, {
|
|
1367
1423
|
level: headingLevel,
|
|
1368
1424
|
// translators: refers to a link to a Mastodon post
|
|
1369
1425
|
children: __17("Link preview", "social-previews")
|
|
1370
1426
|
}),
|
|
1371
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ jsx41("p", { className: "social-preview__section-desc", children: __17(
|
|
1372
1428
|
"This is what it will look like when someone shares the link to your WordPress post on Mastodon.",
|
|
1373
1429
|
"social-previews"
|
|
1374
1430
|
) }),
|
|
1375
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsx41(MastodonLinkPreview, { ...props, user: void 0 })
|
|
1376
1432
|
] })
|
|
1377
1433
|
] });
|
|
1378
1434
|
};
|
|
@@ -1388,9 +1444,9 @@ var FEED_TEXT_MAX_LENGTH2 = 500;
|
|
|
1388
1444
|
import { __ as __18 } from "@wordpress/i18n";
|
|
1389
1445
|
|
|
1390
1446
|
// src/nextdoor-preview/icons/comment-icon.tsx
|
|
1391
|
-
import { jsx as
|
|
1447
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1392
1448
|
function CommentIcon() {
|
|
1393
|
-
return /* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ jsx42("svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx42(
|
|
1394
1450
|
"path",
|
|
1395
1451
|
{
|
|
1396
1452
|
fill: "currentColor",
|
|
@@ -1402,9 +1458,9 @@ function CommentIcon() {
|
|
|
1402
1458
|
}
|
|
1403
1459
|
|
|
1404
1460
|
// src/nextdoor-preview/icons/like-icon.tsx
|
|
1405
|
-
import { jsx as
|
|
1461
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
1406
1462
|
function LikeIcon() {
|
|
1407
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsx43("svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx43(
|
|
1408
1464
|
"path",
|
|
1409
1465
|
{
|
|
1410
1466
|
fill: "currentColor",
|
|
@@ -1416,9 +1472,9 @@ function LikeIcon() {
|
|
|
1416
1472
|
}
|
|
1417
1473
|
|
|
1418
1474
|
// src/nextdoor-preview/icons/share-icon.tsx
|
|
1419
|
-
import { jsx as
|
|
1475
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
1420
1476
|
function ShareIcon() {
|
|
1421
|
-
return /* @__PURE__ */
|
|
1477
|
+
return /* @__PURE__ */ jsx44("svg", { width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx44(
|
|
1422
1478
|
"path",
|
|
1423
1479
|
{
|
|
1424
1480
|
fill: "currentColor",
|
|
@@ -1430,28 +1486,28 @@ function ShareIcon() {
|
|
|
1430
1486
|
}
|
|
1431
1487
|
|
|
1432
1488
|
// src/nextdoor-preview/footer-actions.tsx
|
|
1433
|
-
import { jsx as
|
|
1489
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1434
1490
|
function FooterActions() {
|
|
1435
1491
|
return /* @__PURE__ */ jsxs31("div", { className: "nextdoor-preview__footer--actions", children: [
|
|
1436
1492
|
/* @__PURE__ */ jsxs31("div", { className: "nextdoor-preview__footer--actions-item", children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsx45(LikeIcon, {}),
|
|
1494
|
+
/* @__PURE__ */ jsx45("span", { children: __18("Like", "social-previews") })
|
|
1439
1495
|
] }),
|
|
1440
1496
|
/* @__PURE__ */ jsxs31("div", { className: "nextdoor-preview__footer--actions-item", children: [
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ jsx45(CommentIcon, {}),
|
|
1498
|
+
/* @__PURE__ */ jsx45("span", { children: __18("Comment", "social-previews") })
|
|
1443
1499
|
] }),
|
|
1444
1500
|
/* @__PURE__ */ jsxs31("div", { className: "nextdoor-preview__footer--actions-item", children: [
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1501
|
+
/* @__PURE__ */ jsx45(ShareIcon, {}),
|
|
1502
|
+
/* @__PURE__ */ jsx45("span", { children: __18("Share", "social-previews") })
|
|
1447
1503
|
] })
|
|
1448
1504
|
] });
|
|
1449
1505
|
}
|
|
1450
1506
|
|
|
1451
1507
|
// src/nextdoor-preview/icons/chevron-icon.tsx
|
|
1452
|
-
import { jsx as
|
|
1508
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1453
1509
|
function ChevronIcon() {
|
|
1454
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ jsx46("svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ jsx46(
|
|
1455
1511
|
"path",
|
|
1456
1512
|
{
|
|
1457
1513
|
fill: "#dfe1e4",
|
|
@@ -1462,9 +1518,9 @@ function ChevronIcon() {
|
|
|
1462
1518
|
}
|
|
1463
1519
|
|
|
1464
1520
|
// src/nextdoor-preview/icons/default-image.tsx
|
|
1465
|
-
import { jsx as
|
|
1521
|
+
import { jsx as jsx47, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1466
1522
|
function DefaultImage() {
|
|
1467
|
-
return /* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ jsx47("div", { className: "nextdoor-preview__default-image", children: /* @__PURE__ */ jsxs32(
|
|
1468
1524
|
"svg",
|
|
1469
1525
|
{
|
|
1470
1526
|
width: "24",
|
|
@@ -1474,14 +1530,14 @@ function DefaultImage() {
|
|
|
1474
1530
|
"aria-hidden": "true",
|
|
1475
1531
|
color: "#055c00",
|
|
1476
1532
|
children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1533
|
+
/* @__PURE__ */ jsx47(
|
|
1478
1534
|
"path",
|
|
1479
1535
|
{
|
|
1480
1536
|
fill: "currentColor",
|
|
1481
1537
|
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"
|
|
1482
1538
|
}
|
|
1483
1539
|
),
|
|
1484
|
-
/* @__PURE__ */
|
|
1540
|
+
/* @__PURE__ */ jsx47(
|
|
1485
1541
|
"path",
|
|
1486
1542
|
{
|
|
1487
1543
|
fill: "currentColor",
|
|
@@ -1494,9 +1550,9 @@ function DefaultImage() {
|
|
|
1494
1550
|
}
|
|
1495
1551
|
|
|
1496
1552
|
// src/nextdoor-preview/icons/globe-icon.tsx
|
|
1497
|
-
import { jsx as
|
|
1498
|
-
function
|
|
1499
|
-
return /* @__PURE__ */
|
|
1553
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1554
|
+
function GlobeIcon3() {
|
|
1555
|
+
return /* @__PURE__ */ jsx48("svg", { width: "14", height: "14", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsx48(
|
|
1500
1556
|
"path",
|
|
1501
1557
|
{
|
|
1502
1558
|
fill: "currentColor",
|
|
@@ -1508,7 +1564,7 @@ function GlobeIcon2() {
|
|
|
1508
1564
|
}
|
|
1509
1565
|
|
|
1510
1566
|
// src/nextdoor-preview/post-preview.tsx
|
|
1511
|
-
import { Fragment as Fragment4, jsx as
|
|
1567
|
+
import { Fragment as Fragment4, jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1512
1568
|
function NextdoorPostPreview({
|
|
1513
1569
|
image,
|
|
1514
1570
|
name,
|
|
@@ -1520,38 +1576,38 @@ function NextdoorPostPreview({
|
|
|
1520
1576
|
url
|
|
1521
1577
|
}) {
|
|
1522
1578
|
const hasMedia = !!media?.length;
|
|
1523
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__wrapper", children: /* @__PURE__ */ jsx49("section", { className: `nextdoor-preview__container ${hasMedia ? "has-media" : ""}`, children: /* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__content", children: [
|
|
1524
1580
|
/* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__header", children: [
|
|
1525
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__header--avatar", children: /* @__PURE__ */ jsx49(AvatarWithFallback, { src: profileImage }) }),
|
|
1526
1582
|
/* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__header--details", children: [
|
|
1527
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__header--name", children: name || __19("Account Name", "social-previews") }),
|
|
1528
1584
|
/* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__header--meta", children: [
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
/* @__PURE__ */
|
|
1533
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ jsx49("span", { children: neighborhood || __19("Neighborhood", "social-previews") }),
|
|
1586
|
+
/* @__PURE__ */ jsx49("span", { children: "\u2022" }),
|
|
1587
|
+
/* @__PURE__ */ jsx49("span", { children: formatNextdoorDate(Date.now()) }),
|
|
1588
|
+
/* @__PURE__ */ jsx49("span", { children: "\u2022" }),
|
|
1589
|
+
/* @__PURE__ */ jsx49(GlobeIcon3, {})
|
|
1534
1590
|
] })
|
|
1535
1591
|
] })
|
|
1536
1592
|
] }),
|
|
1537
1593
|
/* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__body", children: [
|
|
1538
1594
|
description ? /* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__caption", children: [
|
|
1539
|
-
/* @__PURE__ */
|
|
1595
|
+
/* @__PURE__ */ jsx49("span", { children: preparePreviewText(description, {
|
|
1540
1596
|
platform: "nextdoor",
|
|
1541
1597
|
maxChars: FEED_TEXT_MAX_LENGTH2
|
|
1542
1598
|
}) }),
|
|
1543
1599
|
!hasMedia && url && /* @__PURE__ */ jsxs33(Fragment4, { children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1600
|
+
/* @__PURE__ */ jsx49("br", {}),
|
|
1601
|
+
/* @__PURE__ */ jsx49("br", {}),
|
|
1602
|
+
/* @__PURE__ */ jsx49("a", { href: url, rel: "nofollow noopener noreferrer", target: "_blank", children: url })
|
|
1547
1603
|
] })
|
|
1548
1604
|
] }) : null,
|
|
1549
|
-
hasMedia ? /* @__PURE__ */
|
|
1550
|
-
return /* @__PURE__ */
|
|
1605
|
+
hasMedia ? /* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__media", children: media.map((mediaItem, index) => {
|
|
1606
|
+
return /* @__PURE__ */ jsx49(
|
|
1551
1607
|
"div",
|
|
1552
1608
|
{
|
|
1553
1609
|
className: "nextdoor-preview__media-item",
|
|
1554
|
-
children: mediaItem?.type?.startsWith("video/") ? /* @__PURE__ */
|
|
1610
|
+
children: mediaItem?.type?.startsWith("video/") ? /* @__PURE__ */ jsx49("video", { controls: true, children: /* @__PURE__ */ jsx49("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx49("img", { alt: mediaItem.alt || "", src: mediaItem.url })
|
|
1555
1611
|
},
|
|
1556
1612
|
`nextdoor-preview__media-item-${index}`
|
|
1557
1613
|
);
|
|
@@ -1563,24 +1619,24 @@ function NextdoorPostPreview({
|
|
|
1563
1619
|
"small-preview": !image || hasMedia
|
|
1564
1620
|
}),
|
|
1565
1621
|
children: [
|
|
1566
|
-
image ? /* @__PURE__ */
|
|
1622
|
+
image ? /* @__PURE__ */ jsx49("img", { className: "nextdoor-preview__image", src: image, alt: "" }) : /* @__PURE__ */ jsx49(DefaultImage, {}),
|
|
1567
1623
|
url ? /* @__PURE__ */ jsxs33("div", { className: "nextdoor-preview__description", children: [
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1624
|
+
/* @__PURE__ */ jsx49("h2", { className: "nextdoor-preview__description--title", children: title || getTitleFromDescription(description) }),
|
|
1625
|
+
/* @__PURE__ */ jsx49("span", { className: "nextdoor-preview__description--url", children: baseDomain(url) })
|
|
1570
1626
|
] }) : null,
|
|
1571
|
-
hasMedia ? /* @__PURE__ */
|
|
1627
|
+
hasMedia ? /* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__card--chevron-wrapper", children: /* @__PURE__ */ jsx49(ChevronIcon, {}) }) : null
|
|
1572
1628
|
]
|
|
1573
1629
|
}
|
|
1574
1630
|
)
|
|
1575
1631
|
] }),
|
|
1576
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx49("div", { className: "nextdoor-preview__footer", children: /* @__PURE__ */ jsx49(FooterActions, {}) })
|
|
1577
1633
|
] }) }) });
|
|
1578
1634
|
}
|
|
1579
1635
|
|
|
1580
1636
|
// src/nextdoor-preview/link-preview.tsx
|
|
1581
|
-
import { jsx as
|
|
1637
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1582
1638
|
function NextdoorLinkPreview(props) {
|
|
1583
|
-
return /* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsx50(
|
|
1584
1640
|
NextdoorPostPreview,
|
|
1585
1641
|
{
|
|
1586
1642
|
name: "",
|
|
@@ -1595,7 +1651,7 @@ function NextdoorLinkPreview(props) {
|
|
|
1595
1651
|
|
|
1596
1652
|
// src/nextdoor-preview/previews.tsx
|
|
1597
1653
|
import { __ as __20 } from "@wordpress/i18n";
|
|
1598
|
-
import { jsx as
|
|
1654
|
+
import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1599
1655
|
var NextdoorPreviews = ({
|
|
1600
1656
|
headingLevel,
|
|
1601
1657
|
hideLinkPreview,
|
|
@@ -1604,25 +1660,25 @@ var NextdoorPreviews = ({
|
|
|
1604
1660
|
}) => {
|
|
1605
1661
|
return /* @__PURE__ */ jsxs34("div", { className: "social-preview nextdoor-preview", children: [
|
|
1606
1662
|
!hidePostPreview && /* @__PURE__ */ jsxs34("section", { className: "social-preview__section nextdoor-preview__section", children: [
|
|
1607
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ jsx51(section_heading_default, {
|
|
1608
1664
|
level: headingLevel,
|
|
1609
1665
|
// translators: refers to a social post on Nextdoor
|
|
1610
1666
|
children: __20("Your post", "social-previews")
|
|
1611
1667
|
}),
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ jsx51("p", { className: "social-preview__section-desc", children: __20("This is what your social post will look like on Nextdoor:", "social-previews") }),
|
|
1669
|
+
/* @__PURE__ */ jsx51(NextdoorPostPreview, { ...props })
|
|
1614
1670
|
] }),
|
|
1615
1671
|
!hideLinkPreview && /* @__PURE__ */ jsxs34("section", { className: "social-preview__section nextdoor-preview__section", children: [
|
|
1616
|
-
/* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ jsx51(section_heading_default, {
|
|
1617
1673
|
level: headingLevel,
|
|
1618
1674
|
// translators: refers to a link to a Nextdoor post
|
|
1619
1675
|
children: __20("Link preview", "social-previews")
|
|
1620
1676
|
}),
|
|
1621
|
-
/* @__PURE__ */
|
|
1677
|
+
/* @__PURE__ */ jsx51("p", { className: "social-preview__section-desc", children: __20(
|
|
1622
1678
|
"This is what it will look like when someone shares the link to your WordPress post on Nextdoor.",
|
|
1623
1679
|
"social-previews"
|
|
1624
1680
|
) }),
|
|
1625
|
-
/* @__PURE__ */
|
|
1681
|
+
/* @__PURE__ */ jsx51(NextdoorLinkPreview, { ...props, name: "", profileImage: "" })
|
|
1626
1682
|
] })
|
|
1627
1683
|
] });
|
|
1628
1684
|
};
|
|
@@ -1631,10 +1687,10 @@ var NextdoorPreviews = ({
|
|
|
1631
1687
|
import clsx6 from "clsx";
|
|
1632
1688
|
|
|
1633
1689
|
// src/bluesky-preview/post/actions/index.tsx
|
|
1634
|
-
import { jsx as
|
|
1690
|
+
import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
1635
1691
|
var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "bluesky-preview__post-actions", children: [
|
|
1636
1692
|
/* @__PURE__ */ jsxs35("div", { children: [
|
|
1637
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ jsx52(
|
|
1638
1694
|
"svg",
|
|
1639
1695
|
{
|
|
1640
1696
|
fill: "none",
|
|
@@ -1643,7 +1699,7 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1643
1699
|
height: "18",
|
|
1644
1700
|
style: { color: "rgb(111, 134, 159)" },
|
|
1645
1701
|
"aria-hidden": "true",
|
|
1646
|
-
children: /* @__PURE__ */
|
|
1702
|
+
children: /* @__PURE__ */ jsx52(
|
|
1647
1703
|
"path",
|
|
1648
1704
|
{
|
|
1649
1705
|
fill: "hsl(211, 20%, 53%)",
|
|
@@ -1654,10 +1710,10 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1654
1710
|
)
|
|
1655
1711
|
}
|
|
1656
1712
|
),
|
|
1657
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx52("span", { children: 0 })
|
|
1658
1714
|
] }),
|
|
1659
1715
|
/* @__PURE__ */ jsxs35("div", { children: [
|
|
1660
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ jsx52(
|
|
1661
1717
|
"svg",
|
|
1662
1718
|
{
|
|
1663
1719
|
fill: "none",
|
|
@@ -1666,7 +1722,7 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1666
1722
|
height: "18",
|
|
1667
1723
|
style: { color: "rgb(111, 134, 159)" },
|
|
1668
1724
|
"aria-hidden": "true",
|
|
1669
|
-
children: /* @__PURE__ */
|
|
1725
|
+
children: /* @__PURE__ */ jsx52(
|
|
1670
1726
|
"path",
|
|
1671
1727
|
{
|
|
1672
1728
|
fill: "hsl(211, 20%, 53%)",
|
|
@@ -1677,10 +1733,10 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1677
1733
|
)
|
|
1678
1734
|
}
|
|
1679
1735
|
),
|
|
1680
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ jsx52("span", { children: 0 })
|
|
1681
1737
|
] }),
|
|
1682
1738
|
/* @__PURE__ */ jsxs35("div", { children: [
|
|
1683
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ jsx52(
|
|
1684
1740
|
"svg",
|
|
1685
1741
|
{
|
|
1686
1742
|
fill: "none",
|
|
@@ -1689,7 +1745,7 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1689
1745
|
height: "18",
|
|
1690
1746
|
style: { color: "rgb(111, 134, 159)" },
|
|
1691
1747
|
"aria-hidden": "true",
|
|
1692
|
-
children: /* @__PURE__ */
|
|
1748
|
+
children: /* @__PURE__ */ jsx52(
|
|
1693
1749
|
"path",
|
|
1694
1750
|
{
|
|
1695
1751
|
fill: "hsl(211, 20%, 53%)",
|
|
@@ -1700,9 +1756,9 @@ var BlueskyPostActions = () => /* @__PURE__ */ jsxs35("div", { className: "blues
|
|
|
1700
1756
|
)
|
|
1701
1757
|
}
|
|
1702
1758
|
),
|
|
1703
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ jsx52("span", { children: 0 })
|
|
1704
1760
|
] }),
|
|
1705
|
-
/* @__PURE__ */
|
|
1761
|
+
/* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsx52("svg", { fill: "none", viewBox: "0 0 24 24", width: "20", height: "20", "aria-hidden": "true", children: /* @__PURE__ */ jsx52(
|
|
1706
1762
|
"path",
|
|
1707
1763
|
{
|
|
1708
1764
|
fill: "hsl(211, 20%, 53%)",
|
|
@@ -1732,14 +1788,14 @@ var blueskyBody = (text, options = {}) => {
|
|
|
1732
1788
|
var blueskyUrl = (text) => firstValid(shortEnough(URL_LENGTH3), hardTruncation(URL_LENGTH3))(stripHtmlTags(text)) || "";
|
|
1733
1789
|
|
|
1734
1790
|
// src/bluesky-preview/post/body/index.tsx
|
|
1735
|
-
import { Fragment as Fragment5, jsx as
|
|
1791
|
+
import { Fragment as Fragment5, jsx as jsx53, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
1736
1792
|
var BlueskyPostBody = ({ customText, url, children, appendUrl }) => {
|
|
1737
1793
|
return /* @__PURE__ */ jsxs36("div", { className: "bluesky-preview__body", children: [
|
|
1738
1794
|
customText ? /* @__PURE__ */ jsxs36(Fragment5, { children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ jsx53("div", { children: blueskyBody(customText) }),
|
|
1740
1796
|
appendUrl && url ? /* @__PURE__ */ jsxs36(Fragment5, { children: [
|
|
1741
|
-
/* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsx53("br", {}),
|
|
1798
|
+
/* @__PURE__ */ jsx53("a", { href: url, target: "_blank", rel: "noreferrer noopener", children: blueskyUrl(url.replace(/^https?:\/\//, "")) })
|
|
1743
1799
|
] }) : null
|
|
1744
1800
|
] }) : null,
|
|
1745
1801
|
children
|
|
@@ -1748,14 +1804,14 @@ var BlueskyPostBody = ({ customText, url, children, appendUrl }) => {
|
|
|
1748
1804
|
var body_default2 = BlueskyPostBody;
|
|
1749
1805
|
|
|
1750
1806
|
// src/bluesky-preview/post/card/index.tsx
|
|
1751
|
-
import { jsx as
|
|
1807
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
1752
1808
|
var BlueskyPostCard = ({ title, description, url, image }) => {
|
|
1753
1809
|
return /* @__PURE__ */ jsxs37("div", { className: "bluesky-preview__card", children: [
|
|
1754
|
-
image ? /* @__PURE__ */
|
|
1810
|
+
image ? /* @__PURE__ */ jsx54("div", { className: "bluesky-preview__card-image", children: /* @__PURE__ */ jsx54("img", { src: image, alt: "" }) }) : null,
|
|
1755
1811
|
/* @__PURE__ */ jsxs37("div", { className: "bluesky-preview__card-text", children: [
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ jsx54("div", { className: "bluesky-preview__card-site", children: baseDomain(url) }),
|
|
1813
|
+
/* @__PURE__ */ jsx54("div", { className: "bluesky-preview__card-title", children: blueskyTitle(title) || getTitleFromDescription(description) }),
|
|
1814
|
+
/* @__PURE__ */ jsx54("div", { className: "bluesky-preview__card-description", children: stripHtmlTags(description) })
|
|
1759
1815
|
] })
|
|
1760
1816
|
] });
|
|
1761
1817
|
};
|
|
@@ -1763,7 +1819,7 @@ var card_default2 = BlueskyPostCard;
|
|
|
1763
1819
|
|
|
1764
1820
|
// src/bluesky-preview/post/header/index.tsx
|
|
1765
1821
|
import { __ as __21, _x as _x2 } from "@wordpress/i18n";
|
|
1766
|
-
import { jsx as
|
|
1822
|
+
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
1767
1823
|
var BlueskyPostHeader = ({ user }) => {
|
|
1768
1824
|
const { displayName, address } = user || {};
|
|
1769
1825
|
let handle = address || "username.bsky.social";
|
|
@@ -1772,11 +1828,11 @@ var BlueskyPostHeader = ({ user }) => {
|
|
|
1772
1828
|
}
|
|
1773
1829
|
return /* @__PURE__ */ jsxs38("div", { className: "bluesky-preview__post-header", children: [
|
|
1774
1830
|
/* @__PURE__ */ jsxs38("div", { className: "bluesky-preview__post-header-user", children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ jsx55("span", { className: "bluesky-preview__post-header--displayname", children: displayName || __21("Account name", "social-previews") }),
|
|
1832
|
+
/* @__PURE__ */ jsx55("span", { className: "bluesky-preview__post-header--username", children: handle })
|
|
1777
1833
|
] }),
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1834
|
+
/* @__PURE__ */ jsx55("div", { className: "bluesky-preview__post-header--separator", children: "\xB7" }),
|
|
1835
|
+
/* @__PURE__ */ jsx55("div", { className: "bluesky-preview__post-header--date", children: _x2(
|
|
1780
1836
|
"1h",
|
|
1781
1837
|
'refers to the time since the post was published, e.g. "1h"',
|
|
1782
1838
|
"social-previews"
|
|
@@ -1786,43 +1842,43 @@ var BlueskyPostHeader = ({ user }) => {
|
|
|
1786
1842
|
var header_default4 = BlueskyPostHeader;
|
|
1787
1843
|
|
|
1788
1844
|
// src/bluesky-preview/post/sidebar/index.tsx
|
|
1789
|
-
import { jsx as
|
|
1845
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
1790
1846
|
var BlueskyPostSidebar = ({ user }) => {
|
|
1791
1847
|
const { avatarUrl } = user || {};
|
|
1792
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ jsx56("div", { className: "bluesky-preview__post-sidebar", children: /* @__PURE__ */ jsx56("div", { className: "bluesky-preview__post-sidebar-user", children: /* @__PURE__ */ jsx56(AvatarWithFallback, { className: "bluesky-preview__post-avatar", src: avatarUrl }) }) });
|
|
1793
1849
|
};
|
|
1794
1850
|
|
|
1795
1851
|
// src/bluesky-preview/post-preview.tsx
|
|
1796
|
-
import { jsx as
|
|
1852
|
+
import { jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
1797
1853
|
var BlueskyPostPreview = (props) => {
|
|
1798
1854
|
const { user, media, appendUrl } = props;
|
|
1799
1855
|
return /* @__PURE__ */ jsxs39("div", { className: "bluesky-preview__post", children: [
|
|
1800
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ jsx57(BlueskyPostSidebar, { user }),
|
|
1801
1857
|
/* @__PURE__ */ jsxs39("div", { children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1803
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ jsx57(header_default4, { user }),
|
|
1859
|
+
/* @__PURE__ */ jsx57(body_default2, { ...props, appendUrl: appendUrl ?? Boolean(media?.length), children: media?.length ? /* @__PURE__ */ jsx57("div", { className: clsx6("bluesky-preview__media", { "as-grid": media.length > 1 }), children: media.map((mediaItem, index) => /* @__PURE__ */ jsx57(
|
|
1804
1860
|
"div",
|
|
1805
1861
|
{
|
|
1806
1862
|
className: "bluesky-preview__media-item",
|
|
1807
|
-
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */
|
|
1863
|
+
children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx57("video", { controls: true, children: /* @__PURE__ */ jsx57("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx57("img", { alt: mediaItem.alt || "", src: mediaItem.url })
|
|
1808
1864
|
},
|
|
1809
1865
|
`bluesky-preview__media-item-${index}`
|
|
1810
1866
|
)) }) : null }),
|
|
1811
|
-
!media?.length ? /* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1867
|
+
!media?.length ? /* @__PURE__ */ jsx57(card_default2, { ...props }) : null,
|
|
1868
|
+
/* @__PURE__ */ jsx57(actions_default4, {})
|
|
1813
1869
|
] })
|
|
1814
1870
|
] });
|
|
1815
1871
|
};
|
|
1816
1872
|
|
|
1817
1873
|
// src/bluesky-preview/link-preview.tsx
|
|
1818
|
-
import { jsx as
|
|
1874
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
1819
1875
|
var BlueskyLinkPreview = (props) => {
|
|
1820
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ jsx58(BlueskyPostPreview, { ...props, user: void 0, media: void 0, customText: "" });
|
|
1821
1877
|
};
|
|
1822
1878
|
|
|
1823
1879
|
// src/bluesky-preview/previews.tsx
|
|
1824
1880
|
import { __ as __22 } from "@wordpress/i18n";
|
|
1825
|
-
import { jsx as
|
|
1881
|
+
import { jsx as jsx59, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
1826
1882
|
var BlueskyPreviews = ({
|
|
1827
1883
|
headingLevel,
|
|
1828
1884
|
hidePostPreview,
|
|
@@ -1831,25 +1887,25 @@ var BlueskyPreviews = ({
|
|
|
1831
1887
|
}) => {
|
|
1832
1888
|
return /* @__PURE__ */ jsxs40("div", { className: "social-preview bluesky-preview", children: [
|
|
1833
1889
|
!hidePostPreview && /* @__PURE__ */ jsxs40("section", { className: "social-preview__section bluesky-preview__section", children: [
|
|
1834
|
-
/* @__PURE__ */
|
|
1890
|
+
/* @__PURE__ */ jsx59(SectionHeading, {
|
|
1835
1891
|
level: headingLevel,
|
|
1836
1892
|
// translators: refers to a social post on Bluesky
|
|
1837
1893
|
children: __22("Your post", "social-previews")
|
|
1838
1894
|
}),
|
|
1839
|
-
/* @__PURE__ */
|
|
1840
|
-
/* @__PURE__ */
|
|
1895
|
+
/* @__PURE__ */ jsx59("p", { className: "social-preview__section-desc", children: __22("This is what your social post will look like on Bluesky:", "social-previews") }),
|
|
1896
|
+
/* @__PURE__ */ jsx59(BlueskyPostPreview, { ...props })
|
|
1841
1897
|
] }),
|
|
1842
1898
|
!hideLinkPreview && /* @__PURE__ */ jsxs40("section", { className: "social-preview__section bluesky-preview__section", children: [
|
|
1843
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsx59(SectionHeading, {
|
|
1844
1900
|
level: headingLevel,
|
|
1845
1901
|
// translators: refers to a link to a Bluesky post
|
|
1846
1902
|
children: __22("Link preview", "social-previews")
|
|
1847
1903
|
}),
|
|
1848
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ jsx59("p", { className: "social-preview__section-desc", children: __22(
|
|
1849
1905
|
"This is what it will look like when someone shares the link to your WordPress post on Bluesky.",
|
|
1850
1906
|
"social-previews"
|
|
1851
1907
|
) }),
|
|
1852
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx59(BlueskyLinkPreview, { ...props })
|
|
1853
1909
|
] })
|
|
1854
1910
|
] });
|
|
1855
1911
|
};
|
|
@@ -1869,32 +1925,32 @@ var threadsTitle = (text) => firstValid(
|
|
|
1869
1925
|
)(stripHtmlTags(text)) || "";
|
|
1870
1926
|
|
|
1871
1927
|
// src/threads-preview/card.tsx
|
|
1872
|
-
import { jsx as
|
|
1928
|
+
import { jsx as jsx60, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
1873
1929
|
var Card2 = ({ image, title, url }) => {
|
|
1874
1930
|
const cardClassNames = clsx7({
|
|
1875
1931
|
"threads-preview__card-has-image": !!image
|
|
1876
1932
|
});
|
|
1877
|
-
return /* @__PURE__ */
|
|
1878
|
-
image && /* @__PURE__ */
|
|
1933
|
+
return /* @__PURE__ */ jsx60("div", { className: "threads-preview__card", children: /* @__PURE__ */ jsxs41("div", { className: cardClassNames, children: [
|
|
1934
|
+
image && /* @__PURE__ */ jsx60("img", { className: "threads-preview__card-image", src: image, alt: "" }),
|
|
1879
1935
|
/* @__PURE__ */ jsxs41("div", { className: "threads-preview__card-body", children: [
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
1936
|
+
/* @__PURE__ */ jsx60("div", { className: "threads-preview__card-url", children: baseDomain(url || "") }),
|
|
1937
|
+
/* @__PURE__ */ jsx60("div", { className: "threads-preview__card-title", children: threadsTitle(title) })
|
|
1882
1938
|
] })
|
|
1883
1939
|
] }) });
|
|
1884
1940
|
};
|
|
1885
1941
|
|
|
1886
1942
|
// src/threads-preview/footer.tsx
|
|
1887
|
-
import { jsx as
|
|
1943
|
+
import { jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
1888
1944
|
var Footer2 = () => {
|
|
1889
1945
|
return /* @__PURE__ */ jsxs42("div", { className: "threads-preview__footer", children: [
|
|
1890
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ jsx61("span", { className: "threads-preview__icon--like", children: /* @__PURE__ */ jsx61("svg", { role: "img", viewBox: "0 0 18 18", children: /* @__PURE__ */ jsx61(
|
|
1891
1947
|
"path",
|
|
1892
1948
|
{
|
|
1893
1949
|
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",
|
|
1894
1950
|
strokeWidth: "1.25"
|
|
1895
1951
|
}
|
|
1896
1952
|
) }) }),
|
|
1897
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ jsx61("span", { className: "threads-preview__icon--reply", children: /* @__PURE__ */ jsx61("svg", { role: "img", viewBox: "0 0 18 18", children: /* @__PURE__ */ jsx61(
|
|
1898
1954
|
"path",
|
|
1899
1955
|
{
|
|
1900
1956
|
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",
|
|
@@ -1902,12 +1958,12 @@ var Footer2 = () => {
|
|
|
1902
1958
|
strokeWidth: "1.25"
|
|
1903
1959
|
}
|
|
1904
1960
|
) }) }),
|
|
1905
|
-
/* @__PURE__ */
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1961
|
+
/* @__PURE__ */ jsx61("span", { className: "threads-preview__icon--repost", children: /* @__PURE__ */ jsxs42("svg", { role: "img", viewBox: "0 0 18 18", children: [
|
|
1962
|
+
/* @__PURE__ */ jsx61("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" }),
|
|
1963
|
+
/* @__PURE__ */ jsx61("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" })
|
|
1908
1964
|
] }) }),
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1965
|
+
/* @__PURE__ */ jsx61("span", { className: "threads-preview__icon--share", children: /* @__PURE__ */ jsxs42("svg", { role: "img", viewBox: "0 0 18 18", children: [
|
|
1966
|
+
/* @__PURE__ */ jsx61(
|
|
1911
1967
|
"path",
|
|
1912
1968
|
{
|
|
1913
1969
|
d: "M15.6097 4.09082L6.65039 9.11104",
|
|
@@ -1915,7 +1971,7 @@ var Footer2 = () => {
|
|
|
1915
1971
|
strokeWidth: "1.25"
|
|
1916
1972
|
}
|
|
1917
1973
|
),
|
|
1918
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ jsx61(
|
|
1919
1975
|
"path",
|
|
1920
1976
|
{
|
|
1921
1977
|
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",
|
|
@@ -1929,19 +1985,19 @@ var Footer2 = () => {
|
|
|
1929
1985
|
|
|
1930
1986
|
// src/threads-preview/header.tsx
|
|
1931
1987
|
import { __ as __23 } from "@wordpress/i18n";
|
|
1932
|
-
import { jsx as
|
|
1988
|
+
import { jsx as jsx62, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
1933
1989
|
var Header2 = ({ name, date }) => {
|
|
1934
1990
|
const postDate = date || /* @__PURE__ */ new Date();
|
|
1935
1991
|
return /* @__PURE__ */ jsxs43("div", { className: "threads-preview__header", children: [
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx62("span", { className: "threads-preview__name", children: name || __23("Account Name", "social-previews") }),
|
|
1993
|
+
/* @__PURE__ */ jsx62("time", { className: "threads-preview__date", dateTime: postDate.toISOString(), children: formatThreadsDate(postDate) })
|
|
1938
1994
|
] });
|
|
1939
1995
|
};
|
|
1940
1996
|
|
|
1941
1997
|
// src/threads-preview/media.tsx
|
|
1942
1998
|
import clsx8 from "clsx";
|
|
1943
1999
|
import { Fragment as Fragment6 } from "react";
|
|
1944
|
-
import { jsx as
|
|
2000
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
1945
2001
|
var Media2 = ({ media }) => {
|
|
1946
2002
|
const filteredMedia = media.filter(
|
|
1947
2003
|
(mediaItem) => mediaItem.type.startsWith("image/") || mediaItem.type.startsWith("video/")
|
|
@@ -1965,27 +2021,27 @@ var Media2 = ({ media }) => {
|
|
|
1965
2021
|
"threads-preview__media",
|
|
1966
2022
|
"threads-preview__media-children-" + filteredMedia.length
|
|
1967
2023
|
]);
|
|
1968
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ jsx63("div", { className: mediaClasses, children: filteredMedia.map((mediaItem, index) => /* @__PURE__ */ jsx63(Fragment6, { children: isVideo ? /* @__PURE__ */ jsx63("video", { controls: true, children: /* @__PURE__ */ jsx63("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx63("img", { alt: mediaItem.alt || "", src: mediaItem.url }) }, `threads-preview__media-item-${index}`)) });
|
|
1969
2025
|
};
|
|
1970
2026
|
|
|
1971
2027
|
// src/threads-preview/sidebar.tsx
|
|
1972
2028
|
import { __ as __24 } from "@wordpress/i18n";
|
|
1973
|
-
import { jsx as
|
|
2029
|
+
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
1974
2030
|
var Sidebar2 = ({ profileImage, showThreadConnector }) => {
|
|
1975
2031
|
return /* @__PURE__ */ jsxs44("div", { className: "threads-preview__sidebar", children: [
|
|
1976
|
-
/* @__PURE__ */
|
|
2032
|
+
/* @__PURE__ */ jsx64("div", { className: "threads-preview__profile-image", children: /* @__PURE__ */ jsx64(
|
|
1977
2033
|
AvatarWithFallback,
|
|
1978
2034
|
{
|
|
1979
2035
|
alt: __24("Threads profile image", "social-previews"),
|
|
1980
2036
|
src: profileImage
|
|
1981
2037
|
}
|
|
1982
2038
|
) }),
|
|
1983
|
-
showThreadConnector && /* @__PURE__ */
|
|
2039
|
+
showThreadConnector && /* @__PURE__ */ jsx64("div", { className: "threads-preview__connector" })
|
|
1984
2040
|
] });
|
|
1985
2041
|
};
|
|
1986
2042
|
|
|
1987
2043
|
// src/threads-preview/post-preview.tsx
|
|
1988
|
-
import { jsx as
|
|
2044
|
+
import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
1989
2045
|
var ThreadsPostPreview = ({
|
|
1990
2046
|
caption,
|
|
1991
2047
|
date,
|
|
@@ -1999,33 +2055,33 @@ var ThreadsPostPreview = ({
|
|
|
1999
2055
|
}) => {
|
|
2000
2056
|
const hasMedia = !!media?.length;
|
|
2001
2057
|
const displayAsCard = url && image && !hasMedia;
|
|
2002
|
-
return /* @__PURE__ */
|
|
2003
|
-
/* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsx65("div", { className: "threads-preview__wrapper", children: /* @__PURE__ */ jsxs45("div", { className: "threads-preview__container", children: [
|
|
2059
|
+
/* @__PURE__ */ jsx65(Sidebar2, { profileImage, showThreadConnector }),
|
|
2004
2060
|
/* @__PURE__ */ jsxs45("div", { className: "threads-preview__main", children: [
|
|
2005
|
-
/* @__PURE__ */
|
|
2061
|
+
/* @__PURE__ */ jsx65(Header2, { name, date }),
|
|
2006
2062
|
/* @__PURE__ */ jsxs45("div", { className: "threads-preview__content", children: [
|
|
2007
|
-
caption ? /* @__PURE__ */
|
|
2063
|
+
caption ? /* @__PURE__ */ jsx65("div", { className: "threads-preview__text", children: preparePreviewText(caption, {
|
|
2008
2064
|
platform: "threads",
|
|
2009
2065
|
maxChars: CAPTION_MAX_CHARS
|
|
2010
2066
|
}) }) : null,
|
|
2011
|
-
hasMedia ? /* @__PURE__ */
|
|
2012
|
-
displayAsCard ? /* @__PURE__ */
|
|
2067
|
+
hasMedia ? /* @__PURE__ */ jsx65(Media2, { media }) : null,
|
|
2068
|
+
displayAsCard ? /* @__PURE__ */ jsx65(Card2, { image, title: title || "", url }) : null
|
|
2013
2069
|
] }),
|
|
2014
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsx65(Footer2, {})
|
|
2015
2071
|
] })
|
|
2016
2072
|
] }) });
|
|
2017
2073
|
};
|
|
2018
2074
|
|
|
2019
2075
|
// src/threads-preview/link-preview.tsx
|
|
2020
|
-
import { jsx as
|
|
2076
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2021
2077
|
var ThreadsLinkPreview = (props) => {
|
|
2022
2078
|
if (!props.image) {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ jsx66("p", { className: "social-preview__section-desc", children: __25(
|
|
2024
2080
|
"Threads link preview requires an image to be set for the post. Please add an image to see the preview.",
|
|
2025
2081
|
"social-previews"
|
|
2026
2082
|
) });
|
|
2027
2083
|
}
|
|
2028
|
-
return /* @__PURE__ */
|
|
2084
|
+
return /* @__PURE__ */ jsx66(
|
|
2029
2085
|
ThreadsPostPreview,
|
|
2030
2086
|
{
|
|
2031
2087
|
...props,
|
|
@@ -2037,7 +2093,7 @@ var ThreadsLinkPreview = (props) => {
|
|
|
2037
2093
|
|
|
2038
2094
|
// src/threads-preview/previews.tsx
|
|
2039
2095
|
import { __ as __26 } from "@wordpress/i18n";
|
|
2040
|
-
import { Fragment as Fragment7, jsx as
|
|
2096
|
+
import { Fragment as Fragment7, jsx as jsx67, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
2041
2097
|
var ThreadsPreviews = ({
|
|
2042
2098
|
headingLevel,
|
|
2043
2099
|
hideLinkPreview,
|
|
@@ -2049,15 +2105,15 @@ var ThreadsPreviews = ({
|
|
|
2049
2105
|
}
|
|
2050
2106
|
return /* @__PURE__ */ jsxs46("div", { className: "social-preview threads-preview", children: [
|
|
2051
2107
|
!hidePostPreview && /* @__PURE__ */ jsxs46("section", { className: "social-preview__section threads-preview__section", children: [
|
|
2052
|
-
/* @__PURE__ */
|
|
2108
|
+
/* @__PURE__ */ jsx67(section_heading_default, {
|
|
2053
2109
|
level: headingLevel,
|
|
2054
2110
|
// translators: refers to a social post on Threads
|
|
2055
2111
|
children: __26("Your post", "social-previews")
|
|
2056
2112
|
}),
|
|
2057
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ jsx67("p", { className: "social-preview__section-desc", children: __26("This is what your social post will look like on Threads:", "social-previews") }),
|
|
2058
2114
|
posts.map((post, index) => {
|
|
2059
2115
|
const isLast = index + 1 === posts.length;
|
|
2060
|
-
return /* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ jsx67(
|
|
2061
2117
|
ThreadsPostPreview,
|
|
2062
2118
|
{
|
|
2063
2119
|
...post,
|
|
@@ -2068,18 +2124,18 @@ var ThreadsPreviews = ({
|
|
|
2068
2124
|
})
|
|
2069
2125
|
] }),
|
|
2070
2126
|
!hideLinkPreview ? /* @__PURE__ */ jsxs46("section", { className: "social-preview__section threads-preview__section", children: [
|
|
2071
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsx67(section_heading_default, {
|
|
2072
2128
|
level: headingLevel,
|
|
2073
2129
|
// translators: refers to a link to a Threads post
|
|
2074
2130
|
children: __26("Link preview", "social-previews")
|
|
2075
2131
|
}),
|
|
2076
2132
|
posts[0].image ? /* @__PURE__ */ jsxs46(Fragment7, { children: [
|
|
2077
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ jsx67("p", { className: "social-preview__section-desc", children: __26(
|
|
2078
2134
|
"This is what it will look like when someone shares the link to your WordPress post on Threads.",
|
|
2079
2135
|
"social-previews"
|
|
2080
2136
|
) }),
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
] }) : /* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ jsx67(ThreadsLinkPreview, { ...posts[0], name: "", profileImage: "" })
|
|
2138
|
+
] }) : /* @__PURE__ */ jsx67("p", { className: "social-preview__section-desc", children: __26(
|
|
2083
2139
|
"Threads link preview requires an image to be set for the post. Please add an image to see the preview.",
|
|
2084
2140
|
"social-previews"
|
|
2085
2141
|
) })
|
|
@@ -2094,9 +2150,9 @@ import { __ as __27 } from "@wordpress/i18n";
|
|
|
2094
2150
|
var FEED_TEXT_MAX_LENGTH3 = 520;
|
|
2095
2151
|
|
|
2096
2152
|
// src/instagram-preview/icons/bookmark.tsx
|
|
2097
|
-
import { jsx as
|
|
2153
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
2098
2154
|
var Bookmark = () => {
|
|
2099
|
-
return /* @__PURE__ */
|
|
2155
|
+
return /* @__PURE__ */ jsx68(
|
|
2100
2156
|
"svg",
|
|
2101
2157
|
{
|
|
2102
2158
|
color: "rgb(38, 38, 38)",
|
|
@@ -2105,7 +2161,7 @@ var Bookmark = () => {
|
|
|
2105
2161
|
role: "img",
|
|
2106
2162
|
viewBox: "0 0 24 24",
|
|
2107
2163
|
width: "24",
|
|
2108
|
-
children: /* @__PURE__ */
|
|
2164
|
+
children: /* @__PURE__ */ jsx68(
|
|
2109
2165
|
"polygon",
|
|
2110
2166
|
{
|
|
2111
2167
|
fill: "none",
|
|
@@ -2121,9 +2177,9 @@ var Bookmark = () => {
|
|
|
2121
2177
|
};
|
|
2122
2178
|
|
|
2123
2179
|
// src/instagram-preview/icons/comment.tsx
|
|
2124
|
-
import { jsx as
|
|
2180
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
2125
2181
|
var Comment = () => {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2182
|
+
return /* @__PURE__ */ jsx69(
|
|
2127
2183
|
"svg",
|
|
2128
2184
|
{
|
|
2129
2185
|
color: "rgb(38, 38, 38)",
|
|
@@ -2132,7 +2188,7 @@ var Comment = () => {
|
|
|
2132
2188
|
role: "img",
|
|
2133
2189
|
viewBox: "0 0 24 24",
|
|
2134
2190
|
width: "24",
|
|
2135
|
-
children: /* @__PURE__ */
|
|
2191
|
+
children: /* @__PURE__ */ jsx69(
|
|
2136
2192
|
"path",
|
|
2137
2193
|
{
|
|
2138
2194
|
d: "M20.656 17.008a9.993 9.993 0 1 0-3.59 3.615L22 22Z",
|
|
@@ -2147,9 +2203,9 @@ var Comment = () => {
|
|
|
2147
2203
|
};
|
|
2148
2204
|
|
|
2149
2205
|
// src/instagram-preview/icons/heart.tsx
|
|
2150
|
-
import { jsx as
|
|
2206
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
2151
2207
|
var Heart = () => {
|
|
2152
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ jsx70(
|
|
2153
2209
|
"svg",
|
|
2154
2210
|
{
|
|
2155
2211
|
color: "rgb(38, 38, 38)",
|
|
@@ -2158,16 +2214,16 @@ var Heart = () => {
|
|
|
2158
2214
|
role: "img",
|
|
2159
2215
|
viewBox: "0 0 24 24",
|
|
2160
2216
|
width: "24",
|
|
2161
|
-
children: /* @__PURE__ */
|
|
2217
|
+
children: /* @__PURE__ */ jsx70("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" })
|
|
2162
2218
|
}
|
|
2163
2219
|
);
|
|
2164
2220
|
};
|
|
2165
2221
|
|
|
2166
2222
|
// src/instagram-preview/icons/menu.tsx
|
|
2167
|
-
import { jsx as
|
|
2223
|
+
import { jsx as jsx71, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
2168
2224
|
var Menu = () => {
|
|
2169
2225
|
return /* @__PURE__ */ jsxs47("svg", { width: "17", height: "5", viewBox: "0 0 17 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
2170
|
-
/* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ jsx71(
|
|
2171
2227
|
"path",
|
|
2172
2228
|
{
|
|
2173
2229
|
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",
|
|
@@ -2176,7 +2232,7 @@ var Menu = () => {
|
|
|
2176
2232
|
strokeWidth: "2"
|
|
2177
2233
|
}
|
|
2178
2234
|
),
|
|
2179
|
-
/* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ jsx71(
|
|
2180
2236
|
"path",
|
|
2181
2237
|
{
|
|
2182
2238
|
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",
|
|
@@ -2185,7 +2241,7 @@ var Menu = () => {
|
|
|
2185
2241
|
strokeWidth: "2"
|
|
2186
2242
|
}
|
|
2187
2243
|
),
|
|
2188
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ jsx71(
|
|
2189
2245
|
"path",
|
|
2190
2246
|
{
|
|
2191
2247
|
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",
|
|
@@ -2198,7 +2254,7 @@ var Menu = () => {
|
|
|
2198
2254
|
};
|
|
2199
2255
|
|
|
2200
2256
|
// src/instagram-preview/icons/share.tsx
|
|
2201
|
-
import { jsx as
|
|
2257
|
+
import { jsx as jsx72, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
2202
2258
|
var Share = () => {
|
|
2203
2259
|
return /* @__PURE__ */ jsxs48(
|
|
2204
2260
|
"svg",
|
|
@@ -2210,7 +2266,7 @@ var Share = () => {
|
|
|
2210
2266
|
viewBox: "0 0 24 24",
|
|
2211
2267
|
width: "24",
|
|
2212
2268
|
children: [
|
|
2213
|
-
/* @__PURE__ */
|
|
2269
|
+
/* @__PURE__ */ jsx72(
|
|
2214
2270
|
"line",
|
|
2215
2271
|
{
|
|
2216
2272
|
fill: "none",
|
|
@@ -2223,7 +2279,7 @@ var Share = () => {
|
|
|
2223
2279
|
y2: "10.083"
|
|
2224
2280
|
}
|
|
2225
2281
|
),
|
|
2226
|
-
/* @__PURE__ */
|
|
2282
|
+
/* @__PURE__ */ jsx72(
|
|
2227
2283
|
"polygon",
|
|
2228
2284
|
{
|
|
2229
2285
|
fill: "none",
|
|
@@ -2239,7 +2295,7 @@ var Share = () => {
|
|
|
2239
2295
|
};
|
|
2240
2296
|
|
|
2241
2297
|
// src/instagram-preview/post-preview.tsx
|
|
2242
|
-
import { Fragment as Fragment8, jsx as
|
|
2298
|
+
import { Fragment as Fragment8, jsx as jsx73, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
2243
2299
|
function InstagramPostPreview({
|
|
2244
2300
|
image,
|
|
2245
2301
|
media,
|
|
@@ -2250,26 +2306,26 @@ function InstagramPostPreview({
|
|
|
2250
2306
|
}) {
|
|
2251
2307
|
const username = name || "username";
|
|
2252
2308
|
const mediaItem = media?.[0];
|
|
2253
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ jsx73("div", { className: "instagram-preview__wrapper", children: /* @__PURE__ */ jsxs49("section", { className: "instagram-preview__container", children: [
|
|
2254
2310
|
/* @__PURE__ */ jsxs49("div", { className: "instagram-preview__header", children: [
|
|
2255
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__header--avatar", children: /* @__PURE__ */ jsx73(AvatarWithFallback, { src: profileImage }) }),
|
|
2256
2312
|
/* @__PURE__ */ jsxs49("div", { className: "instagram-preview__header--profile", children: [
|
|
2257
|
-
/* @__PURE__ */
|
|
2258
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__header--profile-name", children: username }),
|
|
2314
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__header--profile-menu", children: /* @__PURE__ */ jsx73(Menu, {}) })
|
|
2259
2315
|
] })
|
|
2260
2316
|
] }),
|
|
2261
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__media", children: mediaItem ? /* @__PURE__ */ jsx73("div", { className: "instagram-preview__media-item", children: mediaItem.type.startsWith("video/") ? /* @__PURE__ */ jsx73("video", { controls: false, className: "instagram-preview__media--video", children: /* @__PURE__ */ jsx73("source", { src: mediaItem.url, type: mediaItem.type }) }) : /* @__PURE__ */ jsx73("img", { className: "instagram-preview__media--image", src: mediaItem.url, alt: "" }) }) : /* @__PURE__ */ jsx73("img", { className: "instagram-preview__media--image", src: image, alt: "" }) }),
|
|
2262
2318
|
/* @__PURE__ */ jsxs49("div", { className: "instagram-preview__content", children: [
|
|
2263
2319
|
/* @__PURE__ */ jsxs49("section", { className: "instagram-preview__content--actions", children: [
|
|
2264
2320
|
/* @__PURE__ */ jsxs49("div", { className: "instagram-preview__content--actions-primary", children: [
|
|
2265
|
-
/* @__PURE__ */
|
|
2266
|
-
/* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ jsx73(Heart, {}),
|
|
2322
|
+
/* @__PURE__ */ jsx73(Comment, {}),
|
|
2323
|
+
/* @__PURE__ */ jsx73(Share, {})
|
|
2268
2324
|
] }),
|
|
2269
|
-
/* @__PURE__ */
|
|
2325
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__content--actions-secondary", children: /* @__PURE__ */ jsx73(Bookmark, {}) })
|
|
2270
2326
|
] }),
|
|
2271
2327
|
/* @__PURE__ */ jsxs49("div", { className: "instagram-preview__content--body", children: [
|
|
2272
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__content--name", children: username }),
|
|
2273
2329
|
"\xA0",
|
|
2274
2330
|
caption ? /* @__PURE__ */ jsxs49("div", { className: "instagram-preview__content--text", children: [
|
|
2275
2331
|
preparePreviewText(caption, {
|
|
@@ -2277,36 +2333,36 @@ function InstagramPostPreview({
|
|
|
2277
2333
|
maxChars: FEED_TEXT_MAX_LENGTH3
|
|
2278
2334
|
}),
|
|
2279
2335
|
media && url && /* @__PURE__ */ jsxs49(Fragment8, { children: [
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2336
|
+
/* @__PURE__ */ jsx73("br", {}),
|
|
2337
|
+
/* @__PURE__ */ jsx73("br", {}),
|
|
2282
2338
|
url
|
|
2283
2339
|
] })
|
|
2284
2340
|
] }) : null
|
|
2285
2341
|
] }),
|
|
2286
|
-
/* @__PURE__ */
|
|
2342
|
+
/* @__PURE__ */ jsx73("div", { className: "instagram-preview__content--footer", children: /* @__PURE__ */ jsx73("span", { children: __27("View one comment", "social-previews") }) })
|
|
2287
2343
|
] })
|
|
2288
2344
|
] }) });
|
|
2289
2345
|
}
|
|
2290
2346
|
|
|
2291
2347
|
// src/instagram-preview/previews.tsx
|
|
2292
2348
|
import { __ as __28 } from "@wordpress/i18n";
|
|
2293
|
-
import { jsx as
|
|
2349
|
+
import { jsx as jsx74, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
2294
2350
|
var InstagramPreviews = ({
|
|
2295
2351
|
headingLevel,
|
|
2296
2352
|
hidePostPreview,
|
|
2297
2353
|
...props
|
|
2298
2354
|
}) => {
|
|
2299
|
-
return /* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ jsx74("div", { className: "social-preview instagram-preview", children: !hidePostPreview && /* @__PURE__ */ jsxs50("section", { className: "social-preview__section instagram-preview__section", children: [
|
|
2356
|
+
/* @__PURE__ */ jsx74(section_heading_default, {
|
|
2301
2357
|
level: headingLevel,
|
|
2302
2358
|
// translators: refers to a social post on Instagram
|
|
2303
2359
|
children: __28("Your post", "social-previews")
|
|
2304
2360
|
}),
|
|
2305
|
-
/* @__PURE__ */
|
|
2361
|
+
/* @__PURE__ */ jsx74("p", { className: "social-preview__section-desc", children: __28(
|
|
2306
2362
|
"This is what your social post will look like on Instagram:",
|
|
2307
2363
|
"social-previews"
|
|
2308
2364
|
) }),
|
|
2309
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ jsx74(InstagramPostPreview, { ...props })
|
|
2310
2366
|
] }) });
|
|
2311
2367
|
};
|
|
2312
2368
|
export {
|