@haklex/rich-renderer-linkcard 0.0.20 → 0.0.23

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.
@@ -0,0 +1,4 @@
1
+ import { LinkCardFetchContext } from './types';
2
+ export declare const LinkCardFetchProvider: import('react').Provider<LinkCardFetchContext | undefined>;
3
+ export declare function useLinkCardFetchContext(): LinkCardFetchContext | undefined;
4
+ //# sourceMappingURL=FetchContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FetchContext.d.ts","sourceRoot":"","sources":["../src/FetchContext.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAInD,eAAO,MAAM,qBAAqB,4DAAe,CAAA;AAEjD,wBAAgB,uBAAuB,IAAI,oBAAoB,GAAG,SAAS,CAE1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkCardRenderer.d.ts","sourceRoot":"","sources":["../src/LinkCardRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAQ1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnE,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,oBAAoB,CAAA;CACpC;AA6BD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CA6KjE,CAAA"}
1
+ {"version":3,"file":"LinkCardRenderer.d.ts","sourceRoot":"","sources":["../src/LinkCardRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAS1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEnE,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,YAAY,CAAC,EAAE,oBAAoB,CAAA;CACpC;AA6BD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CAgLjE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export type { ConvertToLinkCardActionProps } from './ConvertToLinkCardAction';
2
2
  export { ConvertToLinkCardAction } from './ConvertToLinkCardAction';
3
+ export { LinkCardFetchProvider, useLinkCardFetchContext } from './FetchContext';
3
4
  export type { UrlMatchInfo } from './hooks/useUrlMatcher';
4
5
  export { matchUrl, useUrlMatcher } from './hooks/useUrlMatcher';
5
6
  export { LinkCardEditDecorator } from './LinkCardEditDecorator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACnB,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAC/E,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EACL,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACnB,MAAM,SAAS,CAAA"}
package/dist/index.mjs CHANGED
@@ -6,7 +6,8 @@ import { $createLinkNode, $isLinkNode } from "@lexical/link";
6
6
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
7
7
  import { $getNodeByKey, $createTextNode, $createParagraphNode, $insertNodes, $createNodeSelection, $setSelection, PASTE_COMMAND, $getSelection, $isRangeSelection, $isParagraphNode, COMMAND_PRIORITY_LOW } from "lexical";
8
8
  import { Star, Link, ExternalLink, RemoveFormatting, Unlink, CreditCard, Globe } from "lucide-react";
9
- import { useMemo, useState, useRef, useEffect, useCallback, createElement, useLayoutEffect } from "react";
9
+ import { useMemo, useState, useRef, useEffect, useCallback, createElement, createContext, use, useLayoutEffect } from "react";
10
+ import { vars } from "@haklex/rich-style-token";
10
11
  import { $isLinkCardNode, LinkCardNode, createRendererDecoration, LinkCardRenderer as LinkCardRenderer$1 } from "@haklex/rich-editor";
11
12
  import { Popover, PopoverTrigger, PopoverPanel } from "@haklex/rich-editor-ui";
12
13
  import { useInView } from "react-intersection-observer";
@@ -47,7 +48,7 @@ const arxivPlugin = {
47
48
  display: "inline-flex",
48
49
  alignItems: "center",
49
50
  gap: "4px",
50
- fontSize: "0.875rem",
51
+ fontSize: vars.typography.fontSizeMd,
51
52
  color: "#fb923c"
52
53
  },
53
54
  children: /* @__PURE__ */ jsx("span", { style: { fontFamily: "sans-serif", fontWeight: 500 }, children: id })
@@ -221,7 +222,7 @@ const leetcodePlugin = {
221
222
  display: "inline-flex",
222
223
  alignItems: "center",
223
224
  gap: "4px",
224
- fontSize: "0.875rem",
225
+ fontSize: vars.typography.fontSizeMd,
225
226
  color: "#fb923c"
226
227
  },
227
228
  children: [
@@ -314,8 +315,8 @@ const githubCommitPlugin = {
314
315
  ]
315
316
  }
316
317
  ),
317
- /* @__PURE__ */ jsx("span", { style: { fontSize: "0.875rem" }, children: data.sha.slice(0, 7) }),
318
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.8 }, children: [
318
+ /* @__PURE__ */ jsx("span", { style: { fontSize: vars.typography.fontSizeMd }, children: data.sha.slice(0, 7) }),
319
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: vars.typography.fontSizeMd, opacity: 0.8 }, children: [
319
320
  owner,
320
321
  "/",
321
322
  repo
@@ -378,12 +379,12 @@ const githubDiscussionPlugin = {
378
379
  borderRadius: "4px",
379
380
  backgroundColor: "rgba(128,128,128,0.15)",
380
381
  padding: "2px 6px",
381
- fontSize: "0.75rem"
382
+ fontSize: vars.typography.fontSizeXs
382
383
  },
383
384
  children: categoryName
384
385
  }
