From c317774c8a0382a29f728eb8b160a5706eb32812 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 30 Aug 2022 16:13:11 +0500 Subject: [PATCH 1/3] docs: add license header --- commitlint.config.js => .commitlintrc.js | 0 .eslintignore | 4 + .eslintrc.js | 13 +- .vscode/settings.json | 3 + LICENSE | 674 +++++++++++++ apps/mobile/app/app.js | 18 + apps/mobile/app/assets/images/assets.js | 18 + apps/mobile/app/common/analytics/index.js | 18 + apps/mobile/app/common/database/encryption.js | 18 + apps/mobile/app/common/database/index.js | 18 + apps/mobile/app/common/database/mmkv.js | 18 + apps/mobile/app/common/database/storage.js | 18 + apps/mobile/app/common/filesystem/download.js | 18 + apps/mobile/app/common/filesystem/index.js | 18 + apps/mobile/app/common/filesystem/io.js | 18 + apps/mobile/app/common/filesystem/upload.js | 18 + apps/mobile/app/common/filesystem/utils.js | 18 + apps/mobile/app/common/logger/index.ts | 18 + .../components/announcements/announcement.js | 18 + .../app/components/announcements/body.js | 18 + .../app/components/announcements/cta.js | 18 + .../components/announcements/description.js | 18 + .../app/components/announcements/functions.js | 18 + .../app/components/announcements/index.js | 18 + .../app/components/announcements/list.js | 18 + .../app/components/announcements/photo.js | 18 + .../components/announcements/subheading.js | 18 + .../app/components/announcements/title.js | 18 + .../app/components/attachments/actions.js | 18 + .../components/attachments/attachment-item.js | 18 + .../app/components/attachments/index.js | 18 + apps/mobile/app/components/auth/auth-modal.js | 18 + apps/mobile/app/components/auth/background.js | 18 + .../app/components/auth/change-password.js | 18 + apps/mobile/app/components/auth/common.js | 18 + .../app/components/auth/forgot-password.js | 18 + apps/mobile/app/components/auth/index.js | 18 + apps/mobile/app/components/auth/login.js | 18 + .../app/components/auth/session-expired.js | 18 + apps/mobile/app/components/auth/signup.js | 18 + apps/mobile/app/components/auth/two-factor.js | 18 + .../components/container/container-header.js | 18 + .../components/container/floating-button.js | 18 + apps/mobile/app/components/container/index.js | 18 + .../delay-layout/default-placeholder.tsx | 18 + .../app/components/delay-layout/index.tsx | 18 + .../delay-layout/settings-placeholder.tsx | 18 + .../app/components/dialog-provider/index.js | 18 + .../components/dialog-provider/recievers.js | 18 + .../app/components/dialog/base-dialog.js | 18 + .../app/components/dialog/dialog-buttons.js | 18 + .../app/components/dialog/dialog-container.js | 18 + .../app/components/dialog/dialog-header.tsx | 18 + .../mobile/app/components/dialog/functions.ts | 18 + apps/mobile/app/components/dialog/index.js | 18 + .../app/components/dialogs/add-topic/index.js | 18 + .../dialogs/jump-to-section/index.js | 18 + .../app/components/dialogs/result/index.js | 18 + .../components/dialogs/result/pro-features.js | 18 + .../app/components/dialogs/vault/index.js | 18 + .../components/exception-handler/index.tsx | 18 + apps/mobile/app/components/header/index.js | 18 + .../app/components/header/left-menus.js | 18 + .../app/components/header/right-menus.js | 18 + apps/mobile/app/components/header/title.js | 18 + .../app/components/image-preview/index.js | 18 + apps/mobile/app/components/intro/index.js | 18 + apps/mobile/app/components/intro/welcome.js | 18 + apps/mobile/app/components/launcher/index.js | 18 + .../app/components/list-items/footer/index.js | 18 + .../components/list-items/headers/header.js | 18 + .../list-items/headers/notebook-header.js | 18 + .../list-items/headers/section-header.js | 18 + .../app/components/list-items/note/index.js | 18 + .../app/components/list-items/note/wrapper.js | 18 + .../components/list-items/notebook/index.js | 18 + .../components/list-items/notebook/wrapper.js | 18 + .../selection-wrapper/action-strip.js | 18 + .../list-items/selection-wrapper/back-fill.js | 18 + .../list-items/selection-wrapper/index.js | 18 + .../list-items/selection-wrapper/selection.js | 18 + .../app/components/list-items/tag/index.js | 18 + apps/mobile/app/components/list/card.js | 18 + apps/mobile/app/components/list/empty.js | 18 + apps/mobile/app/components/list/index.js | 18 + .../app/components/merge-conflicts/index.js | 18 + .../app/components/note-history/index.js | 18 + .../app/components/note-history/preview.js | 18 + .../components/premium/compact-features.js | 18 + .../app/components/premium/component.js | 18 + .../mobile/app/components/premium/expiring.js | 18 + apps/mobile/app/components/premium/feature.js | 18 + .../mobile/app/components/premium/features.js | 18 + apps/mobile/app/components/premium/group.js | 18 + apps/mobile/app/components/premium/index.js | 18 + apps/mobile/app/components/premium/offer.js | 18 + .../app/components/premium/premium-toast.js | 18 + .../app/components/premium/pricing-item.js | 18 + .../app/components/premium/pricing-plans.js | 18 + apps/mobile/app/components/premium/pro-tag.js | 18 + .../app/components/properties/color-tags.js | 18 + .../app/components/properties/date-meta.js | 18 + .../app/components/properties/dev-mode.js | 18 + .../mobile/app/components/properties/index.js | 18 + .../mobile/app/components/properties/items.js | 18 + .../app/components/properties/notebooks.js | 18 + .../app/components/properties/synced.js | 18 + apps/mobile/app/components/properties/tags.js | 18 + .../app/components/properties/topics.js | 18 + .../app/components/selection-header/index.js | 18 + .../app/components/sheet-provider/index.js | 18 + .../components/sheets/add-notebook/index.js | 18 + .../app/components/sheets/add-to/index.js | 18 + .../components/sheets/export-notes/index.js | 18 + .../components/sheets/export-notes/share.js | 18 + .../app/components/sheets/github/issue.js | 18 + .../components/sheets/manage-tags/index.js | 18 + .../app/components/sheets/migrate/index.tsx | 18 + .../components/sheets/move-notes/movenote.tsx | 18 + .../components/sheets/new-feature/index.tsx | 18 + .../app/components/sheets/progress/index.tsx | 18 + .../components/sheets/publish-note/index.js | 18 + .../app/components/sheets/rate-app/index.js | 18 + .../components/sheets/recovery-key/index.js | 18 + .../components/sheets/restore-data/index.js | 18 + .../app/components/sheets/sort/index.js | 18 + .../app/components/sheets/update/index.js | 18 + .../app/components/side-menu/color-section.js | 18 + apps/mobile/app/components/side-menu/index.js | 18 + .../app/components/side-menu/menu-item.js | 18 + .../components/side-menu/pinned-section.js | 18 + .../app/components/side-menu/user-status.js | 18 + apps/mobile/app/components/tabs/index.tsx | 18 + apps/mobile/app/components/tip/index.tsx | 18 + apps/mobile/app/components/toast/index.js | 18 + .../ui/animated-button.tsx/index.tsx | 18 + .../mobile/app/components/ui/button/index.tsx | 18 + .../app/components/ui/icon-button/index.tsx | 18 + apps/mobile/app/components/ui/input/index.tsx | 18 + .../mobile/app/components/ui/notice/index.tsx | 18 + .../app/components/ui/pressable/index.tsx | 18 + .../app/components/ui/seperator/index.tsx | 18 + apps/mobile/app/components/ui/sheet/index.js | 18 + apps/mobile/app/components/ui/svg/index.tsx | 18 + apps/mobile/app/components/ui/svg/lazy.js | 18 + .../app/components/ui/svg/module-svg.js | 18 + .../app/components/ui/time-since/index.tsx | 18 + .../ui/transitions/bouncing-view.js | 18 + .../app/components/ui/typography/heading.tsx | 18 + .../components/ui/typography/paragraph.tsx | 18 + .../app/components/walkthroughs/index.tsx | 18 + .../components/walkthroughs/walkthroughs.tsx | 18 + apps/mobile/app/features.ts | 18 + apps/mobile/app/hooks/use-actions.js | 18 + apps/mobile/app/hooks/use-app-events.js | 18 + apps/mobile/app/hooks/use-app-state.ts | 18 + .../app/hooks/use-attachment-progress.js | 18 + apps/mobile/app/hooks/use-delay-layout.ts | 18 + apps/mobile/app/hooks/use-editor-tags.ts | 18 + apps/mobile/app/hooks/use-immediate.ts | 18 + .../app/hooks/use-is-floating-keyboard.ts | 18 + apps/mobile/app/hooks/use-keyboard.ts | 18 + apps/mobile/app/hooks/use-navigation-focus.ts | 18 + apps/mobile/app/hooks/use-pricing.ts | 18 + apps/mobile/app/hooks/use-rotator.ts | 18 + apps/mobile/app/hooks/use-sync-progress.ts | 20 +- apps/mobile/app/hooks/use-timer.ts | 18 + apps/mobile/app/hooks/use-tooltip.ts | 18 + apps/mobile/app/hooks/use-vault-status.js | 18 + apps/mobile/app/navigation/index.js | 18 + .../mobile/app/navigation/navigation-stack.js | 18 + apps/mobile/app/navigation/tabs-holder.js | 18 + apps/mobile/app/screens/editor/index.tsx | 18 + apps/mobile/app/screens/editor/loading.js | 18 + apps/mobile/app/screens/editor/progress.js | 18 + apps/mobile/app/screens/editor/source.ts | 18 + .../app/screens/editor/tiptap/commands.ts | 18 + .../app/screens/editor/tiptap/picker.js | 18 + .../mobile/app/screens/editor/tiptap/types.ts | 18 + .../editor/tiptap/use-editor-events.ts | 18 + .../app/screens/editor/tiptap/use-editor.ts | 18 + .../mobile/app/screens/editor/tiptap/utils.ts | 18 + apps/mobile/app/screens/editor/wrapper.js | 18 + apps/mobile/app/screens/favorites/index.tsx | 18 + apps/mobile/app/screens/home/index.tsx | 18 + apps/mobile/app/screens/notebook/index.tsx | 18 + apps/mobile/app/screens/notebooks/index.tsx | 18 + apps/mobile/app/screens/notes/colored.tsx | 18 + apps/mobile/app/screens/notes/common.ts | 18 + apps/mobile/app/screens/notes/index.tsx | 18 + apps/mobile/app/screens/notes/monographs.tsx | 18 + apps/mobile/app/screens/notes/tagged.tsx | 18 + apps/mobile/app/screens/notes/topic-notes.tsx | 18 + apps/mobile/app/screens/search/index.js | 18 + apps/mobile/app/screens/search/search-bar.js | 18 + apps/mobile/app/screens/settings/2fa.tsx | 18 + apps/mobile/app/screens/settings/app-lock.js | 18 + .../mobile/app/screens/settings/appearance.js | 18 + .../app/screens/settings/backup-restore.js | 18 + .../app/screens/settings/components.tsx | 18 + apps/mobile/app/screens/settings/debug.tsx | 18 + .../app/screens/settings/editor/common.tsx | 18 + .../settings/editor/configure-toolbar.tsx | 18 + .../app/screens/settings/editor/group.tsx | 18 + .../app/screens/settings/editor/state.ts | 18 + .../screens/settings/editor/tool-sheet.tsx | 18 + .../app/screens/settings/editor/tool.tsx | 18 + .../settings/editor/toolbar-definition.ts | 18 + apps/mobile/app/screens/settings/functions.js | 18 + apps/mobile/app/screens/settings/group.tsx | 18 + apps/mobile/app/screens/settings/home.tsx | 18 + apps/mobile/app/screens/settings/index.tsx | 18 + .../app/screens/settings/section-group.tsx | 18 + .../app/screens/settings/section-item.tsx | 18 + .../app/screens/settings/settings-data.tsx | 18 + .../app/screens/settings/subscription.js | 18 + apps/mobile/app/screens/settings/types.ts | 18 + .../app/screens/settings/user-section.js | 18 + apps/mobile/app/screens/tags/index.tsx | 18 + apps/mobile/app/screens/trash/index.tsx | 18 + apps/mobile/app/services/backup.js | 18 + apps/mobile/app/services/biometrics.ts | 18 + apps/mobile/app/services/device-detection.js | 18 + apps/mobile/app/services/event-manager.ts | 18 + apps/mobile/app/services/exporter.js | 18 + apps/mobile/app/services/message.js | 18 + apps/mobile/app/services/navigation.ts | 18 + apps/mobile/app/services/notifications.ts | 18 + apps/mobile/app/services/premium.js | 18 + apps/mobile/app/services/search.js | 18 + apps/mobile/app/services/settings.ts | 18 + apps/mobile/app/services/sync.js | 18 + apps/mobile/app/services/tip-manager.ts | 18 + apps/mobile/app/services/validation.js | 18 + apps/mobile/app/stores/index.ts | 18 + .../mobile/app/stores/use-attachment-store.ts | 18 + apps/mobile/app/stores/use-editor-store.ts | 18 + apps/mobile/app/stores/use-favorite-store.ts | 20 +- apps/mobile/app/stores/use-menu-store.ts | 18 + apps/mobile/app/stores/use-message-store.ts | 18 + .../mobile/app/stores/use-navigation-store.ts | 18 + apps/mobile/app/stores/use-notebook-store.ts | 20 +- apps/mobile/app/stores/use-notes-store.ts | 20 +- apps/mobile/app/stores/use-search-store.ts | 18 + apps/mobile/app/stores/use-selection-store.ts | 18 + apps/mobile/app/stores/use-setting-store.ts | 18 + apps/mobile/app/stores/use-tag-store.ts | 22 +- apps/mobile/app/stores/use-theme-store.ts | 18 + apps/mobile/app/stores/use-trash-store.ts | 20 +- apps/mobile/app/stores/use-user-store.ts | 18 + apps/mobile/app/utils/color-scheme/index.js | 18 + apps/mobile/app/utils/color-scheme/utils.js | 18 + apps/mobile/app/utils/constants.js | 18 + apps/mobile/app/utils/events.js | 18 + apps/mobile/app/utils/functions.js | 18 + apps/mobile/app/utils/global-refs.ts | 18 + apps/mobile/app/utils/index.js | 18 + apps/mobile/app/utils/layout-manager.js | 18 + apps/mobile/app/utils/sanitizer/index.js | 18 + apps/mobile/app/utils/size/index.js | 18 + apps/mobile/app/utils/sse/even-source-ios.js | 32 +- apps/mobile/app/utils/sse/event-source.js | 18 + apps/mobile/app/utils/time/index.ts | 18 + apps/mobile/app/utils/types.ts | 18 + apps/mobile/app/version.js | 18 + apps/mobile/e2e/environment.js | 18 + apps/mobile/e2e/setup.ts | 18 + apps/mobile/e2e/test.ids.js | 18 + apps/mobile/e2e/tests/auth.e2e.js | 18 + apps/mobile/e2e/tests/index.e2e.js | 18 + apps/mobile/e2e/tests/note.e2e.js | 18 + apps/mobile/e2e/tests/notebook.e2e.js | 18 + apps/mobile/e2e/tests/search.e2e.js | 18 + apps/mobile/e2e/tests/sort.e2e.js | 18 + apps/mobile/e2e/tests/tag.e2e.js | 18 + apps/mobile/e2e/tests/utils.js | 18 + apps/mobile/e2e/tests/vault.e2e.js | 18 + apps/mobile/share/index.js | 18 + apps/mobile/share/quick-note.js | 18 + apps/mobile/share/search.js | 18 + apps/mobile/share/share.js | 18 + apps/mobile/share/store.js | 18 + apps/web/__e2e__/checkout.test.js | 18 + apps/web/__e2e__/colors.issues.test.js | 18 + apps/web/__e2e__/editor.test.js | 20 +- apps/web/__e2e__/importer.test.js | 18 + apps/web/__e2e__/navigation.test.js | 18 + apps/web/__e2e__/notebooks.issues.test.js | 18 + apps/web/__e2e__/notebooks.test.js | 18 + apps/web/__e2e__/notehistory.test.js | 18 + apps/web/__e2e__/notes.issues.test.js | 18 + apps/web/__e2e__/notes.test.js | 21 +- apps/web/__e2e__/tags.test.js | 23 +- apps/web/__e2e__/user.test.js | 18 + apps/web/__e2e__/utils/actions.js | 18 + apps/web/__e2e__/utils/conditions.js | 18 + apps/web/__e2e__/utils/index.js | 20 +- apps/web/__e2e__/utils/listitemidbuilder.js | 18 + apps/web/__e2e__/utils/menuitemidbuilder.js | 18 + apps/web/desktop/autoupdate.js | 18 + apps/web/desktop/changelog.js | 18 + apps/web/desktop/config/theme.js | 18 + apps/web/desktop/config/windowstate.js | 22 +- apps/web/desktop/config/zoomfactor.js | 18 + apps/web/desktop/electron.js | 22 +- apps/web/desktop/events.js | 18 + .../web/desktop/ipc/actions/changeAppTheme.js | 18 + .../web/desktop/ipc/actions/checkForUpdate.js | 18 + .../web/desktop/ipc/actions/downloadUpdate.js | 18 + apps/web/desktop/ipc/actions/index.js | 18 + apps/web/desktop/ipc/actions/installUpdate.js | 18 + apps/web/desktop/ipc/actions/open.js | 18 + apps/web/desktop/ipc/actions/saveFile.js | 18 + apps/web/desktop/ipc/actions/setZoomFactor.js | 18 + apps/web/desktop/ipc/calls/getZoomFactor.js | 18 + apps/web/desktop/ipc/calls/index.js | 18 + apps/web/desktop/ipc/calls/selectDirectory.js | 18 + apps/web/desktop/ipc/index.js | 18 + apps/web/desktop/ipc/utils.js | 23 +- apps/web/desktop/jsonstorage/index.js | 18 + apps/web/desktop/logger.js | 18 + apps/web/desktop/menu.js | 18 + apps/web/desktop/paths.js | 18 + apps/web/desktop/preload.js | 18 + apps/web/desktop/protocol.js | 18 + apps/web/desktop/scripts/removeLocales.js | 18 + apps/web/desktop/utils.js | 22 +- apps/web/package.json | 2 - apps/web/playwright.config.js | 18 + apps/web/public/diff.worker.js | 892 ------------------ apps/web/scripts/analyze.js | 18 + apps/web/src/app-effects.js | 18 + apps/web/src/app-effects.mobile.js | 20 +- apps/web/src/app.js | 18 + apps/web/src/commands/change-app-theme.js | 18 + apps/web/src/commands/check-for-update.js | 18 + apps/web/src/commands/download-update.js | 18 + apps/web/src/commands/index.js | 18 + apps/web/src/commands/install-update.js | 18 + apps/web/src/commands/open.js | 18 + apps/web/src/commands/save-file.js | 18 + apps/web/src/commands/set-zoom-factor.js | 18 + apps/web/src/common/app-events.js | 18 + apps/web/src/common/attachments.js | 18 + apps/web/src/common/constants.ts | 18 + apps/web/src/common/db.js | 18 + apps/web/src/common/dialog-controller.tsx | 39 +- apps/web/src/common/export.ts | 30 +- apps/web/src/common/height-calculator.js | 18 + apps/web/src/common/index.js | 20 +- apps/web/src/common/key-map.js | 20 +- apps/web/src/common/list-profiles.js | 20 +- apps/web/src/common/multi-select.ts | 40 +- apps/web/src/common/reminders.js | 18 + apps/web/src/common/store.js | 18 + apps/web/src/common/task-manager.ts | 24 +- apps/web/src/common/toasts.js | 18 + apps/web/src/common/toolbar-config.ts | 18 + apps/web/src/common/vault.js | 18 + apps/web/src/components/accent-item/index.js | 19 +- apps/web/src/components/accordion/index.js | 18 + apps/web/src/components/animated/index.js | 18 + apps/web/src/components/announcements/body.js | 36 +- .../web/src/components/announcements/index.js | 18 + apps/web/src/components/attachment/index.js | 18 + .../src/components/auth-container/index.js | 28 +- .../web/src/components/cached-router/index.js | 20 +- .../components/dialogs/add-notebook-dialog.js | 18 + .../components/dialogs/announcement-dialog.js | 18 + .../components/dialogs/attachments-dialog.js | 18 + .../dialogs/buy-dialog/buy-dialog.tsx | 69 +- .../dialogs/buy-dialog/features.tsx | 70 +- .../components/dialogs/buy-dialog/helpers.ts | 18 + .../components/dialogs/buy-dialog/index.ts | 18 + .../components/dialogs/buy-dialog/paddle.tsx | 18 + .../dialogs/buy-dialog/plan-list.tsx | 19 + .../components/dialogs/buy-dialog/plans.ts | 22 +- .../components/dialogs/buy-dialog/store.ts | 20 +- .../components/dialogs/buy-dialog/types.ts | 20 +- apps/web/src/components/dialogs/confirm.js | 19 +- .../src/components/dialogs/dialog-loader.tsx | 18 + apps/web/src/components/dialogs/dialog.js | 18 + .../dialogs/email-verification-dialog.js | 22 +- .../src/components/dialogs/feature-dialog.tsx | 25 +- .../src/components/dialogs/import-dialog.js | 21 + apps/web/src/components/dialogs/index.ts | 18 + .../src/components/dialogs/issue-dialog.tsx | 18 + .../web/src/components/dialogs/item-dialog.js | 19 +- .../src/components/dialogs/loading-dialog.js | 20 +- .../dialogs/mfa/multi-factor-dialog.tsx | 53 +- .../dialogs/mfa/recovery-code-dialog.tsx | 18 + apps/web/src/components/dialogs/mfa/steps.tsx | 100 +- apps/web/src/components/dialogs/mfa/types.ts | 28 +- .../components/dialogs/migration-dialog.tsx | 18 + .../components/dialogs/move-note-dialog.js | 18 + .../components/dialogs/onboarding-dialog.js | 21 + .../src/components/dialogs/password-dialog.js | 20 +- .../src/components/dialogs/progress-dialog.js | 18 + apps/web/src/components/dialogs/prompt.tsx | 18 + .../components/dialogs/recovery-key-dialog.js | 18 + .../src/components/dialogs/reminder-dialog.js | 19 + .../dialogs/toolbar-config-dialog.tsx | 62 +- .../dialogs/tracking-details-dialog.js | 21 +- .../components/diff-viewer/content-toggle.js | 18 + apps/web/src/components/diff-viewer/index.js | 18 + .../src/components/dropdown-button/index.js | 18 + .../web/src/components/editor/-placeholder.js | 19 +- apps/web/src/components/editor/context.ts | 18 + apps/web/src/components/editor/footer.js | 18 + apps/web/src/components/editor/header.js | 20 +- apps/web/src/components/editor/index.tsx | 23 +- apps/web/src/components/editor/loading.tsx | 18 + apps/web/src/components/editor/picker.ts | 28 +- apps/web/src/components/editor/tiptap.tsx | 26 +- apps/web/src/components/editor/title-box.tsx | 18 + apps/web/src/components/editor/toolbar.js | 20 +- apps/web/src/components/editor/types.ts | 20 +- apps/web/src/components/field/index.js | 22 +- .../components/global-menu-wrapper/index.js | 18 + apps/web/src/components/group-header/index.js | 22 +- apps/web/src/components/hash-router/index.js | 18 + apps/web/src/components/icon-tag/index.js | 18 + apps/web/src/components/icons/index.js | 18 + apps/web/src/components/icons/resolver.js | 18 + .../src/components/install-notice/index.js | 21 +- .../src/components/list-container/index.js | 18 + apps/web/src/components/list-item/index.js | 18 + apps/web/src/components/loader/index.js | 18 + .../src/components/loaders/editor-loader.tsx | 18 + .../src/components/loaders/list-loader.tsx | 18 + .../components/loaders/navigation-loader.tsx | 18 + .../components/loaders/status-bar-loader.tsx | 18 + .../src/components/loaders/view-loader.tsx | 18 + apps/web/src/components/menu/index.js | 18 + apps/web/src/components/menu/menu-item.js | 18 + .../src/components/navigation-menu/index.js | 20 +- .../navigation-menu/navigation-item.js | 18 + apps/web/src/components/note/index.js | 18 + apps/web/src/components/notebook/index.js | 20 +- .../placeholders/attachments-placeholder.js | 18 + .../placeholders/favorites-placeholder.js | 18 + apps/web/src/components/placeholders/index.js | 18 + .../web/src/components/placeholders/loader.js | 18 + .../placeholders/monographs-placeholder.js | 18 + .../placeholders/notebooks-placeholder.js | 19 +- .../placeholders/notesplacholder.js | 18 + .../placeholders/search-placeholder.js | 18 + .../placeholders/tags-placeholder.js | 18 + .../placeholders/topics-placeholder.js | 18 + .../placeholders/trash-placeholder.js | 19 +- apps/web/src/components/progress-bar/index.js | 20 +- apps/web/src/components/properties/index.js | 20 +- apps/web/src/components/properties/toggle.js | 18 + apps/web/src/components/publish-view/index.js | 18 + apps/web/src/components/reminder-bar/index.js | 20 +- .../src/components/route-container/index.js | 20 +- .../src/components/scroll-container/index.js | 20 +- apps/web/src/components/search/index.js | 19 +- apps/web/src/components/status-bar/index.js | 18 + apps/web/src/components/switch/index.js | 18 + apps/web/src/components/tag/index.js | 19 +- .../src/components/theme-provider/index.js | 18 + apps/web/src/components/time-ago/index.js | 18 + apps/web/src/components/tip/index.js | 18 + apps/web/src/components/toggle/index.js | 20 +- apps/web/src/components/topic/index.js | 18 + apps/web/src/components/trash-item/index.js | 19 +- apps/web/src/components/unlock/index.js | 20 +- apps/web/src/hooks/use-announcements.js | 34 +- apps/web/src/hooks/use-auto-updater.js | 18 + apps/web/src/hooks/use-database.js | 18 + apps/web/src/hooks/use-hash-location.ts | 22 +- apps/web/src/hooks/use-hash-routes.js | 18 + apps/web/src/hooks/use-is-user-premium.js | 18 + apps/web/src/hooks/use-location.js | 18 + apps/web/src/hooks/use-media-query.js | 18 + apps/web/src/hooks/use-menu.js | 18 + apps/web/src/hooks/use-mobile.js | 18 + apps/web/src/hooks/use-navigate.js | 18 + apps/web/src/hooks/use-persistent-state.ts | 20 +- apps/web/src/hooks/use-routes.js | 18 + apps/web/src/hooks/use-session-state.ts | 22 +- apps/web/src/hooks/use-slider.js | 18 + apps/web/src/hooks/use-status.ts | 18 + apps/web/src/hooks/use-system-theme.js | 18 + apps/web/src/hooks/use-tablet.js | 18 + apps/web/src/hooks/use-timer.ts | 18 + apps/web/src/hooks/use-zoom-factor.js | 18 + apps/web/src/index.tsx | 83 +- apps/web/src/interfaces/fs.js | 23 +- apps/web/src/interfaces/nncrypto.stub.ts | 29 +- apps/web/src/interfaces/storage.ts | 34 +- apps/web/src/navigation/hash-routes.js | 18 + apps/web/src/navigation/index.js | 18 + apps/web/src/navigation/routes.js | 19 +- apps/web/src/re-exports/react-qrcode-logo.js | 18 + apps/web/src/react-app-env.d.ts | 20 + apps/web/src/service-worker-registration.js | 18 + apps/web/src/service-worker.js | 34 +- apps/web/src/stores/app-store.js | 18 + apps/web/src/stores/attachment-store.js | 18 + apps/web/src/stores/editor-store.js | 18 + apps/web/src/stores/index.js | 18 + apps/web/src/stores/monograph-store.js | 18 + apps/web/src/stores/note-store.js | 21 +- apps/web/src/stores/notebook-store.js | 18 + apps/web/src/stores/search-store.js | 18 + apps/web/src/stores/selection-store.js | 18 + apps/web/src/stores/setting-store.js | 18 + apps/web/src/stores/tag-store.js | 18 + apps/web/src/stores/theme-store.js | 21 + apps/web/src/stores/trash-store.js | 18 + apps/web/src/stores/user-store.js | 20 +- apps/web/src/utils/analytics.ts | 24 +- apps/web/src/utils/color.js | 18 + apps/web/src/utils/config.ts | 22 +- apps/web/src/utils/css.js | 18 + apps/web/src/utils/debounce.ts | 40 +- apps/web/src/utils/dimensions.js | 18 + apps/web/src/utils/filename.js | 18 + apps/web/src/utils/importer.js | 18 + apps/web/src/utils/keyboard.js | 18 + apps/web/src/utils/logger.ts | 27 +- apps/web/src/utils/object.js | 18 + apps/web/src/utils/page-visibility.js | 18 + apps/web/src/utils/parse.js | 18 + apps/web/src/utils/platform.js | 18 + apps/web/src/utils/random.js | 18 + apps/web/src/utils/string.js | 18 + apps/web/src/utils/toast.tsx | 20 +- apps/web/src/utils/version.ts | 18 + apps/web/src/utils/zip.ts | 18 + apps/web/src/views/auth.tsx | 34 +- apps/web/src/views/email-confirmed.js | 23 +- apps/web/src/views/home.js | 18 + apps/web/src/views/notebooks.js | 19 +- apps/web/src/views/notes.js | 18 + apps/web/src/views/recovery.tsx | 27 +- apps/web/src/views/search.js | 36 +- apps/web/src/views/settings.js | 20 +- apps/web/src/views/tags.js | 19 +- apps/web/src/views/topics.js | 20 +- apps/web/src/views/trash.js | 19 +- package-lock.json | 37 + package.json | 2 + packages/core/__e2e__/monographs.test.js | 18 + packages/core/__e2e__/offers.test.js | 18 + packages/core/__e2e__/token-manager.test.js | 18 + packages/core/__e2e__/user-manager.test.js | 18 + packages/core/__mocks__/fs.mock.js | 18 + packages/core/__mocks__/node-storage.mock.js | 18 + packages/core/__mocks__/storage.mock.js | 18 + packages/core/__tests__/backup.test.js | 18 + packages/core/__tests__/content.test.js | 18 + packages/core/__tests__/db.test.js | 18 + packages/core/__tests__/lookup.test.js | 18 + packages/core/__tests__/note-history.test.js | 18 + packages/core/__tests__/notebooks.test.js | 18 + packages/core/__tests__/notes.test.js | 18 + packages/core/__tests__/settings.test.js | 18 + packages/core/__tests__/storage.test.js | 18 + packages/core/__tests__/tags.test.js | 18 + packages/core/__tests__/topics.test.js | 18 + packages/core/__tests__/trash.test.js | 18 + packages/core/__tests__/utils.test.js | 18 + packages/core/__tests__/utils/index.js | 18 + packages/core/__tests__/vault.test.js | 18 + packages/core/analyze-modules.js | 18 + packages/core/api/__tests__/debug.test.js | 18 + .../core/api/__tests__/mfa-manager.test.js | 18 + .../core/api/__tests__/migrations.test.js | 18 + packages/core/api/__tests__/outbox.test.js | 18 + packages/core/api/__tests__/pricing.test.js | 18 + packages/core/api/debug.js | 18 + packages/core/api/index.js | 18 + packages/core/api/lookup.js | 18 + packages/core/api/mfa-manager.js | 18 + packages/core/api/migrations.js | 18 + packages/core/api/monographs.js | 18 + packages/core/api/offers.js | 18 + packages/core/api/outbox.js | 18 + packages/core/api/pricing.js | 18 + packages/core/api/session.js | 18 + packages/core/api/settings.js | 18 + .../core/api/sync/__tests__/collector.test.js | 18 + .../core/api/sync/__tests__/sync.test.skip.js | 18 + packages/core/api/sync/auto-sync.js | 18 + packages/core/api/sync/collector.js | 18 + packages/core/api/sync/conflicts.js | 18 + packages/core/api/sync/index.js | 18 + packages/core/api/sync/merger.js | 18 + packages/core/api/sync/sync-queue.js | 18 + packages/core/api/sync/utils.js | 18 + packages/core/api/token-manager.js | 18 + packages/core/api/user-manager.js | 18 + packages/core/api/vault.js | 18 + packages/core/collections/attachments.js | 18 + packages/core/collections/collection.js | 18 + packages/core/collections/content.js | 18 + packages/core/collections/note-history.js | 18 + packages/core/collections/notebooks.js | 18 + packages/core/collections/notes.js | 18 + packages/core/collections/session-content.js | 18 + packages/core/collections/tags.js | 18 + packages/core/collections/topics.js | 18 + packages/core/collections/trash.js | 18 + packages/core/common.js | 18 + .../content-types/__tests__/tiptap.test.js | 18 + packages/core/content-types/index.js | 18 + packages/core/content-types/tiptap.js | 18 + packages/core/database/backup.js | 18 + packages/core/database/cached-collection.js | 18 + packages/core/database/fs.js | 18 + packages/core/database/indexed-collection.js | 18 + packages/core/database/indexer.js | 18 + packages/core/database/migrator.js | 18 + packages/core/database/storage.js | 18 + packages/core/jest.config.js | 18 + packages/core/jest.setup.js | 18 + packages/core/logger.js | 22 +- packages/core/migrations.js | 18 + packages/core/models/note.js | 18 + packages/core/models/notebook.js | 18 + packages/core/models/topic.js | 18 + packages/core/types.js | 20 + .../core/utils/__tests__/compression.test.js | 18 + packages/core/utils/__tests__/set.test.js | 18 + packages/core/utils/array.js | 18 + packages/core/utils/compression.js | 18 + packages/core/utils/constants.js | 18 + packages/core/utils/dataurl.js | 18 + packages/core/utils/date.js | 18 + packages/core/utils/event-manager.js | 18 + packages/core/utils/grouping.js | 18 + packages/core/utils/hostname.js | 18 + packages/core/utils/html-parser.js | 18 + packages/core/utils/http.js | 18 + packages/core/utils/id.js | 18 + packages/core/utils/map.js | 18 + packages/core/utils/object-id.js | 18 + packages/core/utils/random.js | 18 + packages/core/utils/set.js | 18 + packages/core/utils/templates/helper.js | 18 + packages/core/utils/templates/html/builder.js | 18 + .../core/utils/templates/html/template.js | 18 + .../core/utils/templates/markdown/builder.js | 18 + .../core/utils/templates/markdown/template.js | 18 + packages/core/utils/templates/text/builder.js | 18 + .../core/utils/templates/text/template.js | 18 + packages/crypto-worker/README.md | 0 packages/crypto-worker/index.ts | 18 + packages/crypto-worker/src/utils.ts | 18 + packages/crypto-worker/src/worker.ts | 18 + packages/crypto-worker/src/workerstream.ts | 18 + packages/crypto/README.md | 0 packages/crypto/index.ts | 18 + packages/crypto/src/decryption.ts | 18 + packages/crypto/src/encryption.ts | 18 + packages/crypto/src/interfaces.ts | 18 + packages/crypto/src/keyutils.ts | 18 + packages/crypto/src/password.ts | 18 + packages/crypto/src/types.ts | 18 + packages/editor-mobile/src/App.test.js | 18 + packages/editor-mobile/src/App.tsx | 18 + .../editor-mobile/src/components/button.tsx | 18 + .../editor-mobile/src/components/editor.tsx | 18 + .../editor-mobile/src/components/header.tsx | 18 + .../src/components/statusbar.tsx | 18 + .../editor-mobile/src/components/tags.tsx | 18 + .../editor-mobile/src/components/title.tsx | 18 + .../src/hooks/useEditorController.ts | 18 + .../editor-mobile/src/hooks/useSafeArea.ts | 18 + .../editor-mobile/src/hooks/useSettings.ts | 18 + packages/editor-mobile/src/index.tsx | 18 + packages/editor-mobile/src/react-app-env.d.ts | 20 + packages/editor-mobile/src/setupTests.js | 18 + packages/editor-mobile/src/state/theme.tsx | 18 + packages/editor-mobile/src/utils/css.js | 18 + packages/editor-mobile/src/utils/index.ts | 18 + packages/editor/package.json | 2 - packages/editor/scripts/langen.js | 18 + .../src/components/action-sheet/index.tsx | 20 +- packages/editor/src/components/button.tsx | 28 +- .../src/components/inline-input/index.tsx | 18 + packages/editor/src/components/menu/index.tsx | 18 + .../src/components/menu/menu-button.tsx | 18 + .../src/components/menu/menu-separator.tsx | 18 + packages/editor/src/components/menu/types.ts | 18 + .../editor/src/components/menu/use-focus.ts | 20 +- .../src/components/popup-presenter/index.tsx | 50 +- .../popup-presenter/popuprenderer.tsx | 18 + .../editor/src/components/resizer/index.tsx | 18 + .../src/components/responsive/index.tsx | 18 + packages/editor/src/components/tabs/index.tsx | 18 + .../src/components/theme-provider/index.tsx | 18 + packages/editor/src/extensions.ts | 18 + .../src/extensions/attachment/attachment.ts | 18 + .../src/extensions/attachment/component.tsx | 18 + .../editor/src/extensions/attachment/index.ts | 18 + .../src/extensions/bullet-list/bullet-list.ts | 18 + .../src/extensions/bullet-list/index.ts | 18 + .../clipboard-text-serializer/index.ts | 18 + .../src/extensions/code-block/code-block.ts | 18 + .../src/extensions/code-block/component.tsx | 20 +- .../src/extensions/code-block/highlighter.ts | 18 + .../editor/src/extensions/code-block/index.ts | 18 + .../src/extensions/code-block/loader.ts | 18 + .../src/extensions/code-mark/code-mark.ts | 18 + .../editor/src/extensions/code-mark/index.ts | 18 + .../src/extensions/date-time/date-time.ts | 18 + .../editor/src/extensions/date-time/index.ts | 18 + .../editor/src/extensions/embed/component.tsx | 18 + packages/editor/src/extensions/embed/embed.ts | 18 + packages/editor/src/extensions/embed/index.ts | 18 + .../src/extensions/font-size/font-size.ts | 18 + .../editor/src/extensions/font-size/index.ts | 18 + .../src/extensions/highlight/highlight.ts | 18 + .../editor/src/extensions/highlight/index.ts | 18 + .../editor/src/extensions/image/component.tsx | 60 +- packages/editor/src/extensions/image/image.ts | 18 + packages/editor/src/extensions/image/index.ts | 18 + .../src/extensions/keep-in-view/index.ts | 18 + .../extensions/keep-in-view/keep-in-view.ts | 18 + .../src/extensions/list-item/commands.ts | 18 + .../editor/src/extensions/list-item/index.ts | 18 + .../src/extensions/list-item/list-item.ts | 18 + packages/editor/src/extensions/math/index.ts | 18 + .../editor/src/extensions/math/math-block.ts | 18 + .../editor/src/extensions/math/math-inline.ts | 18 + .../plugin/commands/collapse-math-node.ts | 18 + .../math/plugin/commands/insert-math-node.ts | 18 + .../math/plugin/commands/move-cursor-cmd.ts | 18 + .../src/extensions/math/plugin/index.ts | 18 + .../extensions/math/plugin/math-node-view.ts | 18 + .../src/extensions/math/plugin/math-plugin.ts | 18 + .../math/plugin/plugins/math-backspace.ts | 18 + .../math/plugin/plugins/math-paste-rules.ts | 18 + .../math/plugin/plugins/math-select.ts | 18 + .../extensions/math/plugin/renderers/katex.ts | 18 + .../extensions/math/plugin/renderers/types.ts | 18 + .../math/plugin/utils/text-serializer.ts | 18 + .../src/extensions/math/plugin/utils/types.ts | 18 + .../src/extensions/ordered-list/index.ts | 18 + .../extensions/ordered-list/ordered-list.ts | 18 + .../outline-list-item/component.tsx | 18 + .../src/extensions/outline-list-item/index.ts | 18 + .../outline-list-item/outline-list-item.ts | 18 + .../src/extensions/outline-list/component.tsx | 20 +- .../src/extensions/outline-list/index.ts | 18 + .../extensions/outline-list/outline-list.ts | 18 + .../editor/src/extensions/paragraph/index.ts | 18 + .../src/extensions/paragraph/paragraph.ts | 18 + .../src/extensions/react/event-dispatcher.ts | 18 + packages/editor/src/extensions/react/index.ts | 18 + .../editor/src/extensions/react/plugin.ts | 18 + .../src/extensions/react/react-node-view.tsx | 18 + .../react/react-portal-provider.tsx | 18 + .../react/selection-based-react-node-view.tsx | 18 + packages/editor/src/extensions/react/types.ts | 18 + .../src/extensions/search-replace/index.ts | 18 + .../search-replace/search-replace.ts | 18 + .../src/extensions/selection-persist/index.ts | 18 + .../selection-persist/selection-persist.ts | 18 + .../editor/src/extensions/table-cell/index.ts | 18 + .../src/extensions/table-cell/table-cell.ts | 18 + .../editor/src/extensions/table/actions.ts | 18 + .../editor/src/extensions/table/component.tsx | 98 +- packages/editor/src/extensions/table/index.ts | 18 + packages/editor/src/extensions/table/table.ts | 18 + .../src/extensions/task-item/component.tsx | 20 +- .../editor/src/extensions/task-item/index.ts | 18 + .../src/extensions/task-item/task-item.ts | 18 + .../src/extensions/task-list/component.tsx | 22 +- .../editor/src/extensions/task-list/index.ts | 18 + .../src/extensions/task-list/task-list.ts | 18 + .../src/extensions/text-direction/index.ts | 18 + .../text-direction/text-direction.ts | 18 + packages/editor/src/hooks/use-editor.ts | 54 +- .../src/hooks/use-permission-handler.ts | 18 + packages/editor/src/hooks/use-ref-value.ts | 18 + packages/editor/src/index.ts | 29 +- .../editor/src/toolbar/components/counter.tsx | 18 + .../src/toolbar/components/dropdown.tsx | 18 + .../editor/src/toolbar/components/icon.tsx | 18 + .../src/toolbar/components/more-tools.tsx | 18 + .../editor/src/toolbar/components/popup.tsx | 18 + .../src/toolbar/components/split-button.tsx | 18 + .../src/toolbar/components/tool-button.tsx | 18 + .../src/toolbar/components/toolbar-group.tsx | 18 + .../floating-menus/hover-popup/index.tsx | 152 +-- .../floating-menus/hover-popup/link.tsx | 18 + .../src/toolbar/floating-menus/index.tsx | 18 + .../toolbar/floating-menus/search-replace.tsx | 18 + .../src/toolbar/floating-menus/types.ts | 18 + packages/editor/src/toolbar/icons.ts | 18 + packages/editor/src/toolbar/index.ts | 18 + .../src/toolbar/popups/cell-properties.tsx | 18 + .../src/toolbar/popups/color-picker.tsx | 19 + .../editor/src/toolbar/popups/embed-popup.tsx | 20 +- .../src/toolbar/popups/image-properties.tsx | 19 + .../src/toolbar/popups/image-upload.tsx | 18 + .../editor/src/toolbar/popups/link-popup.tsx | 18 + .../src/toolbar/popups/search-replace.tsx | 21 +- .../editor/src/toolbar/popups/table-popup.tsx | 18 + .../src/toolbar/stores/toolbar-store.ts | 18 + .../editor/src/toolbar/tool-definitions.ts | 18 + packages/editor/src/toolbar/toolbar.tsx | 20 +- .../editor/src/toolbar/tools/alignment.tsx | 18 + .../editor/src/toolbar/tools/attachment.tsx | 18 + packages/editor/src/toolbar/tools/block.tsx | 50 +- packages/editor/src/toolbar/tools/colors.tsx | 18 + packages/editor/src/toolbar/tools/embed.tsx | 20 +- packages/editor/src/toolbar/tools/font.tsx | 23 +- .../editor/src/toolbar/tools/headings.tsx | 21 +- packages/editor/src/toolbar/tools/image.tsx | 18 + packages/editor/src/toolbar/tools/index.ts | 18 + packages/editor/src/toolbar/tools/inline.tsx | 18 + packages/editor/src/toolbar/tools/link.tsx | 136 +-- packages/editor/src/toolbar/tools/lists.tsx | 20 + packages/editor/src/toolbar/tools/table.tsx | 21 + .../src/toolbar/tools/text-direction.tsx | 18 + packages/editor/src/toolbar/tools/utils.tsx | 18 + packages/editor/src/toolbar/types.ts | 18 + packages/editor/src/toolbar/utils/dom.ts | 18 + .../editor/src/toolbar/utils/prosemirror.ts | 18 + packages/editor/src/types.ts | 20 +- packages/editor/src/utils/config.ts | 18 + packages/editor/src/utils/debounce.ts | 18 + packages/editor/src/utils/downloader.ts | 18 + packages/editor/src/utils/platform.ts | 18 + packages/editor/src/utils/position.ts | 18 + packages/logger/README.md | 0 packages/logger/src/index.ts | 18 + packages/logger/src/reporters/console.ts | 18 + packages/logger/src/reporters/index.ts | 18 + packages/logger/src/types.ts | 18 + packages/streamable-fs/README.md | 0 packages/streamable-fs/index.ts | 18 + packages/streamable-fs/src/filehandle.ts | 18 + .../streamable-fs/src/filestreamsource.ts | 18 + packages/streamable-fs/src/interfaces.ts | 18 + packages/streamable-fs/src/types.ts | 18 + packages/theme/README.md | 0 packages/theme/src/css.ts | 40 +- packages/theme/src/index.ts | 18 + packages/theme/src/theme/accents.ts | 18 + packages/theme/src/theme/colorscheme/dark.ts | 20 +- packages/theme/src/theme/colorscheme/index.ts | 18 + packages/theme/src/theme/colorscheme/light.ts | 18 + .../theme/src/theme/colorscheme/static.ts | 18 + packages/theme/src/theme/font/fontsize.ts | 22 +- packages/theme/src/theme/font/index.ts | 18 + packages/theme/src/theme/index.ts | 20 +- packages/theme/src/theme/transformer/css.ts | 18 + packages/theme/src/theme/transformer/index.ts | 23 +- packages/theme/src/theme/types.ts | 18 + packages/theme/src/theme/variants/button.ts | 18 + packages/theme/src/theme/variants/flex.ts | 18 + packages/theme/src/theme/variants/index.ts | 18 + packages/theme/src/theme/variants/input.ts | 18 + packages/theme/src/theme/variants/text.ts | 18 + packages/theme/src/themeprovider.ts | 18 + resources/license-header.js | 17 + 863 files changed, 16755 insertions(+), 1494 deletions(-) rename commitlint.config.js => .commitlintrc.js (100%) create mode 100644 .vscode/settings.json create mode 100644 LICENSE delete mode 100644 apps/web/public/diff.worker.js create mode 100644 packages/crypto-worker/README.md create mode 100644 packages/crypto/README.md create mode 100644 packages/logger/README.md create mode 100644 packages/streamable-fs/README.md create mode 100644 packages/theme/README.md create mode 100644 resources/license-header.js diff --git a/commitlint.config.js b/.commitlintrc.js similarity index 100% rename from commitlint.config.js rename to .commitlintrc.js diff --git a/.eslintignore b/.eslintignore index cfa594a1b..7a35a1735 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,6 +4,10 @@ coverage node_modules dist +# root +resources/ +.*.* + # mobile apps/mobile/native/ apps/mobile/__tests__/ diff --git a/.eslintrc.js b/.eslintrc.js index 4dc90711a..d9f9fb936 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -27,9 +27,13 @@ module.exports = { "unused-imports", "detox", "jest", - "react-native" + "react-native", + "license-header", + "react-hooks" ], rules: { + "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks + "react-hooks/exhaustive-deps": "warn", // Checks effect dependencies "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": "off", "unused-imports/no-unused-imports": "error", @@ -52,7 +56,8 @@ module.exports = { ], semi: ["error", "always"], "@typescript-eslint/no-empty-function": "off", - "react/prop-types": "off" + "react/prop-types": "off", + "license-header/header": ["error", "./resources/license-header.js"] }, settings: { react: { @@ -60,6 +65,10 @@ module.exports = { } }, overrides: [ + { + files: ["apps/web/__e2e__/**/**/*.{jsx,tsx,ts,js}"], + rules: { "react-hooks/rules-of-hooks": "off" } + }, { files: ["apps/mobile/**/**/*.{jsx,tsx,ts,js}"], env: { diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..25fa6215f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..e72bfddab --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/apps/mobile/app/app.js b/apps/mobile/app/app.js index 0e90d6544..59e66a08b 100644 --- a/apps/mobile/app/app.js +++ b/apps/mobile/app/app.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { GestureHandlerRootView } from "react-native-gesture-handler"; import { SafeAreaProvider } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/assets/images/assets.js b/apps/mobile/app/assets/images/assets.js index 2ecb13ea6..20c613f74 100644 --- a/apps/mobile/app/assets/images/assets.js +++ b/apps/mobile/app/assets/images/assets.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const LAUNCH_ROCKET = (color) => ``; diff --git a/apps/mobile/app/common/analytics/index.js b/apps/mobile/app/common/analytics/index.js index 2d2216555..7ce74ca3d 100644 --- a/apps/mobile/app/common/analytics/index.js +++ b/apps/mobile/app/common/analytics/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import { MMKV } from "../database/mmkv"; import { useSettingStore } from "../../stores/use-setting-store"; diff --git a/apps/mobile/app/common/database/encryption.js b/apps/mobile/app/common/database/encryption.js index 8eaadb055..c3441f0e9 100644 --- a/apps/mobile/app/common/database/encryption.js +++ b/apps/mobile/app/common/database/encryption.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import "react-native-get-random-values"; import * as Keychain from "react-native-keychain"; diff --git a/apps/mobile/app/common/database/index.js b/apps/mobile/app/common/database/index.js index c79bfa10f..f2764f3cd 100644 --- a/apps/mobile/app/common/database/index.js +++ b/apps/mobile/app/common/database/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Database from "@notesnook/core/api/index"; import { initalize, logger as dbLogger } from "@notesnook/core/logger"; import { Platform } from "react-native"; diff --git a/apps/mobile/app/common/database/mmkv.js b/apps/mobile/app/common/database/mmkv.js index 347cd765a..059cb3726 100644 --- a/apps/mobile/app/common/database/mmkv.js +++ b/apps/mobile/app/common/database/mmkv.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import MMKVStorage, { ProcessingModes } from "react-native-mmkv-storage"; diff --git a/apps/mobile/app/common/database/storage.js b/apps/mobile/app/common/database/storage.js index 8f220e0b4..57baf52a4 100644 --- a/apps/mobile/app/common/database/storage.js +++ b/apps/mobile/app/common/database/storage.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import RNFetchBlob from "rn-fetch-blob"; import { diff --git a/apps/mobile/app/common/filesystem/download.js b/apps/mobile/app/common/filesystem/download.js index 409bf2542..ff5069b33 100644 --- a/apps/mobile/app/common/filesystem/download.js +++ b/apps/mobile/app/common/filesystem/download.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import NetInfo from "@react-native-community/netinfo"; import hosts from "@notesnook/core/utils/constants"; import React from "react"; diff --git a/apps/mobile/app/common/filesystem/index.js b/apps/mobile/app/common/filesystem/index.js index 2c9720277..b792ccca6 100644 --- a/apps/mobile/app/common/filesystem/index.js +++ b/apps/mobile/app/common/filesystem/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { downloadAttachment, downloadFile, diff --git a/apps/mobile/app/common/filesystem/io.js b/apps/mobile/app/common/filesystem/io.js index 001b7a565..a9bf0c84c 100644 --- a/apps/mobile/app/common/filesystem/io.js +++ b/apps/mobile/app/common/filesystem/io.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import Sodium from "react-native-sodium"; import RNFetchBlob from "rn-fetch-blob"; diff --git a/apps/mobile/app/common/filesystem/upload.js b/apps/mobile/app/common/filesystem/upload.js index 4905fb0e0..5da57f46f 100644 --- a/apps/mobile/app/common/filesystem/upload.js +++ b/apps/mobile/app/common/filesystem/upload.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import RNFetchBlob from "rn-fetch-blob"; import { useAttachmentStore } from "../../stores/use-attachment-store"; import { db } from "../database"; diff --git a/apps/mobile/app/common/filesystem/utils.js b/apps/mobile/app/common/filesystem/utils.js index 3d1cbbfa2..0a04f3ead 100644 --- a/apps/mobile/app/common/filesystem/utils.js +++ b/apps/mobile/app/common/filesystem/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import RNFetchBlob from "rn-fetch-blob"; export const cacheDir = RNFetchBlob.fs.dirs.CacheDir; diff --git a/apps/mobile/app/common/logger/index.ts b/apps/mobile/app/common/logger/index.ts index 6d9ae8814..d96ae6848 100644 --- a/apps/mobile/app/common/logger/index.ts +++ b/apps/mobile/app/common/logger/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function info(context: string, ...logs: unknown[]) { console.log(`${new Date().toLocaleDateString()}::info::${context}:`, ...logs); } diff --git a/apps/mobile/app/components/announcements/announcement.js b/apps/mobile/app/components/announcements/announcement.js index 3a30fc872..212950c75 100644 --- a/apps/mobile/app/components/announcements/announcement.js +++ b/apps/mobile/app/components/announcements/announcement.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { FlatList, View } from "react-native"; import { useSelectionStore } from "../../stores/use-selection-store"; diff --git a/apps/mobile/app/components/announcements/body.js b/apps/mobile/app/components/announcements/body.js index 85cd89532..66c17f0d9 100644 --- a/apps/mobile/app/components/announcements/body.js +++ b/apps/mobile/app/components/announcements/body.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import Paragraph from "../ui/typography/paragraph"; import { getStyle } from "./functions"; diff --git a/apps/mobile/app/components/announcements/cta.js b/apps/mobile/app/components/announcements/cta.js index a07a3314c..07d5ed3ab 100644 --- a/apps/mobile/app/components/announcements/cta.js +++ b/apps/mobile/app/components/announcements/cta.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Linking, View } from "react-native"; //import SettingsBackupAndRestore from '../../screens/settings/backup-restore'; diff --git a/apps/mobile/app/components/announcements/description.js b/apps/mobile/app/components/announcements/description.js index 49f9fed1c..60fe76d6a 100644 --- a/apps/mobile/app/components/announcements/description.js +++ b/apps/mobile/app/components/announcements/description.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { SIZE } from "../../utils/size"; import Paragraph from "../ui/typography/paragraph"; diff --git a/apps/mobile/app/components/announcements/functions.js b/apps/mobile/app/components/announcements/functions.js index 530421a08..b912ed626 100644 --- a/apps/mobile/app/components/announcements/functions.js +++ b/apps/mobile/app/components/announcements/functions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { Fragment } from "react"; import { View } from "react-native"; import { allowedPlatforms } from "../../stores/use-message-store"; diff --git a/apps/mobile/app/components/announcements/index.js b/apps/mobile/app/components/announcements/index.js index b55f9df1a..45b959cc1 100644 --- a/apps/mobile/app/components/announcements/index.js +++ b/apps/mobile/app/components/announcements/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { FlatList, View } from "react-native"; import { DDS } from "../../services/device-detection"; diff --git a/apps/mobile/app/components/announcements/list.js b/apps/mobile/app/components/announcements/list.js index 201964602..c84594bb0 100644 --- a/apps/mobile/app/components/announcements/list.js +++ b/apps/mobile/app/components/announcements/list.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/announcements/photo.js b/apps/mobile/app/components/announcements/photo.js index 099e849c1..7e6a108fa 100644 --- a/apps/mobile/app/components/announcements/photo.js +++ b/apps/mobile/app/components/announcements/photo.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Image } from "react-native"; import { getStyle } from "./functions"; diff --git a/apps/mobile/app/components/announcements/subheading.js b/apps/mobile/app/components/announcements/subheading.js index 99cd2c61e..b4f4ca07d 100644 --- a/apps/mobile/app/components/announcements/subheading.js +++ b/apps/mobile/app/components/announcements/subheading.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { SIZE } from "../../utils/size"; import Heading from "../ui/typography/heading"; diff --git a/apps/mobile/app/components/announcements/title.js b/apps/mobile/app/components/announcements/title.js index bf931e62f..f1509a3a6 100644 --- a/apps/mobile/app/components/announcements/title.js +++ b/apps/mobile/app/components/announcements/title.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useMessageStore } from "../../stores/use-message-store"; diff --git a/apps/mobile/app/components/attachments/actions.js b/apps/mobile/app/components/attachments/actions.js index a15ed94b7..d32619453 100644 --- a/apps/mobile/app/components/attachments/actions.js +++ b/apps/mobile/app/components/attachments/actions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { useEffect, useState } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/attachments/attachment-item.js b/apps/mobile/app/components/attachments/attachment-item.js index a6bffe861..a0d32590b 100644 --- a/apps/mobile/app/components/attachments/attachment-item.js +++ b/apps/mobile/app/components/attachments/attachment-item.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { TouchableOpacity, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/attachments/index.js b/apps/mobile/app/components/attachments/index.js index bac25ccc4..a0f08b89e 100644 --- a/apps/mobile/app/components/attachments/index.js +++ b/apps/mobile/app/components/attachments/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { FlatList } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/components/auth/auth-modal.js b/apps/mobile/app/components/auth/auth-modal.js index 1dcdc0db1..2ced675f3 100644 --- a/apps/mobile/app/components/auth/auth-modal.js +++ b/apps/mobile/app/components/auth/auth-modal.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { Platform, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/auth/background.js b/apps/mobile/app/components/auth/background.js index a3a559caf..acca044e1 100644 --- a/apps/mobile/app/components/auth/background.js +++ b/apps/mobile/app/components/auth/background.js @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const SVG = (color) => ``; diff --git a/apps/mobile/app/components/auth/change-password.js b/apps/mobile/app/components/auth/change-password.js index 626fbd410..30fefaaae 100644 --- a/apps/mobile/app/components/auth/change-password.js +++ b/apps/mobile/app/components/auth/change-password.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef, useState } from "react"; import { View } from "react-native"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/components/auth/common.js b/apps/mobile/app/components/auth/common.js index eed930f2e..28839bbb8 100644 --- a/apps/mobile/app/components/auth/common.js +++ b/apps/mobile/app/components/auth/common.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { createRef } from "react"; import { eSendEvent } from "../../services/event-manager"; import { eCloseLoginDialog } from "../../utils/events"; diff --git a/apps/mobile/app/components/auth/forgot-password.js b/apps/mobile/app/components/auth/forgot-password.js index f141f0288..b28394d46 100644 --- a/apps/mobile/app/components/auth/forgot-password.js +++ b/apps/mobile/app/components/auth/forgot-password.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef, useState } from "react"; import { View } from "react-native"; import ActionSheet from "react-native-actions-sheet"; diff --git a/apps/mobile/app/components/auth/index.js b/apps/mobile/app/components/auth/index.js index e3a8f95a0..0c5deb2ea 100644 --- a/apps/mobile/app/components/auth/index.js +++ b/apps/mobile/app/components/auth/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { View } from "react-native"; import { useNavigationFocus } from "../../hooks/use-navigation-focus"; diff --git a/apps/mobile/app/components/auth/login.js b/apps/mobile/app/components/auth/login.js index 6a5e7cd44..e0a5325ae 100644 --- a/apps/mobile/app/components/auth/login.js +++ b/apps/mobile/app/components/auth/login.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { SheetManager } from "react-native-actions-sheet"; diff --git a/apps/mobile/app/components/auth/session-expired.js b/apps/mobile/app/components/auth/session-expired.js index e2be40e5c..f9fc1fa7a 100644 --- a/apps/mobile/app/components/auth/session-expired.js +++ b/apps/mobile/app/components/auth/session-expired.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { Modal, View } from "react-native"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/components/auth/signup.js b/apps/mobile/app/components/auth/signup.js index bd2acbfaf..ac098672f 100644 --- a/apps/mobile/app/components/auth/signup.js +++ b/apps/mobile/app/components/auth/signup.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef, useState } from "react"; import { Dimensions, View } from "react-native"; import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/auth/two-factor.js b/apps/mobile/app/components/auth/two-factor.js index 5fd5251e8..14703f199 100644 --- a/apps/mobile/app/components/auth/two-factor.js +++ b/apps/mobile/app/components/auth/two-factor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { db } from "../../common/database/index"; diff --git a/apps/mobile/app/components/container/container-header.js b/apps/mobile/app/components/container/container-header.js index 6c13fd2b5..0e673b299 100644 --- a/apps/mobile/app/components/container/container-header.js +++ b/apps/mobile/app/components/container/container-header.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useSelectionStore } from "../../stores/use-selection-store"; diff --git a/apps/mobile/app/components/container/floating-button.js b/apps/mobile/app/components/container/floating-button.js index a42c6d05a..7bfd08ed8 100644 --- a/apps/mobile/app/components/container/floating-button.js +++ b/apps/mobile/app/components/container/floating-button.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { Keyboard, Platform, View } from "react-native"; import Animated, { diff --git a/apps/mobile/app/components/container/index.js b/apps/mobile/app/components/container/index.js index e59cdbad1..dbb1abf75 100644 --- a/apps/mobile/app/components/container/index.js +++ b/apps/mobile/app/components/container/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { KeyboardAvoidingView, Platform, SafeAreaView } from "react-native"; import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard"; diff --git a/apps/mobile/app/components/delay-layout/default-placeholder.tsx b/apps/mobile/app/components/delay-layout/default-placeholder.tsx index 7e0ce7623..20f010c80 100644 --- a/apps/mobile/app/components/delay-layout/default-placeholder.tsx +++ b/apps/mobile/app/components/delay-layout/default-placeholder.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useMessageStore } from "../../stores/use-message-store"; diff --git a/apps/mobile/app/components/delay-layout/index.tsx b/apps/mobile/app/components/delay-layout/index.tsx index 1be80379b..f588c2d05 100644 --- a/apps/mobile/app/components/delay-layout/index.tsx +++ b/apps/mobile/app/components/delay-layout/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ViewProps } from "react-native"; import Animated, { FadeOutUp } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/delay-layout/settings-placeholder.tsx b/apps/mobile/app/components/delay-layout/settings-placeholder.tsx index 6e7e8ea97..358849c87 100644 --- a/apps/mobile/app/components/delay-layout/settings-placeholder.tsx +++ b/apps/mobile/app/components/delay-layout/settings-placeholder.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/dialog-provider/index.js b/apps/mobile/app/components/dialog-provider/index.js index ddeb06178..803894ac3 100644 --- a/apps/mobile/app/components/dialog-provider/index.js +++ b/apps/mobile/app/components/dialog-provider/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { useNoteStore } from "../../stores/use-notes-store"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/dialog-provider/recievers.js b/apps/mobile/app/components/dialog-provider/recievers.js index 54da9358d..3e9e0a3dc 100644 --- a/apps/mobile/app/components/dialog-provider/recievers.js +++ b/apps/mobile/app/components/dialog-provider/recievers.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { eSendEvent } from "../../services/event-manager"; import { eCloseActionSheet, diff --git a/apps/mobile/app/components/dialog/base-dialog.js b/apps/mobile/app/components/dialog/base-dialog.js index 9e9a0fcca..17cfc092c 100644 --- a/apps/mobile/app/components/dialog/base-dialog.js +++ b/apps/mobile/app/components/dialog/base-dialog.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { KeyboardAvoidingView, diff --git a/apps/mobile/app/components/dialog/dialog-buttons.js b/apps/mobile/app/components/dialog/dialog-buttons.js index 774c9384f..7c8dfe185 100644 --- a/apps/mobile/app/components/dialog/dialog-buttons.js +++ b/apps/mobile/app/components/dialog/dialog-buttons.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ActivityIndicator, StyleSheet, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/dialog/dialog-container.js b/apps/mobile/app/components/dialog/dialog-container.js index 7aa2ddc4a..d9affd111 100644 --- a/apps/mobile/app/components/dialog/dialog-container.js +++ b/apps/mobile/app/components/dialog/dialog-container.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { DDS } from "../../services/device-detection"; diff --git a/apps/mobile/app/components/dialog/dialog-header.tsx b/apps/mobile/app/components/dialog/dialog-header.tsx index cca2951f4..89dd6aaa1 100644 --- a/apps/mobile/app/components/dialog/dialog-header.tsx +++ b/apps/mobile/app/components/dialog/dialog-header.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Text, View } from "react-native"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/dialog/functions.ts b/apps/mobile/app/components/dialog/functions.ts index 29f04d575..d38c20094 100644 --- a/apps/mobile/app/components/dialog/functions.ts +++ b/apps/mobile/app/components/dialog/functions.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { eSendEvent } from "../../services/event-manager"; import { eCloseSimpleDialog, eOpenSimpleDialog } from "../../utils/events"; diff --git a/apps/mobile/app/components/dialog/index.js b/apps/mobile/app/components/dialog/index.js index 8b1ace5d4..e74abd619 100644 --- a/apps/mobile/app/components/dialog/index.js +++ b/apps/mobile/app/components/dialog/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { DDS } from "../../services/device-detection"; diff --git a/apps/mobile/app/components/dialogs/add-topic/index.js b/apps/mobile/app/components/dialogs/add-topic/index.js index 001658a7b..9feb23ed1 100644 --- a/apps/mobile/app/components/dialogs/add-topic/index.js +++ b/apps/mobile/app/components/dialogs/add-topic/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { createRef } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/dialogs/jump-to-section/index.js b/apps/mobile/app/components/dialogs/jump-to-section/index.js index 8fc1841a6..906692a37 100644 --- a/apps/mobile/app/components/dialogs/jump-to-section/index.js +++ b/apps/mobile/app/components/dialogs/jump-to-section/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { ScrollView, View } from "react-native"; import { DDS } from "../../../services/device-detection"; diff --git a/apps/mobile/app/components/dialogs/result/index.js b/apps/mobile/app/components/dialogs/result/index.js index 52d3df2b3..51aa548e0 100644 --- a/apps/mobile/app/components/dialogs/result/index.js +++ b/apps/mobile/app/components/dialogs/result/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import { DDS } from "../../../services/device-detection"; diff --git a/apps/mobile/app/components/dialogs/result/pro-features.js b/apps/mobile/app/components/dialogs/result/pro-features.js index e63551101..9fb2189a2 100644 --- a/apps/mobile/app/components/dialogs/result/pro-features.js +++ b/apps/mobile/app/components/dialogs/result/pro-features.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/dialogs/vault/index.js b/apps/mobile/app/components/dialogs/vault/index.js index 4014fb683..499dcaaac 100644 --- a/apps/mobile/app/components/dialogs/vault/index.js +++ b/apps/mobile/app/components/dialogs/vault/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { Component, createRef } from "react"; import { InteractionManager, View } from "react-native"; diff --git a/apps/mobile/app/components/exception-handler/index.tsx b/apps/mobile/app/components/exception-handler/index.tsx index bc1a47614..9c6593b19 100644 --- a/apps/mobile/app/components/exception-handler/index.tsx +++ b/apps/mobile/app/components/exception-handler/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import RNBootSplash from "react-native-bootsplash"; import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/header/index.js b/apps/mobile/app/components/header/index.js index cfce6f621..e30998b2d 100644 --- a/apps/mobile/app/components/header/index.js +++ b/apps/mobile/app/components/header/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { Platform, StyleSheet, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/header/left-menus.js b/apps/mobile/app/components/header/left-menus.js index 67835b88b..83ea4f6f0 100644 --- a/apps/mobile/app/components/header/left-menus.js +++ b/apps/mobile/app/components/header/left-menus.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { notesnook } from "../../../e2e/test.ids"; import { DDS } from "../../services/device-detection"; diff --git a/apps/mobile/app/components/header/right-menus.js b/apps/mobile/app/components/header/right-menus.js index 811e500fc..1913ee0ce 100644 --- a/apps/mobile/app/components/header/right-menus.js +++ b/apps/mobile/app/components/header/right-menus.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef } from "react"; import { Platform, StyleSheet, View } from "react-native"; import Menu from "react-native-reanimated-material-menu"; diff --git a/apps/mobile/app/components/header/title.js b/apps/mobile/app/components/header/title.js index 08cc4be6c..2e79a62b6 100644 --- a/apps/mobile/app/components/header/title.js +++ b/apps/mobile/app/components/header/title.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { Platform, View } from "react-native"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/components/image-preview/index.js b/apps/mobile/app/components/image-preview/index.js index 95d975ee5..0129f60be 100644 --- a/apps/mobile/app/components/image-preview/index.js +++ b/apps/mobile/app/components/image-preview/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import ImageViewer from "react-native-image-zoom-viewer"; diff --git a/apps/mobile/app/components/intro/index.js b/apps/mobile/app/components/intro/index.js index 85da6f239..3f90eb698 100644 --- a/apps/mobile/app/components/intro/index.js +++ b/apps/mobile/app/components/intro/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { Dimensions, diff --git a/apps/mobile/app/components/intro/welcome.js b/apps/mobile/app/components/intro/welcome.js index 845d43a54..fc138af6e 100644 --- a/apps/mobile/app/components/intro/welcome.js +++ b/apps/mobile/app/components/intro/welcome.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import Animated, { FadeInDown } from "react-native-reanimated"; import umami from "../../common/analytics"; diff --git a/apps/mobile/app/components/launcher/index.js b/apps/mobile/app/components/launcher/index.js index 0348ddc7a..d69e441f7 100644 --- a/apps/mobile/app/components/launcher/index.js +++ b/apps/mobile/app/components/launcher/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef } from "react"; import { Platform, View } from "react-native"; import RNBootSplash from "react-native-bootsplash"; diff --git a/apps/mobile/app/components/list-items/footer/index.js b/apps/mobile/app/components/list-items/footer/index.js index b9976c4c3..53b05cdb5 100644 --- a/apps/mobile/app/components/list-items/footer/index.js +++ b/apps/mobile/app/components/list-items/footer/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { View } from "react-native"; import React from "react"; export const Footer = () => { diff --git a/apps/mobile/app/components/list-items/headers/header.js b/apps/mobile/app/components/list-items/headers/header.js index 2fcf5fa7d..c36e1958d 100644 --- a/apps/mobile/app/components/list-items/headers/header.js +++ b/apps/mobile/app/components/list-items/headers/header.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useThemeStore } from "../../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/list-items/headers/notebook-header.js b/apps/mobile/app/components/list-items/headers/notebook-header.js index 76033c599..2f679ac1b 100644 --- a/apps/mobile/app/components/list-items/headers/notebook-header.js +++ b/apps/mobile/app/components/list-items/headers/notebook-header.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useRef, useState } from "react"; import React from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/list-items/headers/section-header.js b/apps/mobile/app/components/list-items/headers/section-header.js index 3e275a008..08cdde531 100644 --- a/apps/mobile/app/components/list-items/headers/section-header.js +++ b/apps/mobile/app/components/list-items/headers/section-header.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { TouchableOpacity, useWindowDimensions, View } from "react-native"; import { useThemeStore } from "../../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/list-items/note/index.js b/apps/mobile/app/components/list-items/note/index.js index 42ee67892..a8cafa246 100644 --- a/apps/mobile/app/components/list-items/note/index.js +++ b/apps/mobile/app/components/list-items/note/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { decode, EntityLevel } from "entities"; import React from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/list-items/note/wrapper.js b/apps/mobile/app/components/list-items/note/wrapper.js index 4bdb80684..c64a5af75 100644 --- a/apps/mobile/app/components/list-items/note/wrapper.js +++ b/apps/mobile/app/components/list-items/note/wrapper.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import NoteItem from "."; import { notesnook } from "../../../../e2e/test.ids"; diff --git a/apps/mobile/app/components/list-items/notebook/index.js b/apps/mobile/app/components/list-items/notebook/index.js index 822f3acd7..1e228bc46 100644 --- a/apps/mobile/app/components/list-items/notebook/index.js +++ b/apps/mobile/app/components/list-items/notebook/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/list-items/notebook/wrapper.js b/apps/mobile/app/components/list-items/notebook/wrapper.js index 55b954fa5..8260da6cb 100644 --- a/apps/mobile/app/components/list-items/notebook/wrapper.js +++ b/apps/mobile/app/components/list-items/notebook/wrapper.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { NotebookItem } from "."; import Notebook from "../../../screens/notebook"; diff --git a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js index 995ebcff9..006d19a04 100644 --- a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js +++ b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { useEffect, useState } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js b/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js index a66b03c1d..a73bc5c53 100644 --- a/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js +++ b/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useEditorStore } from "../../../stores/use-editor-store"; diff --git a/apps/mobile/app/components/list-items/selection-wrapper/index.js b/apps/mobile/app/components/list-items/selection-wrapper/index.js index c8cb392b2..80086e2d6 100644 --- a/apps/mobile/app/components/list-items/selection-wrapper/index.js +++ b/apps/mobile/app/components/list-items/selection-wrapper/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { eSubscribeEvent, diff --git a/apps/mobile/app/components/list-items/selection-wrapper/selection.js b/apps/mobile/app/components/list-items/selection-wrapper/selection.js index 01d5227a1..4cf44c8ef 100644 --- a/apps/mobile/app/components/list-items/selection-wrapper/selection.js +++ b/apps/mobile/app/components/list-items/selection-wrapper/selection.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { TouchableOpacity, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/list-items/tag/index.js b/apps/mobile/app/components/list-items/tag/index.js index 44e816bd1..f90488fab 100644 --- a/apps/mobile/app/components/list-items/tag/index.js +++ b/apps/mobile/app/components/list-items/tag/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { notesnook } from "../../../../e2e/test.ids"; diff --git a/apps/mobile/app/components/list/card.js b/apps/mobile/app/components/list/card.js index 038d199cb..3fcb7bd9f 100644 --- a/apps/mobile/app/components/list/card.js +++ b/apps/mobile/app/components/list/card.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/list/empty.js b/apps/mobile/app/components/list/empty.js index e2b76d982..4e4f77f64 100644 --- a/apps/mobile/app/components/list/empty.js +++ b/apps/mobile/app/components/list/empty.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ActivityIndicator, useWindowDimensions, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/list/index.js b/apps/mobile/app/components/list/index.js index b0e5474e6..871ca78a9 100644 --- a/apps/mobile/app/components/list/index.js +++ b/apps/mobile/app/components/list/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef } from "react"; import { FlatList, RefreshControl, View } from "react-native"; import Animated, { FadeInDown } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/merge-conflicts/index.js b/apps/mobile/app/components/merge-conflicts/index.js index 9c11ec64f..460da90f0 100644 --- a/apps/mobile/app/components/merge-conflicts/index.js +++ b/apps/mobile/app/components/merge-conflicts/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import KeepAwake from "@sayem314/react-native-keep-awake"; import React, { useEffect, useRef, useState } from "react"; import { Modal, SafeAreaView, Text, View } from "react-native"; diff --git a/apps/mobile/app/components/note-history/index.js b/apps/mobile/app/components/note-history/index.js index f93ec6752..ed77e4d7d 100644 --- a/apps/mobile/app/components/note-history/index.js +++ b/apps/mobile/app/components/note-history/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback, useEffect, useState } from "react"; import { Text, View } from "react-native"; import { FlatList } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/components/note-history/preview.js b/apps/mobile/app/components/note-history/preview.js index 56386fa78..28f725567 100644 --- a/apps/mobile/app/components/note-history/preview.js +++ b/apps/mobile/app/components/note-history/preview.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/components/premium/compact-features.js b/apps/mobile/app/components/premium/compact-features.js index 8fd0db498..b2e1b25bd 100644 --- a/apps/mobile/app/components/premium/compact-features.js +++ b/apps/mobile/app/components/premium/compact-features.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ScrollView } from "react-native"; import { FeatureBlock } from "./feature"; diff --git a/apps/mobile/app/components/premium/component.js b/apps/mobile/app/components/premium/component.js index 5ca38753d..91b3625a1 100644 --- a/apps/mobile/app/components/premium/component.js +++ b/apps/mobile/app/components/premium/component.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { ActivityIndicator, ScrollView, View } from "react-native"; import { LAUNCH_ROCKET } from "../../assets/images/assets"; diff --git a/apps/mobile/app/components/premium/expiring.js b/apps/mobile/app/components/premium/expiring.js index aee8b2dea..044f550c6 100644 --- a/apps/mobile/app/components/premium/expiring.js +++ b/apps/mobile/app/components/premium/expiring.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import { usePricing } from "../../hooks/use-pricing"; diff --git a/apps/mobile/app/components/premium/feature.js b/apps/mobile/app/components/premium/feature.js index 865daec66..01194de3d 100644 --- a/apps/mobile/app/components/premium/feature.js +++ b/apps/mobile/app/components/premium/feature.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Text, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/premium/features.js b/apps/mobile/app/components/premium/features.js index ac91a6b45..29a3600bf 100644 --- a/apps/mobile/app/components/premium/features.js +++ b/apps/mobile/app/components/premium/features.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const features = [ { title: "Focused on privacy", diff --git a/apps/mobile/app/components/premium/group.js b/apps/mobile/app/components/premium/group.js index 136a9ec5d..c8f0ee74b 100644 --- a/apps/mobile/app/components/premium/group.js +++ b/apps/mobile/app/components/premium/group.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ScrollView, View } from "react-native"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/premium/index.js b/apps/mobile/app/components/premium/index.js index d320dab36..91efe3901 100644 --- a/apps/mobile/app/components/premium/index.js +++ b/apps/mobile/app/components/premium/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { createRef } from "react"; import { eSubscribeEvent, diff --git a/apps/mobile/app/components/premium/offer.js b/apps/mobile/app/components/premium/offer.js index 8fd104ebb..52a0f12ea 100644 --- a/apps/mobile/app/components/premium/offer.js +++ b/apps/mobile/app/components/premium/offer.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Text } from "react-native"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/premium/premium-toast.js b/apps/mobile/app/components/premium/premium-toast.js index 1cd989816..cda1a249f 100644 --- a/apps/mobile/app/components/premium/premium-toast.js +++ b/apps/mobile/app/components/premium/premium-toast.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/premium/pricing-item.js b/apps/mobile/app/components/premium/pricing-item.js index 6646eba69..8b9daa974 100644 --- a/apps/mobile/app/components/premium/pricing-item.js +++ b/apps/mobile/app/components/premium/pricing-item.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { SIZE } from "../../utils/size"; diff --git a/apps/mobile/app/components/premium/pricing-plans.js b/apps/mobile/app/components/premium/pricing-plans.js index 282d7dd5b..0738078b6 100644 --- a/apps/mobile/app/components/premium/pricing-plans.js +++ b/apps/mobile/app/components/premium/pricing-plans.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { ActivityIndicator, Platform, Text, View } from "react-native"; import * as RNIap from "react-native-iap"; diff --git a/apps/mobile/app/components/premium/pro-tag.js b/apps/mobile/app/components/premium/pro-tag.js index d38208d03..a8a253669 100644 --- a/apps/mobile/app/components/premium/pro-tag.js +++ b/apps/mobile/app/components/premium/pro-tag.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/properties/color-tags.js b/apps/mobile/app/components/properties/color-tags.js index 3fa68ae9d..6270b23c1 100644 --- a/apps/mobile/app/components/properties/color-tags.js +++ b/apps/mobile/app/components/properties/color-tags.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/properties/date-meta.js b/apps/mobile/app/components/properties/date-meta.js index f28d7d439..a04f27e13 100644 --- a/apps/mobile/app/components/properties/date-meta.js +++ b/apps/mobile/app/components/properties/date-meta.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useThemeStore } from "../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/properties/dev-mode.js b/apps/mobile/app/components/properties/dev-mode.js index 8cbae865f..04be7d25f 100644 --- a/apps/mobile/app/components/properties/dev-mode.js +++ b/apps/mobile/app/components/properties/dev-mode.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/components/properties/index.js b/apps/mobile/app/components/properties/index.js index ede8cf5b6..27cb27856 100644 --- a/apps/mobile/app/components/properties/index.js +++ b/apps/mobile/app/components/properties/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Platform, View } from "react-native"; import { ScrollView } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/components/properties/items.js b/apps/mobile/app/components/properties/items.js index 9bcfac370..a4043e1dd 100644 --- a/apps/mobile/app/components/properties/items.js +++ b/apps/mobile/app/components/properties/items.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { FlatList } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/components/properties/notebooks.js b/apps/mobile/app/components/properties/notebooks.js index e38ce5767..d75e0992d 100644 --- a/apps/mobile/app/components/properties/notebooks.js +++ b/apps/mobile/app/components/properties/notebooks.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ScrollView, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/properties/synced.js b/apps/mobile/app/components/properties/synced.js index 6074a3b8e..0a2908b80 100644 --- a/apps/mobile/app/components/properties/synced.js +++ b/apps/mobile/app/components/properties/synced.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/properties/tags.js b/apps/mobile/app/components/properties/tags.js index aab64901f..871e87589 100644 --- a/apps/mobile/app/components/properties/tags.js +++ b/apps/mobile/app/components/properties/tags.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/components/properties/topics.js b/apps/mobile/app/components/properties/topics.js index 28588163f..e9f62684c 100644 --- a/apps/mobile/app/components/properties/topics.js +++ b/apps/mobile/app/components/properties/topics.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { TopicNotes } from "../../screens/notes/topic-notes"; diff --git a/apps/mobile/app/components/selection-header/index.js b/apps/mobile/app/components/selection-header/index.js index 6a527408a..7a5cd11cf 100644 --- a/apps/mobile/app/components/selection-header/index.js +++ b/apps/mobile/app/components/selection-header/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { BackHandler, Platform, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/sheet-provider/index.js b/apps/mobile/app/components/sheet-provider/index.js index 296cbec64..3625ac987 100644 --- a/apps/mobile/app/components/sheet-provider/index.js +++ b/apps/mobile/app/components/sheet-provider/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { ActivityIndicator, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/sheets/add-notebook/index.js b/apps/mobile/app/components/sheets/add-notebook/index.js index 86ca0f3c2..095d1551f 100644 --- a/apps/mobile/app/components/sheets/add-notebook/index.js +++ b/apps/mobile/app/components/sheets/add-notebook/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { createRef } from "react"; import { Keyboard, diff --git a/apps/mobile/app/components/sheets/add-to/index.js b/apps/mobile/app/components/sheets/add-to/index.js index 3bbad29ef..bc91de3ae 100644 --- a/apps/mobile/app/components/sheets/add-to/index.js +++ b/apps/mobile/app/components/sheets/add-to/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { createRef, useEffect, useState } from "react"; import { Keyboard, TouchableOpacity, View } from "react-native"; import { FlatList } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/components/sheets/export-notes/index.js b/apps/mobile/app/components/sheets/export-notes/index.js index 38423c2c3..26ea58923 100644 --- a/apps/mobile/app/components/sheets/export-notes/index.js +++ b/apps/mobile/app/components/sheets/export-notes/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { Fragment, useEffect, useRef, useState } from "react"; import { Platform, StyleSheet, View } from "react-native"; import FileViewer from "react-native-file-viewer"; diff --git a/apps/mobile/app/components/sheets/export-notes/share.js b/apps/mobile/app/components/sheets/export-notes/share.js index 6c135badb..a2a10df91 100644 --- a/apps/mobile/app/components/sheets/export-notes/share.js +++ b/apps/mobile/app/components/sheets/export-notes/share.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import FileViewer from "react-native-file-viewer"; diff --git a/apps/mobile/app/components/sheets/github/issue.js b/apps/mobile/app/components/sheets/github/issue.js index 92dc7f529..e166d932d 100644 --- a/apps/mobile/app/components/sheets/github/issue.js +++ b/apps/mobile/app/components/sheets/github/issue.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { useRef, useState } from "react"; import { Linking, Platform, Text, TextInput, View } from "react-native"; diff --git a/apps/mobile/app/components/sheets/manage-tags/index.js b/apps/mobile/app/components/sheets/manage-tags/index.js index a9cf6a589..8139a0f38 100644 --- a/apps/mobile/app/components/sheets/manage-tags/index.js +++ b/apps/mobile/app/components/sheets/manage-tags/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { ScrollView, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/sheets/migrate/index.tsx b/apps/mobile/app/components/sheets/migrate/index.tsx index f15f2f1f8..5a408360c 100644 --- a/apps/mobile/app/components/sheets/migrate/index.tsx +++ b/apps/mobile/app/components/sheets/migrate/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { View } from "react-native"; import { db } from "../../../common/database"; diff --git a/apps/mobile/app/components/sheets/move-notes/movenote.tsx b/apps/mobile/app/components/sheets/move-notes/movenote.tsx index 7a502694b..74d0fafbe 100644 --- a/apps/mobile/app/components/sheets/move-notes/movenote.tsx +++ b/apps/mobile/app/components/sheets/move-notes/movenote.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NotebookType, NoteType, TopicType } from "app/utils/types"; import React, { RefObject, useState } from "react"; import { Platform, View } from "react-native"; diff --git a/apps/mobile/app/components/sheets/new-feature/index.tsx b/apps/mobile/app/components/sheets/new-feature/index.tsx index aaa95192e..2c2dc83f5 100644 --- a/apps/mobile/app/components/sheets/new-feature/index.tsx +++ b/apps/mobile/app/components/sheets/new-feature/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform, View } from "react-native"; import { APP_VERSION } from "../../../version"; import { eSendEvent, presentSheet } from "../../../services/event-manager"; diff --git a/apps/mobile/app/components/sheets/progress/index.tsx b/apps/mobile/app/components/sheets/progress/index.tsx index 7c207f5f4..d5df48e16 100644 --- a/apps/mobile/app/components/sheets/progress/index.tsx +++ b/apps/mobile/app/components/sheets/progress/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import useSyncProgress from "../../../hooks/use-sync-progress"; diff --git a/apps/mobile/app/components/sheets/publish-note/index.js b/apps/mobile/app/components/sheets/publish-note/index.js index fe54a3529..56ef61700 100644 --- a/apps/mobile/app/components/sheets/publish-note/index.js +++ b/apps/mobile/app/components/sheets/publish-note/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { useEffect, useRef, useState } from "react"; import { ActivityIndicator, TouchableOpacity, View } from "react-native"; diff --git a/apps/mobile/app/components/sheets/rate-app/index.js b/apps/mobile/app/components/sheets/rate-app/index.js index c6cdbe50d..a010c4990 100644 --- a/apps/mobile/app/components/sheets/rate-app/index.js +++ b/apps/mobile/app/components/sheets/rate-app/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { Linking, View } from "react-native"; import { diff --git a/apps/mobile/app/components/sheets/recovery-key/index.js b/apps/mobile/app/components/sheets/recovery-key/index.js index 082312c86..5a31c4929 100644 --- a/apps/mobile/app/components/sheets/recovery-key/index.js +++ b/apps/mobile/app/components/sheets/recovery-key/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { createRef } from "react"; import { Platform, View } from "react-native"; diff --git a/apps/mobile/app/components/sheets/restore-data/index.js b/apps/mobile/app/components/sheets/restore-data/index.js index 0354c4a06..acb6d71f6 100644 --- a/apps/mobile/app/components/sheets/restore-data/index.js +++ b/apps/mobile/app/components/sheets/restore-data/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { createRef, useEffect, useState } from "react"; import { ActivityIndicator, Platform, View } from "react-native"; import DocumentPicker from "react-native-document-picker"; diff --git a/apps/mobile/app/components/sheets/sort/index.js b/apps/mobile/app/components/sheets/sort/index.js index bfa311a25..eb1109c70 100644 --- a/apps/mobile/app/components/sheets/sort/index.js +++ b/apps/mobile/app/components/sheets/sort/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { View } from "react-native"; import { db } from "../../../common/database"; diff --git a/apps/mobile/app/components/sheets/update/index.js b/apps/mobile/app/components/sheets/update/index.js index 8c3bc14f1..a7744d0de 100644 --- a/apps/mobile/app/components/sheets/update/index.js +++ b/apps/mobile/app/components/sheets/update/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { Linking, View } from "react-native"; import { checkVersion } from "react-native-check-version"; diff --git a/apps/mobile/app/components/side-menu/color-section.js b/apps/mobile/app/components/side-menu/color-section.js index bf2103f77..7b2613a81 100644 --- a/apps/mobile/app/components/side-menu/color-section.js +++ b/apps/mobile/app/components/side-menu/color-section.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import Navigation from "../../services/navigation"; diff --git a/apps/mobile/app/components/side-menu/index.js b/apps/mobile/app/components/side-menu/index.js index cbcaa9abe..2d531ceed 100644 --- a/apps/mobile/app/components/side-menu/index.js +++ b/apps/mobile/app/components/side-menu/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback } from "react"; import { FlatList, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/side-menu/menu-item.js b/apps/mobile/app/components/side-menu/menu-item.js index f5656b93e..e129f15e7 100644 --- a/apps/mobile/app/components/side-menu/menu-item.js +++ b/apps/mobile/app/components/side-menu/menu-item.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/side-menu/pinned-section.js b/apps/mobile/app/components/side-menu/pinned-section.js index 8445e9d62..2259ecb3d 100644 --- a/apps/mobile/app/components/side-menu/pinned-section.js +++ b/apps/mobile/app/components/side-menu/pinned-section.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { FlatList, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/components/side-menu/user-status.js b/apps/mobile/app/components/side-menu/user-status.js index 25e0b4c90..27fd27c45 100644 --- a/apps/mobile/app/components/side-menu/user-status.js +++ b/apps/mobile/app/components/side-menu/user-status.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ActivityIndicator, Platform, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/components/tabs/index.tsx b/apps/mobile/app/components/tabs/index.tsx index 2e6dce440..111b2121f 100644 --- a/apps/mobile/app/components/tabs/index.tsx +++ b/apps/mobile/app/components/tabs/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { forwardRef, RefObject, diff --git a/apps/mobile/app/components/tip/index.tsx b/apps/mobile/app/components/tip/index.tsx index eeb9543b6..d71dcf9bc 100644 --- a/apps/mobile/app/components/tip/index.tsx +++ b/apps/mobile/app/components/tip/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Image, TextStyle, View, ViewStyle } from "react-native"; import { MMKV } from "../../common/database/mmkv"; diff --git a/apps/mobile/app/components/toast/index.js b/apps/mobile/app/components/toast/index.js index e1984be5e..2aa2a2352 100644 --- a/apps/mobile/app/components/toast/index.js +++ b/apps/mobile/app/components/toast/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { Keyboard, View } from "react-native"; import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/ui/animated-button.tsx/index.tsx b/apps/mobile/app/components/ui/animated-button.tsx/index.tsx index 1d5d4d6e4..cf28d659e 100644 --- a/apps/mobile/app/components/ui/animated-button.tsx/index.tsx +++ b/apps/mobile/app/components/ui/animated-button.tsx/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ActivityIndicator, ColorValue, ViewStyle } from "react-native"; import Animated, { diff --git a/apps/mobile/app/components/ui/button/index.tsx b/apps/mobile/app/components/ui/button/index.tsx index a7b5cacba..fc5037fe9 100644 --- a/apps/mobile/app/components/ui/button/index.tsx +++ b/apps/mobile/app/components/ui/button/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ActivityIndicator, diff --git a/apps/mobile/app/components/ui/icon-button/index.tsx b/apps/mobile/app/components/ui/icon-button/index.tsx index 3b143a594..78dbba711 100644 --- a/apps/mobile/app/components/ui/icon-button/index.tsx +++ b/apps/mobile/app/components/ui/icon-button/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ColorValue, GestureResponderEvent, ViewStyle } from "react-native"; import Animated, { Layout } from "react-native-reanimated"; diff --git a/apps/mobile/app/components/ui/input/index.tsx b/apps/mobile/app/components/ui/input/index.tsx index ff021c876..acce3af78 100644 --- a/apps/mobile/app/components/ui/input/index.tsx +++ b/apps/mobile/app/components/ui/input/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { RefObject, useState } from "react"; import { ColorValue, diff --git a/apps/mobile/app/components/ui/notice/index.tsx b/apps/mobile/app/components/ui/notice/index.tsx index ec345e1a4..de6f89ca7 100644 --- a/apps/mobile/app/components/ui/notice/index.tsx +++ b/apps/mobile/app/components/ui/notice/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { useThemeStore } from "../../../stores/use-theme-store"; diff --git a/apps/mobile/app/components/ui/pressable/index.tsx b/apps/mobile/app/components/ui/pressable/index.tsx index ec0b1a6bb..ead5cecbe 100644 --- a/apps/mobile/app/components/ui/pressable/index.tsx +++ b/apps/mobile/app/components/ui/pressable/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { RefObject, useCallback } from "react"; import { ColorValue, diff --git a/apps/mobile/app/components/ui/seperator/index.tsx b/apps/mobile/app/components/ui/seperator/index.tsx index 7bb09c64a..e42a3dbed 100644 --- a/apps/mobile/app/components/ui/seperator/index.tsx +++ b/apps/mobile/app/components/ui/seperator/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; const Seperator = ({ half = false }) => { diff --git a/apps/mobile/app/components/ui/sheet/index.js b/apps/mobile/app/components/ui/sheet/index.js index 640a215e4..7d08a5fed 100644 --- a/apps/mobile/app/components/ui/sheet/index.js +++ b/apps/mobile/app/components/ui/sheet/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Platform, View } from "react-native"; import ActionSheet from "react-native-actions-sheet"; diff --git a/apps/mobile/app/components/ui/svg/index.tsx b/apps/mobile/app/components/ui/svg/index.tsx index 25bb16c88..2e89b61ce 100644 --- a/apps/mobile/app/components/ui/svg/index.tsx +++ b/apps/mobile/app/components/ui/svg/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import { SvgXml } from "./lazy"; diff --git a/apps/mobile/app/components/ui/svg/lazy.js b/apps/mobile/app/components/ui/svg/lazy.js index d96ef9388..1add77c20 100644 --- a/apps/mobile/app/components/ui/svg/lazy.js +++ b/apps/mobile/app/components/ui/svg/lazy.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import module_svg from "./module-svg"; export const QRCode = module_svg.QRCode; diff --git a/apps/mobile/app/components/ui/svg/module-svg.js b/apps/mobile/app/components/ui/svg/module-svg.js index 653332c9f..6deff9d1f 100644 --- a/apps/mobile/app/components/ui/svg/module-svg.js +++ b/apps/mobile/app/components/ui/svg/module-svg.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable @typescript-eslint/no-var-requires */ import { Bar, Circle } from "react-native-progress"; import QRCode from "react-native-qrcode-svg"; diff --git a/apps/mobile/app/components/ui/time-since/index.tsx b/apps/mobile/app/components/ui/time-since/index.tsx index dadb4dd5c..b474daa28 100644 --- a/apps/mobile/app/components/ui/time-since/index.tsx +++ b/apps/mobile/app/components/ui/time-since/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { TextProps } from "react-native"; import { timeSince } from "../../../utils/time"; diff --git a/apps/mobile/app/components/ui/transitions/bouncing-view.js b/apps/mobile/app/components/ui/transitions/bouncing-view.js index 6126c4142..f9dcf1456 100644 --- a/apps/mobile/app/components/ui/transitions/bouncing-view.js +++ b/apps/mobile/app/components/ui/transitions/bouncing-view.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import Animated, { Easing, diff --git a/apps/mobile/app/components/ui/typography/heading.tsx b/apps/mobile/app/components/ui/typography/heading.tsx index a86b0acf7..2c70ba581 100644 --- a/apps/mobile/app/components/ui/typography/heading.tsx +++ b/apps/mobile/app/components/ui/typography/heading.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useMemo } from "react"; import { Platform, Text, TextProps } from "react-native"; import Animated, { diff --git a/apps/mobile/app/components/ui/typography/paragraph.tsx b/apps/mobile/app/components/ui/typography/paragraph.tsx index 7be705e25..403ef09d8 100644 --- a/apps/mobile/app/components/ui/typography/paragraph.tsx +++ b/apps/mobile/app/components/ui/typography/paragraph.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useMemo } from "react"; import { Text, TextProps } from "react-native"; import Animated, { diff --git a/apps/mobile/app/components/walkthroughs/index.tsx b/apps/mobile/app/components/walkthroughs/index.tsx index 6b5e335c6..534c21925 100644 --- a/apps/mobile/app/components/walkthroughs/index.tsx +++ b/apps/mobile/app/components/walkthroughs/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { LayoutAnimation, View } from "react-native"; import { MMKV } from "../../common/database/mmkv"; diff --git a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx index b1fdeeb95..6e38c2741 100644 --- a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx +++ b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Linking, View } from "react-native"; import Icon from "react-native-vector-icons/MaterialCommunityIcons"; diff --git a/apps/mobile/app/features.ts b/apps/mobile/app/features.ts index 71f52a54d..198de663e 100644 --- a/apps/mobile/app/features.ts +++ b/apps/mobile/app/features.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { FeatureType } from "./components/sheets/new-feature"; export const features: FeatureType[] = []; diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.js index a780f3e03..8169c90bb 100644 --- a/apps/mobile/app/hooks/use-actions.js +++ b/apps/mobile/app/hooks/use-actions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { useEffect, useState } from "react"; import { Platform } from "react-native"; diff --git a/apps/mobile/app/hooks/use-app-events.js b/apps/mobile/app/hooks/use-app-events.js index fe79b7622..53c7afdf9 100644 --- a/apps/mobile/app/hooks/use-app-events.js +++ b/apps/mobile/app/hooks/use-app-events.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import NetInfo from "@react-native-community/netinfo"; import { EV, EVENTS } from "@notesnook/core/common"; import { useEffect, useRef } from "react"; diff --git a/apps/mobile/app/hooks/use-app-state.ts b/apps/mobile/app/hooks/use-app-state.ts index 577c5104b..66a803edf 100644 --- a/apps/mobile/app/hooks/use-app-state.ts +++ b/apps/mobile/app/hooks/use-app-state.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { AppState, AppStateStatus } from "react-native"; diff --git a/apps/mobile/app/hooks/use-attachment-progress.js b/apps/mobile/app/hooks/use-attachment-progress.js index 42ce51463..e1c1dc88a 100644 --- a/apps/mobile/app/hooks/use-attachment-progress.js +++ b/apps/mobile/app/hooks/use-attachment-progress.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { useAttachmentStore } from "../stores/use-attachment-store"; diff --git a/apps/mobile/app/hooks/use-delay-layout.ts b/apps/mobile/app/hooks/use-delay-layout.ts index fb1c1ae10..3227103f4 100644 --- a/apps/mobile/app/hooks/use-delay-layout.ts +++ b/apps/mobile/app/hooks/use-delay-layout.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { InteractionManager } from "react-native"; diff --git a/apps/mobile/app/hooks/use-editor-tags.ts b/apps/mobile/app/hooks/use-editor-tags.ts index 9440ca2a6..acd058ee3 100644 --- a/apps/mobile/app/hooks/use-editor-tags.ts +++ b/apps/mobile/app/hooks/use-editor-tags.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager"; import { useEditorStore } from "../stores/use-editor-store"; diff --git a/apps/mobile/app/hooks/use-immediate.ts b/apps/mobile/app/hooks/use-immediate.ts index 89e7bd0ec..54f5cb4cd 100644 --- a/apps/mobile/app/hooks/use-immediate.ts +++ b/apps/mobile/app/hooks/use-immediate.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { DependencyList, EffectCallback, useEffect } from "react"; const useImmediateEffect = (callback: EffectCallback, deps: DependencyList) => { diff --git a/apps/mobile/app/hooks/use-is-floating-keyboard.ts b/apps/mobile/app/hooks/use-is-floating-keyboard.ts index 47c4a83d9..a4d7f9bf3 100644 --- a/apps/mobile/app/hooks/use-is-floating-keyboard.ts +++ b/apps/mobile/app/hooks/use-is-floating-keyboard.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { Keyboard, KeyboardEvent, useWindowDimensions } from "react-native"; diff --git a/apps/mobile/app/hooks/use-keyboard.ts b/apps/mobile/app/hooks/use-keyboard.ts index b9412a84a..13d63409f 100644 --- a/apps/mobile/app/hooks/use-keyboard.ts +++ b/apps/mobile/app/hooks/use-keyboard.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { Keyboard, KeyboardEventListener, ScreenRect } from "react-native"; diff --git a/apps/mobile/app/hooks/use-navigation-focus.ts b/apps/mobile/app/hooks/use-navigation-focus.ts index 11879adc4..ed9cbe010 100644 --- a/apps/mobile/app/hooks/use-navigation-focus.ts +++ b/apps/mobile/app/hooks/use-navigation-focus.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NativeStackNavigationProp } from "@react-navigation/native-stack"; import { RefObject, useCallback, useEffect, useRef, useState } from "react"; diff --git a/apps/mobile/app/hooks/use-pricing.ts b/apps/mobile/app/hooks/use-pricing.ts index a2357ff19..3887466fb 100644 --- a/apps/mobile/app/hooks/use-pricing.ts +++ b/apps/mobile/app/hooks/use-pricing.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { Platform } from "react-native"; import { Subscription } from "react-native-iap"; diff --git a/apps/mobile/app/hooks/use-rotator.ts b/apps/mobile/app/hooks/use-rotator.ts index b062abea3..1dbd49a2b 100644 --- a/apps/mobile/app/hooks/use-rotator.ts +++ b/apps/mobile/app/hooks/use-rotator.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef, useState } from "react"; /** diff --git a/apps/mobile/app/hooks/use-sync-progress.ts b/apps/mobile/app/hooks/use-sync-progress.ts index be7a4d355..53f89955c 100644 --- a/apps/mobile/app/hooks/use-sync-progress.ts +++ b/apps/mobile/app/hooks/use-sync-progress.ts @@ -1,4 +1,22 @@ -import { EVENTS } from "@streetwriters/notesnook-core/common"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { EVENTS } from "@notesnook/core/common"; import { useCallback, useEffect, useState } from "react"; import { db } from "../common/database"; diff --git a/apps/mobile/app/hooks/use-timer.ts b/apps/mobile/app/hooks/use-timer.ts index a67f5748b..d5059011d 100644 --- a/apps/mobile/app/hooks/use-timer.ts +++ b/apps/mobile/app/hooks/use-timer.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef, useState } from "react"; const timers: { [name: string]: number } = {}; diff --git a/apps/mobile/app/hooks/use-tooltip.ts b/apps/mobile/app/hooks/use-tooltip.ts index c72391859..515a2f79d 100644 --- a/apps/mobile/app/hooks/use-tooltip.ts +++ b/apps/mobile/app/hooks/use-tooltip.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { RefObject, useEffect, useRef } from "react"; import { Platform } from "react-native"; import RNTooltips from "react-native-tooltips"; diff --git a/apps/mobile/app/hooks/use-vault-status.js b/apps/mobile/app/hooks/use-vault-status.js index 2cd2d3f8c..7d4673eae 100644 --- a/apps/mobile/app/hooks/use-vault-status.js +++ b/apps/mobile/app/hooks/use-vault-status.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback, useEffect } from "react"; import BiometicService from "../services/biometrics"; import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager"; diff --git a/apps/mobile/app/navigation/index.js b/apps/mobile/app/navigation/index.js index 98a329ed8..c819f4e28 100644 --- a/apps/mobile/app/navigation/index.js +++ b/apps/mobile/app/navigation/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { SafeAreaView } from "react-native"; import DelayLayout from "../components/delay-layout"; diff --git a/apps/mobile/app/navigation/navigation-stack.js b/apps/mobile/app/navigation/navigation-stack.js index 76381501b..a19169be3 100644 --- a/apps/mobile/app/navigation/navigation-stack.js +++ b/apps/mobile/app/navigation/navigation-stack.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import * as React from "react"; diff --git a/apps/mobile/app/navigation/tabs-holder.js b/apps/mobile/app/navigation/tabs-holder.js index 4ce586759..288e9f55f 100644 --- a/apps/mobile/app/navigation/tabs-holder.js +++ b/apps/mobile/app/navigation/tabs-holder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { activateKeepAwake, deactivateKeepAwake diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx index f0f5685e3..1942d051d 100755 --- a/apps/mobile/app/screens/editor/index.tsx +++ b/apps/mobile/app/screens/editor/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable @typescript-eslint/no-var-requires */ import { EV, EVENTS } from "@notesnook/core/common"; import React, { diff --git a/apps/mobile/app/screens/editor/loading.js b/apps/mobile/app/screens/editor/loading.js index 5dff103a5..077183f6a 100644 --- a/apps/mobile/app/screens/editor/loading.js +++ b/apps/mobile/app/screens/editor/loading.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import Animated, { diff --git a/apps/mobile/app/screens/editor/progress.js b/apps/mobile/app/screens/editor/progress.js index da0359724..e74da1e89 100644 --- a/apps/mobile/app/screens/editor/progress.js +++ b/apps/mobile/app/screens/editor/progress.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; diff --git a/apps/mobile/app/screens/editor/source.ts b/apps/mobile/app/screens/editor/source.ts index 9f79d02b5..8326457fe 100644 --- a/apps/mobile/app/screens/editor/source.ts +++ b/apps/mobile/app/screens/editor/source.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; export const EDITOR_URI = diff --git a/apps/mobile/app/screens/editor/tiptap/commands.ts b/apps/mobile/app/screens/editor/tiptap/commands.ts index 721292c74..69222998b 100644 --- a/apps/mobile/app/screens/editor/tiptap/commands.ts +++ b/apps/mobile/app/screens/editor/tiptap/commands.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import type { Attachment, AttachmentProgress diff --git a/apps/mobile/app/screens/editor/tiptap/picker.js b/apps/mobile/app/screens/editor/tiptap/picker.js index 3c3048567..87a3df1cd 100644 --- a/apps/mobile/app/screens/editor/tiptap/picker.js +++ b/apps/mobile/app/screens/editor/tiptap/picker.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Platform, View } from "react-native"; import DocumentPicker from "react-native-document-picker"; diff --git a/apps/mobile/app/screens/editor/tiptap/types.ts b/apps/mobile/app/screens/editor/tiptap/types.ts index b087453da..371864a95 100644 --- a/apps/mobile/app/screens/editor/tiptap/types.ts +++ b/apps/mobile/app/screens/editor/tiptap/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEditor } from "./use-editor"; import type { ToolbarGroupDefinition } from "@notesnook/editor/dist/toolbar/types"; import { ThemeStore } from "../../../stores/use-theme-store"; diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts index 9bb0cdaa1..7f5e5dd90 100644 --- a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts +++ b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-case-declarations */ /* eslint-disable @typescript-eslint/no-var-requires */ import { getDefaultPresets } from "@streetwriters/editor/dist/toolbar/tool-definitions"; diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts index fc4bc017f..697dba349 100644 --- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts +++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import WebView from "react-native-webview"; diff --git a/apps/mobile/app/screens/editor/tiptap/utils.ts b/apps/mobile/app/screens/editor/tiptap/utils.ts index 734e9b1ca..6cb5dc500 100644 --- a/apps/mobile/app/screens/editor/tiptap/utils.ts +++ b/apps/mobile/app/screens/editor/tiptap/utils.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { createRef, MutableRefObject, RefObject } from "react"; import { TextInput } from "react-native"; import WebView from "react-native-webview"; diff --git a/apps/mobile/app/screens/editor/wrapper.js b/apps/mobile/app/screens/editor/wrapper.js index de2e6909a..632d73d21 100644 --- a/apps/mobile/app/screens/editor/wrapper.js +++ b/apps/mobile/app/screens/editor/wrapper.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { AppState, diff --git a/apps/mobile/app/screens/favorites/index.tsx b/apps/mobile/app/screens/favorites/index.tsx index b3170fd17..a64b470fd 100644 --- a/apps/mobile/app/screens/favorites/index.tsx +++ b/apps/mobile/app/screens/favorites/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { db } from "../../common/database"; import DelayLayout from "../../components/delay-layout"; diff --git a/apps/mobile/app/screens/home/index.tsx b/apps/mobile/app/screens/home/index.tsx index c716f1bba..9987d36a9 100755 --- a/apps/mobile/app/screens/home/index.tsx +++ b/apps/mobile/app/screens/home/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { db } from "../../common/database"; import { FloatingButton } from "../../components/container/floating-button"; diff --git a/apps/mobile/app/screens/notebook/index.tsx b/apps/mobile/app/screens/notebook/index.tsx index 9e7bf52a0..04dd02bd8 100644 --- a/apps/mobile/app/screens/notebook/index.tsx +++ b/apps/mobile/app/screens/notebook/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "@notesnook/core/utils/grouping"; import { qclone } from "qclone"; import React, { useEffect, useRef, useState } from "react"; diff --git a/apps/mobile/app/screens/notebooks/index.tsx b/apps/mobile/app/screens/notebooks/index.tsx index 07b915173..159b23a39 100644 --- a/apps/mobile/app/screens/notebooks/index.tsx +++ b/apps/mobile/app/screens/notebooks/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { db } from "../../common/database"; import { FloatingButton } from "../../components/container/floating-button"; diff --git a/apps/mobile/app/screens/notes/colored.tsx b/apps/mobile/app/screens/notes/colored.tsx index ce81677b9..123f944d3 100644 --- a/apps/mobile/app/screens/notes/colored.tsx +++ b/apps/mobile/app/screens/notes/colored.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "@notesnook/core/utils/grouping"; import React from "react"; import NotesPage, { PLACEHOLDER_DATA } from "."; diff --git a/apps/mobile/app/screens/notes/common.ts b/apps/mobile/app/screens/notes/common.ts index 1a5cb2e72..d2cddfac0 100644 --- a/apps/mobile/app/screens/notes/common.ts +++ b/apps/mobile/app/screens/notes/common.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { DDS } from "../../services/device-detection"; import { eSendEvent } from "../../services/event-manager"; import Navigation, { NotesScreenParams } from "../../services/navigation"; diff --git a/apps/mobile/app/screens/notes/index.tsx b/apps/mobile/app/screens/notes/index.tsx index 184215298..1ba87aa04 100644 --- a/apps/mobile/app/screens/notes/index.tsx +++ b/apps/mobile/app/screens/notes/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { FloatingButton } from "../../components/container/floating-button"; import DelayLayout from "../../components/delay-layout"; diff --git a/apps/mobile/app/screens/notes/monographs.tsx b/apps/mobile/app/screens/notes/monographs.tsx index 51bd00183..ca009ab6a 100644 --- a/apps/mobile/app/screens/notes/monographs.tsx +++ b/apps/mobile/app/screens/notes/monographs.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "@notesnook/core/utils/grouping"; import React from "react"; import NotesPage, { PLACEHOLDER_DATA } from "."; diff --git a/apps/mobile/app/screens/notes/tagged.tsx b/apps/mobile/app/screens/notes/tagged.tsx index 8c26f0095..72c44554b 100644 --- a/apps/mobile/app/screens/notes/tagged.tsx +++ b/apps/mobile/app/screens/notes/tagged.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "@notesnook/core/utils/grouping"; import React from "react"; import NotesPage, { PLACEHOLDER_DATA } from "."; diff --git a/apps/mobile/app/screens/notes/topic-notes.tsx b/apps/mobile/app/screens/notes/topic-notes.tsx index 80156f4ba..1183991df 100644 --- a/apps/mobile/app/screens/notes/topic-notes.tsx +++ b/apps/mobile/app/screens/notes/topic-notes.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "@notesnook/core/utils/grouping"; import React from "react"; import NotesPage, { PLACEHOLDER_DATA } from "."; diff --git a/apps/mobile/app/screens/search/index.js b/apps/mobile/app/screens/search/index.js index 03584e9a1..b1d2a8c6d 100644 --- a/apps/mobile/app/screens/search/index.js +++ b/apps/mobile/app/screens/search/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import DelayLayout from "../../components/delay-layout"; import List from "../../components/list"; diff --git a/apps/mobile/app/screens/search/search-bar.js b/apps/mobile/app/screens/search/search-bar.js index 7106f753a..ad9379c36 100644 --- a/apps/mobile/app/screens/search/search-bar.js +++ b/apps/mobile/app/screens/search/search-bar.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { View } from "react-native"; import { TextInput } from "react-native-gesture-handler"; diff --git a/apps/mobile/app/screens/settings/2fa.tsx b/apps/mobile/app/screens/settings/2fa.tsx index 11eccc9c1..9b795f88e 100644 --- a/apps/mobile/app/screens/settings/2fa.tsx +++ b/apps/mobile/app/screens/settings/2fa.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import React, { Dispatch, diff --git a/apps/mobile/app/screens/settings/app-lock.js b/apps/mobile/app/screens/settings/app-lock.js index 4d3130d9c..c270f1a7f 100644 --- a/apps/mobile/app/screens/settings/app-lock.js +++ b/apps/mobile/app/screens/settings/app-lock.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState } from "react"; import { Dimensions, LayoutAnimation, Platform, View } from "react-native"; import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated"; diff --git a/apps/mobile/app/screens/settings/appearance.js b/apps/mobile/app/screens/settings/appearance.js index 8c8c16b4d..72b14065c 100644 --- a/apps/mobile/app/screens/settings/appearance.js +++ b/apps/mobile/app/screens/settings/appearance.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef, useState } from "react"; import { View } from "react-native"; import Menu, { MenuItem } from "react-native-reanimated-material-menu"; diff --git a/apps/mobile/app/screens/settings/backup-restore.js b/apps/mobile/app/screens/settings/backup-restore.js index 1e92458d4..1588daeaf 100644 --- a/apps/mobile/app/screens/settings/backup-restore.js +++ b/apps/mobile/app/screens/settings/backup-restore.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Platform, TouchableOpacity, View } from "react-native"; import Paragraph from "../../components/ui/typography/paragraph"; diff --git a/apps/mobile/app/screens/settings/components.tsx b/apps/mobile/app/screens/settings/components.tsx index 71aec8d6e..adb8b7f58 100644 --- a/apps/mobile/app/screens/settings/components.tsx +++ b/apps/mobile/app/screens/settings/components.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { ReactElement } from "react"; import { AccentColorPicker, HomagePageSelector } from "./appearance"; import { AutomaticBackupsSelector } from "./backup-restore"; diff --git a/apps/mobile/app/screens/settings/debug.tsx b/apps/mobile/app/screens/settings/debug.tsx index 4405cb1d9..fcce6cd5b 100644 --- a/apps/mobile/app/screens/settings/debug.tsx +++ b/apps/mobile/app/screens/settings/debug.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import { LogMessage } from "@streetwriters/logger"; import { format, LogLevel, logManager } from "@notesnook/core/logger"; diff --git a/apps/mobile/app/screens/settings/editor/common.tsx b/apps/mobile/app/screens/settings/editor/common.tsx index fe663e195..28b8c96a4 100644 --- a/apps/mobile/app/screens/settings/editor/common.tsx +++ b/apps/mobile/app/screens/settings/editor/common.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Group } from "./group"; import { DraggableItem } from "./state"; diff --git a/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx b/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx index 08d11a118..b3700b76f 100644 --- a/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx +++ b/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { StyleSheet, View } from "react-native"; import { DraxProvider, DraxScrollView } from "react-native-drax"; diff --git a/apps/mobile/app/screens/settings/editor/group.tsx b/apps/mobile/app/screens/settings/editor/group.tsx index fd1ac8405..27740502d 100644 --- a/apps/mobile/app/screens/settings/editor/group.tsx +++ b/apps/mobile/app/screens/settings/editor/group.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import * as React from "react"; import { View } from "react-native"; import { DraxDragWithReceiverEventData, DraxView } from "react-native-drax"; diff --git a/apps/mobile/app/screens/settings/editor/state.ts b/apps/mobile/app/screens/settings/editor/state.ts index c50881afd..1d4e7623f 100644 --- a/apps/mobile/app/screens/settings/editor/state.ts +++ b/apps/mobile/app/screens/settings/editor/state.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import type { ToolbarGroupDefinition } from "@notesnook/editor/dist/toolbar/types"; import create, { State } from "zustand"; import { persist, StateStorage } from "zustand/middleware"; diff --git a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx index e5a7464da..521824319 100644 --- a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx +++ b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolId } from "@notesnook/editor/dist/toolbar"; import React, { RefObject } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/screens/settings/editor/tool.tsx b/apps/mobile/app/screens/settings/editor/tool.tsx index 982c8fbd8..ab4b0c9b0 100644 --- a/apps/mobile/app/screens/settings/editor/tool.tsx +++ b/apps/mobile/app/screens/settings/editor/tool.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import * as React from "react"; import { View } from "react-native"; import { DraxDragWithReceiverEventData, DraxView } from "react-native-drax"; diff --git a/apps/mobile/app/screens/settings/editor/toolbar-definition.ts b/apps/mobile/app/screens/settings/editor/toolbar-definition.ts index 12f31b7f0..f43aeaa9d 100644 --- a/apps/mobile/app/screens/settings/editor/toolbar-definition.ts +++ b/apps/mobile/app/screens/settings/editor/toolbar-definition.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Icons } from "@notesnook/editor/dist/toolbar/icons"; import { getDefaultPresets, diff --git a/apps/mobile/app/screens/settings/functions.js b/apps/mobile/app/screens/settings/functions.js index 7dc58b930..c0569e383 100644 --- a/apps/mobile/app/screens/settings/functions.js +++ b/apps/mobile/app/screens/settings/functions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { presentDialog } from "../../components/dialog/functions"; import { ToastEvent } from "../../services/event-manager"; import { db } from "../../common/database"; diff --git a/apps/mobile/app/screens/settings/group.tsx b/apps/mobile/app/screens/settings/group.tsx index 16987c9c1..35ffa1375 100644 --- a/apps/mobile/app/screens/settings/group.tsx +++ b/apps/mobile/app/screens/settings/group.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NativeStackScreenProps } from "@react-navigation/native-stack"; import React, { useEffect } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/screens/settings/home.tsx b/apps/mobile/app/screens/settings/home.tsx index 28d8ae73b..8cb6981b0 100644 --- a/apps/mobile/app/screens/settings/home.tsx +++ b/apps/mobile/app/screens/settings/home.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NativeStackScreenProps } from "@react-navigation/native-stack"; import React, { useEffect, useState } from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/screens/settings/index.tsx b/apps/mobile/app/screens/settings/index.tsx index 2a0d111d6..b8c6e132a 100644 --- a/apps/mobile/app/screens/settings/index.tsx +++ b/apps/mobile/app/screens/settings/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { createNativeStackNavigator } from "@react-navigation/native-stack"; import React from "react"; import useNavigationStore from "../../stores/use-navigation-store"; diff --git a/apps/mobile/app/screens/settings/section-group.tsx b/apps/mobile/app/screens/settings/section-group.tsx index e9e49ee93..f0b9d470d 100644 --- a/apps/mobile/app/screens/settings/section-group.tsx +++ b/apps/mobile/app/screens/settings/section-group.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { View } from "react-native"; import Heading from "../../components/ui/typography/heading"; diff --git a/apps/mobile/app/screens/settings/section-item.tsx b/apps/mobile/app/screens/settings/section-item.tsx index e04a690a6..bc558a912 100644 --- a/apps/mobile/app/screens/settings/section-item.tsx +++ b/apps/mobile/app/screens/settings/section-item.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NavigationProp, StackActions, diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx index 13e704742..0dbb4745a 100644 --- a/apps/mobile/app/screens/settings/settings-data.tsx +++ b/apps/mobile/app/screens/settings/settings-data.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import dayjs from "dayjs"; import React from "react"; import { Linking, Platform } from "react-native"; diff --git a/apps/mobile/app/screens/settings/subscription.js b/apps/mobile/app/screens/settings/subscription.js index ae447f09d..e3a769900 100644 --- a/apps/mobile/app/screens/settings/subscription.js +++ b/apps/mobile/app/screens/settings/subscription.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Linking, Platform, View } from "react-native"; import { Button } from "../../components/ui/button"; diff --git a/apps/mobile/app/screens/settings/types.ts b/apps/mobile/app/screens/settings/types.ts index 0342428b0..fcec7cd72 100644 --- a/apps/mobile/app/screens/settings/types.ts +++ b/apps/mobile/app/screens/settings/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Settings } from "../../stores/use-setting-store"; export type SettingSection = { diff --git a/apps/mobile/app/screens/settings/user-section.js b/apps/mobile/app/screens/settings/user-section.js index afb3478a8..17f708b0b 100644 --- a/apps/mobile/app/screens/settings/user-section.js +++ b/apps/mobile/app/screens/settings/user-section.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import dayjs from "dayjs"; import React from "react"; import { View } from "react-native"; diff --git a/apps/mobile/app/screens/tags/index.tsx b/apps/mobile/app/screens/tags/index.tsx index 61260ed04..8dbf3f989 100644 --- a/apps/mobile/app/screens/tags/index.tsx +++ b/apps/mobile/app/screens/tags/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { db } from "../../common/database"; import DelayLayout from "../../components/delay-layout"; diff --git a/apps/mobile/app/screens/trash/index.tsx b/apps/mobile/app/screens/trash/index.tsx index 92833970c..64d63278f 100644 --- a/apps/mobile/app/screens/trash/index.tsx +++ b/apps/mobile/app/screens/trash/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { db } from "../../common/database"; import { FloatingButton } from "../../components/container/floating-button"; diff --git a/apps/mobile/app/services/backup.js b/apps/mobile/app/services/backup.js index 98bb89bdc..7576b08b7 100644 --- a/apps/mobile/app/services/backup.js +++ b/apps/mobile/app/services/backup.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import FileViewer from "react-native-file-viewer"; import * as ScopedStorage from "react-native-scoped-storage"; diff --git a/apps/mobile/app/services/biometrics.ts b/apps/mobile/app/services/biometrics.ts index 95adb4380..5d41ec2cc 100644 --- a/apps/mobile/app/services/biometrics.ts +++ b/apps/mobile/app/services/biometrics.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import FingerprintScanner, { AuthenticateIOS diff --git a/apps/mobile/app/services/device-detection.js b/apps/mobile/app/services/device-detection.js index 76691c398..dd88520e3 100644 --- a/apps/mobile/app/services/device-detection.js +++ b/apps/mobile/app/services/device-detection.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Dimensions, PixelRatio, Platform } from "react-native"; import DeviceInfo from "react-native-device-info"; diff --git a/apps/mobile/app/services/event-manager.ts b/apps/mobile/app/services/event-manager.ts index efff214fb..1292c83db 100644 --- a/apps/mobile/app/services/event-manager.ts +++ b/apps/mobile/app/services/event-manager.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Clipboard from "@react-native-clipboard/clipboard"; import EventManager from "@notesnook/core/utils/eventmanager"; import { RefObject } from "react"; diff --git a/apps/mobile/app/services/exporter.js b/apps/mobile/app/services/exporter.js index 1a747cebc..7c583e6d4 100644 --- a/apps/mobile/app/services/exporter.js +++ b/apps/mobile/app/services/exporter.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { decode, EntityLevel } from "entities"; import { Platform } from "react-native"; import RNHTMLtoPDF from "react-native-html-to-pdf-lite"; diff --git a/apps/mobile/app/services/message.js b/apps/mobile/app/services/message.js index f3b084a6f..6ac501edf 100644 --- a/apps/mobile/app/services/message.js +++ b/apps/mobile/app/services/message.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useMessageStore } from "../stores/use-message-store"; import { eOpenLoginDialog, diff --git a/apps/mobile/app/services/navigation.ts b/apps/mobile/app/services/navigation.ts index 98fb53320..e3e6cd1c6 100755 --- a/apps/mobile/app/services/navigation.ts +++ b/apps/mobile/app/services/navigation.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StackActions } from "@react-navigation/native"; import { NativeStackScreenProps } from "@react-navigation/native-stack"; import { useFavoriteStore } from "../stores/use-favorite-store"; diff --git a/apps/mobile/app/services/notifications.ts b/apps/mobile/app/services/notifications.ts index d498ab464..d9bf977b7 100644 --- a/apps/mobile/app/services/notifications.ts +++ b/apps/mobile/app/services/notifications.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import PushNotification, { Importance, diff --git a/apps/mobile/app/services/premium.js b/apps/mobile/app/services/premium.js index b888e09ee..66534d5a9 100644 --- a/apps/mobile/app/services/premium.js +++ b/apps/mobile/app/services/premium.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { CHECK_IDS } from "@notesnook/core/common"; import React from "react"; import { Platform } from "react-native"; diff --git a/apps/mobile/app/services/search.js b/apps/mobile/app/services/search.js index b6ca1bf2c..c3e58591a 100644 --- a/apps/mobile/app/services/search.js +++ b/apps/mobile/app/services/search.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useSearchStore } from "../stores/use-search-store"; import { db } from "../common/database"; diff --git a/apps/mobile/app/services/settings.ts b/apps/mobile/app/services/settings.ts index 23a60a80f..8feb12277 100644 --- a/apps/mobile/app/services/settings.ts +++ b/apps/mobile/app/services/settings.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import { enabled } from "react-native-privacy-snapshot"; import { SettingStore } from "../stores/use-setting-store"; diff --git a/apps/mobile/app/services/sync.js b/apps/mobile/app/services/sync.js index 99d98d9c6..0032641c4 100644 --- a/apps/mobile/app/services/sync.js +++ b/apps/mobile/app/services/sync.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import NetInfo from "@react-native-community/netinfo"; import { EVENTS } from "@notesnook/core/common"; import { initAfterSync } from "../stores/index"; diff --git a/apps/mobile/app/services/tip-manager.ts b/apps/mobile/app/services/tip-manager.ts index b00d894be..a4832e9e1 100644 --- a/apps/mobile/app/services/tip-manager.ts +++ b/apps/mobile/app/services/tip-manager.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef, useState } from "react"; import { MMKV } from "../common/database/mmkv"; diff --git a/apps/mobile/app/services/validation.js b/apps/mobile/app/services/validation.js index a0d22d5ac..6aabb6216 100644 --- a/apps/mobile/app/services/validation.js +++ b/apps/mobile/app/services/validation.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import isEmail from "validator/lib/isEmail"; export function validateEmail(email) { diff --git a/apps/mobile/app/stores/index.ts b/apps/mobile/app/stores/index.ts index 5e83d3e45..d1833dc76 100644 --- a/apps/mobile/app/stores/index.ts +++ b/apps/mobile/app/stores/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/database"; import Navigation from "../services/navigation"; import { useFavoriteStore } from "./use-favorite-store"; diff --git a/apps/mobile/app/stores/use-attachment-store.ts b/apps/mobile/app/stores/use-attachment-store.ts index 87da1cf50..9e6150bfa 100644 --- a/apps/mobile/app/stores/use-attachment-store.ts +++ b/apps/mobile/app/stores/use-attachment-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create from "zustand"; import { editorController } from "../screens/editor/tiptap/utils"; diff --git a/apps/mobile/app/stores/use-editor-store.ts b/apps/mobile/app/stores/use-editor-store.ts index 5a9ca58f3..3e586d6d3 100644 --- a/apps/mobile/app/stores/use-editor-store.ts +++ b/apps/mobile/app/stores/use-editor-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager"; diff --git a/apps/mobile/app/stores/use-favorite-store.ts b/apps/mobile/app/stores/use-favorite-store.ts index d9271aa52..ce248174a 100644 --- a/apps/mobile/app/stores/use-favorite-store.ts +++ b/apps/mobile/app/stores/use-favorite-store.ts @@ -1,4 +1,22 @@ -import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { groupArray } from "@notesnook/core/utils/grouping"; import create, { State } from "zustand"; import { db } from "../common/database"; import { NoteType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-menu-store.ts b/apps/mobile/app/stores/use-menu-store.ts index c146ae198..454e1e61b 100644 --- a/apps/mobile/app/stores/use-menu-store.ts +++ b/apps/mobile/app/stores/use-menu-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; import { db } from "../common/database"; import { ColorType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-message-store.ts b/apps/mobile/app/stores/use-message-store.ts index 291348eb9..ec55dac9c 100644 --- a/apps/mobile/app/stores/use-message-store.ts +++ b/apps/mobile/app/stores/use-message-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import create, { State } from "zustand"; import { APP_VERSION } from "../version"; diff --git a/apps/mobile/app/stores/use-navigation-store.ts b/apps/mobile/app/stores/use-navigation-store.ts index 2091ba2e5..334793927 100644 --- a/apps/mobile/app/stores/use-navigation-store.ts +++ b/apps/mobile/app/stores/use-navigation-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; import { COLORS_NOTE } from "../utils/color-scheme"; import { diff --git a/apps/mobile/app/stores/use-notebook-store.ts b/apps/mobile/app/stores/use-notebook-store.ts index 471a9380f..ed44600b0 100644 --- a/apps/mobile/app/stores/use-notebook-store.ts +++ b/apps/mobile/app/stores/use-notebook-store.ts @@ -1,4 +1,22 @@ -import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { groupArray } from "@notesnook/core/utils/grouping"; import create, { State } from "zustand"; import { db } from "../common/database"; import { NotebookType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-notes-store.ts b/apps/mobile/app/stores/use-notes-store.ts index f8644d0df..346a1dcb4 100644 --- a/apps/mobile/app/stores/use-notes-store.ts +++ b/apps/mobile/app/stores/use-notes-store.ts @@ -1,4 +1,22 @@ -import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { groupArray } from "@notesnook/core/utils/grouping"; import create, { State } from "zustand"; import { db } from "../common/database"; import { NoteType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-search-store.ts b/apps/mobile/app/stores/use-search-store.ts index 1dfa00256..9694522f5 100644 --- a/apps/mobile/app/stores/use-search-store.ts +++ b/apps/mobile/app/stores/use-search-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; export interface SearchStore extends State { diff --git a/apps/mobile/app/stores/use-selection-store.ts b/apps/mobile/app/stores/use-selection-store.ts index 1bff5c410..5796d2b3e 100644 --- a/apps/mobile/app/stores/use-selection-store.ts +++ b/apps/mobile/app/stores/use-selection-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; import { history } from "../utils"; diff --git a/apps/mobile/app/stores/use-setting-store.ts b/apps/mobile/app/stores/use-setting-store.ts index ed5bc2cf5..e2177efc4 100644 --- a/apps/mobile/app/stores/use-setting-store.ts +++ b/apps/mobile/app/stores/use-setting-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Dimensions } from "react-native"; import Config from "react-native-config"; import { FileType } from "react-native-scoped-storage"; diff --git a/apps/mobile/app/stores/use-tag-store.ts b/apps/mobile/app/stores/use-tag-store.ts index 065a65ced..255f536e9 100644 --- a/apps/mobile/app/stores/use-tag-store.ts +++ b/apps/mobile/app/stores/use-tag-store.ts @@ -1,5 +1,23 @@ -import "@streetwriters/notesnook-core/types"; -import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import "@notesnook/core/types"; +import { groupArray } from "@notesnook/core/utils/grouping"; import create, { State } from "zustand"; import { db } from "../common/database"; import { TagType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-theme-store.ts b/apps/mobile/app/stores/use-theme-store.ts index 919908332..6ce47221d 100644 --- a/apps/mobile/app/stores/use-theme-store.ts +++ b/apps/mobile/app/stores/use-theme-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Appearance } from "react-native"; import create, { State } from "zustand"; import { COLOR_SCHEME_DARK, COLOR_SCHEME_LIGHT } from "../utils/color-scheme"; diff --git a/apps/mobile/app/stores/use-trash-store.ts b/apps/mobile/app/stores/use-trash-store.ts index 96ed2a597..035354a88 100644 --- a/apps/mobile/app/stores/use-trash-store.ts +++ b/apps/mobile/app/stores/use-trash-store.ts @@ -1,4 +1,22 @@ -import { groupArray } from "@streetwriters/notesnook-core/utils/grouping"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { groupArray } from "@notesnook/core/utils/grouping"; import create, { State } from "zustand"; import { db } from "../common/database"; import { TrashType } from "../utils/types"; diff --git a/apps/mobile/app/stores/use-user-store.ts b/apps/mobile/app/stores/use-user-store.ts index 5ad93a743..24ff5f7b3 100644 --- a/apps/mobile/app/stores/use-user-store.ts +++ b/apps/mobile/app/stores/use-user-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; export interface UserStore extends State { diff --git a/apps/mobile/app/utils/color-scheme/index.js b/apps/mobile/app/utils/color-scheme/index.js index 2c09bb97d..691e2e5aa 100644 --- a/apps/mobile/app/utils/color-scheme/index.js +++ b/apps/mobile/app/utils/color-scheme/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform, StatusBar } from "react-native"; import { AndroidModule } from ".."; import { eSendEvent } from "../../services/event-manager"; diff --git a/apps/mobile/app/utils/color-scheme/utils.js b/apps/mobile/app/utils/color-scheme/utils.js index 2415e3cc7..746f3b3aa 100644 --- a/apps/mobile/app/utils/color-scheme/utils.js +++ b/apps/mobile/app/utils/color-scheme/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Appearance } from "react-native"; import { COLOR_SCHEME, diff --git a/apps/mobile/app/utils/constants.js b/apps/mobile/app/utils/constants.js index 212c6c7a3..42744e126 100644 --- a/apps/mobile/app/utils/constants.js +++ b/apps/mobile/app/utils/constants.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Platform } from "react-native"; import { Monographs } from "../screens/notes/monographs"; diff --git a/apps/mobile/app/utils/events.js b/apps/mobile/app/utils/events.js index 47fadfebc..c6051ce1b 100644 --- a/apps/mobile/app/utils/events.js +++ b/apps/mobile/app/utils/events.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const eOnLoadNote = "500"; export const eOpenActionSheet = "501"; diff --git a/apps/mobile/app/utils/functions.js b/apps/mobile/app/utils/functions.js index cba12a640..aade92e91 100644 --- a/apps/mobile/app/utils/functions.js +++ b/apps/mobile/app/utils/functions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Linking } from "react-native"; import { history } from "."; import { eSendEvent, ToastEvent } from "../services/event-manager"; diff --git a/apps/mobile/app/utils/global-refs.ts b/apps/mobile/app/utils/global-refs.ts index 3300a70e2..811f02e61 100644 --- a/apps/mobile/app/utils/global-refs.ts +++ b/apps/mobile/app/utils/global-refs.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { createNavigationContainerRef } from "@react-navigation/native"; import { createRef } from "react"; import { TextInput, View } from "react-native"; diff --git a/apps/mobile/app/utils/index.js b/apps/mobile/app/utils/index.js index c847b5e14..32c968a8d 100755 --- a/apps/mobile/app/utils/index.js +++ b/apps/mobile/app/utils/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { AppState, Dimensions, NativeModules, Platform } from "react-native"; import { beginBackgroundTask, diff --git a/apps/mobile/app/utils/layout-manager.js b/apps/mobile/app/utils/layout-manager.js index 465843098..b9525e8fb 100644 --- a/apps/mobile/app/utils/layout-manager.js +++ b/apps/mobile/app/utils/layout-manager.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function withAnimation(_duration = 300) { return; } diff --git a/apps/mobile/app/utils/sanitizer/index.js b/apps/mobile/app/utils/sanitizer/index.js index a19e63d14..64ff0c3b9 100644 --- a/apps/mobile/app/utils/sanitizer/index.js +++ b/apps/mobile/app/utils/sanitizer/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*jshint node:true*/ /** diff --git a/apps/mobile/app/utils/size/index.js b/apps/mobile/app/utils/size/index.js index 2722c1234..87256f83e 100644 --- a/apps/mobile/app/utils/size/index.js +++ b/apps/mobile/app/utils/size/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Dimensions, PixelRatio, Platform } from "react-native"; import { DDS } from "../../services/device-detection"; diff --git a/apps/mobile/app/utils/sse/even-source-ios.js b/apps/mobile/app/utils/sse/even-source-ios.js index e7f910108..76715c290 100644 --- a/apps/mobile/app/utils/sse/even-source-ios.js +++ b/apps/mobile/app/utils/sse/even-source-ios.js @@ -1,27 +1,21 @@ -/** - * Copyright (c) 2020 Adam Chelminski +/* This file is part of the Notesnook project (https://notesnook.com/) * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: + * Copyright (C) 2022 Streetwriters (Private) Limited * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - * - * @format + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + "use strict"; import _reactNative from "react-native"; import _eventTargetShim from "event-target-shim"; diff --git a/apps/mobile/app/utils/sse/event-source.js b/apps/mobile/app/utils/sse/event-source.js index 923882f05..65979ba2b 100644 --- a/apps/mobile/app/utils/sse/event-source.js +++ b/apps/mobile/app/utils/sse/event-source.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NativeEventEmitter, NativeModules, Platform } from "react-native"; const NativeEventSource = diff --git a/apps/mobile/app/utils/time/index.ts b/apps/mobile/app/utils/time/index.ts index 18e429513..8a6d5e6e7 100644 --- a/apps/mobile/app/utils/time/index.ts +++ b/apps/mobile/app/utils/time/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const sleep = (duration: number) => new Promise((resolve) => setTimeout(() => resolve(true), duration)); diff --git a/apps/mobile/app/utils/types.ts b/apps/mobile/app/utils/types.ts index a2afde0a9..09636016c 100644 --- a/apps/mobile/app/utils/types.ts +++ b/apps/mobile/app/utils/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // eslint-disable-next-line @typescript-eslint/ban-types export type LiteralUnion = T | (U & {}); diff --git a/apps/mobile/app/version.js b/apps/mobile/app/version.js index cbc930a8f..9595ad40e 100644 --- a/apps/mobile/app/version.js +++ b/apps/mobile/app/version.js @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const APP_VERSION = 217; diff --git a/apps/mobile/e2e/environment.js b/apps/mobile/e2e/environment.js index 46207ddfd..e65279b8f 100644 --- a/apps/mobile/e2e/environment.js +++ b/apps/mobile/e2e/environment.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { DetoxCircusEnvironment, SpecReporter, diff --git a/apps/mobile/e2e/setup.ts b/apps/mobile/e2e/setup.ts index 0d565f10d..3dc604c42 100644 --- a/apps/mobile/e2e/setup.ts +++ b/apps/mobile/e2e/setup.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { device } from "detox"; beforeAll(async () => { diff --git a/apps/mobile/e2e/test.ids.js b/apps/mobile/e2e/test.ids.js index 56b09650b..0886215b7 100644 --- a/apps/mobile/e2e/test.ids.js +++ b/apps/mobile/e2e/test.ids.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const notesnook = { editor: { back: "editor.back", diff --git a/apps/mobile/e2e/tests/auth.e2e.js b/apps/mobile/e2e/tests/auth.e2e.js index 77a470011..d2e52c982 100644 --- a/apps/mobile/e2e/tests/auth.e2e.js +++ b/apps/mobile/e2e/tests/auth.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { tapByText, prepare, diff --git a/apps/mobile/e2e/tests/index.e2e.js b/apps/mobile/e2e/tests/index.e2e.js index 75d92f8e6..7d168f7ca 100644 --- a/apps/mobile/e2e/tests/index.e2e.js +++ b/apps/mobile/e2e/tests/index.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { navigate, tapByText, prepare, sleep } from "./utils"; describe("APP LAUNCH AND NAVIGATION", () => { diff --git a/apps/mobile/e2e/tests/note.e2e.js b/apps/mobile/e2e/tests/note.e2e.js index d46dd16ef..b04332dfb 100644 --- a/apps/mobile/e2e/tests/note.e2e.js +++ b/apps/mobile/e2e/tests/note.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { navigate, diff --git a/apps/mobile/e2e/tests/notebook.e2e.js b/apps/mobile/e2e/tests/notebook.e2e.js index da92be273..33ad3cee8 100644 --- a/apps/mobile/e2e/tests/notebook.e2e.js +++ b/apps/mobile/e2e/tests/notebook.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { tapById, diff --git a/apps/mobile/e2e/tests/search.e2e.js b/apps/mobile/e2e/tests/search.e2e.js index 27bcce52d..04e559c85 100644 --- a/apps/mobile/e2e/tests/search.e2e.js +++ b/apps/mobile/e2e/tests/search.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { tapById, visibleByText, diff --git a/apps/mobile/e2e/tests/sort.e2e.js b/apps/mobile/e2e/tests/sort.e2e.js index 8d4317665..ff6df27f7 100644 --- a/apps/mobile/e2e/tests/sort.e2e.js +++ b/apps/mobile/e2e/tests/sort.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { tapById, diff --git a/apps/mobile/e2e/tests/tag.e2e.js b/apps/mobile/e2e/tests/tag.e2e.js index 08fac85ac..777426087 100644 --- a/apps/mobile/e2e/tests/tag.e2e.js +++ b/apps/mobile/e2e/tests/tag.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { navigate, diff --git a/apps/mobile/e2e/tests/utils.js b/apps/mobile/e2e/tests/utils.js index 6c992001c..7c06613af 100644 --- a/apps/mobile/e2e/tests/utils.js +++ b/apps/mobile/e2e/tests/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { readFileSync } from "fs"; import { expect as jestExpect } from "@jest/globals"; diff --git a/apps/mobile/e2e/tests/vault.e2e.js b/apps/mobile/e2e/tests/vault.e2e.js index d5fa1af22..3169bddba 100644 --- a/apps/mobile/e2e/tests/vault.e2e.js +++ b/apps/mobile/e2e/tests/vault.e2e.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { notesnook } from "../test.ids"; import { tapById, diff --git a/apps/mobile/share/index.js b/apps/mobile/share/index.js index 19da17826..b376e8f17 100644 --- a/apps/mobile/share/index.js +++ b/apps/mobile/share/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { Fragment } from "react"; import { Modal, Platform } from "react-native"; import ShareView from "./share"; diff --git a/apps/mobile/share/quick-note.js b/apps/mobile/share/quick-note.js index bd452b817..aeec8915c 100644 --- a/apps/mobile/share/quick-note.js +++ b/apps/mobile/share/quick-note.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { Component } from "react"; import { Appearance, SafeAreaView } from "react-native"; import RNBootSplash from "react-native-bootsplash"; diff --git a/apps/mobile/share/search.js b/apps/mobile/share/search.js index 2e1d4a1ea..b14ab4154 100644 --- a/apps/mobile/share/search.js +++ b/apps/mobile/share/search.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useRef, useState } from "react"; import { ActivityIndicator, diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.js index dd856891a..bccd032ba 100644 --- a/apps/mobile/share/share.js +++ b/apps/mobile/share/share.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getPreviewData } from "@flyerhq/react-native-link-preview"; import { parseHTML } from "@notesnook/core/utils/htmlparser"; import React, { useEffect, useRef, useState } from "react"; diff --git a/apps/mobile/share/store.js b/apps/mobile/share/store.js index f5ed0296a..32ef74acc 100644 --- a/apps/mobile/share/store.js +++ b/apps/mobile/share/store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Appearance } from "react-native"; import create from "zustand"; import { diff --git a/apps/web/__e2e__/checkout.test.js b/apps/web/__e2e__/checkout.test.js index 8a4ad7c65..0405f85ce 100644 --- a/apps/web/__e2e__/checkout.test.js +++ b/apps/web/__e2e__/checkout.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { getTestId, loginUser } = require("./utils"); diff --git a/apps/web/__e2e__/colors.issues.test.js b/apps/web/__e2e__/colors.issues.test.js index 5205fe99c..38fd9b48f 100644 --- a/apps/web/__e2e__/colors.issues.test.js +++ b/apps/web/__e2e__/colors.issues.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test } = require("@playwright/test"); const { getTestId } = require("./utils"); const { useContextMenu, clickMenuItem } = require("./utils/actions"); diff --git a/apps/web/__e2e__/editor.test.js b/apps/web/__e2e__/editor.test.js index 0be77353d..3145a1b79 100644 --- a/apps/web/__e2e__/editor.test.js +++ b/apps/web/__e2e__/editor.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { createNote, @@ -234,7 +252,7 @@ test.skip("last line doesn't get saved if it's font is different", async () => { test("editing a note and switching immediately to another note and making an edit shouldn't overlap both notes", async ({ page -}, { setTimeout }) => { +}) => { await createNoteAndCheckPresence({ title: "Test note 1", content: "53ad8e4e40ebebd0f400498d" diff --git a/apps/web/__e2e__/importer.test.js b/apps/web/__e2e__/importer.test.js index 18de82f85..2f73ad43b 100644 --- a/apps/web/__e2e__/importer.test.js +++ b/apps/web/__e2e__/importer.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { getTestId, isTestAll, loginUser } = require("./utils"); const path = require("path"); diff --git a/apps/web/__e2e__/navigation.test.js b/apps/web/__e2e__/navigation.test.js index 2771b8f1e..8e4e403c6 100644 --- a/apps/web/__e2e__/navigation.test.js +++ b/apps/web/__e2e__/navigation.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ const { test, expect } = require("@playwright/test"); diff --git a/apps/web/__e2e__/notebooks.issues.test.js b/apps/web/__e2e__/notebooks.issues.test.js index a2c9bd69b..90dfd5ff4 100644 --- a/apps/web/__e2e__/notebooks.issues.test.js +++ b/apps/web/__e2e__/notebooks.issues.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test } = require("@playwright/test"); test.skip("TODO: pin 3 notebooks & make sure they can be unpinned"); test.skip("TODO: pin 4 notebooks & make sure 4th pin shows an error"); diff --git a/apps/web/__e2e__/notebooks.test.js b/apps/web/__e2e__/notebooks.test.js index e98866748..e02f00430 100644 --- a/apps/web/__e2e__/notebooks.test.js +++ b/apps/web/__e2e__/notebooks.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ const { test, expect } = require("@playwright/test"); const { getTestId, createNote, NOTE, NOTEBOOK } = require("./utils"); diff --git a/apps/web/__e2e__/notehistory.test.js b/apps/web/__e2e__/notehistory.test.js index b21dfc3d9..0528a92d6 100644 --- a/apps/web/__e2e__/notehistory.test.js +++ b/apps/web/__e2e__/notehistory.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { NOTE, getTestId, getEditorContent, editNote } = require("./utils"); const { createNoteAndCheckPresence, isPresent } = require("./utils/conditions"); diff --git a/apps/web/__e2e__/notes.issues.test.js b/apps/web/__e2e__/notes.issues.test.js index f2b5e86ba..72b870d3a 100644 --- a/apps/web/__e2e__/notes.issues.test.js +++ b/apps/web/__e2e__/notes.issues.test.js @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test } = require("@playwright/test"); test.skip("TODO: make sure jump to group works"); diff --git a/apps/web/__e2e__/notes.test.js b/apps/web/__e2e__/notes.test.js index b0c392fe8..4d27b43e6 100644 --- a/apps/web/__e2e__/notes.test.js +++ b/apps/web/__e2e__/notes.test.js @@ -1,4 +1,21 @@ -/* eslint-disable react-hooks/rules-of-hooks */ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ /** @@ -89,7 +106,7 @@ async function openLockedNote(noteSelector, title = NOTE.title) { await page.click(getTestId("unlock-note-submit")); } -async function checkNotePinned(noteSelector, pause) { +async function checkNotePinned(noteSelector) { await openContextMenu(noteSelector); await checkMenuItemText("pin", "Unpin"); diff --git a/apps/web/__e2e__/tags.test.js b/apps/web/__e2e__/tags.test.js index 7f197c059..62dd12983 100644 --- a/apps/web/__e2e__/tags.test.js +++ b/apps/web/__e2e__/tags.test.js @@ -1,4 +1,21 @@ -/* eslint-disable react-hooks/rules-of-hooks */ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { getTestId, createNote, NOTE } = require("./utils"); const { @@ -77,11 +94,11 @@ async function renameTag(tagSelector, newTitle, expected) { await checkTagPresence(expected); } -test("create a tag", async ({ page }) => { +test("create a tag", async () => { await createTagAndCheckPresence("helloworld"); }); -test("edit a tag", async ({ page }) => { +test("edit a tag", async () => { const tagSelector = await createTagAndCheckPresence("helloworld"); await renameTag(tagSelector, "new world", "newworld"); diff --git a/apps/web/__e2e__/user.test.js b/apps/web/__e2e__/user.test.js index b0cf2c938..181fe1b34 100644 --- a/apps/web/__e2e__/user.test.js +++ b/apps/web/__e2e__/user.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { test, expect } = require("@playwright/test"); const { getTestId, isTestAll, loginUser, USER } = require("./utils"); const { isAbsent, isPresent } = require("./utils/conditions"); diff --git a/apps/web/__e2e__/utils/actions.js b/apps/web/__e2e__/utils/actions.js index 93a272494..fccb017fe 100644 --- a/apps/web/__e2e__/utils/actions.js +++ b/apps/web/__e2e__/utils/actions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ const { getTestId } = require("./index"); const Menu = require("./menuitemidbuilder"); diff --git a/apps/web/__e2e__/utils/conditions.js b/apps/web/__e2e__/utils/conditions.js index 3cbdd9436..d1a490a64 100644 --- a/apps/web/__e2e__/utils/conditions.js +++ b/apps/web/__e2e__/utils/conditions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ const { expect } = require("@playwright/test"); diff --git a/apps/web/__e2e__/utils/index.js b/apps/web/__e2e__/utils/index.js index f3868fb12..f25e25181 100644 --- a/apps/web/__e2e__/utils/index.js +++ b/apps/web/__e2e__/utils/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-undef */ const fs = require("fs"); const dotenv = require("dotenv"); @@ -78,7 +96,7 @@ async function editNote(title, content, noDelay = false) { } async function downloadFile(downloadActionSelector, encoding) { - return new Promise(async (resolve) => { + return new Promise((resolve) => { page.on("download", async (download) => { const path = await download.path(); resolve(fs.readFileSync(path, { encoding })); diff --git a/apps/web/__e2e__/utils/listitemidbuilder.js b/apps/web/__e2e__/utils/listitemidbuilder.js index 4cc2aaf62..d536a820d 100644 --- a/apps/web/__e2e__/utils/listitemidbuilder.js +++ b/apps/web/__e2e__/utils/listitemidbuilder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { getTestId } = require("."); class ListItemIDBuilder { diff --git a/apps/web/__e2e__/utils/menuitemidbuilder.js b/apps/web/__e2e__/utils/menuitemidbuilder.js index cfffdfa3e..5006184b6 100644 --- a/apps/web/__e2e__/utils/menuitemidbuilder.js +++ b/apps/web/__e2e__/utils/menuitemidbuilder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { getTestId } = require("."); class MenuItemIDBuilder { diff --git a/apps/web/desktop/autoupdate.js b/apps/web/desktop/autoupdate.js index a64c77dff..0cc0ff578 100644 --- a/apps/web/desktop/autoupdate.js +++ b/apps/web/desktop/autoupdate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { autoUpdater } = require("electron-updater"); const { EVENTS } = require("./events"); const { sendMessageToRenderer } = require("./ipc/utils"); diff --git a/apps/web/desktop/changelog.js b/apps/web/desktop/changelog.js index ade346d2c..43cae3c99 100644 --- a/apps/web/desktop/changelog.js +++ b/apps/web/desktop/changelog.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const showdown = require("showdown"); var converter = new showdown.Converter(); diff --git a/apps/web/desktop/config/theme.js b/apps/web/desktop/config/theme.js index 746120b8b..95834dc13 100644 --- a/apps/web/desktop/config/theme.js +++ b/apps/web/desktop/config/theme.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const JSONStorage = require("../jsonstorage"); const { nativeTheme } = require("electron"); diff --git a/apps/web/desktop/config/windowstate.js b/apps/web/desktop/config/windowstate.js index 947182d45..423587de1 100644 --- a/apps/web/desktop/config/windowstate.js +++ b/apps/web/desktop/config/windowstate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const JSONStorage = require("../jsonstorage"); const electron = require("electron"); const screen = electron.screen || electron.remote.screen; @@ -109,7 +127,9 @@ class WindowState { this.state.isMaximized = win.isMaximized(); this.state.isFullScreen = win.isFullScreen(); this.state.displayBounds = screen.getDisplayMatching(winBounds).bounds; - } catch (err) {} + } catch (err) { + console.error(err); + } } saveState(win) { diff --git a/apps/web/desktop/config/zoomfactor.js b/apps/web/desktop/config/zoomfactor.js index 8cee836e5..69cd2b450 100644 --- a/apps/web/desktop/config/zoomfactor.js +++ b/apps/web/desktop/config/zoomfactor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const JSONStorage = require("../jsonstorage"); function getZoomFactor() { diff --git a/apps/web/desktop/electron.js b/apps/web/desktop/electron.js index b7231c0f3..7f668d2e1 100644 --- a/apps/web/desktop/electron.js +++ b/apps/web/desktop/electron.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + require("isomorphic-fetch"); const { app, BrowserWindow, nativeTheme, shell } = require("electron"); const path = require("path"); @@ -16,7 +34,9 @@ const { EVENTS } = require("./events"); require("./ipc/index.js"); try { require("electron-reloader")(module); -} catch (_) {} +} catch (_) { + // ignore +} // only run a single instance if (!app.requestSingleInstanceLock()) { diff --git a/apps/web/desktop/events.js b/apps/web/desktop/events.js index 483f5f96d..02686ccfe 100644 --- a/apps/web/desktop/events.js +++ b/apps/web/desktop/events.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + module.exports.EVENTS = { checkingForUpdate: "checkingForUpdate", updateAvailable: "updateAvailable", diff --git a/apps/web/desktop/ipc/actions/changeAppTheme.js b/apps/web/desktop/ipc/actions/changeAppTheme.js index 0eb67d4e5..dc0fe94b2 100644 --- a/apps/web/desktop/ipc/actions/changeAppTheme.js +++ b/apps/web/desktop/ipc/actions/changeAppTheme.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { setTheme } = require("../../config/theme"); module.exports = (args) => { diff --git a/apps/web/desktop/ipc/actions/checkForUpdate.js b/apps/web/desktop/ipc/actions/checkForUpdate.js index 1a68d3c4f..dd4435303 100644 --- a/apps/web/desktop/ipc/actions/checkForUpdate.js +++ b/apps/web/desktop/ipc/actions/checkForUpdate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { autoUpdater } = require("electron-updater"); module.exports = () => { diff --git a/apps/web/desktop/ipc/actions/downloadUpdate.js b/apps/web/desktop/ipc/actions/downloadUpdate.js index 25a530509..a6421ac4f 100644 --- a/apps/web/desktop/ipc/actions/downloadUpdate.js +++ b/apps/web/desktop/ipc/actions/downloadUpdate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { CancellationToken } = require("builder-util-runtime"); const { autoUpdater } = require("electron-updater"); const { EVENTS } = require("../../events"); diff --git a/apps/web/desktop/ipc/actions/index.js b/apps/web/desktop/ipc/actions/index.js index c56f13104..fe7d9b7f6 100644 --- a/apps/web/desktop/ipc/actions/index.js +++ b/apps/web/desktop/ipc/actions/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const changeAppTheme = require("./changeAppTheme"); const checkForUpdate = require("./checkForUpdate"); const downloadUpdate = require("./downloadUpdate"); diff --git a/apps/web/desktop/ipc/actions/installUpdate.js b/apps/web/desktop/ipc/actions/installUpdate.js index 84d56dda1..8a447cca2 100644 --- a/apps/web/desktop/ipc/actions/installUpdate.js +++ b/apps/web/desktop/ipc/actions/installUpdate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { autoUpdater } = require("electron-updater"); module.exports = () => { diff --git a/apps/web/desktop/ipc/actions/open.js b/apps/web/desktop/ipc/actions/open.js index bf03256c1..00ee84a88 100644 --- a/apps/web/desktop/ipc/actions/open.js +++ b/apps/web/desktop/ipc/actions/open.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { shell } = require("electron"); const { resolvePath } = require("../utils"); module.exports = (args) => { diff --git a/apps/web/desktop/ipc/actions/saveFile.js b/apps/web/desktop/ipc/actions/saveFile.js index 62e99f096..0c290641a 100644 --- a/apps/web/desktop/ipc/actions/saveFile.js +++ b/apps/web/desktop/ipc/actions/saveFile.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const fs = require("fs"); const path = require("path"); const { logger } = require("../../logger"); diff --git a/apps/web/desktop/ipc/actions/setZoomFactor.js b/apps/web/desktop/ipc/actions/setZoomFactor.js index b914fc315..e4360d4ac 100644 --- a/apps/web/desktop/ipc/actions/setZoomFactor.js +++ b/apps/web/desktop/ipc/actions/setZoomFactor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { setZoomFactor } = require("../../config/zoomfactor"); module.exports = (args) => { diff --git a/apps/web/desktop/ipc/calls/getZoomFactor.js b/apps/web/desktop/ipc/calls/getZoomFactor.js index 6bc0f4d4f..77ea53fd8 100644 --- a/apps/web/desktop/ipc/calls/getZoomFactor.js +++ b/apps/web/desktop/ipc/calls/getZoomFactor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { getZoomFactor } = require("../../config/zoomfactor"); module.exports = function () { diff --git a/apps/web/desktop/ipc/calls/index.js b/apps/web/desktop/ipc/calls/index.js index 1450156eb..e460945d7 100644 --- a/apps/web/desktop/ipc/calls/index.js +++ b/apps/web/desktop/ipc/calls/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const getZoomFactor = require("./getZoomFactor"); const selectDirectory = require("./selectDirectory"); diff --git a/apps/web/desktop/ipc/calls/selectDirectory.js b/apps/web/desktop/ipc/calls/selectDirectory.js index c8f99554a..e4e4d1d07 100644 --- a/apps/web/desktop/ipc/calls/selectDirectory.js +++ b/apps/web/desktop/ipc/calls/selectDirectory.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { dialog } = require("electron"); const { resolvePath } = require("../utils"); diff --git a/apps/web/desktop/ipc/index.js b/apps/web/desktop/ipc/index.js index 070399746..9ef92be52 100644 --- a/apps/web/desktop/ipc/index.js +++ b/apps/web/desktop/ipc/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { ipcMain } = require("electron"); const { logger } = require("../logger"); const { getAction } = require("./actions"); diff --git a/apps/web/desktop/ipc/utils.js b/apps/web/desktop/ipc/utils.js index a24a073d6..644b7c7c5 100644 --- a/apps/web/desktop/ipc/utils.js +++ b/apps/web/desktop/ipc/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { logger } = require("../logger"); const { app } = require("electron"); const path = require("path"); @@ -16,9 +34,10 @@ function resolvePath(_path) { let resolved = segment; try { resolved = app.getPath(resolved); - } finally { - return resolved; + } catch (e) { + // ignore } + return resolved; }) ); } diff --git a/apps/web/desktop/jsonstorage/index.js b/apps/web/desktop/jsonstorage/index.js index 66887d65a..d1a33ce19 100644 --- a/apps/web/desktop/jsonstorage/index.js +++ b/apps/web/desktop/jsonstorage/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const fs = require("fs"); const { app } = require("electron"); const path = require("path"); diff --git a/apps/web/desktop/logger.js b/apps/web/desktop/logger.js index 0c353be68..3ec389257 100644 --- a/apps/web/desktop/logger.js +++ b/apps/web/desktop/logger.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { app } = require("electron"); const { diary, enable, default_reporter } = require("diary"); const fs = require("fs"); diff --git a/apps/web/desktop/menu.js b/apps/web/desktop/menu.js index ce2967a8d..4afb2d617 100644 --- a/apps/web/desktop/menu.js +++ b/apps/web/desktop/menu.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { Menu, MenuItem, clipboard } = require("electron"); /** diff --git a/apps/web/desktop/paths.js b/apps/web/desktop/paths.js index 706293946..0c4ad3854 100644 --- a/apps/web/desktop/paths.js +++ b/apps/web/desktop/paths.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + module.exports.PATHS = { backupsDirectory: "documents/Notesnook/backups", logsDirectory: "logs/" diff --git a/apps/web/desktop/preload.js b/apps/web/desktop/preload.js index 2d41f68cc..bdd4ca550 100644 --- a/apps/web/desktop/preload.js +++ b/apps/web/desktop/preload.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { contextBridge, ipcRenderer } = require("electron"); // Expose protected methods that allow the renderer process to use diff --git a/apps/web/desktop/protocol.js b/apps/web/desktop/protocol.js index ee578dcbf..8dd4d7428 100644 --- a/apps/web/desktop/protocol.js +++ b/apps/web/desktop/protocol.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { protocol } = require("electron"); const { isDevelopment, getPath } = require("./utils"); const fs = require("fs"); diff --git a/apps/web/desktop/scripts/removeLocales.js b/apps/web/desktop/scripts/removeLocales.js index 758f0073f..214b7b65b 100644 --- a/apps/web/desktop/scripts/removeLocales.js +++ b/apps/web/desktop/scripts/removeLocales.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + //https://www.electron.build/configuration/configuration#afterpack exports.default = async function (context) { //console.log(context) diff --git a/apps/web/desktop/utils.js b/apps/web/desktop/utils.js index 945937f86..b8e1c545b 100644 --- a/apps/web/desktop/utils.js +++ b/apps/web/desktop/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { app } = require("electron"); const path = require("path"); const fs = require("fs"); @@ -23,7 +41,9 @@ function getPath(filePath) { if (result.isDirectory()) { return getPath(path.join(filePath, "index.html")); } - } catch (_) {} + } catch (_) { + // ignore + } } module.exports = { getPath, isDevelopment }; diff --git a/apps/web/package.json b/apps/web/package.json index 1118cd775..b16b02fe1 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -71,8 +71,6 @@ "@types/react": "17.0.2", "@types/react-dom": "17.0.2", "@types/react-modal": "^3.13.1", - "@types/rebass": "^4.0.10", - "@types/rebass__forms": "^4.0.6", "buffer": "^6.0.3", "chalk": "^4.1.0", "dotenv": "^10.0.0", diff --git a/apps/web/playwright.config.js b/apps/web/playwright.config.js index 952c4f82b..7cfa1f820 100644 --- a/apps/web/playwright.config.js +++ b/apps/web/playwright.config.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const IS_CI = !!process.env.CI; const projects = IS_CI diff --git a/apps/web/public/diff.worker.js b/apps/web/public/diff.worker.js deleted file mode 100644 index 1f2fec0b3..000000000 --- a/apps/web/public/diff.worker.js +++ /dev/null @@ -1,892 +0,0 @@ -/* eslint-disable no-restricted-globals */ -/* - * htmldiff.js is a library that compares HTML content. It creates a diff between two - * HTML documents by combining the two documents and wrapping the differences with - * and tags. Here is a high-level overview of how the diff works. - * - * 1. Tokenize the before and after HTML with html_to_tokens. - * 2. Generate a list of operations that convert the before list of tokens to the after - * list of tokens with calculate_operations, which does the following: - * a. Find all the matching blocks of tokens between the before and after lists of - * tokens with find_matching_blocks. This is done by finding the single longest - * matching block with find_match, then recursively finding the next longest - * matching block that precede and follow the longest matching block with - * recursively_find_matching_blocks. - * b. Determine insertions, deletions, and replacements from the matching blocks. - * This is done in calculate_operations. - * 3. Render the list of operations by wrapping tokens with and tags where - * appropriate with render_operations. - * - * Example usage: - * - * var htmldiff = require('htmldiff.js'); - * - * htmldiff('

this is some text

', '

this is some more text

') - * == '

this is some more text

' - * - * htmldiff('

this is some text

', '

this is some more text

', 'diff-class') - * == '

this is some more text

' - */ - -function is_start_of_tag(char) { - return char === "<"; -} -const IS_CLOSE_TAG_REGEX = /^\s*<\s*\/[^>]+>\s*$/; -function is_close_tag(tag) { - return IS_CLOSE_TAG_REGEX.test(tag); -} - -const IS_TAG_REGEX = /^\s*<[^>]+>\s*$/; -function is_tag(token) { - return IS_TAG_REGEX.test(token); -} - -function isnt_tag(token) { - return !is_tag(token); -} - -/* - * Checks if the current word is the beginning of an atomic tag. An atomic tag is one whose - * child nodes should not be compared - the entire tag should be treated as one token. This - * is useful for tags where it does not make sense to insert and tags. - * - * @param {string} word The characters of the current token read so far. - * - * @return {string|null} The name of the atomic tag if the word will be an atomic tag, - * null otherwise - */ -const IS_START_ATOMIC_TAG = /^<(iframe|object|math|svg|script)/; -function is_start_of_atomic_tag(word) { - var result = IS_START_ATOMIC_TAG.exec(word); - if (result) { - result = result[1]; - } - return result; -} - -/* - * Checks if a tag is a void tag. - * - * @param {string} token The token to check. - * - * @return {boolean} True if the token is a void tag, false otherwise. - */ -const IS_VOID_TAG_REGEX = /^\s*<[^>]+\/>\s*$/; -function is_void_tag(token) { - return IS_VOID_TAG_REGEX.test(token); -} - -/* - * Checks if a token can be wrapped inside a tag. - * - * @param {string} token The token to check. - * - * @return {boolean} True if the token can be wrapped inside a tag, false otherwise. - */ -function is_wrappable(token) { - return isnt_tag(token) || is_start_of_atomic_tag(token) || is_void_tag(token); -} - -/* - * A Match stores the information of a matching block. A matching block is a list of - * consecutive tokens that appear in both the before and after lists of tokens. - * - * @param {number} start_in_before The index of the first token in the list of before tokens. - * @param {number} start_in_after The index of the first token in the list of after tokens. - * @param {number} length The number of consecutive matching tokens in this block. - */ -function Match(start_in_before, start_in_after, length) { - this.start_in_before = start_in_before; - this.start_in_after = start_in_after; - this.length = length; - this.end_in_before = this.start_in_before + this.length - 1; - this.end_in_after = this.start_in_after + this.length - 1; -} - -function return_dual_pane(before, after) { - return { - before: before, - after: after - }; -} - -/* - * Merge tokens in component by regex rule. - * - * @param {find_regex} dictate witch tag we want to merge. - * @param {words Array.} input data already parsed array(html tags) by html_tokens method. - * @return {Array.} The list of tokens with merged components requested by component_search_role. - */ -function merge_html_by_class(find_regex, words) { - var merged_words_array = [], - merged_words_to_string = "", - count_open_tags = 0; - - for (var i = 0; i < words.length; i++) { - var tag_part = words[i]; - //merge html tags until parent tag is not closed (also ignore self closed html tags) - if (count_open_tags > 0 || find_regex.test(tag_part)) { - if ( - is_start_of_tag(tag_part.slice(0, 1)) && - !is_void_tag(tag_part) && - !is_start_of_atomic_tag(tag_part) - ) { - count_open_tags += is_close_tag(tag_part) ? -1 : 1; - } - //combine all html string from html tokens while all condition are true - merged_words_to_string += tag_part; - //after parent tag is closed push as one html token - if (count_open_tags === 0) { - merged_words_array.push(merged_words_to_string); - merged_words_to_string = ""; - } - } else { - //all tags that are not part of components we wont to merge just ignore - merged_words_array.push(tag_part); - } - } - return merged_words_array; -} - -/* - * Tokenizes a string of HTML. - * - * @param {string} html The string to tokenize. - * - * @return {Array.} The list of tokens. - */ - -function html_to_tokens(html, components_search_rule) { - let words = []; - const range = { - start: 0, - end: 0, - tagOpen: false, - whitespaceOpen: false, - ampersandOpen: false - }; - for (var i = 0; i < html.length; ++i) { - const s = html[i]; - - if (s === " " || s === "\n" || s === "\r" || s === "\t") { - if (range.tagOpen || range.whitespaceOpen) continue; - - //range.end = i; - if (range.start !== i) words.push(html.slice(range.start, i)); - - range.whitespaceOpen = true; - range.start = i; - } else if (range.whitespaceOpen) { - range.whitespaceOpen = false; - // range.end = i; - words.push(html.slice(range.start, i)); - range.start = i; - } - - if (s === "<") { - range.tagOpen = true; - - if (range.start !== i) { - words.push(html.slice(range.start, i)); - } - - range.start = i; - } else if (s === ">") { - range.tagOpen = false; - words.push(html.slice(range.start, i + 1)); - range.start = i + 1; - } else if (!range.ampersandOpen && s === "&") { - range.ampersandOpen = true; - if (range.start !== i) words.push(html.slice(range.start, i)); - range.start = i; - } else if (range.ampersandOpen && s === ";") { - range.ampersandOpen = false; - words.push(html.slice(range.start, i + 1)); - range.start = i + 1; - } - } - if (range.start !== html.length) { - words.push(html.slice(range.start, html.length)); - } - - return components_search_rule - ? merge_html_by_class(components_search_rule, words) - : words; -} - -/* - * Creates a key that should be used to match tokens. This is useful, for example, if we want - * to consider two open tag tokens as equal, even if they don't have the same attributes. We - * use a key instead of overwriting the token because we may want to render the original string - * without losing the attributes. - * - * @param {string} token The token to create the key for. - * - * @return {string} The identifying key that should be used to match before and after tokens. - */ -function get_key_for_token(token) { - var tag_name = /<([^\s>]+)[\s>]/.exec(token); - if (tag_name) { - return "<" + tag_name[1].toLowerCase() + ">"; - } - if (token) { - return token.replace(/(\s+| | )/g, " "); - } - return token; -} - -/* - * Finds the matching block with the most consecutive tokens within the given range in the - * before and after lists of tokens. - * - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * @param {Object} index_of_before_locations_in_after_tokens The index that is used to search - * for tokens in the after list. - * @param {number} start_in_before The beginning of the range in the list of before tokens. - * @param {number} end_in_before The end of the range in the list of before tokens. - * @param {number} start_in_after The beginning of the range in the list of after tokens. - * @param {number} end_in_after The end of the range in the list of after tokens. - * - * @return {Match} A Match that describes the best matching block in the given range. - */ - -function find_match( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - start_in_before, - end_in_before, - start_in_after, - end_in_after -) { - var best_match_in_before = start_in_before; - var best_match_in_after = start_in_after; - var best_match_length = 0; - var match_length_at = {}; - - for ( - var index_in_before = start_in_before; - index_in_before < end_in_before; - index_in_before++ - ) { - var new_match_length_at = {}; - var looking_for = get_key_for_token(before_tokens[index_in_before]); - - var locations_in_after = - index_of_before_locations_in_after_tokens[looking_for]; - - for (var i = 0; i < locations_in_after.length; i++) { - var index_in_after = locations_in_after[i]; - if (index_in_after < start_in_after) continue; - if (index_in_after >= end_in_after) break; - - if (!match_length_at[index_in_after - 1]) { - match_length_at[index_in_after - 1] = 0; - } - var new_match_length = match_length_at[index_in_after - 1] + 1; - new_match_length_at[index_in_after] = new_match_length; - - if (new_match_length > best_match_length) { - best_match_in_before = index_in_before - new_match_length + 1; - best_match_in_after = index_in_after - new_match_length + 1; - best_match_length = new_match_length; - } - } - - match_length_at = new_match_length_at; - } - if (best_match_length !== 0) { - return new Match( - best_match_in_before, - best_match_in_after, - best_match_length - ); - } - return null; -} - -/* - * Finds all the matching blocks within the given range in the before and after lists of - * tokens. This function is called recursively to find the next best matches that precede - * and follow the first best match. - * - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * @param {Object} index_of_before_locations_in_after_tokens The index that is used to search - * for tokens in the after list. - * @param {number} start_in_before The beginning of the range in the list of before tokens. - * @param {number} end_in_before The end of the range in the list of before tokens. - * @param {number} start_in_after The beginning of the range in the list of after tokens. - * @param {number} end_in_after The end of the range in the list of after tokens. - * @param {Array.} matching_blocks The list of matching blocks found so far. - * - * @return {Array.} The list of matching blocks in this range. - */ -function recursively_find_matching_blocks( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - start_in_before, - end_in_before, - start_in_after, - end_in_after, - matching_blocks -) { - var match = find_match( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - start_in_before, - end_in_before, - start_in_after, - end_in_after - ); - if (match) { - if ( - start_in_before < match.start_in_before && - start_in_after < match.start_in_after - ) { - recursively_find_matching_blocks( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - start_in_before, - match.start_in_before, - start_in_after, - match.start_in_after, - matching_blocks - ); - } - matching_blocks.push(match); - if ( - match.end_in_before <= end_in_before && - match.end_in_after <= end_in_after - ) { - recursively_find_matching_blocks( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - match.end_in_before + 1, - end_in_before, - match.end_in_after + 1, - end_in_after, - matching_blocks - ); - } - } - return matching_blocks; -} - -/* - * Creates an index (A.K.A. hash table) that will be used to match the list of before - * tokens with the list of after tokens. - * - * @param {Object} options An object with the following: - * - {Array.} find_these The list of tokens that will be used to search. - * - {Array.} in_these The list of tokens that will be returned. - * - * @return {Object} An index that can be used to search for tokens. - */ -function create_index(options) { - if (!options.find_these) { - throw new Error("params must have find_these key"); - } - if (!options.in_these) { - throw new Error("params must have in_these key"); - } - var queries = options.find_these.map(function (token) { - return get_key_for_token(token); - }); - var results = options.in_these.map(function (token) { - return get_key_for_token(token); - }); - var index = {}; - for (var i = 0; i < queries.length; i++) { - var query = queries[i]; - index[query] = []; - } - - results.forEach((item, i) => { - const array = index[item]; - if (array) array.push(i); - }); - return index; -} - -/* - * Finds all the matching blocks in the before and after lists of tokens. This function - * is a wrapper for the recursive function recursively_find_matching_blocks. - * - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * - * @return {Array.} The list of matching blocks. - */ -function find_matching_blocks(before_tokens, after_tokens) { - var matching_blocks = []; - - var index_of_before_locations_in_after_tokens = create_index({ - find_these: before_tokens, - in_these: after_tokens - }); - - return recursively_find_matching_blocks( - before_tokens, - after_tokens, - index_of_before_locations_in_after_tokens, - 0, - before_tokens.length, - 0, - after_tokens.length, - matching_blocks - ); -} - -/* - * Gets a list of operations required to transform the before list of tokens into the - * after list of tokens. An operation describes whether a particular list of consecutive - * tokens are equal, replaced, inserted, or deleted. - * - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * - * @return {Array.} The list of operations to transform the before list of - * tokens into the after list of tokens, where each operation has the following - * keys: - * - {string} action One of {'replace', 'insert', 'delete', 'equal'}. - * - {number} start_in_before The beginning of the range in the list of before tokens. - * - {number} end_in_before The end of the range in the list of before tokens. - * - {number} start_in_after The beginning of the range in the list of after tokens. - * - {number} end_in_after The end of the range in the list of after tokens. - */ -function calculate_operations(before_tokens, after_tokens) { - if (!before_tokens) { - throw new Error("before_tokens?"); - } - if (!after_tokens) { - throw new Error("after_tokens?"); - } - - var position_in_before = 0; - var position_in_after = 0; - var operations = []; - var action_map = { - "false,false": "replace", - "true,false": "insert", - "false,true": "delete", - "true,true": "none" - }; - var matches = find_matching_blocks(before_tokens, after_tokens); - matches.push(new Match(before_tokens.length, after_tokens.length, 0)); - - for (var index = 0; index < matches.length; index++) { - var match = matches[index]; - var match_starts_at_current_position_in_before = - position_in_before === match.start_in_before; - var match_starts_at_current_position_in_after = - position_in_after === match.start_in_after; - var action_up_to_match_positions = - action_map[ - [ - match_starts_at_current_position_in_before, - match_starts_at_current_position_in_after - ].toString() - ]; - if (action_up_to_match_positions !== "none") { - operations.push({ - action: action_up_to_match_positions, - start_in_before: position_in_before, - end_in_before: - action_up_to_match_positions !== "insert" - ? match.start_in_before - 1 - : void 0, - start_in_after: position_in_after, - end_in_after: - action_up_to_match_positions !== "delete" - ? match.start_in_after - 1 - : void 0 - }); - } - if (match.length !== 0) { - operations.push({ - action: "equal", - start_in_before: match.start_in_before, - end_in_before: match.end_in_before, - start_in_after: match.start_in_after, - end_in_after: match.end_in_after - }); - } - position_in_before = match.end_in_before + 1; - position_in_after = match.end_in_after + 1; - } - - var post_processed = []; - var last_op = { - action: "none" - }; - - function is_single_whitespace(op) { - if (op.action !== "equal") { - return false; - } - if (op.end_in_before - op.start_in_before !== 0) { - return false; - } - return /^\s$/.test( - before_tokens.slice(op.start_in_before, op.end_in_before + 1) - ); - } - - for (var i = 0; i < operations.length; i++) { - var op = operations[i]; - - if ( - (is_single_whitespace(op) && last_op.action === "replace") || - (op.action === "replace" && last_op.action === "replace") - ) { - last_op.end_in_before = op.end_in_before; - last_op.end_in_after = op.end_in_after; - } else { - post_processed.push(op); - last_op = op; - } - } - return post_processed; -} - -/* - * Returns a list of tokens of a particular type starting at a given index. - * - * @param {number} start The index of first token to test. - * @param {Array.} content The list of tokens. - * @param {function} predicate A function that returns true if a token is of - * a particular type, false otherwise. It should accept the following - * parameters: - * - {string} The token to test. - */ -function consecutive_where(start, content, predicate) { - content = content.slice(start, content.length + 1); - var last_matching_index = null; - - for (var index = 0; index < content.length; index++) { - var token = content[index]; - var answer = predicate(token); - - if (answer === true) { - last_matching_index = index; - } - if (answer === false) { - break; - } - } - - if (last_matching_index !== null) { - return content.slice(0, last_matching_index + 1); - } - return []; -} - -/* - * Wraps and concatenates a list of tokens with a tag. Does not wrap tag tokens, - * unless they are wrappable (i.e. void and atomic tags). - * - * @param {sting} tag The tag name of the wrapper tags. - * @param {Array.} content The list of tokens to wrap. - * @param {string} class_name (Optional) The class name to include in the wrapper tag. - */ -function wrap(tag, content, class_name) { - var rendering = ""; - var position = 0; - var length = content.length; - - while (true) { - if (position >= length) break; - var non_tags = consecutive_where(position, content, is_wrappable); - position += non_tags.length; - if (non_tags.length !== 0) { - var val = non_tags.join(""); - if (val.trim()) { - rendering += `${val}`; - } - } - - if (position >= length) break; - var tags = consecutive_where(position, content, is_tag); - position += tags.length; - rendering += tags.join(""); - } - return rendering; -} - -/* - * op_map.equal/insert/delete/replace are functions that render an operation into - * HTML content. - * - * @param {Object} op The operation that applies to a prticular list of tokens. Has the - * following keys: - * - {string} action One of {'replace', 'insert', 'delete', 'equal'}. - * - {number} start_in_before The beginning of the range in the list of before tokens. - * - {number} end_in_before The end of the range in the list of before tokens. - * - {number} start_in_after The beginning of the range in the list of after tokens. - * - {number} end_in_after The end of the range in the list of after tokens. - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * @param {string} class_name (Optional) The class name to include in the wrapper tag. - * - * @return {string} The rendering of that operation. - */ -var op_map = { - equal: function (op, before_tokens, after_tokens, class_name) { - return after_tokens.slice(op.start_in_after, op.end_in_after + 1).join(""); - }, - insert: function (op, before_tokens, after_tokens, class_name) { - var val = after_tokens.slice(op.start_in_after, op.end_in_after + 1); - return wrap("ins", val, class_name); - }, - delete: function (op, before_tokens, after_tokens, class_name) { - var val = before_tokens.slice(op.start_in_before, op.end_in_before + 1); - return wrap("del", val, class_name); - } -}; - -op_map.replace = function (op, before_tokens, after_tokens, class_name) { - return [ - op_map["delete"](op, before_tokens, after_tokens, class_name), - op_map.insert(op, before_tokens, after_tokens, class_name) - ]; -}; - -/* - * Renders a list of operations into HTML content. The result is the combined version - * of the before and after tokens with the differences wrapped in tags. - * - * @param {Array.} before_tokens The before list of tokens. - * @param {Array.} after_tokens The after list of tokens. - * @param {Array.} operations The list of operations to transform the before - * list of tokens into the after list of tokens, where each operation has the - * following keys: - * - {string} action One of {'replace', 'insert', 'delete', 'equal'}. - * - {number} start_in_before The beginning of the range in the list of before tokens. - * - {number} end_in_before The end of the range in the list of before tokens. - * - {number} start_in_after The beginning of the range in the list of after tokens. - * - {number} end_in_after The end of the range in the list of after tokens. - * @param {string} class_name (Optional) The class name to include in the wrapper tag. - * - * @return {string} The rendering of the list of operations. - */ -function render_operations( - before_tokens, - after_tokens, - operations, - class_name -) { - var rendering = ""; - for (var i = 0; i < operations.length; i++) { - var op = operations[i]; - const result = op_map[op.action]( - op, - before_tokens, - after_tokens, - class_name - ); - if (op.action === "replace") { - rendering += result[0] + result[1]; - } else { - rendering += result; - } - } - return rendering; -} - -/** - * htmldiff thinks that atomic or component objects are equal if their tag names are the same, because of it
===
for example - * this function compares them - */ -function render_equal_components( - before, - after, - ops, - class_name, - components_search_rule -) { - var i, j, r, attrs; - var op; - var amount; - var before_token, after_token; - var before_token_match, after_token_match; - for (i = 0; i < ops.length; i++) { - op = ops[i]; - if (op.action === "equal") { - amount = op.end_in_before - op.start_in_before + 1; // +1 since the array is 0 based - for (j = 0; j < amount; j++) { - before_token = before[op.start_in_before + j]; - after_token = after[op.start_in_after + j]; - if (before_token !== after_token) { - before_token_match = components_search_rule.exec(before_token); - after_token_match = components_search_rule.exec(after_token); - if (before_token_match && after_token_match) { - if ( - before_token_match[1].toLowerCase() === - after_token_match[1].toLowerCase() - ) { - // compare content of these two same components - r = diff(before_token, after_token, class_name); - after[op.start_in_after + j] = r; - } else { - // components are different, wrap before by 'del' and after by 'ins' - attrs = class_name ? ' class="' + class_name + '"' : ""; - r = - "" + - before_token + - "" + - "" + - after_token + - ""; - after[op.start_in_after + j] = r; - } - } - } - } - } - } -} - -/* - * Compares two pieces of HTML content and returns the combined content with differences - * wrapped in and tags. - * - * @param {string} before The HTML content before the changes. - * @param {string} after The HTML content after the changes. - * @param {string} class_name (Optional) The class attribute to include in and tags. - * - * @return {string} The combined HTML content with differences wrapped in and tags. - */ -function diff(before, after, class_name, components_search_rule) { - if (before === after) return before; - before = html_to_tokens(before, components_search_rule); - after = html_to_tokens(after, components_search_rule); - var ops = calculate_operations(before, after); - - if (components_search_rule) { - render_equal_components( - before, - after, - ops, - class_name, - components_search_rule - ); - } - - return render_operations(before, after, ops, class_name); -} - -function render_operations_dual_pane(before_tokens, after_tokens, operations) { - var after_render, before_render, next_block, op, _i, _len; - before_render = ""; - after_render = ""; - for (_i = 0, _len = operations.length; _i < _len; _i++) { - op = operations[_i]; - next_block = op_map[op.action](op, before_tokens, after_tokens); - switch (op.action) { - case "equal": - before_render += next_block; - after_render += next_block; - break; - case "insert": - after_render += next_block; - break; - case "delete": - before_render += next_block; - break; - case "replace": - before_render += next_block[0]; - after_render += next_block[1]; - break; - default: - continue; - } - } - return return_dual_pane(before_render, after_render); -} - -function diff_dual_pane(before, after) { - if (!before || !after) return { before, after }; - - var ops; - if (before === after) { - return return_dual_pane(before, after); - } - before = html_to_tokens(before); - after = html_to_tokens(after); - ops = calculate_operations(before, after); - return render_operations_dual_pane(before, after, ops); -} - -diff.html_to_tokens = html_to_tokens; -diff.merge_html_by_class = merge_html_by_class; -diff.find_matching_blocks = find_matching_blocks; - -find_matching_blocks.find_match = find_match; -find_matching_blocks.create_index = create_index; -find_matching_blocks.get_key_for_token = get_key_for_token; - -diff.calculate_operations = calculate_operations; -diff.render_operations = render_operations; -diff.diff_dual_pane = diff_dual_pane; - -diff.clean = function (html) { - const tokens = html_to_tokens(html); - let isDiffSpanOpen = false; - return tokens.reduce((result, token) => { - if (token.includes(`span class="diff-`)) { - isDiffSpanOpen = true; - return result; - } else if (isDiffSpanOpen && token.includes("")) { - isDiffSpanOpen = false; - return result; - } - return result + token; - }, ""); -}; - -if (self.document) { - self.htmlDiff = diff; -} else { - self.addEventListener("message", onMessage); -} - -function onMessage(ev) { - const { type, data, messageId } = ev.data; - try { - switch (type) { - case "generate": { - const { before, after } = data; - const result = diff.diff_dual_pane(before, after); - sendMessage("generate", result, messageId); - break; - } - case "clean": { - const { html } = data; - const cleanHtml = diff.clean(html); - sendMessage("clean", cleanHtml, messageId); - break; - } - default: - return; - } - } catch (error) { - console.error("Crypto worker error:", error, messageId, type); - sendMessage(type, { error: error.message }, messageId); - } -} - -function sendMessage(type, data, messageId) { - postMessage({ type, data, messageId }); -} diff --git a/apps/web/scripts/analyze.js b/apps/web/scripts/analyze.js index 969249969..e50d33e6d 100644 --- a/apps/web/scripts/analyze.js +++ b/apps/web/scripts/analyze.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + process.env.NODE_ENV = "production"; const webpack = require("webpack"); diff --git a/apps/web/src/app-effects.js b/apps/web/src/app-effects.js index 858df1301..e5a05f856 100644 --- a/apps/web/src/app-effects.js +++ b/apps/web/src/app-effects.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect } from "react"; import { useStore } from "./stores/app-store"; import { useStore as useUserStore } from "./stores/user-store"; diff --git a/apps/web/src/app-effects.mobile.js b/apps/web/src/app-effects.mobile.js index 7f4b0da21..784e39e9e 100644 --- a/apps/web/src/app-effects.mobile.js +++ b/apps/web/src/app-effects.mobile.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect } from "react"; import { useStore } from "./stores/app-store"; import useSlider from "./hooks/use-slider"; @@ -14,7 +32,7 @@ export default function MobileAppEffects({ sliderId, overlayId, setShow }) { const isFocusMode = useStore((store) => store.isFocusMode); const [slideToIndex] = useSlider(sliderId, { - onSliding: (e, { lastSlide, position, lastPosition }) => { + onSliding: (_e, { position }) => { if (!isMobile) return; const offset = 70; const width = 300; diff --git a/apps/web/src/app.js b/apps/web/src/app.js index ca77bff0b..6e1a9be92 100644 --- a/apps/web/src/app.js +++ b/apps/web/src/app.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useState, Suspense, useMemo, useRef, useEffect } from "react"; import { Box, Flex } from "@streetwriters/rebass"; import ThemeProvider from "./components/theme-provider"; diff --git a/apps/web/src/commands/change-app-theme.js b/apps/web/src/commands/change-app-theme.js index f8620153c..260b0c931 100644 --- a/apps/web/src/commands/change-app-theme.js +++ b/apps/web/src/commands/change-app-theme.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { invokeCommand } from "./index"; export default function changeAppTheme(theme) { diff --git a/apps/web/src/commands/check-for-update.js b/apps/web/src/commands/check-for-update.js index ec3b46464..42247bcaf 100644 --- a/apps/web/src/commands/check-for-update.js +++ b/apps/web/src/commands/check-for-update.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EVENTS } from "@notesnook/desktop/events"; import { AppEventManager } from "../common/app-events"; import { isDesktop } from "../utils/platform"; diff --git a/apps/web/src/commands/download-update.js b/apps/web/src/commands/download-update.js index d25778f4c..6c379dc4f 100644 --- a/apps/web/src/commands/download-update.js +++ b/apps/web/src/commands/download-update.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { isDesktop } from "../utils/platform"; import { invokeCommand } from "./index"; diff --git a/apps/web/src/commands/index.js b/apps/web/src/commands/index.js index a7158170a..8071bca69 100644 --- a/apps/web/src/commands/index.js +++ b/apps/web/src/commands/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { AppEventManager } from "../common/app-events"; import { isDesktop } from "../utils/platform"; diff --git a/apps/web/src/commands/install-update.js b/apps/web/src/commands/install-update.js index d072e2726..1fa44777a 100644 --- a/apps/web/src/commands/install-update.js +++ b/apps/web/src/commands/install-update.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { isDesktop } from "../utils/platform"; import { invokeCommand } from "./index"; diff --git a/apps/web/src/commands/open.js b/apps/web/src/commands/open.js index cbbfebfb0..f117c0c99 100644 --- a/apps/web/src/commands/open.js +++ b/apps/web/src/commands/open.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { invokeCommand } from "./index"; export function openPath(path) { diff --git a/apps/web/src/commands/save-file.js b/apps/web/src/commands/save-file.js index b8d2a0743..d23de7058 100644 --- a/apps/web/src/commands/save-file.js +++ b/apps/web/src/commands/save-file.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { invokeCommand } from "./index"; export default function saveFile(filePath, data) { diff --git a/apps/web/src/commands/set-zoom-factor.js b/apps/web/src/commands/set-zoom-factor.js index d7a1dd870..58ae47368 100644 --- a/apps/web/src/commands/set-zoom-factor.js +++ b/apps/web/src/commands/set-zoom-factor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { invokeCommand } from "./index"; export default function setZoomFactor(zoomFactor) { diff --git a/apps/web/src/common/app-events.js b/apps/web/src/common/app-events.js index 737fb6df3..59397a235 100644 --- a/apps/web/src/common/app-events.js +++ b/apps/web/src/common/app-events.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import EventManager from "@notesnook/core/utils/event-manager"; export const AppEventManager = new EventManager(); diff --git a/apps/web/src/common/attachments.js b/apps/web/src/common/attachments.js index 7922d1efa..d5fe96eed 100644 --- a/apps/web/src/common/attachments.js +++ b/apps/web/src/common/attachments.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import FS from "../interfaces/fs"; import { db } from "./db"; diff --git a/apps/web/src/common/constants.ts b/apps/web/src/common/constants.ts index 0e4ff9924..e54ddefdd 100644 --- a/apps/web/src/common/constants.ts +++ b/apps/web/src/common/constants.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export const COLORS = [ "red", "orange", diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js index d2c06c035..da2d42458 100644 --- a/apps/web/src/common/db.js +++ b/apps/web/src/common/db.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EventSourcePolyfill as EventSource } from "event-source-polyfill"; import { NNStorage } from "../interfaces/storage"; import { logger } from "../utils/logger"; diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx index b760e1ec4..da598bbae 100644 --- a/apps/web/src/common/dialog-controller.tsx +++ b/apps/web/src/common/dialog-controller.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ReactDOM from "react-dom"; import { Dialogs } from "../components/dialogs"; import { hardNavigate } from "../navigation"; @@ -36,7 +54,7 @@ function showDialog( id: TId, render: RenderDialog ): Promise { - return new Promise((resolve, reject) => { + return new Promise((resolve) => { if (openDialogs[id]) return false; const container = document.createElement("div"); @@ -73,7 +91,7 @@ export function showAddNotebookDialog() { return showDialog("AddNotebookDialog", (Dialog, perform) => ( { + onDone={async (nb: Record) => { // add the notebook to db await db.notebooks?.add({ ...nb }); notebookStore.refresh(); @@ -96,13 +114,13 @@ export function showEditNotebookDialog(notebookId: string) { isOpen={true} notebook={notebook} edit={true} - onDone={async (nb: any, deletedTopics: string[]) => { + onDone={async (nb: Record, deletedTopics: string[]) => { // we remove the topics from notebook // beforehand so we can add them manually, later const topics = qclone(nb.topics); nb.topics = []; - let notebookId = await db.notebooks?.add(nb); + const notebookId = await db.notebooks?.add(nb); // add or delete topics as required const notebookTopics = db.notebooks?.notebook(notebookId).topics; @@ -311,7 +329,7 @@ export function showLoadingDialog(dialogData: LoadingDialogProps) { type ProgressDialogProps = { title: string; subtitle: string; - action: any; + action: (...args: never[]) => void; }; export function showProgressDialog(dialogData: ProgressDialogProps) { const { title, subtitle, action } = dialogData; @@ -473,7 +491,7 @@ export function showCreateTopicDialog() { onClose={() => { perform(false); }} - onAction={async (topic: any) => { + onAction={async (topic: Record) => { if (!topic) return; const notebookId = notebookStore.get().selectedNotebookId; await db.notebooks?.notebook(notebookId).topics.add(topic); @@ -486,9 +504,8 @@ export function showCreateTopicDialog() { } export function showEditTopicDialog(notebookId: string, topicId: string) { - const topic: any = db.notebooks - ?.notebook(notebookId) - ?.topics?.topic(topicId)?._topic; + const topic = db.notebooks?.notebook(notebookId)?.topics?.topic(topicId) + ?._topic as Record | undefined; if (!topic) return; return showDialog("ItemDialog", (Dialog, perform) => ( perform(false)} onAction={async (t: string) => { await db.notebooks - ?.notebook(topic.notebookId) + ?.notebook(topic.notebookId as string) .topics.add({ ...topic, title: t }); notebookStore.setSelectedNotebook(topic.notebookId); appStore.refreshNavItems(); @@ -606,7 +623,7 @@ export function showTrackingDetailsDialog() { } export function showAnnouncementDialog( - announcement: any, + announcement: { id: string }, remove: (id: string) => void ) { return showDialog("AnnouncementDialog", (Dialog, perform) => ( diff --git a/apps/web/src/common/export.ts b/apps/web/src/common/export.ts index ef76cf8d5..db39cccca 100644 --- a/apps/web/src/common/export.ts +++ b/apps/web/src/common/export.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "./db"; import { TaskManager } from "./task-manager"; import { zip } from "../utils/zip"; @@ -10,7 +28,7 @@ export async function exportToPDF( ): Promise { if (!content) return false; const { default: printjs } = await import("print-js"); - return new Promise(async (resolve) => { + return new Promise((resolve) => { printjs({ printable: content, type: "raw-html", @@ -35,14 +53,16 @@ export async function exportNotes( subtitle: "Please wait while your notes are exported.", action: async (report) => { if (format === "pdf") { - const note = db.notes!.note(noteIds[0]); + const note = db.notes?.note(noteIds[0]); + if (!note) return false; return await exportToPDF(note.title, await note.export("html", null)); } - var files = []; + const files = []; let index = 0; - for (var noteId of noteIds) { - const note = db.notes!.note(noteId); + for (const noteId of noteIds) { + const note = db.notes?.note(noteId); + if (!note) continue; report({ current: ++index, total: noteIds.length, diff --git a/apps/web/src/common/height-calculator.js b/apps/web/src/common/height-calculator.js index 4bf41bec1..e90c84900 100644 --- a/apps/web/src/common/height-calculator.js +++ b/apps/web/src/common/height-calculator.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const SINGLE_LINE_HEIGHT = 1.4; const DEFAULT_FONT_SIZE = document.getElementById("p").clientHeight - 1; diff --git a/apps/web/src/common/index.js b/apps/web/src/common/index.js index f05ecb7b6..cffd99fb7 100644 --- a/apps/web/src/common/index.js +++ b/apps/web/src/common/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { showFeatureDialog, showLoadingDialog, @@ -82,7 +100,7 @@ export async function selectBackupFile() { if (!file) return; const reader = new FileReader(); - const backup = await new Promise((resolve, reject) => { + const backup = await new Promise((resolve) => { reader.addEventListener("load", (event) => { const text = event.target.result; try { diff --git a/apps/web/src/common/key-map.js b/apps/web/src/common/key-map.js index 26a78de8f..29a2d827f 100644 --- a/apps/web/src/common/key-map.js +++ b/apps/web/src/common/key-map.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import hotkeys from "hotkeys-js"; import { navigate } from "../navigation"; // import { store as themestore } from "../stores/theme-store"; @@ -111,7 +129,7 @@ const KEYMAP = [ ]; export function registerKeyMap() { - hotkeys.filter = function (e) { + hotkeys.filter = function () { return true; }; diff --git a/apps/web/src/common/list-profiles.js b/apps/web/src/common/list-profiles.js index ae493b12a..b1fbcd52f 100644 --- a/apps/web/src/common/list-profiles.js +++ b/apps/web/src/common/list-profiles.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { navigate } from "../navigation/"; import Note from "../components/note"; import Notebook from "../components/notebook"; @@ -77,7 +95,7 @@ const TrashProfile = createProfile( ); const AttachmentProfile = createProfile( - (index, item, type) => , + (index, item) => , (item) => getNoteHeight(item), Math.max(MAX_HEIGHTS.note, MAX_HEIGHTS.notebook) ); diff --git a/apps/web/src/common/multi-select.ts b/apps/web/src/common/multi-select.ts index 2e0a7a182..62ffd38f4 100644 --- a/apps/web/src/common/multi-select.ts +++ b/apps/web/src/common/multi-select.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { showMultiDeleteConfirmation } from "./dialog-controller"; import { store as noteStore } from "../stores/note-store"; import { store as notebookStore } from "../stores/notebook-store"; @@ -8,7 +26,13 @@ import Vault from "./vault"; import { showItemDeletedToast } from "./toasts"; import { TaskManager } from "./task-manager"; -async function moveNotesToTrash(notes: any[], confirm = true) { +type Item = { + id: string; + locked?: boolean; + metadata?: Record; +}; + +async function moveNotesToTrash(notes: Item[], confirm = true) { const item = notes[0]; if (confirm && !(await showMultiDeleteConfirmation(notes.length))) return; @@ -22,7 +46,7 @@ async function moveNotesToTrash(notes: any[], confirm = true) { } const items = notes.map((item) => { - if (item.locked || db.monographs!.isPublished(item.id)) return 0; + if (item.locked || db.monographs?.isPublished(item.id)) return 0; return item.id; }); @@ -40,7 +64,7 @@ async function moveNotesToTrash(notes: any[], confirm = true) { showToast("success", `${items.length} notes moved to trash`); } -async function moveNotebooksToTrash(notebooks: any[]) { +async function moveNotebooksToTrash(notebooks: Item[]) { const item = notebooks[0]; const isMultiselect = notebooks.length > 1; if (isMultiselect) { @@ -67,7 +91,7 @@ async function moveNotebooksToTrash(notebooks: any[]) { } } -async function deleteTopics(notebookId: string, topics: any[]) { +async function deleteTopics(notebookId: string, topics: Item[]) { await TaskManager.startTask({ type: "status", id: "deleteTopics", @@ -75,8 +99,8 @@ async function deleteTopics(notebookId: string, topics: any[]) { report({ text: `Deleting ${topics.length} topics...` }); - await db - .notebooks!.notebook(notebookId) + await db.notebooks + ?.notebook(notebookId) .topics.delete(...topics.map((t) => t.id)); notebookStore.setSelectedNotebook(notebookId); } @@ -84,7 +108,7 @@ async function deleteTopics(notebookId: string, topics: any[]) { showToast("success", `${topics.length} topics deleted`); } -async function deleteAttachments(attachments: any[]) { +async function deleteAttachments(attachments: Item[]) { if ( !window.confirm( "Are you sure you want to permanently delete these attachments? This action is IRREVERSIBLE." @@ -103,7 +127,7 @@ async function deleteAttachments(attachments: any[]) { current: i, total: attachments.length }); - await attachmentStore.permanentDelete(attachment.metadata.hash); + await attachmentStore.permanentDelete(attachment.metadata?.hash); } } }); diff --git a/apps/web/src/common/reminders.js b/apps/web/src/common/reminders.js index 44b64aa15..509279d3b 100644 --- a/apps/web/src/common/reminders.js +++ b/apps/web/src/common/reminders.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Config from "../utils/config"; import { createBackup, verifyAccount } from "./index"; import { db } from "./db"; diff --git a/apps/web/src/common/store.js b/apps/web/src/common/store.js index 078397fc9..f6b638fb1 100644 --- a/apps/web/src/common/store.js +++ b/apps/web/src/common/store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import produce, { immerable, setAutoFreeze } from "immer"; import create from "zustand"; setAutoFreeze(false); diff --git a/apps/web/src/common/task-manager.ts b/apps/web/src/common/task-manager.ts index b3b405b82..132bfc815 100644 --- a/apps/web/src/common/task-manager.ts +++ b/apps/web/src/common/task-manager.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { removeStatus, updateStatus } from "../hooks/use-status"; import { showProgressDialog } from "./dialog-controller"; @@ -38,7 +56,7 @@ type ProgressReportCallback = (progress: TaskProgress) => void; export class TaskManager { static async startTask(task: TaskDefinition): Promise { switch (task.type) { - case "status": + case "status": { const statusTask = task; const result = await statusTask.action((progress) => { let percentage: number | undefined = undefined; @@ -54,12 +72,14 @@ export class TaskManager { }); removeStatus(statusTask.id); return result; - case "modal": + } + case "modal": { return await showProgressDialog({ title: task.title, subtitle: task.subtitle, action: task.action }); + } } } } diff --git a/apps/web/src/common/toasts.js b/apps/web/src/common/toasts.js index ef00212f5..e45f149ac 100644 --- a/apps/web/src/common/toasts.js +++ b/apps/web/src/common/toasts.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "./db"; import { store as notestore } from "../stores/note-store"; import { store as nbstore } from "../stores/notebook-store"; diff --git a/apps/web/src/common/toolbar-config.ts b/apps/web/src/common/toolbar-config.ts index 95a061770..b301b4aa2 100644 --- a/apps/web/src/common/toolbar-config.ts +++ b/apps/web/src/common/toolbar-config.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getDefaultPresets, ToolbarGroupDefinition } from "@notesnook/editor"; import { db } from "./db"; diff --git a/apps/web/src/common/vault.js b/apps/web/src/common/vault.js index 922a72697..2c3f1afa2 100644 --- a/apps/web/src/common/vault.js +++ b/apps/web/src/common/vault.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/db"; import { showPasswordDialog } from "../common/dialog-controller"; import { showToast } from "../utils/toast"; diff --git a/apps/web/src/components/accent-item/index.js b/apps/web/src/components/accent-item/index.js index 6364e069b..78be75869 100644 --- a/apps/web/src/components/accent-item/index.js +++ b/apps/web/src/components/accent-item/index.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex } from "@streetwriters/rebass"; import * as Icon from "../icons"; import { useStore as useThemeStore } from "../../stores/theme-store"; diff --git a/apps/web/src/components/accordion/index.js b/apps/web/src/components/accordion/index.js index b2de12845..8b5be5746 100644 --- a/apps/web/src/components/accordion/index.js +++ b/apps/web/src/components/accordion/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import { useEffect, useState } from "react"; import { ChevronDown, ChevronUp } from "../icons"; diff --git a/apps/web/src/components/animated/index.js b/apps/web/src/components/animated/index.js index ce4568d15..966ea20b2 100644 --- a/apps/web/src/components/animated/index.js +++ b/apps/web/src/components/animated/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { m } from "framer-motion"; import { Flex, Box, Image, Text } from "@streetwriters/rebass"; import { Input } from "@streetwriters/rebass-forms"; diff --git a/apps/web/src/components/announcements/body.js b/apps/web/src/components/announcements/body.js index 8ccec339c..ba576ed17 100644 --- a/apps/web/src/components/announcements/body.js +++ b/apps/web/src/components/announcements/body.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Button, @@ -141,7 +159,7 @@ function List({ item }) { flexDirection="column" > {items.map((item) => ( - + ))} ); @@ -207,6 +225,7 @@ function CalltoActions({ item, removeAnnouncement }) { ) .map((action, index) => ( diff --git a/apps/web/src/components/announcements/index.js b/apps/web/src/components/announcements/index.js index 811d1a2a0..db2947966 100644 --- a/apps/web/src/components/announcements/index.js +++ b/apps/web/src/components/announcements/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useMemo } from "react"; import { Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/attachment/index.js b/apps/web/src/components/attachment/index.js index 70bc416d0..ef74f96d6 100644 --- a/apps/web/src/components/attachment/index.js +++ b/apps/web/src/components/attachment/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import { formatBytes } from "../../utils/filename"; import ListItem from "../list-item"; diff --git a/apps/web/src/components/auth-container/index.js b/apps/web/src/components/auth-container/index.js index c62e0755f..258764925 100644 --- a/apps/web/src/components/auth-container/index.js +++ b/apps/web/src/components/auth-container/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useMemo } from "react"; import { Box, Flex, Image, Text } from "@streetwriters/rebass"; import ThemeProvider from "../theme-provider"; @@ -91,27 +109,27 @@ function AuthContainer(props) { diff --git a/apps/web/src/components/cached-router/index.js b/apps/web/src/components/cached-router/index.js index 3a287e557..81c83ff1d 100644 --- a/apps/web/src/components/cached-router/index.js +++ b/apps/web/src/components/cached-router/index.js @@ -1,4 +1,22 @@ -import React, { useEffect } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useEffect } from "react"; import ReactDOM from "react-dom"; import { getHomeRoute, NavigationEvents } from "../../navigation"; import { store as selectionStore } from "../../stores/selection-store"; diff --git a/apps/web/src/components/dialogs/add-notebook-dialog.js b/apps/web/src/components/dialogs/add-notebook-dialog.js index dc9d813d4..38a360c6d 100644 --- a/apps/web/src/components/dialogs/add-notebook-dialog.js +++ b/apps/web/src/components/dialogs/add-notebook-dialog.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/dialogs/announcement-dialog.js b/apps/web/src/components/dialogs/announcement-dialog.js index e990ddfba..835378ece 100644 --- a/apps/web/src/components/dialogs/announcement-dialog.js +++ b/apps/web/src/components/dialogs/announcement-dialog.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Modal from "react-modal"; import { useTheme } from "@emotion/react"; import { Flex } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/dialogs/attachments-dialog.js b/apps/web/src/components/dialogs/attachments-dialog.js index 7a6386f53..9cd6f63e0 100644 --- a/apps/web/src/components/dialogs/attachments-dialog.js +++ b/apps/web/src/components/dialogs/attachments-dialog.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect } from "react"; import { Flex } from "@streetwriters/rebass"; import { getTotalSize } from "../../common/attachments"; diff --git a/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx b/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx index 0a8b67971..d42909c1e 100644 --- a/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx +++ b/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useRef, useState } from "react"; import { Text, Flex, Button } from "@streetwriters/rebass"; import * as Icon from "../../icons"; @@ -20,6 +38,7 @@ import { TaskManager } from "../../../common/task-manager"; import { db } from "../../../common/db"; import { useCheckoutStore } from "./store"; import { getCurrencySymbol } from "./helpers"; +import { Theme } from "@notesnook/theme"; type BuyDialogProps = { couponCode?: string; @@ -29,7 +48,7 @@ type BuyDialogProps = { export function BuyDialog(props: BuyDialogProps) { const { onClose, couponCode, plan } = props; - const theme: any = useTheme(); + const theme = useTheme() as Theme; useEffect(() => { return () => { @@ -44,11 +63,13 @@ export function BuyDialog(props: BuyDialogProps) { shouldCloseOnEsc shouldReturnFocusAfterClose shouldFocusAfterRender - onAfterOpen={(e: any) => { - if (!onClose) return; + onAfterOpen={(e) => { + if (!e || !onClose) return; // we need this work around because ReactModal content spreads over the overlay const child = e.contentEl.firstElementChild; - e.contentEl.onmousedown = function (e: any) { + if (!child || !(child instanceof HTMLElement)) return; + + e.contentEl.onmousedown = function (e) { if (!e.screenX && !e.screenY) return; if ( e.x < child.offsetLeft || @@ -209,7 +230,6 @@ function Details(props: DetailsProps) { return ( { - if (!couponInputRef.current) return; - setIsApplyingCoupon(false); + useEffect(() => { + if (!couponInputRef.current) return; + setIsApplyingCoupon(false); - const couponValue = couponInputRef.current.value; + const couponValue = couponInputRef.current.value; - const isInvalidCoupon = - (!!couponValue && couponValue !== pricingInfo?.coupon) || - (!!couponCode && couponCode !== pricingInfo?.coupon); + const isInvalidCoupon = + (!!couponValue && couponValue !== pricingInfo?.coupon) || + (!!couponCode && couponCode !== pricingInfo?.coupon); - setIsInvalidCoupon(isInvalidCoupon); - if (isInvalidCoupon) { - if (couponCode) couponInputRef.current.value = couponCode; - return; - } + setIsInvalidCoupon(isInvalidCoupon); + if (isInvalidCoupon) { + if (couponCode) couponInputRef.current.value = couponCode; + return; + } - const pricingInfoCoupon = pricingInfo?.coupon || ""; - if (couponValue !== pricingInfoCoupon) { - couponInputRef.current.value = pricingInfoCoupon; - onApplyCoupon(pricingInfo?.coupon); - } - }, + const pricingInfoCoupon = pricingInfo?.coupon || ""; + if (couponValue !== pricingInfoCoupon) { + couponInputRef.current.value = pricingInfoCoupon; + onApplyCoupon(pricingInfo?.coupon); + } // eslint-disable-next-line react-hooks/exhaustive-deps - [pricingInfo, onApplyCoupon, setIsApplyingCoupon] - ); + }, [pricingInfo, onApplyCoupon, setIsApplyingCoupon]); return ( <> diff --git a/apps/web/src/components/dialogs/buy-dialog/features.tsx b/apps/web/src/components/dialogs/buy-dialog/features.tsx index 3345b3015..4071e0953 100644 --- a/apps/web/src/components/dialogs/buy-dialog/features.tsx +++ b/apps/web/src/components/dialogs/buy-dialog/features.tsx @@ -1,9 +1,28 @@ -import { Text, Flex, Box } from "@streetwriters/rebass"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { Text, Flex, Box, BoxProps } from "@streetwriters/rebass"; import * as Icon from "../../icons"; type Feature = { + id: string; title?: string; - icon?: (props: any) => JSX.Element; + icon?: (props: BoxProps) => JSX.Element; pro?: boolean; }; @@ -23,22 +42,27 @@ const sections: Section[] = [ "Everything you do in Notesnook stays private. We use XChaCha20-Poly1305-IETF and Argon2 to encrypt your notes.", features: [ { + id: "zero-ads", title: "Zero ads & zero trackers", icon: Icon.Billboard }, { + id: "on-device-encryption", title: "On device encryption", icon: Icon.Cellphone }, { + id: "secure-app-lock", title: "Secure app lock for all", icon: Icon.CellphoneLock }, { + id: "end-to-end-encrypted", title: "100% end-to-end encrypted", icon: Icon.Lock }, { + id: "private-vault", title: "Private vault for notes", icon: Icon.ShieldLock, pro: true @@ -57,27 +81,35 @@ const sections: Section[] = [ columns: 8, features: [ { + id: "ios", icon: Icon.iOS }, { + id: "android", icon: Icon.Android }, { + id: "windows", icon: Icon.Windows }, { + id: "linux", icon: Icon.Linux }, { + id: "macos", icon: Icon.MacOS }, { + id: "chrome", icon: Icon.Chrome }, { + id: "firefox", icon: Icon.Firefox }, { + id: "safari", icon: Icon.Safari } ] @@ -89,22 +121,27 @@ const sections: Section[] = [ pro: true, features: [ { + id: "bulletproof-encryption", title: "Bulletproof encryption", icon: Icon.Lock }, { + id: "4k-images", title: "High quality 4K images", icon: Icon.ImageMultiple }, { + id: "unlimited-storage", title: "Unlimited storage", icon: Icon.Harddisk }, { + id: "500-mb-files", title: "Upto 500 MB per file", icon: Icon.FileCabinet }, { + id: "file-types", title: "All file types supported", icon: Icon.File } @@ -121,14 +158,17 @@ const sections: Section[] = [ "Publishing is nothing new but we offer fully encrypted, anonymous publishing. Take any note & share it with the world.", features: [ { + id: "anon-publishing", title: "Anonymous publishing", icon: Icon.Anonymous }, { + id: "password-protected-publishing", title: "Password protection", icon: Icon.CloudLock }, { + id: "self-destructive-notes", title: "Self destructable notes", icon: Icon.Timebomb } @@ -140,20 +180,24 @@ const sections: Section[] = [ "We offer multiple ways to keep you organized. The only limit is your imagination.", features: [ { + id: "unlimited-notebooks", title: "Unlimited notebooks*", icon: Icon.Notebook2, pro: true }, { + id: "colors-tags", title: "Colors & tags*", icon: Icon.Palette, pro: true }, { + id: "side-menu-shortcuts", title: "Side menu shortcuts", icon: Icon.Shortcut }, { + id: "pins-favorites", title: "Pins & favorites", icon: Icon.Pin } @@ -168,18 +212,22 @@ const sections: Section[] = [ pro: true, features: [ { + id: "lists-tables", title: "Lists & tables", icon: Icon.Table }, { + id: "image-embeds", title: "Images & embeds", icon: Icon.Embed }, { + id: "checklists", title: "Checklists", icon: Icon.CheckCircleOutline }, { + id: "md-shortcuts", title: "Markdown shortcuts", icon: Icon.Markdown } @@ -192,25 +240,30 @@ const sections: Section[] = [ // info: "* Free users can export notes in well formatted plain text.", features: [ { + id: "export-markdown", title: "Export as Markdown", icon: Icon.Markdown, pro: true }, { + id: "export-pdf", title: "Export as PDF", icon: Icon.PDF, pro: true }, { + id: "export-html", title: "Export as HTML", icon: Icon.HTML, pro: true }, { + id: "export-txt", title: "Export as text", icon: Icon.Text }, { + id: "bulk-exports", title: "Bulk exports", icon: Icon.Export } @@ -222,11 +275,13 @@ const sections: Section[] = [ "Do not worry about losing your data. Turn on automatic backups on weekly or daily basis.", features: [ { + id: "auto-backups", title: "Automatic monthly, weekly & daily backups", icon: Icon.Backup, pro: true }, { + id: "backup-encryption", title: "Backup encryption", icon: Icon.EncryptedBackup, pro: true @@ -240,14 +295,17 @@ const sections: Section[] = [ pro: true, features: [ { + id: "10-themes", title: "10+ themes", icon: Icon.Accent }, { + id: "dark-mode", title: "Automatic dark mode", icon: Icon.Theme }, { + id: "default-home-page", title: "Change default home page", icon: Icon.Home } @@ -267,7 +325,7 @@ export function Features() { bg="background" > {sections.map((section) => ( - + {section.pro && ( {section.features.map((feature) => ( - + {feature.icon && ( )} diff --git a/apps/web/src/components/dialogs/buy-dialog/helpers.ts b/apps/web/src/components/dialogs/buy-dialog/helpers.ts index bd343ae57..d9ee7b661 100644 --- a/apps/web/src/components/dialogs/buy-dialog/helpers.ts +++ b/apps/web/src/components/dialogs/buy-dialog/helpers.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getCurrencySymbol as _getSymbol, ICurrencySymbols diff --git a/apps/web/src/components/dialogs/buy-dialog/index.ts b/apps/web/src/components/dialogs/buy-dialog/index.ts index 8079239c2..cc9b31444 100644 --- a/apps/web/src/components/dialogs/buy-dialog/index.ts +++ b/apps/web/src/components/dialogs/buy-dialog/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export { BuyDialog as default } from "./buy-dialog"; diff --git a/apps/web/src/components/dialogs/buy-dialog/paddle.tsx b/apps/web/src/components/dialogs/buy-dialog/paddle.tsx index b6fb0e3d0..c18b0f92d 100644 --- a/apps/web/src/components/dialogs/buy-dialog/paddle.tsx +++ b/apps/web/src/components/dialogs/buy-dialog/paddle.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState, useRef, useCallback } from "react"; import { Box, Flex } from "@streetwriters/rebass"; import Loader from "../../loader"; diff --git a/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx b/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx index 78715de7e..45ddecd7e 100644 --- a/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx +++ b/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Text, Flex, Button } from "@streetwriters/rebass"; import * as Icon from "../../icons"; import { ReactComponent as Nomad } from "../../../assets/nomad.svg"; @@ -40,6 +58,7 @@ export function PlansList(props: PlansListProps) { const metadata = PLAN_METADATA[plan.period]; return ( @@ -366,9 +386,7 @@ function SortableWrapper(props: SortableWrapperProps) { id="remove-item" variant={"tool"} sx={{ p: "small", opacity: 0 }} - onClick={(e) => { - onRemove(item); - }} + onClick={() => onRemove(item)} > @@ -393,18 +411,15 @@ type Subgroup = BaseTreeNode<"group"> & { type Group = BaseTreeNode<"group">; type Item = BaseTreeNode<"item"> & { - toolId: string; + toolId: ToolId; icon: string; collapsed?: boolean; }; type TreeNode = Group | Item | Subgroup; -function flatten( - tools: ToolbarGroupDefinition[], - depth: number = 0 -): TreeNode[] { - let nodes: TreeNode[] = []; +function flatten(tools: ToolbarGroupDefinition[], depth = 0): TreeNode[] { + const nodes: TreeNode[] = []; let groupCount = 1; for (const tool of tools) { if (Array.isArray(tool)) { @@ -415,27 +430,27 @@ function flatten( nodes.push(...flatten(tool as ToolbarGroupDefinition[], depth + 1)); ++groupCount; } else { - const { icon, title } = getToolDefinition(tool as any); + const { icon, title } = getToolDefinition(tool); nodes.push(createItem({ toolId: tool, depth, title, icon })); } } return nodes; } -function unflatten(items: TreeNode[]): ToolbarGroupDefinition[] { - let tools: ToolbarGroupDefinition[] = []; +function unflatten(items: TreeNode[]): ToolbarDefinition { + const tools: ToolbarDefinition = []; for (let i = 0; i < items.length; i++) { const item = items[i]; if (isGroup(item) || isSubgroup(item)) { const group = getGroup(items, item.id); console.log(group?.items); if (!group) continue; - tools.push(unflatten(group.items.slice(1)) as any); + tools.push(unflatten(group.items.slice(1)) as ToolbarGroupDefinition); // skip all the group's items i += group.items.length - 1; } else { - tools.push(item.toolId as any); + (tools as ToolbarGroupDefinition).push(item.toolId); } } return tools; @@ -451,14 +466,13 @@ function createGroup(config: Partial): Group { }; } -function createItem(config: Partial): Item { +function createItem(config: Partial & { toolId: ToolId }): Item { return { type: "item", id: id(), depth: 0, title: "", icon: "", - toolId: "", ...config }; } @@ -674,11 +688,11 @@ function addGroup(items: TreeNode[]) { } export function getDisabledTools(tools: TreeNode[]) { - const allTools = getAllTools() as Record; + const allTools = getAllTools(); const disabled: ToolbarGroupDefinition = []; const items: Item[] = tools.filter((t) => isItem(t)) as Item[]; for (const key in allTools) { - const tool = allTools[key]; + const tool = allTools[key as ToolId]; if (tool.conditional) continue; if (items.findIndex((t) => t.toolId === key) <= -1) disabled.push(key as ToolId); diff --git a/apps/web/src/components/dialogs/tracking-details-dialog.js b/apps/web/src/components/dialogs/tracking-details-dialog.js index 886960cd6..437a123b1 100644 --- a/apps/web/src/components/dialogs/tracking-details-dialog.js +++ b/apps/web/src/components/dialogs/tracking-details-dialog.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Text } from "@streetwriters/rebass"; import { ANALYTICS_EVENTS } from "../../utils/analytics"; import Dialog from "./dialog"; @@ -30,7 +47,7 @@ function TrackingDetailsDialog(props) { {events.map((event) => ( - + . + */ + import { formatDate } from "@notesnook/core/utils/date"; import { Flex, Button } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/diff-viewer/index.js b/apps/web/src/components/diff-viewer/index.js index c8d1f78b5..26a4b5a84 100644 --- a/apps/web/src/components/diff-viewer/index.js +++ b/apps/web/src/components/diff-viewer/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState, useEffect, useCallback } from "react"; import { Flex, Text, Button } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/dropdown-button/index.js b/apps/web/src/components/dropdown-button/index.js index 204620f34..32956f668 100644 --- a/apps/web/src/components/dropdown-button/index.js +++ b/apps/web/src/components/dropdown-button/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Button, Flex } from "@streetwriters/rebass"; import { useMenuTrigger } from "../../hooks/use-menu"; import { ChevronDown } from "../icons"; diff --git a/apps/web/src/components/editor/-placeholder.js b/apps/web/src/components/editor/-placeholder.js index 8935f3f2d..366ebf606 100644 --- a/apps/web/src/components/editor/-placeholder.js +++ b/apps/web/src/components/editor/-placeholder.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Logo from "../../assets/logo.svg"; import LogoDark from "../../assets/logo-dark.svg"; import { Button, Flex, Image, Text } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/editor/context.ts b/apps/web/src/components/editor/context.ts index fb7c89496..1bae00dec 100644 --- a/apps/web/src/components/editor/context.ts +++ b/apps/web/src/components/editor/context.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useRef } from "react"; import { IEditor, NoteStatistics } from "./types"; import createStore from "../../common/store"; diff --git a/apps/web/src/components/editor/footer.js b/apps/web/src/components/editor/footer.js index 1c0f0d51e..5c2e37d30 100644 --- a/apps/web/src/components/editor/footer.js +++ b/apps/web/src/components/editor/footer.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { formatDate } from "@notesnook/core/utils/date"; import { Flex, Text } from "@streetwriters/rebass"; import { useStore } from "../../stores/editor-store"; diff --git a/apps/web/src/components/editor/header.js b/apps/web/src/components/editor/header.js index 75c360543..75c51b9ad 100644 --- a/apps/web/src/components/editor/header.js +++ b/apps/web/src/components/editor/header.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useStore } from "../../stores/editor-store"; import { Input } from "@streetwriters/rebass-forms"; @@ -136,7 +154,7 @@ function Autosuggest({ placeholder="Add a tag..." data-test-id="editor-tag-input" fontSize="subtitle" - onFocus={(e) => { + onFocus={() => { const text = getInputValue(); if (!text) setFiltered(defaultItems); }} diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx index 37f76c2f5..58f2c8983 100644 --- a/apps/web/src/components/editor/index.tsx +++ b/apps/web/src/components/editor/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useCallback, @@ -18,7 +36,6 @@ import Header from "./header"; import { Attachment } from "../icons"; import { useEditorInstance } from "./context"; import { attachFile, AttachmentProgress, insertAttachment } from "./picker"; -import { DropEvent } from "react-dropzone"; import { downloadAttachment } from "../../common/attachments"; import { EV, EVENTS } from "@notesnook/core/common"; import { db } from "../../common/db"; @@ -410,7 +427,7 @@ function DropZone(props: DropZoneProps) { if (!editor || !e.dataTransfer.files?.length) return; e.preventDefault(); - for (let file of e.dataTransfer.files) { + for (const file of e.dataTransfer.files) { const result = await attachFile(file); if (!result) continue; editor.current?.attachFile(result); @@ -451,7 +468,7 @@ function useDragOverlay() { overlay.style.display = "flex"; } - function hideOverlay(e: DragEvent | DropEvent) { + function hideOverlay() { if (!overlay) return; overlay.style.display = "none"; } diff --git a/apps/web/src/components/editor/loading.tsx b/apps/web/src/components/editor/loading.tsx index 9fb9aff92..98e8b87d9 100644 --- a/apps/web/src/components/editor/loading.tsx +++ b/apps/web/src/components/editor/loading.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/editor/picker.ts b/apps/web/src/components/editor/picker.ts index facf6ffa2..f8d5b3265 100644 --- a/apps/web/src/components/editor/picker.ts +++ b/apps/web/src/components/editor/picker.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SerializedKey } from "@notesnook/crypto/dist/src/types"; import { AppEventManager, AppEvents } from "../../common/app-events"; import { db } from "../../common/db"; @@ -96,7 +114,7 @@ async function pickImage(selectedImage: File, options?: AddAttachmentOptions) { } async function getEncryptionKey(): Promise { - const key = await db.attachments!.generateKey(); + const key = await db.attachments?.generateKey(); if (!key) throw new Error("Could not generate a new encryption key."); return key; } @@ -113,7 +131,7 @@ export function showFilePicker({ input.dispatchEvent(new MouseEvent("click")); input.onchange = async function () { if (!input.files) return resolve(undefined); - var file = input.files[0]; + const file = input.files[0]; if (!file) return resolve(undefined); resolve(file); }; @@ -166,15 +184,15 @@ async function addAttachment( throw new Error( `Please select the same file for reuploading. Expected hash ${expectedFileHash} but got ${hash}.` ); - const exists = db.attachments!.exists(hash); + const exists = db.attachments?.exists(hash); if (forceWrite || !exists) { - let key: SerializedKey = await getEncryptionKey(); + const key: SerializedKey = await getEncryptionKey(); const output = await fs.writeEncryptedFile(file, key, hash); if (!output) throw new Error("Could not encrypt file."); if (forceWrite && exists) await db.attachments?.reset(hash); - await db.attachments!.add({ + await db.attachments?.add({ ...output, hash, hashType, diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx index 28be585d8..51f4c30a6 100644 --- a/apps/web/src/components/editor/tiptap.tsx +++ b/apps/web/src/components/editor/tiptap.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "@notesnook/editor/styles/styles.css"; import "@notesnook/editor/styles/katex.min.css"; import "@notesnook/editor/styles/katex-fonts.css"; @@ -26,7 +44,7 @@ import { showBuyDialog } from "../../common/dialog-controller"; import { useStore as useSettingsStore } from "../../stores/setting-store"; const SAVE_INTERVAL = process.env.REACT_APP_TEST ? 0 : 300; -var saveTimeout = 0; +let saveTimeout = 0; type TipTapProps = { editorContainer: HTMLElement; onLoad?: () => void; @@ -83,7 +101,7 @@ function TipTap(props: TipTapProps) { if (event.clipboardData?.files?.length && onAttachFile) { event.preventDefault(); event.stopPropagation(); - for (let file of event.clipboardData.files) { + for (const file of event.clipboardData.files) { onAttachFile(file); } return true; @@ -284,7 +302,7 @@ function toIEditor(editor: Editor): IEditor { sendAttachmentProgress: (hash, type, progress) => editor.current?.commands.setAttachmentProgress({ hash, - type: type as any, + type, progress }) }; @@ -314,7 +332,7 @@ function countWords(str: string) { let count = 0; let shouldCount = false; - for (var i = 0; i < str.length; ++i) { + for (let i = 0; i < str.length; ++i) { const s = str[i]; if ( diff --git a/apps/web/src/components/editor/title-box.tsx b/apps/web/src/components/editor/title-box.tsx index 64509d202..68e0b99de 100644 --- a/apps/web/src/components/editor/title-box.tsx +++ b/apps/web/src/components/editor/title-box.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { Input } from "@streetwriters/rebass-forms"; diff --git a/apps/web/src/components/editor/toolbar.js b/apps/web/src/components/editor/toolbar.js index 3f11569c4..fd36ea737 100644 --- a/apps/web/src/components/editor/toolbar.js +++ b/apps/web/src/components/editor/toolbar.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useMemo, useState } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; @@ -12,7 +30,7 @@ import { db } from "../../common/db"; import { useEditorInstance, useHistory, useSearch } from "./context"; // TODO: this needs to be cleaned up! -function Toolbar(props) { +function Toolbar() { const sessionId = useStore((store) => store.session.id); const isLocked = useStore((store) => store.session.locked); const [isFullscreen, setIsFullscreen] = useState(false); diff --git a/apps/web/src/components/editor/types.ts b/apps/web/src/components/editor/types.ts index 3df958cdf..e42f14801 100644 --- a/apps/web/src/components/editor/types.ts +++ b/apps/web/src/components/editor/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Attachment } from "./picker"; export type NoteStatistics = { @@ -15,7 +33,7 @@ export interface IEditor { loadImage: (hash: string, src: string) => void; sendAttachmentProgress: ( hash: string, - type: string, + type: "download" | "upload" | "encrypt", progress: number ) => void; } diff --git a/apps/web/src/components/field/index.js b/apps/web/src/components/field/index.js index bf044c73c..312eb6ce9 100644 --- a/apps/web/src/components/field/index.js +++ b/apps/web/src/components/field/index.js @@ -1,4 +1,22 @@ -import React, { useState } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useState } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import { Input, Label } from "@streetwriters/rebass-forms"; import * as Icon from "../icons"; @@ -176,7 +194,7 @@ function Field(props) { {validatePassword && ( {rules.map((rule) => ( - + {rule.isValid ? ( ) : ( diff --git a/apps/web/src/components/global-menu-wrapper/index.js b/apps/web/src/components/global-menu-wrapper/index.js index 21102cae6..8f1e0969c 100644 --- a/apps/web/src/components/global-menu-wrapper/index.js +++ b/apps/web/src/components/global-menu-wrapper/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Menu from "../menu"; import { useMenuTrigger, useMenu, getPosition } from "../../hooks/use-menu"; import Modal from "react-modal"; diff --git a/apps/web/src/components/group-header/index.js b/apps/web/src/components/group-header/index.js index f1296f9b7..45d229334 100644 --- a/apps/web/src/components/group-header/index.js +++ b/apps/web/src/components/group-header/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import * as Icon from "../icons"; import { useEffect, useMemo, useRef, useState } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; @@ -230,7 +248,7 @@ function GroupHeader(props) { : Icon.SortDesc } title={`Grouped by ${groupByToTitleMap[groupOptions.groupBy]}`} - onClick={(e) => { + onClick={() => { const groupOptions = db.settings.getGroupOptions(type); setGroupOptions(groupOptions); @@ -252,7 +270,7 @@ function GroupHeader(props) { ? "Switch to detailed view" : "Switch to compact view" } - onClick={(e) => + onClick={() => setViewMode(viewMode === "compact" ? "detailed" : "compact") } /> diff --git a/apps/web/src/components/hash-router/index.js b/apps/web/src/components/hash-router/index.js index ead085274..32473c3bc 100644 --- a/apps/web/src/components/hash-router/index.js +++ b/apps/web/src/components/hash-router/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import useHashRoutes from "../../hooks/use-hash-routes"; import hashroutes from "../../navigation/hash-routes"; diff --git a/apps/web/src/components/icon-tag/index.js b/apps/web/src/components/icon-tag/index.js index 6e54b80c6..412c82663 100644 --- a/apps/web/src/components/icon-tag/index.js +++ b/apps/web/src/components/icon-tag/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; function IconTag({ text, title, icon: Icon, onClick, styles, testId }) { diff --git a/apps/web/src/components/icons/index.js b/apps/web/src/components/icons/index.js index d585e309c..355dd2bd0 100644 --- a/apps/web/src/components/icons/index.js +++ b/apps/web/src/components/icons/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState } from "react"; import MDIIcon from "@mdi/react"; import { diff --git a/apps/web/src/components/icons/resolver.js b/apps/web/src/components/icons/resolver.js index 8b4a1fdcf..da83214a7 100644 --- a/apps/web/src/components/icons/resolver.js +++ b/apps/web/src/components/icons/resolver.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { toTitleCase, toCamelCase } = require("../../utils/string"); var icons = undefined; diff --git a/apps/web/src/components/install-notice/index.js b/apps/web/src/components/install-notice/index.js index 8f31f2746..5e1a8d895 100644 --- a/apps/web/src/components/install-notice/index.js +++ b/apps/web/src/components/install-notice/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ReactDOM from "react-dom"; import { Box, Button, Flex, Text } from "@streetwriters/rebass"; import Config from "../../utils/config"; @@ -64,6 +82,7 @@ export default function InstallNotice({ onClose }) { > {nativeFeatures.map((feature) => ( - Don't show again + {`Don't show again`} diff --git a/apps/web/src/components/list-container/index.js b/apps/web/src/components/list-container/index.js index 57325c0ae..b04bc5d0b 100644 --- a/apps/web/src/components/list-container/index.js +++ b/apps/web/src/components/list-container/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useMemo, useRef, useState } from "react"; import { Flex, Button } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.js index 1bbb1ca22..ad9b2257c 100644 --- a/apps/web/src/components/list-item/index.js +++ b/apps/web/src/components/list-item/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; import { diff --git a/apps/web/src/components/loader/index.js b/apps/web/src/components/loader/index.js index f8efab1b9..7577e3638 100644 --- a/apps/web/src/components/loader/index.js +++ b/apps/web/src/components/loader/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import { Loading } from "../icons"; diff --git a/apps/web/src/components/loaders/editor-loader.tsx b/apps/web/src/components/loaders/editor-loader.tsx index 74049156e..fbc29edb3 100644 --- a/apps/web/src/components/loaders/editor-loader.tsx +++ b/apps/web/src/components/loaders/editor-loader.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { memo } from "react"; import Skeleton from "react-loading-skeleton"; import { Box, Flex } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/loaders/list-loader.tsx b/apps/web/src/components/loaders/list-loader.tsx index a6b91680b..9f15b8808 100644 --- a/apps/web/src/components/loaders/list-loader.tsx +++ b/apps/web/src/components/loaders/list-loader.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { memo } from "react"; import Skeleton from "react-loading-skeleton"; import { Box, Flex } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/loaders/navigation-loader.tsx b/apps/web/src/components/loaders/navigation-loader.tsx index 96c25da8d..b26b67820 100644 --- a/apps/web/src/components/loaders/navigation-loader.tsx +++ b/apps/web/src/components/loaders/navigation-loader.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { memo } from "react"; import Skeleton from "react-loading-skeleton"; import { Box, Flex } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/loaders/status-bar-loader.tsx b/apps/web/src/components/loaders/status-bar-loader.tsx index c3aea9c0d..0b3301f95 100644 --- a/apps/web/src/components/loaders/status-bar-loader.tsx +++ b/apps/web/src/components/loaders/status-bar-loader.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { memo } from "react"; import Skeleton from "react-loading-skeleton"; import { Box } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/loaders/view-loader.tsx b/apps/web/src/components/loaders/view-loader.tsx index 375c68952..5603d5178 100644 --- a/apps/web/src/components/loaders/view-loader.tsx +++ b/apps/web/src/components/loaders/view-loader.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { memo } from "react"; import Skeleton from "react-loading-skeleton"; import { Box, Flex } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/menu/index.js b/apps/web/src/components/menu/index.js index 70f283923..77fafd1d2 100644 --- a/apps/web/src/components/menu/index.js +++ b/apps/web/src/components/menu/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback, useRef, useEffect, useState } from "react"; import { Flex, Text } from "@streetwriters/rebass"; import { getPosition } from "../../hooks/use-menu"; diff --git a/apps/web/src/components/menu/menu-item.js b/apps/web/src/components/menu/menu-item.js index 4598027f1..b1183f8c4 100644 --- a/apps/web/src/components/menu/menu-item.js +++ b/apps/web/src/components/menu/menu-item.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Check, ChevronRight, Pro } from "../icons"; import { useRef } from "react"; import { Flex, Box, Text, Button } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js index 35564c6cb..75265e240 100644 --- a/apps/web/src/components/navigation-menu/index.js +++ b/apps/web/src/components/navigation-menu/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect } from "react"; import { Box, Button, Flex } from "@streetwriters/rebass"; import { @@ -243,7 +261,7 @@ function NavigationMenu(props) { filter: "brightness(100%)" } }} - onClick={(e) => { + onClick={() => { setFollowSystemTheme(false); toggleNightMode(); }} diff --git a/apps/web/src/components/navigation-menu/navigation-item.js b/apps/web/src/components/navigation-menu/navigation-item.js index f12e9154c..6c1a28485 100644 --- a/apps/web/src/components/navigation-menu/navigation-item.js +++ b/apps/web/src/components/navigation-menu/navigation-item.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Button, Flex, Text } from "@streetwriters/rebass"; import { useStore as useAppStore } from "../../stores/app-store"; import { useMenuTrigger } from "../../hooks/use-menu"; diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js index c73086e87..61f6dda87 100644 --- a/apps/web/src/components/note/index.js +++ b/apps/web/src/components/note/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useMemo } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/notebook/index.js b/apps/web/src/components/notebook/index.js index 538bc1138..3c8cf3008 100644 --- a/apps/web/src/components/notebook/index.js +++ b/apps/web/src/components/notebook/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Flex, Text } from "@streetwriters/rebass"; import ListItem from "../list-item"; @@ -45,7 +63,7 @@ function Notebook(props) { key={topic.id} text={topic.title} icon={Icon.Topic} - onClick={(e) => { + onClick={() => { navigate(`/notebooks/${notebook.id}/${topic.id}`); }} /> diff --git a/apps/web/src/components/placeholders/attachments-placeholder.js b/apps/web/src/components/placeholders/attachments-placeholder.js index f011ad94c..871b00912 100644 --- a/apps/web/src/components/placeholders/attachments-placeholder.js +++ b/apps/web/src/components/placeholders/attachments-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function AttachmentsPlaceholder() { diff --git a/apps/web/src/components/placeholders/favorites-placeholder.js b/apps/web/src/components/placeholders/favorites-placeholder.js index c2a20f4ef..518953d66 100644 --- a/apps/web/src/components/placeholders/favorites-placeholder.js +++ b/apps/web/src/components/placeholders/favorites-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function FavoritesPlaceholder() { diff --git a/apps/web/src/components/placeholders/index.js b/apps/web/src/components/placeholders/index.js index c6ef3029d..1667c91bb 100644 --- a/apps/web/src/components/placeholders/index.js +++ b/apps/web/src/components/placeholders/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/placeholders/loader.js b/apps/web/src/components/placeholders/loader.js index e6710aa6c..35e4b4611 100644 --- a/apps/web/src/components/placeholders/loader.js +++ b/apps/web/src/components/placeholders/loader.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useLayoutEffect } from "react"; import { ReactComponent as Note } from "../../assets/note2.svg"; import { ReactComponent as Notebook } from "../../assets/notebook.svg"; diff --git a/apps/web/src/components/placeholders/monographs-placeholder.js b/apps/web/src/components/placeholders/monographs-placeholder.js index c2ff1255f..babe9996d 100644 --- a/apps/web/src/components/placeholders/monographs-placeholder.js +++ b/apps/web/src/components/placeholders/monographs-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function MonographsPlaceholder() { diff --git a/apps/web/src/components/placeholders/notebooks-placeholder.js b/apps/web/src/components/placeholders/notebooks-placeholder.js index 63e623195..3e735cf49 100644 --- a/apps/web/src/components/placeholders/notebooks-placeholder.js +++ b/apps/web/src/components/placeholders/notebooks-placeholder.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; import { Plus } from "../icons"; import { hashNavigate } from "../../navigation"; diff --git a/apps/web/src/components/placeholders/notesplacholder.js b/apps/web/src/components/placeholders/notesplacholder.js index e04e5f870..fc13827b7 100644 --- a/apps/web/src/components/placeholders/notesplacholder.js +++ b/apps/web/src/components/placeholders/notesplacholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; import * as Icon from "../icons"; import { hashNavigate } from "../../navigation"; diff --git a/apps/web/src/components/placeholders/search-placeholder.js b/apps/web/src/components/placeholders/search-placeholder.js index 6d08ecb4d..4694aa901 100644 --- a/apps/web/src/components/placeholders/search-placeholder.js +++ b/apps/web/src/components/placeholders/search-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function SearchPlaceholder({ text }) { diff --git a/apps/web/src/components/placeholders/tags-placeholder.js b/apps/web/src/components/placeholders/tags-placeholder.js index cf749fd2c..507e69e42 100644 --- a/apps/web/src/components/placeholders/tags-placeholder.js +++ b/apps/web/src/components/placeholders/tags-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function TagsPlaceholder() { diff --git a/apps/web/src/components/placeholders/topics-placeholder.js b/apps/web/src/components/placeholders/topics-placeholder.js index 03eb1f954..c1dec02f9 100644 --- a/apps/web/src/components/placeholders/topics-placeholder.js +++ b/apps/web/src/components/placeholders/topics-placeholder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; import { Plus } from "../icons"; import { hashNavigate } from "../../navigation"; diff --git a/apps/web/src/components/placeholders/trash-placeholder.js b/apps/web/src/components/placeholders/trash-placeholder.js index 07729c4f1..bb7f4eb17 100644 --- a/apps/web/src/components/placeholders/trash-placeholder.js +++ b/apps/web/src/components/placeholders/trash-placeholder.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Placeholder from "./index"; function TrashPlaceholder() { diff --git a/apps/web/src/components/progress-bar/index.js b/apps/web/src/components/progress-bar/index.js index b4a68ce8c..8104acd16 100644 --- a/apps/web/src/components/progress-bar/index.js +++ b/apps/web/src/components/progress-bar/index.js @@ -1,5 +1,23 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useAnimation } from "framer-motion"; -import React, { useEffect } from "react"; +import { useEffect } from "react"; import { Flex } from "@streetwriters/rebass"; import { AnimatedBox } from "../animated"; diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.js index 1554a76a3..1706a22ea 100644 --- a/apps/web/src/components/properties/index.js +++ b/apps/web/src/components/properties/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback, useEffect, useState } from "react"; import * as Icon from "../icons"; import { Flex, Text } from "@streetwriters/rebass"; @@ -59,7 +77,7 @@ function Properties(props) { const isPreviewMode = sessionType === "preview"; const changeState = useCallback( - function changeState(prop, value) { + function changeState(prop) { switch (prop) { case "locked": return store.get().session.locked diff --git a/apps/web/src/components/properties/toggle.js b/apps/web/src/components/properties/toggle.js index a9ad0cce2..db6846372 100644 --- a/apps/web/src/components/properties/toggle.js +++ b/apps/web/src/components/properties/toggle.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import { useStore } from "../../stores/editor-store"; import Switch from "../switch"; diff --git a/apps/web/src/components/publish-view/index.js b/apps/web/src/components/publish-view/index.js index 3ccf942ba..c49289ecd 100644 --- a/apps/web/src/components/publish-view/index.js +++ b/apps/web/src/components/publish-view/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useMemo, useState } from "react"; import ReactDOM from "react-dom"; import { Flex, Text, Button } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/reminder-bar/index.js b/apps/web/src/components/reminder-bar/index.js index a8cc73be7..fd5ee043d 100644 --- a/apps/web/src/components/reminder-bar/index.js +++ b/apps/web/src/components/reminder-bar/index.js @@ -1,4 +1,22 @@ -import React, { useMemo } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useMemo } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import { useStore as useAppStore } from "../../stores/app-store"; import { Reminders } from "../../common/reminders"; diff --git a/apps/web/src/components/route-container/index.js b/apps/web/src/components/route-container/index.js index a8df1e978..bb8823654 100644 --- a/apps/web/src/components/route-container/index.js +++ b/apps/web/src/components/route-container/index.js @@ -1,4 +1,22 @@ -import React, { useEffect, useRef, useState } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useEffect, useRef, useState } from "react"; import { Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../icons"; import { useStore } from "../../stores/app-store"; diff --git a/apps/web/src/components/scroll-container/index.js b/apps/web/src/components/scroll-container/index.js index f0ba1010e..88cd010d0 100644 --- a/apps/web/src/components/scroll-container/index.js +++ b/apps/web/src/components/scroll-container/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useRef } from "react"; import { Box } from "@streetwriters/rebass"; import { Scrollbars } from "rc-scrollbars"; @@ -64,7 +82,7 @@ export function FlexScrollContainer({ flex: "1 1 auto", ...style }} - renderView={({ style, ...props }) => ( + renderView={({ _style, ...props }) => ( . + */ + import * as Icon from "../icons"; import "./search.css"; import Field from "../field"; diff --git a/apps/web/src/components/status-bar/index.js b/apps/web/src/components/status-bar/index.js index eeda39698..da68394e4 100644 --- a/apps/web/src/components/status-bar/index.js +++ b/apps/web/src/components/status-bar/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Button, Flex, Text } from "@streetwriters/rebass"; import EditorFooter from "../editor/footer"; import { diff --git a/apps/web/src/components/switch/index.js b/apps/web/src/components/switch/index.js index c50a38dd3..3fc4e243d 100644 --- a/apps/web/src/components/switch/index.js +++ b/apps/web/src/components/switch/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ReactToggle from "react-toggle"; import "react-toggle/style.css"; import "./style.css"; diff --git a/apps/web/src/components/tag/index.js b/apps/web/src/components/tag/index.js index 4340a7fdd..96e50d4c7 100644 --- a/apps/web/src/components/tag/index.js +++ b/apps/web/src/components/tag/index.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ListItem from "../list-item"; import { hashNavigate, navigate } from "../../navigation"; import { Text } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/theme-provider/index.js b/apps/web/src/components/theme-provider/index.js index 63bb4f028..5da25070a 100644 --- a/apps/web/src/components/theme-provider/index.js +++ b/apps/web/src/components/theme-provider/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useStore } from "../../stores/theme-store"; import { ThemeProvider as EmotionThemeProvider } from "@emotion/react"; import { useTheme } from "@notesnook/theme"; diff --git a/apps/web/src/components/time-ago/index.js b/apps/web/src/components/time-ago/index.js index 39c9a58a8..29779365d 100644 --- a/apps/web/src/components/time-ago/index.js +++ b/apps/web/src/components/time-ago/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { formatDate } from "@notesnook/core/utils/date"; import React, { useEffect, useRef } from "react"; import { Text } from "@streetwriters/rebass"; diff --git a/apps/web/src/components/tip/index.js b/apps/web/src/components/tip/index.js index 1a4271192..5f3d57fe2 100644 --- a/apps/web/src/components/tip/index.js +++ b/apps/web/src/components/tip/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Text } from "@streetwriters/rebass"; function TextWithTip({ text, tip, sx, color }) { diff --git a/apps/web/src/components/toggle/index.js b/apps/web/src/components/toggle/index.js index 04a1b1772..510eb3169 100644 --- a/apps/web/src/components/toggle/index.js +++ b/apps/web/src/components/toggle/index.js @@ -1,4 +1,22 @@ -import React, { useCallback } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useCallback } from "react"; import { showBuyDialog } from "../../common/dialog-controller"; import Tip from "../tip"; import { isUserPremium } from "../../hooks/use-is-user-premium"; diff --git a/apps/web/src/components/topic/index.js b/apps/web/src/components/topic/index.js index bd964ba85..d5413527a 100644 --- a/apps/web/src/components/topic/index.js +++ b/apps/web/src/components/topic/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import ListItem from "../list-item"; import { db } from "../../common/db"; diff --git a/apps/web/src/components/trash-item/index.js b/apps/web/src/components/trash-item/index.js index b97880d58..a66b0299e 100644 --- a/apps/web/src/components/trash-item/index.js +++ b/apps/web/src/components/trash-item/index.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ListItem from "../list-item"; import { showMultiPermanentDeleteConfirmation } from "../../common/dialog-controller"; import * as Icon from "../icons"; diff --git a/apps/web/src/components/unlock/index.js b/apps/web/src/components/unlock/index.js index cf472c1d4..bcea2bf06 100644 --- a/apps/web/src/components/unlock/index.js +++ b/apps/web/src/components/unlock/index.js @@ -1,4 +1,22 @@ -import React, { +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useRef, useState, useCallback, diff --git a/apps/web/src/hooks/use-announcements.js b/apps/web/src/hooks/use-announcements.js index eba9ffa56..939b96324 100644 --- a/apps/web/src/hooks/use-announcements.js +++ b/apps/web/src/hooks/use-announcements.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useState } from "react"; import { SUBSCRIPTION_STATUS } from "../common/constants"; import { db } from "../common/db"; @@ -24,15 +42,15 @@ export default function useAnnouncements(type = "inline") { : await db.announcements(); } catch (e) { console.error(e); - } finally { - if (cancelled) return; - let announcements = []; - for (let announcement of CACHED_ANNOUNCEMENTS) { - if (!(await shouldShowAnnouncement(announcement))) continue; - announcements.push(announcement); - } - setAnnouncements(announcements); } + + if (cancelled) return; + let announcements = []; + for (let announcement of CACHED_ANNOUNCEMENTS) { + if (!(await shouldShowAnnouncement(announcement))) continue; + announcements.push(announcement); + } + setAnnouncements(announcements); })(); return () => { cancelled = true; diff --git a/apps/web/src/hooks/use-auto-updater.js b/apps/web/src/hooks/use-auto-updater.js index 599d7a853..40cf3afd3 100644 --- a/apps/web/src/hooks/use-auto-updater.js +++ b/apps/web/src/hooks/use-auto-updater.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { AppEventManager } from "../common/app-events"; import { EVENTS } from "@notesnook/desktop/events"; diff --git a/apps/web/src/hooks/use-database.js b/apps/web/src/hooks/use-database.js index bcb5f5723..677677cf7 100644 --- a/apps/web/src/hooks/use-database.js +++ b/apps/web/src/hooks/use-database.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import { initializeDatabase } from "../common/db"; import { loadTrackerScript } from "../utils/analytics"; diff --git a/apps/web/src/hooks/use-hash-location.ts b/apps/web/src/hooks/use-hash-location.ts index 9e0c1ee80..1fd119ada 100644 --- a/apps/web/src/hooks/use-hash-location.ts +++ b/apps/web/src/hooks/use-hash-location.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState, useEffect } from "react"; import { hashNavigate } from "../navigation"; @@ -28,7 +46,9 @@ export default function useHashLocation() { useEffect(() => { // this function is called whenever the hash changes const handler = (e: HashChangeEvent) => { - const update = (e as any).notify === undefined ? true : (e as any).notify; + const event = e as HashChangeEvent & { notify: boolean }; + + const update = event.notify === undefined ? true : event.notify; console.log(currentLocation()); setLoc({ location: currentLocation(), diff --git a/apps/web/src/hooks/use-hash-routes.js b/apps/web/src/hooks/use-hash-routes.js index 6dae05b01..13c18f6df 100644 --- a/apps/web/src/hooks/use-hash-routes.js +++ b/apps/web/src/hooks/use-hash-routes.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import makeMatcher from "wouter/matcher"; import useHashLocation from "./use-hash-location"; diff --git a/apps/web/src/hooks/use-is-user-premium.js b/apps/web/src/hooks/use-is-user-premium.js index 1e518f408..684d143ec 100644 --- a/apps/web/src/hooks/use-is-user-premium.js +++ b/apps/web/src/hooks/use-is-user-premium.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SUBSCRIPTION_STATUS } from "../common/constants"; import { useStore as useUserStore, diff --git a/apps/web/src/hooks/use-location.js b/apps/web/src/hooks/use-location.js index 416932977..d5a716189 100644 --- a/apps/web/src/hooks/use-location.js +++ b/apps/web/src/hooks/use-location.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { useState, useEffect } = require("react"); const { getCurrentPath, NavigationEvents } = require("../navigation"); diff --git a/apps/web/src/hooks/use-media-query.js b/apps/web/src/hooks/use-media-query.js index 79b0d66d0..eaa4a1814 100644 --- a/apps/web/src/hooks/use-media-query.js +++ b/apps/web/src/hooks/use-media-query.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable react-hooks/rules-of-hooks */ import { useState, useEffect } from "react"; diff --git a/apps/web/src/hooks/use-menu.js b/apps/web/src/hooks/use-menu.js index ea5e34310..09b4d5bb4 100644 --- a/apps/web/src/hooks/use-menu.js +++ b/apps/web/src/hooks/use-menu.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create from "zustand"; import shallow from "zustand/shallow"; import { isUserPremium } from "./use-is-user-premium"; diff --git a/apps/web/src/hooks/use-mobile.js b/apps/web/src/hooks/use-mobile.js index 790a270a5..61d65a51f 100644 --- a/apps/web/src/hooks/use-mobile.js +++ b/apps/web/src/hooks/use-mobile.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import useMediaQuery from "./use-media-query"; const useMobile = () => useMediaQuery("(max-width: 480px)"); diff --git a/apps/web/src/hooks/use-navigate.js b/apps/web/src/hooks/use-navigate.js index fdd65ade3..357fd2d7d 100644 --- a/apps/web/src/hooks/use-navigate.js +++ b/apps/web/src/hooks/use-navigate.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const { useEffect } = require("react"); const { NavigationEvents } = require("../navigation"); diff --git a/apps/web/src/hooks/use-persistent-state.ts b/apps/web/src/hooks/use-persistent-state.ts index e08938ae0..cbc9eadf9 100644 --- a/apps/web/src/hooks/use-persistent-state.ts +++ b/apps/web/src/hooks/use-persistent-state.ts @@ -1,8 +1,26 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import config from "../utils/config"; export function usePersistentState(key: string, def: T) { - let defState = config.get(key, def); + const defState = config.get(key, def); const [value, setValue] = useState(defState); useEffect(() => { diff --git a/apps/web/src/hooks/use-routes.js b/apps/web/src/hooks/use-routes.js index f13cd33cb..1fbccd288 100644 --- a/apps/web/src/hooks/use-routes.js +++ b/apps/web/src/hooks/use-routes.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useLocation } from "wouter"; import makeMatcher from "wouter/matcher"; import { navigate, getHomeRoute } from "../navigation"; diff --git a/apps/web/src/hooks/use-session-state.ts b/apps/web/src/hooks/use-session-state.ts index ee1a9ec1e..e295269ce 100644 --- a/apps/web/src/hooks/use-session-state.ts +++ b/apps/web/src/hooks/use-session-state.ts @@ -1,6 +1,26 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; -const memory: Record = {}; +// eslint-disable-next-line no-var +var memory: Record = {}; + export function useSessionState(key: string, def: T) { const [value, setValue] = useState( memory[key] === undefined ? def : memory[key] diff --git a/apps/web/src/hooks/use-slider.js b/apps/web/src/hooks/use-slider.js index 8c186a2f8..145892ab8 100644 --- a/apps/web/src/hooks/use-slider.js +++ b/apps/web/src/hooks/use-slider.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useMemo, useRef } from "react"; export default function useSlider(sliderId, { onSliding, onChange }) { diff --git a/apps/web/src/hooks/use-status.ts b/apps/web/src/hooks/use-status.ts index eb0a2c637..619be1cb6 100644 --- a/apps/web/src/hooks/use-status.ts +++ b/apps/web/src/hooks/use-status.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create from "zustand"; import produce from "immer"; diff --git a/apps/web/src/hooks/use-system-theme.js b/apps/web/src/hooks/use-system-theme.js index 850fe2ac9..13f0658ea 100644 --- a/apps/web/src/hooks/use-system-theme.js +++ b/apps/web/src/hooks/use-system-theme.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EVENTS } from "@notesnook/desktop/events"; import { useEffect, useState } from "react"; import { AppEventManager } from "../common/app-events"; diff --git a/apps/web/src/hooks/use-tablet.js b/apps/web/src/hooks/use-tablet.js index 7a9c302f9..5f8da7241 100644 --- a/apps/web/src/hooks/use-tablet.js +++ b/apps/web/src/hooks/use-tablet.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import useMediaQuery from "./use-media-query"; const useTablet = () => diff --git a/apps/web/src/hooks/use-timer.ts b/apps/web/src/hooks/use-timer.ts index 414d892f0..23f6789ce 100644 --- a/apps/web/src/hooks/use-timer.ts +++ b/apps/web/src/hooks/use-timer.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef } from "react"; import { useSessionState } from "./use-session-state"; diff --git a/apps/web/src/hooks/use-zoom-factor.js b/apps/web/src/hooks/use-zoom-factor.js index 9c2672cc8..2704a122f 100644 --- a/apps/web/src/hooks/use-zoom-factor.js +++ b/apps/web/src/hooks/use-zoom-factor.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useState } from "react"; import setZoomFactor from "../commands/set-zoom-factor"; diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx index 3db27ab34..10c06502e 100644 --- a/apps/web/src/index.tsx +++ b/apps/web/src/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "@notesnook/core/types"; import { EVENTS } from "@notesnook/desktop/events"; import { AppEventManager } from "./common/app-events"; @@ -7,33 +25,38 @@ import Config from "./utils/config"; import { isTesting } from "./utils/platform"; import { initalizeLogger, logger } from "./utils/logger"; import { Buffer } from "buffer"; +import { AuthProps } from "./views/auth"; global.Buffer = Buffer; initalizeLogger(); if (process.env.REACT_APP_PLATFORM === "desktop") require("./commands"); -type Route = { - component: () => Promise<{ default: (...props: any[]) => JSX.Element }>; - props: Record; +type Route = { + component: () => Promise<{ + default: TProps extends null + ? () => JSX.Element + : (props: TProps) => JSX.Element; + }>; + props: TProps | null; }; -type RouteWithPath = { - route: Route; +type RouteWithPath = { + route: Route; path: Routes; }; -type Routes = - | "/account/recovery" - | "/account/verified" - | "/signup" - | "/login" - | "/sessionexpired" - | "/recover" - | "/mfa/code" - | "/mfa/select" - | "default"; +type Routes = keyof typeof routes; +// | "/account/recovery" +// | "/account/verified" +// | "/signup" +// | "/login" +// | "/sessionexpired" +// | "/recover" +// | "/mfa/code" +// | "/mfa/select" +// | "default"; -const routes: Record = { +const routes = { "/account/recovery": { component: () => import("./views/recovery"), props: { route: "methods" } @@ -66,8 +89,8 @@ const routes: Record = { component: () => import("./views/auth"), props: { route: "login" } }, - default: { component: () => import("./app"), props: {} } -}; + default: { component: () => import("./app"), props: null } +} as const; const sessionExpiryExceptions: Routes[] = [ "/recover", @@ -77,16 +100,16 @@ const sessionExpiryExceptions: Routes[] = [ const serviceWorkerWhitelist: Routes[] = ["default"]; -function getRoute(): RouteWithPath { +function getRoute(): RouteWithPath | RouteWithPath { const path = getCurrentPath() as Routes; logger.info(`Getting route for path: ${path}`); const signup = redirectToRegistration(path); const sessionExpired = isSessionExpired(path); const fallback = fallbackRoute(); - const route: RouteWithPath | null = routes[path] - ? { route: routes[path], path } - : null; + const route = ( + routes[path] ? { route: routes[path], path } : null + ) as RouteWithPath | null; return signup || sessionExpired || route || fallback; } @@ -95,7 +118,7 @@ function fallbackRoute(): RouteWithPath { return { route: routes.default, path: "default" }; } -function redirectToRegistration(path: Routes): RouteWithPath | null { +function redirectToRegistration(path: Routes): RouteWithPath | null { if (!isTesting() && !shouldSkipInitiation() && !routes[path]) { window.history.replaceState({}, "", makeURL("/signup", getCurrentHash())); return { route: routes["/signup"], path: "/signup" }; @@ -103,7 +126,7 @@ function redirectToRegistration(path: Routes): RouteWithPath | null { return null; } -function isSessionExpired(path: Routes): RouteWithPath | null { +function isSessionExpired(path: Routes): RouteWithPath | null { const isSessionExpired = Config.get("sessionExpired", false); if (isSessionExpired && !sessionExpiryExceptions.includes(path)) { logger.info(`User session has expired. Routing to /sessionexpired`); @@ -139,11 +162,15 @@ async function renderApp() { logger.measure("app render"); const { default: Component } = await component(); - render(, document.getElementById("root"), () => { - logger.measure("app render"); + render( + , + document.getElementById("root"), + () => { + logger.measure("app render"); - document.getElementById("splash")?.remove(); - }); + document.getElementById("splash")?.remove(); + } + ); } async function initializeServiceWorker() { diff --git a/apps/web/src/interfaces/fs.js b/apps/web/src/interfaces/fs.js index 056d5d430..b404c3478 100644 --- a/apps/web/src/interfaces/fs.js +++ b/apps/web/src/interfaces/fs.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "web-streams-polyfill/dist/ponyfill"; import localforage from "localforage"; import { xxhash64, createXXHash64 } from "hash-wasm"; @@ -122,6 +140,7 @@ async function hashStream(reader) { const hasher = await createXXHash64(); hasher.init(); + // eslint-disable-next-line no-constant-condition while (true) { const { value } = await reader.read(); if (!value) break; @@ -204,7 +223,7 @@ async function uploadFile(filename, requestOptions) { await fileHandle.addAdditionalData("uploadId", uploadId); - function onUploadProgress(ev) { + const onUploadProgress = (ev) => { reportProgress( { total: fileHandle.file.size + ABYTES, @@ -215,7 +234,7 @@ async function uploadFile(filename, requestOptions) { hash: filename } ); - } + }; for (let i = uploadedChunks.length; i < TOTAL_PARTS; ++i) { const blob = await fileHandle.readChunks( diff --git a/apps/web/src/interfaces/nncrypto.stub.ts b/apps/web/src/interfaces/nncrypto.stub.ts index 6be88140d..a011818f8 100644 --- a/apps/web/src/interfaces/nncrypto.stub.ts +++ b/apps/web/src/interfaces/nncrypto.stub.ts @@ -1,5 +1,22 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { INNCrypto } from "@notesnook/crypto/dist/src/interfaces"; -// eslint-disable-next-line import/no-webpack-loader-syntax import "worker-loader?filename=static/workers/nncrypto.worker.js!@notesnook/crypto-worker/dist/src/worker.js"; const WORKER_PATH = "/static/workers/nncrypto.worker.js"; @@ -15,7 +32,7 @@ async function loadNNCrypto() { } } -var instance: INNCrypto | null = null; +let instance: INNCrypto | null = null; export function getNNCrypto(): Promise { if (instance) return Promise.resolve(instance); @@ -26,12 +43,13 @@ export function getNNCrypto(): Promise { }); } -var processing = false; -var queue: Array = []; +let processing = false; +type PromiseResolve = (value: Awaited) => void; +const queue: Array = []; async function queueify(action: () => Promise): Promise { if (processing) return new Promise((resolve) => { - queue.push(resolve); + queue.push(resolve as PromiseResolve); }); processing = true; @@ -40,6 +58,7 @@ async function queueify(action: () => Promise): Promise { while (queue.length > 0) { const resolve = queue.pop(); + if (!resolve) continue; resolve(result); } return result; diff --git a/apps/web/src/interfaces/storage.ts b/apps/web/src/interfaces/storage.ts index 84dad5962..898a31e58 100644 --- a/apps/web/src/interfaces/storage.ts +++ b/apps/web/src/interfaces/storage.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import localforage from "localforage"; import { extendPrototype } from "localforage-getitems"; import * as MemoryDriver from "localforage-driver-memory"; @@ -58,13 +76,15 @@ export class NNStorage { const crypto = await getNNCrypto(); const keyData = await crypto.exportKey(password, salt); - if (this.isIndexedDBSupported() && window?.crypto?.subtle) { + if (this.isIndexedDBSupported() && window?.crypto?.subtle && keyData.key) { const pbkdfKey = await derivePBKDF2Key(password); await this.write(name, pbkdfKey); - const cipheredKey = await aesEncrypt(pbkdfKey, keyData.key!); + const cipheredKey = await aesEncrypt(pbkdfKey, keyData.key); await this.write(`${name}@_k`, cipheredKey); - } else { + } else if (keyData.key) { await this.write(`${name}@_k`, keyData.key); + } else { + throw new Error(`Invalid key.`); } } @@ -121,8 +141,8 @@ export class NNStorage { } } -let enc = new TextEncoder(); -let dec = new TextDecoder(); +const enc = new TextEncoder(); +const dec = new TextDecoder(); async function derivePBKDF2Key(password: string): Promise { const key = await window.crypto.subtle.importKey( @@ -133,7 +153,7 @@ async function derivePBKDF2Key(password: string): Promise { ["deriveKey"] ); - let salt = window.crypto.getRandomValues(new Uint8Array(16)); + const salt = window.crypto.getRandomValues(new Uint8Array(16)); return await window.crypto.subtle.deriveKey( { name: "PBKDF2", @@ -152,7 +172,7 @@ async function aesEncrypt( cryptoKey: CryptoKey, data: string ): Promise { - let iv = window.crypto.getRandomValues(new Uint8Array(12)); + const iv = window.crypto.getRandomValues(new Uint8Array(12)); const cipher = await window.crypto.subtle.encrypt( { diff --git a/apps/web/src/navigation/hash-routes.js b/apps/web/src/navigation/hash-routes.js index b688346a0..9b6c2f43a 100644 --- a/apps/web/src/navigation/hash-routes.js +++ b/apps/web/src/navigation/hash-routes.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Vault from "../common/vault"; import { showBuyDialog, diff --git a/apps/web/src/navigation/index.js b/apps/web/src/navigation/index.js index 80a8c6919..21034ed1c 100644 --- a/apps/web/src/navigation/index.js +++ b/apps/web/src/navigation/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState } from "react"; import EventManager from "@notesnook/core/utils/event-manager"; import Config from "../utils/config"; diff --git a/apps/web/src/navigation/routes.js b/apps/web/src/navigation/routes.js index 12e1a1c9a..b0a59ce1d 100644 --- a/apps/web/src/navigation/routes.js +++ b/apps/web/src/navigation/routes.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/db"; import Home from "../views/home"; import Notebooks from "../views/notebooks"; diff --git a/apps/web/src/re-exports/react-qrcode-logo.js b/apps/web/src/re-exports/react-qrcode-logo.js index fbf023eb9..46d4dcab6 100644 --- a/apps/web/src/re-exports/react-qrcode-logo.js +++ b/apps/web/src/re-exports/react-qrcode-logo.js @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export { QRCode as default } from "react-qrcode-logo"; diff --git a/apps/web/src/react-app-env.d.ts b/apps/web/src/react-app-env.d.ts index 6431bc5fc..e96c95578 100644 --- a/apps/web/src/react-app-env.d.ts +++ b/apps/web/src/react-app-env.d.ts @@ -1 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /// + +const _ignore; diff --git a/apps/web/src/service-worker-registration.js b/apps/web/src/service-worker-registration.js index 15700f734..8f1546a68 100644 --- a/apps/web/src/service-worker-registration.js +++ b/apps/web/src/service-worker-registration.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // This optional code is used to register a service worker. // register() is not called by default. diff --git a/apps/web/src/service-worker.js b/apps/web/src/service-worker.js index f77f99d06..de5938a21 100644 --- a/apps/web/src/service-worker.js +++ b/apps/web/src/service-worker.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* eslint-disable no-restricted-globals */ // This service worker can be customized! @@ -82,13 +100,15 @@ self.addEventListener("message", (event) => { self.skipWaiting(); break; case "GET_VERSION": - const VERSION = process.env.REACT_APP_VERSION; - const HASH = process.env.REACT_APP_GIT_HASH; - event.source.postMessage({ - type: data.type, - version: VERSION, - hash: HASH - }); + { + const VERSION = process.env.REACT_APP_VERSION; + const HASH = process.env.REACT_APP_GIT_HASH; + event.source.postMessage({ + type: data.type, + version: VERSION, + hash: HASH + }); + } break; default: break; diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js index 458f8d77d..ebe2cf612 100644 --- a/apps/web/src/stores/app-store.js +++ b/apps/web/src/stores/app-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import { store as noteStore } from "./note-store"; diff --git a/apps/web/src/stores/attachment-store.js b/apps/web/src/stores/attachment-store.js index 82051082e..0cc70541f 100644 --- a/apps/web/src/stores/attachment-store.js +++ b/apps/web/src/stores/attachment-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js index f86d83e51..bfa2cae13 100644 --- a/apps/web/src/stores/editor-store.js +++ b/apps/web/src/stores/editor-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { store as noteStore } from "./note-store"; import { store as attachmentStore } from "./attachment-store"; diff --git a/apps/web/src/stores/index.js b/apps/web/src/stores/index.js index b94a187e0..743f30725 100644 --- a/apps/web/src/stores/index.js +++ b/apps/web/src/stores/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + class BaseStore { static new(set, get) { return new this(set, get); diff --git a/apps/web/src/stores/monograph-store.js b/apps/web/src/stores/monograph-store.js index 266b28f56..474f49acf 100644 --- a/apps/web/src/stores/monograph-store.js +++ b/apps/web/src/stores/monograph-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.js index fda57e8fa..3af3952ff 100644 --- a/apps/web/src/stores/note-store.js +++ b/apps/web/src/stores/note-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/db"; import createStore from "../common/store"; import { store as editorStore } from "./editor-store"; @@ -189,13 +207,14 @@ function notesFromContext(context) { case "color": notes = db.notes.colored(context.value); break; - case "topic": + case "topic": { const notebook = db.notebooks.notebook(context?.value?.id); if (!notebook) break; const topic = notebook.topics?.topic(context?.value?.topic); if (!topic) break; notes = topic.all; break; + } case "favorite": notes = db.notes.favorites; break; diff --git a/apps/web/src/stores/notebook-store.js b/apps/web/src/stores/notebook-store.js index 388f72c7e..90500585f 100644 --- a/apps/web/src/stores/notebook-store.js +++ b/apps/web/src/stores/notebook-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/db"; import createStore from "../common/store"; import { store as appStore } from "./app-store"; diff --git a/apps/web/src/stores/search-store.js b/apps/web/src/stores/search-store.js index b746e6e78..037bc90ab 100644 --- a/apps/web/src/stores/search-store.js +++ b/apps/web/src/stores/search-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/selection-store.js b/apps/web/src/stores/selection-store.js index 476cf7576..1fd2e0983 100644 --- a/apps/web/src/stores/selection-store.js +++ b/apps/web/src/stores/selection-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/setting-store.js b/apps/web/src/stores/setting-store.js index 4da8279c1..e5c289636 100644 --- a/apps/web/src/stores/setting-store.js +++ b/apps/web/src/stores/setting-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import Config from "../utils/config"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/tag-store.js b/apps/web/src/stores/tag-store.js index 7d5260e42..9e581fabf 100644 --- a/apps/web/src/stores/tag-store.js +++ b/apps/web/src/stores/tag-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/theme-store.js b/apps/web/src/stores/theme-store.js index d1f4afd32..79a6ffea2 100644 --- a/apps/web/src/stores/theme-store.js +++ b/apps/web/src/stores/theme-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import BaseStore from "./index"; import Config from "../utils/config"; @@ -5,6 +23,9 @@ import changeAppTheme from "../commands/change-app-theme"; import { getDefaultAccentColor } from "@notesnook/theme"; class ThemeStore extends BaseStore { + /** + * @type {"dark" | "light"} + */ theme = Config.get("theme", "light"); accent = Config.get("accent", getDefaultAccentColor()); followSystemTheme = Config.get("followSystemTheme", false); diff --git a/apps/web/src/stores/trash-store.js b/apps/web/src/stores/trash-store.js index cd43f9eeb..b9174ac0b 100644 --- a/apps/web/src/stores/trash-store.js +++ b/apps/web/src/stores/trash-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { db } from "../common/db"; import createStore from "../common/store"; import BaseStore from "./index"; diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js index 0d5441a23..5c9bba270 100644 --- a/apps/web/src/stores/user-store.js +++ b/apps/web/src/stores/user-store.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import createStore from "../common/store"; import { db } from "../common/db"; import BaseStore from "./index"; @@ -71,7 +89,7 @@ class UserStore extends BaseStore { }); config.clear(); EV.publish(EVENTS.appRefreshRequested); - if (!!reason) { + if (reason) { await showAccountLoggedOutNotice(reason); } }); diff --git a/apps/web/src/utils/analytics.ts b/apps/web/src/utils/analytics.ts index 28d0ff50f..9da0b3b41 100644 --- a/apps/web/src/utils/analytics.ts +++ b/apps/web/src/utils/analytics.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Config from "./config"; import { getPlatform } from "./platform"; import { appVersion } from "./version"; @@ -18,7 +36,7 @@ declare global { export function loadTrackerScript() { if (Config.get("telemetry") === "false") return; - var script = document.createElement("script"); + const script = document.createElement("script"); script.src = "/an.js"; script.async = true; script.dataset.websiteId = "f16c07d9-c77b-4781-bfbd-f58e95640002"; @@ -28,7 +46,7 @@ export function loadTrackerScript() { script.dataset.autoTrack = "false"; script.dataset.doNotTrack = "true"; script.dataset.hostUrl = "https://analytics.streetwriters.co"; - var firstScriptElement = document.getElementsByTagName("script")[0]; + const firstScriptElement = document.getElementsByTagName("script")[0]; script.onload = function () { trackVisit(); }; @@ -92,7 +110,7 @@ export function trackEvent(event: TrackerEvent, eventMessage?: string) { else if (eventMessage) window.umami.trackEvent(eventMessage, event.name); } -export function trackVisit(url: string = "/") { +export function trackVisit(url = "/") { if (Config.get("telemetry") === "false") return; const platform = getPlatform(); if (!window.umami || !platform) return; diff --git a/apps/web/src/utils/color.js b/apps/web/src/utils/color.js index dc5ee9803..fec1631b0 100644 --- a/apps/web/src/utils/color.js +++ b/apps/web/src/utils/color.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function hexToRGB(hex, alpha = 1) { let parseString = hex; if (hex.startsWith("#")) { diff --git a/apps/web/src/utils/config.ts b/apps/web/src/utils/config.ts index d171f9152..ef8f8ccc6 100644 --- a/apps/web/src/utils/config.ts +++ b/apps/web/src/utils/config.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { tryParse } from "./parse"; function set(key: string, value: T) { @@ -15,8 +33,8 @@ function clear() { window.localStorage.clear(); } -function all(): Record { - const data: Record = {}; +function all(): Record { + const data: Record = {}; for (let i = 0; i < window.localStorage.length; ++i) { const key = window.localStorage.key(i); if (!key) continue; diff --git a/apps/web/src/utils/css.js b/apps/web/src/utils/css.js index 1348647b0..d50d4eea5 100644 --- a/apps/web/src/utils/css.js +++ b/apps/web/src/utils/css.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function removeCss(id) { var link = document.getElementById(id); link.remove(); diff --git a/apps/web/src/utils/debounce.ts b/apps/web/src/utils/debounce.ts index 75af5eb01..687ab6a04 100644 --- a/apps/web/src/utils/debounce.ts +++ b/apps/web/src/utils/debounce.ts @@ -1,31 +1,49 @@ -export function debounce any>( +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export function debounce void>( func: F, waitFor: number ) { - let timeout: NodeJS.Timeout | null; + let timeout: number | null; - const debounced = (...args: any) => { + const debounced = (...args: Parameters) => { if (timeout) clearTimeout(timeout); - timeout = setTimeout(() => func(...args), waitFor); + timeout = setTimeout(() => func(...args), waitFor) as unknown as number; }; - return debounced as (...args: Parameters) => ReturnType; + return debounced; } -export function debounceWithId any>( +export function debounceWithId void>( func: F, waitFor: number ) { - var timeout: NodeJS.Timeout | null = null; - var debounceId: string | null = null; + let timeout: number | null; + let debounceId: string | null = null; - const debounced = (id: string, ...args: any) => { + const debounced = (id: string, ...args: Parameters) => { if (timeout && id === debounceId) clearTimeout(timeout); debounceId = id; timeout = setTimeout(() => { func(...args); - }, waitFor); + }, waitFor) as unknown as number; }; - return debounced as (id: string, ...args: Parameters) => ReturnType; + return debounced; } diff --git a/apps/web/src/utils/dimensions.js b/apps/web/src/utils/dimensions.js index 86430a7b2..6d31b0c27 100644 --- a/apps/web/src/utils/dimensions.js +++ b/apps/web/src/utils/dimensions.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function isMobile() { var match = window.matchMedia || window.msMatchMedia; if (match) { diff --git a/apps/web/src/utils/filename.js b/apps/web/src/utils/filename.js index 0f75deee5..7f1cb5b4a 100644 --- a/apps/web/src/utils/filename.js +++ b/apps/web/src/utils/filename.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*jshint node:true*/ /** diff --git a/apps/web/src/utils/importer.js b/apps/web/src/utils/importer.js index 209f78abb..af4838622 100644 --- a/apps/web/src/utils/importer.js +++ b/apps/web/src/utils/importer.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { unzipSync } from "fflate"; import { db } from "../common/db"; import FS from "../interfaces/fs"; diff --git a/apps/web/src/utils/keyboard.js b/apps/web/src/utils/keyboard.js index 19fa1deeb..eed91845e 100644 --- a/apps/web/src/utils/keyboard.js +++ b/apps/web/src/utils/keyboard.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import EventManager from "@notesnook/core/utils/event-manager"; const GlobalKeyboard = {}; diff --git a/apps/web/src/utils/logger.ts b/apps/web/src/utils/logger.ts index 1899160e3..68e04b512 100644 --- a/apps/web/src/utils/logger.ts +++ b/apps/web/src/utils/logger.ts @@ -1,15 +1,34 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { initalize, logger as _logger, logManager } from "@notesnook/core/logger"; +import { LogMessage } from "@notesnook/logger"; import FileSaver from "file-saver"; import { DatabasePersistence, NNStorage } from "../interfaces/storage"; import { zip } from "./zip"; -var logger: typeof _logger; +let logger: typeof _logger; function initalizeLogger(persistence: DatabasePersistence = "db") { - initalize(new NNStorage("Logs", persistence) as any); + initalize(new NNStorage("Logs", persistence)); logger = _logger.scope("notesnook-web"); } @@ -18,7 +37,9 @@ async function downloadLogs() { const allLogs = await logManager.get(); const files = allLogs.map((log) => ({ filename: log.key, - content: (log.logs as any[]).map((line) => JSON.stringify(line)).join("\n") + content: (log.logs as LogMessage[]) + .map((line) => JSON.stringify(line)) + .join("\n") })); const archive = await zip(files, "log"); FileSaver.saveAs(new Blob([archive.buffer]), "notesnook-logs.zip"); diff --git a/apps/web/src/utils/object.js b/apps/web/src/utils/object.js index 10d9b5ceb..b8fa3deb2 100644 --- a/apps/web/src/utils/object.js +++ b/apps/web/src/utils/object.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function objectMap(obj, fn) { return Object.entries(obj).map(([k, v], i) => fn(k, v, i)); } diff --git a/apps/web/src/utils/page-visibility.js b/apps/web/src/utils/page-visibility.js index 82a2a160d..ae324efaf 100644 --- a/apps/web/src/utils/page-visibility.js +++ b/apps/web/src/utils/page-visibility.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + var hidden, visibilityChange; if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support diff --git a/apps/web/src/utils/parse.js b/apps/web/src/utils/parse.js index c96f17880..488a83066 100644 --- a/apps/web/src/utils/parse.js +++ b/apps/web/src/utils/parse.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function tryParse(val) { if (val === "undefined" || val === "null") return; diff --git a/apps/web/src/utils/platform.js b/apps/web/src/utils/platform.js index 2ceea0cf6..7393f2129 100644 --- a/apps/web/src/utils/platform.js +++ b/apps/web/src/utils/platform.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function getPlatform() { var userAgent = window.navigator.userAgent, platform = window.navigator.platform, diff --git a/apps/web/src/utils/random.js b/apps/web/src/utils/random.js index 417c31b10..d57a38686 100644 --- a/apps/web/src/utils/random.js +++ b/apps/web/src/utils/random.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function getRandom(min, max) { return Math.round(Math.random() * (max - min) + min); } diff --git a/apps/web/src/utils/string.js b/apps/web/src/utils/string.js index 7849c97f1..dbeb77e51 100644 --- a/apps/web/src/utils/string.js +++ b/apps/web/src/utils/string.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function toTitleCase(str) { if (!str || !str[0]) { return ""; diff --git a/apps/web/src/utils/toast.tsx b/apps/web/src/utils/toast.tsx index 65ec70a69..73e648b43 100644 --- a/apps/web/src/utils/toast.tsx +++ b/apps/web/src/utils/toast.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Button, Flex, Text } from "@streetwriters/rebass"; import ThemeProvider from "../components/theme-provider"; import { Error, Warn, Success } from "../components/icons"; @@ -15,7 +33,7 @@ function showToast( type: ToastType, message: string, actions?: ToastAction[], - hideAfter: number = 5000 + hideAfter = 5000 ): { hide: () => void } { if (appstore.get().isFocusMode) return { hide: () => {} }; // TODO diff --git a/apps/web/src/utils/version.ts b/apps/web/src/utils/version.ts index e2cf31ff3..01d38c897 100644 --- a/apps/web/src/utils/version.ts +++ b/apps/web/src/utils/version.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export type Platforms = "web" | "desktop"; export type AppVersion = typeof appVersion; export const appVersion = { diff --git a/apps/web/src/utils/zip.ts b/apps/web/src/utils/zip.ts index 213178f28..1b7ea6b1a 100644 --- a/apps/web/src/utils/zip.ts +++ b/apps/web/src/utils/zip.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Unzipped } from "fflate"; import { sanitizeFilename } from "./filename"; diff --git a/apps/web/src/views/auth.tsx b/apps/web/src/views/auth.tsx index 9af47e041..0bbfff6c7 100644 --- a/apps/web/src/views/auth.tsx +++ b/apps/web/src/views/auth.tsx @@ -1,5 +1,23 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { Button, Flex, Text } from "@streetwriters/rebass"; +import { BoxProps, Button, Flex, Text } from "@streetwriters/rebass"; import { CheckCircle, Loading, @@ -89,7 +107,7 @@ type AuthRoutes = | "recover" | "mfa:code" | "mfa:select"; -type AuthProps = { route: AuthRoutes }; +export type AuthProps = { route: AuthRoutes }; type AuthComponent = ( props: BaseAuthComponentProps @@ -316,7 +334,7 @@ function Signup(props: BaseAuthComponentProps<"signup">) { loading={!isAppLoaded} /> - By pressing "Create account" button, you agree to our{" "} + By pressing {`"Create account" button, you agree to our`}{" "} ) { mt={2} variant="anchor" color="text" - onClick={() => navigate("recover", { email: user!.email })} + onClick={() => user && navigate("recover", { email: user.email })} > Forgot password? @@ -539,7 +557,7 @@ function MFACode(props: BaseAuthComponentProps<"mfa:code">) { async (selectedMethod: "sms" | "email", token: string) => { setIsSending(true); try { - await db.mfa!.sendCode(selectedMethod, token); + await db.mfa?.sendCode(selectedMethod, token); setEnabled(false); } catch (e) { const error = e as Error; @@ -648,7 +666,7 @@ type MFAMethodType = AuthenticatorType | "recoveryCode"; type MFAMethod = { type: MFAMethodType; title: string; - icon: (props: any) => JSX.Element; + icon: (props: BoxProps) => JSX.Element; }; const MFAMethods: MFAMethod[] = [ { type: "app", title: "Use an authenticator app", icon: MFAAuthenticator }, @@ -683,7 +701,7 @@ function MFASelector(props: BaseAuthComponentProps<"mfa:select">) { title: "Logging you in", subtitle: "Please wait while you are authenticated." }} - onSubmit={async (form) => { + onSubmit={async () => { const selectedType = MFAMethods[selected]; formData.selectedMethod = selectedType.type; navigate("mfa:code", formData); @@ -925,7 +943,7 @@ async function login( Config.set("sessionExpired", false); openURL("/"); } catch (e) { - const error = e as any; + const error = e as Error & { code?: string; data?: unknown }; if (error.code === "mfa_required") { const { primaryMethod, phoneNumber, secondaryMethod, token } = error.data as MFAErrorData; diff --git a/apps/web/src/views/email-confirmed.js b/apps/web/src/views/email-confirmed.js index c600de115..8b5ada4df 100644 --- a/apps/web/src/views/email-confirmed.js +++ b/apps/web/src/views/email-confirmed.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "../app.css"; import { useEffect } from "react"; import { Flex, Text } from "@streetwriters/rebass"; @@ -96,7 +114,7 @@ const social = [ link: "https://reddit.com/r/Notesnook" } ]; -function BlogPromoBanner(props) { +function BlogPromoBanner() { return ( @@ -110,11 +128,12 @@ function BlogPromoBanner(props) { mt={2} sx={{ wordWrap: "break-word" }} > - Because where's the fun in nookin' alone? + {`Because where's the fun in nookin' alone?`} {social.map((account) => ( { diff --git a/apps/web/src/views/home.js b/apps/web/src/views/home.js index 95567a1e8..067906a1c 100644 --- a/apps/web/src/views/home.js +++ b/apps/web/src/views/home.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useEffect, useState } from "react"; import { useStore, store } from "../stores/note-store"; import ListContainer from "../components/list-container"; diff --git a/apps/web/src/views/notebooks.js b/apps/web/src/views/notebooks.js index 14deccc03..0ae3f093f 100644 --- a/apps/web/src/views/notebooks.js +++ b/apps/web/src/views/notebooks.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ListContainer from "../components/list-container"; import { useStore, store } from "../stores/notebook-store"; import NotebooksPlaceholder from "../components/placeholders/notebooks-placeholder"; diff --git a/apps/web/src/views/notes.js b/apps/web/src/views/notes.js index 51e95138b..cfe35067b 100644 --- a/apps/web/src/views/notes.js +++ b/apps/web/src/views/notes.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useState } from "react"; import ListContainer from "../components/list-container"; import { useStore as useNotesStore } from "../stores/note-store"; diff --git a/apps/web/src/views/recovery.tsx b/apps/web/src/views/recovery.tsx index 18b3ec7fe..4f6fe9425 100644 --- a/apps/web/src/views/recovery.tsx +++ b/apps/web/src/views/recovery.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useMemo, useRef, useState } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import { Error as ErrorIcon } from "../components/icons"; @@ -13,7 +31,7 @@ import { showRecoveryKeyDialog } from "../common/dialog-controller"; import Config from "../utils/config"; type RecoveryMethodType = "key" | "backup" | "reset"; -type RecoveryMethodsFormData = {}; +type RecoveryMethodsFormData = Record; type RecoveryKeyFormData = { recoveryKey: string; @@ -22,7 +40,7 @@ type RecoveryKeyFormData = { type BackupFileFormData = { backupFile: { file: File; - backup: any; + backup: Record; }; }; @@ -264,6 +282,7 @@ function RecoveryMethods(props: BaseRecoveryComponentProps<"methods">) { > {recoveryMethods.map((method, index) => ( ); @@ -392,7 +411,7 @@ function BackupFileMethod(props: BaseRecoveryComponentProps<"method:backup">) { color="text" onClick={() => navigate("methods")} > - Don't have a backup file? + {`Don't have a backup file?`} ); diff --git a/apps/web/src/views/search.js b/apps/web/src/views/search.js index 8e56302b4..f512c8b6e 100644 --- a/apps/web/src/views/search.js +++ b/apps/web/src/views/search.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import ListContainer from "../components/list-container"; import SearchPlaceholder from "../components/placeholders/search-placeholder"; @@ -12,18 +30,20 @@ import { hardNavigate } from "../navigation"; async function typeToItems(type, context) { switch (type) { - case "notes": + case "notes": { await db.notes.init(); if (!context) return ["notes", db.notes.all]; const notes = context.notes; return ["notes", notes]; + } case "notebooks": return ["notebooks", db.notebooks.all]; - case "topics": + case "topics": { const notebookId = notebookstore.get().selectedNotebookId; if (!notebookId) return ["topics", []]; const topics = db.notebooks.notebook(notebookId).topics.all; return ["topics", topics]; + } case "tags": return ["tags", db.tags.all]; case "trash": @@ -68,28 +88,32 @@ function Search({ type }) { case "notes": if (!context) return "all notes"; switch (context.type) { - case "topic": + case "topic": { const notebook = db.notebooks.notebook(context.value.id); const topic = notebook.topics.topic(context.value.topic); return `notes of ${topic._topic.title} in ${notebook.title}`; - case "tag": + } + case "tag": { const tag = db.tags.all.find((tag) => tag.id === context.value); return `notes in #${tag.title}`; + } case "favorite": return "favorite notes"; - case "color": + case "color": { const color = db.colors.all.find((tag) => tag.id === context.value); return `notes in color ${color.title}`; + } default: return; } case "notebooks": return "all notebooks"; - case "topics": + case "topics": { const notebookId = notebookstore.get().selectedNotebookId; if (!notebookId) return ""; const notebook = db.notebooks.notebook(notebookId); return `topics in ${notebook.title} notebook`; + } case "tags": return "all tags"; case "trash": diff --git a/apps/web/src/views/settings.js b/apps/web/src/views/settings.js index e645140e3..05f065e32 100644 --- a/apps/web/src/views/settings.js +++ b/apps/web/src/views/settings.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useMemo, useState } from "react"; import { Button, Flex, Text } from "@streetwriters/rebass"; import * as Icon from "../components/icons"; @@ -100,7 +118,7 @@ const otherItems = [ } ]; -function Settings(props) { +function Settings() { const [groups, setGroups] = useState({ appearance: false, editor: false, diff --git a/apps/web/src/views/tags.js b/apps/web/src/views/tags.js index e77ac8754..d71062636 100644 --- a/apps/web/src/views/tags.js +++ b/apps/web/src/views/tags.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ListContainer from "../components/list-container"; import { useStore, store } from "../stores/tag-store"; import TagsPlaceholder from "../components/placeholders/tags-placeholder"; diff --git a/apps/web/src/views/topics.js b/apps/web/src/views/topics.js index e703befbf..445668582 100644 --- a/apps/web/src/views/topics.js +++ b/apps/web/src/views/topics.js @@ -1,4 +1,22 @@ -import React, { useEffect, useState } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { useEffect, useState } from "react"; import ListContainer from "../components/list-container"; import { useStore as useNbStore } from "../stores/notebook-store"; import { useStore as useAppStore } from "../stores/app-store"; diff --git a/apps/web/src/views/trash.js b/apps/web/src/views/trash.js index 84f6cc664..563379702 100644 --- a/apps/web/src/views/trash.js +++ b/apps/web/src/views/trash.js @@ -1,4 +1,21 @@ -import React from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import * as Icon from "../components/icons"; import ListContainer from "../components/list-container"; import { confirm } from "../common/dialog-controller"; diff --git a/package-lock.json b/package-lock.json index 748bafa97..1f06ee3be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,9 @@ "eslint-config-react-hooks": "^1.0.0", "eslint-plugin-detox": "^1.0.0", "eslint-plugin-jest": "^26.8.7", + "eslint-plugin-license-header": "^0.6.0", "eslint-plugin-react": "^7.31.0", + "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-unused-imports": "^2.0.0", "husky": "^8.0.1", @@ -6221,6 +6223,24 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-license-header": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-license-header/-/eslint-plugin-license-header-0.6.0.tgz", + "integrity": "sha512-IEywStBWaDBDMkogYoKUAdaOuomZ+YaQmdoSD2vHmXobekM+XuP6SWLlvwUUhIbdocn3MTlb5CUJ8E4VHz1c/w==", + "dev": true, + "dependencies": { + "requireindex": "^1.2.0" + } + }, + "node_modules/eslint-plugin-license-header/node_modules/requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true, + "engines": { + "node": ">=0.10.5" + } + }, "node_modules/eslint-plugin-react": { "version": "7.31.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.0.tgz", @@ -16793,6 +16813,23 @@ } } }, + "eslint-plugin-license-header": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-license-header/-/eslint-plugin-license-header-0.6.0.tgz", + "integrity": "sha512-IEywStBWaDBDMkogYoKUAdaOuomZ+YaQmdoSD2vHmXobekM+XuP6SWLlvwUUhIbdocn3MTlb5CUJ8E4VHz1c/w==", + "dev": true, + "requires": { + "requireindex": "^1.2.0" + }, + "dependencies": { + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + } + } + }, "eslint-plugin-react": { "version": "7.31.0", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.0.tgz", diff --git a/package.json b/package.json index 356510ee0..12a4d2034 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,9 @@ "eslint-config-react-hooks": "^1.0.0", "eslint-plugin-detox": "^1.0.0", "eslint-plugin-jest": "^26.8.7", + "eslint-plugin-license-header": "^0.6.0", "eslint-plugin-react": "^7.31.0", + "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-unused-imports": "^2.0.0", "husky": "^8.0.1", diff --git a/packages/core/__e2e__/monographs.test.js b/packages/core/__e2e__/monographs.test.js index 1ba215b74..a43f7aa42 100644 --- a/packages/core/__e2e__/monographs.test.js +++ b/packages/core/__e2e__/monographs.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { databaseTest, noteTest, StorageInterface } from "../__tests__/utils"; const user = { diff --git a/packages/core/__e2e__/offers.test.js b/packages/core/__e2e__/offers.test.js index 4f705c494..904d98514 100644 --- a/packages/core/__e2e__/offers.test.js +++ b/packages/core/__e2e__/offers.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import hosts from "../utils/constants"; import Offers from "../api/offers"; diff --git a/packages/core/__e2e__/token-manager.test.js b/packages/core/__e2e__/token-manager.test.js index b2598ab13..96eb572cd 100644 --- a/packages/core/__e2e__/token-manager.test.js +++ b/packages/core/__e2e__/token-manager.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import DB from "../api"; import StorageInterface from "../__mocks__/storage.mock"; diff --git a/packages/core/__e2e__/user-manager.test.js b/packages/core/__e2e__/user-manager.test.js index 05502ecc7..8b4965065 100644 --- a/packages/core/__e2e__/user-manager.test.js +++ b/packages/core/__e2e__/user-manager.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { databaseTest } from "../__tests__/utils"; const user = { diff --git a/packages/core/__mocks__/fs.mock.js b/packages/core/__mocks__/fs.mock.js index 4943dda87..833c1b7e7 100644 --- a/packages/core/__mocks__/fs.mock.js +++ b/packages/core/__mocks__/fs.mock.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + var fs = {}; function hasItem(key) { diff --git a/packages/core/__mocks__/node-storage.mock.js b/packages/core/__mocks__/node-storage.mock.js index 686232028..f2d19c458 100644 --- a/packages/core/__mocks__/node-storage.mock.js +++ b/packages/core/__mocks__/node-storage.mock.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NNCrypto } from "@notesnook/crypto"; export class NodeStorageInterface { diff --git a/packages/core/__mocks__/storage.mock.js b/packages/core/__mocks__/storage.mock.js index 1c89b6da9..a0871ff3f 100644 --- a/packages/core/__mocks__/storage.mock.js +++ b/packages/core/__mocks__/storage.mock.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + var storage = {}; async function read(key) { diff --git a/packages/core/__tests__/backup.test.js b/packages/core/__tests__/backup.test.js index f37ea38ac..64ebd22a8 100644 --- a/packages/core/__tests__/backup.test.js +++ b/packages/core/__tests__/backup.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StorageInterface, databaseTest, diff --git a/packages/core/__tests__/content.test.js b/packages/core/__tests__/content.test.js index b546628ab..004fb3b9f 100644 --- a/packages/core/__tests__/content.test.js +++ b/packages/core/__tests__/content.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StorageInterface, databaseTest } from "./utils"; beforeEach(() => { diff --git a/packages/core/__tests__/db.test.js b/packages/core/__tests__/db.test.js index a2a792955..e5a05f312 100644 --- a/packages/core/__tests__/db.test.js +++ b/packages/core/__tests__/db.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import DB from "../api"; import Constants from "../utils/constants"; import StorageInterface from "../__mocks__/storage.mock"; diff --git a/packages/core/__tests__/lookup.test.js b/packages/core/__tests__/lookup.test.js index ced10147e..31247d4b3 100644 --- a/packages/core/__tests__/lookup.test.js +++ b/packages/core/__tests__/lookup.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StorageInterface, noteTest, diff --git a/packages/core/__tests__/note-history.test.js b/packages/core/__tests__/note-history.test.js index 2e08d5e6b..6511ba16e 100644 --- a/packages/core/__tests__/note-history.test.js +++ b/packages/core/__tests__/note-history.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { delay, noteTest, StorageInterface, TEST_NOTE } from "./utils"; beforeEach(async () => { diff --git a/packages/core/__tests__/notebooks.test.js b/packages/core/__tests__/notebooks.test.js index d01db6d26..c7bae1c2c 100644 --- a/packages/core/__tests__/notebooks.test.js +++ b/packages/core/__tests__/notebooks.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StorageInterface, notebookTest, diff --git a/packages/core/__tests__/notes.test.js b/packages/core/__tests__/notes.test.js index 094948f8f..21e67abb8 100644 --- a/packages/core/__tests__/notes.test.js +++ b/packages/core/__tests__/notes.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "../utils/grouping"; import { StorageInterface, diff --git a/packages/core/__tests__/settings.test.js b/packages/core/__tests__/settings.test.js index 50c2f6e9d..ce520430c 100644 --- a/packages/core/__tests__/settings.test.js +++ b/packages/core/__tests__/settings.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { databaseTest, notebookTest, StorageInterface } from "./utils"; beforeEach(() => { diff --git a/packages/core/__tests__/storage.test.js b/packages/core/__tests__/storage.test.js index 0d93e18b3..b59375c37 100644 --- a/packages/core/__tests__/storage.test.js +++ b/packages/core/__tests__/storage.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import StorageInterface from "../__mocks__/storage.mock"; import Storage from "../database/storage"; diff --git a/packages/core/__tests__/tags.test.js b/packages/core/__tests__/tags.test.js index 4e0286f31..bba3f706e 100644 --- a/packages/core/__tests__/tags.test.js +++ b/packages/core/__tests__/tags.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { noteTest, TEST_NOTE, StorageInterface } from "./utils"; beforeEach(async () => { diff --git a/packages/core/__tests__/topics.test.js b/packages/core/__tests__/topics.test.js index ab484c4a6..55b30cb44 100644 --- a/packages/core/__tests__/topics.test.js +++ b/packages/core/__tests__/topics.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { delay, notebookTest, diff --git a/packages/core/__tests__/trash.test.js b/packages/core/__tests__/trash.test.js index 3beac3d1f..92f95b69e 100644 --- a/packages/core/__tests__/trash.test.js +++ b/packages/core/__tests__/trash.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import dayjs from "dayjs"; import { StorageInterface, diff --git a/packages/core/__tests__/utils.test.js b/packages/core/__tests__/utils.test.js index ab4d156cf..b643958a6 100644 --- a/packages/core/__tests__/utils.test.js +++ b/packages/core/__tests__/utils.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { groupArray } from "../utils/grouping"; test("group alphabetically", () => { diff --git a/packages/core/__tests__/utils/index.js b/packages/core/__tests__/utils/index.js index 47bfd00d8..d19aff766 100644 --- a/packages/core/__tests__/utils/index.js +++ b/packages/core/__tests__/utils/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import DB from "../../api"; import StorageInterface from "../../__mocks__/storage.mock"; import dayjs from "dayjs"; diff --git a/packages/core/__tests__/vault.test.js b/packages/core/__tests__/vault.test.js index 4a79dfe4c..a55592276 100644 --- a/packages/core/__tests__/vault.test.js +++ b/packages/core/__tests__/vault.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StorageInterface, databaseTest, noteTest, TEST_NOTE } from "./utils"; beforeEach(async () => { diff --git a/packages/core/analyze-modules.js b/packages/core/analyze-modules.js index 3e0821400..5f4dc3ece 100644 --- a/packages/core/analyze-modules.js +++ b/packages/core/analyze-modules.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /* This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or diff --git a/packages/core/api/__tests__/debug.test.js b/packages/core/api/__tests__/debug.test.js index 12a9e1369..6db75f8be 100644 --- a/packages/core/api/__tests__/debug.test.js +++ b/packages/core/api/__tests__/debug.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Debug from "../debug"; import { noteTest, notebookTest, databaseTest } from "../../__tests__/utils"; import { enableFetchMocks, disableFetchMocks } from "jest-fetch-mock"; diff --git a/packages/core/api/__tests__/mfa-manager.test.js b/packages/core/api/__tests__/mfa-manager.test.js index 39117e56c..a335f532e 100644 --- a/packages/core/api/__tests__/mfa-manager.test.js +++ b/packages/core/api/__tests__/mfa-manager.test.js @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + test.todo("skipped test"); diff --git a/packages/core/api/__tests__/migrations.test.js b/packages/core/api/__tests__/migrations.test.js index 39117e56c..a335f532e 100644 --- a/packages/core/api/__tests__/migrations.test.js +++ b/packages/core/api/__tests__/migrations.test.js @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + test.todo("skipped test"); diff --git a/packages/core/api/__tests__/outbox.test.js b/packages/core/api/__tests__/outbox.test.js index 39117e56c..a335f532e 100644 --- a/packages/core/api/__tests__/outbox.test.js +++ b/packages/core/api/__tests__/outbox.test.js @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + test.todo("skipped test"); diff --git a/packages/core/api/__tests__/pricing.test.js b/packages/core/api/__tests__/pricing.test.js index 428916cdc..a7d742486 100644 --- a/packages/core/api/__tests__/pricing.test.js +++ b/packages/core/api/__tests__/pricing.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Pricing from "../pricing"; test.each(["monthly", "yearly", undefined])(`get %s price`, async (period) => { diff --git a/packages/core/api/debug.js b/packages/core/api/debug.js index 9d6b95bbb..2de4404cc 100644 --- a/packages/core/api/debug.js +++ b/packages/core/api/debug.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import hosts from "../utils/constants"; export default class Debug { diff --git a/packages/core/api/index.js b/packages/core/api/index.js index 61f3b3bf4..b58c81945 100644 --- a/packages/core/api/index.js +++ b/packages/core/api/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Notes from "../collections/notes"; import Storage from "../database/storage"; import FileStorage from "../database/fs"; diff --git a/packages/core/api/lookup.js b/packages/core/api/lookup.js index d21ef2862..3874cc0de 100644 --- a/packages/core/api/lookup.js +++ b/packages/core/api/lookup.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { filter, parse } from "liqe"; export default class Lookup { diff --git a/packages/core/api/mfa-manager.js b/packages/core/api/mfa-manager.js index 35a0ce028..2a08b6128 100644 --- a/packages/core/api/mfa-manager.js +++ b/packages/core/api/mfa-manager.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import http from "../utils/http"; import constants from "../utils/constants"; import TokenManager from "./token-manager"; diff --git a/packages/core/api/migrations.js b/packages/core/api/migrations.js index 47370d2ba..592fd0dd1 100644 --- a/packages/core/api/migrations.js +++ b/packages/core/api/migrations.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { CURRENT_DATABASE_VERSION } from "../common"; import Migrator from "../database/migrator"; diff --git a/packages/core/api/monographs.js b/packages/core/api/monographs.js index 5d27d05ff..be9eed27b 100644 --- a/packages/core/api/monographs.js +++ b/packages/core/api/monographs.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import http from "../utils/http"; import Constants from "../utils/constants"; diff --git a/packages/core/api/offers.js b/packages/core/api/offers.js index 5af4ce842..a8d8f0e81 100644 --- a/packages/core/api/offers.js +++ b/packages/core/api/offers.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { CLIENT_ID } from "../common"; import hosts from "../utils/constants"; import http from "../utils/http"; diff --git a/packages/core/api/outbox.js b/packages/core/api/outbox.js index dc3d20087..0808ad02c 100644 --- a/packages/core/api/outbox.js +++ b/packages/core/api/outbox.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + class Outbox { /** * diff --git a/packages/core/api/pricing.js b/packages/core/api/pricing.js index 4ba962143..4e43c2d86 100644 --- a/packages/core/api/pricing.js +++ b/packages/core/api/pricing.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import http from "../utils/http"; const BASE_URL = `https://notesnook.com/api/v1/prices`; diff --git a/packages/core/api/session.js b/packages/core/api/session.js index e6e9bb08b..7ffa9f142 100644 --- a/packages/core/api/session.js +++ b/packages/core/api/session.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + class Session { /** * diff --git a/packages/core/api/settings.js b/packages/core/api/settings.js index fb0eff778..0fec5fb0d 100644 --- a/packages/core/api/settings.js +++ b/packages/core/api/settings.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EV, EVENTS } from "../common"; import id from "../utils/id"; import "../types"; diff --git a/packages/core/api/sync/__tests__/collector.test.js b/packages/core/api/sync/__tests__/collector.test.js index 28a3ed753..f75b572e3 100644 --- a/packages/core/api/sync/__tests__/collector.test.js +++ b/packages/core/api/sync/__tests__/collector.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { databaseTest, TEST_NOTE, diff --git a/packages/core/api/sync/__tests__/sync.test.skip.js b/packages/core/api/sync/__tests__/sync.test.skip.js index 14af825e6..e386ab5a0 100644 --- a/packages/core/api/sync/__tests__/sync.test.skip.js +++ b/packages/core/api/sync/__tests__/sync.test.skip.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Database from "../../index"; import { NodeStorageInterface } from "../../../__mocks__/node-storage.mock"; import FS from "../../../__mocks__/fs.mock"; diff --git a/packages/core/api/sync/auto-sync.js b/packages/core/api/sync/auto-sync.js index c251d0a55..5604f81bc 100644 --- a/packages/core/api/sync/auto-sync.js +++ b/packages/core/api/sync/auto-sync.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { checkIsUserPremium, CHECK_IDS, EVENTS } from "../../common"; import { logger } from "../../logger"; diff --git a/packages/core/api/sync/collector.js b/packages/core/api/sync/collector.js index 627968e4f..6a02394c4 100644 --- a/packages/core/api/sync/collector.js +++ b/packages/core/api/sync/collector.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { CURRENT_DATABASE_VERSION } from "../../common"; import { logger } from "../../logger"; diff --git a/packages/core/api/sync/conflicts.js b/packages/core/api/sync/conflicts.js index 46906f54f..de6fbb3dd 100644 --- a/packages/core/api/sync/conflicts.js +++ b/packages/core/api/sync/conflicts.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + class Conflicts { /** * diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js index 3b9b7799a..f0e31babc 100644 --- a/packages/core/api/sync/index.js +++ b/packages/core/api/sync/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EV, EVENTS, diff --git a/packages/core/api/sync/merger.js b/packages/core/api/sync/merger.js index 08b911946..acad1b811 100644 --- a/packages/core/api/sync/merger.js +++ b/packages/core/api/sync/merger.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { migrations } from "../../migrations"; import SparkMD5 from "spark-md5"; import setManipulator from "../../utils/set"; diff --git a/packages/core/api/sync/sync-queue.js b/packages/core/api/sync/sync-queue.js index 42c6612a3..9b2c03757 100644 --- a/packages/core/api/sync/sync-queue.js +++ b/packages/core/api/sync/sync-queue.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import set from "../../utils/set"; import { qclone } from "qclone"; import { logger } from "../../logger"; diff --git a/packages/core/api/sync/utils.js b/packages/core/api/sync/utils.js index 6a7351c0b..b55d705fa 100644 --- a/packages/core/api/sync/utils.js +++ b/packages/core/api/sync/utils.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function areAllEmpty(obj) { for (let key in obj) { const value = obj[key]; diff --git a/packages/core/api/token-manager.js b/packages/core/api/token-manager.js index a9a71062c..dcbb4301a 100644 --- a/packages/core/api/token-manager.js +++ b/packages/core/api/token-manager.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import http from "../utils/http"; import constants from "../utils/constants"; import { EV, EVENTS } from "../common"; diff --git a/packages/core/api/user-manager.js b/packages/core/api/user-manager.js index 2c09e461d..99e1e7550 100644 --- a/packages/core/api/user-manager.js +++ b/packages/core/api/user-manager.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "../types"; import http from "../utils/http"; import constants from "../utils/constants"; diff --git a/packages/core/api/vault.js b/packages/core/api/vault.js index c429813a3..f94b3818f 100644 --- a/packages/core/api/vault.js +++ b/packages/core/api/vault.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { CHECK_IDS, EV, EVENTS, checkIsUserPremium } from "../common"; import { tinyToTiptap } from "../migrations"; diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js index 88a0802b7..59a129c30 100644 --- a/packages/core/collections/attachments.js +++ b/packages/core/collections/attachments.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Collection from "./collection"; import getId from "../utils/id"; import { deleteItem, hasItem } from "../utils/array"; diff --git a/packages/core/collections/collection.js b/packages/core/collections/collection.js index 1319dd766..d60b2d83f 100644 --- a/packages/core/collections/collection.js +++ b/packages/core/collections/collection.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EV, EVENTS } from "../common"; import CachedCollection from "../database/cached-collection"; import IndexedCollection from "../database/indexed-collection"; diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js index 1c91c6162..342dea583 100644 --- a/packages/core/collections/content.js +++ b/packages/core/collections/content.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Collection from "./collection"; import getId from "../utils/id"; import { getContentFromData } from "../content-types"; diff --git a/packages/core/collections/note-history.js b/packages/core/collections/note-history.js index c9c8e57cd..9c1f9d29f 100644 --- a/packages/core/collections/note-history.js +++ b/packages/core/collections/note-history.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { makeSessionContentId } from "../utils/id"; import Collection from "./collection"; import SessionContent from "./session-content"; diff --git a/packages/core/collections/notebooks.js b/packages/core/collections/notebooks.js index b1472037e..6c47cf0ed 100644 --- a/packages/core/collections/notebooks.js +++ b/packages/core/collections/notebooks.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Collection from "./collection"; import Notebook from "../models/notebook"; import getId from "../utils/id"; diff --git a/packages/core/collections/notes.js b/packages/core/collections/notes.js index 833c712c1..e5d0de716 100644 --- a/packages/core/collections/notes.js +++ b/packages/core/collections/notes.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Collection from "./collection"; import Note from "../models/note"; import getId from "../utils/id"; diff --git a/packages/core/collections/session-content.js b/packages/core/collections/session-content.js index f05dc8dec..9fc29b319 100644 --- a/packages/core/collections/session-content.js +++ b/packages/core/collections/session-content.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { compress, decompress } from "../utils/compression"; import { makeSessionContentId } from "../utils/id"; import Collection from "./collection"; diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.js index 98c763be6..ecabbc6bf 100644 --- a/packages/core/collections/tags.js +++ b/packages/core/collections/tags.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Collection from "./collection"; import { makeId } from "../utils/id"; import { deleteItems, hasItem } from "../utils/array"; diff --git a/packages/core/collections/topics.js b/packages/core/collections/topics.js index 05cbb0f0b..3383b81de 100644 --- a/packages/core/collections/topics.js +++ b/packages/core/collections/topics.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Topic from "../models/topic"; import { qclone } from "qclone"; import id from "../utils/id"; diff --git a/packages/core/collections/trash.js b/packages/core/collections/trash.js index 553774b7d..ad707b755 100644 --- a/packages/core/collections/trash.js +++ b/packages/core/collections/trash.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import dayjs from "dayjs"; export default class Trash { diff --git a/packages/core/common.js b/packages/core/common.js index 2336de5de..479db9f38 100644 --- a/packages/core/common.js +++ b/packages/core/common.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import EventManager from "./utils/event-manager"; export const EV = new EventManager(); diff --git a/packages/core/content-types/__tests__/tiptap.test.js b/packages/core/content-types/__tests__/tiptap.test.js index de7ab3357..57ba39aca 100644 --- a/packages/core/content-types/__tests__/tiptap.test.js +++ b/packages/core/content-types/__tests__/tiptap.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { IMG_CONTENT, IMG_CONTENT_WITHOUT_HASH } from "../../__tests__/utils"; import { Tiptap } from "../tiptap"; diff --git a/packages/core/content-types/index.js b/packages/core/content-types/index.js index 19c1e94ba..b1268ab54 100644 --- a/packages/core/content-types/index.js +++ b/packages/core/content-types/index.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Tiptap } from "./tiptap"; export function getContentFromData(type, data) { diff --git a/packages/core/content-types/tiptap.js b/packages/core/content-types/tiptap.js index e9feb72f3..8d9a65f36 100644 --- a/packages/core/content-types/tiptap.js +++ b/packages/core/content-types/tiptap.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import showdown from "showdown"; import dataurl from "../utils/dataurl"; import { getDummyDocument, parseHTML } from "../utils/html-parser"; diff --git a/packages/core/database/backup.js b/packages/core/database/backup.js index 49685b45b..793004c3b 100644 --- a/packages/core/database/backup.js +++ b/packages/core/database/backup.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Migrator from "./migrator.js"; import { CHECK_IDS, diff --git a/packages/core/database/cached-collection.js b/packages/core/database/cached-collection.js index 70705f607..41c552758 100644 --- a/packages/core/database/cached-collection.js +++ b/packages/core/database/cached-collection.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import IndexedCollection from "./indexed-collection"; import MapStub from "../utils/map"; diff --git a/packages/core/database/fs.js b/packages/core/database/fs.js index 0403dd8c9..3fcbb209b 100644 --- a/packages/core/database/fs.js +++ b/packages/core/database/fs.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import hosts from "../utils/constants"; import TokenManager from "../api/token-manager"; diff --git a/packages/core/database/indexed-collection.js b/packages/core/database/indexed-collection.js index 1fabd3d10..ed3395c0f 100644 --- a/packages/core/database/indexed-collection.js +++ b/packages/core/database/indexed-collection.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EVENTS } from "../common"; import Indexer from "./indexer"; diff --git a/packages/core/database/indexer.js b/packages/core/database/indexer.js index 0b55fe326..4af925ec2 100644 --- a/packages/core/database/indexer.js +++ b/packages/core/database/indexer.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Storage from "./storage"; export default class Indexer extends Storage { diff --git a/packages/core/database/migrator.js b/packages/core/database/migrator.js index f08fad240..de10b5adb 100644 --- a/packages/core/database/migrator.js +++ b/packages/core/database/migrator.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { migrations } from "../migrations"; class Migrator { diff --git a/packages/core/database/storage.js b/packages/core/database/storage.js index e8c9478b5..268c39e40 100644 --- a/packages/core/database/storage.js +++ b/packages/core/database/storage.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { randomBytes } from "../utils/random"; export default class Storage { diff --git a/packages/core/jest.config.js b/packages/core/jest.config.js index 1662e128a..f7a7be6a0 100644 --- a/packages/core/jest.config.js +++ b/packages/core/jest.config.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // For a detailed explanation regarding each configuration property, visit: // https://jestjs.io/docs/en/configuration.html diff --git a/packages/core/jest.setup.js b/packages/core/jest.setup.js index 0c2ab8340..a35f1fedc 100644 --- a/packages/core/jest.setup.js +++ b/packages/core/jest.setup.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + var nodeCrypto = require("crypto"); var dotenv = require("dotenv"); const fetch = require("node-fetch"); diff --git a/packages/core/logger.js b/packages/core/logger.js index cb092185e..cbb492e81 100644 --- a/packages/core/logger.js +++ b/packages/core/logger.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Logger, combineReporters, @@ -117,10 +135,6 @@ class DatabaseLogManager { } } -/** - * - * @param {import("./database/storage").default} storage - */ function initalize(storage) { if (storage) { let reporters = [new DatabaseLogReporter(storage)]; diff --git a/packages/core/migrations.js b/packages/core/migrations.js index 57fc5df4e..328d0336c 100644 --- a/packages/core/migrations.js +++ b/packages/core/migrations.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { parseHTML } from "./utils/html-parser"; import { decodeHTML5 } from "entities"; diff --git a/packages/core/models/note.js b/packages/core/models/note.js index 9fbd5de6c..c9df82633 100644 --- a/packages/core/models/note.js +++ b/packages/core/models/note.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import MarkdownBuilder from "../utils/templates/markdown/builder"; import HTMLBuilder from "../utils/templates/html/builder"; import TextBuilder from "../utils/templates/text/builder"; diff --git a/packages/core/models/notebook.js b/packages/core/models/notebook.js index 4e9b81290..c4470ca2c 100644 --- a/packages/core/models/notebook.js +++ b/packages/core/models/notebook.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Topics from "../collections/topics"; export default class Notebook { diff --git a/packages/core/models/topic.js b/packages/core/models/topic.js index 9423e69b8..b0129d246 100644 --- a/packages/core/models/topic.js +++ b/packages/core/models/topic.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { qclone } from "qclone"; import { deleteItem, findById } from "../utils/array"; diff --git a/packages/core/types.js b/packages/core/types.js index 352e50aca..caccaf7a1 100644 --- a/packages/core/types.js +++ b/packages/core/types.js @@ -1,3 +1,23 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +const _ignore = ""; + /** * @typedef {{ * groupBy: "abc" | "year" | "month" | "week" | "none" | undefined, diff --git a/packages/core/utils/__tests__/compression.test.js b/packages/core/utils/__tests__/compression.test.js index b712edffc..35b3989d8 100644 --- a/packages/core/utils/__tests__/compression.test.js +++ b/packages/core/utils/__tests__/compression.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { TEST_NOTE } from "../../__tests__/utils"; import { compress, decompress } from "../compression"; diff --git a/packages/core/utils/__tests__/set.test.js b/packages/core/utils/__tests__/set.test.js index 7ab681cc6..308886e06 100644 --- a/packages/core/utils/__tests__/set.test.js +++ b/packages/core/utils/__tests__/set.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import Set from "../set"; test("union", () => { diff --git a/packages/core/utils/array.js b/packages/core/utils/array.js index 2dcbce74a..6336c67e6 100644 --- a/packages/core/utils/array.js +++ b/packages/core/utils/array.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function findItemAndDelete(array, predicate) { return deleteAtIndex(array, array.findIndex(predicate)); } diff --git a/packages/core/utils/compression.js b/packages/core/utils/compression.js index af64a51ff..7dc7be80e 100644 --- a/packages/core/utils/compression.js +++ b/packages/core/utils/compression.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { decode, encode } from "base64-arraybuffer"; import { compressSync, decompressSync, strToU8, strFromU8 } from "fflate"; diff --git a/packages/core/utils/constants.js b/packages/core/utils/constants.js index 8bf8bc516..42bc12d23 100644 --- a/packages/core/utils/constants.js +++ b/packages/core/utils/constants.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { extractHostname } from "./hostname"; function isProduction() { diff --git a/packages/core/utils/dataurl.js b/packages/core/utils/dataurl.js index 384ea65a6..c1009e5ac 100644 --- a/packages/core/utils/dataurl.js +++ b/packages/core/utils/dataurl.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const REGEX = /^data:(image\/.+);base64,(.+)/; function toObject(dataurl) { diff --git a/packages/core/utils/date.js b/packages/core/utils/date.js index e7bf485ac..f83356000 100644 --- a/packages/core/utils/date.js +++ b/packages/core/utils/date.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function getWeekGroupFromTimestamp(timestamp) { const date = new Date(timestamp); const { start, end } = getWeek(date); diff --git a/packages/core/utils/event-manager.js b/packages/core/utils/event-manager.js index a72932b51..0e0167e3f 100644 --- a/packages/core/utils/event-manager.js +++ b/packages/core/utils/event-manager.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + class EventManager { constructor() { this._registry = new Map(); diff --git a/packages/core/utils/grouping.js b/packages/core/utils/grouping.js index 9155930e0..f232b9e77 100644 --- a/packages/core/utils/grouping.js +++ b/packages/core/utils/grouping.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "../types"; import { getWeekGroupFromTimestamp, MONTHS_FULL } from "./date"; diff --git a/packages/core/utils/hostname.js b/packages/core/utils/hostname.js index f9f04de62..035981847 100644 --- a/packages/core/utils/hostname.js +++ b/packages/core/utils/hostname.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function extractHostname(url) { var hostname; //find & remove protocol (http, ftp, etc.) and get hostname diff --git a/packages/core/utils/html-parser.js b/packages/core/utils/html-parser.js index f25c6dd80..a2bcd4f2d 100644 --- a/packages/core/utils/html-parser.js +++ b/packages/core/utils/html-parser.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { decodeHTML5 } from "entities"; export const parseHTML = (input) => diff --git a/packages/core/utils/http.js b/packages/core/utils/http.js index dac8cf682..f57eccbac 100644 --- a/packages/core/utils/http.js +++ b/packages/core/utils/http.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EV, EVENTS } from "../common"; import { logger } from "../logger"; import { getServerNameFromHost } from "./constants"; diff --git a/packages/core/utils/id.js b/packages/core/utils/id.js index dcf51578b..e2c8e54f4 100644 --- a/packages/core/utils/id.js +++ b/packages/core/utils/id.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import SparkMD5 from "spark-md5"; import ObjectID from "./object-id"; diff --git a/packages/core/utils/map.js b/packages/core/utils/map.js index f27cdcc03..7c9748386 100644 --- a/packages/core/utils/map.js +++ b/packages/core/utils/map.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + var map = Map; class MapStub { override(replacement) { diff --git a/packages/core/utils/object-id.js b/packages/core/utils/object-id.js index 87ec09922..120354b90 100644 --- a/packages/core/utils/object-id.js +++ b/packages/core/utils/object-id.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // Copied from https://github.com/williamkapke/bson-objectid const { randomInt } = require("./random"); diff --git a/packages/core/utils/random.js b/packages/core/utils/random.js index 4a85fca1b..09f503983 100644 --- a/packages/core/utils/random.js +++ b/packages/core/utils/random.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /** * * @param {number} size diff --git a/packages/core/utils/set.js b/packages/core/utils/set.js index 3bfdd87bf..ae95cc381 100644 --- a/packages/core/utils/set.js +++ b/packages/core/utils/set.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // SetManipulator MIT Licence © 2016 Edwin Monk-Fromont http://github.com/edmofro // Based on setOps.js MIT License © 2014 James Abney http://github.com/jabney diff --git a/packages/core/utils/templates/helper.js b/packages/core/utils/templates/helper.js index d661d51de..584bd3f73 100644 --- a/packages/core/utils/templates/helper.js +++ b/packages/core/utils/templates/helper.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { formatDate } from "../date"; function generateMetaTags(metadata, createMetaTag) { diff --git a/packages/core/utils/templates/html/builder.js b/packages/core/utils/templates/html/builder.js index 2a7f8eee2..492cc066b 100644 --- a/packages/core/utils/templates/html/builder.js +++ b/packages/core/utils/templates/html/builder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { buildPage } from "../helper"; import HTMLTemplate from "./template"; diff --git a/packages/core/utils/templates/html/template.js b/packages/core/utils/templates/html/template.js index 4b006efb2..cb2d0d0a3 100644 --- a/packages/core/utils/templates/html/template.js +++ b/packages/core/utils/templates/html/template.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const template = ` diff --git a/packages/core/utils/templates/markdown/builder.js b/packages/core/utils/templates/markdown/builder.js index ecb98e42b..c83a6eb8d 100644 --- a/packages/core/utils/templates/markdown/builder.js +++ b/packages/core/utils/templates/markdown/builder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { buildPage } from "../helper"; import MDTemplate from "./template"; diff --git a/packages/core/utils/templates/markdown/template.js b/packages/core/utils/templates/markdown/template.js index 381ca063c..1f110dfa9 100644 --- a/packages/core/utils/templates/markdown/template.js +++ b/packages/core/utils/templates/markdown/template.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const template = `# {{title}} {{content}} diff --git a/packages/core/utils/templates/text/builder.js b/packages/core/utils/templates/text/builder.js index 3deb04635..c98a759cb 100644 --- a/packages/core/utils/templates/text/builder.js +++ b/packages/core/utils/templates/text/builder.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { buildPage } from "../helper"; import TextTemplate from "./template"; diff --git a/packages/core/utils/templates/text/template.js b/packages/core/utils/templates/text/template.js index a1d2e393e..b1e0439ad 100644 --- a/packages/core/utils/templates/text/template.js +++ b/packages/core/utils/templates/text/template.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const template = `{{title}} ---------- diff --git a/packages/crypto-worker/README.md b/packages/crypto-worker/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/crypto-worker/index.ts b/packages/crypto-worker/index.ts index d05c07101..889a4adbb 100644 --- a/packages/crypto-worker/index.ts +++ b/packages/crypto-worker/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SerializedKey, Plaintext, diff --git a/packages/crypto-worker/src/utils.ts b/packages/crypto-worker/src/utils.ts index 71ae0a863..5d98890ac 100644 --- a/packages/crypto-worker/src/utils.ts +++ b/packages/crypto-worker/src/utils.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + type Message = { type: string; data?: T; diff --git a/packages/crypto-worker/src/worker.ts b/packages/crypto-worker/src/worker.ts index 26b4fa90d..0bd278d29 100644 --- a/packages/crypto-worker/src/worker.ts +++ b/packages/crypto-worker/src/worker.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Cipher, OutputFormat, diff --git a/packages/crypto-worker/src/workerstream.ts b/packages/crypto-worker/src/workerstream.ts index 25c4a38f7..f36820de2 100644 --- a/packages/crypto-worker/src/workerstream.ts +++ b/packages/crypto-worker/src/workerstream.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { IStreamable } from "@notesnook/crypto/dist/src/interfaces"; import { Chunk } from "@notesnook/crypto/dist/src/types"; import { sendEventWithResult } from "./utils"; diff --git a/packages/crypto/README.md b/packages/crypto/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/crypto/index.ts b/packages/crypto/index.ts index 362fd39ec..05d162336 100644 --- a/packages/crypto/index.ts +++ b/packages/crypto/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ready } from "libsodium-wrappers"; import Decryption from "./src/decryption"; import Encryption from "./src/encryption"; diff --git a/packages/crypto/src/decryption.ts b/packages/crypto/src/decryption.ts index c57dce454..787e6e420 100644 --- a/packages/crypto/src/decryption.ts +++ b/packages/crypto/src/decryption.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { crypto_aead_xchacha20poly1305_ietf_decrypt, crypto_secretstream_xchacha20poly1305_init_pull, diff --git a/packages/crypto/src/encryption.ts b/packages/crypto/src/encryption.ts index b59749ac1..aa9a780bb 100644 --- a/packages/crypto/src/encryption.ts +++ b/packages/crypto/src/encryption.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { crypto_aead_xchacha20poly1305_ietf_encrypt, crypto_secretstream_xchacha20poly1305_init_push, diff --git a/packages/crypto/src/interfaces.ts b/packages/crypto/src/interfaces.ts index 9c817f64b..a89882a2c 100644 --- a/packages/crypto/src/interfaces.ts +++ b/packages/crypto/src/interfaces.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Cipher, EncryptionKey, diff --git a/packages/crypto/src/keyutils.ts b/packages/crypto/src/keyutils.ts index 8795fac4c..44958a36c 100644 --- a/packages/crypto/src/keyutils.ts +++ b/packages/crypto/src/keyutils.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { from_base64, to_base64, diff --git a/packages/crypto/src/password.ts b/packages/crypto/src/password.ts index 5a283cd4b..ae3dea388 100644 --- a/packages/crypto/src/password.ts +++ b/packages/crypto/src/password.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { crypto_generichash, crypto_pwhash, diff --git a/packages/crypto/src/types.ts b/packages/crypto/src/types.ts index d894e5ecf..42e8ee9ff 100644 --- a/packages/crypto/src/types.ts +++ b/packages/crypto/src/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { StringOutputFormat, Uint8ArrayOutputFormat } from "libsodium-wrappers"; export type OutputFormat = Uint8ArrayOutputFormat | StringOutputFormat; diff --git a/packages/editor-mobile/src/App.test.js b/packages/editor-mobile/src/App.test.js index 9382b9ad5..2d375412a 100644 --- a/packages/editor-mobile/src/App.test.js +++ b/packages/editor-mobile/src/App.test.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { render, screen } from "@testing-library/react"; import App from "./App"; diff --git a/packages/editor-mobile/src/App.tsx b/packages/editor-mobile/src/App.tsx index 605e15dd6..cc99c0051 100644 --- a/packages/editor-mobile/src/App.tsx +++ b/packages/editor-mobile/src/App.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "./App.css"; import Tiptap from "./components/editor"; diff --git a/packages/editor-mobile/src/components/button.tsx b/packages/editor-mobile/src/components/button.tsx index fdf92a7ae..3c42e1fba 100644 --- a/packages/editor-mobile/src/components/button.tsx +++ b/packages/editor-mobile/src/components/button.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "@notesnook/editor"; type ButtonType = { diff --git a/packages/editor-mobile/src/components/editor.tsx b/packages/editor-mobile/src/components/editor.tsx index b144d7924..f80b7d1c0 100644 --- a/packages/editor-mobile/src/components/editor.tsx +++ b/packages/editor-mobile/src/components/editor.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, PortalProvider, diff --git a/packages/editor-mobile/src/components/header.tsx b/packages/editor-mobile/src/components/header.tsx index 126f098ae..bb5b9a0c2 100644 --- a/packages/editor-mobile/src/components/header.tsx +++ b/packages/editor-mobile/src/components/header.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ArrowBackIcon from "mdi-react/ArrowBackIcon"; import CloudUploadOutlineIcon from "mdi-react/CloudUploadOutlineIcon"; import CrownIcon from "mdi-react/CrownIcon"; diff --git a/packages/editor-mobile/src/components/statusbar.tsx b/packages/editor-mobile/src/components/statusbar.tsx index 9cdbcf09e..f86283ead 100644 --- a/packages/editor-mobile/src/components/statusbar.tsx +++ b/packages/editor-mobile/src/components/statusbar.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { RefObject, useEffect, useRef, useState } from "react"; function StatusBar({ container }: { container: RefObject }) { diff --git a/packages/editor-mobile/src/components/tags.tsx b/packages/editor-mobile/src/components/tags.tsx index b1a6b2a8e..9d6468bc6 100644 --- a/packages/editor-mobile/src/components/tags.tsx +++ b/packages/editor-mobile/src/components/tags.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useRef, useState } from "react"; import { EventTypes } from "../utils"; import styles from "./styles.module.css"; diff --git a/packages/editor-mobile/src/components/title.tsx b/packages/editor-mobile/src/components/title.tsx index 9c7461319..df6199632 100644 --- a/packages/editor-mobile/src/components/title.tsx +++ b/packages/editor-mobile/src/components/title.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { RefObject, useEffect, useRef } from "react"; import { EditorController } from "../hooks/useEditorController"; diff --git a/packages/editor-mobile/src/hooks/useEditorController.ts b/packages/editor-mobile/src/hooks/useEditorController.ts index 0d5f0d69f..b9d62818c 100644 --- a/packages/editor-mobile/src/hooks/useEditorController.ts +++ b/packages/editor-mobile/src/hooks/useEditorController.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "@notesnook/editor"; import { MutableRefObject, diff --git a/packages/editor-mobile/src/hooks/useSafeArea.ts b/packages/editor-mobile/src/hooks/useSafeArea.ts index 99461b220..b4622ff66 100644 --- a/packages/editor-mobile/src/hooks/useSafeArea.ts +++ b/packages/editor-mobile/src/hooks/useSafeArea.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState } from "react"; const insetsStorage = localStorage.getItem("safeAreaInsets"); diff --git a/packages/editor-mobile/src/hooks/useSettings.ts b/packages/editor-mobile/src/hooks/useSettings.ts index b0585055c..059c560ce 100644 --- a/packages/editor-mobile/src/hooks/useSettings.ts +++ b/packages/editor-mobile/src/hooks/useSettings.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getDefaultPresets } from "@notesnook/editor"; import { useState } from "react"; diff --git a/packages/editor-mobile/src/index.tsx b/packages/editor-mobile/src/index.tsx index 14e760cd9..01558e687 100644 --- a/packages/editor-mobile/src/index.tsx +++ b/packages/editor-mobile/src/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import ReactDOM from "react-dom"; import "./index.css"; diff --git a/packages/editor-mobile/src/react-app-env.d.ts b/packages/editor-mobile/src/react-app-env.d.ts index 6431bc5fc..e96c95578 100644 --- a/packages/editor-mobile/src/react-app-env.d.ts +++ b/packages/editor-mobile/src/react-app-env.d.ts @@ -1 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /// + +const _ignore; diff --git a/packages/editor-mobile/src/setupTests.js b/packages/editor-mobile/src/setupTests.js index 1dd407a63..36eef6678 100644 --- a/packages/editor-mobile/src/setupTests.js +++ b/packages/editor-mobile/src/setupTests.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + // jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) diff --git a/packages/editor-mobile/src/state/theme.tsx b/packages/editor-mobile/src/state/theme.tsx index 0e341ec7e..00461a24b 100644 --- a/packages/editor-mobile/src/state/theme.tsx +++ b/packages/editor-mobile/src/state/theme.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import create, { State } from "zustand"; import { injectCss, transform } from "../utils/css"; export type Colors = { diff --git a/packages/editor-mobile/src/utils/css.js b/packages/editor-mobile/src/utils/css.js index fffbbd806..8a4025612 100644 --- a/packages/editor-mobile/src/utils/css.js +++ b/packages/editor-mobile/src/utils/css.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function removeCss(id) { var link = document.getElementById(id); link.remove(); diff --git a/packages/editor-mobile/src/utils/index.ts b/packages/editor-mobile/src/utils/index.ts index 9967dbf39..fb99167cd 100644 --- a/packages/editor-mobile/src/utils/index.ts +++ b/packages/editor-mobile/src/utils/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolbarGroupDefinition } from "@notesnook/editor"; import { Editor } from "@notesnook/editor"; import { Dispatch, MutableRefObject, RefObject, SetStateAction } from "react"; diff --git a/packages/editor/package.json b/packages/editor/package.json index b95ee606f..e8f7bce1e 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -60,8 +60,6 @@ "@types/react": "17.0.2", "@types/react-dom": "17.0.2", "@types/react-modal": "^3.13.1", - "@types/rebass": "^4.0.10", - "@types/rebass__forms": "^4.0.6", "@types/tinycolor2": "^1.4.3", "framer-motion": "^4.1.17", "isomorphic-fetch": "^3.0.0", diff --git a/packages/editor/scripts/langen.js b/packages/editor/scripts/langen.js index 7ddc57670..5f41071a6 100644 --- a/packages/editor/scripts/langen.js +++ b/packages/editor/scripts/langen.js @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /** * Quick & dirty script to download & transform all language details from * the PrismJS repo. diff --git a/packages/editor/src/components/action-sheet/index.tsx b/packages/editor/src/components/action-sheet/index.tsx index d53332117..05791708f 100644 --- a/packages/editor/src/components/action-sheet/index.tsx +++ b/packages/editor/src/components/action-sheet/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { PropsWithChildren, useCallback, @@ -105,7 +123,7 @@ export function ActionSheetPresenter( transition: TRANSITION, y: height + 100 }); - }, [animation, onClose, contentRef.current]); + }, [animation, onClose]); const handleBackPress = useCallback( (event: Event) => { diff --git a/packages/editor/src/components/button.tsx b/packages/editor/src/components/button.tsx index c728f92b2..f63b74b8b 100644 --- a/packages/editor/src/components/button.tsx +++ b/packages/editor/src/components/button.tsx @@ -1,4 +1,22 @@ -import { forwardRef, useCallback, useRef, ForwardedRef } from "react"; +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { forwardRef, useRef, ForwardedRef } from "react"; import { useEffect } from "react"; import { Button as RebassButton, ButtonProps } from "@streetwriters/rebass"; @@ -17,6 +35,10 @@ const _Button = ( useEffect(() => { if (!buttonRef.current) return; + function onMouseDown(e: MouseEvent) { + e.preventDefault(); + } + buttonRef.current.addEventListener("mousedown", onMouseDown, { passive: false, capture: true @@ -29,10 +51,6 @@ const _Button = ( }; }, []); - const onMouseDown = useCallback((e: MouseEvent) => { - e.preventDefault(); - }, []); - return ( . + */ + import { Input, InputProps } from "@streetwriters/rebass-forms"; import { Flex, FlexProps, Text } from "@streetwriters/rebass"; diff --git a/packages/editor/src/components/menu/index.tsx b/packages/editor/src/components/menu/index.tsx index aa9650a12..9e0927948 100644 --- a/packages/editor/src/components/menu/index.tsx +++ b/packages/editor/src/components/menu/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useRef, useEffect, PropsWithChildren } from "react"; import { Box, Flex, FlexProps, Text } from "@streetwriters/rebass"; import { getPosition } from "../../utils/position"; diff --git a/packages/editor/src/components/menu/menu-button.tsx b/packages/editor/src/components/menu/menu-button.tsx index 9eaaaf79e..8e46f4421 100644 --- a/packages/editor/src/components/menu/menu-button.tsx +++ b/packages/editor/src/components/menu/menu-button.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useRef } from "react"; import { Flex, Text } from "@streetwriters/rebass"; import { Icon } from "../../toolbar/components/icon"; diff --git a/packages/editor/src/components/menu/menu-separator.tsx b/packages/editor/src/components/menu/menu-separator.tsx index 6e1a9d729..b347269ac 100644 --- a/packages/editor/src/components/menu/menu-separator.tsx +++ b/packages/editor/src/components/menu/menu-separator.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box } from "@streetwriters/rebass"; export function MenuSeparator() { diff --git a/packages/editor/src/components/menu/types.ts b/packages/editor/src/components/menu/types.ts index 03e8b94ae..dd4e32e36 100644 --- a/packages/editor/src/components/menu/types.ts +++ b/packages/editor/src/components/menu/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SxStyleProp } from "@streetwriters/rebass"; import { IconNames } from "../../toolbar/icons"; diff --git a/packages/editor/src/components/menu/use-focus.ts b/packages/editor/src/components/menu/use-focus.ts index 9cba826f4..52629d008 100644 --- a/packages/editor/src/components/menu/use-focus.ts +++ b/packages/editor/src/components/menu/use-focus.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useEffect, useState } from "react"; import { MenuButton, MenuItem } from "./types"; @@ -79,7 +97,7 @@ export function useFocus( return nextIndex; }); }, - [items, isSubmenuOpen, moveItemIntoView, onAction] + [items, moveItemIntoView, isSubmenuOpen, onAction, onClose] ); useEffect(() => { diff --git a/packages/editor/src/components/popup-presenter/index.tsx b/packages/editor/src/components/popup-presenter/index.tsx index 8388e8619..124a758e8 100644 --- a/packages/editor/src/components/popup-presenter/index.tsx +++ b/packages/editor/src/components/popup-presenter/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useCallback, useRef, useEffect, PropsWithChildren } from "react"; import { Box } from "@streetwriters/rebass"; import { getPosition, PositionOptions } from "../../utils/position"; @@ -36,27 +54,27 @@ function _PopupPresenter(props: PropsWithChildren) { const contentRef = useRef(); const observerRef = useRef(); - const repositionPopup = useCallback(() => { + const repositionPopup = useCallback((position: PositionOptions) => { if (!contentRef.current || !position) return; const popup = contentRef.current; const popupPosition = getPosition(popup, position); popup.style.top = popupPosition.top + "px"; popup.style.left = popupPosition.left + "px"; - }, [position]); + }, []); useEffect(() => { - repositionPopup(); - }, [position]); + repositionPopup(position); + }, [repositionPopup, position]); useEffect(() => { function onWindowResize() { - repositionPopup(); + repositionPopup(position); } window.addEventListener("resize", onWindowResize); return () => { window.removeEventListener("resize", onWindowResize); }; - }, []); + }, [repositionPopup, position]); const attachMoveHandlers = useCallback(() => { if (!contentRef.current || !isOpen) return; @@ -99,7 +117,7 @@ function _PopupPresenter(props: PropsWithChildren) { let oldHeight: number = popup.offsetHeight; observerRef.current = new ResizeObserver(() => { if (isMobile) { - repositionPopup(); + repositionPopup(position); } else { const { height, y } = popup.getBoundingClientRect(); const delta = height - oldHeight; @@ -117,7 +135,7 @@ function _PopupPresenter(props: PropsWithChildren) { } }); observerRef.current.observe(popup, { box: "border-box" }); - }, [isMobile]); + }, [repositionPopup, position, isMobile]); return ( ) { portalClassName={"popup-presenter-portal"} onAfterOpen={(obj) => { if (!obj || !position) return; - repositionPopup(); + repositionPopup(position); handleResize(); attachMoveHandlers(); @@ -244,7 +262,7 @@ export function PopupWrapper(props: PopupWrapperProps) { if (!isPopupOpen) { PopupRenderer.closePopup(id); } - }, [isPopupOpen]); + }, [id, isPopupOpen]); return ( { if (!isPopupOpen) onClosed?.(); - }, [isPopupOpen]); + }, [isPopupOpen, onClosed]); useEffect(() => { if (isPopupOpen) { diff --git a/packages/editor/src/components/popup-presenter/popuprenderer.tsx b/packages/editor/src/components/popup-presenter/popuprenderer.tsx index f95b2928a..ec9d16ad1 100644 --- a/packages/editor/src/components/popup-presenter/popuprenderer.tsx +++ b/packages/editor/src/components/popup-presenter/popuprenderer.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { PropsWithChildren, useContext } from "react"; import { Editor } from "@tiptap/core"; diff --git a/packages/editor/src/components/resizer/index.tsx b/packages/editor/src/components/resizer/index.tsx index b22687610..07f16c077 100644 --- a/packages/editor/src/components/resizer/index.tsx +++ b/packages/editor/src/components/resizer/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme"; import { Resizable } from "re-resizable"; import { PropsWithChildren } from "react"; diff --git a/packages/editor/src/components/responsive/index.tsx b/packages/editor/src/components/responsive/index.tsx index df9e884a4..d3ce05763 100644 --- a/packages/editor/src/components/responsive/index.tsx +++ b/packages/editor/src/components/responsive/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { PropsWithChildren } from "react"; import { useIsMobile } from "../../toolbar/stores/toolbar-store"; import { diff --git a/packages/editor/src/components/tabs/index.tsx b/packages/editor/src/components/tabs/index.tsx index 2aaf75a52..59ad53d14 100644 --- a/packages/editor/src/components/tabs/index.tsx +++ b/packages/editor/src/components/tabs/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { Children, PropsWithChildren, useMemo, useState } from "react"; import { Button, Flex, FlexProps } from "@streetwriters/rebass"; diff --git a/packages/editor/src/components/theme-provider/index.tsx b/packages/editor/src/components/theme-provider/index.tsx index 6e543394c..e40d8502b 100644 --- a/packages/editor/src/components/theme-provider/index.tsx +++ b/packages/editor/src/components/theme-provider/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ThemeProvider as EmotionThemeProvider } from "@emotion/react"; import { PropsWithChildren } from "react"; import { useTheme } from "../../toolbar/stores/toolbar-store"; diff --git a/packages/editor/src/extensions.ts b/packages/editor/src/extensions.ts index d3f0f4c27..10f92f3a7 100644 --- a/packages/editor/src/extensions.ts +++ b/packages/editor/src/extensions.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "@tiptap/extension-character-count"; import "@tiptap/extension-placeholder"; import "@tiptap/extension-underline"; diff --git a/packages/editor/src/extensions/attachment/attachment.ts b/packages/editor/src/extensions/attachment/attachment.ts index 6b131186f..a0e9aba9a 100644 --- a/packages/editor/src/extensions/attachment/attachment.ts +++ b/packages/editor/src/extensions/attachment/attachment.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes, findChildren, Editor } from "@tiptap/core"; import { Attribute } from "@tiptap/core"; import { createSelectionBasedNodeView } from "../react"; diff --git a/packages/editor/src/extensions/attachment/component.tsx b/packages/editor/src/extensions/attachment/component.tsx index 00a7e84d1..913a94eb1 100644 --- a/packages/editor/src/extensions/attachment/component.tsx +++ b/packages/editor/src/extensions/attachment/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Text } from "@streetwriters/rebass"; import { AttachmentWithProgress } from "./attachment"; import { useRef } from "react"; diff --git a/packages/editor/src/extensions/attachment/index.ts b/packages/editor/src/extensions/attachment/index.ts index 9f9f38860..9b3b17803 100644 --- a/packages/editor/src/extensions/attachment/index.ts +++ b/packages/editor/src/extensions/attachment/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./attachment"; diff --git a/packages/editor/src/extensions/bullet-list/bullet-list.ts b/packages/editor/src/extensions/bullet-list/bullet-list.ts index 88eb62f56..9127c3953 100644 --- a/packages/editor/src/extensions/bullet-list/bullet-list.ts +++ b/packages/editor/src/extensions/bullet-list/bullet-list.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import TiptapBulletList from "@tiptap/extension-bullet-list"; export const BulletList = TiptapBulletList.extend({ diff --git a/packages/editor/src/extensions/bullet-list/index.ts b/packages/editor/src/extensions/bullet-list/index.ts index f164090c5..811d1bfac 100644 --- a/packages/editor/src/extensions/bullet-list/index.ts +++ b/packages/editor/src/extensions/bullet-list/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { BulletList } from "./bullet-list"; export * from "./bullet-list"; diff --git a/packages/editor/src/extensions/clipboard-text-serializer/index.ts b/packages/editor/src/extensions/clipboard-text-serializer/index.ts index 25ad6efc0..8c0f94e32 100644 --- a/packages/editor/src/extensions/clipboard-text-serializer/index.ts +++ b/packages/editor/src/extensions/clipboard-text-serializer/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension, TextSerializer } from "@tiptap/core"; import { Plugin, PluginKey } from "prosemirror-state"; import { Node as ProseMirrorNode, Schema, Slice } from "prosemirror-model"; diff --git a/packages/editor/src/extensions/code-block/code-block.ts b/packages/editor/src/extensions/code-block/code-block.ts index 142147b38..cb90a8e5b 100644 --- a/packages/editor/src/extensions/code-block/code-block.ts +++ b/packages/editor/src/extensions/code-block/code-block.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, findParentNodeClosestToPos } from "@tiptap/core"; import { Node, textblockTypeInputRule, mergeAttributes } from "@tiptap/core"; import { diff --git a/packages/editor/src/extensions/code-block/component.tsx b/packages/editor/src/extensions/code-block/component.tsx index 6266cf494..bbb617d3b 100644 --- a/packages/editor/src/extensions/code-block/component.tsx +++ b/packages/editor/src/extensions/code-block/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef, useState } from "react"; import { isLanguageLoaded, loadLanguage } from "./loader"; import { refractor } from "refractor/lib/core"; @@ -44,7 +62,7 @@ export function CodeblockComponent( { preventUpdate, addToHistory: false } ); })(); - }, [language]); + }, [language, languageDefinition, updateAttributes]); return ( <> diff --git a/packages/editor/src/extensions/code-block/highlighter.ts b/packages/editor/src/extensions/code-block/highlighter.ts index 4e2b55a37..2ffca7aad 100644 --- a/packages/editor/src/extensions/code-block/highlighter.ts +++ b/packages/editor/src/extensions/code-block/highlighter.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Plugin, PluginKey } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; import { diff --git a/packages/editor/src/extensions/code-block/index.ts b/packages/editor/src/extensions/code-block/index.ts index 80ea37c7c..3b0ab8572 100644 --- a/packages/editor/src/extensions/code-block/index.ts +++ b/packages/editor/src/extensions/code-block/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./code-block"; diff --git a/packages/editor/src/extensions/code-block/loader.ts b/packages/editor/src/extensions/code-block/loader.ts index 8a349dc21..96d629e8e 100644 --- a/packages/editor/src/extensions/code-block/loader.ts +++ b/packages/editor/src/extensions/code-block/loader.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Syntax } from "refractor"; const loadedLanguages: Record = {}; diff --git a/packages/editor/src/extensions/code-mark/code-mark.ts b/packages/editor/src/extensions/code-mark/code-mark.ts index cf091d0f5..9706dfdfb 100644 --- a/packages/editor/src/extensions/code-mark/code-mark.ts +++ b/packages/editor/src/extensions/code-mark/code-mark.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension } from "@tiptap/core"; import codemark from "prosemirror-codemark"; diff --git a/packages/editor/src/extensions/code-mark/index.ts b/packages/editor/src/extensions/code-mark/index.ts index 8c4911b98..8ebbc9086 100644 --- a/packages/editor/src/extensions/code-mark/index.ts +++ b/packages/editor/src/extensions/code-mark/index.ts @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./code-mark"; export { Codemark as default } from "./code-mark"; diff --git a/packages/editor/src/extensions/date-time/date-time.ts b/packages/editor/src/extensions/date-time/date-time.ts index 94fcb7872..177733a34 100644 --- a/packages/editor/src/extensions/date-time/date-time.ts +++ b/packages/editor/src/extensions/date-time/date-time.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension, InputRule, diff --git a/packages/editor/src/extensions/date-time/index.ts b/packages/editor/src/extensions/date-time/index.ts index 92da0746f..ed28fb663 100644 --- a/packages/editor/src/extensions/date-time/index.ts +++ b/packages/editor/src/extensions/date-time/index.ts @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./date-time"; export { DateTime as default } from "./date-time"; diff --git a/packages/editor/src/extensions/embed/component.tsx b/packages/editor/src/extensions/embed/component.tsx index f16ed93ed..b156bf6f7 100644 --- a/packages/editor/src/extensions/embed/component.tsx +++ b/packages/editor/src/extensions/embed/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex } from "@streetwriters/rebass"; import { useRef, useState } from "react"; import { EmbedAlignmentOptions, EmbedAttributes } from "./embed"; diff --git a/packages/editor/src/extensions/embed/embed.ts b/packages/editor/src/extensions/embed/embed.ts index 3319f4cad..8b8bfb09c 100644 --- a/packages/editor/src/extensions/embed/embed.ts +++ b/packages/editor/src/extensions/embed/embed.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes } from "@tiptap/core"; import { createSelectionBasedNodeView } from "../react"; import { EmbedComponent } from "./component"; diff --git a/packages/editor/src/extensions/embed/index.ts b/packages/editor/src/extensions/embed/index.ts index 12b3c5295..a04f91ad6 100644 --- a/packages/editor/src/extensions/embed/index.ts +++ b/packages/editor/src/extensions/embed/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./embed"; diff --git a/packages/editor/src/extensions/font-size/font-size.ts b/packages/editor/src/extensions/font-size/font-size.ts index 9a979f049..9d694d49a 100644 --- a/packages/editor/src/extensions/font-size/font-size.ts +++ b/packages/editor/src/extensions/font-size/font-size.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension } from "@tiptap/core"; import "@tiptap/extension-text-style"; diff --git a/packages/editor/src/extensions/font-size/index.ts b/packages/editor/src/extensions/font-size/index.ts index 2882e207b..d107c61d8 100644 --- a/packages/editor/src/extensions/font-size/index.ts +++ b/packages/editor/src/extensions/font-size/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { FontSize } from "./font-size"; export * from "./font-size"; diff --git a/packages/editor/src/extensions/highlight/highlight.ts b/packages/editor/src/extensions/highlight/highlight.ts index b00519604..8660264ed 100644 --- a/packages/editor/src/extensions/highlight/highlight.ts +++ b/packages/editor/src/extensions/highlight/highlight.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "@tiptap/extension-text-style"; import { Extension } from "@tiptap/core"; diff --git a/packages/editor/src/extensions/highlight/index.ts b/packages/editor/src/extensions/highlight/index.ts index d90b37cc0..03e2ade2e 100644 --- a/packages/editor/src/extensions/highlight/index.ts +++ b/packages/editor/src/extensions/highlight/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./highlight"; diff --git a/packages/editor/src/extensions/image/component.tsx b/packages/editor/src/extensions/image/component.tsx index a56cdc788..de38ed68f 100644 --- a/packages/editor/src/extensions/image/component.tsx +++ b/packages/editor/src/extensions/image/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Button, Flex, Image, Text } from "@streetwriters/rebass"; import { ImageAlignmentOptions, ImageAttributes } from "./image"; import { useEffect, useRef, useState } from "react"; @@ -29,26 +47,30 @@ export function ImageComponent( const [error, setError] = useState(); const [source, setSource] = useState(); - useEffect(() => { - (async () => { - if (!src) return; - try { - if (isDataUrl(src)) setSource(await toBlobURL(src)); - else { - const { url, size, blob, type } = await downloadImage(src); - setSource(url); - console.log(url, size, blob, type); - editor.current?.commands.updateImage( - { src }, - { src: await toDataURL(blob), size, type } - ); + useEffect( + () => { + (async () => { + if (!src) return; + try { + if (isDataUrl(src)) setSource(await toBlobURL(src)); + else { + const { url, size, blob, type } = await downloadImage(src); + setSource(url); + console.log(url, size, blob, type); + editor.current?.commands.updateImage( + { src }, + { src: await toDataURL(blob), size, type } + ); + } + } catch (e) { + console.error(e); + if (e instanceof Error) setError(e.message); } - } catch (e) { - console.error(e); - if (e instanceof Error) setError(e.message); - } - })(); - }, [src, imageRef]); + })(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [src, imageRef] + ); return ( <> diff --git a/packages/editor/src/extensions/image/image.ts b/packages/editor/src/extensions/image/image.ts index 2f3ac7f75..ffb5ff9a7 100644 --- a/packages/editor/src/extensions/image/image.ts +++ b/packages/editor/src/extensions/image/image.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, nodeInputRule, diff --git a/packages/editor/src/extensions/image/index.ts b/packages/editor/src/extensions/image/index.ts index 0aa9b4bbd..fa6a7bbbf 100644 --- a/packages/editor/src/extensions/image/index.ts +++ b/packages/editor/src/extensions/image/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./image"; diff --git a/packages/editor/src/extensions/keep-in-view/index.ts b/packages/editor/src/extensions/keep-in-view/index.ts index 7d6036306..676deedbc 100644 --- a/packages/editor/src/extensions/keep-in-view/index.ts +++ b/packages/editor/src/extensions/keep-in-view/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./keep-in-view"; diff --git a/packages/editor/src/extensions/keep-in-view/keep-in-view.ts b/packages/editor/src/extensions/keep-in-view/keep-in-view.ts index 11c9b2234..10ef90a3f 100644 --- a/packages/editor/src/extensions/keep-in-view/keep-in-view.ts +++ b/packages/editor/src/extensions/keep-in-view/keep-in-view.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, Extension, posToDOMRect } from "@tiptap/core"; let onWindowResize: ((this: Window, ev: UIEvent) => void) | undefined = diff --git a/packages/editor/src/extensions/list-item/commands.ts b/packages/editor/src/extensions/list-item/commands.ts index ed3dac746..ad2556a86 100644 --- a/packages/editor/src/extensions/list-item/commands.ts +++ b/packages/editor/src/extensions/list-item/commands.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EditorState } from "prosemirror-state"; import { NodeType } from "prosemirror-model"; import { findParentNodeOfType, hasParentNodeOfType } from "prosemirror-utils"; diff --git a/packages/editor/src/extensions/list-item/index.ts b/packages/editor/src/extensions/list-item/index.ts index 24950c4f2..e5208c485 100644 --- a/packages/editor/src/extensions/list-item/index.ts +++ b/packages/editor/src/extensions/list-item/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./list-item"; diff --git a/packages/editor/src/extensions/list-item/list-item.ts b/packages/editor/src/extensions/list-item/list-item.ts index f691a3085..a6bec8488 100644 --- a/packages/editor/src/extensions/list-item/list-item.ts +++ b/packages/editor/src/extensions/list-item/list-item.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ListItem as TiptapListItem } from "@tiptap/extension-list-item"; import { onBackspacePressed } from "./commands"; diff --git a/packages/editor/src/extensions/math/index.ts b/packages/editor/src/extensions/math/index.ts index 1331fdb01..f7b006fb9 100644 --- a/packages/editor/src/extensions/math/index.ts +++ b/packages/editor/src/extensions/math/index.ts @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export { MathInline } from "./math-inline"; export { MathBlock } from "./math-block"; diff --git a/packages/editor/src/extensions/math/math-block.ts b/packages/editor/src/extensions/math/math-block.ts index 7dd2b5303..22546bde3 100644 --- a/packages/editor/src/extensions/math/math-block.ts +++ b/packages/editor/src/extensions/math/math-block.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes } from "@tiptap/core"; import { insertMathNode } from "./plugin"; import { NodeSelection } from "prosemirror-state"; diff --git a/packages/editor/src/extensions/math/math-inline.ts b/packages/editor/src/extensions/math/math-inline.ts index 98a7e6abb..782af57d0 100644 --- a/packages/editor/src/extensions/math/math-inline.ts +++ b/packages/editor/src/extensions/math/math-inline.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes } from "@tiptap/core"; import { mathPlugin } from "./plugin"; diff --git a/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts b/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts index f49737709..0899d84a2 100644 --- a/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts +++ b/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Command } from "prosemirror-state"; import { EditorState, TextSelection, Transaction } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; diff --git a/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts b/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts index 309cb879e..4b00754e8 100644 --- a/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts +++ b/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Command } from "prosemirror-state"; import { NodeType } from "prosemirror-model"; import { diff --git a/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts b/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts index 20e3ed6e3..0c79307d0 100644 --- a/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts +++ b/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Command } from "prosemirror-state"; import { EditorState, TextSelection, Transaction } from "prosemirror-state"; diff --git a/packages/editor/src/extensions/math/plugin/index.ts b/packages/editor/src/extensions/math/plugin/index.ts index 71d85124d..33b51179c 100644 --- a/packages/editor/src/extensions/math/plugin/index.ts +++ b/packages/editor/src/extensions/math/plugin/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*--------------------------------------------------------- * Author: Benjamin R. Bray * License: MIT (see LICENSE in project root for details) diff --git a/packages/editor/src/extensions/math/plugin/math-node-view.ts b/packages/editor/src/extensions/math/plugin/math-node-view.ts index 36423514c..76f117d7f 100644 --- a/packages/editor/src/extensions/math/plugin/math-node-view.ts +++ b/packages/editor/src/extensions/math/plugin/math-node-view.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*--------------------------------------------------------- * Author: Benjamin R. Bray * License: MIT (see LICENSE in project root for details) diff --git a/packages/editor/src/extensions/math/plugin/math-plugin.ts b/packages/editor/src/extensions/math/plugin/math-plugin.ts index ac090710e..47b8c6a3e 100644 --- a/packages/editor/src/extensions/math/plugin/math-plugin.ts +++ b/packages/editor/src/extensions/math/plugin/math-plugin.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*--------------------------------------------------------- * Author: Benjamin R. Bray * License: MIT (see LICENSE in project root for details) diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts b/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts index 8945c5f8c..aec7b2ee2 100644 --- a/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts +++ b/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { NodeSelection } from "prosemirror-state"; import { Command as ProseCommand } from "prosemirror-state"; diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts b/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts index 0703f1bd5..45780d064 100644 --- a/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts +++ b/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /** * Note that for some of the `ParseRule`s defined below, * we define a `getAttrs` function, which, other than diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-select.ts b/packages/editor/src/extensions/math/plugin/plugins/math-select.ts index 7c733f2b8..a960bfc5b 100644 --- a/packages/editor/src/extensions/math/plugin/plugins/math-select.ts +++ b/packages/editor/src/extensions/math/plugin/plugins/math-select.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + /*--------------------------------------------------------- * Author: Benjamin R. Bray * License: MIT (see LICENSE in project root for details) diff --git a/packages/editor/src/extensions/math/plugin/renderers/katex.ts b/packages/editor/src/extensions/math/plugin/renderers/katex.ts index f958cd434..dd91c9854 100644 --- a/packages/editor/src/extensions/math/plugin/renderers/katex.ts +++ b/packages/editor/src/extensions/math/plugin/renderers/katex.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { MathRenderer } from "./types"; async function loadKatex() { diff --git a/packages/editor/src/extensions/math/plugin/renderers/types.ts b/packages/editor/src/extensions/math/plugin/renderers/types.ts index ffd5bf1c5..f513e5a08 100644 --- a/packages/editor/src/extensions/math/plugin/renderers/types.ts +++ b/packages/editor/src/extensions/math/plugin/renderers/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export type MathRenderFn = (text: string, element: HTMLElement) => void; export type MathRenderer = { inline: MathRenderFn; diff --git a/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts b/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts index ab6c799db..b15d85add 100644 --- a/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts +++ b/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node as ProseNode, Mark, diff --git a/packages/editor/src/extensions/math/plugin/utils/types.ts b/packages/editor/src/extensions/math/plugin/utils/types.ts index f1ab69a1d..6e8158949 100644 --- a/packages/editor/src/extensions/math/plugin/utils/types.ts +++ b/packages/editor/src/extensions/math/plugin/utils/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Schema, SchemaSpec } from "prosemirror-model"; //////////////////////////////////////////////////////////////////////////////// diff --git a/packages/editor/src/extensions/ordered-list/index.ts b/packages/editor/src/extensions/ordered-list/index.ts index 7ef46798c..914261cf2 100644 --- a/packages/editor/src/extensions/ordered-list/index.ts +++ b/packages/editor/src/extensions/ordered-list/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { OrderedList } from "./ordered-list"; export * from "./ordered-list"; diff --git a/packages/editor/src/extensions/ordered-list/ordered-list.ts b/packages/editor/src/extensions/ordered-list/ordered-list.ts index aa089b55c..419b6d3f9 100644 --- a/packages/editor/src/extensions/ordered-list/ordered-list.ts +++ b/packages/editor/src/extensions/ordered-list/ordered-list.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import TiptapOrderedList from "@tiptap/extension-ordered-list"; export const OrderedList = TiptapOrderedList.extend({ diff --git a/packages/editor/src/extensions/outline-list-item/component.tsx b/packages/editor/src/extensions/outline-list-item/component.tsx index af9fa7611..e8099a39c 100644 --- a/packages/editor/src/extensions/outline-list-item/component.tsx +++ b/packages/editor/src/extensions/outline-list-item/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import { ReactNodeViewProps } from "../react"; import { Icon } from "../../toolbar/components/icon"; diff --git a/packages/editor/src/extensions/outline-list-item/index.ts b/packages/editor/src/extensions/outline-list-item/index.ts index 1b1e56bc7..364d03cc9 100644 --- a/packages/editor/src/extensions/outline-list-item/index.ts +++ b/packages/editor/src/extensions/outline-list-item/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./outline-list-item"; diff --git a/packages/editor/src/extensions/outline-list-item/outline-list-item.ts b/packages/editor/src/extensions/outline-list-item/outline-list-item.ts index 5f1318075..3b8c021e2 100644 --- a/packages/editor/src/extensions/outline-list-item/outline-list-item.ts +++ b/packages/editor/src/extensions/outline-list-item/outline-list-item.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes, findChildren, Editor } from "@tiptap/core"; import { NodeType } from "prosemirror-model"; import { findParentNodeOfTypeClosestToPos } from "prosemirror-utils"; diff --git a/packages/editor/src/extensions/outline-list/component.tsx b/packages/editor/src/extensions/outline-list/component.tsx index 4a306132b..4bd3e90aa 100644 --- a/packages/editor/src/extensions/outline-list/component.tsx +++ b/packages/editor/src/extensions/outline-list/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Text } from "@streetwriters/rebass"; import { ReactNodeViewProps } from "../react"; import { useMemo } from "react"; @@ -13,7 +31,7 @@ export function OutlineListComponent( const isNested = useMemo(() => { const pos = editor.state.doc.resolve(getPos()); return pos.parent?.type.name === OutlineListItem.name; - }, []); + }, [editor, getPos]); return ( <> diff --git a/packages/editor/src/extensions/outline-list/index.ts b/packages/editor/src/extensions/outline-list/index.ts index 5aec1c8aa..ed8ecd8b8 100644 --- a/packages/editor/src/extensions/outline-list/index.ts +++ b/packages/editor/src/extensions/outline-list/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./outline-list"; diff --git a/packages/editor/src/extensions/outline-list/outline-list.ts b/packages/editor/src/extensions/outline-list/outline-list.ts index 0d259a1c2..b09d2626f 100644 --- a/packages/editor/src/extensions/outline-list/outline-list.ts +++ b/packages/editor/src/extensions/outline-list/outline-list.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Node, mergeAttributes, wrappingInputRule } from "@tiptap/core"; import { createNodeView } from "../react"; import { OutlineListComponent } from "./component"; diff --git a/packages/editor/src/extensions/paragraph/index.ts b/packages/editor/src/extensions/paragraph/index.ts index ed5fa62a0..73d9bc2eb 100644 --- a/packages/editor/src/extensions/paragraph/index.ts +++ b/packages/editor/src/extensions/paragraph/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./paragraph"; diff --git a/packages/editor/src/extensions/paragraph/paragraph.ts b/packages/editor/src/extensions/paragraph/paragraph.ts index 64c5febe5..3b6c449f5 100644 --- a/packages/editor/src/extensions/paragraph/paragraph.ts +++ b/packages/editor/src/extensions/paragraph/paragraph.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, mergeAttributes, Node } from "@tiptap/core"; import { NodeType } from "prosemirror-model"; diff --git a/packages/editor/src/extensions/react/event-dispatcher.ts b/packages/editor/src/extensions/react/event-dispatcher.ts index 54a9b0c74..f06320487 100644 --- a/packages/editor/src/extensions/react/event-dispatcher.ts +++ b/packages/editor/src/extensions/react/event-dispatcher.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { PluginKey } from "prosemirror-state"; export interface Listeners { diff --git a/packages/editor/src/extensions/react/index.ts b/packages/editor/src/extensions/react/index.ts index db315768f..696acaa90 100644 --- a/packages/editor/src/extensions/react/index.ts +++ b/packages/editor/src/extensions/react/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./react-node-view"; export * from "./types"; export * from "./react-portal-provider"; diff --git a/packages/editor/src/extensions/react/plugin.ts b/packages/editor/src/extensions/react/plugin.ts index 954eb9ba6..4722a8774 100644 --- a/packages/editor/src/extensions/react/plugin.ts +++ b/packages/editor/src/extensions/react/plugin.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Plugin, PluginKey } from "prosemirror-state"; import { EditorView } from "prosemirror-view"; import { Extension } from "@tiptap/core"; diff --git a/packages/editor/src/extensions/react/react-node-view.tsx b/packages/editor/src/extensions/react/react-node-view.tsx index a7092d0da..ec075a169 100644 --- a/packages/editor/src/extensions/react/react-node-view.tsx +++ b/packages/editor/src/extensions/react/react-node-view.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { SyntheticEvent } from "react"; import { NodeView, Decoration, DecorationSource } from "prosemirror-view"; import { Node as PMNode, Slice } from "prosemirror-model"; diff --git a/packages/editor/src/extensions/react/react-portal-provider.tsx b/packages/editor/src/extensions/react/react-portal-provider.tsx index dda978a10..156e0f6c5 100644 --- a/packages/editor/src/extensions/react/react-portal-provider.tsx +++ b/packages/editor/src/extensions/react/react-portal-provider.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { PropsWithChildren, useContext } from "react"; import { createPortal, diff --git a/packages/editor/src/extensions/react/selection-based-react-node-view.tsx b/packages/editor/src/extensions/react/selection-based-react-node-view.tsx index d15e7f101..7ca629a9a 100644 --- a/packages/editor/src/extensions/react/selection-based-react-node-view.tsx +++ b/packages/editor/src/extensions/react/selection-based-react-node-view.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { DecorationSet } from "prosemirror-view"; import { Node as PMNode } from "prosemirror-model"; diff --git a/packages/editor/src/extensions/react/types.ts b/packages/editor/src/extensions/react/types.ts index 4f04a2bd5..7a9e3aa7d 100644 --- a/packages/editor/src/extensions/react/types.ts +++ b/packages/editor/src/extensions/react/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "../../types"; import { Node as PMNode, Attrs } from "prosemirror-model"; diff --git a/packages/editor/src/extensions/search-replace/index.ts b/packages/editor/src/extensions/search-replace/index.ts index 8a016dad8..d29e8126f 100644 --- a/packages/editor/src/extensions/search-replace/index.ts +++ b/packages/editor/src/extensions/search-replace/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./search-replace"; diff --git a/packages/editor/src/extensions/search-replace/search-replace.ts b/packages/editor/src/extensions/search-replace/search-replace.ts index ae04d3d15..c3f6689ed 100644 --- a/packages/editor/src/extensions/search-replace/search-replace.ts +++ b/packages/editor/src/extensions/search-replace/search-replace.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, Extension } from "@tiptap/core"; import { Decoration, DecorationSet } from "prosemirror-view"; import { diff --git a/packages/editor/src/extensions/selection-persist/index.ts b/packages/editor/src/extensions/selection-persist/index.ts index 1bb64b085..a31aa1e05 100644 --- a/packages/editor/src/extensions/selection-persist/index.ts +++ b/packages/editor/src/extensions/selection-persist/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./selection-persist"; diff --git a/packages/editor/src/extensions/selection-persist/selection-persist.ts b/packages/editor/src/extensions/selection-persist/selection-persist.ts index 340b3abca..9e7ef5345 100644 --- a/packages/editor/src/extensions/selection-persist/selection-persist.ts +++ b/packages/editor/src/extensions/selection-persist/selection-persist.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension } from "@tiptap/core"; import { Plugin, PluginKey } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; diff --git a/packages/editor/src/extensions/table-cell/index.ts b/packages/editor/src/extensions/table-cell/index.ts index 512bb46bf..0c082d7dd 100644 --- a/packages/editor/src/extensions/table-cell/index.ts +++ b/packages/editor/src/extensions/table-cell/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { TableCell } from "./table-cell"; export * from "./table-cell"; diff --git a/packages/editor/src/extensions/table-cell/table-cell.ts b/packages/editor/src/extensions/table-cell/table-cell.ts index 8f21c182f..4de434bc5 100644 --- a/packages/editor/src/extensions/table-cell/table-cell.ts +++ b/packages/editor/src/extensions/table-cell/table-cell.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import TiptapTableCell from "@tiptap/extension-table-cell"; import { Attribute } from "@tiptap/core"; diff --git a/packages/editor/src/extensions/table/actions.ts b/packages/editor/src/extensions/table/actions.ts index a8c369f09..01778c721 100644 --- a/packages/editor/src/extensions/table/actions.ts +++ b/packages/editor/src/extensions/table/actions.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "@tiptap/core"; import { selectedRect, TableRect } from "@_ueberdosis/prosemirror-tables"; import { Transaction } from "prosemirror-state"; diff --git a/packages/editor/src/extensions/table/component.tsx b/packages/editor/src/extensions/table/component.tsx index b0f00be71..3ef5a9fbf 100644 --- a/packages/editor/src/extensions/table/component.tsx +++ b/packages/editor/src/extensions/table/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex } from "@streetwriters/rebass"; import { SelectionBasedNodeView, @@ -97,24 +115,28 @@ function TableRowToolbar(props: TableToolbarProps) { const { editor } = props; const rowToolsRef = useRef(null); - useEffect(() => { - if (!rowToolsRef.current) { - return; - } + useEffect( + () => { + if (!rowToolsRef.current) { + return; + } - const currentRow = findSelectedDOMNode(editor, ["tableRow"]); - if (!currentRow) return; + const currentRow = findSelectedDOMNode(editor, ["tableRow"]); + if (!currentRow) return; - const pos = getPosition(rowToolsRef.current, { - location: "left", - target: currentRow, - align: "start", - xOffset: -5, - yOffset: -3 - }); - rowToolsRef.current.style.top = `${pos.top}px`; - rowToolsRef.current.style.left = `${pos.left}px`; - }, [editor.state.selection, rowToolsRef.current]); + const pos = getPosition(rowToolsRef.current, { + location: "left", + target: currentRow, + align: "start", + xOffset: -5, + yOffset: -3 + }); + rowToolsRef.current.style.top = `${pos.top}px`; + rowToolsRef.current.style.left = `${pos.left}px`; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [editor.state.selection] + ); return ( (null); - useEffect(() => { - if (!columnToolsRef.current || !table) { - return; - } + useEffect( + () => { + if (!columnToolsRef.current || !table) { + return; + } - const currentCell = findSelectedDOMNode(editor, [ - "tableCell", - "tableHeader" - ]); - if (!currentCell) return; + const currentCell = findSelectedDOMNode(editor, [ + "tableCell", + "tableHeader" + ]); + if (!currentCell) return; - // tableRef.current - const pos = getPosition(columnToolsRef.current, { - location: "top", - align: "center", - target: currentCell as HTMLElement, - yAnchor: table, - yOffset: 2 - }); + // tableRef.current + const pos = getPosition(columnToolsRef.current, { + location: "top", + align: "center", + target: currentCell as HTMLElement, + yAnchor: table, + yOffset: 2 + }); - columnToolsRef.current.style.left = `${pos.left}px`; - columnToolsRef.current.style.top = `${pos.top}px`; - }, [editor.state.selection, columnToolsRef.current, table]); + columnToolsRef.current.style.left = `${pos.left}px`; + columnToolsRef.current.style.top = `${pos.top}px`; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [editor.state.selection, table] + ); return ( . + */ + export * from "./table"; diff --git a/packages/editor/src/extensions/table/table.ts b/packages/editor/src/extensions/table/table.ts index c04e40e2d..8152d94fc 100644 --- a/packages/editor/src/extensions/table/table.ts +++ b/packages/editor/src/extensions/table/table.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Table as TiptapTable, TableOptions } from "@tiptap/extension-table"; import { columnResizing, tableEditing } from "@_ueberdosis/prosemirror-tables"; import { Editor } from "../../types"; diff --git a/packages/editor/src/extensions/task-item/component.tsx b/packages/editor/src/extensions/task-item/component.tsx index 67d00af4e..b17335722 100644 --- a/packages/editor/src/extensions/task-item/component.tsx +++ b/packages/editor/src/extensions/task-item/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import { ReactNodeViewProps } from "../react"; import { Icon } from "../../toolbar/components/icon"; @@ -51,7 +69,7 @@ export function TaskItemComponent( } return true; - }, [editor, getPos, checked]); + }, [editor, checked, updateAttributes, getPos]); return ( <> diff --git a/packages/editor/src/extensions/task-item/index.ts b/packages/editor/src/extensions/task-item/index.ts index 3518ff3b2..300432439 100644 --- a/packages/editor/src/extensions/task-item/index.ts +++ b/packages/editor/src/extensions/task-item/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./task-item"; diff --git a/packages/editor/src/extensions/task-item/task-item.ts b/packages/editor/src/extensions/task-item/task-item.ts index 7eb6cfeee..e91979cd4 100644 --- a/packages/editor/src/extensions/task-item/task-item.ts +++ b/packages/editor/src/extensions/task-item/task-item.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { mergeAttributes } from "@tiptap/core"; import { onBackspacePressed } from "../list-item/commands"; import { TaskItem } from "@tiptap/extension-task-item"; diff --git a/packages/editor/src/extensions/task-list/component.tsx b/packages/editor/src/extensions/task-list/component.tsx index 71bf8b852..f0ee9fee3 100644 --- a/packages/editor/src/extensions/task-list/component.tsx +++ b/packages/editor/src/extensions/task-list/component.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import { ReactNodeViewProps } from "../react"; import { Node } from "prosemirror-model"; @@ -23,7 +41,7 @@ export function TaskListComponent( const getParent = useCallback(() => { const pos = editor.state.doc.resolve(getPos()); return findParentNodeOfTypeClosestToPos(pos, taskItemType); - }, []); + }, [editor.state.doc, getPos, taskItemType]); const isNested = useMemo(() => { return !!getParent(); @@ -44,7 +62,7 @@ export function TaskListComponent( tr.setNodeMarkup(pos, undefined, { checked: allChecked }); return true; }); - }, [node, node.childCount]); + }, [editor.commands, editor.state.doc, getParent, node, node.childCount]); useEffect(() => { const children = findChildren( diff --git a/packages/editor/src/extensions/task-list/index.ts b/packages/editor/src/extensions/task-list/index.ts index 291e035cb..4eb625f3b 100644 --- a/packages/editor/src/extensions/task-list/index.ts +++ b/packages/editor/src/extensions/task-list/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./task-list"; diff --git a/packages/editor/src/extensions/task-list/task-list.ts b/packages/editor/src/extensions/task-list/task-list.ts index 3ac797f2f..c1b6c0ba8 100644 --- a/packages/editor/src/extensions/task-list/task-list.ts +++ b/packages/editor/src/extensions/task-list/task-list.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { mergeAttributes } from "@tiptap/core"; import { TaskList } from "@tiptap/extension-task-list"; import { createNodeView } from "../react"; diff --git a/packages/editor/src/extensions/text-direction/index.ts b/packages/editor/src/extensions/text-direction/index.ts index f2c9d7991..83f4688d4 100644 --- a/packages/editor/src/extensions/text-direction/index.ts +++ b/packages/editor/src/extensions/text-direction/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { TextDirection } from "./text-direction"; export * from "./text-direction"; diff --git a/packages/editor/src/extensions/text-direction/text-direction.ts b/packages/editor/src/extensions/text-direction/text-direction.ts index a43b75784..087edbcf6 100644 --- a/packages/editor/src/extensions/text-direction/text-direction.ts +++ b/packages/editor/src/extensions/text-direction/text-direction.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Extension } from "@tiptap/core"; import "@tiptap/extension-text-style"; diff --git a/packages/editor/src/hooks/use-editor.ts b/packages/editor/src/hooks/use-editor.ts index 7a5cce808..473523328 100644 --- a/packages/editor/src/hooks/use-editor.ts +++ b/packages/editor/src/hooks/use-editor.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { EditorOptions } from "@tiptap/core"; import { DependencyList, useEffect, useRef, useState } from "react"; import { Editor } from "../types"; @@ -16,28 +34,32 @@ export const useEditor = ( const forceUpdate = useForceUpdate(); const editorRef = useRef(editor); - useEffect(() => { - let isMounted = true; + useEffect( + () => { + let isMounted = true; - const instance = new Editor(options); + const instance = new Editor(options); - setEditor(instance); + setEditor(instance); - instance.on("transaction", () => { - requestAnimationFrame(() => { + instance.on("transaction", () => { requestAnimationFrame(() => { - if (isMounted) { - forceUpdate(); - } + requestAnimationFrame(() => { + if (isMounted) { + forceUpdate(); + } + }); }); }); - }); - return () => { - instance.destroy(); - isMounted = false; - }; - }, deps); + return () => { + instance.destroy(); + isMounted = false; + }; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [...deps, forceUpdate, options] + ); useEffect(() => { editorRef.current = editor; @@ -73,7 +95,7 @@ export const useEditor = ( return () => { editor?.view.dom.removeEventListener("dragenter", onDragEnter); }; - }, [editor?.view.dom]); + }, [editor?.view.dom, editor?.view.dragging]); return editor; }; diff --git a/packages/editor/src/hooks/use-permission-handler.ts b/packages/editor/src/hooks/use-permission-handler.ts index 2c2b922a4..a10238df4 100644 --- a/packages/editor/src/hooks/use-permission-handler.ts +++ b/packages/editor/src/hooks/use-permission-handler.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { UnionCommands } from "@tiptap/core"; import { useEffect } from "react"; import { PermissionRequestEvent } from "../types"; diff --git a/packages/editor/src/hooks/use-ref-value.ts b/packages/editor/src/hooks/use-ref-value.ts index d7f4ddff8..9a5f70246 100644 --- a/packages/editor/src/hooks/use-ref-value.ts +++ b/packages/editor/src/hooks/use-ref-value.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef } from "react"; export function useRefValue(value: T) { diff --git a/packages/editor/src/index.ts b/packages/editor/src/index.ts index 990c9ec40..6c748ab8d 100644 --- a/packages/editor/src/index.ts +++ b/packages/editor/src/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import "./extensions"; import CharacterCount from "@tiptap/extension-character-count"; import Placeholder from "@tiptap/extension-placeholder"; @@ -88,7 +106,14 @@ const useTiptap = ( setIsMobile(isMobile || false); setTheme(theme); setIsKeyboardOpen(isKeyboardOpen || false); - }, [isMobile, theme, isKeyboardOpen]); + }, [ + isMobile, + theme, + isKeyboardOpen, + setIsMobile, + setTheme, + setIsKeyboardOpen + ]); const defaultOptions = useMemo>( () => ({ @@ -179,6 +204,8 @@ const useTiptap = ( injectCSS: false }), [ + doubleSpacedLines, + isMobile, onDownloadAttachment, onOpenAttachmentPicker, PortalProviderAPI, diff --git a/packages/editor/src/toolbar/components/counter.tsx b/packages/editor/src/toolbar/components/counter.tsx index 4320eac22..1183910e8 100644 --- a/packages/editor/src/toolbar/components/counter.tsx +++ b/packages/editor/src/toolbar/components/counter.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { Flex } from "@streetwriters/rebass"; import { Button } from "../../components/button"; diff --git a/packages/editor/src/toolbar/components/dropdown.tsx b/packages/editor/src/toolbar/components/dropdown.tsx index 654fa9739..7e7f42a85 100644 --- a/packages/editor/src/toolbar/components/dropdown.tsx +++ b/packages/editor/src/toolbar/components/dropdown.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useRef, useState } from "react"; import { Text } from "@streetwriters/rebass"; import { Icon } from "./icon"; diff --git a/packages/editor/src/toolbar/components/icon.tsx b/packages/editor/src/toolbar/components/icon.tsx index 02395b7db..a0ba05e6c 100644 --- a/packages/editor/src/toolbar/components/icon.tsx +++ b/packages/editor/src/toolbar/components/icon.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import MDIIcon from "@mdi/react"; import { Theme } from "@notesnook/theme"; import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme"; diff --git a/packages/editor/src/toolbar/components/more-tools.tsx b/packages/editor/src/toolbar/components/more-tools.tsx index e318f16c2..ab8ce0764 100644 --- a/packages/editor/src/toolbar/components/more-tools.tsx +++ b/packages/editor/src/toolbar/components/more-tools.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useRef, useState } from "react"; import { PopupWrapper } from "../../components/popup-presenter"; import { ToolButton } from "../components/tool-button"; diff --git a/packages/editor/src/toolbar/components/popup.tsx b/packages/editor/src/toolbar/components/popup.tsx index 0314c3dd8..96f42ae8b 100644 --- a/packages/editor/src/toolbar/components/popup.tsx +++ b/packages/editor/src/toolbar/components/popup.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Button, Flex, Text } from "@streetwriters/rebass"; import { Icon } from "./icon"; import { Icons } from "../icons"; diff --git a/packages/editor/src/toolbar/components/split-button.tsx b/packages/editor/src/toolbar/components/split-button.tsx index 48b3bb068..a5f459b61 100644 --- a/packages/editor/src/toolbar/components/split-button.tsx +++ b/packages/editor/src/toolbar/components/split-button.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { PropsWithChildren, useRef } from "react"; import { Flex } from "@streetwriters/rebass"; import { Icons } from "../icons"; diff --git a/packages/editor/src/toolbar/components/tool-button.tsx b/packages/editor/src/toolbar/components/tool-button.tsx index da1ba4b4d..f08287b40 100644 --- a/packages/editor/src/toolbar/components/tool-button.tsx +++ b/packages/editor/src/toolbar/components/tool-button.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Theme } from "@notesnook/theme"; import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme"; import React from "react"; diff --git a/packages/editor/src/toolbar/components/toolbar-group.tsx b/packages/editor/src/toolbar/components/toolbar-group.tsx index cc2fa15e3..877cf0c17 100644 --- a/packages/editor/src/toolbar/components/toolbar-group.tsx +++ b/packages/editor/src/toolbar/components/toolbar-group.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolbarGroupDefinition, ToolButtonVariant } from "../types"; import { findTool } from "../tools"; import { Flex, FlexProps } from "@streetwriters/rebass"; diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx index 70ce4a440..5298cf7ef 100644 --- a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx +++ b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useEffect, useRef } from "react"; import { showPopup } from "../../../components/popup-presenter"; import { Editor } from "../../../types"; @@ -19,74 +37,78 @@ export function HoverPopupHandler(props: FloatingMenuProps) { const hoverTimeoutId = useRef(); const activePopup = useRef<{ element: HTMLElement; hide: () => void }>(); - useEffect(() => { - function onMouseOver(e: MouseEvent) { - if ( - !e.target || - !(e.target instanceof HTMLElement) || - e.target.classList.contains("ProseMirror") - ) - return; - - const element = e.target; - - if (activePopup.current) { - const isOutsideEditor = !element.closest(".ProseMirror"); - const isInsidePopup = element.closest(".popup-presenter-portal"); - const isActiveElement = activePopup.current.element === element; - if (isInsidePopup) return; - - if (isOutsideEditor || !isActiveElement) { - activePopup.current.hide(); - activePopup.current = undefined; + useEffect( + () => { + function onMouseOver(e: MouseEvent) { + if ( + !e.target || + !(e.target instanceof HTMLElement) || + e.target.classList.contains("ProseMirror") + ) return; + + const element = e.target; + + if (activePopup.current) { + const isOutsideEditor = !element.closest(".ProseMirror"); + const isInsidePopup = element.closest(".popup-presenter-portal"); + const isActiveElement = activePopup.current.element === element; + if (isInsidePopup) return; + + if (isOutsideEditor || !isActiveElement) { + activePopup.current.hide(); + activePopup.current = undefined; + return; + } } + + clearTimeout(hoverTimeoutId.current); + + hoverTimeoutId.current = setTimeout( + () => { + const PopupHandler = handlers.find((h) => h.isActive(element)); + if (!PopupHandler || !editor.current) return; + + const { popup: Popup } = PopupHandler; + const pos = editor.current.view.posAtDOM(element, 0); + const node = editor.current.view.state.doc.nodeAt(pos); + + if (!node) return; + + const hidePopup = showPopup({ + popup: () => ( + + ), + blocking: false, + focusOnRender: false, + position: { + target: element, + align: "center", + location: "top", + isTargetAbsolute: true + } + }); + activePopup.current = { element, hide: hidePopup }; + }, + HOVER_TIMEOUT, + {} + ); } - - clearTimeout(hoverTimeoutId.current); - - hoverTimeoutId.current = setTimeout( - () => { - const PopupHandler = handlers.find((h) => h.isActive(element)); - if (!PopupHandler || !editor.current) return; - - const { popup: Popup } = PopupHandler; - const pos = editor.current.view.posAtDOM(element, 0); - const node = editor.current.view.state.doc.nodeAt(pos); - - if (!node) return; - - const hidePopup = showPopup({ - popup: () => ( - - ), - blocking: false, - focusOnRender: false, - position: { - target: element, - align: "center", - location: "top", - isTargetAbsolute: true - } - }); - activePopup.current = { element, hide: hidePopup }; - }, - HOVER_TIMEOUT, - {} - ); - } - window.addEventListener("mouseover", onMouseOver); - return () => { - window.removeEventListener("mouseover", onMouseOver); - }; - }, []); + window.addEventListener("mouseover", onMouseOver); + return () => { + window.removeEventListener("mouseover", onMouseOver); + }; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [] + ); return null; } diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx index 412054cd0..cd7186c6c 100644 --- a/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx +++ b/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolbarGroup } from "../../components/toolbar-group"; import { HoverPopupProps } from "."; diff --git a/packages/editor/src/toolbar/floating-menus/index.tsx b/packages/editor/src/toolbar/floating-menus/index.tsx index 31fc28193..ee2bcd40e 100644 --- a/packages/editor/src/toolbar/floating-menus/index.tsx +++ b/packages/editor/src/toolbar/floating-menus/index.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { DesktopOnly } from "../../components/responsive"; import { HoverPopupHandler } from "./hover-popup"; import { SearchReplaceFloatingMenu } from "./search-replace"; diff --git a/packages/editor/src/toolbar/floating-menus/search-replace.tsx b/packages/editor/src/toolbar/floating-menus/search-replace.tsx index ed4716acd..176a13e33 100644 --- a/packages/editor/src/toolbar/floating-menus/search-replace.tsx +++ b/packages/editor/src/toolbar/floating-menus/search-replace.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SearchStorage } from "../../extensions/search-replace"; import { FloatingMenuProps } from "./types"; import { SearchReplacePopup } from "../popups/search-replace"; diff --git a/packages/editor/src/toolbar/floating-menus/types.ts b/packages/editor/src/toolbar/floating-menus/types.ts index ff5a1d681..6215d0e32 100644 --- a/packages/editor/src/toolbar/floating-menus/types.ts +++ b/packages/editor/src/toolbar/floating-menus/types.ts @@ -1,2 +1,20 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "../../types"; export type FloatingMenuProps = { editor: Editor }; diff --git a/packages/editor/src/toolbar/icons.ts b/packages/editor/src/toolbar/icons.ts index 337f68cd8..dfd201bcf 100644 --- a/packages/editor/src/toolbar/icons.ts +++ b/packages/editor/src/toolbar/icons.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { mdiAttachment, mdiBorderHorizontal, diff --git a/packages/editor/src/toolbar/index.ts b/packages/editor/src/toolbar/index.ts index e0caeec4b..3c233d051 100644 --- a/packages/editor/src/toolbar/index.ts +++ b/packages/editor/src/toolbar/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Toolbar } from "./toolbar"; export default Toolbar; diff --git a/packages/editor/src/toolbar/popups/cell-properties.tsx b/packages/editor/src/toolbar/popups/cell-properties.tsx index 3dd0c43e7..b76d62b42 100644 --- a/packages/editor/src/toolbar/popups/cell-properties.tsx +++ b/packages/editor/src/toolbar/popups/cell-properties.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "../../types"; import { Box } from "@streetwriters/rebass"; import { Tab, Tabs } from "../../components/tabs"; diff --git a/packages/editor/src/toolbar/popups/color-picker.tsx b/packages/editor/src/toolbar/popups/color-picker.tsx index 5b8dd911a..c91427b40 100644 --- a/packages/editor/src/toolbar/popups/color-picker.tsx +++ b/packages/editor/src/toolbar/popups/color-picker.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import { Input } from "@streetwriters/rebass-forms"; import { Icon } from "../components/icon"; @@ -56,6 +74,7 @@ export function ColorPicker(props: ColorPickerProps) { if (isPickerOpen) ref.current.focus({ preventScroll: true }); }, [isPickerOpen]); + // eslint-disable-next-line react-hooks/exhaustive-deps const onColorChange = useCallback( debounce((color: string) => { onChange(color); diff --git a/packages/editor/src/toolbar/popups/embed-popup.tsx b/packages/editor/src/toolbar/popups/embed-popup.tsx index 6dba2cec2..dbdb3c35c 100644 --- a/packages/editor/src/toolbar/popups/embed-popup.tsx +++ b/packages/editor/src/toolbar/popups/embed-popup.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex, Text } from "@streetwriters/rebass"; import { useCallback, useState } from "react"; import { Popup } from "../components/popup"; @@ -44,7 +62,7 @@ export function EmbedPopup(props: EmbedPopupProps) { setHeight(size.height); if (onSizeChanged) onSizeChanged(size); }, - [width, height] + [height, width, onSizeChanged] ); return ( diff --git a/packages/editor/src/toolbar/popups/image-properties.tsx b/packages/editor/src/toolbar/popups/image-properties.tsx index d26d5621c..173253f9d 100644 --- a/packages/editor/src/toolbar/popups/image-properties.tsx +++ b/packages/editor/src/toolbar/popups/image-properties.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Flex } from "@streetwriters/rebass"; import { useCallback } from "react"; import { Popup } from "../components/popup"; @@ -34,6 +52,7 @@ export function ImageProperties(props: ImagePropertiesProps) { editor.current?.chain().setImageSize(size).run(); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [width, height] ); diff --git a/packages/editor/src/toolbar/popups/image-upload.tsx b/packages/editor/src/toolbar/popups/image-upload.tsx index 1078d1724..6cf9c64fb 100644 --- a/packages/editor/src/toolbar/popups/image-upload.tsx +++ b/packages/editor/src/toolbar/popups/image-upload.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Input } from "@streetwriters/rebass-forms"; import { useState } from "react"; import { Flex, Text } from "@streetwriters/rebass"; diff --git a/packages/editor/src/toolbar/popups/link-popup.tsx b/packages/editor/src/toolbar/popups/link-popup.tsx index 563b57003..3c0479391 100644 --- a/packages/editor/src/toolbar/popups/link-popup.tsx +++ b/packages/editor/src/toolbar/popups/link-popup.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Input } from "@streetwriters/rebass-forms"; import { Flex } from "@streetwriters/rebass"; import { useRefValue } from "../../hooks/use-ref-value"; diff --git a/packages/editor/src/toolbar/popups/search-replace.tsx b/packages/editor/src/toolbar/popups/search-replace.tsx index f2d10bdb0..16633be4c 100644 --- a/packages/editor/src/toolbar/popups/search-replace.tsx +++ b/packages/editor/src/toolbar/popups/search-replace.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Input } from "@streetwriters/rebass-forms"; import { useCallback, useEffect, useRef, useState } from "react"; import { Flex, Text } from "@streetwriters/rebass"; @@ -21,12 +39,13 @@ export function SearchReplacePopup(props: SearchReplacePopupProps) { const search = useCallback( (term: string) => { - editor.commands.search(term, { + editor.current?.commands.search(term, { matchCase, enableRegex, matchWholeWord }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [matchCase, enableRegex, matchWholeWord] ); diff --git a/packages/editor/src/toolbar/popups/table-popup.tsx b/packages/editor/src/toolbar/popups/table-popup.tsx index 52387649e..271664192 100644 --- a/packages/editor/src/toolbar/popups/table-popup.tsx +++ b/packages/editor/src/toolbar/popups/table-popup.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Box, Flex, Text } from "@streetwriters/rebass"; import { useEffect, useState } from "react"; import { Popup } from "../components/popup"; diff --git a/packages/editor/src/toolbar/stores/toolbar-store.ts b/packages/editor/src/toolbar/stores/toolbar-store.ts index a7b3e5e3f..37591e815 100644 --- a/packages/editor/src/toolbar/stores/toolbar-store.ts +++ b/packages/editor/src/toolbar/stores/toolbar-store.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Theme } from "@notesnook/theme"; import create from "zustand"; diff --git a/packages/editor/src/toolbar/tool-definitions.ts b/packages/editor/src/toolbar/tool-definitions.ts index c897a9707..af9627672 100644 --- a/packages/editor/src/toolbar/tool-definitions.ts +++ b/packages/editor/src/toolbar/tool-definitions.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolbarDefinition, ToolDefinition } from "./types"; import { ToolId } from "./tools"; diff --git a/packages/editor/src/toolbar/toolbar.tsx b/packages/editor/src/toolbar/toolbar.tsx index 46b057849..7da4cc589 100644 --- a/packages/editor/src/toolbar/toolbar.tsx +++ b/packages/editor/src/toolbar/toolbar.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Theme } from "@notesnook/theme"; import { Editor } from "../types"; import { Flex, FlexProps } from "@streetwriters/rebass"; @@ -47,7 +65,7 @@ export function Toolbar(props: ToolbarProps) { useEffect(() => { setToolbarLocation(location); - }, [location]); + }, [location, setToolbarLocation]); if (!editor) return null; return ( diff --git a/packages/editor/src/toolbar/tools/alignment.tsx b/packages/editor/src/toolbar/tools/alignment.tsx index 143ae4103..aed339086 100644 --- a/packages/editor/src/toolbar/tools/alignment.tsx +++ b/packages/editor/src/toolbar/tools/alignment.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { useRefValue } from "../../hooks/use-ref-value"; diff --git a/packages/editor/src/toolbar/tools/attachment.tsx b/packages/editor/src/toolbar/tools/attachment.tsx index 3d9f113f5..f9bbcf655 100644 --- a/packages/editor/src/toolbar/tools/attachment.tsx +++ b/packages/editor/src/toolbar/tools/attachment.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { MoreTools } from "../components/more-tools"; diff --git a/packages/editor/src/toolbar/tools/block.tsx b/packages/editor/src/toolbar/tools/block.tsx index 4cbb2a23a..6059cbcb3 100644 --- a/packages/editor/src/toolbar/tools/block.tsx +++ b/packages/editor/src/toolbar/tools/block.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { Editor } from "../../types"; import { Icons } from "../icons"; @@ -19,20 +37,24 @@ export function InsertBlock(props: ToolProps) { const toolbarLocation = useToolbarLocation(); const isMobile = useIsMobile(); - const menuItems = useMemo(() => { - return [ - tasklist(editor), - outlinelist(editor), - horizontalRule(editor), - codeblock(editor), - mathblock(editor), - blockquote(editor), - image(editor, isMobile), - attachment(editor), - isMobile ? embedMobile(editor) : embedDesktop(editor), - table(editor) - ]; - }, [isMobile]); + const menuItems = useMemo( + () => { + return [ + tasklist(editor), + outlinelist(editor), + horizontalRule(editor), + codeblock(editor), + mathblock(editor), + blockquote(editor), + image(editor, isMobile), + attachment(editor), + isMobile ? embedMobile(editor) : embedDesktop(editor), + table(editor) + ]; + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [isMobile] + ); return ( <> diff --git a/packages/editor/src/toolbar/tools/colors.tsx b/packages/editor/src/toolbar/tools/colors.tsx index cb8e1d200..73393f4f8 100644 --- a/packages/editor/src/toolbar/tools/colors.tsx +++ b/packages/editor/src/toolbar/tools/colors.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { useState } from "react"; import tinycolor from "tinycolor2"; import { PopupWrapper } from "../../components/popup-presenter"; diff --git a/packages/editor/src/toolbar/tools/embed.tsx b/packages/editor/src/toolbar/tools/embed.tsx index cb556cc83..49da8bf54 100644 --- a/packages/editor/src/toolbar/tools/embed.tsx +++ b/packages/editor/src/toolbar/tools/embed.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { useMemo, useRef, useState } from "react"; @@ -81,7 +99,7 @@ export function EmbedProperties(props: ToolProps) { const buttonRef = useRef(); // TODO: improve perf by deferring this until user opens the popup - const embedNode = useMemo(() => findSelectedNode(editor, "embed"), []); + const embedNode = useMemo(() => findSelectedNode(editor, "embed"), [editor]); const embed = (embedNode?.attrs || {}) as Embed; return ( diff --git a/packages/editor/src/toolbar/tools/font.tsx b/packages/editor/src/toolbar/tools/font.tsx index fd8dc47ff..d5efde032 100644 --- a/packages/editor/src/toolbar/tools/font.tsx +++ b/packages/editor/src/toolbar/tools/font.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { Editor } from "../../types"; import { Dropdown } from "../components/dropdown"; @@ -14,11 +32,11 @@ export function FontSize(props: ToolProps) { const decreaseFontSize = useCallback(() => { return Math.max(8, fontSizeAsNumber.current - 1); - }, []); + }, [fontSizeAsNumber]); const increaseFontSize = useCallback(() => { return Math.min(120, fontSizeAsNumber.current + 1); - }, []); + }, [fontSizeAsNumber]); return ( toMenuItems(editor, currentFontFamily), + // eslint-disable-next-line react-hooks/exhaustive-deps [currentFontFamily] ); diff --git a/packages/editor/src/toolbar/tools/headings.tsx b/packages/editor/src/toolbar/tools/headings.tsx index e9bd8f05c..857be12e3 100644 --- a/packages/editor/src/toolbar/tools/headings.tsx +++ b/packages/editor/src/toolbar/tools/headings.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { Editor } from "../../types"; import { Dropdown } from "../components/dropdown"; @@ -16,7 +34,8 @@ export function Headings(props: ToolProps) { ); const items = useMemo( () => toMenuItems(editor, toolbarLocation, currentHeadingLevel), - [currentHeadingLevel] + // eslint-disable-next-line react-hooks/exhaustive-deps + [currentHeadingLevel, toolbarLocation] ); return ( diff --git a/packages/editor/src/toolbar/tools/image.tsx b/packages/editor/src/toolbar/tools/image.tsx index b18d955af..bbb0ee873 100644 --- a/packages/editor/src/toolbar/tools/image.tsx +++ b/packages/editor/src/toolbar/tools/image.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { useRef, useState } from "react"; diff --git a/packages/editor/src/toolbar/tools/index.ts b/packages/editor/src/toolbar/tools/index.ts index 13deafdc9..5ad5db5ba 100644 --- a/packages/editor/src/toolbar/tools/index.ts +++ b/packages/editor/src/toolbar/tools/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React from "react"; import { ToolProps } from "../types"; import { diff --git a/packages/editor/src/toolbar/tools/inline.tsx b/packages/editor/src/toolbar/tools/inline.tsx index 43011b96f..a6ac0db95 100644 --- a/packages/editor/src/toolbar/tools/inline.tsx +++ b/packages/editor/src/toolbar/tools/inline.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { useToolbarLocation } from "../stores/toolbar-store"; diff --git a/packages/editor/src/toolbar/tools/link.tsx b/packages/editor/src/toolbar/tools/link.tsx index a82ae802e..d6dd9696f 100644 --- a/packages/editor/src/toolbar/tools/link.tsx +++ b/packages/editor/src/toolbar/tools/link.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { useCallback, useRef, useState } from "react"; @@ -31,27 +49,31 @@ export function AddLink(props: ToolProps) { const isActive = props.editor.isActive("link"); - const onDone = useCallback((link: LinkDefinition) => { - const { href, text, isImage } = link; - if (!href) return; + const onDone = useCallback( + (link: LinkDefinition) => { + const { href, text, isImage } = link; + if (!href) return; - let commandChain = editor.current?.chain().focus(); - if (!commandChain) return; + let commandChain = editor.current?.chain().focus(); + if (!commandChain) return; - const isSelection = !editor.current?.state.selection.empty; + const isSelection = !editor.current?.state.selection.empty; - commandChain = commandChain - .extendMarkRange("link") - .toggleLink({ href, target: "_blank" }); - if (!isImage) commandChain = commandChain.insertContent(text || href); + commandChain = commandChain + .extendMarkRange("link") + .toggleLink({ href, target: "_blank" }); + if (!isImage) commandChain = commandChain.insertContent(text || href); - commandChain = commandChain.focus(); + commandChain = commandChain.focus(); - if (!isSelection && !isImage) - commandChain = commandChain.unsetMark("link").insertContent(" "); + if (!isSelection && !isImage) + commandChain = commandChain.unsetMark("link").insertContent(" "); - commandChain.run(); - }, []); + commandChain.run(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [] + ); if (isActive) return ; return ( @@ -79,49 +101,57 @@ export function EditLink(props: ToolProps) { _selectedNode || selectionToOffset(editor.state) ); - const onDone = useCallback((link: LinkDefinition) => { - const { href, text, isImage } = link; - const { from, node, to } = selectedNode.current; - if (!href || !editor.current || !node) return; + const onDone = useCallback( + (link: LinkDefinition) => { + const { href, text, isImage } = link; + const { from, node, to } = selectedNode.current; + if (!href || !editor.current || !node) return; - const mark = findMark(node, "link"); - if (!mark) return; + const mark = findMark(node, "link"); + if (!mark) return; - const selection = editor.current.state.selection; + const selection = editor.current.state.selection; - let commandChain = editor.current.chain(); + let commandChain = editor.current.chain(); - if (!isImage) { - commandChain = commandChain.command(({ tr }) => { - tr.removeMark(from, to, mark.type); - tr.insertText( - text || node.textContent, - tr.mapping.map(from), - tr.mapping.map(to) - ); - tr.setSelection( - TextSelection.create(tr.doc, tr.mapping.map(from), tr.mapping.map(to)) - ); - return true; - }); - } + if (!isImage) { + commandChain = commandChain.command(({ tr }) => { + tr.removeMark(from, to, mark.type); + tr.insertText( + text || node.textContent, + tr.mapping.map(from), + tr.mapping.map(to) + ); + tr.setSelection( + TextSelection.create( + tr.doc, + tr.mapping.map(from), + tr.mapping.map(to) + ) + ); + return true; + }); + } - commandChain - .extendMarkRange("link") - .toggleLink({ href, target: "_blank" }) - .command(({ tr }) => { - tr.setSelection( - TextSelection.create( - tr.doc, - tr.mapping.map(selection.from), - tr.mapping.map(selection.to) - ) - ); - return true; - }) - .focus(undefined, { scrollIntoView: true }) - .run(); - }, []); + commandChain + .extendMarkRange("link") + .toggleLink({ href, target: "_blank" }) + .command(({ tr }) => { + tr.setSelection( + TextSelection.create( + tr.doc, + tr.mapping.map(selection.from), + tr.mapping.map(selection.to) + ) + ); + return true; + }) + .focus(undefined, { scrollIntoView: true }) + .run(); + }, + // eslint-disable-next-line react-hooks/exhaustive-deps + [] + ); return ( . + */ + import { ToolProps } from "../types"; import { Box, Button, Flex } from "@streetwriters/rebass"; import { IconNames } from "../icons"; @@ -103,6 +121,7 @@ export function NumberedList(props: ToolProps) { const onClick = useCallback( () => editor.current?.chain().focus().toggleOrderedList().run(), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -136,6 +155,7 @@ export function BulletList(props: ToolProps) { const { editor } = props; const onClick = useCallback( () => editor.current?.chain().focus().toggleBulletList().run(), + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/packages/editor/src/toolbar/tools/table.tsx b/packages/editor/src/toolbar/tools/table.tsx index 971ac4982..3767462f7 100644 --- a/packages/editor/src/toolbar/tools/table.tsx +++ b/packages/editor/src/toolbar/tools/table.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { Editor } from "../../types"; import { ToolButton } from "../components/tool-button"; @@ -57,6 +75,7 @@ export function RowProperties(props: ToolProps) { moveRowDown(editor), deleteRow(editor) ], + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -99,6 +118,7 @@ export function ColumnProperties(props: ToolProps) { moveColumnRight(editor), deleteColumn(editor) ], + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); @@ -147,6 +167,7 @@ export function TableProperties(props: ToolProps) { { type: "separator", key: "tableSeperator" }, deleteTable(editor) ], + // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/packages/editor/src/toolbar/tools/text-direction.tsx b/packages/editor/src/toolbar/tools/text-direction.tsx index eb3d60f78..72eef064f 100644 --- a/packages/editor/src/toolbar/tools/text-direction.tsx +++ b/packages/editor/src/toolbar/tools/text-direction.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ToolProps } from "../types"; import { ToolButton } from "../components/tool-button"; import { IconNames } from "../icons"; diff --git a/packages/editor/src/toolbar/tools/utils.tsx b/packages/editor/src/toolbar/tools/utils.tsx index e96fe9a99..415ef1dc4 100644 --- a/packages/editor/src/toolbar/tools/utils.tsx +++ b/packages/editor/src/toolbar/tools/utils.tsx @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "../../types"; import { MenuButton } from "../../components/menu/types"; import { ToolButton } from "../components/tool-button"; diff --git a/packages/editor/src/toolbar/types.ts b/packages/editor/src/toolbar/types.ts index 653bcab87..50f829029 100644 --- a/packages/editor/src/toolbar/types.ts +++ b/packages/editor/src/toolbar/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor } from "../types"; import { IconNames } from "./icons"; import { ToolId } from "./tools"; diff --git a/packages/editor/src/toolbar/utils/dom.ts b/packages/editor/src/toolbar/utils/dom.ts index d3285e623..d6c70c442 100644 --- a/packages/editor/src/toolbar/utils/dom.ts +++ b/packages/editor/src/toolbar/utils/dom.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function getToolbarElement() { return ( (document.querySelector(".editor-toolbar") as HTMLElement) || undefined diff --git a/packages/editor/src/toolbar/utils/prosemirror.ts b/packages/editor/src/toolbar/utils/prosemirror.ts index c8ed5ff85..d3f6966eb 100644 --- a/packages/editor/src/toolbar/utils/prosemirror.ts +++ b/packages/editor/src/toolbar/utils/prosemirror.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Editor, findParentNode } from "@tiptap/core"; import { Node as ProsemirrorNode, Mark } from "prosemirror-model"; import { EditorState } from "prosemirror-state"; diff --git a/packages/editor/src/types.ts b/packages/editor/src/types.ts index 2dfe2cef1..1b05f291c 100644 --- a/packages/editor/src/types.ts +++ b/packages/editor/src/types.ts @@ -1,6 +1,24 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { UnionCommands, Editor as TiptapEditor } from "@tiptap/core"; -export type PermissionRequestEvent = CustomEvent<{ id: keyof UnionCommands }> +export type PermissionRequestEvent = CustomEvent<{ id: keyof UnionCommands }>; export class Editor extends TiptapEditor { /** diff --git a/packages/editor/src/utils/config.ts b/packages/editor/src/utils/config.ts index 669a04908..93804dfa9 100644 --- a/packages/editor/src/utils/config.ts +++ b/packages/editor/src/utils/config.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + function set(key: string, value: T | null) { if (!value) return window.localStorage.removeItem(key); window.localStorage.setItem(key, JSON.stringify(value)); diff --git a/packages/editor/src/utils/debounce.ts b/packages/editor/src/utils/debounce.ts index 23f5ac678..064ad2b49 100644 --- a/packages/editor/src/utils/debounce.ts +++ b/packages/editor/src/utils/debounce.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function debounce void>( func: F, waitFor: number diff --git a/packages/editor/src/utils/downloader.ts b/packages/editor/src/utils/downloader.ts index d529df74e..14473eb92 100644 --- a/packages/editor/src/utils/downloader.ts +++ b/packages/editor/src/utils/downloader.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export async function downloadImage(url: string) { const response = await fetch(url); if (!response.ok) throw new Error(`invalid status code ${response.status}`); diff --git a/packages/editor/src/utils/platform.ts b/packages/editor/src/utils/platform.ts index c52f50c0d..6befc2d9f 100644 --- a/packages/editor/src/utils/platform.ts +++ b/packages/editor/src/utils/platform.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function isiOS(): boolean { return ( [ diff --git a/packages/editor/src/utils/position.ts b/packages/editor/src/utils/position.ts index 154035bac..7533c7880 100644 --- a/packages/editor/src/utils/position.ts +++ b/packages/editor/src/utils/position.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + type PositionData = { x: number; y: number; diff --git a/packages/logger/README.md b/packages/logger/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index ddcebd649..d5aacac94 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { consoleReporter } from "./reporters/console"; import { ILogReporter, LoggerConfig, LogLevel } from "./types"; diff --git a/packages/logger/src/reporters/console.ts b/packages/logger/src/reporters/console.ts index 8344a9487..bb20a9b72 100644 --- a/packages/logger/src/reporters/console.ts +++ b/packages/logger/src/reporters/console.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ILogReporter, LogLevel, LogMessage } from "../types"; export const consoleReporter: ILogReporter = { diff --git a/packages/logger/src/reporters/index.ts b/packages/logger/src/reporters/index.ts index bf4f5ebda..d4f78e214 100644 --- a/packages/logger/src/reporters/index.ts +++ b/packages/logger/src/reporters/index.ts @@ -1 +1,19 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./console"; diff --git a/packages/logger/src/types.ts b/packages/logger/src/types.ts index 8583c0eed..4dd82bf7d 100644 --- a/packages/logger/src/types.ts +++ b/packages/logger/src/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export interface ILogReporter { write(message: LogMessage): void; } diff --git a/packages/streamable-fs/README.md b/packages/streamable-fs/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/streamable-fs/index.ts b/packages/streamable-fs/index.ts index aa70563be..1492bd0ee 100644 --- a/packages/streamable-fs/index.ts +++ b/packages/streamable-fs/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import localforage from "localforage"; import FileHandle from "./src/filehandle"; import { IStreamableFS } from "./src/interfaces"; diff --git a/packages/streamable-fs/src/filehandle.ts b/packages/streamable-fs/src/filehandle.ts index df8a47a6a..cb897ad4c 100644 --- a/packages/streamable-fs/src/filehandle.ts +++ b/packages/streamable-fs/src/filehandle.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import FileStreamSource from "./filestreamsource"; import { File } from "./types"; diff --git a/packages/streamable-fs/src/filestreamsource.ts b/packages/streamable-fs/src/filestreamsource.ts index 5853dd506..3f9ca3607 100644 --- a/packages/streamable-fs/src/filestreamsource.ts +++ b/packages/streamable-fs/src/filestreamsource.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { File } from "./types"; import { Chunk } from "@notesnook/crypto/dist/src/types"; diff --git a/packages/streamable-fs/src/interfaces.ts b/packages/streamable-fs/src/interfaces.ts index e5a43dc99..8c69011a3 100644 --- a/packages/streamable-fs/src/interfaces.ts +++ b/packages/streamable-fs/src/interfaces.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import FileHandle from "./filehandle"; export interface IStreamableFS { diff --git a/packages/streamable-fs/src/types.ts b/packages/streamable-fs/src/types.ts index 1f3ccf414..a2c543b5d 100644 --- a/packages/streamable-fs/src/types.ts +++ b/packages/streamable-fs/src/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export type File = { filename: string; size: number; diff --git a/packages/theme/README.md b/packages/theme/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/packages/theme/src/css.ts b/packages/theme/src/css.ts index 7bc4f5ce5..3d61b1c02 100644 --- a/packages/theme/src/css.ts +++ b/packages/theme/src/css.ts @@ -1,11 +1,29 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export function removeCss(id: string) { - var link = document.getElementById(id); + const link = document.getElementById(id); if (link) link.remove(); } export function injectCssSrc(id: string, src: string) { - var head = document.head; - var link = document.createElement("link"); + const head = document.head; + const link = document.createElement("link"); link.id = id; link.type = "text/css"; @@ -16,24 +34,22 @@ export function injectCssSrc(id: string, src: string) { } export function injectCss(rules: string) { - let variableCss = document.getElementById("variables"); - let head = document.getElementsByTagName("head")[0]; + const variableCss = document.getElementById("variables"); + const head = document.getElementsByTagName("head")[0]; if (variableCss) { head.removeChild(variableCss); } - let css = document.createElement("style"); + const css = document.createElement("style"); css.type = "text/css"; css.id = "variables"; - // Support for IE - if ("styleSheet" in css) (css as any).styleSheet.cssText = rules; // Support for the rest - else css.appendChild(document.createTextNode(rules)); + css.appendChild(document.createTextNode(rules)); head.insertBefore(css, getRootStylesheet()); } function getRootStylesheet() { - for (let sty of document.getElementsByTagName("style")) { + for (const sty of document.getElementsByTagName("style")) { if (sty.innerHTML.includes("#root")) { return sty; } @@ -42,7 +58,7 @@ function getRootStylesheet() { } export function changeSvgTheme(newAccent: string) { - var nodes = document.querySelectorAll('*[fill="#0560ff"]'); - for (var n = 0; n < nodes.length; ++n) + const nodes = document.querySelectorAll('*[fill="#0560ff"]'); + for (let n = 0; n < nodes.length; ++n) nodes[n].setAttribute("fill", newAccent); } diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts index 9aec7ed78..4b9df5c8e 100644 --- a/packages/theme/src/index.ts +++ b/packages/theme/src/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + export * from "./theme/accents"; export * from "./themeprovider"; export * from "./theme"; diff --git a/packages/theme/src/theme/accents.ts b/packages/theme/src/theme/accents.ts index 6a7c87b93..c699dedfa 100644 --- a/packages/theme/src/theme/accents.ts +++ b/packages/theme/src/theme/accents.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + const accents = { orange: "#FF5722", yellow: "#FFA000", diff --git a/packages/theme/src/theme/colorscheme/dark.ts b/packages/theme/src/theme/colorscheme/dark.ts index 68e999f5d..5ede05b44 100644 --- a/packages/theme/src/theme/colorscheme/dark.ts +++ b/packages/theme/src/theme/colorscheme/dark.ts @@ -1,6 +1,24 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import tinycolor from "tinycolor2"; import { SchemeColors } from "."; -import { getStaticColors, StaticColors } from "./static"; +import { getStaticColors } from "./static"; export function getDarkScheme(accent: string): SchemeColors { return { diff --git a/packages/theme/src/theme/colorscheme/index.ts b/packages/theme/src/theme/colorscheme/index.ts index 051f9a6d1..0b8556f31 100644 --- a/packages/theme/src/theme/colorscheme/index.ts +++ b/packages/theme/src/theme/colorscheme/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getDarkScheme } from "./dark"; import { getLightScheme } from "./light"; import { StaticColors } from "./static"; diff --git a/packages/theme/src/theme/colorscheme/light.ts b/packages/theme/src/theme/colorscheme/light.ts index 648fcaa83..3afb07f83 100644 --- a/packages/theme/src/theme/colorscheme/light.ts +++ b/packages/theme/src/theme/colorscheme/light.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import tinycolor from "tinycolor2"; import { SchemeColors } from "."; import { getStaticColors } from "./static"; diff --git a/packages/theme/src/theme/colorscheme/static.ts b/packages/theme/src/theme/colorscheme/static.ts index 4ac1b2c0f..a41cd0540 100644 --- a/packages/theme/src/theme/colorscheme/static.ts +++ b/packages/theme/src/theme/colorscheme/static.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import tinycolor from "tinycolor2"; export type StaticColors = { diff --git a/packages/theme/src/theme/font/fontsize.ts b/packages/theme/src/theme/font/fontsize.ts index 5022cddb3..7ecd3e0f8 100644 --- a/packages/theme/src/theme/font/fontsize.ts +++ b/packages/theme/src/theme/font/fontsize.ts @@ -1,4 +1,22 @@ -export function getFontSizes(scale?: number): FontSizes { +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export function getFontSizes(): FontSizes { return { heading: "1.5rem", subheading: "1.2rem", @@ -8,7 +26,7 @@ export function getFontSizes(scale?: number): FontSizes { body: "0.8rem", menu: "0.8rem", subBody: "0.750rem", - code: "0.9rem", + code: "0.9rem" }; } diff --git a/packages/theme/src/theme/font/index.ts b/packages/theme/src/theme/font/index.ts index ba77f1d93..efc93d630 100644 --- a/packages/theme/src/theme/font/index.ts +++ b/packages/theme/src/theme/font/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { FontSizes, getFontSizes } from "./fontsize"; const SANS_FONT_STACK = [ diff --git a/packages/theme/src/theme/index.ts b/packages/theme/src/theme/index.ts index a6583ccfc..bd67f754a 100644 --- a/packages/theme/src/theme/index.ts +++ b/packages/theme/src/theme/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { getColors, SchemeColors } from "./colorscheme"; import { variants } from "./variants"; import { FontConfig, getFontConfig } from "./font"; @@ -25,7 +43,7 @@ export type Theme = { typeof variants; class ThemeFactory { - transform(type: Transformers, theme: any) { + transform(type: Transformers, theme: Theme) { const factory = new TransformerFactory(); return factory.construct(type, theme); } diff --git a/packages/theme/src/theme/transformer/css.ts b/packages/theme/src/theme/transformer/css.ts index c41fe2e02..6ad62c323 100644 --- a/packages/theme/src/theme/transformer/css.ts +++ b/packages/theme/src/theme/transformer/css.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { Theme } from ".."; import { SchemeColors } from "../colorscheme"; diff --git a/packages/theme/src/theme/transformer/index.ts b/packages/theme/src/theme/transformer/index.ts index 149a5af6f..8b921ffde 100644 --- a/packages/theme/src/theme/transformer/index.ts +++ b/packages/theme/src/theme/transformer/index.ts @@ -1,12 +1,31 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import { Theme } from ".."; import css from "./css"; const transformers = { - css: css, + css: css }; export type Transformers = keyof typeof transformers; export class TransformerFactory { - construct(type: Transformers, theme: any) { + construct(type: Transformers, theme: Theme) { return transformers[type](theme); } } diff --git a/packages/theme/src/theme/types.ts b/packages/theme/src/theme/types.ts index 968b61a11..735de59a8 100644 --- a/packages/theme/src/theme/types.ts +++ b/packages/theme/src/theme/types.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { ColorSchemes } from "./colorscheme"; export type ThemeConfig = { diff --git a/packages/theme/src/theme/variants/button.ts b/packages/theme/src/theme/variants/button.ts index 95f5e4e31..28def3ce4 100644 --- a/packages/theme/src/theme/variants/button.ts +++ b/packages/theme/src/theme/variants/button.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SxStyleProp } from "@streetwriters/rebass"; const defaultVariant: SxStyleProp = { diff --git a/packages/theme/src/theme/variants/flex.ts b/packages/theme/src/theme/variants/flex.ts index 9f5139040..c9c16a722 100644 --- a/packages/theme/src/theme/variants/flex.ts +++ b/packages/theme/src/theme/variants/flex.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SxStyleProp } from "@streetwriters/rebass"; type FlexDirection = "row" | "column"; diff --git a/packages/theme/src/theme/variants/index.ts b/packages/theme/src/theme/variants/index.ts index 5088b046d..b2ada5ddc 100644 --- a/packages/theme/src/theme/variants/index.ts +++ b/packages/theme/src/theme/variants/index.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { buttonVariants } from "./button"; import { inputVariants } from "./input"; import { textVariants } from "./text"; diff --git a/packages/theme/src/theme/variants/input.ts b/packages/theme/src/theme/variants/input.ts index 38675d2d7..ae0ab4f2d 100644 --- a/packages/theme/src/theme/variants/input.ts +++ b/packages/theme/src/theme/variants/input.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SxStyleProp } from "@streetwriters/rebass"; const defaultVariant: SxStyleProp = { diff --git a/packages/theme/src/theme/variants/text.ts b/packages/theme/src/theme/variants/text.ts index 24228a16e..b87750598 100644 --- a/packages/theme/src/theme/variants/text.ts +++ b/packages/theme/src/theme/variants/text.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import { SxStyleProp } from "@streetwriters/rebass"; const defaultVariant: SxStyleProp = { diff --git a/packages/theme/src/themeprovider.ts b/packages/theme/src/themeprovider.ts index 89c83fdd6..bca53d930 100644 --- a/packages/theme/src/themeprovider.ts +++ b/packages/theme/src/themeprovider.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import ThemeFactory from "./theme"; import { ThemeConfig } from "./theme/types"; import { injectCss } from "./css"; diff --git a/resources/license-header.js b/resources/license-header.js new file mode 100644 index 000000000..053987d76 --- /dev/null +++ b/resources/license-header.js @@ -0,0 +1,17 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ From 14fe6d071a7ca728f2a470da0d82186d101e3c30 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 30 Aug 2022 16:27:48 +0500 Subject: [PATCH 2/3] mobile: move dependent packages to root package.json --- apps/mobile/app/package.json | 2 - .../mobile/app/stores/use-navigation-store.ts | 1 - apps/mobile/package.json | 3 +- apps/web/package-lock.json | 108 -------------- packages/editor/package-lock.json | 141 ------------------ 5 files changed, 2 insertions(+), 253 deletions(-) diff --git a/apps/mobile/app/package.json b/apps/mobile/app/package.json index d58e4da29..6eb64cd22 100644 --- a/apps/mobile/app/package.json +++ b/apps/mobile/app/package.json @@ -5,8 +5,6 @@ "dependencies": { "@flyerhq/react-native-link-preview": "^1.6.0", "@mdi/js": "^6.7.96", - "@notesnook/editor": "*", - "@notesnook/core": "*", "absolutify": "^0.1.0", "buffer": "^6.0.3", "dayjs": "^1.10.4", diff --git a/apps/mobile/app/stores/use-navigation-store.ts b/apps/mobile/app/stores/use-navigation-store.ts index 334793927..a2b4f89c7 100644 --- a/apps/mobile/app/stores/use-navigation-store.ts +++ b/apps/mobile/app/stores/use-navigation-store.ts @@ -25,7 +25,6 @@ import { TagType, TopicType } from "../utils/types"; -import { ColorKey } from "./use-theme-store"; export type GenericRouteParam = { [name: string]: unknown }; diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 24ca1429a..4e4df2126 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -21,6 +21,7 @@ "typescript": "^4.8.2" }, "dependencies": { - "@notesnook/editor": "*" + "@notesnook/editor": "*", + "@notesnook/core": "*" } } diff --git a/apps/web/package-lock.json b/apps/web/package-lock.json index 48c8d3513..d21f40664 100644 --- a/apps/web/package-lock.json +++ b/apps/web/package-lock.json @@ -65,8 +65,6 @@ "@types/react": "17.0.2", "@types/react-dom": "17.0.2", "@types/react-modal": "^3.13.1", - "@types/rebass": "^4.0.10", - "@types/rebass__forms": "^4.0.6", "buffer": "^6.0.3", "chalk": "^4.1.0", "dotenv": "^10.0.0", @@ -4189,15 +4187,6 @@ "@types/node": "*" } }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/hookrouter": { "version": "2.2.5", "dev": true, @@ -4353,27 +4342,6 @@ "@types/react": "*" } }, - "node_modules/@types/rebass": { - "version": "4.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "@types/styled-components": "*", - "@types/styled-system": "*", - "@types/styled-system__css": "*" - } - }, - "node_modules/@types/rebass__forms": { - "version": "4.0.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "@types/rebass": "*", - "@types/styled-system": "*" - } - }, "node_modules/@types/resolve": { "version": "1.17.1", "license": "MIT", @@ -4415,32 +4383,6 @@ "version": "2.0.1", "license": "MIT" }, - "node_modules/@types/styled-components": { - "version": "5.1.26", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hoist-non-react-statics": "*", - "@types/react": "*", - "csstype": "^3.0.2" - } - }, - "node_modules/@types/styled-system": { - "version": "5.1.15", - "dev": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.0.2" - } - }, - "node_modules/@types/styled-system__css": { - "version": "5.0.17", - "dev": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.0.2" - } - }, "node_modules/@types/trusted-types": { "version": "2.0.2", "license": "MIT" @@ -20512,14 +20454,6 @@ "@types/node": "*" } }, - "@types/hoist-non-react-statics": { - "version": "3.3.1", - "dev": true, - "requires": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "@types/hookrouter": { "version": "2.2.5", "dev": true, @@ -20650,25 +20584,6 @@ "@types/react": "*" } }, - "@types/rebass": { - "version": "4.0.10", - "dev": true, - "requires": { - "@types/react": "*", - "@types/styled-components": "*", - "@types/styled-system": "*", - "@types/styled-system__css": "*" - } - }, - "@types/rebass__forms": { - "version": "4.0.6", - "dev": true, - "requires": { - "@types/react": "*", - "@types/rebass": "*", - "@types/styled-system": "*" - } - }, "@types/resolve": { "version": "1.17.1", "requires": { @@ -20703,29 +20618,6 @@ "@types/stack-utils": { "version": "2.0.1" }, - "@types/styled-components": { - "version": "5.1.26", - "dev": true, - "requires": { - "@types/hoist-non-react-statics": "*", - "@types/react": "*", - "csstype": "^3.0.2" - } - }, - "@types/styled-system": { - "version": "5.1.15", - "dev": true, - "requires": { - "csstype": "^3.0.2" - } - }, - "@types/styled-system__css": { - "version": "5.0.17", - "dev": true, - "requires": { - "csstype": "^3.0.2" - } - }, "@types/trusted-types": { "version": "2.0.2" }, diff --git a/packages/editor/package-lock.json b/packages/editor/package-lock.json index cfb0e625a..f5821ca98 100644 --- a/packages/editor/package-lock.json +++ b/packages/editor/package-lock.json @@ -60,8 +60,6 @@ "@types/react-color": "^3.0.6", "@types/react-dom": "17.0.2", "@types/react-modal": "^3.13.1", - "@types/rebass": "^4.0.10", - "@types/rebass__forms": "^4.0.6", "@types/tinycolor2": "^1.4.3", "framer-motion": "^4.1.17", "isomorphic-fetch": "^3.0.0", @@ -2473,15 +2471,6 @@ "@types/unist": "*" } }, - "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "node_modules/@types/katex": { "version": "0.14.0", "dev": true, @@ -2544,68 +2533,6 @@ "@types/react": "*" } }, - "node_modules/@types/rebass": { - "version": "4.0.10", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "@types/styled-components": "*", - "@types/styled-system": "*", - "@types/styled-system__css": "*" - } - }, - "node_modules/@types/rebass__forms": { - "version": "4.0.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/react": "*", - "@types/rebass": "*", - "@types/styled-system": "*" - } - }, - "node_modules/@types/styled-components": { - "version": "5.1.25", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/hoist-non-react-statics": "*", - "@types/react": "*", - "csstype": "^3.0.2" - } - }, - "node_modules/@types/styled-components/node_modules/csstype": { - "version": "3.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/styled-system": { - "version": "5.1.15", - "dev": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.0.2" - } - }, - "node_modules/@types/styled-system__css": { - "version": "5.0.16", - "dev": true, - "license": "MIT", - "dependencies": { - "csstype": "^3.0.2" - } - }, - "node_modules/@types/styled-system__css/node_modules/csstype": { - "version": "3.1.0", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/styled-system/node_modules/csstype": { - "version": "3.1.0", - "dev": true, - "license": "MIT" - }, "node_modules/@types/tinycolor2": { "version": "1.4.3", "dev": true, @@ -5665,14 +5592,6 @@ "@types/unist": "*" } }, - "@types/hoist-non-react-statics": { - "version": "3.3.1", - "dev": true, - "requires": { - "@types/react": "*", - "hoist-non-react-statics": "^3.3.0" - } - }, "@types/katex": { "version": "0.14.0", "dev": true @@ -5728,66 +5647,6 @@ "@types/react": "*" } }, - "@types/rebass": { - "version": "4.0.10", - "dev": true, - "requires": { - "@types/react": "*", - "@types/styled-components": "*", - "@types/styled-system": "*", - "@types/styled-system__css": "*" - } - }, - "@types/rebass__forms": { - "version": "4.0.6", - "dev": true, - "requires": { - "@types/react": "*", - "@types/rebass": "*", - "@types/styled-system": "*" - } - }, - "@types/styled-components": { - "version": "5.1.25", - "dev": true, - "requires": { - "@types/hoist-non-react-statics": "*", - "@types/react": "*", - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.1.0", - "dev": true - } - } - }, - "@types/styled-system": { - "version": "5.1.15", - "dev": true, - "requires": { - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.1.0", - "dev": true - } - } - }, - "@types/styled-system__css": { - "version": "5.0.16", - "dev": true, - "requires": { - "csstype": "^3.0.2" - }, - "dependencies": { - "csstype": { - "version": "3.1.0", - "dev": true - } - } - }, "@types/tinycolor2": { "version": "1.4.3", "dev": true From 8d543d2d2f8b7b17e36becef02e136f601a29ef6 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Tue, 30 Aug 2022 16:28:02 +0500 Subject: [PATCH 3/3] docs: add missing license header --- apps/mobile/app/hooks/use-vault-status.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/mobile/app/hooks/use-vault-status.ts b/apps/mobile/app/hooks/use-vault-status.ts index 846aac553..39385563f 100644 --- a/apps/mobile/app/hooks/use-vault-status.ts +++ b/apps/mobile/app/hooks/use-vault-status.ts @@ -1,3 +1,21 @@ +/* This file is part of the Notesnook project (https://notesnook.com/) + * + * Copyright (C) 2022 Streetwriters (Private) Limited + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + import React, { useCallback, useEffect } from "react"; import BiometicService from "../services/biometrics"; import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager";