@blocklet/editor 1.6.264 → 2.0.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.
@@ -4,6 +4,7 @@ import { $isListNode, $isListItemNode } from '@lexical/list';
4
4
  import { $dfs, $findMatchingParent } from '@lexical/utils';
5
5
  import { fetchEventSource } from '@microsoft/fetch-event-source';
6
6
  import { $createLinkNode, $isLinkNode } from '@lexical/link';
7
+ import { joinURL } from 'ufo';
7
8
  import { blockletExists, getBlockletMountPointInfo, isValidUrl } from '../utils';
8
9
  import { $getDepth } from '../../lexical-utils';
9
10
  const REGEX_INVALID_SEQUENCE = /^[!@#$%^&*()_+\-=\\[\]{};':"\\|,.<>/?].*$/;
@@ -18,7 +19,7 @@ export const defaultTranslateAPI = async ({ texts, sourceLanguage, targetLanguag
18
19
  const total = Object.keys(texts).length;
19
20
  let done = 0;
20
21
  try {
21
- await fetchEventSource(`${getBlockletMountPointInfo('did-comments').mountPoint}/api/ai/translate`, {
22
+ await fetchEventSource(joinURL(getBlockletMountPointInfo('did-comments').mountPoint, '/api/ai/translate'), {
22
23
  method: 'POST',
23
24
  headers: { 'Content-Type': 'application/json' },
24
25
  body: JSON.stringify({ texts, sourceLanguage, targetLanguage }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/editor",
3
- "version": "1.6.264",
3
+ "version": "2.0.0",
4
4
  "main": "lib/index.js",
5
5
  "scripts": {
6
6
  "dev": "npm run storybook",
@@ -40,7 +40,7 @@
40
40
  "@arcblock/ux": "^2.9.77",
41
41
  "@blocklet/embed": "^0.1.11",
42
42
  "@blocklet/pages-kit": "^0.2.302",
43
- "@blocklet/pdf": "1.6.264",
43
+ "@blocklet/pdf": "2.0.0",
44
44
  "@excalidraw/excalidraw": "^0.14.2",
45
45
  "@iconify/iconify": "^3.0.1",
46
46
  "@iconify/icons-tabler": "^1.2.95",
@@ -113,5 +113,5 @@
113
113
  "react": "*",
114
114
  "react-dom": "*"
115
115
  },
116
- "gitHead": "a8ddc71b34312b738cd8e879fef8325b69df0132"
116
+ "gitHead": "519537bb4c513e973dc4e9506ec15f3fdea80889"
117
117
  }