@haklex/rich-renderer-linkcard 0.23.0 → 0.25.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.
- package/README.md +20 -25
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -12,24 +12,24 @@ pnpm add @haklex/rich-renderer-linkcard
|
|
|
12
12
|
|
|
13
13
|
## Peer Dependencies
|
|
14
14
|
|
|
15
|
-
| Package
|
|
16
|
-
|
|
|
17
|
-
| `lexical`
|
|
18
|
-
| `@lexical/react` | `^0.
|
|
19
|
-
| `@lexical/link`
|
|
20
|
-
| `react`
|
|
21
|
-
| `react-dom`
|
|
15
|
+
| Package | Version |
|
|
16
|
+
| ---------------- | --------- |
|
|
17
|
+
| `lexical` | `^0.45.0` |
|
|
18
|
+
| `@lexical/react` | `^0.45.0` |
|
|
19
|
+
| `@lexical/link` | `^0.45.0` |
|
|
20
|
+
| `react` | `>=19` |
|
|
21
|
+
| `react-dom` | `>=19` |
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
25
|
```tsx
|
|
26
|
-
import { LinkCardRenderer } from '@haklex/rich-renderer-linkcard/static'
|
|
26
|
+
import { LinkCardRenderer } from '@haklex/rich-renderer-linkcard/static';
|
|
27
27
|
|
|
28
28
|
// Register in a static RendererConfig
|
|
29
29
|
const rendererConfig = {
|
|
30
30
|
// ...other renderers
|
|
31
31
|
LinkCard: LinkCardRenderer,
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
For edit mode with link card conversion and paste support:
|
|
@@ -41,27 +41,22 @@ import {
|
|
|
41
41
|
ConvertToLinkCardAction,
|
|
42
42
|
PasteLinkCardPlugin,
|
|
43
43
|
LinkCardFetchProvider,
|
|
44
|
-
} from '@haklex/rich-renderer-linkcard'
|
|
44
|
+
} from '@haklex/rich-renderer-linkcard';
|
|
45
45
|
|
|
46
46
|
// Wrap editor with fetch provider for metadata resolution
|
|
47
47
|
<LinkCardFetchProvider>
|
|
48
|
-
<Editor
|
|
49
|
-
|
|
50
|
-
plugins={[
|
|
51
|
-
<PasteLinkCardPlugin />,
|
|
52
|
-
]}
|
|
53
|
-
/>
|
|
54
|
-
</LinkCardFetchProvider>
|
|
48
|
+
<Editor nodes={linkCardEditNodes} plugins={[<PasteLinkCardPlugin />]} />
|
|
49
|
+
</LinkCardFetchProvider>;
|
|
55
50
|
```
|
|
56
51
|
|
|
57
52
|
### Using URL-specific plugins
|
|
58
53
|
|
|
59
54
|
```tsx
|
|
60
|
-
import { githubRepoPlugin, githubPrPlugin } from '@haklex/rich-renderer-linkcard'
|
|
55
|
+
import { githubRepoPlugin, githubPrPlugin } from '@haklex/rich-renderer-linkcard';
|
|
61
56
|
|
|
62
57
|
// Plugins are auto-registered; use matchUrl to detect supported URLs
|
|
63
|
-
import { matchUrl } from '@haklex/rich-renderer-linkcard'
|
|
64
|
-
const matched = matchUrl('https://github.com/user/repo')
|
|
58
|
+
import { matchUrl } from '@haklex/rich-renderer-linkcard';
|
|
59
|
+
const matched = matchUrl('https://github.com/user/repo');
|
|
65
60
|
```
|
|
66
61
|
|
|
67
62
|
## Exports
|
|
@@ -102,11 +97,11 @@ const matched = matchUrl('https://github.com/user/repo')
|
|
|
102
97
|
|
|
103
98
|
### Sub-path Exports
|
|
104
99
|
|
|
105
|
-
| Path
|
|
106
|
-
|
|
|
107
|
-
| `@haklex/rich-renderer-linkcard`
|
|
108
|
-
| `@haklex/rich-renderer-linkcard/static`
|
|
109
|
-
| `@haklex/rich-renderer-linkcard/style.css` | Stylesheet
|
|
100
|
+
| Path | Description |
|
|
101
|
+
| ------------------------------------------ | -------------------------------------- |
|
|
102
|
+
| `@haklex/rich-renderer-linkcard` | Full exports (edit + static + plugins) |
|
|
103
|
+
| `@haklex/rich-renderer-linkcard/static` | Static-only renderer |
|
|
104
|
+
| `@haklex/rich-renderer-linkcard/style.css` | Stylesheet |
|
|
110
105
|
|
|
111
106
|
## Part of Haklex
|
|
112
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-linkcard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Rich link preview card renderer with extensible URL plugins",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -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-editor-ui": "0.
|
|
53
|
-
"@haklex/rich-style-token": "0.
|
|
51
|
+
"@haklex/rich-editor": "0.25.0",
|
|
52
|
+
"@haklex/rich-editor-ui": "0.25.0",
|
|
53
|
+
"@haklex/rich-style-token": "0.25.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|