Compare commits

..

33 Commits

Author SHA1 Message Date
ammarahm-ed
911e90379f mobile: save report issue information if app gets
restarted or accidentally closed
2023-08-21 14:26:55 +05:00
ammarahm-ed
54b8a3e789 mobile: refactor to typescript 2023-08-16 10:14:39 +05:00
Abdullah Atta
7ff5f0001c core: tagging an empty note should not create a content item 2023-08-14 13:41:19 +05:00
Abdullah Atta
d384aa9dcf core: use isolated storage for each test for more reliability 2023-08-14 09:54:57 +05:00
Abdullah Atta
1190da7c91 crypto: use buffer from node:buffer 2023-08-14 09:54:57 +05:00
Abdullah Atta
6561791530 setup: remove dist, build & out dirs during cleanup 2023-08-14 09:54:57 +05:00
Abdullah Atta
26e233d3eb global: update lockfiles 2023-08-14 09:54:57 +05:00
Abdullah Atta
0417981538 global: remove maxNodeModuleJsDepth from tsconfig 2023-08-14 09:54:57 +05:00
Abdullah Atta
81fc56937e web: fix syntax errors 2023-08-14 09:54:57 +05:00
Abdullah Atta
cb778d7e35 core: make dateFormat optional 2023-08-14 09:54:57 +05:00
Abdullah Atta
8442b43715 core: don't include tests & unnecessary files during build 2023-08-14 09:54:57 +05:00
Abdullah Atta
28b3306506 core: import isomorphic-fetch 2023-08-14 09:54:57 +05:00
Abdullah Atta
f51f45aeb2 editor: move isomorphic-fetch import 2023-08-14 09:54:57 +05:00
Abdullah Atta
7f1184736c core: use isomorphic-fetch 2023-08-14 09:54:57 +05:00
Abdullah Atta
e4c8e7a0c5 core: download prismjs languages before tests 2023-08-14 09:54:57 +05:00
Abdullah Atta
44e4722de2 global: fix @notesnook/core direct paths 2023-08-14 09:54:57 +05:00
Abdullah Atta
7c2b0c5947 core: start migrating core to typescript & vitest 2023-08-14 09:54:57 +05:00
Abdullah Atta
6ea912ad0e themebuilder: bump version to 1.1.1 2023-08-11 09:54:09 +05:00
Abdullah Atta
124bbb6ac1 web: do not show website link if there's no homepage 2023-08-11 09:53:01 +05:00
Abdullah Atta
30d6345152 theme: make homepage property in themes optional 2023-08-11 09:53:01 +05:00
Abdullah Atta
60ff7b2f97 themebuilder: update themes manually in themebuilder 2023-08-11 09:51:43 +05:00
Abdullah Atta
c6e90142bb themebuilder: bump version to 1.1.0 2023-08-10 07:20:07 +05:00
Abdullah Atta
1289a025a5 web: skip initiation for theme builder 2023-08-10 07:18:49 +05:00
Abdullah Atta
18d0b72785 themebuilder: fix various bugs 2023-08-10 07:18:18 +05:00
Abdullah Atta
0157cf496f themebuilder: add support for loading from pr, url & base64 2023-08-10 07:17:37 +05:00
Abdullah Atta
3450f2d19d setup: support generating flatpak sources from windows 2023-08-09 16:56:29 +05:00
Abdullah Atta
e509c82807 web: bump version to 2.6.1 2023-08-09 16:31:52 +05:00
Abdullah Atta
d5afd6f32e editor: fix recursive loop on loading a code lang that never registered 2023-08-09 16:26:31 +05:00
Abdullah Atta
fb34dd2864 core: do not throw if language grammar is not found on export 2023-08-09 16:26:31 +05:00
Abdullah Atta
0cd1ce3431 core: don't use require in desktop app 2023-08-09 16:26:31 +05:00
Abdullah Atta
a24447d569 web: fix unstyled "0" in theme details dialog 2023-08-09 16:25:43 +05:00
Abdullah Atta
0bf26afa33 web: fix error on installing theme from file 2023-08-09 16:25:43 +05:00
Abdullah Atta
49455e8054 docs: add documentation for custom themes (#3118)
* themebuilder: add docs

* themebuilder: update theme docs

* docs: finalize docs for custom themes

---------

Co-authored-by: ammarahm-ed <ammarahmed6506@gmail.com>
2023-08-09 15:49:33 +05:00
304 changed files with 4211 additions and 25535 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@notesnook/desktop",
"version": "2.6.0",
"version": "2.6.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/desktop",
"version": "2.6.0",
"version": "2.6.1",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "@notesnook/desktop",
"productName": "Notesnook",
"description": "Your private note taking space",
"version": "2.6.0",
"version": "2.6.1",
"appAppleId": "1544027013",
"private": true,
"main": "./dist/index.js",

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { database } from "@notesnook/common";
import { initalize, logger as dbLogger } from "@notesnook/core/logger";
import { initalize, logger as dbLogger } from "@notesnook/core/dist/logger";
import { Platform } from "react-native";
import { MMKVLoader } from "react-native-mmkv-storage";
import filesystem from "../filesystem";

View File

@@ -22,7 +22,7 @@ import {
getFileNameWithExtension,
isImage,
isDocument
} from "@notesnook/core/utils/filename";
} from "@notesnook/core/dist/utils/filename";
import React from "react";
import { Platform } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import hosts from "@notesnook/core/utils/constants";
import hosts from "@notesnook/core/dist/utils/constants";
import NetInfo from "@react-native-community/netinfo";
import RNFetchBlob from "react-native-blob-util";
import { ToastEvent } from "../../services/event-manager";

View File

@@ -21,7 +21,7 @@ import RNFetchBlob from "react-native-blob-util";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { DatabaseLogger, db } from "../database";
import { cacheDir } from "./utils";
import { isImage, isDocument } from "@notesnook/core/utils/filename";
import { isImage, isDocument } from "@notesnook/core/dist/utils/filename";
import { Platform } from "react-native";
import { IOS_APPGROUPID } from "../../utils/constants";

View File

@@ -40,7 +40,7 @@ import {
isDocument,
isImage,
isVideo
} from "@notesnook/core/utils/filename";
} from "@notesnook/core/dist/utils/filename";
import { useSettingStore } from "../../stores/use-setting-store";
import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList";

View File

@@ -17,12 +17,12 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import React, { PropsWithChildren } from "react";
import { View } from "react-native";
import { useSelectionStore } from "../../stores/use-selection-store";
import { useThemeColors } from "@notesnook/theme";
export const ContainerHeader = ({ children }) => {
export const ContainerHeader = (props: PropsWithChildren) => {
const { colors } = useThemeColors();
const selectionMode = useSelectionStore((state) => state.selectionMode);
@@ -34,7 +34,7 @@ export const ContainerHeader = ({ children }) => {
overflow: "hidden"
}}
>
{children}
{props.children}
</View>
) : null;
};

View File

