@tn-pulse-suivi/notion-ui-comps 1.0.5 → 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 CHANGED
@@ -11643,7 +11643,7 @@ var import_react_i18next3 = require("react-i18next");
11643
11643
  var import_react_fontawesome = require("@fortawesome/react-fontawesome");
11644
11644
  var import_jsx_runtime100 = require("react/jsx-runtime");
11645
11645
  function ImageExpandButton(props) {
11646
- const { commonFns, customIcons } = props;
11646
+ const { commonFns } = props;
11647
11647
  const { t } = (0, import_react_i18next3.useTranslation)("richText" /* richText */);
11648
11648
  const { currentSelectedImgId } = window;
11649
11649
  return currentSelectedImgId ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
@@ -11660,7 +11660,7 @@ function ImageExpandButton(props) {
11660
11660
  commonFns.ExpandImgIconClickHAndler(e, currentSelectedImgId);
11661
11661
  commonFns.stopEventPropagation(e);
11662
11662
  },
11663
- 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" } })
11664
11664
  }
11665
11665
  ) : "";
11666
11666
  }
@@ -12226,8 +12226,7 @@ var import_jsx_runtime108 = require("react/jsx-runtime");
12226
12226
  function ImageNodeFloating({
12227
12227
  editor: providedEditor,
12228
12228
  tNotionLike,
12229
- commonFns,
12230
- customIcons
12229
+ commonFns
12231
12230
  }) {
12232
12231
  const { editor } = useTiptapEditor(providedEditor);
12233
12232
  const visible = isNodeTypeSelected(editor, ["image"]);
@@ -12235,7 +12234,7 @@ function ImageNodeFloating({
12235
12234
  return null;
12236
12235
  }
12237
12236
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
12238
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(image_expand_button_default, { commonFns, customIcons }),
12237
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(image_expand_button_default, { commonFns }),
12239
12238
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "left" }),
12240
12239
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "center" }),
12241
12240
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ImageAlignButton, { align: "right" }),
@@ -12494,8 +12493,7 @@ function MainToolbarContent({
12494
12493
  toolbarViews,
12495
12494
  onViewChange,
12496
12495
  tNotionLike,
12497
- commonFns,
12498
- customIcons
12496
+ commonFns
12499
12497
  }) {
12500
12498
  const hasSelection = hasTextSelection(editor);
12501
12499
  const hasContent = (editor?.getText().length ?? 0) > 0;
@@ -12516,7 +12514,7 @@ function MainToolbarContent({
12516
12514
  editor
12517
12515
  }
12518
12516
  ),
12519
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ImageNodeFloating, { tNotionLike, commonFns, customIcons }),
12517
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ImageNodeFloating, { tNotionLike, commonFns }),
12520
12518
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ScriptGroup, { tNotionLike }),
12521
12519
  /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(AlignmentGroup, { tNotionLike }),
12522
12520
  /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(ToolbarGroup, { children: [
@@ -12540,7 +12538,7 @@ function SpecializedToolbarContent({ view, onBack }) {
12540
12538
  view.content
12541
12539
  ] });
12542
12540
  }
12543
- function MobileToolbar({ editor: providedEditor, tNotionLike, commonFns, customIcons }) {
12541
+ function MobileToolbar({ editor: providedEditor, tNotionLike, commonFns }) {
12544
12542
  const { editor } = useTiptapEditor(providedEditor);
12545
12543
  const isMobile = useIsBreakpoint("max", 480);
12546
12544
  const toolbarRef = (0, import_react155.useRef)(null);
@@ -12573,8 +12571,7 @@ function MobileToolbar({ editor: providedEditor, tNotionLike, commonFns, customI
12573
12571
  toolbarViews,
12574
12572
  onViewChange: toolbarState.showView,
12575
12573
  tNotionLike,
12576
- commonFns,
12577
- customIcons
12574
+ commonFns
12578
12575
  }
12579
12576
  ) : currentView && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(SpecializedToolbarContent, { view: currentView, onBack: toolbarState.showMainView })
12580
12577
  }
@@ -12832,7 +12829,7 @@ var isElementWithinEditor = (editor, element) => {
12832
12829
 
12833
12830
  // src/components/tiptap-templates/notion-like/notion-like-editor-toolbar-floating.tsx
12834
12831
  var import_jsx_runtime112 = require("react/jsx-runtime");
12835
- function NotionToolbarFloating({ tNotionLike, commonFns, customIcons }) {
12832
+ function NotionToolbarFloating({ tNotionLike, commonFns }) {
12836
12833
  const { editor } = useTiptapEditor();
12837
12834
  const isMobile = useIsBreakpoint("max", 480);
12838
12835
  const { lockDragHandle, commentInputVisible } = useUiEditorState(editor);
@@ -12853,7 +12850,7 @@ function NotionToolbarFloating({ tNotionLike, commonFns, customIcons }) {
12853
12850
  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(MarkButton, { type: "code", hideWhenUnavailable: true, tNotionLike })
12854
12851
  ] }),
12855
12852
  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarSeparator, {}),
12856
- /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ImageNodeFloating, { tNotionLike, commonFns, customIcons }) }),
12853
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ImageNodeFloating, { tNotionLike, commonFns }) }),
12857
12854
  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(VideoNodeFloating, { tNotionLike }) }),