385
386
  ),
386
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.8 }, children: [
387
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: vars.typography.fontSizeMd, opacity: 0.8 }, children: [
387
388
  "#",
388
389
  discussionNumber,
389
390
  " · ",
@@ -450,7 +451,7 @@ const githubIssuePlugin = {
450
451
  },
451
452
  children: [
452
453
  /* @__PURE__ */ jsx("span", { style: { color }, children: stateText }),
453
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.8 }, children: [
454
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: vars.typography.fontSizeMd, opacity: 0.8 }, children: [
454
455
  "#",
455
456
  issueNumber,
456
457
  " · ",
@@ -543,7 +544,7 @@ const githubPrPlugin = {
543
544
  ]
544
545
  }
545
546
  ),
546
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.8 }, children: [
547
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: vars.typography.fontSizeMd, opacity: 0.8 }, children: [
547
548
  owner,
548
549
  "/",
549
550
  repo
@@ -593,7 +594,7 @@ const githubRepoPlugin = {
593
594
  display: "inline-flex",
594
595
  alignItems: "center",
595
596
  gap: "4px",
596
- fontSize: "0.875rem",
597
+ fontSize: vars.typography.fontSizeMd,
597
598
  color: "#fb923c"
598
599
  },
599
600
  children: [
@@ -663,7 +664,7 @@ const bangumiPlugin = {
663
664
  alignItems: "center",
664
665
  gap: "4px",
665
666
  alignSelf: "center",
666
- fontSize: "0.75rem",
667
+ fontSize: vars.typography.fontSizeXs,
667
668
  color: "#fb923c"
668
669
  };
669
670
  return {
@@ -678,11 +679,17 @@ const bangumiPlugin = {
678
679
  },
679
680
  children: [
680
681
  /* @__PURE__ */ jsx("span", { children: title2 }),
681
- title2 !== originalTitle && /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.7 }, children: [
682
- "(",
683
- originalTitle,
684
- ")"
685
- ] }),
682
+ title2 !== originalTitle && /* @__PURE__ */ jsxs(
683
+ "span",
684
+ {
685
+ style: { fontSize: vars.typography.fontSizeMd, opacity: 0.7 },
686
+ children: [
687
+ "(",
688
+ originalTitle,
689
+ ")"
690
+ ]
691
+ }
692
+ ),
686
693
  type === "subject" && /* @__PURE__ */ jsxs(
687
694
  "span",
688
695
  {
@@ -760,7 +767,7 @@ const neteaseMusicPlugin = {
760
767
  {
761
768
  style: {
762
769
  marginLeft: "8px",
763
- fontSize: "0.875rem",
770
+ fontSize: vars.typography.fontSizeMd,
764
771
  color: "#a1a1aa"
765
772
  },
766
773
  children: songInfo.tns[0]
@@ -817,7 +824,7 @@ const qqMusicPlugin = {
817
824
  {
818
825
  style: {
819
826
  marginLeft: "8px",
820
- fontSize: "0.875rem",
827
+ fontSize: vars.typography.fontSizeMd,
821
828
  color: "#a1a1aa"
822
829
  },
823
830
  children: songInfo.subtitle
@@ -860,6 +867,7 @@ const tmdbPlugin = {
860
867
  displayName: "The Movie Database",
861
868
  priority: 70,
862
869
  typeClass: "media",
870
+ provider: "tmdb",
863
871
  matchUrl(url) {
864
872
  if (!url.hostname.includes("themoviedb.org")) return null;
865
873
  const parts = url.pathname.split("/").filter(Boolean);
@@ -874,13 +882,15 @@ const tmdbPlugin = {
874
882
  const canParsedTypes = ["tv", "movie"];
875
883
  return canParsedTypes.includes(type) && realId?.length > 0;
876
884
  },
877
- async fetch(id) {
885
+ async fetch(id, _meta, context) {
878
886
  const [type, realId] = id.split("/");
879
887
  const locale = getCurrentLocale();
880
888
  const userLanguage = TMDB_LANGUAGE_BY_LOCALE[locale] || (typeof navigator !== "undefined" ? navigator.language : "en-US") || "en-US";
881
- const json = await fetch(
882
- `/api/tmdb/${type}/${realId}?language=${userLanguage}`
883
- ).then((r) => r.json());
889
+ const json = await fetchJsonWithContext(
890
+ `https://api.themoviedb.org/3/${type}/${realId}?language=${userLanguage}`,
891
+ context,
892
+ "tmdb"
893
+ );
884
894
  const title2 = type === "tv" ? json.name : json.title;
885
895
  const originalTitle = type === "tv" ? json.original_name : json.original_title;
886
896
  return {
@@ -895,11 +905,17 @@ const tmdbPlugin = {
895
905
  },
896
906
  children: [
897
907
  /* @__PURE__ */ jsx("span", { children: title2 }),
898
- title2 !== originalTitle && /* @__PURE__ */ jsxs("span", { style: { fontSize: "0.875rem", opacity: 0.7 }, children: [
899
- "(",
900
- originalTitle,
901
- ")"
902
- ] }),
908
+ title2 !== originalTitle && /* @__PURE__ */ jsxs(
909
+ "span",
910
+ {
911
+ style: { fontSize: vars.typography.fontSizeMd, opacity: 0.7 },
912
+ children: [
913
+ "(",
914
+ originalTitle,
915
+ ")"
916
+ ]
917
+ }
918
+ ),
903
919
  /* @__PURE__ */ jsxs(
904
920
  "span",
905
921
  {
@@ -909,7 +925,7 @@ const tmdbPlugin = {
909
925
  alignItems: "center",
910
926
  gap: "4px",
911
927
  alignSelf: "center",
912
- fontSize: "0.75rem",
928
+ fontSize: vars.typography.fontSizeXs,
913
929
  color: "#fb923c"
914
930
  },
915
931
  children: [
@@ -1329,6 +1345,11 @@ function ConvertToLinkCardAction({
1329
1345
  "To Card"
1330
1346
  ] });
1331
1347
  }
1348
+ const ctx = createContext(void 0);
1349
+ const LinkCardFetchProvider = ctx.Provider;
1350
+ function useLinkCardFetchContext() {
1351
+ return use(ctx);
1352
+ }
1332
1353
  function useCardFetcher(options) {
1333
1354
  const { source, plugin, id, fallbackUrl, enabled = true, context } = options;
1334
1355
  const [loading, setLoading] = useState(true);
@@ -1442,8 +1463,10 @@ const LinkCardRenderer = (props) => {
1442
1463
  id: explicitId,
1443
1464
  className,
1444
1465
  plugins: plugins$1 = plugins,
1445
- fetchContext
1466
+ fetchContext: fetchContextProp
1446
1467
  } = props;
1468
+ const contextValue = useLinkCardFetchContext();
1469
+ const fetchContext = fetchContextProp ?? contextValue;
1447
1470
  const pluginMap2 = useMemo(
1448
1471
  () => new Map(plugins$1.map((plugin) => [plugin.name, plugin])),
1449
1472
  [plugins$1]
@@ -1632,6 +1655,7 @@ export {
1632
1655
  LanguageToColorMap,
1633
1656
  LinkCardEditDecorator,
1634
1657
  LinkCardEditNode,
1658
+ LinkCardFetchProvider,
1635
1659
  LinkCardRenderer,
1636
1660
  LinkCardSkeleton,
1637
1661
  PasteLinkCardPlugin,
@@ -1657,5 +1681,6 @@ export {
1657
1681
  plugins,
1658
1682
  qqMusicPlugin,
1659
1683
  tmdbPlugin,
1684
+ useLinkCardFetchContext,
1660
1685
  useUrlMatcher
1661
1686
  };
@@ -1 +1 @@
1
- {"version":3,"file":"arxiv.d.ts","sourceRoot":"","sources":["../../../src/plugins/academic/arxiv.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,WAAW,EAAE,cAwDzB,CAAA"}
1
+ {"version":3,"file":"arxiv.d.ts","sourceRoot":"","sources":["../../../src/plugins/academic/arxiv.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,WAAW,EAAE,cAwDzB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"leetcode.d.ts","sourceRoot":"","sources":["../../../src/plugins/code/leetcode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAgB/E,eAAO,MAAM,cAAc,EAAE,cAsF5B,CAAA"}
1
+ {"version":3,"file":"leetcode.d.ts","sourceRoot":"","sources":["../../../src/plugins/code/leetcode.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAgB/E,eAAO,MAAM,cAAc,EAAE,cAsF5B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/commit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,kBAAkB,EAAE,cAsEhC,CAAA"}
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/commit.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,kBAAkB,EAAE,cAwEhC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"discussion.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/discussion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,sBAAsB,EAAE,cAqEpC,CAAA"}
1
+ {"version":3,"file":"discussion.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/discussion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,sBAAsB,EAAE,cAqEpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/issue.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAa/E,eAAO,MAAM,iBAAiB,EAAE,cA2D/B,CAAA"}
1
+ {"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/issue.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAa/E,eAAO,MAAM,iBAAiB,EAAE,cA2D/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/pr.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAsB/E,eAAO,MAAM,cAAc,EAAE,cAiE5B,CAAA"}
1
+ {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/pr.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAsB/E,eAAO,MAAM,cAAc,EAAE,cAiE5B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/repo.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAO/E,eAAO,MAAM,gBAAgB,EAAE,cA0D9B,CAAA"}
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../../src/plugins/github/repo.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAO/E,eAAO,MAAM,gBAAgB,EAAE,cA0D9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"bangumi.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/bangumi.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,aAAa,EAAE,cAwI3B,CAAA"}
1
+ {"version":3,"file":"bangumi.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/bangumi.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAG/E,eAAO,MAAM,aAAa,EAAE,cA0I3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"netease-music.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/netease-music.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,kBAAkB,EAAE,cAoEhC,CAAA"}
1
+ {"version":3,"file":"netease-music.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/netease-music.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,kBAAkB,EAAE,cAoEhC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"qq-music.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/qq-music.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,aAAa,EAAE,cAiE3B,CAAA"}
1
+ {"version":3,"file":"qq-music.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/qq-music.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAE/E,eAAO,MAAM,aAAa,EAAE,cAiE3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tmdb.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/tmdb.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,cAAc,EAAkB,MAAM,aAAa,CAAA;AAuB/E,eAAO,MAAM,UAAU,EAAE,cAqFxB,CAAA"}
1
+ {"version":3,"file":"tmdb.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/tmdb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,aAAa,CAAA;AAuBpB,eAAO,MAAM,UAAU,EAAE,cA8FxB,CAAA"}
@@ -1,331 +1 @@
1
- @keyframes _13weebvm {
2
- 0%, 100% {
3
- opacity: 1;
4
- }
5
- 50% {
6
- opacity: 0.5;
7
- }
8
- }
9
- ._13weebv0 {
10
- position: relative;
11
- display: flex;
12
- box-sizing: border-box;
13
- align-items: flex-start;
14
- gap: 0.75rem;
15
- width: 32rem;
16
- max-width: 100%;
17
- margin: 1.25rem auto;
18
- padding: 1rem;
19
- border-radius: 0.5rem;
20
- overflow: hidden;
21
- cursor: pointer;
22
- text-decoration: none;
23
- color: inherit;
24
- text-indent: 0;
25
- font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
26
- border: 1px solid color-mix(in srgb, var(--rc-border) 80%, transparent);
27
- background-color: color-mix(in srgb, var(--rc-bg-secondary) 80%, transparent);
28
- backdrop-filter: blur(12px) saturate(150%);
29
- transition: border-color 0.2s, background-color 0.2s;
30
- }
31
- ._13weebv0:hover {
32
- border-color: var(--rc-border);
33
- background-color: var(--rc-bg-secondary);
34
- }
35
- ._13weebv1 {
36
- align-items: center;
37
- }
38
- ._13weebv0 * {
39
- font-style: normal !important;
40
- }
41
- ._13weebv0 span {
42
- border-bottom: 0 !important;
43
- }
44
- ._13weebv2 {
45
- position: absolute;
46
- inset: 0;
47
- z-index: 0;
48
- pointer-events: none;
49
- }
50
- ._13weebv3 {
51
- position: relative;
52
- flex-shrink: 0;
53
- width: 2.5rem;
54
- height: 2.5rem;
55
- border-radius: 0.5rem;
56
- background-size: cover;
57
- background-position: center;
58
- background-repeat: no-repeat;
59
- background-color: var(--rc-bg-secondary);
60
- z-index: 1;
61
- }
62
- ._13weebv4 {
63
- width: 6.25rem !important;
64
- height: auto !important;
65
- min-height: 8.75rem;
66
- aspect-ratio: 2 / 3;
67
- align-self: stretch;
68
- }
69
- ._13weebv5 {
70
- width: 3.5rem !important;
71
- height: 5rem !important;
72
- aspect-ratio: auto;
73
- align-self: flex-start;
74
- }
75
- ._13weebv6 {
76
- width: 3.5rem !important;
77
- height: 3.5rem !important;
78
- aspect-ratio: auto;
79
- align-self: flex-start;
80
- }
81
- ._13weebv7 {
82
- flex-shrink: 0;
83
- display: flex;
84
- align-items: center;
85
- justify-content: center;
86
- width: 2.5rem;
87
- height: 2.5rem;
88
- border-radius: 0.5rem;
89
- background-color: var(--rc-bg-secondary);
90
- z-index: 1;
91
- }
92
- ._13weebv7 img {
93
- width: 1.25rem;
94
- height: 1.25rem;
95
- border-radius: 0.25rem;
96
- }
97
- ._13weebv7 svg {
98
- width: 1.25rem;
99
- height: 1.25rem;
100
- color: var(--rc-text-secondary);
101
- }
102
- ._13weebv8 {
103
- flex: 1;
104
- min-width: 0;
105
- position: relative;
106
- z-index: 1;
107
- }
108
- ._13weebv9 {
109
- display: flex;
110
- align-items: center;
111
- gap: 0.5rem;
112
- line-height: 1.25rem;
113
- }
114
- ._13weebva {
115
- flex: 1;
116
- min-width: 0;
117
- display: -webkit-box;
118
- -webkit-box-orient: vertical;
119
- -webkit-line-clamp: 2;
120
- overflow: hidden;
121
- text-overflow: ellipsis;
122
- font-size: 0.875rem;
123
- font-weight: 600;
124
- line-height: 1.25rem;
125
- }
126
- ._13weebvb {
127
- flex-shrink: 0;
128
- margin-left: auto;
129
- width: 0.875rem;
130
- height: 0.875rem;
131
- color: var(--rc-text-secondary);
132
- opacity: 0;
133
- transition: opacity 0.2s;
134
- }
135
- ._13weebv0:hover ._13weebvb {
136
- opacity: 1;
137
- }
138
- ._13weebvc {
139
- display: -webkit-box;
140
- -webkit-box-orient: vertical;
141
- -webkit-line-clamp: 2;
142
- overflow: hidden;
143
- text-overflow: ellipsis;
144
- margin-top: 0.375rem;
145
- font-size: 0.875rem;
146
- line-height: 1.5;
147
- color: var(--rc-text-secondary);
148
- min-width: 0;
149
- }
150
- ._13weebve {
151
- flex-shrink: 0;
152
- width: 1rem;
153
- height: 1rem;
154
- display: inline;
155
- vertical-align: middle;
156
- margin-right: 0.375rem;
157
- }
158
- ._13weebvf {
159
- width: 100% !important;
160
- height: auto !important;
161
- padding: 0;
162
- }
163
- ._13weebvf ._13weebv3 {
164
- border-radius: 0;
165
- }
166
- ._13weebvf ._13weebv3::after {
167
- content: '';
168
- position: absolute;
169
- inset: 0;
170
- background: linear-gradient(to right, transparent 60%, var(--rc-bg-secondary));
171
- pointer-events: none;
172
- }
173
- ._13weebvf ._13weebv8 {
174
- padding: 1rem;
175
- display: flex;
176
- flex-direction: column;
177
- justify-content: center;
178
- }
179
- ._13weebvg {
180
- width: 100%;
181
- max-width: 40rem;
182
- }
183
- ._13weebvh {
184
- width: 100%;
185
- }
186
- ._13weebvi {
187
- width: 100%;
188
- }
189
- ._13weebvi ._13weebvc {
190
- -webkit-line-clamp: 4;
191
- }
192
- ._13weebvj {
193
- width: 36rem;
194
- }
195
- ._13weebvk {
196
- width: 38rem;
197
- }
198
- ._13weebvk ._13weebvc {
199
- -webkit-line-clamp: 3;
200
- }
201
- ._13weebv0[data-source='gh-repo'] {
202
- height: 6.25rem;
203
- }
204
- ._13weebv0[data-source='gh-commit'], ._13weebv0[data-source='gh-pr'], ._13weebv0[data-source='gh-issue'], ._13weebv0[data-source='gh-discussion'] {
205
- height: 5rem;
206
- }
207
- ._13weebv0[data-source='leetcode'] {
208
- height: 5.25rem;
209
- }
210
- ._13weebv0[data-source='arxiv'] {
211
- height: 6rem;
212
- }
213
- ._13weebv0[data-source='netease-music-song'], ._13weebv0[data-source='qq-music-song'] {
214
- height: 5.75rem;
215
- }
216
- ._13weebvl {
217
- animation-play-state: paused;
218
- }
219
- ._13weebvl ._13weebva {
220
- width: 8rem;
221
- height: 1.25rem;
222
- border-radius: 0.375rem;
223
- background-color: var(--rc-border);
224
- }
225
- ._13weebvl ._13weebvc {
226
- width: 100%;
227
- margin-top: 0.5rem;
228
- height: 0.875rem;
229
- border-radius: 0.375rem;
230
- background-color: var(--rc-border);
231
- }
232
- ._13weebvl ._13weebvd {
233
- width: 80%;
234
- }
235
- ._13weebvl ._13weebv3 {
236
- background-color: var(--rc-border);
237
- }
238
- ._13weebvl ._13weebva, ._13weebvl ._13weebvc, ._13weebvl ._13weebv3 {
239
- animation: _13weebvm 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
240
- }
241
- ._13weebvl._13weebvn {
242
- background-color: color-mix(in srgb, var(--rc-alert-caution) 12%, transparent) !important;
243
- }
244
- ._13weebvl._13weebvn ._13weebva, ._13weebvl._13weebvn ._13weebvc, ._13weebvl._13weebvn ._13weebv3 {
245
- background-color: color-mix(in srgb, var(--rc-alert-caution) 47%, transparent);
246
- color: transparent;
247
- }
248
- ._13weebvl._13weebvn ._13weebv3 {
249
- background-image: none !important;
250
- }
251
- ._13weebvo {
252
- display: inline;
253
- }
254
- ._13weebvp {
255
- display: flex;
256
- flex-direction: column;
257
- gap: 8px;
258
- width: 340px;
259
- padding: 12px;
260
- font-size: 13px;
261
- background-color: var(--rc-bg);
262
- border-color: var(--rc-border);
263
- color: var(--rc-text);
264
- }
265
- ._13weebvq {
266
- display: flex;
267
- align-items: center;
268
- gap: 8px;
269
- padding: 8px 12px;
270
- background-color: var(--rc-bg-secondary);
271
- border-radius: var(--rc-radius-md);
272
- min-width: 0;
273
- }
274
- ._13weebvr {
275
- flex-shrink: 0;
276
- color: var(--rc-text-secondary);
277
- }
278
- ._13weebvs {
279
- flex: 1;
280
- color: var(--rc-text);
281
- font-family: var(--rc-font-mono);
282
- font-size: 13px;
283
- overflow: hidden;
284
- text-overflow: ellipsis;
285
- white-space: nowrap;
286
- min-width: 0;
287
- }
288
- ._13weebvt {
289
- flex: 1;
290
- appearance: none;
291
- border: none;
292
- background-color: transparent;
293
- color: var(--rc-text);
294
- font-family: var(--rc-font-mono);
295
- font-size: 13px;
296
- padding: 0;
297
- outline: none;
298
- min-width: 0;
299
- }
300
- ._13weebvu {
301
- display: flex;
302
- align-items: center;
303
- gap: 4px;
304
- }
305
- ._13weebvv {
306
- display: inline-flex;
307
- align-items: center;
308
- gap: 6px;
309
- appearance: none;
310
- border: none;
311
- background: none;
312
- color: var(--rc-text);
313
- font-size: 13px;
314
- font-weight: 500;
315
- cursor: pointer;
316
- padding: 4px 8px;
317
- border-radius: var(--rc-radius-sm);
318
- transition: color 0.15s ease, background-color 0.15s ease;
319
- white-space: nowrap;
320
- }
321
- ._13weebvv:hover {
322
- background-color: var(--rc-bg-secondary);
323
- }
324
- ._13weebvw {
325
- margin-left: auto;
326
- }
327
- @media (max-width: 640px) {
328
- ._13weebvj {
329
- width: 100%;
330
- }
331
- }
1
+ @keyframes _13weebvm{0%,to{opacity:1}50%{opacity:.5}}._13weebv0{position:relative;display:flex;box-sizing:border-box;align-items:flex-start;gap:.75rem;width:32rem;max-width:100%;margin:1.25rem auto;padding:1rem;border-radius:.5rem;overflow:hidden;cursor:pointer;text-decoration:none;color:inherit;text-indent:0;font-family:ui-sans-serif,system-ui,-apple-system,sans-serif;border:1px solid color-mix(in srgb,var(--rc-border) 80%,transparent);background-color:color-mix(in srgb,var(--rc-bg-secondary) 80%,transparent);backdrop-filter:blur(12px) saturate(150%);transition:background-color .2s}._13weebv0:hover{border-color:var(--rc-border);background-color:var(--rc-bg-secondary)}._13weebv1{align-items:center}._13weebv0 *{font-style:normal!important}._13weebv0 span{border-bottom:0!important}._13weebv2{position:absolute;inset:0;z-index:0;pointer-events:none}._13weebv3{position:relative;flex-shrink:0;width:2.5rem;height:2.5rem;border-radius:.5rem;background-size:cover;background-position:center;background-repeat:no-repeat;background-color:var(--rc-bg-secondary);z-index:1}._13weebv4{width:6.25rem!important;height:auto!important;min-height:8.75rem;aspect-ratio:2 / 3;align-self:stretch}._13weebv5{width:3.5rem!important;height:5rem!important;aspect-ratio:auto;align-self:flex-start}._13weebv6{width:3.5rem!important;height:3.5rem!important;aspect-ratio:auto;align-self:flex-start}._13weebv7{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:.5rem;background-color:var(--rc-bg-secondary);z-index:1}._13weebv7 img{width:1.25rem;height:1.25rem;border-radius:.25rem}._13weebv7 svg{width:1.25rem;height:1.25rem;color:var(--rc-text-secondary)}._13weebv8{flex:1;min-width:0;position:relative;z-index:1}._13weebv9{display:flex;align-items:center;gap:.5rem;line-height:1.25rem}._13weebva{flex:1;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;font-size:var(--rc-font-size-md);font-weight:600;line-height:1.25rem}._13weebvb{flex-shrink:0;margin-left:auto;width:.875rem;height:.875rem;color:var(--rc-text-secondary);opacity:0;transition:opacity .2s}._13weebv0:hover ._13weebvb{opacity:1}._13weebvc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;margin-top:.375rem;font-size:var(--rc-font-size-md);line-height:1.5;color:var(--rc-text-secondary);min-width:0}._13weebve{flex-shrink:0;width:1rem;height:1rem;display:inline;vertical-align:middle;margin-right:.375rem}._13weebvf{width:100%!important;height:auto!important;padding:0}._13weebvf ._13weebv3{border-radius:0}._13weebvf ._13weebv3:after{content:"";position:absolute;inset:0;background:linear-gradient(to right,transparent 60%,var(--rc-bg-secondary));pointer-events:none}._13weebvf ._13weebv8{padding:1rem;display:flex;flex-direction:column;justify-content:center}._13weebvg{width:100%;max-width:40rem}._13weebvh,._13weebvi{width:100%}._13weebvi ._13weebvc{-webkit-line-clamp:4}._13weebvj{width:36rem}._13weebvk{width:38rem}._13weebvk ._13weebvc{-webkit-line-clamp:3}._13weebv0[data-source=gh-repo]{height:6.25rem}._13weebv0[data-source=gh-commit],._13weebv0[data-source=gh-pr],._13weebv0[data-source=gh-issue],._13weebv0[data-source=gh-discussion]{height:5rem}._13weebv0[data-source=leetcode]{height:5.25rem}._13weebv0[data-source=arxiv]{height:6rem}._13weebv0[data-source=netease-music-song],._13weebv0[data-source=qq-music-song]{height:5.75rem}._13weebvl{animation-play-state:paused}._13weebvl ._13weebva{width:8rem;height:1.25rem;border-radius:.375rem;background-color:var(--rc-border)}._13weebvl ._13weebvc{width:100%;margin-top:.5rem;height:.875rem;border-radius:.375rem;background-color:var(--rc-border)}._13weebvl ._13weebvd{width:80%}._13weebvl ._13weebv3{background-color:var(--rc-border)}._13weebvl ._13weebva,._13weebvl ._13weebvc,._13weebvl ._13weebv3{animation:_13weebvm 2s cubic-bezier(.4,0,.6,1) infinite}._13weebvl._13weebvn{background-color:color-mix(in srgb,var(--rc-alert-caution) 12%,transparent)!important}._13weebvl._13weebvn ._13weebva,._13weebvl._13weebvn ._13weebvc,._13weebvl._13weebvn ._13weebv3{background-color:color-mix(in srgb,var(--rc-alert-caution) 47%,transparent);color:transparent}._13weebvl._13weebvn ._13weebv3{background-image:none!important}._13weebvo{display:block}._13weebvp{display:flex;flex-direction:column;gap:8px;width:340px;padding:12px;font-size:var(--rc-font-size-sm);background-color:var(--rc-bg);border-color:var(--rc-border);color:var(--rc-text)}._13weebvq{display:flex;align-items:center;gap:8px;padding:8px 12px;background-color:var(--rc-bg-secondary);border-radius:var(--rc-radius-md);min-width:0}._13weebvr{flex-shrink:0;color:var(--rc-text-secondary)}._13weebvs{flex:1;color:var(--rc-text);font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}._13weebvt{flex:1;appearance:none;border:none;background-color:transparent;color:var(--rc-text);font-family:var(--rc-font-mono);font-size:var(--rc-font-size-sm);padding:0;outline:none;min-width:0}._13weebvu{display:flex;align-items:center;gap:4px}._13weebvv{display:inline-flex;align-items:center;gap:6px;appearance:none;border:none;background:none;color:var(--rc-text);font-size:var(--rc-font-size-sm);font-weight:500;cursor:pointer;padding:4px 8px;border-radius:var(--rc-radius-sm);transition:color .15s ease,background-color .15s ease;white-space:nowrap}._13weebvv:hover{background-color:var(--rc-bg-secondary)}._13weebvw{margin-left:auto}@media(max-width:640px){._13weebvj{width:100%}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-renderer-linkcard",
3
- "version": "0.0.20",
3
+ "version": "0.0.23",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,9 +17,9 @@
17
17
  "dependencies": {
18
18
  "lucide-react": "^0.574.0",
19
19
  "react-intersection-observer": "^9.16.0",
20
- "@haklex/rich-editor": "0.0.20",
21
- "@haklex/rich-editor-ui": "0.0.20",
22
- "@haklex/rich-style-token": "0.0.20"
20
+ "@haklex/rich-editor": "0.0.23",
21
+ "@haklex/rich-editor-ui": "0.0.23",
22
+ "@haklex/rich-style-token": "0.0.23"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@lexical/link": "^0.40.0",