@haklex/rich-ext-embed 0.36.0 → 0.38.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.
|
@@ -179,7 +179,7 @@ function matchEmbedUrl(url, selfThinkingMatcher) {
|
|
|
179
179
|
return null;
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
|
-
//#region \0@oxc-project+runtime@0.
|
|
182
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/typeof.js
|
|
183
183
|
function _typeof(o) {
|
|
184
184
|
"@babel/helpers - typeof";
|
|
185
185
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -189,7 +189,7 @@ function _typeof(o) {
|
|
|
189
189
|
}, _typeof(o);
|
|
190
190
|
}
|
|
191
191
|
//#endregion
|
|
192
|
-
//#region \0@oxc-project+runtime@0.
|
|
192
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPrimitive.js
|
|
193
193
|
function toPrimitive(t, r) {
|
|
194
194
|
if ("object" != _typeof(t) || !t) return t;
|
|
195
195
|
var e = t[Symbol.toPrimitive];
|
|
@@ -201,13 +201,13 @@ function toPrimitive(t, r) {
|
|
|
201
201
|
return ("string" === r ? String : Number)(t);
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
|
-
//#region \0@oxc-project+runtime@0.
|
|
204
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPropertyKey.js
|
|
205
205
|
function toPropertyKey(t) {
|
|
206
206
|
var i = toPrimitive(t, "string");
|
|
207
207
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
210
|
-
//#region \0@oxc-project+runtime@0.
|
|
210
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/defineProperty.js
|
|
211
211
|
function _defineProperty(e, r, t) {
|
|
212
212
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
213
213
|
value: t,
|
|
@@ -368,12 +368,14 @@ function GithubFileEmbed({ url, href }) {
|
|
|
368
368
|
const matchResult = url.hash.match(/L\d+/g);
|
|
369
369
|
let startLine = 0;
|
|
370
370
|
let endLine;
|
|
371
|
-
if (matchResult)
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
371
|
+
if (matchResult) {
|
|
372
|
+
if (matchResult.length === 1) {
|
|
373
|
+
startLine = Number.parseInt(matchResult[0].slice(1)) - 1;
|
|
374
|
+
endLine = startLine + 1;
|
|
375
|
+
} else {
|
|
376
|
+
startLine = Number.parseInt(matchResult[0].slice(1)) - 1;
|
|
377
|
+
endLine = Number.parseInt(matchResult[1].slice(1));
|
|
378
|
+
}
|
|
377
379
|
}
|
|
378
380
|
const [content, setContent] = useState(null);
|
|
379
381
|
const [highlightedHtml, setHighlightedHtml] = useState(null);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as EmbedRendererProvider, a as EmbedStaticRenderer, c as isAppleMusicUrl, d as isGistUrl, f as isGithubFilePreviewUrl, g as matchEmbedUrl, h as isYoutubeUrl, i as EmbedNode, l as isBilibiliVideoUrl, m as isTweetUrl, n as $createEmbedNode, o as _defineProperty, p as isSpotifyUrl, r as $isEmbedNode, s as createSelfThinkingMatcher, t as EmbedLinkRenderer, u as isCodesandboxUrl, v as useEmbedRenderers } from "./EmbedLinkRenderer-
|
|
1
|
+
import { _ as EmbedRendererProvider, a as EmbedStaticRenderer, c as isAppleMusicUrl, d as isGistUrl, f as isGithubFilePreviewUrl, g as matchEmbedUrl, h as isYoutubeUrl, i as EmbedNode, l as isBilibiliVideoUrl, m as isTweetUrl, n as $createEmbedNode, o as _defineProperty, p as isSpotifyUrl, r as $isEmbedNode, s as createSelfThinkingMatcher, t as EmbedLinkRenderer, u as isCodesandboxUrl, v as useEmbedRenderers } from "./EmbedLinkRenderer-Df_Ta40q.js";
|
|
2
2
|
import { $insertNodes, COMMAND_PRIORITY_LOW, PASTE_COMMAND, createCommand } from "lexical";
|
|
3
3
|
import { createElement, useEffect, useMemo } from "react";
|
|
4
4
|
import { Code } from "lucide-react";
|
package/dist/static.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as EmbedRendererProvider, a as EmbedStaticRenderer, c as isAppleMusicUrl, d as isGistUrl, f as isGithubFilePreviewUrl, g as matchEmbedUrl, h as isYoutubeUrl, i as EmbedNode, l as isBilibiliVideoUrl, m as isTweetUrl, n as $createEmbedNode, p as isSpotifyUrl, r as $isEmbedNode, s as createSelfThinkingMatcher, t as EmbedLinkRenderer, u as isCodesandboxUrl, v as useEmbedRenderers } from "./EmbedLinkRenderer-
|
|
1
|
+
import { _ as EmbedRendererProvider, a as EmbedStaticRenderer, c as isAppleMusicUrl, d as isGistUrl, f as isGithubFilePreviewUrl, g as matchEmbedUrl, h as isYoutubeUrl, i as EmbedNode, l as isBilibiliVideoUrl, m as isTweetUrl, n as $createEmbedNode, p as isSpotifyUrl, r as $isEmbedNode, s as createSelfThinkingMatcher, t as EmbedLinkRenderer, u as isCodesandboxUrl, v as useEmbedRenderers } from "./EmbedLinkRenderer-Df_Ta40q.js";
|
|
2
2
|
//#region src/static.ts
|
|
3
3
|
var embedNodes = [EmbedNode];
|
|
4
4
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-ext-embed",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Embed extension for Twitter, YouTube, etc.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"shiki": "^4.4.3",
|
|
41
41
|
"typescript": "^7.0.2",
|
|
42
42
|
"unplugin-dts": "^1.0.3",
|
|
43
|
-
"vite": "^8.2.
|
|
43
|
+
"vite": "^8.2.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@lexical/react": "^0.49.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"react": ">=19",
|
|
50
50
|
"react-dom": ">=19",
|
|
51
51
|
"shiki": ">=4.0.0",
|
|
52
|
-
"@haklex/rich-editor": "^0.
|
|
53
|
-
"@haklex/rich-editor-ui": "^0.
|
|
54
|
-
"@haklex/rich-style-token": "^0.
|
|
52
|
+
"@haklex/rich-editor": "^0.38.0",
|
|
53
|
+
"@haklex/rich-editor-ui": "^0.38.0",
|
|
54
|
+
"@haklex/rich-style-token": "^0.38.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"shiki": {
|