@flamingo-stack/openframe-frontend-core 0.0.295 → 0.0.296-snapshot.20260621021605
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/README.md +9 -0
- package/dist/{chunk-7RIYT7ZH.js → chunk-2QG57XOJ.js} +1067 -205
- package/dist/chunk-2QG57XOJ.js.map +1 -0
- package/dist/{chunk-7KXD7CWD.js → chunk-3JIQVE7T.js} +9 -15
- package/dist/{chunk-7KXD7CWD.js.map → chunk-3JIQVE7T.js.map} +1 -1
- package/dist/{chunk-FT4FCV7L.cjs → chunk-4PSQS3SW.cjs} +7 -9
- package/dist/chunk-4PSQS3SW.cjs.map +1 -0
- package/dist/{chunk-OOKKGOPQ.js → chunk-4TLE6VLU.js} +30 -24
- package/dist/chunk-4TLE6VLU.js.map +1 -0
- package/dist/{chunk-6IBA2MQV.cjs → chunk-53FUMSZ5.cjs} +40 -46
- package/dist/chunk-53FUMSZ5.cjs.map +1 -0
- package/dist/{chunk-D3LEFMOA.cjs → chunk-54KNMC2R.cjs} +3 -3
- package/dist/{chunk-D3LEFMOA.cjs.map → chunk-54KNMC2R.cjs.map} +1 -1
- package/dist/{chunk-EYEW6PTA.cjs → chunk-6C526VNN.cjs} +358 -118
- package/dist/chunk-6C526VNN.cjs.map +1 -0
- package/dist/{chunk-5O6N3BKR.cjs → chunk-7OVGB2DQ.cjs} +19 -25
- package/dist/chunk-7OVGB2DQ.cjs.map +1 -0
- package/dist/{chunk-6GCI7JOE.js → chunk-AD6C23QY.js} +8 -7
- package/dist/{chunk-6GCI7JOE.js.map → chunk-AD6C23QY.js.map} +1 -1
- package/dist/chunk-F5OB2YAL.cjs +144 -0
- package/dist/chunk-F5OB2YAL.cjs.map +1 -0
- package/dist/chunk-FBWXMMRB.cjs +2 -0
- package/dist/chunk-FBWXMMRB.cjs.map +1 -0
- package/dist/{chunk-YIGPRLQY.cjs → chunk-FCDQNTDG.cjs} +21 -20
- package/dist/chunk-FCDQNTDG.cjs.map +1 -0
- package/dist/{chunk-XXI7BNB6.cjs → chunk-FQOTC3UU.cjs} +321 -18
- package/dist/chunk-FQOTC3UU.cjs.map +1 -0
- package/dist/{chunk-INDQMNP6.cjs → chunk-GUTS7HGA.cjs} +11658 -2146
- package/dist/chunk-GUTS7HGA.cjs.map +1 -0
- package/dist/chunk-GZ4C3XW6.js +2 -0
- package/dist/chunk-GZ4C3XW6.js.map +1 -0
- package/dist/{chunk-HOVJGXF7.js → chunk-IL47XWV5.js} +8 -14
- package/dist/{chunk-HOVJGXF7.js.map → chunk-IL47XWV5.js.map} +1 -1
- package/dist/{chunk-LCNMR277.js → chunk-IZ7JSBFP.js} +1 -1
- package/dist/chunk-IZ7JSBFP.js.map +1 -0
- package/dist/{chunk-5IJ46KAV.js → chunk-JALO4TAZ.js} +360 -57
- package/dist/chunk-JALO4TAZ.js.map +1 -0
- package/dist/{chunk-AQOWFSMB.cjs → chunk-L6PSSIUQ.cjs} +1 -1
- package/dist/chunk-L6PSSIUQ.cjs.map +1 -0
- package/dist/{chunk-J3RDKZ32.js → chunk-L7ULJKG7.js} +6 -10
- package/dist/{chunk-J3RDKZ32.js.map → chunk-L7ULJKG7.js.map} +1 -1
- package/dist/{chunk-6BZEAPNT.js → chunk-PC746XCO.js} +15120 -5608
- package/dist/chunk-PC746XCO.js.map +1 -0
- package/dist/{chunk-3ZXUQQL4.js → chunk-PI4WSYQV.js} +2 -2
- package/dist/{chunk-E4XABBSU.js → chunk-PWQUAVA3.js} +338 -98
- package/dist/chunk-PWQUAVA3.js.map +1 -0
- package/dist/chunk-SA2WPJVO.js +144 -0
- package/dist/chunk-SA2WPJVO.js.map +1 -0
- package/dist/{chunk-ETACGX2A.cjs → chunk-UNVE2SDJ.cjs} +37 -31
- package/dist/chunk-UNVE2SDJ.cjs.map +1 -0
- package/dist/{chunk-5E2HOSSH.cjs → chunk-WMSTJAZT.cjs} +913 -51
- package/dist/chunk-WMSTJAZT.cjs.map +1 -0
- package/dist/{chunk-EJXHZX2E.js → chunk-X4DOXQRT.js} +4 -6
- package/dist/{chunk-EJXHZX2E.js.map → chunk-X4DOXQRT.js.map} +1 -1
- package/dist/{chunk-A2YL7QRX.cjs → chunk-YBYI62OE.cjs} +33 -37
- package/dist/chunk-YBYI62OE.cjs.map +1 -0
- package/dist/components/case-studies/index.cjs +126 -0
- package/dist/components/case-studies/index.cjs.map +1 -0
- package/dist/components/case-studies/index.d.ts +2 -0
- package/dist/components/case-studies/index.d.ts.map +1 -0
- package/dist/components/case-studies/index.js +126 -0
- package/dist/components/case-studies/index.js.map +1 -0
- package/dist/components/case-studies/share-experience-section.d.ts +48 -0
- package/dist/components/case-studies/share-experience-section.d.ts.map +1 -0
- package/dist/components/chat/chat-container.d.ts.map +1 -1
- package/dist/components/chat/error-message-display.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +8 -18
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +75 -85
- package/dist/components/chat/types/component.types.d.ts +2 -0
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +8 -15
- package/dist/components/contact/index.cjs.map +1 -1
- package/dist/components/contact/index.js +7 -14
- package/dist/components/docs/doc-viewer.d.ts +39 -2
- package/dist/components/docs/doc-viewer.d.ts.map +1 -1
- package/dist/components/docs/docs-hub-page.d.ts +46 -0
- package/dist/components/docs/docs-hub-page.d.ts.map +1 -0
- package/dist/components/docs/index.cjs +17 -9
- package/dist/components/docs/index.cjs.map +1 -1
- package/dist/components/docs/index.d.ts +4 -0
- package/dist/components/docs/index.d.ts.map +1 -1
- package/dist/components/docs/index.js +16 -8
- package/dist/components/docs/skeletons.d.ts +32 -0
- package/dist/components/docs/skeletons.d.ts.map +1 -0
- package/dist/components/docs/use-docs-resolve-link.d.ts +20 -0
- package/dist/components/docs/use-docs-resolve-link.d.ts.map +1 -0
- package/dist/components/docs/use-document-tree.d.ts.map +1 -1
- package/dist/components/embeds/embed-container.d.ts +37 -0
- package/dist/components/embeds/embed-container.d.ts.map +1 -0
- package/dist/components/embeds/embed-iframe.d.ts.map +1 -1
- package/dist/components/embeds/file-download-card.d.ts +18 -0
- package/dist/components/embeds/file-download-card.d.ts.map +1 -0
- package/dist/components/embeds/index.cjs +38 -15
- package/dist/components/embeds/index.cjs.map +1 -1
- package/dist/components/embeds/index.d.ts +8 -0
- package/dist/components/embeds/index.d.ts.map +1 -1
- package/dist/components/embeds/index.js +40 -17
- package/dist/components/embeds/linkedin-embed-client.d.ts +8 -0
- package/dist/components/embeds/linkedin-embed-client.d.ts.map +1 -0
- package/dist/components/embeds/markdown-image.d.ts +5 -0
- package/dist/components/embeds/markdown-image.d.ts.map +1 -0
- package/dist/components/embeds/reddit-embed-client.d.ts +7 -0
- package/dist/components/embeds/reddit-embed-client.d.ts.map +1 -0
- package/dist/components/embeds/rich-markdown-runtime.d.ts +46 -0
- package/dist/components/embeds/rich-markdown-runtime.d.ts.map +1 -0
- package/dist/components/embeds/twitter-embed-client.d.ts +8 -0
- package/dist/components/embeds/twitter-embed-client.d.ts.map +1 -0
- package/dist/components/faq/index.cjs +9 -16
- package/dist/components/faq/index.cjs.map +1 -1
- package/dist/components/faq/index.js +8 -15
- package/dist/components/features/index.cjs +8 -16
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +24 -32
- package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
- package/dist/components/features/notifications/notifications-context.d.ts +5 -1
- package/dist/components/features/notifications/notifications-context.d.ts.map +1 -1
- package/dist/components/index.cjs +257 -452
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +781 -976
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/page-header.d.ts +78 -0
- package/dist/components/layout/page-header.d.ts.map +1 -0
- package/dist/components/layout/page-layout.d.ts +10 -1
- package/dist/components/layout/page-layout.d.ts.map +1 -1
- package/dist/components/layout/page-with-header.d.ts +67 -0
- package/dist/components/layout/page-with-header.d.ts.map +1 -0
- package/dist/components/layout/title-block.d.ts +17 -1
- package/dist/components/layout/title-block.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +7 -15
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +9 -17
- package/dist/components/onboarding-guides/index.cjs +35 -36
- package/dist/components/onboarding-guides/index.cjs.map +1 -1
- package/dist/components/onboarding-guides/index.js +13 -14
- package/dist/components/onboarding-guides/index.js.map +1 -1
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts +1 -1
- package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +9 -16
- package/dist/components/related-content/index.cjs.map +1 -1
- package/dist/components/related-content/index.js +8 -15
- package/dist/components/shared/dev-section/dev-section-page.d.ts +9 -0
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/dev-section/dev-section-view.d.ts.map +1 -1
- package/dist/components/shared/dev-section/index.d.ts +1 -1
- package/dist/components/shared/dev-section/index.d.ts.map +1 -1
- package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/tickets/index.cjs +100 -112
- package/dist/components/tickets/index.cjs.map +1 -1
- package/dist/components/tickets/index.js +20 -32
- package/dist/components/tickets/index.js.map +1 -1
- package/dist/components/ui/button/split-button.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +50 -52
- package/dist/components/ui/file-manager/index.cjs.map +1 -1
- package/dist/components/ui/file-manager/index.js +4 -6
- package/dist/components/ui/file-manager/index.js.map +1 -1
- package/dist/components/ui/index.cjs +13 -19
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +133 -139
- package/dist/components/ui/release-changelog-section.d.ts +6 -2
- package/dist/components/ui/release-changelog-section.d.ts.map +1 -1
- package/dist/components/ui/rich-markdown-renderer.d.ts +34 -0
- package/dist/components/ui/rich-markdown-renderer.d.ts.map +1 -0
- package/dist/components/ui/simple-markdown-renderer.d.ts +2 -8
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/contexts/chat-runtime-context.d.ts +14 -0
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +3 -3
- package/dist/contexts/index.js +5 -5
- package/dist/embed-shims/index.cjs +3 -3
- package/dist/embed-shims/index.cjs.map +1 -1
- package/dist/embed-shims/index.js +4 -4
- package/dist/hooks/index.cjs +4 -9
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +6 -11
- package/dist/index.cjs +14 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +362 -368
- package/dist/types/doc-source.d.ts +31 -1
- package/dist/types/doc-source.d.ts.map +1 -1
- package/dist/utils/index.cjs +4 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/page-header-constants.d.ts +15 -0
- package/dist/utils/page-header-constants.d.ts.map +1 -0
- package/dist/utils/social-embed-cache.d.ts +29 -0
- package/dist/utils/social-embed-cache.d.ts.map +1 -0
- package/package.json +7 -1
- package/src/components/case-studies/index.ts +4 -0
- package/src/components/case-studies/share-experience-section.tsx +185 -0
- package/src/components/chat/chat-container.tsx +5 -7
- package/src/components/chat/embeddable-chat.tsx +1 -1
- package/src/components/chat/error-message-display.tsx +49 -31
- package/src/components/chat/types/component.types.ts +2 -0
- package/src/components/docs/doc-viewer.tsx +111 -19
- package/src/components/docs/docs-hub-page.tsx +149 -0
- package/src/components/docs/index.ts +17 -0
- package/src/components/docs/skeletons.tsx +138 -0
- package/src/components/docs/use-docs-resolve-link.ts +52 -0
- package/src/components/docs/use-document-tree.ts +21 -0
- package/src/components/embeds/embed-container.tsx +80 -0
- package/src/components/embeds/embed-iframe.tsx +7 -9
- package/src/components/embeds/file-download-card.tsx +54 -0
- package/src/components/embeds/index.ts +30 -0
- package/src/components/embeds/linkedin-embed-client.tsx +100 -0
- package/src/components/embeds/markdown-image.tsx +88 -0
- package/src/components/embeds/og-link-preview.tsx +13 -13
- package/src/components/embeds/reddit-embed-client.tsx +550 -0
- package/src/components/embeds/rich-markdown-runtime.tsx +79 -0
- package/src/components/embeds/twitter-embed-client.tsx +308 -0
- package/src/components/features/notifications/notification-drawer.tsx +18 -7
- package/src/components/features/notifications/notifications-context.tsx +7 -0
- package/src/components/layout/page-header.tsx +182 -0
- package/src/components/layout/page-layout.tsx +14 -1
- package/src/components/layout/page-with-header.tsx +110 -0
- package/src/components/layout/title-block.tsx +40 -62
- package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +3 -3
- package/src/components/shared/dev-section/dev-section-page.tsx +9 -1
- package/src/components/shared/dev-section/dev-section-view.tsx +14 -9
- package/src/components/shared/dev-section/index.ts +1 -1
- package/src/components/shared/doc-search/use-doc-search.ts +7 -3
- package/src/components/shared/legal-document/legal-document-page.tsx +2 -2
- package/src/components/shared/product-release/release-detail-page.tsx +6 -4
- package/src/components/ui/button/split-button.tsx +5 -2
- package/src/components/ui/index.ts +2 -0
- package/src/components/ui/release-changelog-section.tsx +7 -2
- package/src/components/ui/rich-markdown-renderer.tsx +1203 -0
- package/src/components/ui/simple-markdown-renderer.tsx +7 -11
- package/src/contexts/chat-runtime-context.tsx +14 -0
- package/src/stories/NotificationDrawer.stories.tsx +2 -0
- package/src/types/doc-source.ts +33 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/page-header-constants.ts +15 -0
- package/src/utils/social-embed-cache.ts +391 -0
- package/dist/chunk-26PKDALD.js +0 -2379
- package/dist/chunk-26PKDALD.js.map +0 -1
- package/dist/chunk-3MCHAFHB.js +0 -89
- package/dist/chunk-3MCHAFHB.js.map +0 -1
- package/dist/chunk-3XIB4VKS.cjs +0 -619
- package/dist/chunk-3XIB4VKS.cjs.map +0 -1
- package/dist/chunk-4W7NYJ3B.cjs +0 -3009
- package/dist/chunk-4W7NYJ3B.cjs.map +0 -1
- package/dist/chunk-5E2HOSSH.cjs.map +0 -1
- package/dist/chunk-5IJ46KAV.js.map +0 -1
- package/dist/chunk-5O6N3BKR.cjs.map +0 -1
- package/dist/chunk-6BZEAPNT.js.map +0 -1
- package/dist/chunk-6IBA2MQV.cjs.map +0 -1
- package/dist/chunk-6JINAOI7.cjs +0 -311
- package/dist/chunk-6JINAOI7.cjs.map +0 -1
- package/dist/chunk-7RIYT7ZH.js.map +0 -1
- package/dist/chunk-A2YL7QRX.cjs.map +0 -1
- package/dist/chunk-AQOWFSMB.cjs.map +0 -1
- package/dist/chunk-E4XABBSU.js.map +0 -1
- package/dist/chunk-ETACGX2A.cjs.map +0 -1
- package/dist/chunk-EYEW6PTA.cjs.map +0 -1
- package/dist/chunk-FQJK446R.js +0 -1606
- package/dist/chunk-FQJK446R.js.map +0 -1
- package/dist/chunk-FT4FCV7L.cjs.map +0 -1
- package/dist/chunk-INDQMNP6.cjs.map +0 -1
- package/dist/chunk-J54Z3OCR.cjs +0 -1606
- package/dist/chunk-J54Z3OCR.cjs.map +0 -1
- package/dist/chunk-KXCRGTRN.cjs +0 -2379
- package/dist/chunk-KXCRGTRN.cjs.map +0 -1
- package/dist/chunk-LCNMR277.js.map +0 -1
- package/dist/chunk-LFGGF7OT.cjs +0 -449
- package/dist/chunk-LFGGF7OT.cjs.map +0 -1
- package/dist/chunk-M2OCXTNT.js +0 -311
- package/dist/chunk-M2OCXTNT.js.map +0 -1
- package/dist/chunk-NSPOYUBH.js +0 -3009
- package/dist/chunk-NSPOYUBH.js.map +0 -1
- package/dist/chunk-OOKKGOPQ.js.map +0 -1
- package/dist/chunk-OQ6X7ZOC.js +0 -449
- package/dist/chunk-OQ6X7ZOC.js.map +0 -1
- package/dist/chunk-POKKCWKF.js +0 -354
- package/dist/chunk-POKKCWKF.js.map +0 -1
- package/dist/chunk-TFSYSWPS.cjs +0 -89
- package/dist/chunk-TFSYSWPS.cjs.map +0 -1
- package/dist/chunk-XXI7BNB6.cjs.map +0 -1
- package/dist/chunk-YD43AKI5.js +0 -619
- package/dist/chunk-YD43AKI5.js.map +0 -1
- package/dist/chunk-YETA25JW.cjs +0 -354
- package/dist/chunk-YETA25JW.cjs.map +0 -1
- package/dist/chunk-YIGPRLQY.cjs.map +0 -1
- /package/dist/{chunk-3ZXUQQL4.js.map → chunk-PI4WSYQV.js.map} +0 -0
package/dist/chunk-YD43AKI5.js
DELETED
|
@@ -1,619 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
ToggleGroup,
|
|
4
|
-
ToggleGroupItem
|
|
5
|
-
} from "./chunk-6BZEAPNT.js";
|
|
6
|
-
import {
|
|
7
|
-
isFigmaSlidesUrl,
|
|
8
|
-
toFigmaEmbedUrl,
|
|
9
|
-
toFigmaOriginalUrl,
|
|
10
|
-
toGoogleSheetsEmbedUrl,
|
|
11
|
-
toGoogleSheetsOriginalUrl
|
|
12
|
-
} from "./chunk-26PKDALD.js";
|
|
13
|
-
import {
|
|
14
|
-
useImageEdgeColor
|
|
15
|
-
} from "./chunk-7RIYT7ZH.js";
|
|
16
|
-
import {
|
|
17
|
-
next_image_default
|
|
18
|
-
} from "./chunk-LXC6P2EO.js";
|
|
19
|
-
import {
|
|
20
|
-
Button
|
|
21
|
-
} from "./chunk-5IJ46KAV.js";
|
|
22
|
-
import {
|
|
23
|
-
AdobePdfIcon,
|
|
24
|
-
FigmaIcon,
|
|
25
|
-
GoogleSheetsIcon
|
|
26
|
-
} from "./chunk-J7AV6H63.js";
|
|
27
|
-
|
|
28
|
-
// src/components/embeds/embed-iframe.tsx
|
|
29
|
-
import { useState, useCallback, useRef, useEffect } from "react";
|
|
30
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
-
function EmbedLoadingSkeleton({ height }) {
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
"div",
|
|
34
|
-
{
|
|
35
|
-
className: "w-full rounded-lg border border-ods-border overflow-hidden bg-ods-skeleton animate-pulse",
|
|
36
|
-
style: { height: height || "calc(100vh - 250px)" },
|
|
37
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center h-full gap-4", children: [
|
|
38
|
-
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-ods-card" }),
|
|
39
|
-
/* @__PURE__ */ jsx("div", { className: "h-4 w-48 rounded bg-ods-card" }),
|
|
40
|
-
/* @__PURE__ */ jsx("div", { className: "h-3 w-32 rounded bg-ods-card" })
|
|
41
|
-
] })
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function EmbedIframe({
|
|
46
|
-
src,
|
|
47
|
-
title,
|
|
48
|
-
className,
|
|
49
|
-
height,
|
|
50
|
-
allow,
|
|
51
|
-
referrerPolicy,
|
|
52
|
-
loading,
|
|
53
|
-
allowFullScreen
|
|
54
|
-
}) {
|
|
55
|
-
const [isLoaded, setIsLoaded] = useState(false);
|
|
56
|
-
const iframeRef = useRef(null);
|
|
57
|
-
const handleLoad = useCallback(() => setIsLoaded(true), []);
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
setIsLoaded(false);
|
|
60
|
-
}, [src]);
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
const iframe = iframeRef.current;
|
|
63
|
-
return () => {
|
|
64
|
-
if (iframe) {
|
|
65
|
-
try {
|
|
66
|
-
iframe.src = "about:blank";
|
|
67
|
-
} catch {
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}, [src]);
|
|
72
|
-
const resolvedHeight = height || "calc(100vh - 250px)";
|
|
73
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
-
!isLoaded && /* @__PURE__ */ jsx(EmbedLoadingSkeleton, { height: resolvedHeight }),
|
|
75
|
-
/* @__PURE__ */ jsx(
|
|
76
|
-
"div",
|
|
77
|
-
{
|
|
78
|
-
className: `w-full rounded-lg border border-ods-border overflow-hidden ${!isLoaded ? "h-0 overflow-hidden" : ""} ${className || ""}`,
|
|
79
|
-
style: isLoaded ? { height: resolvedHeight } : void 0,
|
|
80
|
-
children: /* @__PURE__ */ jsx(
|
|
81
|
-
"iframe",
|
|
82
|
-
{
|
|
83
|
-
ref: iframeRef,
|
|
84
|
-
src,
|
|
85
|
-
className: "w-full h-full border-0",
|
|
86
|
-
title,
|
|
87
|
-
onLoad: handleLoad,
|
|
88
|
-
allow,
|
|
89
|
-
referrerPolicy,
|
|
90
|
-
loading,
|
|
91
|
-
allowFullScreen: allow?.includes("fullscreen") ? void 0 : allowFullScreen
|
|
92
|
-
},
|
|
93
|
-
src
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
)
|
|
97
|
-
] });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// src/components/embeds/pdf-viewer.tsx
|
|
101
|
-
import { Download, Eye } from "lucide-react";
|
|
102
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
103
|
-
function PdfViewer({ src, fileName, onPreview, onDownload, height }) {
|
|
104
|
-
const displayName = fileName || "PDF Document";
|
|
105
|
-
if (!src) {
|
|
106
|
-
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
107
|
-
/* @__PURE__ */ jsx2(AdobePdfIcon, { className: "w-16 h-16 text-ods-text-secondary mb-4" }),
|
|
108
|
-
/* @__PURE__ */ jsx2("p", { className: "text-ods-text-secondary", children: "PDF file not available" })
|
|
109
|
-
] });
|
|
110
|
-
}
|
|
111
|
-
return /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
|
|
112
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
113
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
114
|
-
/* @__PURE__ */ jsx2(AdobePdfIcon, { className: "w-5 h-5 shrink-0" }),
|
|
115
|
-
/* @__PURE__ */ jsx2("h2", { className: "text-xl font-semibold text-ods-text-primary truncate", children: displayName })
|
|
116
|
-
] }),
|
|
117
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 w-full sm:w-auto", children: [
|
|
118
|
-
/* @__PURE__ */ jsx2(
|
|
119
|
-
Button,
|
|
120
|
-
{
|
|
121
|
-
variant: "outline",
|
|
122
|
-
size: "small-legacy",
|
|
123
|
-
href: onPreview ? void 0 : src,
|
|
124
|
-
openInNewTab: !onPreview,
|
|
125
|
-
onClick: onPreview,
|
|
126
|
-
leftIcon: /* @__PURE__ */ jsx2(Eye, { className: "w-4 h-4" }),
|
|
127
|
-
className: "flex-1 sm:flex-initial",
|
|
128
|
-
children: "Preview"
|
|
129
|
-
}
|
|
130
|
-
),
|
|
131
|
-
/* @__PURE__ */ jsx2(
|
|
132
|
-
Button,
|
|
133
|
-
{
|
|
134
|
-
variant: "outline",
|
|
135
|
-
size: "small-legacy",
|
|
136
|
-
href: onDownload ? void 0 : src,
|
|
137
|
-
openInNewTab: !onDownload,
|
|
138
|
-
onClick: onDownload,
|
|
139
|
-
leftIcon: /* @__PURE__ */ jsx2(Download, { className: "w-4 h-4" }),
|
|
140
|
-
className: "flex-1 sm:flex-initial",
|
|
141
|
-
children: "Download"
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
] })
|
|
145
|
-
] }),
|
|
146
|
-
/* @__PURE__ */ jsx2(EmbedIframe, { src, title: displayName, height })
|
|
147
|
-
] });
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// src/components/embeds/google-sheets-viewer.tsx
|
|
151
|
-
import { ExternalLink } from "lucide-react";
|
|
152
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
153
|
-
function GoogleSheetsViewer({ externalUrl, fileName, height }) {
|
|
154
|
-
const displayName = fileName || "Google Sheet";
|
|
155
|
-
if (!externalUrl) {
|
|
156
|
-
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
157
|
-
/* @__PURE__ */ jsx3(GoogleSheetsIcon, { className: "w-16 h-16 text-ods-text-secondary mb-4" }),
|
|
158
|
-
/* @__PURE__ */ jsx3("p", { className: "text-ods-text-secondary", children: "Google Sheet URL not configured" })
|
|
159
|
-
] });
|
|
160
|
-
}
|
|
161
|
-
return /* @__PURE__ */ jsxs3("div", { className: "space-y-4", children: [
|
|
162
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
163
|
-
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
164
|
-
/* @__PURE__ */ jsx3(GoogleSheetsIcon, { className: "w-5 h-5 shrink-0" }),
|
|
165
|
-
/* @__PURE__ */ jsx3("h2", { className: "text-xl font-semibold text-ods-text-primary truncate", children: displayName })
|
|
166
|
-
] }),
|
|
167
|
-
/* @__PURE__ */ jsx3(
|
|
168
|
-
Button,
|
|
169
|
-
{
|
|
170
|
-
variant: "outline",
|
|
171
|
-
size: "small-legacy",
|
|
172
|
-
href: toGoogleSheetsOriginalUrl(externalUrl),
|
|
173
|
-
openInNewTab: true,
|
|
174
|
-
leftIcon: /* @__PURE__ */ jsx3(GoogleSheetsIcon, { className: "w-4 h-4" }),
|
|
175
|
-
rightIcon: /* @__PURE__ */ jsx3(ExternalLink, { className: "w-4 h-4" }),
|
|
176
|
-
className: "w-full sm:w-auto",
|
|
177
|
-
children: "Open in Google Sheets"
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
] }),
|
|
181
|
-
/* @__PURE__ */ jsx3(
|
|
182
|
-
EmbedIframe,
|
|
183
|
-
{
|
|
184
|
-
src: toGoogleSheetsEmbedUrl(externalUrl),
|
|
185
|
-
title: displayName,
|
|
186
|
-
height
|
|
187
|
-
}
|
|
188
|
-
)
|
|
189
|
-
] });
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/components/embeds/figma-embed.tsx
|
|
193
|
-
import { useState as useState2 } from "react";
|
|
194
|
-
import { ExternalLink as ExternalLink2, Play, LayoutGrid } from "lucide-react";
|
|
195
|
-
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
196
|
-
function SlidesViewToggle({
|
|
197
|
-
view,
|
|
198
|
-
onChange
|
|
199
|
-
}) {
|
|
200
|
-
const options = [
|
|
201
|
-
{ key: "present", label: "Present", Icon: Play },
|
|
202
|
-
{ key: "browse", label: "Browse", Icon: LayoutGrid }
|
|
203
|
-
];
|
|
204
|
-
return /* @__PURE__ */ jsx4(
|
|
205
|
-
ToggleGroup,
|
|
206
|
-
{
|
|
207
|
-
type: "single",
|
|
208
|
-
value: view,
|
|
209
|
-
onValueChange: (v) => {
|
|
210
|
-
if (v && v !== view) onChange(v);
|
|
211
|
-
},
|
|
212
|
-
"aria-label": "Figma slides view mode",
|
|
213
|
-
className: "flex shrink-0 items-center gap-0.5 rounded-lg border border-ods-border bg-ods-card p-0.5",
|
|
214
|
-
children: options.map(({ key, label, Icon }) => {
|
|
215
|
-
const active = view === key;
|
|
216
|
-
return /* @__PURE__ */ jsxs4(
|
|
217
|
-
ToggleGroupItem,
|
|
218
|
-
{
|
|
219
|
-
value: key,
|
|
220
|
-
"aria-label": label,
|
|
221
|
-
className: `flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm font-medium transition-colors ${active ? "bg-ods-accent text-ods-text-on-accent" : "text-ods-text-secondary hover:text-ods-text-primary hover:bg-ods-bg-hover"}`,
|
|
222
|
-
children: [
|
|
223
|
-
/* @__PURE__ */ jsx4(Icon, { className: "h-4 w-4 shrink-0" }),
|
|
224
|
-
label
|
|
225
|
-
]
|
|
226
|
-
},
|
|
227
|
-
key
|
|
228
|
-
);
|
|
229
|
-
})
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
function FigmaEmbed({ url, title, height, loading = "lazy" }) {
|
|
234
|
-
const [view, setView] = useState2("present");
|
|
235
|
-
const isSlides = url ? isFigmaSlidesUrl(url) : false;
|
|
236
|
-
const embedSrc = url ? toFigmaEmbedUrl(url, { slidesView: view }) : null;
|
|
237
|
-
const originalUrl = (() => {
|
|
238
|
-
if (!url) return null;
|
|
239
|
-
try {
|
|
240
|
-
const parsed = new URL(toFigmaOriginalUrl(url));
|
|
241
|
-
const host = parsed.hostname.toLowerCase();
|
|
242
|
-
const okHost = host === "figma.com" || host.endsWith(".figma.com");
|
|
243
|
-
const okProtocol = parsed.protocol === "https:" || parsed.protocol === "http:";
|
|
244
|
-
return okHost && okProtocol ? parsed.toString() : null;
|
|
245
|
-
} catch {
|
|
246
|
-
return null;
|
|
247
|
-
}
|
|
248
|
-
})();
|
|
249
|
-
const heading = title || "Figma Design";
|
|
250
|
-
return /* @__PURE__ */ jsxs4("div", { className: "my-6 space-y-3", children: [
|
|
251
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
252
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
253
|
-
/* @__PURE__ */ jsx4(FigmaIcon, { className: "w-5 h-5 shrink-0" }),
|
|
254
|
-
/* @__PURE__ */ jsx4("span", { className: "font-sans text-base font-semibold text-ods-text-primary truncate", children: heading })
|
|
255
|
-
] }),
|
|
256
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-center", children: [
|
|
257
|
-
isSlides && embedSrc && /* @__PURE__ */ jsx4(SlidesViewToggle, { view, onChange: setView }),
|
|
258
|
-
originalUrl && /* @__PURE__ */ jsx4(
|
|
259
|
-
Button,
|
|
260
|
-
{
|
|
261
|
-
variant: "outline",
|
|
262
|
-
size: "small-legacy",
|
|
263
|
-
href: originalUrl,
|
|
264
|
-
openInNewTab: true,
|
|
265
|
-
leftIcon: /* @__PURE__ */ jsx4(FigmaIcon, { className: "w-4 h-4" }),
|
|
266
|
-
rightIcon: /* @__PURE__ */ jsx4(ExternalLink2, { className: "w-4 h-4" }),
|
|
267
|
-
className: "w-full sm:w-auto",
|
|
268
|
-
children: "Open in Figma"
|
|
269
|
-
}
|
|
270
|
-
)
|
|
271
|
-
] })
|
|
272
|
-
] }),
|
|
273
|
-
embedSrc ? /* @__PURE__ */ jsx4(
|
|
274
|
-
EmbedIframe,
|
|
275
|
-
{
|
|
276
|
-
src: embedSrc,
|
|
277
|
-
title: heading,
|
|
278
|
-
allow: "clipboard-write; clipboard-read; fullscreen",
|
|
279
|
-
loading,
|
|
280
|
-
height,
|
|
281
|
-
allowFullScreen: true
|
|
282
|
-
}
|
|
283
|
-
) : /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
284
|
-
/* @__PURE__ */ jsx4(FigmaIcon, { className: "w-16 h-16 text-ods-text-secondary mb-4" }),
|
|
285
|
-
/* @__PURE__ */ jsx4("p", { className: "text-ods-text-secondary", children: "Figma URL not configured" })
|
|
286
|
-
] })
|
|
287
|
-
] });
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// src/components/embeds/og-link-preview.tsx
|
|
291
|
-
import { useState as useState3, useEffect as useEffect2, Component } from "react";
|
|
292
|
-
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
293
|
-
var OGLinkErrorBoundary = class extends Component {
|
|
294
|
-
constructor(props) {
|
|
295
|
-
super(props);
|
|
296
|
-
this.state = { hasError: false };
|
|
297
|
-
}
|
|
298
|
-
static getDerivedStateFromError() {
|
|
299
|
-
return { hasError: true };
|
|
300
|
-
}
|
|
301
|
-
componentDidCatch(error, errorInfo) {
|
|
302
|
-
console.warn("Link preview error caught by boundary:", error, errorInfo);
|
|
303
|
-
}
|
|
304
|
-
render() {
|
|
305
|
-
if (this.state.hasError) return this.props.fallback;
|
|
306
|
-
return this.props.children;
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
function getDomain(urlStr) {
|
|
310
|
-
try {
|
|
311
|
-
return new URL(urlStr).hostname.replace("www.", "");
|
|
312
|
-
} catch {
|
|
313
|
-
return "External Link";
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
function domainToTitle(domain) {
|
|
317
|
-
return domain.split(".")[0].replace(/-/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
318
|
-
}
|
|
319
|
-
var ExternalLinkIcon = ({ size = 16 }) => /* @__PURE__ */ jsx5("svg", { width: size, height: size, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", className: "text-ods-text-secondary group-hover:text-ods-accent transition-colors flex-shrink-0", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) });
|
|
320
|
-
var Favicon = ({ src, size = "w-6 h-6" }) => /* @__PURE__ */ jsx5("img", { src, alt: "", className: size, onError: (e) => {
|
|
321
|
-
e.target.style.display = "none";
|
|
322
|
-
} });
|
|
323
|
-
var OGLinkPreview = ({
|
|
324
|
-
url,
|
|
325
|
-
apiBaseUrl,
|
|
326
|
-
ogEndpointPath = "/api/blog/og-scraper",
|
|
327
|
-
buildPlaceholderUrl,
|
|
328
|
-
fallbackTitle,
|
|
329
|
-
fallbackDescription,
|
|
330
|
-
fallbackImage,
|
|
331
|
-
publicationName,
|
|
332
|
-
publicationLogo,
|
|
333
|
-
variant = "default",
|
|
334
|
-
enablePlaceholder = true
|
|
335
|
-
}) => {
|
|
336
|
-
const [ogData, setOgData] = useState3(null);
|
|
337
|
-
const [loading, setLoading] = useState3(true);
|
|
338
|
-
const [error, setError] = useState3(false);
|
|
339
|
-
const [imageError, setImageError] = useState3(false);
|
|
340
|
-
const [originalImageError, setOriginalImageError] = useState3(false);
|
|
341
|
-
const [fallbackImageError, setFallbackImageError] = useState3(false);
|
|
342
|
-
let isValidUrl = true;
|
|
343
|
-
let isLocalhost = false;
|
|
344
|
-
try {
|
|
345
|
-
if (url && typeof url === "string") {
|
|
346
|
-
const urlObj = new URL(url);
|
|
347
|
-
if (["localhost", "127.0.0.1", "0.0.0.0"].includes(urlObj.hostname) || urlObj.hostname.startsWith("192.168.") || urlObj.hostname.startsWith("10.") || urlObj.hostname.startsWith("172.")) {
|
|
348
|
-
isLocalhost = true;
|
|
349
|
-
}
|
|
350
|
-
} else {
|
|
351
|
-
isValidUrl = false;
|
|
352
|
-
}
|
|
353
|
-
} catch {
|
|
354
|
-
isValidUrl = false;
|
|
355
|
-
}
|
|
356
|
-
useEffect2(() => {
|
|
357
|
-
if (!isValidUrl || isLocalhost) return;
|
|
358
|
-
const fetchOGData = async () => {
|
|
359
|
-
try {
|
|
360
|
-
new URL(url);
|
|
361
|
-
setLoading(true);
|
|
362
|
-
const endpoint = `${apiBaseUrl ?? ""}${ogEndpointPath}?url=${encodeURIComponent(url)}`;
|
|
363
|
-
const response = await fetch(endpoint);
|
|
364
|
-
if (response.ok) {
|
|
365
|
-
const data = await response.json();
|
|
366
|
-
if (data?.title && data.title !== "Link Preview Unavailable") {
|
|
367
|
-
setOgData(data);
|
|
368
|
-
} else {
|
|
369
|
-
setError(true);
|
|
370
|
-
}
|
|
371
|
-
} else {
|
|
372
|
-
setError(true);
|
|
373
|
-
}
|
|
374
|
-
} catch {
|
|
375
|
-
setError(true);
|
|
376
|
-
} finally {
|
|
377
|
-
setLoading(false);
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
fetchOGData();
|
|
381
|
-
}, [url, isValidUrl, isLocalhost, apiBaseUrl, ogEndpointPath]);
|
|
382
|
-
const isCompact = variant === "compact";
|
|
383
|
-
const domain = getDomain(url);
|
|
384
|
-
const effectiveData = ogData ?? (error ? {
|
|
385
|
-
title: fallbackTitle || domainToTitle(domain),
|
|
386
|
-
description: fallbackDescription || domain,
|
|
387
|
-
image: "",
|
|
388
|
-
url,
|
|
389
|
-
siteName: publicationName || domain,
|
|
390
|
-
type: "website",
|
|
391
|
-
favicon: `https://www.google.com/s2/favicons?domain=${domain}&sz=32`
|
|
392
|
-
} : null);
|
|
393
|
-
const placeholderImageUrl = enablePlaceholder && buildPlaceholderUrl && effectiveData?.title ? buildPlaceholderUrl(effectiveData.title, effectiveData.siteName || domain) : null;
|
|
394
|
-
const resolvedImageUrl = effectiveData?.image && !imageError ? effectiveData.image : effectiveData?.originalImage && !originalImageError ? effectiveData.originalImage : fallbackImage && !fallbackImageError ? fallbackImage : placeholderImageUrl;
|
|
395
|
-
const hasImage = !!resolvedImageUrl;
|
|
396
|
-
const isFallbackImage = resolvedImageUrl === fallbackImage;
|
|
397
|
-
const isPlaceholder = resolvedImageUrl === placeholderImageUrl && !isFallbackImage;
|
|
398
|
-
const bgColor = useImageEdgeColor(resolvedImageUrl ?? null, "var(--ods-bg-secondary)");
|
|
399
|
-
const renderSkeleton = () => isCompact ? /* @__PURE__ */ jsx5("div", { className: "my-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex flex-row border border-ods-border rounded-lg overflow-hidden bg-ods-card h-[120px]", children: [
|
|
400
|
-
/* @__PURE__ */ jsx5("div", { className: "w-[200px] h-full flex-shrink-0 bg-ods-skeleton animate-pulse" }),
|
|
401
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 p-3 flex flex-col justify-center", children: [
|
|
402
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse h-4 w-3/4 mb-2" }),
|
|
403
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse h-3 w-full mb-1" }),
|
|
404
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse h-3 w-2/3 mb-2" }),
|
|
405
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse h-3 w-1/3" })
|
|
406
|
-
] })
|
|
407
|
-
] }) }) : /* @__PURE__ */ jsx5("div", { className: "my-6", children: /* @__PURE__ */ jsxs5("div", { className: "block border border-ods-border rounded-lg overflow-hidden bg-ods-card", children: [
|
|
408
|
-
/* @__PURE__ */ jsx5("div", { className: "aspect-video w-full bg-ods-skeleton overflow-hidden relative animate-pulse" }),
|
|
409
|
-
/* @__PURE__ */ jsx5("div", { className: "p-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-3", children: [
|
|
410
|
-
/* @__PURE__ */ jsx5("div", { className: "w-6 h-6 bg-ods-skeleton rounded flex-shrink-0 mt-0.5 animate-pulse" }),
|
|
411
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
|
|
412
|
-
/* @__PURE__ */ jsxs5("div", { className: "h-[2.5rem] leading-[1.25rem] mb-2 overflow-hidden", children: [
|
|
413
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse", style: { height: "1.25rem", marginBottom: "0.25rem" } }),
|
|
414
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse w-3/4", style: { height: "1.25rem" } })
|
|
415
|
-
] }),
|
|
416
|
-
/* @__PURE__ */ jsxs5("div", { className: "h-[2.5rem] leading-[1.25rem] mb-2 overflow-hidden", children: [
|
|
417
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse", style: { height: "1.25rem", marginBottom: "0.25rem" } }),
|
|
418
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse w-5/6", style: { height: "1.25rem" } })
|
|
419
|
-
] }),
|
|
420
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2", children: [
|
|
421
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse", style: { height: "0.75rem", width: "6rem" } }),
|
|
422
|
-
/* @__PURE__ */ jsx5("div", { className: "bg-ods-skeleton rounded animate-pulse", style: { height: "0.75rem", width: "5rem" } })
|
|
423
|
-
] })
|
|
424
|
-
] })
|
|
425
|
-
] }) })
|
|
426
|
-
] }) });
|
|
427
|
-
if (!url || typeof url !== "string" || !isValidUrl) return renderSkeleton();
|
|
428
|
-
if (isLocalhost) {
|
|
429
|
-
return /* @__PURE__ */ jsx5("div", { className: "my-6", children: /* @__PURE__ */ jsxs5(
|
|
430
|
-
"a",
|
|
431
|
-
{
|
|
432
|
-
href: url,
|
|
433
|
-
target: "_blank",
|
|
434
|
-
rel: "noopener noreferrer",
|
|
435
|
-
className: "inline-flex items-center gap-2 text-ods-accent hover:text-ods-accent-hover transition-colors",
|
|
436
|
-
children: [
|
|
437
|
-
/* @__PURE__ */ jsx5("span", { className: "underline", children: url }),
|
|
438
|
-
/* @__PURE__ */ jsx5(ExternalLinkIcon, { size: 14 })
|
|
439
|
-
]
|
|
440
|
-
}
|
|
441
|
-
) });
|
|
442
|
-
}
|
|
443
|
-
if (loading) return renderSkeleton();
|
|
444
|
-
if (!effectiveData) return renderSkeleton();
|
|
445
|
-
const title = fallbackTitle || effectiveData.title;
|
|
446
|
-
const description = fallbackDescription || effectiveData.description || "";
|
|
447
|
-
const ogDomain = getDomain(effectiveData.url);
|
|
448
|
-
const faviconSrc = effectiveData.favicon || `https://www.google.com/s2/favicons?domain=${ogDomain}&sz=32`;
|
|
449
|
-
const logoSrc = publicationLogo || faviconSrc;
|
|
450
|
-
const handleImageError = () => {
|
|
451
|
-
if (effectiveData.image && !imageError) setImageError(true);
|
|
452
|
-
else if (effectiveData.originalImage && !originalImageError) setOriginalImageError(true);
|
|
453
|
-
else setFallbackImageError(true);
|
|
454
|
-
};
|
|
455
|
-
const renderImage = () => {
|
|
456
|
-
if (!resolvedImageUrl) return null;
|
|
457
|
-
if (isPlaceholder) {
|
|
458
|
-
return /* @__PURE__ */ jsx5(
|
|
459
|
-
"img",
|
|
460
|
-
{
|
|
461
|
-
src: resolvedImageUrl,
|
|
462
|
-
alt: title,
|
|
463
|
-
className: "absolute inset-0 w-full h-full object-cover rounded-md"
|
|
464
|
-
}
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
|
-
if (isFallbackImage) {
|
|
468
|
-
return /* @__PURE__ */ jsx5(
|
|
469
|
-
next_image_default,
|
|
470
|
-
{
|
|
471
|
-
src: resolvedImageUrl,
|
|
472
|
-
alt: title,
|
|
473
|
-
fill: true,
|
|
474
|
-
className: "object-contain rounded-md group-hover:scale-105 transition-transform duration-300",
|
|
475
|
-
onError: handleImageError,
|
|
476
|
-
unoptimized: resolvedImageUrl.includes("/render/image/")
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
return /* @__PURE__ */ jsx5(
|
|
481
|
-
"img",
|
|
482
|
-
{
|
|
483
|
-
src: resolvedImageUrl,
|
|
484
|
-
alt: title,
|
|
485
|
-
className: "absolute inset-0 w-full h-full object-contain rounded-md group-hover:scale-105 transition-transform duration-300",
|
|
486
|
-
onError: handleImageError
|
|
487
|
-
}
|
|
488
|
-
);
|
|
489
|
-
};
|
|
490
|
-
if (isCompact) {
|
|
491
|
-
if (!hasImage) {
|
|
492
|
-
return /* @__PURE__ */ jsx5("div", { className: "my-4", children: /* @__PURE__ */ jsxs5(
|
|
493
|
-
"a",
|
|
494
|
-
{
|
|
495
|
-
href: effectiveData.url,
|
|
496
|
-
target: "_blank",
|
|
497
|
-
rel: "noopener noreferrer",
|
|
498
|
-
className: "flex flex-row items-center gap-3 border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-all duration-200 group px-4 py-3",
|
|
499
|
-
children: [
|
|
500
|
-
/* @__PURE__ */ jsx5("div", { className: "w-8 h-8 bg-ods-bg-secondary rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx5(Favicon, { src: faviconSrc, size: "w-5 h-5" }) }),
|
|
501
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
|
|
502
|
-
/* @__PURE__ */ jsx5("h3", { className: "font-sans text-sm font-semibold text-ods-text-primary group-hover:text-ods-accent transition-colors truncate", children: title }),
|
|
503
|
-
description && /* @__PURE__ */ jsx5("p", { className: "font-sans text-xs text-ods-text-secondary truncate", children: description })
|
|
504
|
-
] }),
|
|
505
|
-
/* @__PURE__ */ jsx5(ExternalLinkIcon, { size: 14 })
|
|
506
|
-
]
|
|
507
|
-
}
|
|
508
|
-
) });
|
|
509
|
-
}
|
|
510
|
-
return /* @__PURE__ */ jsx5("div", { className: "my-4", children: /* @__PURE__ */ jsxs5(
|
|
511
|
-
"a",
|
|
512
|
-
{
|
|
513
|
-
href: effectiveData.url,
|
|
514
|
-
target: "_blank",
|
|
515
|
-
rel: "noopener noreferrer",
|
|
516
|
-
className: "flex flex-row border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-colors group h-[120px]",
|
|
517
|
-
children: [
|
|
518
|
-
/* @__PURE__ */ jsx5("div", { className: "w-[200px] h-full flex-shrink-0 overflow-hidden relative flex items-center justify-center rounded-lg transition-colors duration-300", style: { backgroundColor: bgColor }, children: renderImage() }),
|
|
519
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 p-3 flex flex-col justify-center min-w-0", children: [
|
|
520
|
-
/* @__PURE__ */ jsx5(
|
|
521
|
-
"h3",
|
|
522
|
-
{
|
|
523
|
-
className: "font-sans text-sm font-semibold text-ods-text-primary overflow-hidden group-hover:text-ods-accent transition-colors",
|
|
524
|
-
style: { display: "-webkit-box", WebkitLineClamp: 1, WebkitBoxOrient: "vertical" },
|
|
525
|
-
children: title
|
|
526
|
-
}
|
|
527
|
-
),
|
|
528
|
-
description && /* @__PURE__ */ jsx5(
|
|
529
|
-
"p",
|
|
530
|
-
{
|
|
531
|
-
className: "font-sans text-xs text-ods-text-secondary overflow-hidden mt-1",
|
|
532
|
-
style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" },
|
|
533
|
-
children: description
|
|
534
|
-
}
|
|
535
|
-
),
|
|
536
|
-
/* @__PURE__ */ jsx5("div", { className: "text-xs text-ods-text-secondary mt-1 truncate", children: effectiveData.siteName || ogDomain })
|
|
537
|
-
] })
|
|
538
|
-
]
|
|
539
|
-
}
|
|
540
|
-
) });
|
|
541
|
-
}
|
|
542
|
-
if (!hasImage) {
|
|
543
|
-
return /* @__PURE__ */ jsx5("div", { className: "my-6", children: /* @__PURE__ */ jsxs5(
|
|
544
|
-
"a",
|
|
545
|
-
{
|
|
546
|
-
href: effectiveData.url,
|
|
547
|
-
target: "_blank",
|
|
548
|
-
rel: "noopener noreferrer",
|
|
549
|
-
className: "flex items-center gap-3 border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-all duration-200 group px-4 py-3",
|
|
550
|
-
children: [
|
|
551
|
-
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 bg-ods-bg-secondary rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx5(Favicon, { src: faviconSrc }) }),
|
|
552
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
|
|
553
|
-
/* @__PURE__ */ jsx5("h3", { className: "font-sans font-semibold text-ods-text-primary text-base group-hover:text-ods-accent transition-colors truncate", children: title }),
|
|
554
|
-
description && /* @__PURE__ */ jsx5("p", { className: "font-sans text-sm text-ods-text-secondary truncate", children: description })
|
|
555
|
-
] }),
|
|
556
|
-
/* @__PURE__ */ jsx5(ExternalLinkIcon, {})
|
|
557
|
-
]
|
|
558
|
-
}
|
|
559
|
-
) });
|
|
560
|
-
}
|
|
561
|
-
return /* @__PURE__ */ jsx5("div", { className: "my-6", children: /* @__PURE__ */ jsxs5(
|
|
562
|
-
"a",
|
|
563
|
-
{
|
|
564
|
-
href: effectiveData.url,
|
|
565
|
-
target: "_blank",
|
|
566
|
-
rel: "noopener noreferrer",
|
|
567
|
-
className: "block border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-colors group",
|
|
568
|
-
children: [
|
|
569
|
-
/* @__PURE__ */ jsx5("div", { className: "aspect-video w-full overflow-hidden relative flex items-center justify-center rounded-lg transition-colors duration-300", style: { backgroundColor: bgColor }, children: renderImage() }),
|
|
570
|
-
/* @__PURE__ */ jsx5("div", { className: "p-4", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-3", children: [
|
|
571
|
-
/* @__PURE__ */ jsx5(
|
|
572
|
-
"img",
|
|
573
|
-
{
|
|
574
|
-
src: logoSrc,
|
|
575
|
-
alt: publicationName || "",
|
|
576
|
-
className: "w-6 h-6 rounded object-contain flex-shrink-0 mt-0.5",
|
|
577
|
-
onError: (e) => {
|
|
578
|
-
e.target.style.display = "none";
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
),
|
|
582
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex-1 min-w-0", children: [
|
|
583
|
-
/* @__PURE__ */ jsx5(
|
|
584
|
-
"h3",
|
|
585
|
-
{
|
|
586
|
-
className: "font-sans font-semibold text-ods-text-primary text-base overflow-hidden group-hover:text-ods-accent transition-colors h-[2.5rem] leading-[1.25rem] mb-2",
|
|
587
|
-
style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" },
|
|
588
|
-
children: title
|
|
589
|
-
}
|
|
590
|
-
),
|
|
591
|
-
description && /* @__PURE__ */ jsx5(
|
|
592
|
-
"p",
|
|
593
|
-
{
|
|
594
|
-
className: "font-sans text-sm text-ods-text-secondary overflow-hidden h-[2.5rem] leading-[1.25rem] mb-2",
|
|
595
|
-
style: { display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical" },
|
|
596
|
-
children: description
|
|
597
|
-
}
|
|
598
|
-
),
|
|
599
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 text-xs text-ods-text-secondary", children: [
|
|
600
|
-
/* @__PURE__ */ jsx5("span", { className: "font-medium", children: effectiveData.siteName }),
|
|
601
|
-
/* @__PURE__ */ jsx5("span", { children: "\u2022" }),
|
|
602
|
-
/* @__PURE__ */ jsx5("span", { className: "truncate", children: ogDomain })
|
|
603
|
-
] })
|
|
604
|
-
] })
|
|
605
|
-
] }) })
|
|
606
|
-
]
|
|
607
|
-
}
|
|
608
|
-
) });
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
export {
|
|
612
|
-
EmbedIframe,
|
|
613
|
-
PdfViewer,
|
|
614
|
-
GoogleSheetsViewer,
|
|
615
|
-
FigmaEmbed,
|
|
616
|
-
OGLinkErrorBoundary,
|
|
617
|
-
OGLinkPreview
|
|
618
|
-
};
|
|
619
|
-
//# sourceMappingURL=chunk-YD43AKI5.js.map
|