@4399ywkf/editor 0.13.2 → 0.14.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.
@@ -119745,7 +119745,12 @@ function LoadingSpinner({ text = "Connecting..." }) {
119745
119745
  /* @__PURE__ */ jsx("div", { className: "spinner-loading-text", children: text })
119746
119746
  ] }) });
119747
119747
  }
119748
- function EditorContentArea({ hideFloatingToolbar = false }) {
119748
+ function EditorContentArea({
119749
+ hideFloatingToolbar = false,
119750
+ hideSlashMenu = false,
119751
+ hideDragHandle = false,
119752
+ hideEmojiMenu = false
119753
+ }) {
119749
119754
  const { editor } = useContext(EditorContext);
119750
119755
  useScrollToHash();
119751
119756
  if (!editor) {
@@ -119771,10 +119776,10 @@ function EditorContentArea({ hideFloatingToolbar = false }) {
119771
119776
  /* @__PURE__ */ jsx(FindReplacePanel, { editor }),
119772
119777
  /* @__PURE__ */ jsx(WordCountBadge, { editor }),
119773
119778
  isEditable && /* @__PURE__ */ jsxs(Fragment$1, { children: [
119774
- /* @__PURE__ */ jsx(DragContextMenu, {}),
119775
- /* @__PURE__ */ jsx(EmojiDropdownMenu, {}),
119779
+ !hideDragHandle && /* @__PURE__ */ jsx(DragContextMenu, {}),
119780
+ !hideEmojiMenu && /* @__PURE__ */ jsx(EmojiDropdownMenu, {}),
119776
119781
  /* @__PURE__ */ jsx(MentionDropdownMenu, {}),
119777
- /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
119782
+ !hideSlashMenu && /* @__PURE__ */ jsx(SlashDropdownMenu, {}),
119778
119783
  !hideFloatingToolbar && /* @__PURE__ */ jsx(NotionToolbarFloating, {}),
119779
119784
  /* @__PURE__ */ jsx(MathEditorPopover, { editor }),
119780
119785
  /* @__PURE__ */ jsx(LinkPastePanel, { editor }),
@@ -119802,6 +119807,9 @@ function EditorProvider(props) {
119802
119807
  permissions,
119803
119808
  hideHeader = false,
119804
119809
  hideFloatingToolbar = false,
119810
+ hideSlashMenu = false,
119811
+ hideDragHandle = false,
119812
+ hideEmojiMenu = false,
119805
119813
  embedded = false,
119806
119814
  richMarkdown = false,
119807
119815
  sendKey,
@@ -120280,7 +120288,15 @@ function EditorProvider(props) {
120280
120288
  /* @__PURE__ */ jsx(ReadModeSelectionBar, { editor }),
120281
120289
  !readOnly && !hideHeader && /* @__PURE__ */ jsx(NotionEditorHeader, {}),
120282
120290
  /* @__PURE__ */ jsxs("div", { className: "notion-like-editor-layout", "data-width-mode": widthModeValue, children: [
120283
- /* @__PURE__ */ jsx(EditorContentArea, { hideFloatingToolbar }),
120291
+ /* @__PURE__ */ jsx(
120292
+ EditorContentArea,
120293
+ {
120294
+ hideFloatingToolbar,
120295
+ hideSlashMenu,
120296
+ hideDragHandle,
120297
+ hideEmojiMenu
120298
+ }
120299
+ ),
120284
120300
  !embedded && /* @__PURE__ */ jsx(TocSidebar, { topOffset: 48 })
120285
120301
  ] }),
120286
120302
  isEditable && /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -120311,6 +120327,9 @@ function NotionEditor({
120311
120327
  readOnly = false,
120312
120328
  hideHeader = false,
120313
120329
  hideFloatingToolbar = false,
120330
+ hideSlashMenu = false,
120331
+ hideDragHandle = false,
120332
+ hideEmojiMenu = false,
120314
120333
  embedded = false,
120315
120334
  richMarkdown = false,
120316
120335
  sendKey,
@@ -120343,6 +120362,9 @@ function NotionEditor({
120343
120362
  permissions,
120344
120363
  hideHeader,
120345
120364
  hideFloatingToolbar,
120365
+ hideSlashMenu,
120366
+ hideDragHandle,
120367
+ hideEmojiMenu,
120346
120368
  embedded,
120347
120369
  richMarkdown,
120348
120370
  sendKey,
@@ -120372,6 +120394,9 @@ function NotionEditorContent({
120372
120394
  permissions,
120373
120395
  hideHeader = false,
120374
120396
  hideFloatingToolbar = false,
120397
+ hideSlashMenu = false,
120398
+ hideDragHandle = false,
120399
+ hideEmojiMenu = false,
120375
120400
  embedded = false,
120376
120401
  richMarkdown = false,
120377
120402
  sendKey,
@@ -120409,6 +120434,9 @@ function NotionEditorContent({
120409
120434
  permissions,
120410
120435
  hideHeader,
120411
120436
  hideFloatingToolbar,
120437
+ hideSlashMenu,
120438
+ hideDragHandle,
120439
+ hideEmojiMenu,
120412
120440
  embedded,
120413
120441
  richMarkdown,
120414
120442
  sendKey,
@@ -120455,26 +120483,25 @@ function ArticleViewer({
120455
120483
  ) })
120456
120484
  ] });
120457
120485
  }
120486
+
120487
+ // src/components/tiptap-templates/notion-like/message-editor-defaults.ts
120488
+ function withMessageEditorDefaults(props) {
120489
+ return {
120490
+ ...props,
120491
+ embedded: props.embedded ?? true,
120492
+ hideHeader: props.hideHeader ?? true,
120493
+ sendKey: props.sendKey ?? "enter",
120494
+ placeholder: props.placeholder ?? "发送消息...",
120495
+ hideSlashMenu: props.hideSlashMenu ?? true,
120496
+ hideDragHandle: props.hideDragHandle ?? true,
120497
+ hideEmojiMenu: props.hideEmojiMenu ?? true
120498
+ };
120499
+ }
120458
120500
  function DocEditor(props) {
120459
120501
  return /* @__PURE__ */ jsx(NotionEditor, { ...props });
120460
120502
  }
120461
- function MessageEditor({
120462
- embedded = true,
120463
- hideHeader = true,
120464
- sendKey = "enter",
120465
- placeholder = "发送消息...",
120466
- ...props
120467
- }) {
120468
- return /* @__PURE__ */ jsx(
120469
- NotionEditor,
120470
- {
120471
- ...props,
120472
- embedded,
120473
- hideHeader,
120474
- sendKey,
120475
- placeholder
120476
- }
120477
- );
120503
+ function MessageEditor(props) {
120504
+ return /* @__PURE__ */ jsx(NotionEditor, { ...withMessageEditorDefaults(props) });
120478
120505
  }
120479
120506
  function useScrolling(target, options = {}) {
120480
120507
  const { debounce = 150, fallbackToDocument = true } = options;