@4399ywkf/editor 0.14.0 → 0.14.1
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-FYAAUPSK.js → DocView-MZKHSN67.js} +3 -3
- package/dist/{DocView-FYAAUPSK.js.map → DocView-MZKHSN67.js.map} +1 -1
- package/dist/{chunk-6BJB4YWS.js → chunk-IKYVPJQ5.js} +50 -8
- package/dist/chunk-IKYVPJQ5.js.map +1 -0
- package/dist/doc-standalone.js +112 -68
- package/dist/doc-standalone.js.map +1 -1
- package/dist/doc.js +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6BJB4YWS.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EditorConfigProvider, NotionEditor } from './chunk-
|
|
1
|
+
import { EditorConfigProvider, NotionEditor } from './chunk-IKYVPJQ5.js';
|
|
2
2
|
import './chunk-MGSVKKK7.js';
|
|
3
3
|
import './chunk-UD6MDBTN.js';
|
|
4
4
|
import './chunk-ABMZOL26.js';
|
|
@@ -18,5 +18,5 @@ function DocView({ content, contentFormat, readOnly, room, className, onReady })
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export { DocView as default };
|
|
21
|
-
//# sourceMappingURL=DocView-
|
|
22
|
-
//# sourceMappingURL=DocView-
|
|
21
|
+
//# sourceMappingURL=DocView-MZKHSN67.js.map
|
|
22
|
+
//# sourceMappingURL=DocView-MZKHSN67.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/views/DocView.tsx"],"names":[],"mappings":";;;;;;AAMe,SAAR,OAAA,CAAyB,EAAE,OAAA,EAAS,aAAA,EAAe,UAAU,IAAA,EAAM,SAAA,EAAW,SAAQ,EAAsB;AACjH,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,aAAA;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,OAAA,CAAyB,EAAE,OAAA,EAAS,aAAA,EAAe,UAAU,IAAA,EAAM,SAAA,EAAW,SAAQ,EAAsB;AACjH,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,aAAA;AAAA,MACA,QAAA;AAAA,MACA,aAAA,EAAe,CAAC,MAAA,KAAmB,OAAA,GAAU,MAAM;AAAA;AAAA,KAEvD,CAAA,EACF,CAAA;AAEJ","file":"DocView-MZKHSN67.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, contentFormat, 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 contentFormat={contentFormat}\n readOnly={readOnly}\n onEditorReady={(editor: Editor) => onReady?.(editor)}\n />\n </EditorConfigProvider>\n </div>\n )\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useTiptapEditor, isExtensionAvailable, isNodeInSchema, Button, cn, getSelectionBoundingRect, isSelectionValid, getSelectedNodesOfType, selectCurrentBlockContent, Popover, PopoverTrigger, PopoverContent, isValidPosition, updateNodesAttr, parseShortcutKeys, isMarkInSchema, isNodeTypeSelected, SR_ONLY, selectionWithinConvertibleTypes, getSelectedBlockNodes, findNodePosition, sanitizeUrl, clamp,
|
|
2
|
-
import { resolveCalloutLook, MARKDOWN_SEQ_PATTERN, markdownSeqFor, attrsForMenuAction, AUTO_NUMBER_MAX_LEVEL, AUTO, HIGHLIGHT_SWATCHES, BLOCK_BACKGROUND_SWATCHES, defaultReminder, normalizeReminder, reminderText, reminderColor, LEGACY_SWATCHES, TEXT_SWATCHES, createCodeHighlighter, swatchValue, resolveCodeLanguage, getCodeBlockTitle, CALLOUT_EMOJIS, CALLOUT_BORDER_SWATCHES, FEISHU_DEFAULT_CALLOUT,
|
|
1
|
+
import { useTiptapEditor, isExtensionAvailable, isNodeInSchema, Button, cn, getSelectionBoundingRect, isSelectionValid, getSelectedNodesOfType, selectCurrentBlockContent, Popover, PopoverTrigger, PopoverContent, isValidPosition, updateNodesAttr, parseShortcutKeys, isMarkInSchema, isNodeTypeSelected, SR_ONLY, selectionWithinConvertibleTypes, getSelectedBlockNodes, findNodePosition, sanitizeUrl, clamp, getAvatar, getUrlParam, handleImageUpload, isTextSelectionValid, AIButton, focusNextNode, getElementOverflowPosition, getNodeDisplayName } from './chunk-MGSVKKK7.js';
|
|
2
|
+
import { resolveCalloutLook, MARKDOWN_SEQ_PATTERN, markdownSeqFor, attrsForMenuAction, AUTO_NUMBER_MAX_LEVEL, AUTO, HIGHLIGHT_SWATCHES, BLOCK_BACKGROUND_SWATCHES, defaultReminder, normalizeReminder, reminderText, reminderColor, LEGACY_SWATCHES, TEXT_SWATCHES, createCodeHighlighter, swatchValue, resolveCodeLanguage, orderText, resolveShikiTheme, computeHeadingOrders, resolveColorToHex, getCodeBlockTitle, CALLOUT_EMOJIS, CALLOUT_BORDER_SWATCHES, FEISHU_DEFAULT_CALLOUT, numberMenuState, MAX_SEQ_VALUE, filterCodeLanguages, pairedBorderFor, notifyOptions, withDate, withWholeDay, withTime, formatTime, withNotify, withNotifyOffset, reminderFullText, remindUsersLine, calendarDays, TIME_SLOTS, parseTimeInput } from './chunk-UD6MDBTN.js';
|
|
3
3
|
import { normalizeDiagram, defaultDiagram, toMermaid, DEFAULT_DIAGRAM_HEIGHT, clampDiagramHeight, toOutline, SHAPE_SIZE } from './chunk-ABMZOL26.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { createContext, memo, forwardRef, useState, useCallback, useRef, useEffect, useMemo, lazy, useLayoutEffect,
|
|
5
|
+
import { createContext, memo, forwardRef, useState, useCallback, useRef, useEffect, useMemo, lazy, useLayoutEffect, useContext, Suspense, useReducer, useId, Children, isValidElement, cloneElement } from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
7
7
|
import { createPortal, flushSync } from 'react-dom';
|
|
8
8
|
import { Extension, Node as Node$2, mergeAttributes as mergeAttributes$1, textblockTypeInputRule, Mark, InputRule, PasteRule, getChangedRanges, combineTransactionSteps, getTextSerializersFromSchema, getTextBetween, generateJSON, generateHTML } from '@tiptap/core';
|
|
@@ -11,7 +11,7 @@ import { Fragment, Slice, Mark as Mark$1, DOMSerializer } from '@tiptap/pm/model
|
|
|
11
11
|
import { PluginKey, Plugin, TextSelection, Selection, NodeSelection, SelectionRange } from '@tiptap/pm/state';
|
|
12
12
|
import { createGlobalStyle, useTheme } from 'antd-style';
|
|
13
13
|
import { serialize, compile, stringify } from 'stylis';
|
|
14
|
-
import { Node as Node$1,
|
|
14
|
+
import { Node as Node$1, mergeAttributes, Extension as Extension$1, ReactNodeViewRenderer as ReactNodeViewRenderer$1, useEditorState, EditorContext, EditorContent, useEditor, isNodeSelection, NodeViewWrapper, NodeViewContent } from '@tiptap/react';
|
|
15
15
|
import { useHotkeys } from 'react-hotkeys-hook';
|
|
16
16
|
import { canJoin, ReplaceStep, Mapping } from '@tiptap/pm/transform';
|
|
17
17
|
import { CodeBlock } from '@tiptap/extension-code-block';
|
|
@@ -31,7 +31,7 @@ import { Superscript } from '@tiptap/extension-superscript';
|
|
|
31
31
|
import { Subscript } from '@tiptap/extension-subscript';
|
|
32
32
|
import { TextAlign } from '@tiptap/extension-text-align';
|
|
33
33
|
import { UniqueID } from '@tiptap/extension-unique-id';
|
|
34
|
-
import {
|
|
34
|
+
import { Emoji, gitHubEmojis } from '@tiptap/extension-emoji';
|
|
35
35
|
import { TableOfContents, getHierarchicalIndexes } from '@tiptap/extension-table-of-contents';
|
|
36
36
|
import TiptapHorizontalRule from '@tiptap/extension-horizontal-rule';
|
|
37
37
|
import { Heading as Heading$1 } from '@tiptap/extension-heading';
|
|
@@ -13951,9 +13951,27 @@ function editorComponentCss(ctx) {
|
|
|
13951
13951
|
return COMPONENT_STYLES.map((fn) => fn(ctx)).join("\n");
|
|
13952
13952
|
}
|
|
13953
13953
|
var SSR_PSEUDO_FLAG = "/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */";
|
|
13954
|
+
var PSEUDO = /:(?:first|nth|nth-last)-child/;
|
|
13955
|
+
function markUnsafePseudo(flat) {
|
|
13956
|
+
const parts = [];
|
|
13957
|
+
let segStart = 0;
|
|
13958
|
+
for (let i = 0; i < flat.length; i++) {
|
|
13959
|
+
const ch = flat.charCodeAt(i);
|
|
13960
|
+
if (ch !== 123 && ch !== 125) continue;
|
|
13961
|
+
const seg = flat.slice(segStart, i);
|
|
13962
|
+
parts.push(ch === 123 && PSEUDO.test(seg) ? `${seg} ${SSR_PSEUDO_FLAG} {` : seg + flat[i]);
|
|
13963
|
+
segStart = i + 1;
|
|
13964
|
+
}
|
|
13965
|
+
parts.push(flat.slice(segStart));
|
|
13966
|
+
return parts.join("");
|
|
13967
|
+
}
|
|
13968
|
+
var cache;
|
|
13954
13969
|
function prepareForEmotion(css) {
|
|
13970
|
+
if (cache?.input === css) return cache.output;
|
|
13955
13971
|
const flat = serialize(compile(css), stringify).replace(/\n/g, " ");
|
|
13956
|
-
|
|
13972
|
+
const output = markUnsafePseudo(flat);
|
|
13973
|
+
cache = { input: css, output };
|
|
13974
|
+
return output;
|
|
13957
13975
|
}
|
|
13958
13976
|
|
|
13959
13977
|
// src/theme/style-context.ts
|
|
@@ -14638,6 +14656,30 @@ var getColorFromLocalStorage = () => {
|
|
|
14638
14656
|
var getUserIdFromLocalStorage = () => {
|
|
14639
14657
|
return getFromLocalStorage("_tiptap_user_id", () => uuid());
|
|
14640
14658
|
};
|
|
14659
|
+
function isReactRenderMutation(mutation, dom, contentDOM) {
|
|
14660
|
+
if (mutation.type !== "childList" || !dom || !contentDOM) return false;
|
|
14661
|
+
if (contentDOM.contains(mutation.target)) return false;
|
|
14662
|
+
if (mutation.target === dom) return true;
|
|
14663
|
+
const changed = [
|
|
14664
|
+
...Array.from(mutation.addedNodes ?? []),
|
|
14665
|
+
...Array.from(mutation.removedNodes ?? [])
|
|
14666
|
+
];
|
|
14667
|
+
return changed.includes(contentDOM);
|
|
14668
|
+
}
|
|
14669
|
+
function guardReactRenderMutations(view) {
|
|
14670
|
+
const v = view;
|
|
14671
|
+
const original = v.ignoreMutation;
|
|
14672
|
+
if (typeof original !== "function") return view;
|
|
14673
|
+
v.ignoreMutation = (mutation) => {
|
|
14674
|
+
if (isReactRenderMutation(mutation, v.dom, v.contentDOM)) return true;
|
|
14675
|
+
return original.call(view, mutation);
|
|
14676
|
+
};
|
|
14677
|
+
return view;
|
|
14678
|
+
}
|
|
14679
|
+
function ReactNodeViewRenderer(component, options) {
|
|
14680
|
+
const create = ReactNodeViewRenderer$1(component, options);
|
|
14681
|
+
return (props) => guardReactRenderMutations(create(props));
|
|
14682
|
+
}
|
|
14641
14683
|
|
|
14642
14684
|
// src/lib/resizable-width.ts
|
|
14643
14685
|
function computeResizedWidth({
|
|
@@ -52951,5 +52993,5 @@ function ArticleViewer({
|
|
|
52951
52993
|
}
|
|
52952
52994
|
|
|
52953
52995
|
export { ApiParamExtension, ArticleViewer, Audio, CalloutExtension, CodeBlockExtension, CodeGroupExtension, CollabContext, CollabProvider, Column, Columns, CommentThread, DEFAULT_DOC_PERMISSIONS, DEFAULT_MAX_FILE_SIZES, DOC_WIDTHS, DetailsExtension, DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EditorConfigProvider, EditorContentArea, EditorProvider, EditorThemeStyle, FileAttachment, FileInline, FloatingElement, HIDE_FLOATING_META, LoadingSpinner, MediaUploadButton, MediaUploadPlaceholder, NotionEditor, NotionEditorContent, PasteDropMedia, Separator, Spacer, Toolbar, ToolbarGroup, ToolbarSeparator, UiState, UserContext, UserProvider, VIEW_MODE_TOAST, Video, ViewModeSwitch, WIDTH_MODE_ITEMS, WIDTH_MODE_MENU_HEADER, WIDTH_MODE_MENU_TITLE, countDocument, countRange, countText, defaultUiState, detectMediaKind, findSelectionPosition, getDocPermissions, getEditorMarkdown, hasContentAbove, markHideFloatingOnNext, parseEditorContent, pickFile, printDocument, refreshCommentThreadInteractivity, renderHighlightedHTML, resolveEditorTheme, resolveMaxSize, runMediaUpload, selectNodeAndHideFloating, serializeEditorMarkdown, useCollab, useCollaboration, useComposedRef, useCursorVisibility, useEditorConfig, useElementRect, useFloatingElement, useFloatingToolbarVisibility, useIsBreakpoint, useIsomorphicLayoutEffect, useMenuNavigation, useOnClickOutside, useThrottledCallback, useUiEditorState, useUnmount, useUser, useViewMode, useWidthMode, useWindowSize, use_ui_editor_state_default };
|
|
52954
|
-
//# sourceMappingURL=chunk-
|
|
52955
|
-
//# sourceMappingURL=chunk-
|
|
52996
|
+
//# sourceMappingURL=chunk-IKYVPJQ5.js.map
|
|
52997
|
+
//# sourceMappingURL=chunk-IKYVPJQ5.js.map
|