Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

chore: clean up repo for open sourcing

thecodrr927ecf18c464
diff --git a/packages/editor/backward.md b/packages/editor/backward.md
deleted file mode 100644
index a54670e88..000000000
--- a/packages/editor/backward.md
+++ /dev/null
@@ -1,28 +0,0 @@
-## Checklists (done):
-
-Old:
-
-```html
- <ul style=\"list-style-type: none;\" class=\"checklist\"><li class=\"\"> Show connection state in extension<br data-mce-bogus=\"1\"></li><li>Show logged in status in extension &amp; an option to login if it is false</li><li>Show button to reconnect extension which will basically just open the web app in a separate tab</li><li>Implement Save clip functionality</li><li class=\"checked\">Move all UI to WebExtension popups</li><li class=\"checked\">Fix all UI bugs</li><li>Refactor code<ul style=\"list-style-type: none;\" class=\"checklist\"><li>Move all the modular code to <code spellcheck=\"false\">@notesnook/webextension-utils</code>&nbsp;</li><li>Clean up all the UI code</li></ul></li><li class=\"\">Make content script &amp; background script communication type-safe</li><li>Add a basic onboarding screen</li><li>Test on Firefox &amp; Chrome</li><li>Ready the extension for publishing<ul style=\"list-style-type: none;\" class=\"checklist\"><li>Icon</li><li>Description<br data-mce-bogus=\"1\"></li></ul></li></ul><p><br data-mce-bogus=\"1\"></p><p><br data-mce-bogus=\"1\"></p><p><br data-mce-bogus=\"1\"></p>
-```
-
-## Images:
-
-Load images on editor load.
-
-```html
-<img
- class="attachment"
- alt="image.png"
- data-mime="image/png"
- data-hash="ea503ba76ff2d3a7"
- data-filename="image.png"
- data-size="38039"
- width="199"
- height="367"
- style="display: block; margin-left: auto; margin-right: auto;"
- src="/placeholder.svg"
-/>
-```
-
-## Codeblocks
diff --git a/packages/editor/bugs.md b/packages/editor/bugs.md
deleted file mode 100644
index a85467b29..000000000
--- a/packages/editor/bugs.md
+++ /dev/null
@@ -1,5 +0,0 @@
-1. Color tool is not updated on selection
-2. Cached colors not working
-3. ~Font size cannot be changed after a single change~
-4. ~Setting font size and then changing text to heading has no effect~
-5. List cannot be inserted from the dropdown
diff --git a/packages/editor/test.js b/packages/editor/test.js
deleted file mode 100644
index 61779606b..000000000
--- a/packages/editor/test.js
+++ /dev/null
@@ -1,15 +0,0 @@
- const text = event.clipboardData.getData("text/plain");
- const vscode = event.clipboardData.getData("vscode-editor-data");
- const vscodeData = vscode ? JSON.parse(vscode) : undefined;
- const language = vscodeData?.mode;
-
- if (!text || !language) {
- }
-
- const { tr } = view.state;
-
- const indent = detectIndentation(text);
-
- // create an empty code block
- tr.replaceSelectionWith(
- );
\ No newline at end of file
diff --git a/packages/editor/todo b/packages/editor/todo
deleted file mode 100644
index b2618eee6..000000000
--- a/packages/editor/todo
+++ /dev/null
@@ -1,14 +0,0 @@
-1. Editor
- a. Wrap Tiptap in useTiptap hook -> done
- b. Create useEditorController hook -> done
- c. Expose required events to app via post -> done
-
-2. App
- a. Refactor Functions.js to a hook or a class possibly.
- b. Implement basic editing
- 1. Save & load content
- 2. Save & load title
- 3. Update status bar in Editor
- 4. Attach toolbar commands & events
- 5. Show selected text formats in toolbar
-
diff --git a/packages/editor/toolbar.md b/packages/editor/toolbar.md
deleted file mode 100644
index e75925f86..000000000
--- a/packages/editor/toolbar.md
+++ /dev/null
@@ -1,133 +0,0 @@
-Features:
-
-1. Cross-platform
-2. Able to render at the top & the bottom
- 1. Aligns & adjusts different elements based on where it's located
-3. 4 different types of interaction elements:
- 1. Dropdown
- 2. Popup
- 3. Bottom action sheet (mobile only)
- 4. Sidebar
-4. The toolbar will be extensible allowing plugins to add tools into it.
-
-API Design:
-
-1. All the tools will be defined in a seperate file
-2. Each tool will implement the `ITool` interface
-3. The `ITool` interface defines:
- 1. The name
- 2. Type: "block" | "inline" etc.
- 3. Help text/description
- 4. The action
-4. Each tool will take the `Editor` instance from its constructor
-5. The `action` needs to be pure i.e., it should perform the exact same action on the same data.
-6. All the tools classes will be exported from the `index.ts` file
-
-The Toolbar:
-
-1. The toolbar will be React rendered taking a tool definition from its props & the location.
-2. Based on the tool definition, the toolbar will render different items.
-3. The icon for each tool will be derived from the tool definition
- 1. We will need an icon resolver that will take an icon name & find the icon associated with it.
- 2. To this purpose, we should have an icon dictionary which the client can import & use.
-4. This toolbar will be exported for the client to render.
-
-Interaction Elements:
-
-1. Inside the `action` of each tool, the action will have full control over what to render & where.
-2. The action should take the rendered `HTMLElement` as reference
-3. In case of dropdown:
- 1. We can use the menu from the app & move it into a module
- 2. This menu can then be reshaped to act as a dropdown
-4. In case of bottom sheet:
- 1. We should use [react-spring-bottom-sheet](https://github.com/stipsan/react-spring-bottom-sheet)
- 2. Since bottom sheet will serve multiple purposes (not just a list of items), it should be possible
- to render anything in it.
-5. In case of popup: TBD
-6. In case of side bar: TBD
-
-Total Tools:
-
-- [x] bold italic underline strikethrough inlinecode
-- [x] fontselect
-- [x] blockquote (styling left)
-- [x] codeblock
-- [x] fontsizeselect
-- [x] formatselect
-- [x] alignleft aligncenter alignright alignjustify
-- [] outdent indent
-- [x] subscript superscript
-- [x] numlist
-- [x] bullist
-- [x] checklist
-- [x] forecolor backcolor
-- [x] removeformat
-- [x] hr
-- [x] link
-- [x] image
-- [x] attachment
-- [x] media
-- [x] table
-- [x] ltr rtl
-- [x] searchreplace
-
-What's next:
-
-- [x] Port codeblock extension from tinymce to tiptap
-- [x] Optimize toolbar & editor UI for mobile
-- [x] Refactor & finalize UI + styling
-- [ ] Write tests
-
-## Optimize toolbar & editor UI for mobile
-
-1. Refactor tools to be more easily configurable (partially done)
-2. Implement sub groups in toolbar (done)
-3. Move all popups to /popups directory (partially done)
-4. Implement mobile positioning logic in menu/popup presenter (done)
-5. Add support for repositioning toolbar (top/bottom) (done)
-6. Move all popups to be shown as bottom sheets on mobile (partially done)
-7. Figure out how to make interactive widgets selectable in editor (e.g. iframe & table)
-8. Create popup header for use in action sheet (done)
- 1. Header contains title & action(s)
-9. Implement logic to open inline popups (image/cell properties) as an action sheet (done)
-10. Open search replace popup as action sheet (done)
-11. Improve font size menu (done)
-12. Move table context toolbars to bottom (done)
-
-### Refactor tools
-
-1. A tool defines it's own UI
- - This gives it maximum flexibility to do whatever it wants.
- - However, this also restricts the tool to be shown in specific places
- - For example: if all block tools are defined as menu buttons, they can only be shown in a menu
- - But since this toolbar is application specific, this is alright. We already know where a certain
- tool is going to be rendered. Locking things down, while reduces flexibility, also allows us to
- easily customize a specific tool's behavior. A generic toolbar would be great in cases where multiple
- apps are going to be using it.
-2. Some factors of a tool's UI can be defined externally
- - For example, a tool's icon + title + description?
-3. It wouldn't be a bad idea to separate out action & toggle state of a tool as well. This can be useful in
- cases where we want to invoke a specific tool or get a specific tool's toggle state.
-
----
-
-1. Keyboard shouldn't close on tool click
-2. Handle context toolbar menus on scroll
-
-## Premium restriction
-
-1. `isAuthorized` method on the editor
-2. `execCommand` method on the editor that emits an event (onBeforeExecCommand)
-
-Requirements:
-
- 1. We will need to check the user status sometimes outside the editor commands
- 2. For this reason, we shouldn't attach this to the editor
- 3. Or if we do, we shouldn't make it command specific.
- 4. Secondly, we need a way to authorize user actions without spreading it all over the codebase.
- 5. One option is to put it in the base buttons etc. and pass an "isPro" prop
- 1. But I don't like this because not all buttons need it.
- 6. What we should do it emit an event before each command
- 1. We can have a `requestPermission` method on the editor that sends an id
- 2. This can be used to allow/deny user actions
- 7. And also have a function to check authorization for non-command actions.