@4399ywkf/editor 0.1.2 → 0.2.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/dist/{DocView-5KS7B4DA.js → DocView-BPODKQ57.js} +3 -3
- package/dist/{DocView-5KS7B4DA.js.map → DocView-BPODKQ57.js.map} +1 -1
- package/dist/{chunk-G6WM2PSU.js → chunk-3GZSG6KH.js} +34 -7
- package/dist/chunk-3GZSG6KH.js.map +1 -0
- package/dist/doc-runtime.d.ts +325 -0
- package/dist/doc-runtime.js +687 -0
- package/dist/doc-runtime.js.map +1 -0
- package/dist/doc.js +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +22 -0
- package/package.json +15 -11
- package/dist/chunk-G6WM2PSU.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorConfigProvider, NotionEditor } from './chunk-
|
|
1
|
+
import { EditorConfigProvider, NotionEditor } from './chunk-3GZSG6KH.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
function DocView({ content, readOnly, room, className, onReady }) {
|
|
@@ -14,5 +14,5 @@ function DocView({ content, readOnly, room, className, onReady }) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export { DocView as default };
|
|
17
|
-
//# sourceMappingURL=DocView-
|
|
18
|
-
//# sourceMappingURL=DocView-
|
|
17
|
+
//# sourceMappingURL=DocView-BPODKQ57.js.map
|
|
18
|
+
//# sourceMappingURL=DocView-BPODKQ57.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/views/DocView.tsx"],"names":[],"mappings":";;;AAMe,SAAR,QAAyB,EAAE,OAAA,EAAS,UAAU,IAAA,EAAM,SAAA,EAAW,SAAQ,EAAsB;AAClG,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EACH,8BAAC,oBAAA,EAAA,EAAqB,MAAA,EAAQ,EAAC,EAC7B,QAAA,kBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,MAAM,IAAA,IAAQ,SAAA;AAAA,MACd,OAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA,EAAe,CAAC,MAAA,KAAmB,OAAA,GAAU,MAAM;AAAA;AAAA,KAEvD,CAAA,EACF,CAAA;AAEJ","file":"DocView-
|
|
1
|
+
{"version":3,"sources":["../src/views/DocView.tsx"],"names":[],"mappings":";;;AAMe,SAAR,QAAyB,EAAE,OAAA,EAAS,UAAU,IAAA,EAAM,SAAA,EAAW,SAAQ,EAAsB;AAClG,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EACH,8BAAC,oBAAA,EAAA,EAAqB,MAAA,EAAQ,EAAC,EAC7B,QAAA,kBAAA,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,MAAM,IAAA,IAAQ,SAAA;AAAA,MACd,OAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA,EAAe,CAAC,MAAA,KAAmB,OAAA,GAAU,MAAM;AAAA;AAAA,KAEvD,CAAA,EACF,CAAA;AAEJ","file":"DocView-BPODKQ57.js","sourcesContent":["import type { Editor } from \"@tiptap/react\"\nimport { EditorConfigProvider } from \"../contexts/editor-config-context\"\nimport { NotionEditor } from \"../components/tiptap-templates/notion-like/notion-like-editor\"\nimport type { DocumentViewProps } from \"../registry\"\n\n/** doc 通道:云文档与本地 doc 是同一套 tiptap,不做区分 */\nexport default function DocView({ content, readOnly, room, className, onReady }: DocumentViewProps) {\n return (\n <div className={className}>\n <EditorConfigProvider config={{}}>\n <NotionEditor\n room={room ?? \"default\"}\n content={content as string}\n readOnly={readOnly}\n onEditorReady={(editor: Editor) => onReady?.(editor)}\n />\n </EditorConfigProvider>\n </div>\n )\n}\n"]}
|
|
@@ -21692,16 +21692,43 @@ function EditorProvider(props) {
|
|
|
21692
21692
|
onRehostProgress
|
|
21693
21693
|
}),
|
|
21694
21694
|
UniqueID.configure({
|
|
21695
|
+
/**
|
|
21696
|
+
* 带稳定 id 的节点类型 —— 也就是 AI 能直接寻址的那些(见 doc-runtime)。
|
|
21697
|
+
*
|
|
21698
|
+
* 原本只配了上面 9 种块级类型,于是 listItem / taskItem / tableCell /
|
|
21699
|
+
* columns / column / image 这些**结构**节点全都没 id:AI 能读到它们,
|
|
21700
|
+
* 却没法指着其中一个说「改这个」。doc_modify_nodes 的 modify 要求
|
|
21701
|
+
* litexml 带 id,所以「把第 3 个列表项加粗」「把这张图换掉」
|
|
21702
|
+
* 「改这个单元格的底色」在旧配置下根本表达不出来。
|
|
21703
|
+
*
|
|
21704
|
+
* 代价是每个此类节点在文档里多一个 id 属性(大表格尤其明显)。
|
|
21705
|
+
* 拿可寻址性换体积,这笔是划算的 —— 寻址不了的能力等于没有。
|
|
21706
|
+
*/
|
|
21695
21707
|
types: [
|
|
21696
|
-
|
|
21708
|
+
// 块级容器
|
|
21697
21709
|
"paragraph",
|
|
21698
|
-
"bulletList",
|
|
21699
|
-
"orderedList",
|
|
21700
|
-
"taskList",
|
|
21701
21710
|
"heading",
|
|
21702
21711
|
"blockquote",
|
|
21703
21712
|
"codeBlock",
|
|
21704
|
-
"tocNode"
|
|
21713
|
+
"tocNode",
|
|
21714
|
+
// 列表:容器和条目都要,否则改不了单条
|
|
21715
|
+
"bulletList",
|
|
21716
|
+
"orderedList",
|
|
21717
|
+
"listItem",
|
|
21718
|
+
"taskList",
|
|
21719
|
+
"taskItem",
|
|
21720
|
+
// 表格:结构性改动走 (tableId,row,col),但改单元格属性只能靠 id
|
|
21721
|
+
"table",
|
|
21722
|
+
"tableCell",
|
|
21723
|
+
"tableHeader",
|
|
21724
|
+
// 分栏
|
|
21725
|
+
"columns",
|
|
21726
|
+
"column",
|
|
21727
|
+
// 媒体
|
|
21728
|
+
"image",
|
|
21729
|
+
"video",
|
|
21730
|
+
"audio",
|
|
21731
|
+
"fileAttachment"
|
|
21705
21732
|
],
|
|
21706
21733
|
filterTransaction: (transaction) => !isChangeOrigin(transaction)
|
|
21707
21734
|
}),
|
|
@@ -21834,5 +21861,5 @@ function ArticleViewer({ content, placeholder = "" }) {
|
|
|
21834
21861
|
}
|
|
21835
21862
|
|
|
21836
21863
|
export { ArticleViewer, Audio, Button, CollabContext, CollabProvider, Column, Columns, DEFAULT_MAX_FILE_SIZES, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditorConfigProvider, EditorContentArea, EditorProvider, FileAttachment, FloatingElement, HIDE_FLOATING_META, LoadingSpinner, MAC_SYMBOLS, MAX_FILE_SIZE, MediaUploadButton, MediaUploadPlaceholder, NotionEditor, NotionEditorContent, PasteDropMedia, Popover, PopoverContent, PopoverTrigger, SR_ONLY, Separator, Spacer, Toolbar, ToolbarGroup, ToolbarSeparator, UiState, UserContext, UserProvider, Video, clamp, cn, defaultUiState, detectMediaKind, findNodeAtPosition, findNodePosition, findSelectionPosition, focusNextNode, formatShortcutKey, getAvatar, getElementOverflowPosition, getNodeDisplayName, getSelectedBlockNodes, getSelectedNodesOfType, getSelectionBoundingRect, getUrlParam, handleImageUpload, hasContentAbove, isAllowedUri, isExtensionAvailable, isMac, isMarkInSchema, isNodeInSchema, isNodeTypeSelected, isSelectionValid, isTextSelectionValid, isValidPosition, markHideFloatingOnNext, parseShortcutKeys, pickFile, removeEmptyParagraphs, resolveMaxSize, runMediaUpload, sanitizeUrl, selectCurrentBlockContent, selectNodeAndHideFloating, selectionWithinConvertibleTypes, updateNodesAttr, useCollab, useCollaboration, useComposedRef, useCursorVisibility, useEditorConfig, useElementRect, useFloatingElement, useFloatingToolbarVisibility, useIsBreakpoint, useIsomorphicLayoutEffect, useMenuNavigation, useOnClickOutside, useThrottledCallback, useTiptapEditor, useUiEditorState, useUnmount, useUser, useWindowSize, use_ui_editor_state_default };
|
|
21837
|
-
//# sourceMappingURL=chunk-
|
|
21838
|
-
//# sourceMappingURL=chunk-
|
|
21864
|
+
//# sourceMappingURL=chunk-3GZSG6KH.js.map
|
|
21865
|
+
//# sourceMappingURL=chunk-3GZSG6KH.js.map
|