From 5b1ec8e91562fed2ea7a2a5f3b9e6a5d5177c8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= <34830846+alisahanyalcin@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:27:32 +0300 Subject: [PATCH 1/6] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4fa733..bf0317b 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,12 @@ Typing Assistant is a plugin that improves writing efficiency and provides a use ![GitHub all releases](https://img.shields.io/github/downloads/jambo2018/notion-assistant-plugin/total) -## Demo +## Demo 1 ![Typing Assistant Demo](/src/assets/demo.gif) + +## Demo 2 +https://github.com/alisahanyalcin/Typing-Assistant/assets/34830846/0994312e-ab97-45b1-b810-d1a9b62b9c40 + ## Usage - Install and activate the plugin - When you input a '/' in an empty line or the end of a line that not empty,you will get a command menu to help you choose type of the new line @@ -23,4 +27,4 @@ Typing Assistant is a plugin that improves writing efficiency and provides a use - Click to browse community plugins - Search for "Typing Assistant" - click install -- Once installed, close the community plugin window and activate the newly installed plugin \ No newline at end of file +- Once installed, close the community plugin window and activate the newly installed plugin From dfaa71bfee8355dc4cc47ee925966d7cc39e1589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= Date: Sun, 31 Dec 2023 16:30:23 +0300 Subject: [PATCH 2/6] Update README.md --- README.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e4fa733..d7475e3 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ # Typing Assistant -Typing Assistant is a plugin that improves writing efficiency and provides a user experience similar to that of【Notion】 +Typing Assistant is a plugin that improves writing efficiency and provides a user experience similar to that of Notion -![GitHub all releases](https://img.shields.io/github/downloads/jambo2018/notion-assistant-plugin/total) +![GitHub all releases](https://img.shields.io/github/downloads/alisahanyalcin/Typing-Assistant/total) -## Demo +## Demo 1 ![Typing Assistant Demo](/src/assets/demo.gif) + +## Demo 2 +https://github.com/alisahanyalcin/Typing-Assistant/assets/34830846/0994312e-ab97-45b1-b810-d1a9b62b9c40 + ## Usage - Install and activate the plugin -- When you input a '/' in an empty line or the end of a line that not empty,you will get a command menu to help you choose type of the new line +- When you input a '/' in an empty line or the end of a line that not empty, you will get a command menu to help you choose type of the new line - At any time, the selected text will evoke the selection-menu for quick setting to switch the style of the selected text,and also supports row style switching - + ## Features - Support to create multiple types of line text by invoke the shortcut menu -- Support settings relular styles of markdown to selected text +- Support settings regular styles of markdown to selected text - The menu actively follows the cursor position of writing - Support input link address to generate personalized card - Supports custom command combinations and drag-and-drop sorting @@ -23,4 +27,4 @@ Typing Assistant is a plugin that improves writing efficiency and provides a use - Click to browse community plugins - Search for "Typing Assistant" - click install -- Once installed, close the community plugin window and activate the newly installed plugin \ No newline at end of file +- Once installed, close the community plugin window and activate the newly installed plugin From 191997f56613c2becd02018393392f168a6df2ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= Date: Sun, 31 Dec 2023 16:48:13 +0300 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7475e3..237bf14 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Typing Assistant Typing Assistant is a plugin that improves writing efficiency and provides a user experience similar to that of Notion -![GitHub all releases](https://img.shields.io/github/downloads/alisahanyalcin/Typing-Assistant/total) +![GitHub all releases](https://img.shields.io/github/downloads/jambo2018/notion-assistant-plugin/total) ## Demo 1 ![Typing Assistant Demo](/src/assets/demo.gif) From 633e4656f59c896ff3fd53d64fdcf3f07aa37872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= Date: Mon, 1 Jan 2024 11:40:25 +0300 Subject: [PATCH 4/6] Update constants.ts --- src/constants.ts | 162 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 41 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index 09d401d..e9ea522 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,42 +1,41 @@ export const ICON_MAP = { ['text']: '', - ['heading1']: - '', - ['heading2']: - '', - ['heading3']: - '', - ['heading4']: - '', - ['heading5']: - '', - ['heading6']: - '', - ['todoList']: - '', - ['linkBookMark']: - '', - ['bulletList']: - '', - ['numberList']: - '', + ['heading1']: '', + ['heading2']: '', + ['heading3']: '', + ['heading4']: '', + ['heading5']: '', + ['heading6']: '', + ['todoList']: '', + ['linkBookMark']: '', + ['bulletList']: '', + ['numberList']: '', ['bold']: '', - ['strikethrough']: - '', - ['italics']: - '', - ['underline']: - '', + ['strikethrough']: '', + ['italics']: '', + ['underline']: '', ['code']: '', ['divide']: '', ['quote']: '', ['link']: '', ['math']: '', ['highlight']: '', - ['call-out']: '', + ["note-call-out"]: '', + ["abstract-call-out"]: '', + ["info-call-out"]: '', + ["todo-call-out"]: '', + ["tip-call-out"]: '', + ["success-call-out"]: '', + ["question-call-out"]: '', + ["warning-call-out"]: '', + ["failure-call-out"]: '', + ["danger-call-out"]: '', + ["bug-call-out"]: '', + ["example-call-out"]: '', ['tag']: '', ['embed']: '' } + export const TEXT_MAP = { ['text']: "Text", ['heading1']: "Heading1", @@ -52,7 +51,18 @@ export const TEXT_MAP = { ['quote']: "Quote", ['linkBookMark']: "Link Bookmark", ['divide']: "Divide", - ['callout']: "CallOut", + ["noteCallout"]: "Note Callout", + ["abstractCallout"]: "Abstract Callout", + ["infoCallout"]: "Info Callout", + ["todoCallout"]: "Todo Callout", + ["tipCallout"]: "Tip Callout", + ["successCallout"]: "Success Callout", + ["questionCallout"]: "Question Callout", + ["warningCallout"]: "Warning Callout", + ["failureCallout"]: "Failure Callout", + ["dangerCallout"]: "Danger Callout", + ["bugCallout"]: "Bug Callout", + ["exampleCallout"]: "example Callout", }; export const CMD_INSERTIONS = { @@ -79,7 +89,18 @@ export const CMD_INSERTIONS = { export const CONTENT_MAP = { embed: "![[]]", - callout: "> [!NOTE]\n> ", + noteCallout: "> [!NOTE]\n> ", + abstractCallout: "> [!abstract]\n> ", + infoCallout: "> [!info]\n> ", + todoCallout: "> [!todo]\n> ", + tipCallout: "> [!tip]\n> ", + successCallout: "> [!success]\n> ", + questionCallout: "> [!question]\n> ", + warningCallout: "> [!warning]\n> ", + failureCallout: "> [!failure]\n> ", + dangerCallout: "> [!danger]\n> ", + bugCallout: "> [!bug]\n> ", + exampleCallout: "> [!example]\n> ", quote: "> ", linkBookMark: "bookmark", math: "$$\n\n$$", @@ -99,7 +120,18 @@ export const CONTENT_MAP = { export const HEADING_MENU = [ 'insert-text', - 'insert-callout', + "insert-note-callout", + "insert-abstract-callout", + "insert-info-callout", + "insert-todo-callout", + "insert-tip-callout", + "insert-success-callout", + "insert-question-callout", + "insert-warning-callout", + "insert-failure-callout", + "insert-danger-callout", + "insert-bug-callout", + "insert-example-callout", 'insert-heading1', 'insert-heading2', 'insert-heading3', @@ -143,16 +175,66 @@ export const SELECTION_CMDS = [ "toggle-highlight" ] as const; - - - - - export const CMD_CONFIG = { - ['insert-callout']: { - title: 'Callout', - icon: 'call-out', - cmd: "typing-assistant:insert-callout" + ["insert-note-callout"]: { + title: "Note Callout", + icon: "note-call-out", + cmd: "typing-assistant:insert-note-callout" + }, + ["insert-abstract-callout"]: { + title: "Abstract Callout", + icon: "abstract-call-out", + cmd: "typing-assistant:insert-abstract-callout" + }, + ["insert-info-callout"]: { + title: "Info Callout", + icon: "info-call-out", + cmd: "typing-assistant:insert-info-callout" + }, + ["insert-todo-callout"]: { + title: "Todo Callout", + icon: "todo-call-out", + cmd: "typing-assistant:insert-todo-callout" + }, + ["insert-tip-callout"]: { + title: "Tip Callout", + icon: "tip-call-out", + cmd: "typing-assistant:insert-tip-callout" + }, + ["insert-success-callout"]: { + title: "Success Callout", + icon: "success-call-out", + cmd: "typing-assistant:insert-success-callout" + }, + ["insert-question-callout"]: { + title: "Question Callout", + icon: "question-call-out", + cmd: "typing-assistant:insert-question-callout" + }, + ["insert-warning-callout"]: { + title: "Warning Callout", + icon: "warning-call-out", + cmd: "typing-assistant:insert-warning-callout" + }, + ["insert-failure-callout"]: { + title: "Failure Callout", + icon: "failure-call-out", + cmd: "typing-assistant:insert-failure-callout" + }, + ["insert-danger-callout"]: { + title: "Danger Callout", + icon: "danger-call-out", + cmd: "typing-assistant:insert-danger-callout" + }, + ["insert-bug-callout"]: { + title: "Bug Callout", + icon: "bug-call-out", + cmd: "typing-assistant:insert-bug-callout" + }, + ["insert-example-callout"]: { + title: "Example Callout", + icon: "example-call-out", + cmd: "typing-assistant:insert-example-callout" }, 'insert-tag': { title: 'Tag', @@ -301,8 +383,6 @@ export const CMD_CONFIG = { icon: 'numberList', cmd: "editor:toggle-numbered-list", }, - - 'set-link': { title: 'Link', icon: 'link', From 2439cd107c40c8c9d0e79a3b44844b243a5273e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= Date: Mon, 1 Jan 2024 11:55:02 +0300 Subject: [PATCH 5/6] Update cmd-generate.ts --- src/util/cmd-generate.ts | 93 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 85 insertions(+), 8 deletions(-) diff --git a/src/util/cmd-generate.ts b/src/util/cmd-generate.ts index 1c6bed3..3e34b46 100644 --- a/src/util/cmd-generate.ts +++ b/src/util/cmd-generate.ts @@ -153,13 +153,90 @@ export function loadCommands() { generateCommand(CONTENT_MAP['quote']) }, }); - this.addCommand({ - id: "insert-callout", - name: "Insert Callout", - editorCallback: (editor: Editor) => { - generateCommand(CONTENT_MAP['callout']) - }, - }); + this.addCommand({ + id: "insert-note-callout", + name: "Insert Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["noteCallout"]); + } + }); + this.addCommand({ + id: "insert-abstract-callout", + name: "Insert Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["abstractCallout"]); + } + }); + this.addCommand({ + id: "insert-info-callout", + name: "Insert Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["infoCallout"]); + } + }); + this.addCommand({ + id: "insert-todo-callout", + name: "Insert Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["todoCallout"]); + } + }); + this.addCommand({ + id: "insert-tip-callout", + name: "Insert Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["tipCallout"]); + } + }); + this.addCommand({ + id: "insert-success-callout", + name: "Success Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["successCallout"]); + } + }); + this.addCommand({ + id: "insert-question-callout", + name: "Question Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["questionCallout"]); + } + }); + this.addCommand({ + id: "insert-warning-callout", + name: "Warning Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["warningCallout"]); + } + }); + this.addCommand({ + id: "insert-failure-callout", + name: "Failure Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["failureCallout"]); + } + }); + this.addCommand({ + id: "insert-danger-callout", + name: "Danger Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["dangerCallout"]); + } + }); + this.addCommand({ + id: "insert-bug-callout", + name: "Bug Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["bugCallout"]); + } + }); + this.addCommand({ + id: "insert-example-callout", + name: "Example Callout", + editorCallback: (editor) => { + generateCommand(CONTENT_MAP["exampleCallout"]); + } + }); this.addCommand({ id: "insert-mathblock", name: "Insert Math Block", @@ -262,4 +339,4 @@ export function loadCommands() { }, }); -} \ No newline at end of file +} From ae8a72c5fd556ba31f83557b0b9e90ef435720d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=C5=9Eahan=20Yal=C3=A7=C4=B1n?= Date: Mon, 1 Jan 2024 11:58:48 +0300 Subject: [PATCH 6/6] Update cmd-generate.ts --- src/util/cmd-generate.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/util/cmd-generate.ts b/src/util/cmd-generate.ts index 3e34b46..3982094 100644 --- a/src/util/cmd-generate.ts +++ b/src/util/cmd-generate.ts @@ -156,84 +156,84 @@ export function loadCommands() { this.addCommand({ id: "insert-note-callout", name: "Insert Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["noteCallout"]); } }); this.addCommand({ id: "insert-abstract-callout", name: "Insert Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["abstractCallout"]); } }); this.addCommand({ id: "insert-info-callout", name: "Insert Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["infoCallout"]); } }); this.addCommand({ id: "insert-todo-callout", name: "Insert Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["todoCallout"]); } }); this.addCommand({ id: "insert-tip-callout", name: "Insert Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["tipCallout"]); } }); this.addCommand({ id: "insert-success-callout", name: "Success Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["successCallout"]); } }); this.addCommand({ id: "insert-question-callout", name: "Question Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["questionCallout"]); } }); this.addCommand({ id: "insert-warning-callout", name: "Warning Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["warningCallout"]); } }); this.addCommand({ id: "insert-failure-callout", name: "Failure Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["failureCallout"]); } }); this.addCommand({ id: "insert-danger-callout", name: "Danger Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["dangerCallout"]); } }); this.addCommand({ id: "insert-bug-callout", name: "Bug Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["bugCallout"]); } }); this.addCommand({ id: "insert-example-callout", name: "Example Callout", - editorCallback: (editor) => { + editorCallback: (editor: Editor) => { generateCommand(CONTENT_MAP["exampleCallout"]); } });