@haklex/rich-renderer-linkcard 0.32.0 → 0.34.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.
|
@@ -1416,7 +1416,7 @@ var LinkCardRenderer = (props) => {
|
|
|
1416
1416
|
return;
|
|
1417
1417
|
}
|
|
1418
1418
|
const style = getComputedStyle(el);
|
|
1419
|
-
const maxTwoLines = (Number.parseFloat(style.lineHeight) ||
|
|
1419
|
+
const maxTwoLines = (Number.parseFloat(style.lineHeight) || 21) * 2;
|
|
1420
1420
|
setShortDesc(el.scrollHeight <= maxTwoLines + 1);
|
|
1421
1421
|
}, [finalDesc, finalTitle]);
|
|
1422
1422
|
if (useDynamicFetch && !isValid) return null;
|
|
@@ -2,5 +2,5 @@ import { PluginRegistry } from './types';
|
|
|
2
2
|
export interface PasteLinkCardPluginProps {
|
|
3
3
|
pluginRegistry?: PluginRegistry;
|
|
4
4
|
}
|
|
5
|
-
export declare function PasteLinkCardPlugin({ pluginRegistry
|
|
5
|
+
export declare function PasteLinkCardPlugin({ pluginRegistry }: PasteLinkCardPluginProps): null;
|
|
6
6
|
//# sourceMappingURL=PasteLinkCardPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasteLinkCardPlugin.d.ts","sourceRoot":"","sources":["../src/PasteLinkCardPlugin.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"PasteLinkCardPlugin.d.ts","sourceRoot":"","sources":["../src/PasteLinkCardPlugin.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,wBAAwB;IACvC,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,cAAc,EAAE,EAAE,wBAAwB,QAoC/E"}
|
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-Cr8_JV6Z.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.142.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.142.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.142.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.142.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,
|
|
@@ -276,6 +276,7 @@ function PasteLinkCardPlugin({ pluginRegistry }) {
|
|
|
276
276
|
const [editor] = useLexicalComposerContext();
|
|
277
277
|
useEffect(() => {
|
|
278
278
|
return editor.registerCommand(PASTE_COMMAND, (event) => {
|
|
279
|
+
if (!(event instanceof ClipboardEvent)) return false;
|
|
279
280
|
const text = event.clipboardData?.getData("text/plain")?.trim();
|
|
280
281
|
if (!text) return false;
|
|
281
282
|
if (!matchUrl(text, pluginRegistry)) return false;
|
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-Cr8_JV6Z.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.34.0",
|
|
4
4
|
"description": "Rich link preview card renderer with extensible URL plugins",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,32 +25,32 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"react-intersection-observer": "^
|
|
28
|
+
"react-intersection-observer": "^11.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@lexical/link": "^0.
|
|
32
|
-
"@lexical/react": "^0.
|
|
33
|
-
"@types/react": "^19.2.
|
|
34
|
-
"@types/react-dom": "^19.2.
|
|
35
|
-
"@vanilla-extract/css": "^1.21.
|
|
36
|
-
"@vanilla-extract/vite-plugin": "^5.2.
|
|
37
|
-
"lexical": "^0.
|
|
31
|
+
"@lexical/link": "^0.49.0",
|
|
32
|
+
"@lexical/react": "^0.49.0",
|
|
33
|
+
"@types/react": "^19.2.18",
|
|
34
|
+
"@types/react-dom": "^19.2.4",
|
|
35
|
+
"@vanilla-extract/css": "^1.21.2",
|
|
36
|
+
"@vanilla-extract/vite-plugin": "^5.2.6",
|
|
37
|
+
"lexical": "^0.49.0",
|
|
38
38
|
"react": "^19.2.8",
|
|
39
39
|
"react-dom": "^19.2.8",
|
|
40
40
|
"typescript": "^7.0.2",
|
|
41
41
|
"unplugin-dts": "^1.0.3",
|
|
42
|
-
"vite": "^8.
|
|
42
|
+
"vite": "^8.2.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@lexical/link": "^0.
|
|
46
|
-
"@lexical/react": "^0.
|
|
47
|
-
"lexical": "^0.
|
|
45
|
+
"@lexical/link": "^0.49.0",
|
|
46
|
+
"@lexical/react": "^0.49.0",
|
|
47
|
+
"lexical": "^0.49.0",
|
|
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.34.0",
|
|
52
|
+
"@haklex/rich-editor-ui": "^0.34.0",
|
|
53
|
+
"@haklex/rich-style-token": "^0.34.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|