@4399ywkf/editor 0.10.0 → 0.10.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.
@@ -1,4 +1,4 @@
1
- import { EditorConfigProvider, NotionEditor } from './chunk-4MQS76M2.js';
1
+ import { EditorConfigProvider, NotionEditor } from './chunk-ABXCS4IZ.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-YBRD4V4E.js.map
22
- //# sourceMappingURL=DocView-YBRD4V4E.js.map
21
+ //# sourceMappingURL=DocView-HCBFGLWI.js.map
22
+ //# sourceMappingURL=DocView-HCBFGLWI.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-YBRD4V4E.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
+ {"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-HCBFGLWI.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"]}
@@ -8914,48 +8914,39 @@ var notionLikeEditorStyles = ({ surface }) => `
8914
8914
  /* 正文字体栈对齐飞书文档(feishu.cn 文章页实测值),纯系统字体、无外网字体依赖 */
8915
8915
  /* (原 Google Fonts 的 DM Sans/Inter 在内网/无外网环境加载失败,中文全靠 sans-serif 兜底)。 */
8916
8916
  /* "Segoe UI Emoji" 放最前是飞书的做法:Windows 上 emoji 走彩色字体,文本字符自动落到后面的正文字体。 */
8917
-
8918
- body {
8919
- --tt-toolbar-height: 44px;
8920
- /* 正文色读表面 token surface.colorText(src/theme/editor-theme.ts:Notion #2c2c2b / 飞书 N900 #1f2329) */
8921
- }
8922
-
8923
- body {
8917
+ /* 正文色读表面 token surface.colorText(src/theme/editor-theme.ts:Notion #2c2c2b / 飞书 N900 #1f2329)。 */
8918
+
8919
+ /* ⚠️ 字体、颜色、滚动条只写在编辑器根上,不要写 html / body / #root / 全局 *: */
8920
+ /* 这份样式随编辑器挂载 / 卸载注入和撤掉,写在 body 上会让宿主整站跟着变。实测 tokenhub: */
8921
+ /* 宿主 body 有 font-size-adjust: from-font,按 body 首选字体取值 —— 换成这套字体后从 SF 的 0.526 变成 */
8922
+ /* Helvetica Neue 的 0.517,整站文字缩小 1.7%,切换文章(编辑器卸载再挂载)时全站字体抖一下。 */
8923
+ /* 页面底色、overscroll 归宿主管;独立整页编辑器的宿主页面自己设。 */
8924
+ .notion-like-editor-wrapper {
8924
8925
  font-family: "Segoe UI Emoji", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "PingFang SC", Roboto, "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "Hiragino Sans", "Lucida Grande", sans-serif;
8925
8926
  color: ${surface.colorText};
8926
8927
  font-weight: 400;
8927
8928
  font-style: normal;
8928
- padding: 0;
8929
- overscroll-behavior-y: none;
8930
8929
  }
8931
8930
 
8932
- html,
8933
- body {
8934
- overscroll-behavior-x: none;
8935
- }
8936
-
8937
- html,
8938
- body,
8939
- #root,
8940
- #app {
8941
- background-color: var(--tt-bg-color);
8931
+ .notion-like-editor-wrapper,
8932
+ .notion-like-editor-wrapper * {
8933
+ scrollbar-width: thin;
8934
+ scrollbar-color: var(--tt-scrollbar-color) transparent;
8942
8935
  }
8943
8936
 
8944
- ::-webkit-scrollbar {
8937
+ .notion-like-editor-wrapper::-webkit-scrollbar,
8938
+ .notion-like-editor-wrapper ::-webkit-scrollbar {
8945
8939
  width: 0.25rem;
8946
8940
  }
8947
8941
 
8948
- * {
8949
- scrollbar-width: thin;
8950
- scrollbar-color: var(--tt-scrollbar-color) transparent;
8951
- }
8952
-
8953
- ::-webkit-scrollbar-thumb {
8942
+ .notion-like-editor-wrapper::-webkit-scrollbar-thumb,
8943
+ .notion-like-editor-wrapper ::-webkit-scrollbar-thumb {
8954
8944
  background-color: var(--tt-scrollbar-color);
8955
8945
  border-radius: 9999px;
8956
8946
  }
8957
8947
 
8958
- ::-webkit-scrollbar-track {
8948
+ .notion-like-editor-wrapper::-webkit-scrollbar-track,
8949
+ .notion-like-editor-wrapper ::-webkit-scrollbar-track {
8959
8950
  background: transparent;
8960
8951
  }
8961
8952
 
@@ -13103,15 +13094,13 @@ var tooltipStyles = ({ surface, pick, isDark }) => `
13103
13094
  var variablesStyles = () => `
13104
13095
  /* 颜色、圆角、阴影、过渡等 --tt-* 变量已经搬到 src/theme(base-vars.ts / editor-theme.ts), */
13105
13096
  /* 由 EditorThemeStyle 按宿主 antd 主题注入,构建时再生成进 dist/style.css。这里只留全局规则。 */
13106
- :root {
13107
- &,
13108
- *,
13109
- ::before,
13110
- ::after {
13111
- box-sizing: border-box;
13112
- transition: none var(--tt-transition-duration-default)
13113
- var(--tt-transition-easing-default);
13114
- }
13097
+ /* 只留 border-box:挂在 body 下的浮层(提示、下拉、弹窗)也靠它,宿主一般早已是 border-box。 */
13098
+ /* 不要在这里给所有元素写 transition:这份样式随编辑器挂载 / 卸载注入和撤掉,会把宿主整站的过渡一起关掉 */
13099
+ /* (宿主菜单的悬停渐变就没了)。要过渡的组件自己写全 transition-duration / timing-function。 */
13100
+ *,
13101
+ ::before,
13102
+ ::after {
13103
+ box-sizing: border-box;
13115
13104
  }
13116
13105
  `;
13117
13106
 
@@ -51662,5 +51651,5 @@ function ArticleViewer({
51662
51651
  }
51663
51652
 
51664
51653
  export { ApiParamExtension, ArticleViewer, Audio, CalloutExtension, CodeBlockExtension, CodeGroupExtension, CollabContext, CollabProvider, Column, Columns, 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, WidthModeMenu, countDocument, countRange, countText, defaultUiState, detectMediaKind, findSelectionPosition, getDocPermissions, getEditorMarkdown, hasContentAbove, markHideFloatingOnNext, parseEditorContent, pickFile, printDocument, 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 };
51665
- //# sourceMappingURL=chunk-4MQS76M2.js.map
51666
- //# sourceMappingURL=chunk-4MQS76M2.js.map
51654
+ //# sourceMappingURL=chunk-ABXCS4IZ.js.map
51655
+ //# sourceMappingURL=chunk-ABXCS4IZ.js.map