@haklex/rich-ext-embed 0.32.0 → 0.33.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.139.0/helpers/esm/typeof.js
182
+ //#region \0@oxc-project+runtime@0.142.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.139.0/helpers/esm/toPrimitive.js
192
+ //#region \0@oxc-project+runtime@0.142.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.139.0/helpers/esm/toPropertyKey.js
204
+ //#region \0@oxc-project+runtime@0.142.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.139.0/helpers/esm/defineProperty.js
210
+ //#region \0@oxc-project+runtime@0.142.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,
@@ -1 +1 @@
1
- {"version":3,"file":"EmbedPlugin.d.ts","sourceRoot":"","sources":["../src/EmbedPlugin.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,oBAAoB,0CAAwC,CAAA;AAEzE,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB;AAED,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,EAAE,gBAAgB,QA6D9D"}
1
+ {"version":3,"file":"EmbedPlugin.d.ts","sourceRoot":"","sources":["../src/EmbedPlugin.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB,0CAAwC,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,EAAE,gBAAgB,QA2D9D"}
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-Bj7R8TDp.js";
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-CKuT3NSb.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";
@@ -59,6 +59,7 @@ function EmbedPlugin({ selfHostnames }) {
59
59
  const thinkingMatcher = useMemo(() => selfHostnames?.length ? createSelfThinkingMatcher(selfHostnames) : void 0, [selfHostnames]);
60
60
  useEffect(() => {
61
61
  const removePaste = editor.registerCommand(PASTE_COMMAND, (event) => {
62
+ if (!(event instanceof ClipboardEvent)) return false;
62
63
  const text = event.clipboardData?.getData("text/plain")?.trim();
63
64
  if (!text) return false;
64
65
  let url;
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-Bj7R8TDp.js";
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-CKuT3NSb.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.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "Embed extension for Twitter, YouTube, etc.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,29 +29,29 @@
29
29
  "react-tweet": "npm:@innei/react-tweet@3.4.3"
30
30
  },
31
31
  "devDependencies": {
32
- "@lexical/react": "^0.48.0",
33
- "@types/react": "^19.2.17",
34
- "@types/react-dom": "^19.2.3",
35
- "@vanilla-extract/css": "^1.21.1",
36
- "@vanilla-extract/vite-plugin": "^5.2.5",
37
- "lexical": "^0.48.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
- "shiki": "^4.3.1",
40
+ "shiki": "^4.4.1",
41
41
  "typescript": "^7.0.2",
42
42
  "unplugin-dts": "^1.0.3",
43
- "vite": "^8.1.5"
43
+ "vite": "^8.2.0"
44
44
  },
45
45
  "peerDependencies": {
46
- "@lexical/react": "^0.47.0",
47
- "lexical": "^0.47.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
51
  "shiki": ">=4.0.0",
52
- "@haklex/rich-editor": "^0.32.0",
53
- "@haklex/rich-editor-ui": "^0.32.0",
54
- "@haklex/rich-style-token": "^0.32.0"
52
+ "@haklex/rich-style-token": "^0.33.0",
53
+ "@haklex/rich-editor-ui": "^0.33.0",
54
+ "@haklex/rich-editor": "^0.33.0"
55
55
  },
56
56
  "peerDependenciesMeta": {
57
57
  "shiki": {