@@ -17,8 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useThemeColors } from "@notesnook/theme";
import React, { useCallback, useEffect } from "react";
import { Keyboard, Platform, View } from "react-native";
import { Keyboard, View } from "react-native";
import Animated, {
Easing,
useAnimatedStyle,
@@ -34,14 +35,20 @@ import { getElevationStyle } from "../../utils/elevation";
import { SIZE, normalize } from "../../utils/size";
import NativeTooltip from "../../utils/tooltip";
import { PressableButton } from "../ui/pressable";
import { useThemeColors } from "@notesnook/theme";
export const FloatingButton = ({
interface FloatingButton {
title?: string;
onPress: () => void;
color?: string;
alwaysVisible?: boolean;
}
const FloatingButton = ({
title,
onPress,
color,
shouldShow = false
}) => {
alwaysVisible = false
}: FloatingButton) => {
const { colors } = useThemeColors();
const deviceMode = useSettingStore((state) => state.deviceMode);
const selectionMode = useSelectionStore((state) => state.selectionMode);
@@ -60,12 +67,8 @@ export const FloatingButton = ({
};
});
useEffect(() => {
animate(selectionMode ? 150 : 0);
}, [animate, selectionMode]);
const animate = useCallback(
(toValue) => {
(toValue: number) => {
translate.value = withTiming(toValue, {
duration: 250,
easing: Easing.elastic(1)
@@ -74,39 +77,39 @@ export const FloatingButton = ({
[translate]
);
const onKeyboardHide = useCallback(async () => {
editorState().keyboardState = false;
if (deviceMode !== "mobile") return;
animate(0);
}, [animate, deviceMode]);
const onKeyboardShow = useCallback(async () => {
editorState().keyboardState = true;
if (deviceMode !== "mobile") return;
animate(150);
}, [animate, deviceMode]);
useEffect(() => {
animate(selectionMode ? 150 : 0);
}, [animate, selectionMode]);
useEffect(() => {
let sub1 = Keyboard.addListener("keyboardDidShow", onKeyboardShow);
let sub2 = Keyboard.addListener("keyboardDidHide", onKeyboardHide);
return () => {
sub1?.remove();
sub2?.remove();
const onKeyboardHide = () => {
editorState().keyboardState = false;
if (deviceMode !== "mobile") return;
animate(0);
};
}, [deviceMode, onKeyboardHide, onKeyboardShow]);
const paddings = {
ios: 20,
android: 20,
iPad: 20
};
return deviceMode !== "mobile" && !shouldShow ? null : (
const onKeyboardShow = () => {
editorState().keyboardState = true;
if (deviceMode !== "mobile") return;
animate(150);
};
const sub = [
Keyboard.addListener("keyboardDidShow", onKeyboardShow),
Keyboard.addListener("keyboardDidHide", onKeyboardHide)
];
return () => {
sub.forEach((sub) => sub?.remove?.());
};
}, [deviceMode, animate]);
return deviceMode !== "mobile" && !alwaysVisible ? null : (
<Animated.View
style={[
{
position: "absolute",
right: 12,
bottom: paddings[Platform.isPad ? "iPad" : Platform.OS],
bottom: 20,
zIndex: 10
},
animatedStyle
@@ -115,16 +118,15 @@ export const FloatingButton = ({
<PressableButton
testID={notesnook.buttons.add}
type="accent"
buttonType={{
color: colors.static[color],
text: colors.static.white
}}
accentColor={colors.static[color as keyof typeof colors.static]}
customStyle={{
...getElevationStyle(5),
borderRadius: 100
}}
onLongPress={(event) => {
NativeTooltip.show(event, title, NativeTooltip.POSITIONS.LEFT);
if (title) {
NativeTooltip.show(event, title, NativeTooltip.POSITIONS.LEFT);
}
}}
onPress={onPress}
>
@@ -146,3 +148,5 @@ export const FloatingButton = ({
</Animated.View>
);
};
export { FloatingButton };

View File

@@ -17,44 +17,40 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from "react";
import { KeyboardAvoidingView, Platform, View } from "react-native";
import React, { PropsWithChildren } from "react";
import { KeyboardAvoidingView, Platform } from "react-native";
import useGlobalSafeAreaInsets from "../../hooks/use-global-safe-area-insets";
import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard";
import { useSettingStore } from "../../stores/use-setting-store";
import { Header } from "../header";
import SelectionHeader from "../selection-header";
export const Container = ({ children }) => {
export const Container = ({ children }: PropsWithChildren) => {
const floating = useIsFloatingKeyboard();
const introCompleted = useSettingStore(
(state) => state.settings.introCompleted
);
const insets = useGlobalSafeAreaInsets();
return (
<KeyboardAvoidingView
behavior="padding"
enabled={Platform.OS === "ios" && !floating}
style={{
flex: 1
flex: 1,
overflow: "hidden",
paddingTop: Platform.OS === "android" ? 0 : insets.top,
paddingBottom: Platform.OS === "android" ? 0 : insets.bottom
}}
>
<View
style={{
flex: 1,
overflow: "hidden",
paddingTop: Platform.OS === "android" ? 0 : insets.top,
paddingBottom: Platform.OS === "android" ? 0 : insets.bottom
}}
>
{!introCompleted ? null : (
<>
<SelectionHeader />
<Header title="Header" screen="Header" />
</>
)}
{!introCompleted ? null : (
<>
<SelectionHeader />
<Header />
</>
)}
{children}
</View>
{children}
</KeyboardAvoidingView>
);
};

View File

@@ -43,7 +43,7 @@ const _Header = () => {
);
const onScroll = useCallback(
(data) => {
(data: { x: number; y: number }) => {
if (data.y > 150) {
if (!hide) return;
setHide(false);

View File

@@ -43,12 +43,6 @@ export const LeftMenus = () => {
return;
}
Navigation.goBack();
if (
useNavigationStore.getState().currentScreen.name === "Signup" ||
useNavigationStore.getState().currentScreen.name === "Login"
) {
tabBarRef.current.unlock();
}
};
return isTablet && !canGoBack ? null : (

View File

@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useRef } from "react";
import { Platform, StyleSheet, View } from "react-native";
//@ts-ignore
import Menu from "react-native-reanimated-material-menu";
import { notesnook } from "../../../e2e/test.ids";
import Navigation from "../../services/navigation";
@@ -35,10 +36,13 @@ export const RightMenus = () => {
const { colors } = useThemeColors();
const { colors: contextMenuColors } = useThemeColors("contextMenu");
const deviceMode = useSettingStore((state) => state.deviceMode);
const rightButtons = useNavigationStore((state) => state.headerRightButtons);
const buttons = useNavigationStore((state) => state.headerRightButtons);
const currentScreen = useNavigationStore((state) => state.currentScreen.name);
const buttonAction = useNavigationStore((state) => state.buttonAction);
const menuRef = useRef();
const menuRef = useRef<{
show: () => void;
hide: () => void;
}>();
return (
<View style={styles.rightBtnContainer}>
@@ -46,9 +50,12 @@ export const RightMenus = () => {
<IconButton
onPress={async () => {
SearchService.prepareSearch();
Navigation.navigate({
name: "Search"
});
Navigation.navigate(
{
name: "Search"
},
{}
);
}}
testID="icon-search"
name="magnify"
@@ -82,7 +89,7 @@ export const RightMenus = () => {
/>
) : null}
{rightButtons && rightButtons.length > 0 ? (
{buttons && buttons.length > 0 ? (
<Menu
ref={menuRef}
animationDuration={200}
@@ -104,7 +111,7 @@ export const RightMenus = () => {
/>
}
>
{rightButtons.map((item) => (
{buttons.map((item) => (
<Button
style={{
width: 150,

View File

@@ -17,8 +17,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React, { useEffect, useState } from "react";
import { Platform, View } from "react-native";
import { useThemeColors } from "@notesnook/theme";
import React, { useCallback, useEffect, useState } from "react";
import { Platform } from "react-native";
import { db } from "../../common/database";
import Notebook from "../../screens/notebook";
import {
@@ -26,14 +27,12 @@ import {
eUnSubscribeEvent
} from "../../services/event-manager";
import useNavigationStore from "../../stores/use-navigation-store";
import { useThemeColors } from "@notesnook/theme";
import { eScrollEvent } from "../../utils/events";
import { SIZE } from "../../utils/size";
import Heading from "../ui/typography/heading";
import { useCallback } from "react";
import Tag from "../ui/tag";
import Heading from "../ui/typography/heading";
const titleState = {};
const titleState: { [name: string]: boolean } = {};
export const Title = () => {
const { colors } = useThemeColors();
@@ -42,12 +41,12 @@ export const Title = () => {
const isTopic = currentScreen?.name === "TopicNotes";
const [hide, setHide] = useState(
isNotebook
? typeof titleState[currentScreen.id] === "boolean"
? titleState[currentScreen.id]
? typeof titleState[currentScreen.id as string] === "boolean"
? titleState[currentScreen.id as string]
: true
: false
);
const isHidden = titleState[currentScreen.id];
const isHidden = titleState[currentScreen.id as string];
const notebook =
isTopic && currentScreen.notebookId
? db.notebooks?.notebook(currentScreen.notebookId)?.data
@@ -56,18 +55,18 @@ export const Title = () => {
const isTag = currentScreen?.name === "TaggedNotes";
const onScroll = useCallback(
(data) => {
(data: { x: number; y: number }) => {
if (currentScreen.name !== "Notebook") {
setHide(false);
return;
}
if (data.y > 150) {
if (!hide) return;
titleState[currentScreen.id] = false;
titleState[currentScreen.id as string] = false;
setHide(false);
} else {
if (hide) return;
titleState[currentScreen.id] = true;
titleState[currentScreen.id as string] = true;
setHide(true);
}
},
@@ -76,13 +75,13 @@ export const Title = () => {
useEffect(() => {
if (currentScreen.name === "Notebook") {
let value =
typeof titleState[currentScreen.id] === "boolean"
? titleState[currentScreen.id]
const value =
typeof titleState[currentScreen.id as string] === "boolean"
? titleState[currentScreen.id as string]
: true;
setHide(value);
} else {
setHide(titleState[currentScreen.id]);
setHide(titleState[currentScreen.id as string]);
}
}, [currentScreen.id, currentScreen.name]);
@@ -98,14 +97,7 @@ export const Title = () => {
Notebook.navigate(notebook, true);
}
return (
<View
style={{
opacity: 1,
flexShrink: 1,
flexDirection: "row",
alignItems: "center"
}}
>
<>
{!hide && !isHidden ? (
<Heading
onPress={navigateToNotebook}
@@ -122,10 +114,9 @@ export const Title = () => {
#
</Heading>
) : null}
{title}
{title} <Tag visible={currentScreen.beta} text="BETA" />
</Heading>
) : null}
<Tag visible={currentScreen.beta} text="BETA" />
</View>
</>
);
};

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Sodium from "@ammarahmed/react-native-sodium";
import dataurl from "@notesnook/core/utils/dataurl";
import dataurl from "@notesnook/core/dist/utils/dataurl";
import { useThemeColors } from "@notesnook/theme";
import React, { useEffect, useState } from "react";
import { Platform, View } from "react-native";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { getUpcomingReminder } from "@notesnook/core/collections/reminders";
import { getUpcomingReminder } from "@notesnook/core/dist/collections/reminders";
import { decode, EntityLevel } from "entities";
import React from "react";
import { View } from "react-native";

View File

@@ -35,10 +35,14 @@ import { presentDialog } from "../../dialog/functions";
import { Button } from "../../ui/button";
import Seperator from "../../ui/seperator";
import Paragraph from "../../ui/typography/paragraph";
import { useStoredRef } from "../../../hooks/use-stored-ref";
export const Issue = ({ defaultTitle, defaultBody, issueTitle }) => {
const { colors } = useThemeColors();
const body = useRef(defaultBody);
const title = useRef(defaultTitle);
const body = useStoredRef("issueBody", defaultBody);
const title = useStoredRef("issueTitle", defaultTitle);
const user = useUserStore((state) => state.user);
const [loading, setLoading] = useState(false);
const bodyRef = useRef();
@@ -70,6 +74,8 @@ Logged in: ${user ? "yes" : "no"}`,
});
setLoading(false);
eSendEvent(eCloseSheet);
body.reset();
title.reset();
await sleep(300);
presentDialog({
title: "Issue reported",

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import React, { useCallback, useEffect, useState } from "react";
import { Platform, View } from "react-native";
import { db } from "../../../common/database";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import React, { useCallback, useEffect, useRef, useState } from "react";
import { ActivityIndicator, Platform, View } from "react-native";
import { FlatList } from "react-native-actions-sheet";
@@ -377,7 +377,10 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
height: 100
}}
>
<ActivityIndicator color={colors.primary.accent} size={SIZE.lg} />
<ActivityIndicator
color={colors.primary.accent}
size={SIZE.lg}
/>
</View>
) : (
<View
@@ -434,7 +437,9 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
</Paragraph>
</>
) : (
<Paragraph color={colors.secondary.paragraph}>No backups found</Paragraph>
<Paragraph color={colors.secondary.paragraph}>
No backups found
</Paragraph>
)}
</View>
)

View File

@@ -54,7 +54,7 @@ import {
import { normalize, SIZE } from "../../../utils/size";
import { GroupHeader, NotebookType, TopicType } from "../../../utils/types";
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import Config from "react-native-config";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
import { notesnook } from "../../../../e2e/test.ids";

View File

@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { isReminderActive } from "@notesnook/core/collections/reminders";
import { isReminderActive } from "@notesnook/core/dist/collections/reminders";
import React from "react";
import { ViewStyle } from "react-native";

View File

@@ -49,7 +49,6 @@ const SheetWrapper = ({
const largeTablet = deviceMode === "tablet";
const smallTablet = deviceMode === "smallTablet";
const dimensions = useSettingStore((state) => state.dimensions);
const pitchBlack = useSettingStore((state) => state.settings.pitchBlack);
const insets = useGlobalSafeAreaInsets();
let width = dimensions.width > 600 ? 600 : 500;
@@ -121,19 +120,17 @@ const SheetWrapper = ({
}
onClose={_onClose}
>
<BouncingView>
{children}
{bottomPadding ? (
<View
style={{
height:
Platform.OS === "ios" && insets.bottom !== 0
? insets.bottom + 5
: 20
}}
/>
) : null}
</BouncingView>
{children}
{bottomPadding ? (
<View
style={{
height:
Platform.OS === "ios" && insets.bottom !== 0
? insets.bottom + 5
: 20
}}
/>
) : null}
</ActionSheet>
</ScopedThemeProvider>
);

View File

@@ -37,7 +37,7 @@ export default function Tag({
}) {
const { colors } = useThemeColors();
return !visible ? null : (
<View
<Paragraph
style={{
backgroundColor: background || colors.primary.accent,
borderRadius: 100,
@@ -46,13 +46,14 @@ export default function Tag({
marginLeft: 2,
marginTop: -10,
height: 20,
justifyContent: "center",
textAlignVertical: "center",
textAlign: "center",
...style
}}
color={textColor || colors.static.white}
size={SIZE.xxs}
>
<Paragraph color={textColor || colors.static.white} size={SIZE.xxs}>
{text}
</Paragraph>
</View>
{text}
</Paragraph>
);
}

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EV, EVENTS, SYNC_CHECK_IDS } from "@notesnook/core/common";
import { EV, EVENTS, SYNC_CHECK_IDS } from "@notesnook/core/dist/common";
import notifee from "@notifee/react-native";
import NetInfo from "@react-native-community/netinfo";
import React, { useCallback, useEffect, useRef } from "react";

View File

@@ -0,0 +1,52 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useRef } from "react";
import { MMKV } from "../common/database/mmkv";
export function useStoredRef<T>(
key: string,
initialValue: T
): {
current: T;
reset(): void;
} {
const refKey = `storedRef:${key}`;
const value = useRef(
MMKV.getMap<{ current: T }>(refKey)?.current || initialValue
);
const frameRef = useRef(0);
return {
get current() {
return value.current;
},
set current(next: T) {
value.current = next;
cancelAnimationFrame(frameRef.current);
frameRef.current = requestAnimationFrame(() => {
MMKV.setMap(refKey, {
current: value.current
});
});
},
reset() {
MMKV.removeItem(refKey);
}
};
}

View File

@@ -0,0 +1,49 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useRef, useState } from "react";
import { MMKV } from "../common/database/mmkv";
export function useStoredValue<T>(
key: string,
initialValue: T
): { value: T; reset(): void } {
const refKey = `storedState:${key}`;
const [value, setValue] = useState<T>(
MMKV.getMap<{ value: T }>(refKey)?.value || initialValue
);
const frameRef = useRef(0);
return {
get value() {
return value;
},
set value(next: T) {
setValue(next);
cancelAnimationFrame(frameRef.current);
frameRef.current = requestAnimationFrame(() => {
MMKV.setMap(refKey, {
value: value
});
});
},
reset() {
MMKV.removeItem(refKey);
}
};
}

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import { useCallback, useEffect, useState } from "react";
import { db } from "../common/database";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* eslint-disable @typescript-eslint/no-var-requires */
import { EV, EVENTS } from "@notesnook/core/common";
import { EV, EVENTS } from "@notesnook/core/dist/common";
import React, {
forwardRef,
useCallback,

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Sodium from "@ammarahmed/react-native-sodium";
import { isImage } from "@notesnook/core/utils/filename";
import { isImage } from "@notesnook/core/dist/utils/filename";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import DocumentPicker from "react-native-document-picker";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import { useThemeEngineStore } from "@notesnook/theme";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import WebView from "react-native-webview";

View File

@@ -29,6 +29,7 @@ import SettingsService from "../../services/settings";
import useNavigationStore from "../../stores/use-navigation-store";
import { useNoteStore } from "../../stores/use-notes-store";
import { openEditor } from "../notes/common";
const prepareSearch = () => {
SearchService.update({
placeholder: "Type a keyword to search in notes",

View File

@@ -16,7 +16,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import React, { useEffect, useRef, useState } from "react";
import { db } from "../../common/database";
import DelayLayout from "../../components/delay-layout";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
import { db } from "../../common/database";

View File

@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import Clipboard from "@react-native-clipboard/clipboard";
import { LogMessage } from "@notesnook/logger";
import { format, LogLevel, logManager } from "@notesnook/core/logger";
import { format, LogLevel, logManager } from "@notesnook/core/dist/logger";
import React, { useEffect, useRef, useState } from "react";
import { FlatList, Platform, TouchableOpacity, View } from "react-native";
import * as ScopedStorage from "react-native-scoped-storage";

View File

@@ -42,8 +42,7 @@ export async function verifyUser(
negativeText: closeText || "Cancel",
positivePress: async (value) => {
try {
const user = await db.user.getUser();
let verified = !user ? true : await db.user.verifyPassword(value);
let verified = await db.user.verifyPassword(value);
if (verified) {
sleep(300).then(async () => {
await onsuccess();
@@ -59,7 +58,7 @@ export async function verifyUser(
}
} catch (e) {
ToastEvent.show({
heading: "Failed to verify",
heading: "Failed to backup data",
message: e.message,
type: "error",
context: "global"

View File

@@ -27,8 +27,6 @@ import PremiumService from "../../../services/premium";
import { useThemeColors } from "@notesnook/theme";
import { SIZE } from "../../../utils/size";
import { sleep } from "../../../utils/time";
import { verifyUser } from "../functions";
import { Dialog } from "../../../components/dialog";
interface PickerOptions<T> {
getValue: () => T;
@@ -39,7 +37,6 @@ interface PickerOptions<T> {
options: T[];
premium?: boolean;
onCheckOptionIsPremium?: (item: T) => boolean;
requiresVerification?: () => boolean;
}
export function SettingsPicker<T>({
@@ -50,8 +47,7 @@ export function SettingsPicker<T>({
options,
getItemKey,
premium,
onCheckOptionIsPremium = () => true,
requiresVerification = () => false
onCheckOptionIsPremium = () => true
}: PickerOptions<T>) {
const { colors } = useThemeColors("contextMenu");
const menuRef = useRef<any>();
@@ -122,18 +118,11 @@ export function SettingsPicker<T>({
</PressableButton>
}
>
<Dialog context="local" />
{options.map((item) => (
<MenuItem
key={getItemKey(item)}
onPress={async () => {
if (requiresVerification?.()) {
verifyUser("local", () => {
onChange(item);
});
} else {
onChange(item);
}
onChange(item);
}}
style={{
backgroundColor: compareValue(currentValue, item)

View File

@@ -24,9 +24,8 @@ import { useSettingStore } from "../../../stores/use-setting-store";
import { MenuItemsList } from "../../../utils/menu-items";
import { createSettingsPicker } from ".";
import { getFontById, getFonts } from "@notesnook/editor/dist/utils/font";
import { DATE_FORMATS, TIME_FORMATS } from "@notesnook/core/common";
import { DATE_FORMATS, TIME_FORMATS } from "@notesnook/core/dist/common";
import dayjs from "dayjs";
import { useUserStore } from "../../../stores/use-user-store";
export const FontPicker = createSettingsPicker({
getValue: () => useSettingStore.getState().settings.defaultFontFamily,
@@ -128,12 +127,6 @@ export const BackupReminderPicker = createSettingsPicker({
options: ["useroff", "daily", "weekly", "monthly"],
compareValue: (current, item) => current === item,
premium: true,
requiresVerification: () => {
return (
!useSettingStore.getState().settings.encryptedBackup &&
useUserStore.getState().user
);
},
onCheckOptionIsPremium: (item) => {
return item !== "useroff";
}

View File

@@ -783,11 +783,10 @@ export const settingsGroups: SettingSection[] = [
description: "Create a backup of your data",
modifer: async () => {
const user = useUserStore.getState().user;
if (!user || SettingsService.getProperty("encryptedBackup")) {
if (!user) {
await BackupService.run(true);
return;
}
verifyUser(null, () => BackupService.run(true));
}
},
@@ -871,17 +870,9 @@ export const settingsGroups: SettingSection[] = [
});
return;
}
if (settings.encryptedBackup) {
await verifyUser(null, () => {
SettingsService.set({
encryptedBackup: false
});
});
} else {
SettingsService.set({
encryptedBackup: true
});
}
SettingsService.set({
encryptedBackup: !settings.encryptedBackup
});
}
}
]
@@ -911,9 +902,7 @@ export const settingsGroups: SettingSection[] = [
description:
"Export all notes as pdf, markdown, html or text in a single zip file",
modifer: () => {
verifyUser(null, () => {
ExportNotesSheet.present(undefined, true);
});
ExportNotesSheet.present(undefined, true);
}
}
]

View File

@@ -114,7 +114,7 @@ export const Trash = ({ navigation, route }: NavigationProps<"Trash">) => {
<FloatingButton
title="Clear all trash"
onPress={onPressFloatingButton}
shouldShow={true}
alwaysVisible={true}
/>
) : null}
</DelayLayout>

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import EventManager from "@notesnook/core/utils/event-manager";
import EventManager from "@notesnook/core/dist/utils/event-manager";
import Clipboard from "@react-native-clipboard/clipboard";
import { RefObject } from "react";
import { ActionSheetRef } from "react-native-actions-sheet";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { CHECK_IDS } from "@notesnook/core/common";
import { CHECK_IDS } from "@notesnook/core/dist/common";
import React from "react";
import { Platform } from "react-native";
import Config from "react-native-config";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import NetInfo from "@react-native-community/netinfo";
import { db } from "../common/database";
import { DatabaseLogger } from "../common/database/index";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NotebookType } from "../utils/types";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupReminders } from "@notesnook/core/utils/grouping";
import { groupReminders } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { Reminder } from "../services/notifications";

View File

@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import "@notesnook/core/types";
import { groupArray } from "@notesnook/core/utils/grouping";
import "@notesnook/core/dist/types";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TagType } from "../utils/types";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TrashType } from "../utils/types";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Sodium from "@ammarahmed/react-native-sodium";
import { isImage } from "@notesnook/core/utils/filename";
import { isImage } from "@notesnook/core/dist/utils/filename";
import { Platform } from "react-native";
import RNFetchBlob from "react-native-blob-util";
import { db } from "../common/database";

View File

@@ -6,6 +6,7 @@ const configs = {
plugins: [
'@babel/plugin-transform-named-capturing-groups-regex',
'react-native-reanimated/plugin',
"@babel/plugin-transform-export-namespace-from"
]
},
test: {
@@ -22,6 +23,7 @@ const configs = {
'transform-remove-console',
'@babel/plugin-transform-named-capturing-groups-regex',
'react-native-reanimated/plugin',
"@babel/plugin-transform-export-namespace-from"
]
}
}

View File

@@ -1,12 +1,12 @@
{
"name": "@notesnook/mobile",
"version": "2.6.0",
"version": "2.6.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@notesnook/mobile",
"version": "2.6.0",
"version": "2.6.1",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"workspaces": [
@@ -75,30 +75,22 @@
"spark-md5": "^3.0.2"
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/plugin-transform-runtime": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/runtime": "^7.18.9",
"@notesnook/crypto": "file:../crypto",
"@types/html-to-text": "^9.0.0",
"@types/jest": "^28.1.6",
"@types/katex": "^0.16.1",
"@types/prismjs": "^1.26.0",
"@types/showdown": "^2.0.0",
"abortcontroller-polyfill": "^1.7.3",
"analyze-es6-modules": "^0.6.2",
"babel-jest": "^28.1.3",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"cross-env": "^7.0.3",
"dotenv": "^16.0.1",
"env-cmd": "^10.1.0",
"eventsource": "^2.0.2",
"jest": "^28.1.3",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^20.0.0",
"happy-dom": "^10.9.0",
"isomorphic-fetch": "^3.0.0",
"mockdate": "^3.0.5",
"otplib": "^12.0.1"
"otplib": "^12.0.1",
"refractor": "^4.8.1",
"vitest": "^0.34.1",
"vitest-fetch-mock": "^0.2.2"
}
},
"../../packages/editor": {
@@ -26509,37 +26501,26 @@
"@notesnook/core": {
"version": "file:../../packages/core",
"requires": {
"@babel/core": "^7.18.9",
"@babel/plugin-transform-runtime": "^7.18.9",
"@babel/preset-env": "^7.18.9",
"@babel/runtime": "^7.18.9",
"@microsoft/signalr": "^6.0.7",
"@microsoft/signalr-protocol-msgpack": "^6.0.7",
"@notesnook/crypto": "file:../crypto",
"@notesnook/logger": "file:../logger",
"@streetwriters/showdown": "^3.0.1-alpha.2",
"@types/html-to-text": "^9.0.0",
"@types/jest": "^28.1.6",
"@types/katex": "^0.16.1",
"@types/prismjs": "^1.26.0",
"@types/showdown": "^2.0.0",
"abortcontroller-polyfill": "^1.7.3",
"analyze-es6-modules": "^0.6.2",
"async-mutex": "^0.3.2",
"babel-jest": "^28.1.3",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"cross-env": "^7.0.3",
"dayjs": "1.11.9",
"dotenv": "^16.0.1",
"entities": "^4.3.1",
"env-cmd": "^10.1.0",
"eventsource": "^2.0.2",
"happy-dom": "^10.9.0",
"html-to-text": "^9.0.5",
"htmlparser2": "^8.0.1",
"jest": "^28.1.3",
"jest-fetch-mock": "^3.0.3",
"jsdom": "^20.0.0",
"isomorphic-fetch": "^3.0.0",
"katex": "0.16.2",
"linkedom": "^0.14.17",
"liqe": "^1.13.0",
@@ -26548,7 +26529,10 @@
"otplib": "^12.0.1",
"prismjs": "^1.29.0",
"qclone": "^1.2.0",
"spark-md5": "^3.0.2"
"refractor": "^4.8.1",
"spark-md5": "^3.0.2",
"vitest": "^0.34.1",
"vitest-fetch-mock": "^0.2.2"
}
},
"@notesnook/editor": {

View File

@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import ShareExtension from "@ammarahmed/react-native-share-extension";
import { getPreviewData } from "@flyerhq/react-native-link-preview";
import { formatBytes } from "@notesnook/common";
import { isImage } from "@notesnook/core/utils/filename";
import { parseHTML } from "@notesnook/core/utils/html-parser";
import { isImage } from "@notesnook/core/dist/utils/filename";
import { parseHTML } from "@notesnook/core/dist/utils/html-parser";
import React, { useCallback, useEffect, useRef, useState } from "react";
import {
ActivityIndicator,

View File

@@ -6,7 +6,6 @@
"baseUrl": "./",
"jsx": "react-native",
"noEmit": true,
"maxNodeModuleJsDepth": 5,
"types": ["node", "jest", "detox"],
"paths": {
"@notesnook/*": ["../../packages"],

View File

@@ -1,12 +1,12 @@
{
"name": "@notesnook/theme-builder",
"version": "1.0.0",
"version": "1.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@notesnook/theme-builder",
"version": "1.0.0",
"version": "1.1.1",
"license": "GPL-3.0-or-later",
"dependencies": {
"@emotion/react": "11.11.1",
@@ -17,6 +17,7 @@
"@notesnook/web": "file:../web",
"@theme-ui/components": "^0.14.7",
"@theme-ui/core": "^0.14.7",
"clipboard-polyfill": "^4.0.0",
"file-saver": "^2.0.5",
"katex": "^0.16.2",
"react": "17.0.2",
@@ -1386,7 +1387,7 @@
},
"../web": {
"name": "@notesnook/web",
"version": "2.6.0",
"version": "2.6.1",
"license": "GPL-3.0-or-later",
"dependencies": {
"@aws-sdk/util-base64-browser": "^3.208.0",
@@ -2023,32 +2024,6 @@
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/source-map": {
"version": "0.3.3",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.0",
"@jridgewell/trace-mapping": "^0.3.9"
}
},
"node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": {
"version": "0.3.3",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"@jridgewell/set-array": "^1.0.1",
"@jridgewell/sourcemap-codec": "^1.4.10",
"@jridgewell/trace-mapping": "^0.3.9"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jridgewell/sourcemap-codec": {
"version": "1.4.14",
"dev": true,
@@ -2777,13 +2752,6 @@
"ieee754": "^1.2.1"
}
},
"node_modules/buffer-from": {
"version": "1.1.2",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true
},
"node_modules/cac": {
"version": "6.7.14",
"dev": true,
@@ -2869,6 +2837,11 @@
"node": "*"
}
},
"node_modules/clipboard-polyfill": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/clipboard-polyfill/-/clipboard-polyfill-4.0.0.tgz",
"integrity": "sha512-U4KPNJqAYuyOtixCZZUyWTcj+wlI66j07g5ggMRE2DR1VFu/3ZWXkjLAslmme8i065gBSCUblHET7DKQ2Xg3RA=="
},
"node_modules/cliui": {
"version": "8.0.1",
"dev": true,
@@ -4272,27 +4245,6 @@
"node": ">=0.10.0"
}
},
"node_modules/source-map-support": {
"version": "0.5.21",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true,
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"node_modules/source-map-support/node_modules/source-map": {
"version": "0.6.1",
"dev": true,
"license": "BSD-3-Clause",
"optional": true,
"peer": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/stackback": {
"version": "0.0.2",
"dev": true,
@@ -4393,32 +4345,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/terser": {
"version": "5.17.7",
"dev": true,
"license": "BSD-2-Clause",
"optional": true,
"peer": true,
"dependencies": {
"@jridgewell/source-map": "^0.3.3",
"acorn": "^8.8.2",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
},
"bin": {
"terser": "bin/terser"
},
"engines": {
"node": ">=10"
}
},
"node_modules/terser/node_modules/commander": {
"version": "2.20.3",
"dev": true,
"license": "MIT",
"optional": true,
"peer": true
},
"node_modules/time-zone": {
"version": "1.0.0",
"dev": true,

View File

@@ -1,7 +1,7 @@
{
"name": "@notesnook/theme-builder",
"description": "Your private note taking space",
"version": "1.0.0",
"version": "1.1.1",
"private": true,
"main": "./src/app.js",
"homepage": "https://notesnook.com/",
@@ -9,13 +9,14 @@
"license": "GPL-3.0-or-later",
"dependencies": {
"@emotion/react": "11.11.1",
"@mdi/js": "^7.2.96",
"@mdi/react": "^1.6.1",
"@notesnook/common": "file:../../packages/common",
"@notesnook/theme": "file:../../packages/theme",
"@notesnook/web": "file:../web",
"@mdi/js": "^7.2.96",
"@mdi/react": "^1.6.1",
"@theme-ui/components": "^0.14.7",
"@theme-ui/core": "^0.14.7",
"clipboard-polyfill": "^4.0.0",
"file-saver": "^2.0.5",
"katex": "^0.16.2",
"react": "17.0.2",

View File

@@ -0,0 +1,81 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useQueryParams } from "@notesnook/web/src/navigation";
import ThemeBuilder from "./components/theme-builder";
import { useEffect, useState } from "react";
import { Loader } from "@notesnook/web/src/components/loader";
import { Flex } from "@theme-ui/components";
import { useStore } from "@notesnook/web/src/stores/theme-store";
import {
loadThemeFromBase64,
loadThemeFromPullRequest,
loadThemeFromURL
} from "./utils/theme-loader";
export function App() {
const [isLoading, setIsLoading] = useState(false);
const [{ from_pr, from_url, from_base64 }] = useQueryParams();
useEffect(() => {
(async () => {
try {
setIsLoading(true);
await useStore.getState().init();
const theme = from_pr
? await loadThemeFromPullRequest(from_pr)
: from_url
? await loadThemeFromURL(from_url)
: from_base64
? loadThemeFromBase64(from_base64)
: null;
if (!theme) return;
useStore.getState().setTheme(theme);
} catch (e) {
console.error(e);
} finally {
setIsLoading(false);
}
})();
}, [from_pr, from_url, from_base64]);
return (
<Flex
sx={{
width: 260,
flexShrink: 0,
bg: "background",
display: "flex",
overflow: "hidden",
flexDirection: "column",
overflowY: "scroll",
pt: 2,
rowGap: 2,
borderLeft: "1px solid var(--border)",
zIndex: 1001
}}
>
{isLoading ? (
<Loader title="Downloading theme" text="Please wait..." />
) : (
<ThemeBuilder />
)}
</Flex>
);
}

View File

@@ -35,6 +35,10 @@ import { showFilePicker, readFile } from "@notesnook/web/src/utils/file-picker";
import Field from "@notesnook/web/src/components/field";
import { Close } from "@notesnook/web/src/components/icons";
import { flatten, unflatten } from "../../utils/object";
import { version } from "../../../package.json";
import { writeText } from "clipboard-polyfill";
import { tryParse } from "@notesnook/web/src/utils/parse";
import { loadThemeFromJSON } from "../../utils/theme-loader";
const JSON_SCHEMA_URL =
"https://raw.githubusercontent.com/streetwriters/notesnook-themes/main/schemas/v1.schema.json";
@@ -121,21 +125,7 @@ export default function ThemeBuilder() {
}, [authors, setTheme]);
return loading ? null : (
<Flex
sx={{
width: 260,
flexShrink: 0,
bg: "background",
display: "flex",
overflow: "hidden",
flexDirection: "column",
overflowY: "scroll",
pt: 2,
rowGap: 2,
borderLeft: "1px solid var(--border)",
zIndex: 999
}}
>
<>
<Flex
sx={{
justifyContent: "space-between",
@@ -143,7 +133,7 @@ export default function ThemeBuilder() {
paddingX: "10px"
}}
>
<Text variant="title">Theme Builder 1.0</Text>
<Text variant="title">Theme Builder {version}</Text>
</Flex>
<Flex
@@ -170,6 +160,23 @@ export default function ThemeBuilder() {
Export theme
</Text>
</Button>
<Button
sx={{ py: "7px" }}
variant="secondary"
onClick={() =>
writeText(themeToJSON(currentTheme)).then(() =>
showToast("success", "Copied!")
)
}
>
<Text
sx={{
fontSize: "12px"
}}
>
Copy to clipboard
</Text>
</Button>
<Button
sx={{ py: "7px" }}
variant="secondary"
@@ -198,6 +205,34 @@ export default function ThemeBuilder() {
</Text>
</Button>
<Button
sx={{ py: "7px" }}
variant="secondary"
onClick={async () => {
try {
setLoading(true);
const text = window.prompt("Paste your JSON here");
if (!text) return null;
const theme = loadThemeFromJSON(tryParse(text));
if (!theme) {
showToast("error", "Please copy a valid JSON theme.");
return;
}
setTheme(theme);
} finally {
setLoading(false);
}
}}
>
<Text
sx={{
fontSize: "12px"
}}
>
Load from JSON
</Text>
</Button>
<Field
label="Search & Replace"
name="Search"
@@ -254,7 +289,7 @@ export default function ThemeBuilder() {
<Flex
as="form"
key={currentTheme.id}
key={getThemeKey(currentTheme)}
id="theme-form"
ref={formRef}
onChange={onThemeChanged}
@@ -270,7 +305,7 @@ export default function ThemeBuilder() {
{Object.keys(ThemeInfoTemplate).map((key) => {
return (
<Field
key={key}
key={`${getThemeKey(currentTheme)}-${key}`}
label={toTitleCase(key)}
name={key}
defaultValue={currentThemeFlattened[key]}
@@ -322,7 +357,7 @@ export default function ThemeBuilder() {
{authors.map((author, index) => (
<Flex
key={author.name}
key={`${getThemeKey(currentTheme)}-${author.name}`}
sx={{
flexDirection: "column"
}}
@@ -549,7 +584,7 @@ export default function ThemeBuilder() {
</>
))}
</Flex>
</Flex>
</>
);
}
@@ -604,19 +639,25 @@ function SelectItem(props: {
}
function exportTheme(theme: ThemeDefinition) {
const json = JSON.stringify({
...theme,
$schema: JSON_SCHEMA_URL
});
FileSaver.saveAs(
new Blob([json], {
new Blob([themeToJSON(theme)], {
type: "text/plain"
}),
`${theme.id}.json`
);
}
function themeToJSON(theme: ThemeDefinition) {
return JSON.stringify(
{
$schema: JSON_SCHEMA_URL,
...theme
},
undefined,
2
);
}
const onChangeColor = (target: HTMLInputElement, sibling: HTMLInputElement) => {
const value = target.value;
if ((sibling as HTMLInputElement).value !== value) {
@@ -660,3 +701,7 @@ function toTitleCase(value: string) {
value.slice(1).replace(/([A-Z]+)*([A-Z][a-z])/g, "$1 $2")
);
}
function getThemeKey(theme: ThemeDefinition) {
return `${theme.id}-${theme.version}-${theme.compatibilityVersion}`;
}

View File

@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { init } from "@notesnook/web/src/bootstrap";
import { render } from "react-dom";
import ThemeBuilder from "./components/theme-builder";
import { BaseThemeProvider } from "@notesnook/web/src/components/theme-provider";
import { App } from "./app";
renderApp();
@@ -39,7 +39,7 @@ async function renderApp() {
}}
>
<Component route={props?.route || "login:email"} />
<ThemeBuilder />
<App />
</BaseThemeProvider>,
document.getElementById("root"),
() => {

View File

@@ -0,0 +1,76 @@
/*
This file is part of the Notesnook project (https://notesnook.com/)
Copyright (C) 2023 Streetwriters (Private) Limited
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { ThemeDefinition, validateTheme } from "@notesnook/theme";
import { tryParse } from "@notesnook/web/src/utils/parse";
export async function loadThemeFromPullRequest(id: string) {
try {
//streetwriters/notesnook-themes/3
const [owner, repo, pullRequestNumber] = id.split("/");
console.log(owner, repo, pullRequestNumber);
if (
!owner ||
!repo ||
!pullRequestNumber ||
owner !== "streetwriters" ||
repo !== "notesnook-themes" ||
isNaN(parseInt(pullRequestNumber))
)
return null;
const files = await fetch(
`https://api.github.com/repos/${owner}/${repo}/pulls/${pullRequestNumber}/files`
).then((res) => (res.ok ? res.json() : []));
if (!files || !Array.isArray(files)) return null;
for (const file of files) {
if (file.filename?.endsWith("theme.json") && file.raw_url) {
return loadThemeFromURL(file.raw_url);
}
}
return null;
} catch (ex) {
console.error(ex);
return null;
}
}
export async function loadThemeFromURL(url: string) {
try {
return loadThemeFromJSON(
await fetch(`https://cors.notesnook.com/${url}`).then((res) => res.json())
);
} catch (err) {
console.error(err);
return null;
}
}
export function loadThemeFromBase64(base64: string) {
return loadThemeFromJSON(
tryParse(Buffer.from(base64, "base64url").toString("utf-8"))
);
}
export function loadThemeFromJSON(themeJSON: any) {
const result = validateTheme(themeJSON);
if (result.error) return null;
return themeJSON as ThemeDefinition;
}

View File

@@ -2,11 +2,8 @@
"extends": "../../tsconfig",
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"jsx": "react-jsx",
"maxNodeModuleJsDepth": 10,
"noEmit": true,
"downlevelIteration": true
"noEmit": true
},
"include": ["src"]
}

View File

@@ -2,9 +2,7 @@
"extends": "../../tsconfig",
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"jsx": "react-jsx",
"maxNodeModuleJsDepth": 5,
"noEmit": true
},
"include": ["src"]

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import { Locator } from "@playwright/test";
import { getTestId } from "../utils";
import { BaseItemModel } from "./base-item.model";

View File

@@ -21,7 +21,7 @@ import { Locator, Page } from "@playwright/test";
import { getTestId } from "../utils";
import { BaseViewModel } from "./base-view.model";
import { ReminderItemModel } from "./reminder-item.model";
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import { fillReminderDialog } from "./utils";
export class RemindersViewModel extends BaseViewModel {

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import { Locator, Page } from "@playwright/test";
import { getTestId } from "../utils";
import { Item, Notebook } from "./types";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import { test, expect } from "@playwright/test";
import { AppModel } from "./models/app.model";

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "@notesnook/web",
"description": "Your private note taking space",
"version": "2.6.0",
"version": "2.6.1",
"private": true,
"main": "./src/app.js",
"homepage": "https://notesnook.com/",

View File

@@ -28,7 +28,7 @@ import { resetNotices, scheduleBackups } from "./common/notices";
import { introduceFeatures, showUpgradeReminderDialogs } from "./common";
import { AppEventManager, AppEvents } from "./common/app-events";
import { db } from "./common/db";
import { EV, EVENTS } from "@notesnook/core/common";
import { EV, EVENTS } from "@notesnook/core/dist/common";
import { registerKeyMap } from "./common/key-map";
import { isUserPremium } from "./hooks/use-is-user-premium";
import {

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import "./polyfills";
import "@notesnook/core/types";
import "@notesnook/core/dist/types";
import { getCurrentHash, getCurrentPath, makeURL } from "./navigation";
import Config from "./utils/config";
@@ -147,5 +147,5 @@ export async function init() {
}
function shouldSkipInitiation() {
return localStorage.getItem("skipInitiation") || false;
return IS_THEME_BUILDER || localStorage.getItem("skipInitiation") || false;
}

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import EventManager from "@notesnook/core/utils/event-manager";
import EventManager from "@notesnook/core/dist/utils/event-manager";
export const AppEventManager = new EventManager();
export const AppEvents = {

View File

@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { EventSourcePolyfill as EventSource } from "event-source-polyfill";
import { DatabasePersistence, NNStorage } from "../interfaces/storage";
import { logger } from "../utils/logger";
import type Database from "@notesnook/core/api";
import type Database from "@notesnook/core/dist/api";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

View File

@@ -35,7 +35,7 @@ import { Period } from "../dialogs/buy-dialog/types";
import { FeatureKeys } from "../dialogs/feature-dialog";
import { AuthenticatorType } from "../dialogs/mfa/types";
import { Suspense } from "react";
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import { ConfirmDialogProps } from "../dialogs/confirm";
import { getFormattedDate } from "@notesnook/common";
import { downloadUpdate } from "../utils/updater";

View File

@@ -35,7 +35,7 @@ import { showFilePicker } from "../utils/file-picker";
import { logger } from "../utils/logger";
import { PATHS } from "@notesnook/desktop";
import { TaskManager } from "./task-manager";
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import { getFormattedDate } from "@notesnook/common";
import { desktop } from "./desktop-bridge";

View File

@@ -54,7 +54,7 @@ import {
DocumentMimeTypes,
WebClipMimeType,
PDFMimeType
} from "@notesnook/core/utils/filename";
} from "@notesnook/core/dist/utils/filename";
import { useEffect, useState } from "react";
import { AppEventManager, AppEvents } from "../../common/app-events";
import { getFormattedDate } from "@notesnook/common";

View File

@@ -42,7 +42,7 @@ import { Attachment } from "../icons";
import { useEditorInstance } from "./context";
import { attachFile, AttachmentProgress, insertAttachment } from "./picker";
import { saveAttachment, downloadAttachment } from "../../common/attachments";
import { EV, EVENTS } from "@notesnook/core/common";
import { EV, EVENTS } from "@notesnook/core/dist/common";
import { db } from "../../common/db";
import useMobile from "../../hooks/use-mobile";
import Titlebox from "./title-box";

View File

@@ -76,7 +76,7 @@ import {
Reminder as ReminderType,
isReminderActive,
isReminderToday
} from "@notesnook/core/collections/reminders";
} from "@notesnook/core/dist/collections/reminders";
import { getFormattedReminderTime } from "@notesnook/common";
import { MenuItem } from "@notesnook/ui";
import {

View File

@@ -27,7 +27,7 @@ import { db } from "../../common/db";
import { writeText } from "clipboard-polyfill";
import { ScopedThemeProvider } from "../theme-provider";
import { showToast } from "../../utils/toast";
import { EV, EVENTS } from "@notesnook/core/common";
import { EV, EVENTS } from "@notesnook/core/dist/common";
import { useStore } from "../../stores/monograph-store";
import ReactModal from "react-modal";
import { DialogButton } from "../dialog";

View File

@@ -35,7 +35,7 @@ import IconTag from "../icon-tag";
import {
Reminder as ReminderType,
isReminderToday
} from "@notesnook/core/collections/reminders";
} from "@notesnook/core/dist/collections/reminders";
import { hashNavigate } from "../../navigation";
import { Multiselect } from "../../common/multi-select";
import { store } from "../../stores/reminder-store";

View File

@@ -51,6 +51,7 @@ export function BaseThemeProvider(
const cssTheme = useMemo(() => themeToCSS(theme), [theme]);
useEffect(() => {
if (IS_THEME_BUILDER) return;
(async () => {
await useThemeStore.getState().init();
})();

View File

@@ -55,7 +55,11 @@ import { Perform } from "../common/dialog-controller";
import { Multiselect } from "../common/multi-select";
import { CustomScrollbarsVirtualList } from "../components/list-container";
import { Attachment } from "../components/attachment";
import { isDocument, isImage, isVideo } from "@notesnook/core/utils/filename";
import {
isDocument,
isImage,
isVideo
} from "@notesnook/core/dist/utils/filename";
import { alpha } from "@theme-ui/color";
import { ScopedThemeProvider } from "../components/theme-provider";

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { EVENTS } from "@notesnook/core/common";
import { EVENTS } from "@notesnook/core/dist/common";
import { Text } from "@theme-ui/components";
import { useCallback, useEffect, useState } from "react";
import { createBackup } from "../common";

View File

@@ -21,7 +21,7 @@ import { Perform } from "../common/dialog-controller";
import Dialog from "../components/dialog";
import { Button, Flex, Text } from "@theme-ui/components";
import { db } from "../common/db";
import { Reminder } from "@notesnook/core/collections/reminders";
import { Reminder } from "@notesnook/core/dist/collections/reminders";
import IconTag from "../components/icon-tag";
import { Clock, Refresh } from "../components/icons";
import Note from "../components/note";

View File

@@ -46,10 +46,7 @@ export const BackupExportSettings: SettingsGroup[] = [
action: async () => {
if (!isUserPremium() && useSettingStore.getState().encryptBackups)
useSettingStore.getState().toggleEncryptBackups();
const verified =
useSettingStore.getState().encryptBackups ||
(await verifyAccount());
if (verified) await createBackup();
if (await verifyAccount()) await createBackup();
},
variant: "secondary"
}
@@ -92,15 +89,10 @@ export const BackupExportSettings: SettingsGroup[] = [
],
selectedOption: () =>
useSettingStore.getState().backupReminderOffset.toString(),
onSelectionChanged: async (value) => {
const verified =
useSettingStore.getState().encryptBackups ||
(await verifyAccount());
if (verified)
useSettingStore
.getState()
.setBackupReminderOffset(parseInt(value));
}
onSelectionChanged: (value) =>
useSettingStore
.getState()
.setBackupReminderOffset(parseInt(value))
}
]
},
@@ -119,12 +111,7 @@ export const BackupExportSettings: SettingsGroup[] = [
isToggled: () =>
!!useUserStore.getState().isLoggedIn &&
useSettingStore.getState().encryptBackups,
toggle: async () => {
const verified =
!useSettingStore.getState().encryptBackups ||
(await verifyAccount());
if (verified) useSettingStore.getState().toggleEncryptBackups();
}
toggle: () => useSettingStore.getState().toggleEncryptBackups()
}
]
},
@@ -138,11 +125,6 @@ export const BackupExportSettings: SettingsGroup[] = [
type: "button",
title: "Select directory",
action: async () => {
const verified =
useSettingStore.getState().encryptBackups ||
(await verifyAccount());
if (!verified) return;
const backupStorageLocation =
useSettingStore.getState().backupStorageLocation ||
PATHS.backupsDirectory;
@@ -182,11 +164,11 @@ export const BackupExportSettings: SettingsGroup[] = [
selectedOption: () => "-",
onSelectionChanged: async (value) => {
if (!db.notes || value === "-") return;
if (await verifyAccount())
await exportNotes(
value as "txt" | "md" | "html",
db.notes.all.map((n) => n.id)
);
await exportNotes(
value as "txt" | "md" | "html",
db.notes.all.map((n) => n.id)
);
}
}
]

View File

@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { DATE_FORMATS } from "@notesnook/core/common";
import { DATE_FORMATS } from "@notesnook/core/dist/common";
import { SettingsGroup } from "./types";
import { useStore as useSettingStore } from "../../stores/setting-store";
import dayjs from "dayjs";

View File

@@ -46,7 +46,7 @@ import {
import { useEffect, useState } from "react";
import { CSS } from "@dnd-kit/utilities";
import { createPortal } from "react-dom";
import { getId } from "@notesnook/core/utils/id";
import { getId } from "@notesnook/core/dist/utils/id";
import { Label } from "@theme-ui/components";
import { db } from "../../../common/db";
import { useToolbarConfig } from "../../../components/editor/context";

View File

@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Language, useSpellChecker } from "../../../hooks/use-spell-checker";
import { Input, Label } from "@theme-ui/components";
import { useCallback, useEffect, useState } from "react";
import { deleteItem } from "@notesnook/core/utils/array";
import { deleteItem } from "@notesnook/core/dist/utils/array";
import { FlexScrollContainer } from "../../../components/scroll-container";
export function SpellCheckerLanguages() {

View File

@@ -184,7 +184,7 @@ function ThemesList() {
previewColors: getPreviewColors(theme)
})
) {
setTheme(theme);
setCurrentTheme(theme);
}
}}
sx={{

View File

@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import { Flex, Text } from "@theme-ui/components";
import { User } from "../../../components/icons";
import { useStore as useUserStore } from "../../../stores/user-store";
import ObjectID from "@notesnook/core/utils/object-id";
import ObjectID from "@notesnook/core/dist/utils/object-id";
import { getFormattedDate } from "@notesnook/common";
import { SUBSCRIPTION_STATUS } from "../../../common/constants";
import dayjs from "dayjs";

View File

@@ -63,23 +63,25 @@ function ThemeDetailsDialog(props: ThemeDetailsDialogProps) {
<Text variant="subBody" sx={{ fontSize: "subtitle" }}>
{theme.authors.map((author) => author.name).join(", ")}
</Text>
{theme.totalInstalls && (
{theme.totalInstalls && theme.totalInstalls > 0 ? (
<Text variant="subBody" sx={{ fontSize: "subtitle" }}>
{theme.totalInstalls} installs
</Text>
)}
) : null}
<Text variant="subBody" sx={{ fontSize: "subtitle" }}>
Licensed under {theme.license}
</Text>
<Flex sx={{ gap: 1, mt: 1 }}>
<Link
href={theme.homepage}
target="_blank"
variant="text.subBody"
sx={{ fontSize: "subtitle", color: "accent" }}
>
Website
</Link>
{theme.homepage && (
<Link
href={theme.homepage}
target="_blank"
variant="text.subBody"
sx={{ fontSize: "subtitle", color: "accent" }}
>
Website
</Link>
)}
{theme.sourceURL && (
<Link
href={theme.sourceURL}

View File

@@ -30,6 +30,7 @@ declare global {
var PLATFORM: "web" | "desktop";
var IS_BETA: boolean;
var APP_TITLE: string;
var IS_THEME_BUILDER: boolean;
interface Window {
os?: () => NodeJS.Platform | "mas";

View File

@@ -23,12 +23,12 @@ import axios, { AxiosProgressEvent } from "axios";
import { AppEventManager, AppEvents } from "../common/app-events";
import { StreamableFS } from "@notesnook/streamable-fs";
import { getNNCrypto } from "./nncrypto.stub";
import hosts from "@notesnook/core/utils/constants";
import { sendAttachmentsProgressEvent } from "@notesnook/core/common";
import hosts from "@notesnook/core/dist/utils/constants";
import { sendAttachmentsProgressEvent } from "@notesnook/core/dist/common";
import { saveAs } from "file-saver";
import { showToast } from "../utils/toast";
import { db } from "../common/db";
import { getFileNameWithExtension } from "@notesnook/core/utils/filename";
import { getFileNameWithExtension } from "@notesnook/core/dist/utils/filename";
import { ChunkedStream, IntoChunks } from "../utils/streams/chunked-stream";
import { ProgressStream } from "../utils/streams/progress-stream";
import { consumeReadableStream } from "../utils/stream";

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { useState } from "react";
import EventManager from "@notesnook/core/utils/event-manager";
import EventManager from "@notesnook/core/dist/utils/event-manager";
import Config from "../utils/config";
import { HashRoute } from "./hash-routes";
import { ReplaceParametersInPath } from "./types";

View File

@@ -24,7 +24,7 @@ import Config from "../utils/config";
import { isUserPremium } from "../hooks/use-is-user-premium";
import { SUBSCRIPTION_STATUS } from "../common/constants";
import { appVersion } from "../utils/version";
import { findItemAndDelete } from "@notesnook/core/utils/array";
import { findItemAndDelete } from "@notesnook/core/dist/utils/array";
/**
* @extends {BaseStore<AnnouncementStore>}

View File

@@ -32,7 +32,7 @@ import { store as settingStore } from "./setting-store";
import BaseStore from "./index";
import { showToast } from "../utils/toast";
import { resetNotices } from "../common/notices";
import { EV, EVENTS, SYNC_CHECK_IDS } from "@notesnook/core/common";
import { EV, EVENTS, SYNC_CHECK_IDS } from "@notesnook/core/dist/common";
import { logger } from "../utils/logger";
import Config from "../utils/config";
import { onPageVisibilityChanged } from "../utils/page-visibility";

View File

@@ -24,7 +24,7 @@ import { store as appStore } from "./app-store";
import { store as tagStore } from "./tag-store";
import { db } from "../common/db";
import BaseStore from ".";
import { EV, EVENTS } from "@notesnook/core/common";
import { EV, EVENTS } from "@notesnook/core/dist/common";
import { hashNavigate } from "../navigation";
import { logger } from "../utils/logger";
import Config from "../utils/config";

View File

@@ -25,7 +25,7 @@ import { store as selectionStore } from "./selection-store";
import Vault from "../common/vault";
import BaseStore from ".";
import Config from "../utils/config";
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
/**
* @extends {BaseStore<NoteStore>}

View File

@@ -22,7 +22,7 @@ import createStore from "../common/store";
import { store as appStore } from "./app-store";
import { store as noteStore } from "./note-store";
import BaseStore from "./index";
import { groupArray } from "@notesnook/core/utils/grouping";
import { groupArray } from "@notesnook/core/dist/utils/grouping";
import Config from "../utils/config";
/**

Some files were not shown because too many files have changed in this diff Show More