diff --git a/apps/web/.npmrc b/apps/web/.npmrc new file mode 100644 index 000000000..748eb9318 --- /dev/null +++ b/apps/web/.npmrc @@ -0,0 +1 @@ +@streetwriters:registry=https://npm.pkg.github.com \ No newline at end of file diff --git a/apps/web/package.json b/apps/web/package.json index 34a5a8852..1ad349870 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,8 +15,10 @@ "@mdi/react": "^1.4.0", "@notesnook/crypto": "^1.0.0", "@notesnook/desktop": "file:desktop", - "@notesnook/theme": "github:streetwriters/themeprovider", "@rebass/forms": "^4.0.6", + "@streetwriters/editor": "^1.0.2", + "@streetwriters/notesnook-core": "^7.0.1", + "@streetwriters/theme": "1.0.0", "allotment": "^1.12.1", "async-mutex": "^0.3.2", "axios": "^0.21.4", @@ -35,8 +37,6 @@ "localforage-driver-memory": "^1.0.5", "localforage-getitems": "https://github.com/thecodrr/localForage-getItems.git", "nncryptoworker": "file:packages/nncryptoworker", - "notes-core": "npm:@streetwriters/notesnook-core@latest", - "notesnook-editor": "github:streetwriters/notesnook-editor#develop", "phone": "^3.1.14", "platform": "^1.3.6", "print-js": "^1.6.0", diff --git a/apps/web/src/app-effects.js b/apps/web/src/app-effects.js index 2f99ba126..ac5349196 100644 --- a/apps/web/src/app-effects.js +++ b/apps/web/src/app-effects.js @@ -8,7 +8,7 @@ import { resetReminders } from "./common/reminders"; import { introduceFeatures, showUpgradeReminderDialogs } from "./common"; import { AppEventManager, AppEvents } from "./common/app-events"; import { db } from "./common/db"; -import { CHECK_IDS, EV, EVENTS } from "notes-core/common"; +import { CHECK_IDS, EV, EVENTS } from "@streetwriters/notesnook-core/common"; import { registerKeyMap } from "./common/key-map"; import { isUserPremium } from "./hooks/use-is-user-premium"; import { loadTrackerScript } from "./utils/analytics"; diff --git a/apps/web/src/common/app-events.js b/apps/web/src/common/app-events.js index be32ecf39..91b914037 100644 --- a/apps/web/src/common/app-events.js +++ b/apps/web/src/common/app-events.js @@ -1,4 +1,4 @@ -import EventManager from "notes-core/utils/eventmanager"; +import EventManager from "@streetwriters/notesnook-core/utils/eventmanager"; export const AppEventManager = new EventManager(); export const AppEvents = { diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js index 0b735ade6..21ce62243 100644 --- a/apps/web/src/common/db.js +++ b/apps/web/src/common/db.js @@ -1,13 +1,15 @@ import { EventSourcePolyfill as EventSource } from "event-source-polyfill"; -import { EVENTS } from "notes-core/common"; +import { EVENTS } from "@streetwriters/notesnook-core/common"; import { TaskManager } from "./task-manager"; /** - * @type {import("notes-core/api").default} + * @type {import("@streetwriters/notesnook-core/api").default} */ var db; async function initializeDatabase(persistence) { - const { default: Database } = await import("notes-core/api"); + const { default: Database } = await import( + "@streetwriters/notesnook-core/api" + ); const { NNStorage } = await import("../interfaces/storage"); const { default: FS } = await import("../interfaces/fs"); db = new Database(new NNStorage(persistence), EventSource, FS); diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx index ba872cac5..31722a537 100644 --- a/apps/web/src/common/dialog-controller.tsx +++ b/apps/web/src/common/dialog-controller.tsx @@ -14,7 +14,7 @@ import { Box, Flex, Text } from "rebass"; import * as Icon from "../components/icons"; import Config from "../utils/config"; -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import downloadUpdate from "../commands/download-update"; import installUpdate from "../commands/install-update"; import { AppVersion, getChangelog } from "../utils/version"; diff --git a/apps/web/src/common/toolbar-config.ts b/apps/web/src/common/toolbar-config.ts index 0ee3b37d0..16bd10045 100644 --- a/apps/web/src/common/toolbar-config.ts +++ b/apps/web/src/common/toolbar-config.ts @@ -1,4 +1,7 @@ -import { getDefaultPresets, ToolbarGroupDefinition } from "notesnook-editor"; +import { + getDefaultPresets, + ToolbarGroupDefinition, +} from "@streetwriters/editor"; import { db } from "./db"; const defaultPresets = getDefaultPresets(); diff --git a/apps/web/src/components/dialogs/onboarding-dialog.js b/apps/web/src/components/dialogs/onboarding-dialog.js index 46be5a9d6..4dcb8bba9 100644 --- a/apps/web/src/components/dialogs/onboarding-dialog.js +++ b/apps/web/src/components/dialogs/onboarding-dialog.js @@ -20,7 +20,7 @@ import { usePersistentState } from "../../utils/hooks"; import AccentItem from "../accent-item"; import { useCallback, useState } from "react"; import Config from "../../utils/config"; -import { getAllAccents } from "@notesnook/theme"; +import { getAllAccents } from "@streetwriters/theme"; const newUserSteps = [ { diff --git a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx index 7ff7254a0..85c3a3812 100644 --- a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx +++ b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx @@ -9,7 +9,7 @@ import { ToolbarGroupDefinition, ToolDefinition, ToolId, -} from "notesnook-editor"; +} from "@streetwriters/editor"; import { closestCenter, DndContext, @@ -30,7 +30,7 @@ import { import { useEffect, useState } from "react"; import { CSS } from "@dnd-kit/utilities"; import { createPortal } from "react-dom"; -import id from "notes-core/utils/id"; +import id from "@streetwriters/notesnook-core/utils/id"; import { Label, Radio } from "@rebass/forms"; import { db } from "../../common/db"; import { useToolbarConfig } from "../editor/context"; diff --git a/apps/web/src/components/diff-viewer/content-toggle.js b/apps/web/src/components/diff-viewer/content-toggle.js index 9d913f0a5..d68b32099 100644 --- a/apps/web/src/components/diff-viewer/content-toggle.js +++ b/apps/web/src/components/diff-viewer/content-toggle.js @@ -1,4 +1,4 @@ -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import { Flex, Button } from "rebass"; function ContentToggle(props) { diff --git a/apps/web/src/components/editor/context.ts b/apps/web/src/components/editor/context.ts index c06789963..55e975670 100644 --- a/apps/web/src/components/editor/context.ts +++ b/apps/web/src/components/editor/context.ts @@ -4,7 +4,7 @@ import createStore from "../../common/store"; import BaseStore from "../../stores"; import { UseStore } from "zustand"; import shallow from "zustand/shallow"; -import { ToolbarDefinition } from "notesnook-editor"; +import { ToolbarDefinition } from "@streetwriters/editor"; type EditorSubState = { editor?: IEditor; diff --git a/apps/web/src/components/editor/footer.js b/apps/web/src/components/editor/footer.js index d0644b829..3a7dda458 100644 --- a/apps/web/src/components/editor/footer.js +++ b/apps/web/src/components/editor/footer.js @@ -1,4 +1,4 @@ -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import { Flex, Text } from "rebass"; import { useStore } from "../../stores/editor-store"; import { Loading, Saved, NotSaved } from "../icons"; diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx index 6ddc5bd84..a6c915ef2 100644 --- a/apps/web/src/components/editor/index.tsx +++ b/apps/web/src/components/editor/index.tsx @@ -11,7 +11,7 @@ import { useStore, store as editorstore } from "../../stores/editor-store"; import Toolbar from "./toolbar"; import { AppEventManager, AppEvents } from "../../common/app-events"; import { FlexScrollContainer } from "../scroll-container"; -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import { debounceWithId } from "../../utils/debounce"; import Tiptap from "./tiptap"; import Header from "./header"; @@ -20,7 +20,7 @@ import { useEditorInstance } from "./context"; import { attachFile, AttachmentProgress, insertAttachment } from "./picker"; import { DropEvent } from "react-dropzone"; import { downloadAttachment } from "../../common/attachments"; -import { EV, EVENTS } from "notes-core/common"; +import { EV, EVENTS } from "@streetwriters/notesnook-core/common"; import { db } from "../../common/db"; import useMobile from "../../utils/use-mobile"; import Titlebox from "./title-box"; diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx index ed77eaf0d..b74f93069 100644 --- a/apps/web/src/components/editor/tiptap.tsx +++ b/apps/web/src/components/editor/tiptap.tsx @@ -1,9 +1,9 @@ -import "notesnook-editor/styles/styles.css"; -import "notesnook-editor/styles/katex.min.css"; -import "notesnook-editor/styles/katexfonts.css"; -import "notesnook-editor/styles/fonts.css"; -import "notesnook-editor/styles/prism-theme.css"; -import { Theme } from "@notesnook/theme"; +import "@streetwriters/editor/styles/styles.css"; +import "@streetwriters/editor/styles/katex.min.css"; +import "@streetwriters/editor/styles/katexfonts.css"; +import "@streetwriters/editor/styles/fonts.css"; +import "@streetwriters/editor/styles/prism-theme.css"; +import { Theme } from "@streetwriters/theme"; import { useTheme } from "emotion-theming"; import { Toolbar, @@ -12,7 +12,7 @@ import { Editor, AttachmentType, usePermissionHandler, -} from "notesnook-editor"; +} from "@streetwriters/editor"; import { Box, Flex } from "rebass"; import { PropsWithChildren, useEffect, useRef, useState } from "react"; import useMobile from "../../utils/use-mobile"; diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.js index de10dcb94..37723b5f6 100644 --- a/apps/web/src/components/properties/index.js +++ b/apps/web/src/components/properties/index.js @@ -12,7 +12,7 @@ import Toggle from "./toggle"; import { navigate } from "../../navigation"; import IconTag from "../icon-tag"; import ScrollContainer from "../scroll-container"; -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import Vault from "../../common/vault"; import TimeAgo from "../time-ago"; import Attachment from "../attachment"; diff --git a/apps/web/src/components/publish-view/index.js b/apps/web/src/components/publish-view/index.js index 1458341c9..0909df120 100644 --- a/apps/web/src/components/publish-view/index.js +++ b/apps/web/src/components/publish-view/index.js @@ -8,7 +8,7 @@ import { db } from "../../common/db"; import * as clipboard from "clipboard-polyfill/text"; import ThemeProvider from "../theme-provider"; import { showToast } from "../../utils/toast"; -import { EV, EVENTS } from "notes-core/common"; +import { EV, EVENTS } from "@streetwriters/notesnook-core/common"; import { useStore } from "../../stores/monograph-store"; import { closeOpenedDialog } from "../../common/dialog-controller"; diff --git a/apps/web/src/components/theme-provider/index.js b/apps/web/src/components/theme-provider/index.js index d05e5491d..4af87c2ef 100644 --- a/apps/web/src/components/theme-provider/index.js +++ b/apps/web/src/components/theme-provider/index.js @@ -1,6 +1,6 @@ import { useStore } from "../../stores/theme-store"; import { ThemeProvider as EmotionThemeProvider } from "emotion-theming"; -import { useTheme } from "@notesnook/theme"; +import { useTheme } from "@streetwriters/theme"; function ThemeProviderWrapper(props) { const theme = useStore((store) => store.theme); diff --git a/apps/web/src/components/time-ago/index.js b/apps/web/src/components/time-ago/index.js index 866031362..cad968c34 100644 --- a/apps/web/src/components/time-ago/index.js +++ b/apps/web/src/components/time-ago/index.js @@ -1,4 +1,4 @@ -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import React, { useEffect, useRef } from "react"; import { Text } from "rebass"; import { register, format, cancel, render } from "timeago.js"; diff --git a/apps/web/src/index.js b/apps/web/src/index.js index bcd79f703..3f752e81d 100644 --- a/apps/web/src/index.js +++ b/apps/web/src/index.js @@ -1,4 +1,4 @@ -import "notes-core/types"; +import "@streetwriters/notesnook-core/types"; import { EVENTS } from "@notesnook/desktop/events"; import { render } from "react-dom"; import { AppEventManager } from "./common/app-events"; diff --git a/apps/web/src/interfaces/fs.js b/apps/web/src/interfaces/fs.js index d51c28a3f..3f272c3b0 100644 --- a/apps/web/src/interfaces/fs.js +++ b/apps/web/src/interfaces/fs.js @@ -5,8 +5,8 @@ import axios from "axios"; import { AppEventManager, AppEvents } from "../common/app-events"; import { StreamableFS } from "streamablefs"; import { getNNCrypto } from "./nncrypto.stub"; -import hosts from "notes-core/utils/constants"; -import { sendAttachmentsProgressEvent } from "notes-core/common"; +import hosts from "@streetwriters/notesnook-core/utils/constants"; +import { sendAttachmentsProgressEvent } from "@streetwriters/notesnook-core/common"; import { saveAs } from "file-saver"; import { showToast } from "../utils/toast"; import { db } from "../common/db"; diff --git a/apps/web/src/navigation/index.js b/apps/web/src/navigation/index.js index cc12af741..5f188893e 100644 --- a/apps/web/src/navigation/index.js +++ b/apps/web/src/navigation/index.js @@ -1,5 +1,5 @@ import { useState } from "react"; -import EventManager from "notes-core/utils/eventmanager"; +import EventManager from "@streetwriters/notesnook-core/utils/eventmanager"; import Config from "../utils/config"; export function navigate(url, replaceOrQuery, replace) { diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js index 02527b123..4e8844c8c 100644 --- a/apps/web/src/stores/app-store.js +++ b/apps/web/src/stores/app-store.js @@ -9,7 +9,7 @@ import { store as attachmentStore } from "./attachment-store"; import BaseStore from "./index"; import { showToast } from "../utils/toast"; import { resetReminders } from "../common/reminders"; -import { EVENTS } from "notes-core/common"; +import { EVENTS } from "@streetwriters/notesnook-core/common"; var syncStatusTimeout = 0; const BATCH_SIZE = 50; diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js index 94907a678..8553b1753 100644 --- a/apps/web/src/stores/editor-store.js +++ b/apps/web/src/stores/editor-store.js @@ -5,7 +5,7 @@ import { store as appStore } from "./app-store"; import { store as tagStore } from "./tag-store"; import { db } from "../common/db"; import BaseStore from "."; -import { EV, EVENTS } from "notes-core/common"; +import { EV, EVENTS } from "@streetwriters/notesnook-core/common"; import { hashNavigate } from "../navigation"; const SESSION_STATES = { diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.js index 6c73db927..0e3709edc 100644 --- a/apps/web/src/stores/note-store.js +++ b/apps/web/src/stores/note-store.js @@ -6,10 +6,10 @@ import { store as appStore } from "./app-store"; import { store as selectionStore } from "./selection-store"; import Vault from "../common/vault"; import BaseStore from "."; -import { EV, EVENTS } from "notes-core/common"; +import { EV, EVENTS } from "@streetwriters/notesnook-core/common"; import Config from "../utils/config"; import { hashNavigate } from "../navigation"; -import { groupArray } from "notes-core/utils/grouping"; +import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; class NoteStore extends BaseStore { notes = []; diff --git a/apps/web/src/stores/notebook-store.js b/apps/web/src/stores/notebook-store.js index abe0f510e..41cc3d139 100644 --- a/apps/web/src/stores/notebook-store.js +++ b/apps/web/src/stores/notebook-store.js @@ -3,7 +3,7 @@ import createStore from "../common/store"; import { store as appStore } from "./app-store"; import { store as noteStore } from "./note-store"; import BaseStore from "./index"; -import { groupArray } from "notes-core/utils/grouping"; +import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; import Config from "../utils/config"; class NotebookStore extends BaseStore { diff --git a/apps/web/src/stores/tag-store.js b/apps/web/src/stores/tag-store.js index 591ff6487..146954c38 100644 --- a/apps/web/src/stores/tag-store.js +++ b/apps/web/src/stores/tag-store.js @@ -1,7 +1,7 @@ import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; -import { groupArray } from "notes-core/utils/grouping"; +import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; class TagStore extends BaseStore { tags = []; diff --git a/apps/web/src/stores/theme-store.js b/apps/web/src/stores/theme-store.js index d1f4afd32..5559ba775 100644 --- a/apps/web/src/stores/theme-store.js +++ b/apps/web/src/stores/theme-store.js @@ -2,7 +2,7 @@ import createStore from "../common/store"; import BaseStore from "./index"; import Config from "../utils/config"; import changeAppTheme from "../commands/change-app-theme"; -import { getDefaultAccentColor } from "@notesnook/theme"; +import { getDefaultAccentColor } from "@streetwriters/theme"; class ThemeStore extends BaseStore { theme = Config.get("theme", "light"); diff --git a/apps/web/src/stores/trash-store.js b/apps/web/src/stores/trash-store.js index fd0662bf5..197ec563d 100644 --- a/apps/web/src/stores/trash-store.js +++ b/apps/web/src/stores/trash-store.js @@ -3,7 +3,7 @@ import createStore from "../common/store"; import BaseStore from "./index"; import { store as appStore } from "./app-store"; import { store as notestore } from "./note-store"; -import { groupArray } from "notes-core/utils/grouping"; +import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; class TrashStore extends BaseStore { trash = []; diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js index b14c16af1..9dff11aeb 100644 --- a/apps/web/src/stores/user-store.js +++ b/apps/web/src/stores/user-store.js @@ -3,7 +3,7 @@ import { db } from "../common/db"; import { store as appStore } from "./app-store"; import BaseStore from "./index"; import config from "../utils/config"; -import { EV, EVENTS } from "notes-core/common"; +import { EV, EVENTS } from "@streetwriters/notesnook-core/common"; import { showAccountLoggedOutNotice, showOnboardingDialog, diff --git a/apps/web/src/utils/keyboard.js b/apps/web/src/utils/keyboard.js index 345c635c6..80aaf451a 100644 --- a/apps/web/src/utils/keyboard.js +++ b/apps/web/src/utils/keyboard.js @@ -1,4 +1,4 @@ -import EventManager from "notes-core/utils/eventmanager"; +import EventManager from "@streetwriters/notesnook-core/utils/eventmanager"; const GlobalKeyboard = {}; diff --git a/apps/web/src/views/notes.js b/apps/web/src/views/notes.js index 95d568fe0..ccf682ec4 100644 --- a/apps/web/src/views/notes.js +++ b/apps/web/src/views/notes.js @@ -4,7 +4,7 @@ import { useStore as useNotesStore } from "../stores/note-store"; import NotesPlaceholder from "../components/placeholders/notesplacholder"; import { hashNavigate, navigate } from "../navigation"; import FavoritesPlaceholder from "../components/placeholders/favorites-placeholder"; -import { groupArray } from "notes-core/utils/grouping"; +import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; import { db } from "../common/db"; import { Flex, Text } from "rebass"; import { SyncError } from "../components/icons"; diff --git a/apps/web/src/views/settings.js b/apps/web/src/views/settings.js index 5a33894c2..9a65aa72a 100644 --- a/apps/web/src/views/settings.js +++ b/apps/web/src/views/settings.js @@ -32,7 +32,7 @@ import ScrollContainer from "../components/scroll-container"; import { showToast } from "../utils/toast"; import { hardNavigate, hashNavigate } from "../navigation"; import { appVersion } from "../utils/version"; -import { CHECK_IDS } from "notes-core/common"; +import { CHECK_IDS } from "@streetwriters/notesnook-core/common"; import Tip from "../components/tip"; import Toggle from "../components/toggle"; import { isDesktop } from "../utils/platform"; @@ -42,7 +42,7 @@ import { Slider } from "@rebass/forms"; import useZoomFactor from "../hooks/use-zoom-factor"; import { PATHS } from "@notesnook/desktop/paths"; import { openPath } from "../commands/open"; -import { getAllAccents } from "@notesnook/theme"; +import { getAllAccents } from "@streetwriters/theme"; import { debounce } from "../utils/debounce"; function subscriptionStatusToString(user) { diff --git a/apps/web/src/views/topics.js b/apps/web/src/views/topics.js index ef7658db4..d124a7ebc 100644 --- a/apps/web/src/views/topics.js +++ b/apps/web/src/views/topics.js @@ -7,7 +7,7 @@ import TopicsPlaceholder from "../components/placeholders/topics-placeholder"; import { Button, Flex, Text } from "rebass"; import { Edit, RemoveShortcutLink, ShortcutLink } from "../components/icons"; import { getTotalNotes } from "../common"; -import { formatDate } from "notes-core/utils/date"; +import { formatDate } from "@streetwriters/notesnook-core/utils/date"; import { db } from "../common/db"; import { pluralize } from "../utils/string";