@tn-pulse-suivi/notion-ui-comps 1.0.4 → 1.0.6
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/index.cjs +43 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +43 -60
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2508,7 +2508,7 @@ function addEmojiTrigger(editor, trigger = ":", node, nodePos) {
|
|
|
2508
2508
|
}
|
|
2509
2509
|
|
|
2510
2510
|
// src/components/tiptap-ui/slash-dropdown-menu/use-slash-dropdown-menu.tsx
|
|
2511
|
-
var getSlashMenuItemsTexts = (tNL
|
|
2511
|
+
var getSlashMenuItemsTexts = (tNL) => ({
|
|
2512
2512
|
// Style
|
|
2513
2513
|
text: {
|
|
2514
2514
|
title: tNL("Text"),
|
|
@@ -2698,7 +2698,7 @@ var getItemImplementations = (commonFns) => {
|
|
|
2698
2698
|
const statusNodeDomNode = commonFns.findDomRefAtPos(pos, domAtPos.bind(view));
|
|
2699
2699
|
if (statusNodeDomNode.tagName === "STATUS-NODE") {
|
|
2700
2700
|
const statusNodeDomNodeText = statusNodeDomNode.getAttribute("text");
|
|
2701
|
-
const emptyStatusPopupInputPlaceholder =
|
|
2701
|
+
const emptyStatusPopupInputPlaceholder = t("emptyStatusPopupInputPlaceholder");
|
|
2702
2702
|
const nodeAtPos = doc.nodeAt(pos);
|
|
2703
2703
|
if (commonFns.equalNodeType(nodes.statusNode, nodeAtPos)) {
|
|
2704
2704
|
if (statusNodeDomNodeText === emptyStatusPopupInputPlaceholder) {
|
|
@@ -2810,12 +2810,10 @@ function organizeItemsByGroups(items, showGroups) {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
function useSlashDropdownMenu(config) {
|
|
2812
2812
|
const { t: tNotionLike } = (0, import_react_i18next.useTranslation)("notionLike" /* notionLike */);
|
|
2813
|
-
const { t: tCommon } = (0, import_react_i18next.useTranslation)("common" /* common */);
|
|
2814
|
-
const { t: tBook } = (0, import_react_i18next.useTranslation)("book" /* book */);
|
|
2815
2813
|
const getSlashMenuItems = (0, import_react38.useCallback)(
|
|
2816
2814
|
(editor, commonFns) => {
|
|
2817
2815
|
const items = [];
|
|
2818
|
-
const texts = getSlashMenuItemsTexts(tNotionLike
|
|
2816
|
+
const texts = getSlashMenuItemsTexts(tNotionLike);
|
|
2819
2817
|
const enabledItems = config?.enabledItems || Object.keys(texts);
|
|
2820
2818
|
const showGroups = config?.showGroups !== false;
|
|
2821
2819
|
const itemImplementations = getItemImplementations(commonFns);
|
|
@@ -10994,7 +10992,8 @@ var TurnIntoDropdown = (0, import_react138.forwardRef)(
|
|
|
10994
10992
|
hideWhenUnavailable,
|
|
10995
10993
|
blockTypes,
|
|
10996
10994
|
onOpenChange,
|
|
10997
|
-
tNotionLike
|
|
10995
|
+
tNotionLike,
|
|
10996
|
+
commonFns
|
|
10998
10997
|
});
|
|
10999
10998
|
if (!isVisible) {
|
|
11000
10999
|
return null;
|
|
@@ -11123,7 +11122,7 @@ function shouldShowTurnInto(params) {
|
|
|
11123
11122
|
return true;
|
|
11124
11123
|
}
|
|
11125
11124
|
function useTurnIntoDropdown(config) {
|
|
11126
|
-
const { editor: providedEditor, hideWhenUnavailable = false, blockTypes, onOpenChange, tNotionLike } = config || {};
|
|
11125
|
+
const { editor: providedEditor, hideWhenUnavailable = false, blockTypes, onOpenChange, tNotionLike, commonFns } = config || {};
|
|
11127
11126
|
const { editor } = useTiptapEditor(providedEditor);
|
|
11128
11127
|
const [isOpen, setIsOpen] = (0, import_react139.useState)(false);
|
|
11129
11128
|
const [isVisible, setIsVisible] = (0, import_react139.useState)(true);
|
|
@@ -11162,7 +11161,7 @@ function useTurnIntoDropdown(config) {
|
|
|
11162
11161
|
activeBlockType,
|
|
11163
11162
|
handleOpenChange,
|
|
11164
11163
|
filteredOptions: getFilteredBlockTypeOptions(tNotionLike, blockTypes),
|
|
11165
|
-
label: capitalizeFirstLetter(tNotionLike("TurnInto").toLowerCase()) + ` (current: ${activeBlockType?.label || tNotionLike("Text")})`,
|
|
11164
|
+
label: commonFns.capitalizeFirstLetter(tNotionLike("TurnInto").toLowerCase()) + ` (current: ${activeBlockType?.label || tNotionLike("Text")})`,
|
|
11166
11165
|
Icon: ChevronDownIcon
|
|
11167
11166
|
};
|
|
11168
11167
|
}
|
|
@@ -11644,7 +11643,7 @@ var import_react_i18next3 = require("react-i18next");
|
|
|
11644
11643
|
var import_react_fontawesome = require("@fortawesome/react-fontawesome");
|
|
11645
11644
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
11646
11645
|
function ImageExpandButton(props) {
|
|
11647
|
-
const { commonFns
|
|
11646
|
+
const { commonFns } = props;
|
|
11648
11647
|
const { t } = (0, import_react_i18next3.useTranslation)("richText" /* richText */);
|
|
11649
11648
|
const { currentSelectedImgId } = window;
|
|
11650
11649
|
return currentSelectedImgId ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
@@ -11661,7 +11660,7 @@ function ImageExpandButton(props) {
|
|
|
11661
11660
|
commonFns.ExpandImgIconClickHAndler(e, currentSelectedImgId);
|
|
11662
11661
|
commonFns.stopEventPropagation(e);
|
|
11663
11662
|
},
|
|
11664
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react_fontawesome.FontAwesomeIcon, { id: "ImageExpandBtnIcon", icon: customIcons.faExpand, style: { height: 20, width: "auto" } })
|
|
11663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react_fontawesome.FontAwesomeIcon, { id: "ImageExpandBtnIcon", icon: commonFns.customIcons.faExpand, style: { height: 20, width: "auto" } })
|
|
11665
11664
|
}
|
|
11666
11665
|
) : "";
|
|
11667
11666
|
}
|
|
@@ -12226,10 +12225,8 @@ RefreshCcwIcon.displayName = "RefreshCcwIcon";
|
|
|
12226
12225
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
12227
12226
|
function ImageNodeFloating({
|
|
12228
12227
|
editor: providedEditor,
|
|
12229
|
-
ExpandImgIconClickHAndler,
|
|
12230
12228
|
tNotionLike,
|
|
12231
|
-
commonFns
|
|
12232
|
-
customIcons
|
|
12229
|
+
commonFns
|
|
12233
12230
|
}) {
|
|
12234
12231
|
const { editor } = useTiptapEditor(providedEditor);
|
|
12235
12232
|
const visible = isNodeTypeSelected(editor, ["image"]);
|
|
@@ -12237,7 +12234,7 @@ function ImageNodeFloating({
|
|
|
12237
12234
|
return null;
|
|
12238
12235
|
}
|
|
12239
12236
|
return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
|
|
12240
|
-
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(image_expand_button_default, {
|
|
12237
|
+
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(image_expand_button_default, { commonFns }),
|
|
12241
12238
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "left" }),
|
|
12242
12239
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "center" }),
|
|
12243
12240
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "right" }),
|
|
@@ -12495,10 +12492,8 @@ function MainToolbarContent({
|
|
|
12495
12492
|
isMobile,
|
|
12496
12493
|
toolbarViews,
|
|
12497
12494
|
onViewChange,
|
|
12498
|
-
ExpandImgIconClickHAndler,
|
|
12499
12495
|
tNotionLike,
|
|
12500
|
-
commonFns
|
|
12501
|
-
customIcons
|
|
12496
|
+
commonFns
|
|
12502
12497
|
}) {
|
|
12503
12498
|
const hasSelection = hasTextSelection(editor);
|
|
12504
12499
|
const hasContent = (editor?.getText().length ?? 0) > 0;
|
|
@@ -12519,7 +12514,7 @@ function MainToolbarContent({
|
|
|
12519
12514
|
editor
|
|
12520
12515
|
}
|
|
12521
12516
|
),
|
|
12522
|
-
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ImageNodeFloating, {
|
|
12517
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ImageNodeFloating, { tNotionLike, commonFns }),
|
|
12523
12518
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ScriptGroup, { tNotionLike }),
|
|
12524
12519
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(AlignmentGroup, { tNotionLike }),
|
|
12525
12520
|
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(ToolbarGroup, { children: [
|
|
@@ -12543,7 +12538,7 @@ function SpecializedToolbarContent({ view, onBack }) {
|
|
|
12543
12538
|
view.content
|
|
12544
12539
|
] });
|
|
12545
12540
|
}
|
|
12546
|
-
function MobileToolbar({ editor: providedEditor,
|
|
12541
|
+
function MobileToolbar({ editor: providedEditor, tNotionLike, commonFns }) {
|
|
12547
12542
|
const { editor } = useTiptapEditor(providedEditor);
|
|
12548
12543
|
const isMobile = useIsBreakpoint("max", 480);
|
|
12549
12544
|
const toolbarRef = (0, import_react155.useRef)(null);
|
|
@@ -12575,10 +12570,8 @@ function MobileToolbar({ editor: providedEditor, ExpandImgIconClickHAndler, tNot
|
|
|
12575
12570
|
isMobile,
|
|
12576
12571
|
toolbarViews,
|
|
12577
12572
|
onViewChange: toolbarState.showView,
|
|
12578
|
-
ExpandImgIconClickHAndler,
|
|
12579
12573
|
tNotionLike,
|
|
12580
|
-
commonFns
|
|
12581
|
-
customIcons
|
|
12574
|
+
commonFns
|
|
12582
12575
|
}
|
|
12583
12576
|
) : currentView && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(SpecializedToolbarContent, { view: currentView, onBack: toolbarState.showMainView })
|
|
12584
12577
|
}
|
|
@@ -12836,7 +12829,7 @@ var isElementWithinEditor = (editor, element) => {
|
|
|
12836
12829
|
|
|
12837
12830
|
// src/components/tiptap-templates/notion-like/notion-like-editor-toolbar-floating.tsx
|
|
12838
12831
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
12839
|
-
function NotionToolbarFloating({
|
|
12832
|
+
function NotionToolbarFloating({ tNotionLike, commonFns }) {
|
|
12840
12833
|
const { editor } = useTiptapEditor();
|
|
12841
12834
|
const isMobile = useIsBreakpoint("max", 480);
|
|
12842
12835
|
const { lockDragHandle, commentInputVisible } = useUiEditorState(editor);
|
|
@@ -12857,7 +12850,7 @@ function NotionToolbarFloating({ ExpandImgIconClickHAndler, tNotionLike, commonF
|
|
|
12857
12850
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(MarkButton, { type: "code", hideWhenUnavailable: true, tNotionLike })
|
|
12858
12851
|
] }),
|
|
12859
12852
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarSeparator, {}),
|
|
12860
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ImageNodeFloating, {
|
|
12853
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ImageNodeFloating, { tNotionLike, commonFns }) }),
|
|
12861
12854
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(VideoNodeFloating, { tNotionLike }) }),
|
|
12862
12855
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(ToolbarGroup, { children: [
|
|
12863
12856
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(LinkPopover, { autoOpenOnLinkActive: false, hideWhenUnavailable: true, tNotionLike }),
|
|
@@ -19545,10 +19538,11 @@ function ImageNodeView(props) {
|
|
|
19545
19538
|
const { editor, node, updateAttributes, getPos } = props;
|
|
19546
19539
|
const hasContent = node.content.size > 0;
|
|
19547
19540
|
const { commonFns } = (0, import_react198.useContext)(import_react199.EditorContext);
|
|
19541
|
+
console.log("\u{1F680} ~ ImageNodeView ~ commonFns:", commonFns);
|
|
19548
19542
|
if (!commonFns) {
|
|
19549
19543
|
console.error("ImageNodeView :: commonFns NOT PROVIDED !!!!");
|
|
19550
19544
|
}
|
|
19551
|
-
const { getFileUrl
|
|
19545
|
+
const { getFileUrl } = commonFns || {};
|
|
19552
19546
|
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
19553
19547
|
ResizableImage,
|
|
19554
19548
|
{
|
|
@@ -19574,7 +19568,6 @@ function ImageNodeView(props) {
|
|
|
19574
19568
|
},
|
|
19575
19569
|
onUpdateAttributes: updateAttributes,
|
|
19576
19570
|
getPos,
|
|
19577
|
-
ExpandImgIconClickHAndler,
|
|
19578
19571
|
commonFns
|
|
19579
19572
|
}
|
|
19580
19573
|
);
|
|
@@ -19595,7 +19588,6 @@ var ResizableImage = ({
|
|
|
19595
19588
|
onImageResize,
|
|
19596
19589
|
onUpdateAttributes,
|
|
19597
19590
|
getPos,
|
|
19598
|
-
ExpandImgIconClickHAndler,
|
|
19599
19591
|
commonFns
|
|
19600
19592
|
}) => {
|
|
19601
19593
|
const [width, setWidth] = (0, import_react198.useState)(initialWidth);
|
|
@@ -20173,7 +20165,7 @@ CloseIcon.displayName = "CloseIcon";
|
|
|
20173
20165
|
|
|
20174
20166
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
20175
20167
|
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
20176
|
-
function useFileUpload(options
|
|
20168
|
+
function useFileUpload(options) {
|
|
20177
20169
|
const [fileItems, setFileItems] = (0, import_react202.useState)([]);
|
|
20178
20170
|
const fileItemsRef = (0, import_react202.useRef)(fileItems);
|
|
20179
20171
|
fileItemsRef.current = fileItems;
|
|
@@ -20240,8 +20232,7 @@ function useFileUpload(options, commonFns) {
|
|
|
20240
20232
|
} else {
|
|
20241
20233
|
console.error("abortController.signal.aborted !!");
|
|
20242
20234
|
}
|
|
20243
|
-
}
|
|
20244
|
-
commonFns
|
|
20235
|
+
}
|
|
20245
20236
|
);
|
|
20246
20237
|
return null;
|
|
20247
20238
|
} catch (error) {
|
|
@@ -20265,7 +20256,7 @@ function useFileUpload(options, commonFns) {
|
|
|
20265
20256
|
options.onError?.(new Error(`Maximum ${options.limit} file${options.limit === 1 ? "" : "s"} allowed`));
|
|
20266
20257
|
return [];
|
|
20267
20258
|
}
|
|
20268
|
-
const uploadPromises = files.map((file) => uploadFile(file
|
|
20259
|
+
const uploadPromises = files.map((file) => uploadFile(file));
|
|
20269
20260
|
const results = await Promise.all(uploadPromises);
|
|
20270
20261
|
return results.filter((imgInfos) => imgInfos !== null);
|
|
20271
20262
|
};
|
|
@@ -20482,7 +20473,8 @@ var ImageUploadNode = (props) => {
|
|
|
20482
20473
|
onError: extension.options.onError
|
|
20483
20474
|
};
|
|
20484
20475
|
const { commonFns } = (0, import_react202.useContext)(import_react203.EditorContext);
|
|
20485
|
-
|
|
20476
|
+
console.log("\u{1F680} ~ ImageUploadNode ~ commonFns:", commonFns);
|
|
20477
|
+
const { fileItems, uploadFiles, removeFileItem, clearAllFiles } = useFileUpload(uploadOptions);
|
|
20486
20478
|
const handleUpload = async (files) => {
|
|
20487
20479
|
const imgsInfos = await uploadFiles(files);
|
|
20488
20480
|
if (imgsInfos.length > 0) {
|
|
@@ -20863,11 +20855,12 @@ var useNotionLikeExtensions = (args) => {
|
|
|
20863
20855
|
withVideo = true,
|
|
20864
20856
|
setTocContent,
|
|
20865
20857
|
ignore,
|
|
20866
|
-
customExtensions = []
|
|
20858
|
+
customExtensions = [],
|
|
20859
|
+
commonFns
|
|
20867
20860
|
} = args;
|
|
20868
20861
|
const editable = Boolean(isEditable);
|
|
20869
20862
|
const localHandleImageUpload = (0, import_react206.useCallback)(
|
|
20870
|
-
async (file, fileId, onProgress, abortSignal, onDoneCb
|
|
20863
|
+
async (file, fileId, onProgress, abortSignal, onDoneCb) => {
|
|
20871
20864
|
if (!file) {
|
|
20872
20865
|
throw new Error("No file provided");
|
|
20873
20866
|
}
|
|
@@ -20884,7 +20877,7 @@ var useNotionLikeExtensions = (args) => {
|
|
|
20884
20877
|
[MAX_FILE_SIZE]
|
|
20885
20878
|
);
|
|
20886
20879
|
if (ignore) {
|
|
20887
|
-
return
|
|
20880
|
+
return [];
|
|
20888
20881
|
}
|
|
20889
20882
|
let extensions = [
|
|
20890
20883
|
import_starter_kit.StarterKit.configure({
|
|
@@ -21106,8 +21099,6 @@ function TocSidebar({ className, maxShowCount = 20, topOffset = 0, commonFns, ..
|
|
|
21106
21099
|
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
21107
21100
|
function EditorProvider(props) {
|
|
21108
21101
|
const {
|
|
21109
|
-
// provider,
|
|
21110
|
-
// ydoc,
|
|
21111
21102
|
placeholder = "Start writing...",
|
|
21112
21103
|
getInchangeableProps,
|
|
21113
21104
|
className,
|
|
@@ -21115,8 +21106,6 @@ function EditorProvider(props) {
|
|
|
21115
21106
|
width,
|
|
21116
21107
|
height,
|
|
21117
21108
|
extraStyle,
|
|
21118
|
-
// setMenuBarGetter,
|
|
21119
|
-
// mentionList,
|
|
21120
21109
|
isEditable = true,
|
|
21121
21110
|
withImages = true,
|
|
21122
21111
|
initialContent = "",
|
|
@@ -21132,10 +21121,7 @@ function EditorProvider(props) {
|
|
|
21132
21121
|
withTables,
|
|
21133
21122
|
withVideo,
|
|
21134
21123
|
pSwipeIsOpen,
|
|
21135
|
-
showToCInBookPages
|
|
21136
|
-
customExtensions,
|
|
21137
|
-
customIcons
|
|
21138
|
-
// withStatus,
|
|
21124
|
+
showToCInBookPages
|
|
21139
21125
|
} = props;
|
|
21140
21126
|
const { setTocContent } = useToc();
|
|
21141
21127
|
const { t: tBook } = (0, import_react_i18next8.useTranslation)("book" /* book */);
|
|
@@ -21153,18 +21139,16 @@ function EditorProvider(props) {
|
|
|
21153
21139
|
onDestroyTimerLockRef,
|
|
21154
21140
|
isLinkRemovalRef,
|
|
21155
21141
|
fileReUploadIsOnRef,
|
|
21156
|
-
// svgs,
|
|
21157
|
-
// t,
|
|
21158
|
-
// setVideoUrlDialogData,
|
|
21159
21142
|
getFileUrl,
|
|
21160
21143
|
setGetEditorContent,
|
|
21161
21144
|
getEditorRef,
|
|
21162
21145
|
setAutoFocusOnPopupIsReady,
|
|
21163
21146
|
ExpandImgIconClickHAndler,
|
|
21164
21147
|
tNotionLike,
|
|
21165
|
-
commonFns
|
|
21166
|
-
|
|
21148
|
+
commonFns,
|
|
21149
|
+
customExtensions
|
|
21167
21150
|
} = getInchangeableProps();
|
|
21151
|
+
const { getUpdatedProseMirrorViewVars, urlToFile, ...restCommonFns } = commonFns;
|
|
21168
21152
|
const extensions = useNotionLikeExtensions_default({
|
|
21169
21153
|
isEditable,
|
|
21170
21154
|
withImages,
|
|
@@ -21173,7 +21157,8 @@ function EditorProvider(props) {
|
|
|
21173
21157
|
withTables,
|
|
21174
21158
|
withVideo,
|
|
21175
21159
|
setTocContent,
|
|
21176
|
-
customExtensions
|
|
21160
|
+
customExtensions,
|
|
21161
|
+
commonFns: restCommonFns
|
|
21177
21162
|
});
|
|
21178
21163
|
const imageIndexRef = (0, import_react208.useRef)(0);
|
|
21179
21164
|
const transformNode = (args) => {
|
|
@@ -21240,7 +21225,7 @@ function EditorProvider(props) {
|
|
|
21240
21225
|
const selection = bookmark.resolve(view.state.doc);
|
|
21241
21226
|
setTimeout(
|
|
21242
21227
|
({ sel, frag, v }) => {
|
|
21243
|
-
let { newDispatch, newTr } =
|
|
21228
|
+
let { newDispatch, newTr } = getUpdatedProseMirrorViewVars(v);
|
|
21244
21229
|
const { from, to } = sel;
|
|
21245
21230
|
newDispatch(newTr.replaceRange(from, to, frag).scrollIntoView());
|
|
21246
21231
|
},
|
|
@@ -21298,7 +21283,7 @@ function EditorProvider(props) {
|
|
|
21298
21283
|
if (slice.content.size === 0 && fileImages.length) {
|
|
21299
21284
|
setTimeout(
|
|
21300
21285
|
(blobs) => {
|
|
21301
|
-
let { newDispatch, newTr } =
|
|
21286
|
+
let { newDispatch, newTr } = getUpdatedProseMirrorViewVars(view);
|
|
21302
21287
|
const { schema: schema2 } = editorRef.current;
|
|
21303
21288
|
let tr;
|
|
21304
21289
|
if (blobs.length === 1) {
|
|
@@ -21338,7 +21323,7 @@ function EditorProvider(props) {
|
|
|
21338
21323
|
const isFile = htmImg instanceof File;
|
|
21339
21324
|
if (!isFile) {
|
|
21340
21325
|
const { src } = htmImg;
|
|
21341
|
-
|
|
21326
|
+
urlToFile(src, `pasted-${hiIndex}.png`, (err, imf) => {
|
|
21342
21327
|
if (err) {
|
|
21343
21328
|
console.error("handlePaste.urlToFile.cb ~ err : ", err);
|
|
21344
21329
|
} else {
|
|
@@ -21576,18 +21561,16 @@ function EditorProvider(props) {
|
|
|
21576
21561
|
...extraStyle
|
|
21577
21562
|
},
|
|
21578
21563
|
children: [
|
|
21579
|
-
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_react209.EditorContext.Provider, { value: { editor, commonFns: { getFileUrl } }, children: [
|
|
21564
|
+
/* @__PURE__ */ (0, import_jsx_runtime138.jsxs)(import_react209.EditorContext.Provider, { value: { editor, commonFns: { ...restCommonFns, getFileUrl, ExpandImgIconClickHAndler } }, children: [
|
|
21580
21565
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
21581
21566
|
EditorContentArea,
|
|
21582
21567
|
{
|
|
21583
21568
|
mentionListRef,
|
|
21584
|
-
ExpandImgIconClickHAndler,
|
|
21585
21569
|
tNotionLike,
|
|
21586
|
-
commonFns
|
|
21587
|
-
customIcons
|
|
21570
|
+
commonFns: restCommonFns
|
|
21588
21571
|
}
|
|
21589
21572
|
),
|
|
21590
|
-
withToc && showToCInBookPages ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(TocSidebar, { topOffset: 48, commonFns }) : "",
|
|
21573
|
+
withToc && showToCInBookPages ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(TocSidebar, { topOffset: 48, commonFns: restCommonFns }) : "",
|
|
21591
21574
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(TableExtendRowColumnButtons, {}),
|
|
21592
21575
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(TableHandle, { tNotionLike }),
|
|
21593
21576
|
/* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
|
|
@@ -21632,7 +21615,7 @@ function LoadingSpinner({ text = "Connecting..." }) {
|
|
|
21632
21615
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "spinner-loading-text", children: text })
|
|
21633
21616
|
] }) });
|
|
21634
21617
|
}
|
|
21635
|
-
function EditorContentArea({ mentionListRef,
|
|
21618
|
+
function EditorContentArea({ mentionListRef, tNotionLike, commonFns }) {
|
|
21636
21619
|
const { editor } = (0, import_react210.useContext)(import_react211.EditorContext);
|
|
21637
21620
|
const { isDragging } = useUiEditorState(editor);
|
|
21638
21621
|
useScrollToHash();
|
|
@@ -21653,9 +21636,9 @@ function EditorContentArea({ mentionListRef, ExpandImgIconClickHAndler, tNotionL
|
|
|
21653
21636
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(EmojiDropdownMenu, {}),
|
|
21654
21637
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MentionDropdownMenu, { mentionListRef }),
|
|
21655
21638
|
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(SlashDropdownMenu, { commonFns }),
|
|
21656
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NotionToolbarFloating, {
|
|
21639
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NotionToolbarFloating, { tNotionLike, commonFns }),
|
|
21657
21640
|
(0, import_react_dom.createPortal)(
|
|
21658
|
-
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MobileToolbar, {
|
|
21641
|
+
/* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MobileToolbar, { tNotionLike, commonFns }),
|
|
21659
21642
|
document.body
|
|
21660
21643
|
)
|
|
21661
21644
|
]
|