@haklex/rich-renderer-linkcard 0.0.31 → 0.0.33

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.
@@ -1 +1 @@
1
- {"version":3,"file":"LinkCardEditDecorator.d.ts","sourceRoot":"","sources":["../src/LinkCardEditDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAM/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,UAAU,0BAA0B;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,mBAAmB,CAAA;IAC5B,QAAQ,EAAE,YAAY,CAAA;CACvB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,0BAA0B,2CAuJ5B"}
1
+ {"version":3,"file":"LinkCardEditDecorator.d.ts","sourceRoot":"","sources":["../src/LinkCardEditDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAM/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,UAAU,0BAA0B;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,mBAAmB,CAAA;IAC5B,QAAQ,EAAE,YAAY,CAAA;CACvB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,0BAA0B,2CAwJ5B"}
@@ -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;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"}
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,CA2KjE,CAAA"}
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ 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, createContext, use, useLayoutEffect } from "react";
9
+ import { useMemo, useState, useRef, useEffect, useCallback, createElement, createContext, use } from "react";
10
10
  import { vars } from "@haklex/rich-style-token";
11
11
  import { $isLinkCardNode, LinkCardNode, createRendererDecoration, LinkCardRenderer as LinkCardRenderer$1 } from "@haklex/rich-editor";
12
12
  import { Popover, PopoverTrigger, PopoverPanel } from "@haklex/rich-editor-ui";
@@ -295,7 +295,7 @@ const githubCommitPlugin = {
295
295
  flexWrap: "wrap",
296
296
  alignItems: "center",
297
297
  gap: "4px 12px",
298
- fontFamily: "ui-monospace, monospace"
298
+ fontFamily: vars.typography.fontMono
299
299
  },
300
300
  children: [
301
301
  /* @__PURE__ */ jsxs(
@@ -372,7 +372,7 @@ const githubDiscussionPlugin = {
372
372
  flexWrap: "wrap",
373
373
  alignItems: "center",
374
374
  gap: "4px 12px",
375
- fontFamily: "ui-monospace, monospace"
375
+ fontFamily: vars.typography.fontMono
376
376
  },
377
377
  children: [
378
378
  /* @__PURE__ */ jsx(
@@ -450,7 +450,7 @@ const githubIssuePlugin = {
450
450
  flexWrap: "wrap",
451
451
  alignItems: "center",
452
452
  gap: "4px 12px",
453
- fontFamily: "ui-monospace, monospace"
453
+ fontFamily: vars.typography.fontMono
454
454
  },
455
455
  children: [
456
456
  /* @__PURE__ */ jsx("span", { style: { color }, children: stateText }),
@@ -522,7 +522,7 @@ const githubPrPlugin = {
522
522
  flexWrap: "wrap",
523
523
  alignItems: "center",
524
524
  gap: "4px 12px",
525
- fontFamily: "ui-monospace, monospace"
525
+ fontFamily: vars.typography.fontMono
526
526
  },
527
527
  children: [
528
528
  /* @__PURE__ */ jsx("span", { style: { color }, children: stateText }),
@@ -729,7 +729,7 @@ const bangumiPlugin = {
729
729
  image: json.images.grid,
730
730
  color: generateColor(title2),
731
731
  classNames: {
732
- image: type === "subject" ? "link-card__image--poster-md" : "link-card__image--poster-sm",
732
+ image: "link-card__image--poster",
733
733
  cardRoot: "link-card--reversed"
734
734
  }
735
735
  };
@@ -1079,31 +1079,30 @@ function useUrlMatcher(url, pluginRegistry = plugins) {
1079
1079
  return matchUrl(url, pluginRegistry);
1080
1080
  }, [url, pluginRegistry]);
1081
1081
  }
1082
- var semanticClassNames = { card: "link-card", cardShortDesc: "link-card--short-desc", cardSkeleton: "link-card--skeleton", cardError: "link-card--error", bg: "link-card__bg", image: "link-card__image", icon: "link-card__icon", content: "link-card__content", title: "link-card__title", titleText: "link-card__title-text", external: "link-card__external", desc: "link-card__desc", desc2: "link-card__desc-2", editWrapper: "rich-link-card-edit-wrapper", editPanel: "rich-link-card-edit-panel", editUrlRow: "rich-link-card-edit-url-row", editLinkIcon: "rich-link-card-edit-link-icon", editInput: "rich-link-card-edit-input", editActions: "rich-link-card-edit-actions", editActionButton: "rich-link-card-edit-action-btn", editActionButtonEnd: "rich-link-card-edit-action-btn--end" };
1082
+ var semanticClassNames = { card: "link-card", cardShortDesc: "link-card--short-desc", cardSkeleton: "link-card--skeleton", cardError: "link-card--error", bg: "link-card__bg", image: "link-card__image", icon: "link-card__icon", content: "link-card__content", title: "link-card__title", titleText: "link-card__title-text", desc: "link-card__desc", desc2: "link-card__desc-2", editWrapper: "rich-link-card-edit-wrapper", editPanel: "rich-link-card-edit-panel", editUrlRow: "rich-link-card-edit-url-row", editLinkIcon: "rich-link-card-edit-link-icon", editInput: "rich-link-card-edit-input", editActions: "rich-link-card-edit-actions", editActionButton: "rich-link-card-edit-action-btn", editActionButtonEnd: "rich-link-card-edit-action-btn--end" };
1083
1083
  var card = "_13weebv0";
1084
1084
  var cardShortDesc = "_13weebv1";
1085
1085
  var bg = "_13weebv2";
1086
1086
  var image = "_13weebv3";
1087
- var icon = "_13weebv7";
1088
- var content = "_13weebv8";
1089
- var title = "_13weebv9";
1090
- var titleText = "_13weebva";
1091
- var external = "_13weebvb";
1092
- var desc = "_13weebvc";
1093
- var desc2 = "_13weebvd";
1094
- var cardSkeleton = "_13weebvl";
1095
- var cardError = "_13weebvn";
1096
- var editWrapper = "_13weebvo";
1097
- var editPanel = "_13weebvp";
1098
- var editUrlRow = "_13weebvq";
1099
- var editLinkIcon = "_13weebvr";
1100
- var editInput = "_13weebvt";
1101
- var editActions = "_13weebvu";
1102
- var editActionButton = "_13weebvv";
1103
- var editActionButtonEnd = "_13weebvw";
1104
- var typeCardModifier = { media: "_13weebvi", github: "_13weebvj", academic: "_13weebvk", wide: "_13weebvg", full: "_13weebvh" };
1087
+ var icon = "_13weebv5";
1088
+ var content = "_13weebv6";
1089
+ var title = "_13weebv7";
1090
+ var titleText = "_13weebv8";
1091
+ var desc = "_13weebva";
1092
+ var desc2 = "_13weebvb";
1093
+ var cardSkeleton = "_13weebvj";
1094
+ var cardError = "_13weebvl";
1095
+ var editWrapper = "_13weebvm";
1096
+ var editPanel = "_13weebvn";
1097
+ var editUrlRow = "_13weebvo";
1098
+ var editLinkIcon = "_13weebvp";
1099
+ var editInput = "_13weebvr";
1100
+ var editActions = "_13weebvs";
1101
+ var editActionButton = "_13weebvt";
1102
+ var editActionButtonEnd = "_13weebvu";
1103
+ var typeCardModifier = { media: "_13weebvg", github: "_13weebvh", academic: "_13weebvi", wide: "_13weebve", full: "_13weebvf" };
1105
1104
  var semanticTypeClassNames = { media: "link-card--media", github: "link-card--github", academic: "link-card--academic", wide: "link-card--wide", full: "link-card--full" };
1106
- var semanticClassToStyle = { "link-card--short-desc": "_13weebv1", "link-card--skeleton": "_13weebvl", "link-card--error": "_13weebvn", "link-card--reversed": "_13weebvf", "link-card--wide": "_13weebvg", "link-card--full": "_13weebvh", "link-card--media": "_13weebvi", "link-card--github": "_13weebvj", "link-card--academic": "_13weebvk", "link-card__image--poster": "_13weebv4", "link-card__image--poster-md": "_13weebv5", "link-card__image--poster-sm": "_13weebv6" };
1105
+ var semanticClassToStyle = { "link-card--short-desc": "_13weebv1", "link-card--skeleton": "_13weebvj", "link-card--error": "_13weebvl", "link-card--reversed": "_13weebvd", "link-card--wide": "_13weebve", "link-card--full": "_13weebvf", "link-card--media": "_13weebvg", "link-card--github": "_13weebvh", "link-card--academic": "_13weebvi", "link-card__image--poster": "_13weebv4" };
1107
1106
  function LinkCardEditDecorator({
1108
1107
  nodeKey,
1109
1108
  payload,
@@ -1188,6 +1187,7 @@ function LinkCardEditDecorator({
1188
1187
  delay: 200,
1189
1188
  closeDelay: 300,
1190
1189
  openOnHover: true,
1190
+ nativeButton: false,
1191
1191
  render: /* @__PURE__ */ jsx(
1192
1192
  "span",
1193
1193
  {
@@ -1529,7 +1529,7 @@ const LinkCardRenderer = (props) => {
1529
1529
  const mappedImageClass = mapSemanticClasses(classNames.image);
1530
1530
  const [shortDesc, setShortDesc] = useState(false);
1531
1531
  const descRef = useRef(null);
1532
- useLayoutEffect(() => {
1532
+ useEffect(() => {
1533
1533
  const el = descRef.current;
1534
1534
  if (!el || !finalDesc) {
1535
1535
  setShortDesc(false);
@@ -1615,23 +1615,13 @@ const LinkCardRenderer = (props) => {
1615
1615
  {
1616
1616
  className: `${content} ${semanticClassNames.content}`,
1617
1617
  children: [
1618
- /* @__PURE__ */ jsxs("span", { className: `${title} ${semanticClassNames.title}`, children: [
1619
- /* @__PURE__ */ jsx(
1620
- "span",
1621
- {
1622
- className: `${titleText} ${semanticClassNames.titleText}`,
1623
- children: finalTitle
1624
- }
1625
- ),
1626
- /* @__PURE__ */ jsx(
1627
- ExternalLink,
1628
- {
1629
- className: `${external} ${semanticClassNames.external}`,
1630
- "aria-hidden": "true",
1631
- focusable: false
1632
- }
1633
- )
1634
- ] }),
1618
+ /* @__PURE__ */ jsx("span", { className: `${title} ${semanticClassNames.title}`, children: /* @__PURE__ */ jsx(
1619
+ "span",
1620
+ {
1621
+ className: `${titleText} ${semanticClassNames.titleText}`,
1622
+ children: finalTitle
1623
+ }
1624
+ ) }),
1635
1625
  finalDesc && /* @__PURE__ */ jsx(
1636
1626
  "span",
1637
1627
  {
@@ -1 +1 @@
1
- {"version":3,"file":"bangumi.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/bangumi.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,aAAa,CAAA;AAQpB,eAAO,MAAM,aAAa,EAAE,cAiJ3B,CAAA"}
1
+ {"version":3,"file":"bangumi.d.ts","sourceRoot":"","sources":["../../../src/plugins/media/bangumi.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,cAAc,EAEf,MAAM,aAAa,CAAA;AAQpB,eAAO,MAAM,aAAa,EAAE,cA8I3B,CAAA"}
@@ -1 +1 @@
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:var(--rc-font-family);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;max-width:40rem;padding:0}._13weebvf ._13weebv3{border-radius:0;align-self:stretch;height:auto!important}._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%}}
1
+ :root{--rc-text: #000;--rc-text-secondary: #18181b;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._1osyxsk0{--rc-text: #000;--rc-text-secondary: #18181b;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._1osyxsk1{--rc-text: #000;--rc-text-secondary: #18181b;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}._1osyxsk2{--rc-text: #000;--rc-text-secondary: #18181b;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 8px}.dark ._1osyxsk0,[data-theme=dark] ._1osyxsk0,.dark._1osyxsk0,[data-theme=dark]._1osyxsk0,.dark ._1osyxsk1,[data-theme=dark] ._1osyxsk1,.dark._1osyxsk1,[data-theme=dark]._1osyxsk1,.dark ._1osyxsk2,[data-theme=dark] ._1osyxsk2,.dark._1osyxsk2,[data-theme=dark]._1osyxsk2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0}@keyframes _13weebvk{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:var(--rc-font-family-sans);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{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}._13weebv5 img{width:1.25rem;height:1.25rem;border-radius:.25rem}._13weebv5 svg{width:1.25rem;height:1.25rem;color:var(--rc-text-secondary)}._13weebv6{flex:1;min-width:0;position:relative;z-index:1}._13weebv7{display:flex;align-items:center;gap:.5rem;line-height:1.25rem}._13weebv8{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}._13weebv9{flex-shrink:0;margin-left:auto;width:.875rem;height:.875rem;color:var(--rc-text-secondary);opacity:0;transition:opacity .2s}._13weebv0:hover ._13weebv9{opacity:1}._13weebva{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}._13weebvc{flex-shrink:0;width:1rem;height:1rem;display:inline;vertical-align:middle;margin-right:.375rem}._13weebvd{width:100%!important;height:auto!important;max-width:40rem;padding:0}._13weebvd ._13weebv3{border-radius:0;align-self:stretch;height:auto!important}._13weebvd ._13weebv3:after{content:"";position:absolute;inset:0;background:linear-gradient(to right,transparent 60%,var(--rc-bg-secondary));pointer-events:none}._13weebvd ._13weebv6{padding:1rem;display:flex;flex-direction:column;justify-content:center}._13weebve{width:100%;max-width:40rem}._13weebvf,._13weebvg{width:100%}._13weebvg ._13weebva{-webkit-line-clamp:4}._13weebvh{width:36rem}._13weebvi{width:38rem}._13weebvi ._13weebva{-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}._13weebvj{animation-play-state:paused}._13weebvj ._13weebv8{width:8rem;height:1.25rem;border-radius:.375rem;background-color:var(--rc-border)}._13weebvj ._13weebva{width:100%;margin-top:.5rem;height:.875rem;border-radius:.375rem;background-color:var(--rc-border)}._13weebvj ._13weebvb{width:80%}._13weebvj ._13weebv3{background-color:var(--rc-border)}._13weebvj ._13weebv8,._13weebvj ._13weebva,._13weebvj ._13weebv3{animation:_13weebvk 2s cubic-bezier(.4,0,.6,1) infinite}._13weebvj._13weebvl{background-color:color-mix(in srgb,var(--rc-alert-caution) 12%,transparent)!important;border:0}._13weebvj._13weebvl ._13weebv8,._13weebvj._13weebvl ._13weebva,._13weebvj._13weebvl ._13weebv3{background-color:color-mix(in srgb,var(--rc-alert-caution) 47%,transparent);color:transparent;animation:none}._13weebvj._13weebvl ._13weebv6{overflow:hidden;min-width:0}._13weebvj._13weebvl ._13weebva{width:80%}._13weebvj._13weebvl ._13weebv3{background-image:none!important}._13weebvm{display:block}._13weebvn{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)}._13weebvo{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}._13weebvp{flex-shrink:0;color:var(--rc-text-secondary)}._13weebvq{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}._13weebvr{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}._13weebvs{display:flex;align-items:center;gap:4px}._13weebvt{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}._13weebvt:hover{background-color:var(--rc-bg-secondary)}._13weebvu{margin-left:auto}@media(max-width:640px){._13weebvh{width:100%}}
@@ -12,8 +12,6 @@ export declare const semanticClassNames: {
12
12
  readonly bg: "link-card__bg";
13
13
  readonly image: "link-card__image";
14
14
  readonly imagePoster: "link-card__image--poster";
15
- readonly imagePosterMd: "link-card__image--poster-md";
16
- readonly imagePosterSm: "link-card__image--poster-sm";
17
15
  readonly icon: "link-card__icon";
18
16
  readonly content: "link-card__content";
19
17
  readonly title: "link-card__title";
@@ -37,8 +35,6 @@ export declare const cardShortDesc: string;
37
35
  export declare const bg: string;
38
36
  export declare const image: string;
39
37
  export declare const imagePoster: string;
40
- export declare const imagePosterMd: string;
41
- export declare const imagePosterSm: string;
42
38
  export declare const icon: string;
43
39
  export declare const content: string;
44
40
  export declare const title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCrB,CAAA;AAEV,eAAO,MAAM,IAAI,QA2Bf,CAAA;AAEF,e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,SAAS,QAWpB,CAAA;AAEF,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,gBAAgB,QAoB3B,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAE9B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAA;AAEV,eAAO,MAAM,sBAAsB;;;;;;CAMzB,CAAA;AAEV,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWvD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-renderer-linkcard",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
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.31",
21
- "@haklex/rich-editor-ui": "0.0.31",
22
- "@haklex/rich-style-token": "0.0.31"
20
+ "@haklex/rich-editor-ui": "0.0.33",
21
+ "@haklex/rich-editor": "0.0.33",
22
+ "@haklex/rich-style-token": "0.0.33"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@lexical/link": "^0.40.0",