@haklex/rich-renderer-linkcard 0.35.0 → 0.37.0
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.
|
@@ -725,14 +725,15 @@ var bangumiPlugin = {
|
|
|
725
725
|
const json = await fetchJsonWithContext(`https://api.bgm.tv/v0/${bangumiTypeMap[type]}/${realId}`, context, "bangumi");
|
|
726
726
|
let title = "";
|
|
727
727
|
let originalTitle = "";
|
|
728
|
-
if (type === "subject")
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
728
|
+
if (type === "subject") {
|
|
729
|
+
if (json.name_cn && json.name_cn !== json.name && json.name_cn !== "") {
|
|
730
|
+
title = json.name_cn;
|
|
731
|
+
originalTitle = json.name;
|
|
732
|
+
} else {
|
|
733
|
+
title = json.name;
|
|
734
|
+
originalTitle = json.name;
|
|
735
|
+
}
|
|
736
|
+
} else if (type === "character" || type === "person") {
|
|
736
737
|
const { infobox } = json;
|
|
737
738
|
infobox.forEach((item) => {
|
|
738
739
|
if (item.key === "简体中文名") title = typeof item.value === "string" ? item.value : item.value[0].v;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as fetchJsonWithContext, C as githubIssuePlugin, D as LanguageToColorMap, E as leetcodePlugin, M as arxivPlugin, O as camelcaseKeys, S as githubPrPlugin, T as githubCommitPlugin, _ as tmdbPlugin, a as editInput, b as bangumiPlugin, c as editUrlRow, d as matchUrl, f as useUrlMatcher, g as createMxSpacePlugin, h as plugins, i as useLinkCardFetchContext, j as generateColor, k as fetchGitHubApi, l as editWrapper, m as pluginMap, n as LinkCardSkeleton, o as editLinkIcon, p as getPluginByName, r as LinkCardFetchProvider, s as editPanel, t as LinkCardRenderer, u as semanticClassNames, v as qqMusicPlugin, w as githubDiscussionPlugin, x as githubRepoPlugin, y as neteaseMusicPlugin } from "./LinkCardRenderer-
|
|
1
|
+
import { A as fetchJsonWithContext, C as githubIssuePlugin, D as LanguageToColorMap, E as leetcodePlugin, M as arxivPlugin, O as camelcaseKeys, S as githubPrPlugin, T as githubCommitPlugin, _ as tmdbPlugin, a as editInput, b as bangumiPlugin, c as editUrlRow, d as matchUrl, f as useUrlMatcher, g as createMxSpacePlugin, h as plugins, i as useLinkCardFetchContext, j as generateColor, k as fetchGitHubApi, l as editWrapper, m as pluginMap, n as LinkCardSkeleton, o as editLinkIcon, p as getPluginByName, r as LinkCardFetchProvider, s as editPanel, t as LinkCardRenderer, u as semanticClassNames, v as qqMusicPlugin, w as githubDiscussionPlugin, x as githubRepoPlugin, y as neteaseMusicPlugin } from "./LinkCardRenderer-CeW33C1C.js";
|
|
2
2
|
import { $createLinkNode, $isLinkNode } from "@lexical/link";
|
|
3
3
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
4
4
|
import { $createNodeSelection, $createParagraphNode, $createTextNode, $getNodeByKey, $getSelection, $insertNodes, $isParagraphNode, $isRangeSelection, $setSelection, COMMAND_PRIORITY_LOW, PASTE_COMMAND, REDO_COMMAND, UNDO_COMMAND } from "lexical";
|
|
@@ -149,7 +149,7 @@ function LinkCardEditDecorator({ nodeKey, payload, children }) {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
//#endregion
|
|
152
|
-
//#region \0@oxc-project+runtime@0.
|
|
152
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/typeof.js
|
|
153
153
|
function _typeof(o) {
|
|
154
154
|
"@babel/helpers - typeof";
|
|
155
155
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -159,7 +159,7 @@ function _typeof(o) {
|
|
|
159
159
|
}, _typeof(o);
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region \0@oxc-project+runtime@0.
|
|
162
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPrimitive.js
|
|
163
163
|
function toPrimitive(t, r) {
|
|
164
164
|
if ("object" != _typeof(t) || !t) return t;
|
|
165
165
|
var e = t[Symbol.toPrimitive];
|
|
@@ -171,13 +171,13 @@ function toPrimitive(t, r) {
|
|
|
171
171
|
return ("string" === r ? String : Number)(t);
|
|
172
172
|
}
|
|
173
173
|
//#endregion
|
|
174
|
-
//#region \0@oxc-project+runtime@0.
|
|
174
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPropertyKey.js
|
|
175
175
|
function toPropertyKey(t) {
|
|
176
176
|
var i = toPrimitive(t, "string");
|
|
177
177
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
178
178
|
}
|
|
179
179
|
//#endregion
|
|
180
|
-
//#region \0@oxc-project+runtime@0.
|
|
180
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/defineProperty.js
|
|
181
181
|
function _defineProperty(e, r, t) {
|
|
182
182
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
183
183
|
value: t,
|
package/dist/static.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as fetchJsonWithContext, C as githubIssuePlugin, D as LanguageToColorMap, E as leetcodePlugin, M as arxivPlugin, O as camelcaseKeys, S as githubPrPlugin, T as githubCommitPlugin, _ as tmdbPlugin, b as bangumiPlugin, d as matchUrl, f as useUrlMatcher, g as createMxSpacePlugin, h as plugins, i as useLinkCardFetchContext, j as generateColor, k as fetchGitHubApi, m as pluginMap, n as LinkCardSkeleton, p as getPluginByName, r as LinkCardFetchProvider, t as LinkCardRenderer, v as qqMusicPlugin, w as githubDiscussionPlugin, x as githubRepoPlugin, y as neteaseMusicPlugin } from "./LinkCardRenderer-
|
|
1
|
+
import { A as fetchJsonWithContext, C as githubIssuePlugin, D as LanguageToColorMap, E as leetcodePlugin, M as arxivPlugin, O as camelcaseKeys, S as githubPrPlugin, T as githubCommitPlugin, _ as tmdbPlugin, b as bangumiPlugin, d as matchUrl, f as useUrlMatcher, g as createMxSpacePlugin, h as plugins, i as useLinkCardFetchContext, j as generateColor, k as fetchGitHubApi, m as pluginMap, n as LinkCardSkeleton, p as getPluginByName, r as LinkCardFetchProvider, t as LinkCardRenderer, v as qqMusicPlugin, w as githubDiscussionPlugin, x as githubRepoPlugin, y as neteaseMusicPlugin } from "./LinkCardRenderer-CeW33C1C.js";
|
|
2
2
|
export { LanguageToColorMap, LinkCardFetchProvider, LinkCardRenderer, LinkCardSkeleton, arxivPlugin, bangumiPlugin, camelcaseKeys, createMxSpacePlugin, fetchGitHubApi, fetchJsonWithContext, generateColor, getPluginByName, githubCommitPlugin, githubDiscussionPlugin, githubIssuePlugin, githubPrPlugin, githubRepoPlugin, leetcodePlugin, matchUrl, neteaseMusicPlugin, pluginMap, plugins, qqMusicPlugin, tmdbPlugin, useLinkCardFetchContext, useUrlMatcher };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-linkcard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Rich link preview card renderer with extensible URL plugins",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "^19.2.8",
|
|
40
40
|
"typescript": "^7.0.2",
|
|
41
41
|
"unplugin-dts": "^1.0.3",
|
|
42
|
-
"vite": "^8.2.
|
|
42
|
+
"vite": "^8.2.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@lexical/link": "^0.49.0",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"lucide-react": "^1.0.0",
|
|
49
49
|
"react": ">=19",
|
|
50
50
|
"react-dom": ">=19",
|
|
51
|
-
"@haklex/rich-editor": "^0.
|
|
52
|
-
"@haklex/rich-
|
|
53
|
-
"@haklex/rich-
|
|
51
|
+
"@haklex/rich-editor": "^0.37.0",
|
|
52
|
+
"@haklex/rich-style-token": "^0.37.0",
|
|
53
|
+
"@haklex/rich-editor-ui": "^0.37.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|