A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: add outline list to block tool
thecodrr84d2720762b5
diff --git a/packages/editor/dist/toolbar/components/toolbutton.d.ts b/packages/editor/dist/toolbar/components/toolbutton.d.tsindex 2cde85f8c..8d67be87b 100644--- a/packages/editor/dist/toolbar/components/toolbutton.d.ts+++ b/packages/editor/dist/toolbar/components/toolbutton.d.ts@@ -14,7 +14,7 @@ export declare type ToolButtonProps = ButtonProps & {};export declare const ToolButton: React.NamedExoticComponent<ButtonProps & {icon: IconNames;- iconColor?: "background" | "border" | "text" | "blue" | "gray" | "green" | "orange" | "purple" | "red" | "yellow" | "checked" | "disabled" | "placeholder" | "icon" | "overlay" | "hover" | keyof import("@notesnook/theme/dist/theme/colorscheme/static").StaticColors | "primary" | "bgTransparent" | "accent" | "bgSecondary" | "bgSecondaryText" | "fontSecondary" | "fontTertiary" | "secondary" | undefined;+ iconColor?: "icon" | "text" | "blue" | "gray" | "green" | "orange" | "purple" | "red" | "yellow" | "checked" | "disabled" | "placeholder" | "background" | "border" | "overlay" | "hover" | keyof import("@notesnook/theme/dist/theme/colorscheme/static").StaticColors | "primary" | "bgTransparent" | "accent" | "bgSecondary" | "bgSecondaryText" | "fontSecondary" | "fontTertiary" | "secondary" | undefined;iconSize?: number | "small" | "big" | "medium" | undefined;toggled: boolean;buttonRef?: React.MutableRefObject<HTMLButtonElement | null | undefined> | undefined;diff --git a/packages/editor/dist/toolbar/icons.d.ts b/packages/editor/dist/toolbar/icons.d.tsindex f590b325e..fe29be023 100644--- a/packages/editor/dist/toolbar/icons.d.ts+++ b/packages/editor/dist/toolbar/icons.d.ts@@ -76,6 +76,7 @@ export declare const Icons: {tableSettings: string;math: string;mathBlock: string;+ outlineList: string;plus: string;minus: string;close: string;diff --git a/packages/editor/dist/toolbar/icons.js b/packages/editor/dist/toolbar/icons.jsindex b90ad6744..bba64ebb4 100644--- a/packages/editor/dist/toolbar/icons.js+++ b/packages/editor/dist/toolbar/icons.js@@ -1,4 +1,4 @@-import { mdiAttachment, mdiBorderHorizontal, mdiCheck, mdiChevronDown, mdiCodeBraces, mdiCodeTags, mdiDotsVertical, mdiFormatAlignCenter, mdiFormatAlignJustify, mdiFormatAlignLeft, mdiFormatAlignRight, mdiFormatBold, mdiFormatClear, mdiFormatColorHighlight, mdiFormatColorText, mdiFormatItalic, mdiFormatListBulleted, mdiFormatListNumbered, mdiFormatQuoteClose, mdiFormatStrikethrough, mdiFormatSubscript, mdiFormatSuperscript, mdiFormatTextdirectionLToR, mdiFormatTextdirectionRToL, mdiFormatUnderline, mdiImage, mdiInvertColorsOff, mdiLinkPlus, mdiLoading, mdiTable, mdiTableBorder, mdiTableRowPlusAfter, mdiTableRowPlusBefore, mdiTableRowRemove, mdiTableColumnPlusAfter, mdiTableColumnPlusBefore, mdiTableColumnRemove, mdiUploadOutline, mdiPlus, mdiFormatColorFill, mdiClose, mdiSortDescending, mdiArrowExpandRight, mdiArrowExpandLeft, mdiArrowExpandDown, mdiArrowExpandUp, mdiTableMergeCells, mdiTableSplitCell, mdiDeleteOutline, mdiDownloadOutline, mdiFormatListCheckbox, mdiDrag, mdiCheckboxMarkedOutline, mdiChevronUp, mdiArrowUp, mdiArrowDown, mdiRegex, mdiFormatLetterCase, mdiFormatLetterMatches, mdiMoviePlusOutline, mdiLink, mdiChevronRight, mdiTableColumnWidth, mdiTableRowHeight, mdiMinus, mdiPaletteOutline, mdiCircle, mdiChevronLeft, mdiTableCog, mdiTableOff, mdiRectangle, mdiImageEditOutline, mdiArrowLeft, mdiMovieCogOutline, mdiLinkOff, mdiOpenInNew, mdiCameraOutline, mdiMathIntegral, mdiFunctionVariant, } from "@mdi/js";+import { mdiAttachment, mdiBorderHorizontal, mdiCheck, mdiChevronDown, mdiCodeBraces, mdiCodeTags, mdiDotsVertical, mdiFormatAlignCenter, mdiFormatAlignJustify, mdiFormatAlignLeft, mdiFormatAlignRight, mdiFormatBold, mdiFormatClear, mdiFormatColorHighlight, mdiFormatColorText, mdiFormatItalic, mdiFormatListBulleted, mdiFormatListNumbered, mdiFormatQuoteClose, mdiFormatStrikethrough, mdiFormatSubscript, mdiFormatSuperscript, mdiFormatTextdirectionLToR, mdiFormatTextdirectionRToL, mdiFormatUnderline, mdiImage, mdiInvertColorsOff, mdiLinkPlus, mdiLoading, mdiTable, mdiTableBorder, mdiTableRowPlusAfter, mdiTableRowPlusBefore, mdiTableRowRemove, mdiTableColumnPlusAfter, mdiTableColumnPlusBefore, mdiTableColumnRemove, mdiUploadOutline, mdiPlus, mdiFormatColorFill, mdiClose, mdiSortDescending, mdiArrowExpandRight, mdiArrowExpandLeft, mdiArrowExpandDown, mdiArrowExpandUp, mdiTableMergeCells, mdiTableSplitCell, mdiDeleteOutline, mdiDownloadOutline, mdiFormatListCheckbox, mdiDrag, mdiCheckboxMarkedOutline, mdiChevronUp, mdiArrowUp, mdiArrowDown, mdiRegex, mdiFormatLetterCase, mdiFormatLetterMatches, mdiMoviePlusOutline, mdiLink, mdiChevronRight, mdiTableColumnWidth, mdiTableRowHeight, mdiMinus, mdiPaletteOutline, mdiCircle, mdiChevronLeft, mdiTableCog, mdiTableOff, mdiRectangle, mdiImageEditOutline, mdiArrowLeft, mdiMovieCogOutline, mdiLinkOff, mdiOpenInNew, mdiCameraOutline, mdiMathIntegral, mdiFunctionVariant, mdiFileTreeOutline, } from "@mdi/js";export var Icons = {bold: mdiFormatBold,italic: mdiFormatItalic,@@ -77,6 +77,7 @@ export var Icons = {tableSettings: mdiTableCog,math: mdiFunctionVariant,mathBlock: mdiMathIntegral,+ outlineList: mdiFileTreeOutline,plus: mdiPlus,minus: mdiMinus,close: mdiClose,diff --git a/packages/editor/dist/toolbar/tooldefinitions.d.ts b/packages/editor/dist/toolbar/tooldefinitions.d.tsindex 71e62199d..c9d7776e9 100644--- a/packages/editor/dist/toolbar/tooldefinitions.d.ts+++ b/packages/editor/dist/toolbar/tooldefinitions.d.ts@@ -1,5 +1,5 @@import { ToolbarDefinition, ToolDefinition } from "./types";import { ToolId } from "./tools";export declare function getToolDefinition(id: ToolId): ToolDefinition;-export declare function getAllTools(): Record<"bold" | "italic" | "underline" | "strikethrough" | "code" | "codeRemove" | "subscript" | "superscript" | "clearformatting" | "addLink" | "editLink" | "removeLink" | "linkSettings" | "openLink" | "insertBlock" | "numberedList" | "bulletList" | "fontSize" | "fontFamily" | "headings" | "alignCenter" | "alignRight" | "alignLeft" | "alignJustify" | "ltr" | "rtl" | "textColor" | "highlight" | "math" | "imageSettings" | "imageAlignCenter" | "imageAlignLeft" | "imageAlignRight" | "imageProperties" | "embedAlignCenter" | "embedAlignLeft" | "embedAlignRight" | "embedProperties" | "embedSettings" | "attachmentSettings" | "downloadAttachment" | "removeAttachment" | "tableSettings" | "columnProperties" | "rowProperties" | "cellProperties" | "insertColumnLeft" | "insertColumnRight" | "moveColumnLeft" | "moveColumnRight" | "deleteColumn" | "splitCells" | "mergeCells" | "cellBackgroundColor" | "cellBorderColor" | "cellTextColor" | "cellBorderWidth" | "insertRowAbove" | "insertRowBelow" | "moveRowUp" | "moveRowDown" | "deleteRow" | "deleteTable", ToolDefinition>;+export declare function getAllTools(): Record<"bold" | "italic" | "underline" | "strikethrough" | "code" | "codeRemove" | "alignCenter" | "alignLeft" | "alignRight" | "alignJustify" | "subscript" | "superscript" | "ltr" | "rtl" | "numberedList" | "bulletList" | "highlight" | "textColor" | "openLink" | "linkSettings" | "imageSettings" | "rowProperties" | "insertRowBelow" | "insertRowAbove" | "moveRowDown" | "moveRowUp" | "deleteRow" | "columnProperties" | "insertColumnRight" | "insertColumnLeft" | "moveColumnRight" | "moveColumnLeft" | "deleteColumn" | "cellProperties" | "cellBorderColor" | "deleteTable" | "mergeCells" | "splitCells" | "attachmentSettings" | "embedSettings" | "tableSettings" | "math" | "fontSize" | "fontFamily" | "removeAttachment" | "downloadAttachment" | "clearformatting" | "addLink" | "editLink" | "removeLink" | "insertBlock" | "headings" | "imageAlignCenter" | "imageAlignLeft" | "imageAlignRight" | "imageProperties" | "embedAlignCenter" | "embedAlignLeft" | "embedAlignRight" | "embedProperties" | "cellBackgroundColor" | "cellTextColor" | "cellBorderWidth", ToolDefinition>;export declare const DEFAULT_TOOLS: ToolbarDefinition;diff --git a/packages/editor/dist/toolbar/tools/block.js b/packages/editor/dist/toolbar/tools/block.jsindex 2ec74796d..8dce0e1d8 100644--- a/packages/editor/dist/toolbar/tools/block.js+++ b/packages/editor/dist/toolbar/tools/block.js@@ -45,6 +45,7 @@ export function InsertBlock(props) {var menuItems = useMemo(function () {return [tasklist(editor),+ outlinelist(editor),horizontalRule(editor),codeblock(editor),mathblock(editor),@@ -216,6 +217,14 @@ var tasklist = function (editor) { return ({isChecked: editor === null || editor === void 0 ? void 0 : editor.isActive("taskList"),onClick: function () { var _a; return (_a = editor.current) === null || _a === void 0 ? void 0 : _a.chain().focus().toggleTaskList().run(); },}); };+var outlinelist = function (editor) { return ({+ key: "outlinelist",+ type: "button",+ title: "Outline list",+ icon: "outlineList",+ isChecked: editor === null || editor === void 0 ? void 0 : editor.isActive("outlineList"),+ onClick: function () { var _a; return (_a = editor.current) === null || _a === void 0 ? void 0 : _a.chain().focus().toggleOutlineList().run(); },+}); };var uploadImageFromURLMobile = function (editor) { return ({key: "upload-from-url",type: "button",diff --git a/packages/editor/src/toolbar/icons.ts b/packages/editor/src/toolbar/icons.tsindex 9092de0aa..edb44fa2a 100644--- a/packages/editor/src/toolbar/icons.ts+++ b/packages/editor/src/toolbar/icons.ts@@ -78,6 +78,7 @@ import {mdiCameraOutline,mdiMathIntegral,mdiFunctionVariant,+ mdiFileTreeOutline,} from "@mdi/js";export const Icons = {@@ -167,6 +168,7 @@ export const Icons = {tableSettings: mdiTableCog,math: mdiFunctionVariant,mathBlock: mdiMathIntegral,+ outlineList: mdiFileTreeOutline,plus: mdiPlus,minus: mdiMinus,diff --git a/packages/editor/src/toolbar/tools/block.tsx b/packages/editor/src/toolbar/tools/block.tsxindex 5356df7bf..52ad1611c 100644--- a/packages/editor/src/toolbar/tools/block.tsx+++ b/packages/editor/src/toolbar/tools/block.tsx@@ -22,6 +22,7 @@ export function InsertBlock(props: ToolProps) {const menuItems = useMemo(() => {return [tasklist(editor),+ outlinelist(editor),horizontalRule(editor),codeblock(editor),mathblock(editor),@@ -240,6 +241,15 @@ const tasklist = (editor: Editor): MenuItem => ({onClick: () => editor.current?.chain().focus().toggleTaskList().run(),});+const outlinelist = (editor: Editor): MenuItem => ({+ key: "outlinelist",+ type: "button",+ title: "Outline list",+ icon: "outlineList",+ isChecked: editor?.isActive("outlineList"),+ onClick: () => editor.current?.chain().focus().toggleOutlineList().run(),+});+const uploadImageFromURLMobile = (editor: Editor): MenuItem => ({key: "upload-from-url",type: "button",