12858
12855
  /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(ToolbarGroup, { children: [
12859
12856
  /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(LinkPopover, { autoOpenOnLinkActive: false, hideWhenUnavailable: true, tNotionLike }),
@@ -20880,7 +20877,7 @@ var useNotionLikeExtensions = (args) => {
20880
20877
  [MAX_FILE_SIZE]
20881
20878
  );
20882
20879
  if (ignore) {
20883
- return void 0;
20880
+ return [];
20884
20881
  }
20885
20882
  let extensions = [
20886
20883
  import_starter_kit.StarterKit.configure({
@@ -21102,8 +21099,6 @@ function TocSidebar({ className, maxShowCount = 20, topOffset = 0, commonFns, ..
21102
21099
  var import_jsx_runtime138 = require("react/jsx-runtime");
21103
21100
  function EditorProvider(props) {
21104
21101
  const {
21105
- // provider,
21106
- // ydoc,
21107
21102
  placeholder = "Start writing...",
21108
21103
  getInchangeableProps,
21109
21104
  className,
@@ -21126,9 +21121,7 @@ function EditorProvider(props) {
21126
21121
  withTables,
21127
21122
  withVideo,
21128
21123
  pSwipeIsOpen,
21129
- showToCInBookPages,
21130
- customExtensions,
21131
- customIcons
21124
+ showToCInBookPages
21132
21125
  } = props;
21133
21126
  const { setTocContent } = useToc();
21134
21127
  const { t: tBook } = (0, import_react_i18next8.useTranslation)("book" /* book */);
@@ -21152,7 +21145,8 @@ function EditorProvider(props) {
21152
21145
  setAutoFocusOnPopupIsReady,
21153
21146
  ExpandImgIconClickHAndler,
21154
21147
  tNotionLike,
21155
- commonFns
21148
+ commonFns,
21149
+ customExtensions
21156
21150
  } = getInchangeableProps();
21157
21151
  const { getUpdatedProseMirrorViewVars, urlToFile, ...restCommonFns } = commonFns;
21158
21152
  const extensions = useNotionLikeExtensions_default({
@@ -21573,8 +21567,7 @@ function EditorProvider(props) {
21573
21567
  {
21574
21568
  mentionListRef,
21575
21569
  tNotionLike,
21576
- commonFns: restCommonFns,
21577
- customIcons
21570
+ commonFns: restCommonFns
21578
21571
  }
21579
21572
  ),
21580
21573
  withToc && showToCInBookPages ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(TocSidebar, { topOffset: 48, commonFns: restCommonFns }) : "",
@@ -21622,7 +21615,7 @@ function LoadingSpinner({ text = "Connecting..." }) {
21622
21615
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "spinner-loading-text", children: text })
21623
21616
  ] }) });
21624
21617
  }
21625
- function EditorContentArea({ mentionListRef, tNotionLike, commonFns, customIcons }) {
21618
+ function EditorContentArea({ mentionListRef, tNotionLike, commonFns }) {
21626
21619
  const { editor } = (0, import_react210.useContext)(import_react211.EditorContext);
21627
21620
  const { isDragging } = useUiEditorState(editor);
21628
21621
  useScrollToHash();
@@ -21643,9 +21636,9 @@ function EditorContentArea({ mentionListRef, tNotionLike, commonFns, customIcons
21643
21636
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(EmojiDropdownMenu, {}),
21644
21637
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MentionDropdownMenu, { mentionListRef }),
21645
21638
  /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(SlashDropdownMenu, { commonFns }),
21646
- /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NotionToolbarFloating, { tNotionLike, commonFns, customIcons }),
21639
+ /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(NotionToolbarFloating, { tNotionLike, commonFns }),
21647
21640
  (0, import_react_dom.createPortal)(
21648
- /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MobileToolbar, { tNotionLike, commonFns, customIcons }),
21641
+ /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(MobileToolbar, { tNotionLike, commonFns }),
21649
21642
  document.body
21650
21643
  )
21651
21644
  ]