mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-08-29 18:19:38 +02:00
Compare commits
116 Commits
fix/launch
...
theme-buil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ef9180894 | ||
|
|
d1a2ec580d | ||
|
|
0a057e2b32 | ||
|
|
29611ffdef | ||
|
|
85fa49f53e | ||
|
|
703853bd8a | ||
|
|
9b046c6b6f | ||
|
|
d10e08a158 | ||
|
|
ad67947ad7 | ||
|
|
1574ae7a28 | ||
|
|
56201cb408 | ||
|
|
b3fc476352 | ||
|
|
fdd24a90d5 | ||
|
|
5140fd7108 | ||
|
|
becd852165 | ||
|
|
700f5e4205 | ||
|
|
4245ac1451 | ||
|
|
26e44798ec | ||
|
|
9648913a02 | ||
|
|
7091f64de8 | ||
|
|
e5ec15fd9c | ||
|
|
c067c73b33 | ||
|
|
d304f708c7 | ||
|
|
71cf9955cd | ||
|
|
c5fcfd6654 | ||
|
|
67a1c55420 | ||
|
|
6c54f28c0f | ||
|
|
c576671302 | ||
|
|
6e663bf913 | ||
|
|
0f999947ee | ||
|
|
ab458486a2 | ||
|
|
5e627b567f | ||
|
|
2ef7baab0a | ||
|
|
56ede7654a | ||
|
|
18ccbc0ba3 | ||
|
|
73f50a34f9 | ||
|
|
c0805b1915 | ||
|
|
3c9a62b8ed | ||
|
|
b61c094a5d | ||
|
|
7f7390810f | ||
|
|
09ea2f577b | ||
|
|
cbcd7a9e5a | ||
|
|
bca774dfd0 | ||
|
|
0b56bdb0c4 | ||
|
|
cdf481d581 | ||
|
|
c644f606f3 | ||
|
|
c45e029780 | ||
|
|
59422d3e9c | ||
|
|
f0df45bd82 | ||
|
|
c5ce153c00 | ||
|
|
3e7d68f524 | ||
|
|
e4eea50319 | ||
|
|
47e0c54ab0 | ||
|
|
1ff1319e8a | ||
|
|
16c46d3fc7 | ||
|
|
8362c39277 | ||
|
|
eedf347708 | ||
|
|
403b2809b7 | ||
|
|
6c551eef0a | ||
|
|
d34b354420 | ||
|
|
38a4652c29 | ||
|
|
228c1a4d3a | ||
|
|
7bca693c44 | ||
|
|
583fa3da49 | ||
|
|
2ff73e241d | ||
|
|
fe2c753068 | ||
|
|
19201186c5 | ||
|
|
b2dd6b750d | ||
|
|
25380ec052 | ||
|
|
81cc687e1e | ||
|
|
1dab6be32d | ||
|
|
b9bfeee126 | ||
|
|
a06fa9f00e | ||
|
|
b147afbefe | ||
|
|
7646f35e58 | ||
|
|
beb782b9ad | ||
|
|
6e3f706b3a | ||
|
|
f01d415415 | ||
|
|
b6417d0016 | ||
|
|
f1ab8e92bd | ||
|
|
80ffbc511d | ||
|
|
745bf65641 | ||
|
|
a0015af169 | ||
|
|
e6e775dbeb | ||
|
|
e082007a49 | ||
|
|
deced99339 | ||
|
|
b0acce7b4f | ||
|
|
e081e7ea09 | ||
|
|
35db89aa11 | ||
|
|
679a912e2b | ||
|
|
627259e129 | ||
|
|
70c8201355 | ||
|
|
064059278a | ||
|
|
959e7466a6 | ||
|
|
69bd277d87 | ||
|
|
5833832123 | ||
|
|
37187403d4 | ||
|
|
b24d52bbbd | ||
|
|
82142d11aa | ||
|
|
19b4d84c40 | ||
|
|
fd98b89900 | ||
|
|
1870406b5e | ||
|
|
64e5f63f70 | ||
|
|
02f75ac1cd | ||
|
|
52849a5bf3 | ||
|
|
f64c91faec | ||
|
|
c7ae14f239 | ||
|
|
9ab084d793 | ||
|
|
6514b98ce8 | ||
|
|
5a5cacee4f | ||
|
|
04451eee5d | ||
|
|
6e7558b364 | ||
|
|
9c02fed3af | ||
|
|
5d7195fb41 | ||
|
|
6cd1178347 | ||
|
|
b7b4a18624 |
@@ -14,7 +14,6 @@ const SCOPES = [
|
||||
|
||||
"mobile",
|
||||
"web",
|
||||
"vericrypt",
|
||||
"desktop",
|
||||
"crypto",
|
||||
"editor",
|
||||
@@ -33,8 +32,7 @@ const SCOPES = [
|
||||
"misc",
|
||||
"common",
|
||||
"global",
|
||||
"docs",
|
||||
"themebuilder"
|
||||
"docs"
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
|
||||
31
.github/workflows/theme-builder.publish.yml
vendored
31
.github/workflows/theme-builder.publish.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Publish @notesnook/theme-builder
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node-with-cache
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
npm ci --ignore-scripts --prefer-offline --no-audit
|
||||
npm run bootstrap -- --scope=themebuilder
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate build
|
||||
run: npm run build:theme-builder
|
||||
|
||||
- name: Publish to Cloudflare Pages
|
||||
run: npx --yes wrangler pages deploy --project-name=notesnook-theme-builder ./apps/theme-builder/build/
|
||||
31
.github/workflows/vericrypt.publish.yml
vendored
31
.github/workflows/vericrypt.publish.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Publish @notesnook/vericrypt
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node-with-cache
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
npm ci --ignore-scripts --prefer-offline --no-audit
|
||||
npm run bootstrap -- --scope=vericrypt
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate build
|
||||
run: npm run build:vericrypt
|
||||
|
||||
- name: Publish on Cloudflare Pages
|
||||
run: npx --yes wrangler pages deploy --project-name=vericrypt ./apps/vericrypt/build/
|
||||
67
.github/workflows/web.beta.publish.yml
vendored
67
.github/workflows/web.beta.publish.yml
vendored
@@ -1,67 +0,0 @@
|
||||
name: Publish @notesnook/web Beta
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- "apps/mobile/**"
|
||||
- "packages/editor-mobile/**"
|
||||
- "apps/desktop/**"
|
||||
- "apps/vericrypt/**"
|
||||
- "servers/**"
|
||||
- "packages/clipper/**"
|
||||
- "extensions/web-clipper/**"
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
- ready_for_review
|
||||
- reopened
|
||||
- opened
|
||||
- synchronize
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- "apps/mobile/**"
|
||||
- "packages/editor-mobile/**"
|
||||
- "apps/desktop/**"
|
||||
- "apps/vericrypt/**"
|
||||
- "servers/**"
|
||||
- "packages/clipper/**"
|
||||
- "extensions/web-clipper/**"
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: ./.github/actions/setup-node-with-cache
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
npm ci --ignore-scripts --prefer-offline --no-audit
|
||||
npm run bootstrap -- --scope=web
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
echo "NX_CLOUD_ACCESS_TOKEN=${{ secrets.NX_CLOUD_ACCESS_TOKEN }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate beta build
|
||||
run: npm run build:beta:web
|
||||
|
||||
- name: Publish to Cloudflare Pages
|
||||
uses: unlike-ltd/github-actions-cloudflare-pages@v0.1.1
|
||||
id: pages
|
||||
with:
|
||||
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
cloudflare-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
cloudflare-project-name: notesnook-beta-app
|
||||
directory: ./apps/web/build
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github-environment: ${{ (github.ref == 'refs/heads/master' && 'beta') || 'preview' }}
|
||||
6
.github/workflows/web.publish.yml
vendored
6
.github/workflows/web.publish.yml
vendored
@@ -24,8 +24,8 @@ jobs:
|
||||
echo "CLOUDFLARE_ACCOUNT_ID=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}" >> $GITHUB_ENV
|
||||
echo "CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_API_TOKEN }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Generate build
|
||||
- name: Generate desktop build
|
||||
run: npm run build:web
|
||||
|
||||
- name: Publish to Cloudflare Pages
|
||||
run: npx --yes wrangler pages deploy --project-name=notesnook-app ./apps/web/build/
|
||||
- name: Publish on Cloudflare Pages
|
||||
run: npx --yes wrangler pages publish --project-name=notesnook-app ./apps/web/build/
|
||||
|
||||
6
apps/desktop/package-lock.json
generated
6
apps/desktop/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@notesnook/desktop",
|
||||
"version": "2.6.1",
|
||||
"version": "2.5.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@notesnook/desktop",
|
||||
"version": "2.6.1",
|
||||
"version": "2.5.8",
|
||||
"hasInstallScript": true,
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"../../packages/crypto": {
|
||||
"name": "@notesnook/crypto",
|
||||
"version": "1.1.1",
|
||||
"version": "1.0.1",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@notesnook/sodium": "file:../sodium"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@notesnook/desktop",
|
||||
"productName": "Notesnook",
|
||||
"description": "Your private note taking space",
|
||||
"version": "2.6.1",
|
||||
"version": "2.5.8",
|
||||
"appAppleId": "1544027013",
|
||||
"private": true,
|
||||
"main": "./dist/index.js",
|
||||
|
||||
@@ -52,21 +52,21 @@ export const osIntegrationRouter = t.router({
|
||||
|
||||
privacyMode: t.procedure.query(() => config.privacyMode),
|
||||
setPrivacyMode: t.procedure
|
||||
.input(z.object({ enabled: z.boolean() }))
|
||||
.mutation(({ input: { enabled } }) => {
|
||||
.input(z.boolean().optional())
|
||||
.mutation(({ input: privacyMode }) => {
|
||||
if (!globalThis.window || !["win32", "darwin"].includes(process.platform))
|
||||
return;
|
||||
|
||||
globalThis.window.setContentProtection(enabled);
|
||||
globalThis.window.setContentProtection(!!privacyMode);
|
||||
|
||||
if (process.platform === "win32") {
|
||||
globalThis.window.setThumbnailClip(
|
||||
enabled
|
||||
privacyMode
|
||||
? { x: 0, y: 0, width: 1, height: 1 }
|
||||
: { x: 0, y: 0, width: 0, height: 0 }
|
||||
);
|
||||
}
|
||||
config.privacyMode = enabled;
|
||||
config.privacyMode = !!privacyMode;
|
||||
}),
|
||||
|
||||
desktopIntegration: t.procedure.query(() => config.desktopSettings),
|
||||
|
||||
@@ -114,9 +114,9 @@ export const spellCheckerRouter = t.router({
|
||||
globalThis.window?.webContents.session.setSpellCheckerLanguages(languages)
|
||||
),
|
||||
toggle: t.procedure
|
||||
.input(z.object({ enabled: z.boolean() }))
|
||||
.mutation(({ input: { enabled } }) => {
|
||||
globalThis.window?.webContents.session.setSpellCheckerEnabled(enabled);
|
||||
config.isSpellCheckerEnabled = enabled;
|
||||
.input(z.boolean().optional())
|
||||
.mutation(({ input: enabled }) => {
|
||||
globalThis.window?.webContents.session.setSpellCheckerEnabled(!!enabled);
|
||||
config.isSpellCheckerEnabled = !!enabled;
|
||||
})
|
||||
});
|
||||
|
||||
@@ -41,9 +41,10 @@ export const updaterRouter = t.router({
|
||||
}),
|
||||
|
||||
toggleAutoUpdates: t.procedure
|
||||
.input(z.object({ enabled: z.boolean() }))
|
||||
.mutation(({ input: { enabled } }) => {
|
||||
config.automaticUpdates = enabled;
|
||||
.input(z.boolean().optional())
|
||||
.mutation(({ input }) => {
|
||||
config.automaticUpdates =
|
||||
input === undefined ? !config.automaticUpdates : input;
|
||||
}),
|
||||
|
||||
onChecking: createSubscription("checking-for-update"),
|
||||
|
||||
@@ -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 { app, BrowserWindow, nativeTheme, shell } from "electron";
|
||||
import { app, BrowserWindow, nativeTheme, session, shell } from "electron";
|
||||
import { isDevelopment } from "./utils";
|
||||
import { registerProtocol, PROTOCOL_URL } from "./utils/protocol";
|
||||
import { configureAutoUpdater } from "./utils/autoupdater";
|
||||
@@ -33,13 +33,6 @@ import { createIPCHandler } from "electron-trpc/main";
|
||||
import { router, api } from "./api";
|
||||
import { config } from "./utils/config";
|
||||
import path from "path";
|
||||
import { bringToFront } from "./utils/bring-to-front";
|
||||
|
||||
// only run a single instance
|
||||
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
|
||||
console.log("Another instance is already running!");
|
||||
app.exit();
|
||||
}
|
||||
|
||||
if (process.platform == "win32" && process.env.PORTABLE_EXECUTABLE_DIR) {
|
||||
console.log("Portable app: true");
|
||||
@@ -49,6 +42,11 @@ if (process.platform == "win32" && process.env.PORTABLE_EXECUTABLE_DIR) {
|
||||
app.setPath("userData", path.join(root, "UserData"));
|
||||
}
|
||||
|
||||
// only run a single instance
|
||||
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
|
||||
app.exit();
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
app.setAppUserModelId(app.name);
|
||||
}
|
||||
@@ -93,7 +91,7 @@ async function createWindow() {
|
||||
mainWindow.setOpacity(1);
|
||||
|
||||
if (config.privacyMode) {
|
||||
await api.integration.setPrivacyMode({ enabled: config.privacyMode });
|
||||
await api.integration.setPrivacyMode(config.privacyMode);
|
||||
}
|
||||
|
||||
await AssetManager.loadIcons();
|
||||
@@ -139,11 +137,6 @@ app.once("window-all-closed", () => {
|
||||
}
|
||||
});
|
||||
|
||||
app.on("second-instance", () => {
|
||||
if (!globalThis.window) return;
|
||||
bringToFront();
|
||||
});
|
||||
|
||||
app.on("activate", () => {
|
||||
if (globalThis.window === null) {
|
||||
createWindow();
|
||||
|
||||
@@ -38,8 +38,8 @@ export const config = {
|
||||
closeToSystemTray: false
|
||||
},
|
||||
privacyMode: false,
|
||||
isSpellCheckerEnabled: true,
|
||||
zoomFactor: 1,
|
||||
isSpellCheckerEnabled: false,
|
||||
zoomFactor: 0,
|
||||
theme: nativeTheme.themeSource,
|
||||
automaticUpdates: true
|
||||
};
|
||||
|
||||
1
apps/mobile/.gitignore
vendored
1
apps/mobile/.gitignore
vendored
@@ -5,6 +5,7 @@ artifacts/
|
||||
.DS_Store
|
||||
|
||||
native/android/app/src/main/assets/
|
||||
|
||||
*Issues.md
|
||||
build_cache/
|
||||
#
|
||||
|
||||
@@ -16,7 +16,6 @@ GNU General 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 SettingsService from "./services/settings";
|
||||
import {
|
||||
THEME_COMPATIBILITY_VERSION,
|
||||
useThemeEngineStore
|
||||
@@ -32,11 +31,13 @@ import GlobalSafeAreaProvider from "./components/globalsafearea";
|
||||
import { useAppEvents } from "./hooks/use-app-events";
|
||||
import { ApplicationHolder } from "./navigation";
|
||||
import Notifications from "./services/notifications";
|
||||
import SettingsService from "./services/settings";
|
||||
import { TipManager } from "./services/tip-manager";
|
||||
import { useThemeStore } from "./stores/use-theme-store";
|
||||
import { useUserStore } from "./stores/use-user-store";
|
||||
import { themeTrpcClient } from "./screens/settings/theme-selector";
|
||||
|
||||
SettingsService.init();
|
||||
SettingsService.checkOrientation();
|
||||
const App = () => {
|
||||
const init = useAppEvents();
|
||||
@@ -92,12 +93,6 @@ const App = () => {
|
||||
);
|
||||
};
|
||||
|
||||
let currTheme =
|
||||
useThemeStore.getState().colorScheme === "dark"
|
||||
? SettingsService.getProperty("darkTheme")
|
||||
: SettingsService.getProperty("lightTheme");
|
||||
useThemeEngineStore.getState().setTheme(currTheme);
|
||||
|
||||
export const withTheme = (Element) => {
|
||||
return function AppWithThemeProvider() {
|
||||
const [colorScheme, darkTheme, lightTheme] = useThemeStore((state) => [
|
||||
@@ -107,35 +102,31 @@ export const withTheme = (Element) => {
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
const currentTheme = colorScheme === "dark" ? darkTheme : lightTheme;
|
||||
if (!currentTheme) return;
|
||||
themeTrpcClient.updateTheme
|
||||
.query({
|
||||
version: currentTheme.version,
|
||||
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
|
||||
id: currentTheme.id
|
||||
})
|
||||
.then((theme) => {
|
||||
if (theme) {
|
||||
console.log(theme.version, "theme updated");
|
||||
theme.colorScheme === "dark"
|
||||
? useThemeStore.getState().setDarkTheme(theme)
|
||||
: useThemeStore.getState().setLightTheme(theme);
|
||||
}
|
||||
})
|
||||
.catch(console.log);
|
||||
}, 1000);
|
||||
const currentTheme = colorScheme === "dark" ? darkTheme : lightTheme;
|
||||
if (!currentTheme) return;
|
||||
themeTrpcClient.updateTheme
|
||||
.query({
|
||||
version: currentTheme.version,
|
||||
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
|
||||
id: currentTheme.id
|
||||
})
|
||||
.then((theme) => {
|
||||
if (theme) {
|
||||
console.log(theme.version, "theme updated");
|
||||
theme.colorScheme === "dark"
|
||||
? useThemeStore.getState().setDarkTheme(theme)
|
||||
: useThemeStore.getState().setLightTheme(theme);
|
||||
}
|
||||
})
|
||||
.catch(console.log);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const nextTheme = colorScheme === "dark" ? darkTheme : lightTheme;
|
||||
if (JSON.stringify(nextTheme) !== JSON.stringify(currTheme)) {
|
||||
useEffect(() => {
|
||||
useThemeEngineStore
|
||||
.getState()
|
||||
.setTheme(colorScheme === "dark" ? darkTheme : lightTheme);
|
||||
currTheme = nextTheme;
|
||||
}
|
||||
}, [colorScheme, darkTheme, lightTheme]);
|
||||
|
||||
return <Element />;
|
||||
};
|
||||
|
||||
@@ -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/dist/logger";
|
||||
import { initalize, logger as dbLogger } from "@notesnook/core/logger";
|
||||
import { Platform } from "react-native";
|
||||
import { MMKVLoader } from "react-native-mmkv-storage";
|
||||
import filesystem from "../filesystem";
|
||||
@@ -30,38 +30,41 @@ const LoggerStorage = new MMKVLoader()
|
||||
.withInstanceID("notesnook_logs")
|
||||
.initialize();
|
||||
|
||||
database.host(
|
||||
__DEV__
|
||||
? {
|
||||
API_HOST: "https://api.notesnook.com",
|
||||
AUTH_HOST: "https://auth.streetwriters.co",
|
||||
SSE_HOST: "https://events.streetwriters.co",
|
||||
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
|
||||
ISSUES_HOST: "https://issues.streetwriters.co"
|
||||
// API_HOST: "http://192.168.8.101:5264",
|
||||
// AUTH_HOST: "http://192.168.8.101:8264",
|
||||
// SSE_HOST: "http://192.168.8.101:7264",
|
||||
// SUBSCRIPTIONS_HOST: "http://192.168.8.101:9264",
|
||||
// ISSUES_HOST: "http://192.168.8.101:2624"
|
||||
}
|
||||
: {
|
||||
API_HOST: "https://api.notesnook.com",
|
||||
AUTH_HOST: "https://auth.streetwriters.co",
|
||||
SSE_HOST: "https://events.streetwriters.co",
|
||||
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
|
||||
ISSUES_HOST: "https://issues.streetwriters.co"
|
||||
}
|
||||
);
|
||||
|
||||
database.host(
|
||||
__DEV__
|
||||
? {
|
||||
API_HOST: "https://api.notesnook.com",
|
||||
AUTH_HOST: "https://auth.streetwriters.co",
|
||||
SSE_HOST: "https://events.streetwriters.co",
|
||||
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
|
||||
ISSUES_HOST: "https://issues.streetwriters.co"
|
||||
// API_HOST: "http://192.168.8.101:5264",
|
||||
// AUTH_HOST: "http://192.168.8.101:8264",
|
||||
// SSE_HOST: "http://192.168.8.101:7264",
|
||||
// SUBSCRIPTIONS_HOST: "http://192.168.8.101:9264",
|
||||
// ISSUES_HOST: "http://192.168.8.101:2624"
|
||||
}
|
||||
: {
|
||||
API_HOST: "https://api.notesnook.com",
|
||||
AUTH_HOST: "https://auth.streetwriters.co",
|
||||
SSE_HOST: "https://events.streetwriters.co",
|
||||
SUBSCRIPTIONS_HOST: "https://subscriptions.streetwriters.co",
|
||||
ISSUES_HOST: "https://issues.streetwriters.co"
|
||||
}
|
||||
);
|
||||
|
||||
database.setup(
|
||||
Storage,
|
||||
Platform.OS === "ios" ? EventSource : AndroidEventSource,
|
||||
filesystem,
|
||||
{
|
||||
compress: Gzip.deflate,
|
||||
decompress: Gzip.inflate
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
database.setup(
|
||||
Storage,
|
||||
Platform.OS === "ios" ? EventSource : AndroidEventSource,
|
||||
filesystem,
|
||||
{
|
||||
compress: Gzip.deflate,
|
||||
decompress: Gzip.inflate
|
||||
}
|
||||
);
|
||||
|
||||
initalize(new KV(LoggerStorage), true);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
getFileNameWithExtension,
|
||||
isImage,
|
||||
isDocument
|
||||
} from "@notesnook/core/dist/utils/filename";
|
||||
} from "@notesnook/core/utils/filename";
|
||||
import React from "react";
|
||||
import { Platform } from "react-native";
|
||||
import * as ScopedStorage from "react-native-scoped-storage";
|
||||
|
||||
@@ -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/dist/utils/constants";
|
||||
import hosts from "@notesnook/core/utils/constants";
|
||||
import NetInfo from "@react-native-community/netinfo";
|
||||
import RNFetchBlob from "react-native-blob-util";
|
||||
import { ToastEvent } from "../../services/event-manager";
|
||||
|
||||
@@ -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/dist/utils/filename";
|
||||
import { isImage, isDocument } from "@notesnook/core/utils/filename";
|
||||
import { Platform } from "react-native";
|
||||
import { IOS_APPGROUPID } from "../../utils/constants";
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ const AppLockedOverlay = () => {
|
||||
appLocked && (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.primary.background,
|
||||
backgroundColor: colors.bg,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
@@ -160,7 +160,7 @@ const AppLockedOverlay = () => {
|
||||
style={{
|
||||
width: "100%",
|
||||
padding: 12,
|
||||
backgroundColor: colors.primary.background
|
||||
backgroundColor: colors.bg
|
||||
}}
|
||||
>
|
||||
{user ? (
|
||||
|
||||
@@ -40,7 +40,7 @@ import {
|
||||
isDocument,
|
||||
isImage,
|
||||
isVideo
|
||||
} from "@notesnook/core/dist/utils/filename";
|
||||
} from "@notesnook/core/utils/filename";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { FlashList } from "react-native-actions-sheet/dist/src/views/FlashList";
|
||||
|
||||
@@ -241,7 +241,7 @@ export const AttachmentDialog = ({ note }) => {
|
||||
width: "100%",
|
||||
height: 50,
|
||||
flexDirection: "row",
|
||||
backgroundColor: colors.primary.background
|
||||
backgroundColor: colors.bg
|
||||
}}
|
||||
contentContainerStyle={{
|
||||
minWidth: "100%",
|
||||
|
||||
@@ -17,22 +17,18 @@ 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, { useEffect, useState } from "react";
|
||||
import { Modal, View } from "react-native";
|
||||
import { db } from "../../common/database";
|
||||
import { MMKV } from "../../common/database/mmkv";
|
||||
import BiometricService from "../../services/biometrics";
|
||||
import {
|
||||
ToastEvent,
|
||||
eSendEvent,
|
||||
eSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { setLoginMessage } from "../../services/message";
|
||||
import SettingsService from "../../services/settings";
|
||||
import Sync from "../../services/sync";
|
||||
import { clearAllStores } from "../../stores";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { eLoginSessionExpired, eUserLoggedIn } from "../../utils/events";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { sleep } from "../../utils/time";
|
||||
@@ -75,12 +71,9 @@ export const SessionExpired = () => {
|
||||
try {
|
||||
await db.user.logout();
|
||||
await BiometricService.resetCredentials();
|
||||
setLoginMessage();
|
||||
SettingsService.resetSettings();
|
||||
useUserStore.getState().setUser(null);
|
||||
useUserStore.getState().setSyncing(false);
|
||||
MMKV.clearStore();
|
||||
clearAllStores();
|
||||
SettingsService.set({
|
||||
introCompleted: true
|
||||
});
|
||||
setVisible(false);
|
||||
} catch (e) {
|
||||
ToastEvent.show({
|
||||
|
||||
@@ -33,7 +33,7 @@ import { IconButton } from "../ui/icon-button";
|
||||
|
||||
export const RightMenus = () => {
|
||||
const { colors } = useThemeColors();
|
||||
const { colors: contextMenuColors } = useThemeColors("contextMenu");
|
||||
const { contextMenuColors } = useThemeColors("contextMenu");
|
||||
const deviceMode = useSettingStore((state) => state.deviceMode);
|
||||
const rightButtons = useNavigationStore((state) => state.headerRightButtons);
|
||||
const currentScreen = useNavigationStore((state) => state.currentScreen.name);
|
||||
@@ -93,7 +93,7 @@ export const RightMenus = () => {
|
||||
onRequestClose={() => {
|
||||
menuRef.current?.hide();
|
||||
}}
|
||||
anchor={
|
||||
button={
|
||||
<IconButton
|
||||
onPress={() => {
|
||||
menuRef.current?.show();
|
||||
@@ -113,7 +113,7 @@ export const RightMenus = () => {
|
||||
}}
|
||||
type="gray"
|
||||
buttonType={{
|
||||
text: contextMenuColors.primary.paragraph
|
||||
text: colors.primary.paragraph
|
||||
}}
|
||||
key={item.title}
|
||||
title={item.title}
|
||||
|
||||
@@ -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/dist/utils/dataurl";
|
||||
import dataurl from "@notesnook/core/utils/dataurl";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Platform, View } from "react-native";
|
||||
|
||||
@@ -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/dist/collections/reminders";
|
||||
import { getUpcomingReminder } from "@notesnook/core/collections/reminders";
|
||||
import { decode, EntityLevel } from "entities";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
@@ -109,6 +109,7 @@ export default function NotePreview({ session, content, note }) {
|
||||
flex: 1
|
||||
}}
|
||||
>
|
||||
<EditorOverlay editorId={editorId} />
|
||||
<Editor
|
||||
noHeader
|
||||
noToolbar
|
||||
@@ -116,6 +117,7 @@ export default function NotePreview({ session, content, note }) {
|
||||
editorId={editorId}
|
||||
onLoad={async () => {
|
||||
const _note = note || db.notes.note(session?.noteId)?.data;
|
||||
await sleep(1000);
|
||||
eSendEvent(eOnLoadNote + editorId, {
|
||||
..._note,
|
||||
content: {
|
||||
|
||||
@@ -102,11 +102,7 @@ const SheetProvider = ({ context = "global" }) => {
|
||||
setData(null);
|
||||
}}
|
||||
bottomPadding={!data.noBottomPadding}
|
||||
enableGesturesInScrollView={
|
||||
typeof data.enableGesturesInScrollView === "undefined"
|
||||
? true
|
||||
: data.enableGesturesInScrollView
|
||||
}
|
||||
enableGesturesInScrollView={data.enableGesturesInScrollView}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
@@ -131,7 +127,7 @@ const SheetProvider = ({ context = "global" }) => {
|
||||
|
||||
{data?.icon ? (
|
||||
<Icon
|
||||
color={colors[data.iconColor] || colors.primary.accent}
|
||||
color={colors[dialogData.iconColor] || colors.primary.accent}
|
||||
name={data.icon}
|
||||
size={50}
|
||||
/>
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EVENTS } from "@notesnook/core/common";
|
||||
import React, { useCallback, useEffect, useState } from "react";
|
||||
import { Platform, View } from "react-native";
|
||||
import { db } from "../../../common/database";
|
||||
|
||||
@@ -16,7 +16,6 @@ GNU General 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 { useThemeColors } from "@notesnook/theme";
|
||||
import React, { RefObject, useRef, useState } from "react";
|
||||
import { Platform, TextInput, View } from "react-native";
|
||||
import { ActionSheetRef, ScrollView } from "react-native-actions-sheet";
|
||||
@@ -26,6 +25,7 @@ import {
|
||||
ToastEvent,
|
||||
presentSheet
|
||||
} from "../../../services/event-manager";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { SIZE } from "../../../utils/size";
|
||||
import { Button } from "../../ui/button";
|
||||
import Input from "../../ui/input";
|
||||
@@ -223,7 +223,7 @@ export default function ReminderSheet({
|
||||
<View
|
||||
style={{
|
||||
paddingHorizontal: 12,
|
||||
maxHeight: DDS.isTab ? "99.99%" : "99.99%"
|
||||
maxHeight: DDS.isTab ? "90%" : "99.99%"
|
||||
}}
|
||||
>
|
||||
<View
|
||||
@@ -247,12 +247,7 @@ export default function ReminderSheet({
|
||||
/>
|
||||
</View>
|
||||
<Dialog context="local" />
|
||||
<ScrollView
|
||||
bounces={false}
|
||||
style={{
|
||||
marginBottom: DDS.isTab ? 25 : undefined
|
||||
}}
|
||||
>
|
||||
<ScrollView>
|
||||
<Input
|
||||
fwdRef={titleRef}
|
||||
defaultValue={reminder?.title || referencedItem?.title}
|
||||
@@ -606,7 +601,7 @@ ReminderSheet.present = (
|
||||
) => {
|
||||
presentSheet({
|
||||
context: isSheet ? "local" : undefined,
|
||||
enableGesturesInScrollView: false,
|
||||
enableGesturesInScrollView: true,
|
||||
noBottomPadding: true,
|
||||
component: (ref, close, update) => (
|
||||
<ReminderSheet
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EVENTS } from "@notesnook/core/common";
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { ActivityIndicator, Platform, View } from "react-native";
|
||||
import { FlatList } from "react-native-actions-sheet";
|
||||
@@ -377,10 +377,7 @@ 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
|
||||
@@ -437,9 +434,7 @@ 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>
|
||||
)
|
||||
|
||||
@@ -54,7 +54,7 @@ import {
|
||||
import { normalize, SIZE } from "../../../utils/size";
|
||||
import { GroupHeader, NotebookType, TopicType } from "../../../utils/types";
|
||||
|
||||
import { groupArray } from "@notesnook/core/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import Config from "react-native-config";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import { notesnook } from "../../../../e2e/test.ids";
|
||||
@@ -263,7 +263,6 @@ export const TopicsSheet = () => {
|
||||
index
|
||||
);
|
||||
}}
|
||||
overlayColor={colors.primary.backdrop}
|
||||
closable={!canShow}
|
||||
elevation={10}
|
||||
indicatorStyle={{
|
||||
|
||||
@@ -28,8 +28,7 @@ import { useNoteStore } from "../../stores/use-notes-store";
|
||||
import { useSettingStore } from "../../stores/use-setting-store";
|
||||
import { useThemeColors } from "@notesnook/theme";
|
||||
import { useUserStore } from "../../stores/use-user-store";
|
||||
import { MenuItemsList } from "../../utils/menu-items";
|
||||
import { SUBSCRIPTION_STATUS } from "../../utils/constants";
|
||||
import { MenuItemsList, SUBSCRIPTION_STATUS } from "../../utils/constants";
|
||||
import { eOpenPremiumDialog } from "../../utils/events";
|
||||
import { ColorSection } from "./color-section";
|
||||
import { MenuItem } from "./menu-item";
|
||||
|
||||
@@ -214,10 +214,6 @@ export const FluidTabs = forwardRef<TabsRef, TabProps>(function FluidTabs(
|
||||
return;
|
||||
}
|
||||
translateX.value = animated ? withTiming(homePosition) : homePosition;
|
||||
if (!animated) {
|
||||
translateX.value = 299;
|
||||
translateX.value = 300;
|
||||
}
|
||||
onDrawerStateChange(false);
|
||||
isDrawerOpen.value = false;
|
||||
},
|
||||
|
||||
@@ -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/dist/collections/reminders";
|
||||
import { isReminderActive } from "@notesnook/core/collections/reminders";
|
||||
import React from "react";
|
||||
import { ViewStyle } from "react-native";
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ const SheetWrapper = ({
|
||||
const dimensions = useSettingStore((state) => state.dimensions);
|
||||
const pitchBlack = useSettingStore((state) => state.settings.pitchBlack);
|
||||
const insets = useGlobalSafeAreaInsets();
|
||||
console.log(colors.primary.background);
|
||||
let width = dimensions.width > 600 ? 600 : 500;
|
||||
|
||||
const style = React.useMemo(() => {
|
||||
@@ -103,7 +104,7 @@ const SheetWrapper = ({
|
||||
keyboardDismissMode="none"
|
||||
enableGesturesInScrollView={enableGesturesInScrollView}
|
||||
defaultOverlayOpacity={overlayOpacity}
|
||||
overlayColor={colors.primary.backdrop}
|
||||
overlayColor={pitchBlack ? "#585858" : "#2b2b2b"}
|
||||
keyboardShouldPersistTaps="always"
|
||||
openAnimationConfig={{
|
||||
friction: 9
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EV, EVENTS, SYNC_CHECK_IDS } from "@notesnook/core/common";
|
||||
import notifee from "@notifee/react-native";
|
||||
import NetInfo from "@react-native-community/netinfo";
|
||||
import React, { useCallback, useEffect, useRef } from "react";
|
||||
@@ -631,7 +631,6 @@ const doAppLoadActions = async () => {
|
||||
await useMessageStore.getState().setAnnouncement();
|
||||
if (NewFeature.present()) return;
|
||||
if (await checkAppUpdateAvailable()) return;
|
||||
|
||||
if (!(await db.user.getUser())) {
|
||||
setLoginMessage();
|
||||
return;
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EVENTS } from "@notesnook/core/common";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { db } from "../common/database";
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ const _TabsHolder = () => {
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
zIndex: 999,
|
||||
backgroundColor: colors.primary.backdrop
|
||||
backgroundColor: "rgba(0,0,0,0.2)"
|
||||
},
|
||||
animatedStyle
|
||||
]}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"html-to-text": "9.0.5",
|
||||
"phone": "^3.1.14",
|
||||
"qclone": "^1.2.0",
|
||||
"react-native-actions-sheet": "0.9.0-alpha.23",
|
||||
"react-native-actions-sheet": "0.9.0-alpha.21",
|
||||
"react-native-check-version": "https://github.com/flexible-agency/react-native-check-version",
|
||||
"react-native-drax": "^0.10.2",
|
||||
"react-native-image-zoom-viewer": "^3.0.1",
|
||||
@@ -30,8 +30,7 @@
|
||||
"toggle-switch-react-native": "3.2.0",
|
||||
"url": "^0.11.0",
|
||||
"validator": "^13.5.2",
|
||||
"zustand": "^3.6.0",
|
||||
"katex": "0.16.2"
|
||||
"zustand": "^3.6.0"
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
||||
@@ -18,33 +18,35 @@ 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/dist/common";
|
||||
import { EV, EVENTS } from "@notesnook/core/common";
|
||||
import React, {
|
||||
forwardRef,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
useLayoutEffect,
|
||||
useRef
|
||||
useRef,
|
||||
useState
|
||||
} from "react";
|
||||
import { Platform, ViewStyle } from "react-native";
|
||||
import WebView from "react-native-webview";
|
||||
import { ShouldStartLoadRequest } from "react-native-webview/lib/WebViewTypes";
|
||||
import { notesnook } from "../../../e2e/test.ids";
|
||||
import { db } from "../../common/database";
|
||||
import { IconButton } from "../../components/ui/icon-button";
|
||||
import useKeyboard from "../../hooks/use-keyboard";
|
||||
import { eSubscribeEvent } from "../../services/event-manager";
|
||||
import {
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent
|
||||
} from "../../services/event-manager";
|
||||
import { useEditorStore } from "../../stores/use-editor-store";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import { openLinkInBrowser } from "../../utils/functions";
|
||||
import { NoteType } from "../../utils/types";
|
||||
import EditorOverlay from "./loading";
|
||||
import { EDITOR_URI } from "./source";
|
||||
import { EditorProps, useEditorType } from "./tiptap/types";
|
||||
import { useEditor } from "./tiptap/use-editor";
|
||||
import { useEditorEvents } from "./tiptap/use-editor-events";
|
||||
import { editorController } from "./tiptap/utils";
|
||||
import { useLayoutEffect } from "react";
|
||||
import useKeyboard from "../../hooks/use-keyboard";
|
||||
|
||||
const style: ViewStyle = {
|
||||
height: "100%",
|
||||
@@ -125,26 +127,21 @@ const Editor = React.memo(
|
||||
const onError = useCallback(() => {
|
||||
renderKey.current =
|
||||
renderKey.current === `editor-0` ? `editor-1` : `editor-0`;
|
||||
editor.state.current.ready = false;
|
||||
editor.setLoading(true);
|
||||
// editor.state.current.ready = false;
|
||||
//editor.setLoading(true);
|
||||
}, [editor]);
|
||||
|
||||
useEffect(() => {
|
||||
const sub = [
|
||||
eSubscribeEvent("webview_reset", onError),
|
||||
EV.subscribe(EVENTS.mediaAttachmentDownloaded, onMediaDownloaded)
|
||||
];
|
||||
|
||||
eSubscribeEvent("webview_reset", onError);
|
||||
EV.subscribe(EVENTS.mediaAttachmentDownloaded, onMediaDownloaded);
|
||||
return () => {
|
||||
sub.forEach((s) => s.unsubscribe());
|
||||
eUnSubscribeEvent("webview_reset", onError);
|
||||
EV.unsubscribe(EVENTS.mediaAttachmentDownloaded, onMediaDownloaded);
|
||||
};
|
||||
}, [onError, onMediaDownloaded]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
setImmediate(() => {
|
||||
onLoad && onLoad();
|
||||
});
|
||||
onLoad && onLoad();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [onLoad]);
|
||||
|
||||
@@ -196,8 +193,9 @@ const Editor = React.memo(
|
||||
autoManageStatusBarEnabled={false}
|
||||
onMessage={onMessage || undefined}
|
||||
/>
|
||||
<EditorOverlay editorId={editorId || ""} editor={editor} />
|
||||
<ReadonlyButton editor={editor} />
|
||||
{editorId === "shareEditor" ? null : (
|
||||
<AppSection editor={editor} editorId={editorId} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -207,6 +205,32 @@ const Editor = React.memo(
|
||||
|
||||
export default Editor;
|
||||
|
||||
let EditorOverlay: React.ElementType;
|
||||
let IconButton: React.ElementType;
|
||||
const AppSection = ({
|
||||
editor,
|
||||
editorId
|
||||
}: {
|
||||
editor: useEditorType;
|
||||
editorId: string;
|
||||
}) => {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
useEffect(() => {
|
||||
EditorOverlay = require("./loading.js").default;
|
||||
IconButton =
|
||||
require("../../components/ui/icon-button/index.tsx").IconButton;
|
||||
setLoaded(true);
|
||||
}, []);
|
||||
return loaded ? (
|
||||
<>
|
||||
{EditorOverlay ? (
|
||||
<EditorOverlay editorId={editorId || ""} editor={editor} />
|
||||
) : null}
|
||||
{editorId === "" ? <ReadonlyButton editor={editor} /> : null}
|
||||
</>
|
||||
) : null;
|
||||
};
|
||||
|
||||
const ReadonlyButton = ({ editor }: { editor: useEditorType }) => {
|
||||
const readonly = useEditorStore((state) => state.readonly);
|
||||
const keyboard = useKeyboard();
|
||||
@@ -220,7 +244,7 @@ const ReadonlyButton = ({ editor }: { editor: useEditorType }) => {
|
||||
}
|
||||
};
|
||||
|
||||
return readonly && !keyboard.keyboardShown ? (
|
||||
return readonly && IconButton && !keyboard.keyboardShown ? (
|
||||
<IconButton
|
||||
name="pencil-lock"
|
||||
type="grayBg"
|
||||
|
||||
@@ -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/dist/utils/filename";
|
||||
import { isImage } from "@notesnook/core/utils/filename";
|
||||
import { Platform } from "react-native";
|
||||
import RNFetchBlob from "react-native-blob-util";
|
||||
import DocumentPicker from "react-native-document-picker";
|
||||
|
||||
@@ -48,7 +48,7 @@ export type Settings = {
|
||||
keyboardShown?: boolean;
|
||||
doubleSpacedLines?: boolean;
|
||||
corsProxy: string;
|
||||
fontSize: number;
|
||||
fontSize: string;
|
||||
fontFamily: string;
|
||||
dateFormat: string;
|
||||
timeFormat: string;
|
||||
|
||||
@@ -189,10 +189,7 @@ export const useEditorEvents = (
|
||||
noToolbar: readonly || editorPropReadonly || noToolbar,
|
||||
doubleSpacedLines: doubleSpacedLines,
|
||||
corsProxy: corsProxy,
|
||||
fontSize:
|
||||
typeof defaultFontSize === "string"
|
||||
? parseInt(defaultFontSize)
|
||||
: defaultFontSize,
|
||||
fontSize: defaultFontSize,
|
||||
fontFamily: SettingsService.get().defaultFontFamily,
|
||||
dateFormat: db.settings?.getDateFormat(),
|
||||
timeFormat: db.settings?.getTimeFormat()
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EVENTS } from "@notesnook/core/common";
|
||||
import { useThemeEngineStore } from "@notesnook/theme";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import WebView from "react-native-webview";
|
||||
@@ -80,7 +80,6 @@ export const useEditor = (
|
||||
const lock = useRef(false);
|
||||
const loadedImages = useRef<{ [name: string]: boolean }>({});
|
||||
const lockedSessionId = useRef<string>();
|
||||
const loadingState = useRef<string>();
|
||||
|
||||
const postMessage = useCallback(
|
||||
async <T>(type: string, data: T, waitFor = 300) =>
|
||||
@@ -118,8 +117,9 @@ export const useEditor = (
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) {
|
||||
state.current.ready = false;
|
||||
setLoading(false);
|
||||
} else {
|
||||
state.current.ready = false;
|
||||
}
|
||||
}, [loading]);
|
||||
|
||||
@@ -363,9 +363,6 @@ export const useEditor = (
|
||||
isDefaultEditor && editorState.setCurrentlyEditingNote(item.id);
|
||||
currentNote.current && (await reset(false, false));
|
||||
await loadContent(item as NoteType);
|
||||
if (loadingState.current === currentContent.current?.data) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
!currentContent.current?.data ||
|
||||
currentContent.current?.data.length < 50000
|
||||
@@ -388,13 +385,11 @@ export const useEditor = (
|
||||
currentNote.current = item as NoteType;
|
||||
await commands.setStatus(getFormattedDate(item.dateEdited), "Saved");
|
||||
await postMessage(EditorEvents.title, item.title);
|
||||
loadingState.current = currentContent.current?.data;
|
||||
await postMessage(
|
||||
EditorEvents.html,
|
||||
currentContent.current?.data,
|
||||
10000
|
||||
);
|
||||
loadingState.current = undefined;
|
||||
useEditorStore.getState().setReadonly(item.readonly);
|
||||
await commands.setTags(currentNote.current);
|
||||
commands.setSettings();
|
||||
@@ -606,11 +601,9 @@ export const useEditor = (
|
||||
|
||||
const onReady = useCallback(async () => {
|
||||
if (!(await isEditorLoaded(editorRef, sessionIdRef.current))) {
|
||||
eSendEvent("webview_reset", "onReady");
|
||||
return false;
|
||||
eSendEvent("webview_reset");
|
||||
} else {
|
||||
isDefaultEditor && restoreEditorState();
|
||||
return true;
|
||||
}
|
||||
}, [isDefaultEditor, restoreEditorState]);
|
||||
|
||||
@@ -623,18 +616,15 @@ export const useEditor = (
|
||||
isDefaultEditor ? insets : { top: 0, left: 0, right: 0, bottom: 0 }
|
||||
);
|
||||
await commands.setSessionId(sessionIdRef.current);
|
||||
await onReady();
|
||||
state.current.ready = true;
|
||||
await commands.setSettings();
|
||||
timers.current["editor:loaded"] = setTimeout(async () => {
|
||||
if (!state.current.ready && (await onReady())) {
|
||||
state.current.ready = true;
|
||||
}
|
||||
if (currentNote.current) {
|
||||
loadNote({ ...currentNote.current, forced: true });
|
||||
} else {
|
||||
await commands.setPlaceholder(placeholderTip.current);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (currentNote.current) {
|
||||
loadNote({ ...currentNote.current, forced: true });
|
||||
} else {
|
||||
await commands.setPlaceholder(placeholderTip.current);
|
||||
}
|
||||
}, 1000);
|
||||
}, [
|
||||
onReady,
|
||||
postMessage,
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { db } from "../../common/database";
|
||||
import DelayLayout from "../../components/delay-layout";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import React from "react";
|
||||
import NotesPage, { PLACEHOLDER_DATA } from ".";
|
||||
import { db } from "../../common/database";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import React from "react";
|
||||
import NotesPage, { PLACEHOLDER_DATA } from ".";
|
||||
import { db } from "../../common/database";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import React from "react";
|
||||
import NotesPage, { PLACEHOLDER_DATA } from ".";
|
||||
import { db } from "../../common/database";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import React from "react";
|
||||
import NotesPage, { PLACEHOLDER_DATA } from ".";
|
||||
import { db } from "../../common/database";
|
||||
|
||||
@@ -66,7 +66,6 @@ export const Reminders = ({
|
||||
});
|
||||
|
||||
SearchService.prepareSearch = prepareSearch;
|
||||
useNavigationStore.getState().setButtonAction(PLACEHOLDER_DATA.action);
|
||||
return !prev?.current;
|
||||
},
|
||||
onBlur: () => false,
|
||||
|
||||
@@ -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/dist/logger";
|
||||
import { format, LogLevel, logManager } from "@notesnook/core/logger";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { FlatList, Platform, TouchableOpacity, View } from "react-native";
|
||||
import * as ScopedStorage from "react-native-scoped-storage";
|
||||
|
||||
@@ -92,8 +92,7 @@ export function SettingsPicker<T>({
|
||||
borderRadius: 5,
|
||||
backgroundColor: colors.primary.background,
|
||||
width: width,
|
||||
marginTop: 60,
|
||||
overflow: "hidden"
|
||||
marginTop: 60
|
||||
}}
|
||||
onRequestClose={() => {
|
||||
menuRef.current?.hide();
|
||||
|
||||
@@ -21,10 +21,10 @@ import { db } from "../../../common/database";
|
||||
import { ToastEvent } from "../../../services/event-manager";
|
||||
import SettingsService from "../../../services/settings";
|
||||
import { useSettingStore } from "../../../stores/use-setting-store";
|
||||
import { MenuItemsList } from "../../../utils/menu-items";
|
||||
import { MenuItemsList } from "../../../utils/constants";
|
||||
import { createSettingsPicker } from ".";
|
||||
import { getFontById, getFonts } from "@notesnook/editor/dist/utils/font";
|
||||
import { DATE_FORMATS, TIME_FORMATS } from "@notesnook/core/dist/common";
|
||||
import { DATE_FORMATS, TIME_FORMATS } from "@notesnook/core/common";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export const FontPicker = createSettingsPicker({
|
||||
|
||||
@@ -972,7 +972,7 @@ export const settingsGroups: SettingSection[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "reminder-sound-ios",
|
||||
id: "reminder-sound",
|
||||
type: "screen",
|
||||
name: "Change notification sound",
|
||||
description:
|
||||
@@ -984,7 +984,7 @@ export const settingsGroups: SettingSection[] = [
|
||||
(Platform.OS === "android" && Platform.Version > 25)
|
||||
},
|
||||
{
|
||||
id: "reminder-sound-android",
|
||||
id: "reminder-sound",
|
||||
name: "Change notification sound",
|
||||
description:
|
||||
"Set the notification sound for reminder notifications",
|
||||
|
||||
@@ -51,11 +51,11 @@ import { ToastEvent, presentSheet } from "../../services/event-manager";
|
||||
import { useThemeStore } from "../../stores/use-theme-store";
|
||||
import { SIZE } from "../../utils/size";
|
||||
import { getElevationStyle } from "../../utils/elevation";
|
||||
import { MenuItemsList } from "../../utils/menu-items";
|
||||
import { MenuItemsList } from "../../utils/constants";
|
||||
import { IconButton } from "../../components/ui/icon-button";
|
||||
import { PressableButton } from "../../components/ui/pressable";
|
||||
|
||||
const THEME_SERVER_URL = "https://themes-api.notesnook.com";
|
||||
const THEME_SERVER_URL = "https://themes.notesnook.com";
|
||||
//@ts-ignore
|
||||
export const themeTrpcClient = createTRPCProxyClient<ThemesRouter>({
|
||||
links: [
|
||||
@@ -103,12 +103,10 @@ function ThemeSelector() {
|
||||
}
|
||||
);
|
||||
|
||||
const select = (item: Partial<ThemeMetadata>, fromFile?: boolean) => {
|
||||
const select = (item: Partial<ThemeMetadata>) => {
|
||||
presentSheet({
|
||||
context: "theme-details",
|
||||
component: (ref, close) => (
|
||||
<ThemeSetter close={close} theme={item} fromFile={fromFile} />
|
||||
)
|
||||
component: (ref, close) => <ThemeSetter close={close} theme={item} />
|
||||
});
|
||||
};
|
||||
|
||||
@@ -329,6 +327,7 @@ function ThemeSelector() {
|
||||
) || []
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SheetProvider context="theme-details" />
|
||||
@@ -398,17 +397,16 @@ function ThemeSelector() {
|
||||
icon="folder"
|
||||
fontSize={SIZE.xs}
|
||||
onPress={() => {
|
||||
DocumentPicker.pickSingle({
|
||||
allowMultiSelection: false
|
||||
}).then((r) => {
|
||||
DocumentPicker.pickSingle().then((r) => {
|
||||
fetch(r.uri).then(async (response) => {
|
||||
const json = await response.json();
|
||||
console.log(json);
|
||||
const result = validateTheme(json);
|
||||
if (result.error) {
|
||||
ToastEvent.error(new Error(result.error));
|
||||
return;
|
||||
}
|
||||
select(json, true);
|
||||
select(json);
|
||||
});
|
||||
});
|
||||
}}
|
||||
@@ -447,22 +445,6 @@ function ThemeSelector() {
|
||||
)}
|
||||
</View>
|
||||
}
|
||||
ListFooterComponent={
|
||||
themes.isError ? (
|
||||
<View
|
||||
style={{
|
||||
height: 100,
|
||||
width: "100%",
|
||||
justifyContent: "center",
|
||||
alignItems: "center"
|
||||
}}
|
||||
>
|
||||
<Paragraph color={colors.error.paragraph}>
|
||||
Error loading themes. {themes.error.message}.
|
||||
</Paragraph>
|
||||
</View>
|
||||
) : null
|
||||
}
|
||||
estimatedItemSize={200}
|
||||
renderItem={renderItem}
|
||||
onEndReachedThreshold={0.1}
|
||||
@@ -501,12 +483,10 @@ export default function ThemeSelectorWithQueryClient() {
|
||||
|
||||
const ThemeSetter = ({
|
||||
theme,
|
||||
close,
|
||||
fromFile
|
||||
close
|
||||
}: {
|
||||
theme: Partial<CompiledThemeDefinition>;
|
||||
close?: (ctx?: string) => void;
|
||||
fromFile?: boolean;
|
||||
}) => {
|
||||
const [darkTheme, lightTheme] = useThemeStore((state) => [
|
||||
state.darkTheme,
|
||||
@@ -522,13 +502,14 @@ const ThemeSetter = ({
|
||||
if (!theme.id) return;
|
||||
try {
|
||||
const user = await db.user?.getUser();
|
||||
const fullTheme = fromFile
|
||||
const fullTheme = theme.scopes
|
||||
? (theme as ThemeDefinition)
|
||||
: await themeTrpcClient.installTheme.query({
|
||||
compatibilityVersion: THEME_COMPATIBILITY_VERSION,
|
||||
id: theme.id,
|
||||
userId: user?.id
|
||||
});
|
||||
|
||||
if (!fullTheme) return;
|
||||
theme.colorScheme === "dark"
|
||||
? useThemeStore.getState().setDarkTheme(fullTheme)
|
||||
|
||||
@@ -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/dist/utils/event-manager";
|
||||
import EventManager from "@notesnook/core/utils/event-manager";
|
||||
import Clipboard from "@react-native-clipboard/clipboard";
|
||||
import { RefObject } from "react";
|
||||
import { ActionSheetRef } from "react-native-actions-sheet";
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { CHECK_IDS } from "@notesnook/core/common";
|
||||
import React from "react";
|
||||
import { Platform } from "react-native";
|
||||
import Config from "react-native-config";
|
||||
|
||||
@@ -166,5 +166,4 @@ export const SettingsService = {
|
||||
resetSettings
|
||||
};
|
||||
|
||||
init();
|
||||
export default SettingsService;
|
||||
|
||||
@@ -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/dist/common";
|
||||
import { EVENTS } from "@notesnook/core/common";
|
||||
import NetInfo from "@react-native-community/netinfo";
|
||||
import { db } from "../common/database";
|
||||
import { DatabaseLogger } from "../common/database/index";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import create, { State } from "zustand";
|
||||
import { db } from "../common/database";
|
||||
import { NoteType } from "../utils/types";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import create, { State } from "zustand";
|
||||
import { db } from "../common/database";
|
||||
import { NotebookType } from "../utils/types";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import create, { State } from "zustand";
|
||||
import { db } from "../common/database";
|
||||
import { NoteType } from "../utils/types";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupReminders } from "@notesnook/core/utils/grouping";
|
||||
import create, { State } from "zustand";
|
||||
import { db } from "../common/database";
|
||||
import { Reminder } from "../services/notifications";
|
||||
|
||||
@@ -69,7 +69,7 @@ export type Settings = {
|
||||
corsProxy: string;
|
||||
disableRealtimeSync?: boolean;
|
||||
notificationSound?: Sound & { platform: PlatformOSType };
|
||||
defaultFontSize: number;
|
||||
defaultFontSize: string;
|
||||
defaultFontFamily: string;
|
||||
colorScheme: "dark" | "light";
|
||||
lighTheme: ThemeDefinition;
|
||||
@@ -149,7 +149,7 @@ export const defaultSettings: SettingStore["settings"] = {
|
||||
reminderNotificationMode: "urgent",
|
||||
notificationSound: undefined,
|
||||
defaultFontFamily: "sans-serif",
|
||||
defaultFontSize: 16,
|
||||
defaultFontSize: "16",
|
||||
colorScheme: "light",
|
||||
lighTheme: ThemeLight,
|
||||
darkTheme: ThemeDark
|
||||
|
||||
@@ -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/dist/types";
|
||||
import { groupArray } from "@notesnook/core/dist/utils/grouping";
|
||||
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";
|
||||
|
||||
@@ -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/dist/utils/grouping";
|
||||
import { groupArray } from "@notesnook/core/utils/grouping";
|
||||
import create, { State } from "zustand";
|
||||
import { db } from "../common/database";
|
||||
import { TrashType } from "../utils/types";
|
||||
|
||||
@@ -100,6 +100,49 @@ export const SUBSCRIPTION_PROVIDER = {
|
||||
}
|
||||
};
|
||||
|
||||
export const MenuItemsList = [
|
||||
{
|
||||
name: "Notes",
|
||||
icon: "home-variant-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Notebooks",
|
||||
icon: "book-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Favorites",
|
||||
icon: "star-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Tags",
|
||||
icon: "pound",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Reminders",
|
||||
icon: "bell",
|
||||
close: true,
|
||||
isBeta: true
|
||||
},
|
||||
{
|
||||
name: "Monographs",
|
||||
icon: "text-box-multiple-outline",
|
||||
close: true,
|
||||
func: () => {
|
||||
const Monographs = require("../screens/notes/monographs").Monographs;
|
||||
Monographs.navigate();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Trash",
|
||||
icon: "delete-outline",
|
||||
close: true
|
||||
}
|
||||
];
|
||||
|
||||
export const BUTTON_TYPES = {
|
||||
transparent: {
|
||||
primary: "transparent",
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
export const MenuItemsList = [
|
||||
{
|
||||
name: "Notes",
|
||||
icon: "home-variant-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Notebooks",
|
||||
icon: "book-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Favorites",
|
||||
icon: "star-outline",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Tags",
|
||||
icon: "pound",
|
||||
close: true
|
||||
},
|
||||
{
|
||||
name: "Reminders",
|
||||
icon: "bell",
|
||||
close: true,
|
||||
isBeta: true
|
||||
},
|
||||
{
|
||||
name: "Monographs",
|
||||
icon: "text-box-multiple-outline",
|
||||
close: true,
|
||||
func: () => {
|
||||
const Monographs = require("../screens/notes/monographs").Monographs;
|
||||
Monographs.navigate();
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Trash",
|
||||
icon: "delete-outline",
|
||||
close: true
|
||||
}
|
||||
];
|
||||
@@ -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/dist/utils/filename";
|
||||
import { isImage } from "@notesnook/core/utils/filename";
|
||||
import { Platform } from "react-native";
|
||||
import RNFetchBlob from "react-native-blob-util";
|
||||
import { db } from "../common/database";
|
||||
|
||||
16
apps/mobile/e2e/config.json
Normal file
16
apps/mobile/e2e/config.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"testEnvironment": "./environment",
|
||||
"testRunner": "jest-circus/runner",
|
||||
"setupFilesAfterEnv": ["./setup.ts"],
|
||||
"testTimeout": 120000,
|
||||
"testRegex": "\\.e2e\\.js$",
|
||||
"reporters": ["detox/runners/jest/streamlineReporter"],
|
||||
"transformIgnorePatterns": ["<rootDir>/node_modules/"],
|
||||
"transform": {
|
||||
"^.+\\.(js|jsx|ts|tsx)$": [
|
||||
"babel-jest",
|
||||
{ "configFile": "../native/babel.config.js" }
|
||||
]
|
||||
},
|
||||
"verbose": true
|
||||
}
|
||||
57
apps/mobile/e2e/environment.js
Normal file
57
apps/mobile/e2e/environment.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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/>.
|
||||
*/
|
||||
|
||||
const {
|
||||
DetoxCircusEnvironment,
|
||||
SpecReporter,
|
||||
WorkerAssignReporter
|
||||
} = require("detox/runners/jest-circus");
|
||||
|
||||
const sleep = (duration) =>
|
||||
new Promise((resolve) =>
|
||||
setTimeout(() => {
|
||||
resolve();
|
||||
}, duration)
|
||||
);
|
||||
|
||||
class CustomDetoxEnvironment extends DetoxCircusEnvironment {
|
||||
constructor(config, context) {
|
||||
super(config, context);
|
||||
|
||||
// Can be safely removed, if you are content with the default value (=300000ms)
|
||||
this.initTimeout = 300000;
|
||||
|
||||
// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
|
||||
// This is strictly optional.
|
||||
this.registerListeners({
|
||||
SpecReporter,
|
||||
WorkerAssignReporter
|
||||
});
|
||||
}
|
||||
|
||||
async initDetox() {
|
||||
const instance = await this.detox.init(undefined, { launchApp: false });
|
||||
await sleep(10000);
|
||||
await instance.device.reverseTcpPort(8081); // added this line
|
||||
await instance.device.launchApp();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CustomDetoxEnvironment;
|
||||
@@ -1,20 +0,0 @@
|
||||
/** @type {import('@jest/types').Config.InitialOptions} */
|
||||
module.exports = {
|
||||
rootDir: "..",
|
||||
testMatch: ["<rootDir>/e2e/**/*.e2e.js"],
|
||||
testTimeout: 120000,
|
||||
maxWorkers: 1,
|
||||
setupFilesAfterEnv: ["./e2e/setup.js"],
|
||||
globalSetup: "detox/runners/jest/globalSetup",
|
||||
globalTeardown: "detox/runners/jest/globalTeardown",
|
||||
reporters: ["detox/runners/jest/reporter"],
|
||||
testEnvironment: "detox/runners/jest/testEnvironment",
|
||||
verbose: true,
|
||||
transform: {
|
||||
"^.+\\.(js|jsx|ts|tsx)$": [
|
||||
"babel-jest",
|
||||
{ configFile: "../native/babel.config.js" }
|
||||
]
|
||||
},
|
||||
transformIgnorePatterns: ["<rootDir>/../node_modules/"]
|
||||
};
|
||||
@@ -1,7 +0,0 @@
|
||||
import { device } from "detox";
|
||||
|
||||
beforeAll(async () => {
|
||||
await device.launchApp();
|
||||
});
|
||||
|
||||
export {};
|
||||
@@ -17,8 +17,10 @@ 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 { Blockquote } from "./blockquote";
|
||||
import { device } from "detox";
|
||||
|
||||
export * from "./blockquote";
|
||||
beforeAll(async () => {
|
||||
await device.launchApp();
|
||||
});
|
||||
|
||||
export default Blockquote;
|
||||
export {};
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 73 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 73 KiB |
@@ -35,7 +35,7 @@ async function sortBy(sorting, elementText = "Default") {
|
||||
}
|
||||
|
||||
describe("Sort & filter", () => {
|
||||
it("Sort by date-edited/date-created", async () => {
|
||||
it.only("Sort by date-edited/date-created", async () => {
|
||||
await prepare();
|
||||
let webview = web(by.id(notesnook.editor.id));
|
||||
await createNote("Note 1", "Note 1");
|
||||
@@ -52,11 +52,11 @@ describe("Sort & filter", () => {
|
||||
await device.pressBack();
|
||||
await sortBy("Date created");
|
||||
await tapById(notesnook.listitem.menu);
|
||||
//await visibleByText("Note 2");
|
||||
await visibleByText("Note 2");
|
||||
await device.pressBack();
|
||||
await sortBy("Date edited");
|
||||
await tapById(notesnook.listitem.menu);
|
||||
//await visibleByText("Edited Note 1");
|
||||
await visibleByText("Edited Note 1");
|
||||
await device.pressBack();
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ import { sleep } from "./utils";
|
||||
|
||||
async function lockNote() {
|
||||
await tapById(notesnook.listitem.menu);
|
||||
await tapById("icon-lock-unlock");
|
||||
await tapById("icon-Vault");
|
||||
await sleep(1000);
|
||||
await visibleByText("Lock");
|
||||
await elementById(notesnook.ids.dialogs.vault.pwd).typeText("1234");
|
||||
@@ -46,7 +46,7 @@ async function lockNote() {
|
||||
|
||||
async function removeFromVault() {
|
||||
await tapById(notesnook.listitem.menu);
|
||||
await tapById("icon-lock-unlock");
|
||||
await tapById("icon-Vault");
|
||||
await sleep(1000);
|
||||
await elementById(notesnook.ids.dialogs.vault.pwd).typeText("1234");
|
||||
await tapByText("Unlock");
|
||||
@@ -127,7 +127,7 @@ describe("VAULT", () => {
|
||||
await notVisibleById(notesnook.listitem.menu);
|
||||
});
|
||||
|
||||
it("Add a note to vault", async () => {
|
||||
it.only("Add a note to vault", async () => {
|
||||
await prepare();
|
||||
await createNote();
|
||||
await lockNote();
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/** @type {Detox.DetoxConfig} */
|
||||
module.exports = {
|
||||
testRunner: {
|
||||
args: {
|
||||
'$0': 'jest',
|
||||
config: '../e2e/jest.config.js'
|
||||
},
|
||||
jest: {
|
||||
setupTimeout: 120000
|
||||
}
|
||||
},
|
||||
apps: {
|
||||
'ios.debug': {
|
||||
type: 'ios.app',
|
||||
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Notesnook.app',
|
||||
build: 'xcodebuild -workspace ios/Notesnook.xcworkspace -scheme YOUR_APP -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build'
|
||||
},
|
||||
'ios.release': {
|
||||
type: 'ios.app',
|
||||
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Notesnook.app',
|
||||
build: 'xcodebuild -workspace ios/Notesnook.xcworkspace -scheme YOUR_APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build'
|
||||
},
|
||||
'android.debug': {
|
||||
type: 'android.apk',
|
||||
"binaryPath": "android/app/build/outputs/apk/debug/app-x86_64-debug.apk",
|
||||
"testBinaryPath": "android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk",
|
||||
"build": "cd android ; ENVFILE=.env.test ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
|
||||
reversePorts: [
|
||||
8081
|
||||
]
|
||||
},
|
||||
'android.release': {
|
||||
type: 'android.apk',
|
||||
"binaryPath": "android/app/build/outputs/apk/release/app-x86_64-release.apk",
|
||||
"testBinaryPath": "android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk",
|
||||
"build": "cd android ; ENVFILE=.env.test ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd .."
|
||||
}
|
||||
},
|
||||
devices: {
|
||||
simulator: {
|
||||
type: 'ios.simulator',
|
||||
device: {
|
||||
type: 'iPhone 12'
|
||||
}
|
||||
},
|
||||
attached: {
|
||||
type: 'android.attached',
|
||||
device: {
|
||||
adbName: '.*'
|
||||
}
|
||||
},
|
||||
emulator: {
|
||||
type: 'android.emulator',
|
||||
device: {
|
||||
avdName: 'Pixel_5_API_31'
|
||||
}
|
||||
}
|
||||
},
|
||||
configurations: {
|
||||
'ios.sim.debug': {
|
||||
device: 'simulator',
|
||||
app: 'ios.debug'
|
||||
},
|
||||
'ios.sim.release': {
|
||||
device: 'simulator',
|
||||
app: 'ios.release'
|
||||
},
|
||||
'android.att.debug': {
|
||||
device: 'attached',
|
||||
app: 'android.debug'
|
||||
},
|
||||
'android.att.release': {
|
||||
device: 'attached',
|
||||
app: 'android.release'
|
||||
},
|
||||
'android.emu.debug': {
|
||||
device: 'emulator',
|
||||
app: 'android.debug'
|
||||
},
|
||||
'android.emu.release': {
|
||||
device: 'emulator',
|
||||
app: 'android.release'
|
||||
}
|
||||
}
|
||||
};
|
||||
52
apps/mobile/native/.detoxrc.json
Normal file
52
apps/mobile/native/.detoxrc.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"testRunner": "jest",
|
||||
"runnerConfig": "../e2e/config.json",
|
||||
"devices": {
|
||||
"emulator": {
|
||||
"type": "android.emulator",
|
||||
"device": {
|
||||
"avdName": "Pixel_5_API_31"
|
||||
}
|
||||
},
|
||||
"simulator": {
|
||||
"type": "ios.simulator",
|
||||
"device": {
|
||||
"type": "iPhone 8"
|
||||
}
|
||||
}
|
||||
},
|
||||
"apps": {
|
||||
"android.debug": {
|
||||
"type": "android.apk",
|
||||
"binaryPath": "android/app/build/outputs/apk/debug/app-x86_64-debug.apk",
|
||||
"testBinaryPath": "android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk",
|
||||
"build": "cd android ; ENVFILE=.env.test ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .."
|
||||
},
|
||||
"android.release": {
|
||||
"type": "android.apk",
|
||||
"binaryPath": "android/app/build/outputs/apk/release/app-x86_64-release.apk",
|
||||
"testBinaryPath": "android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk",
|
||||
"build": "cd android ; ENVFILE=.env.test ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release ; cd .."
|
||||
},
|
||||
"ios.release": {
|
||||
"name": "Notesnook",
|
||||
"type": "ios.app",
|
||||
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/Notesnook.app",
|
||||
"build": "ENVFILE=.env.test xcodebuild -workspace ios/Notesnook.xcworkspace -scheme NotesnookRelease -sdk iphonesimulator -derivedDataPath ios/build"
|
||||
}
|
||||
},
|
||||
"configurations": {
|
||||
"android.emu.debug": {
|
||||
"app": "android.debug",
|
||||
"device": "emulator"
|
||||
},
|
||||
"android.emu.release": {
|
||||
"app": "android.release",
|
||||
"device": "emulator"
|
||||
},
|
||||
"ios.sim.release": {
|
||||
"device": "simulator",
|
||||
"app": "ios.release"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ android {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
multiDexEnabled true
|
||||
versionCode 2057
|
||||
versionCode 2055
|
||||
versionName getNpmVersion()
|
||||
testBuildType System.getProperty('testBuildType', 'debug')
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
@@ -220,31 +220,24 @@ dependencies {
|
||||
}
|
||||
|
||||
|
||||
|
||||
task deleteFiles(type: Delete) {
|
||||
delete './src/main/assets/static'
|
||||
}
|
||||
|
||||
task copyEditorBundle(type: Copy) {
|
||||
task copyFiles(type: Copy) {
|
||||
from '../../../../../packages/editor-mobile/build.bundle'
|
||||
into './src/main/assets'
|
||||
}
|
||||
|
||||
task copyPlainEditorBundle(type: Copy) {
|
||||
from '../../ios/extension.bundle'
|
||||
into './src/main/assets'
|
||||
}
|
||||
|
||||
task copyFontFiles(type: Copy) {
|
||||
from '../../fonts'
|
||||
into './src/main/assets/fonts'
|
||||
}
|
||||
copyFiles.dependsOn(deleteFiles)
|
||||
preBuild.dependsOn(copyFiles)
|
||||
|
||||
|
||||
copyEditorBundle.dependsOn(deleteFiles)
|
||||
copyFontFiles.dependsOn(copyEditorBundle);
|
||||
copyPlainEditorBundle.dependsOn(copyFontFiles);
|
||||
preBuild.dependsOn(copyPlainEditorBundle)
|
||||
project.ext.vectoricons = [
|
||||
iconFontNames: ['MaterialCommunityIcons.ttf' ],
|
||||
iconFontsDir: "../../../node_modules/react-native-vector-icons/Fonts"
|
||||
]
|
||||
|
||||
apply from: "../../../node_modules/react-native-vector-icons/fonts.gradle"
|
||||
|
||||
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||
|
||||
|
||||
@@ -14,11 +14,17 @@ import androidx.test.rule.ActivityTestRule;
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
@LargeTest
|
||||
public class DetoxTest {
|
||||
@Rule // (2)
|
||||
// Replace 'MainActivity' with the value of android:name entry in
|
||||
// <activity> in AndroidManifest.xml
|
||||
@Rule
|
||||
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
|
||||
|
||||
@Test
|
||||
public void runDetoxTests() {
|
||||
// This is optional - in case you've decided to integrate TestButler
|
||||
// See https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md#8-test-butler-support-optional
|
||||
//TestButlerProbe.assertReadyIfInstalled();
|
||||
|
||||
DetoxConfig detoxConfig = new DetoxConfig();
|
||||
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
|
||||
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
|
||||
|
||||
@@ -56,7 +56,6 @@
|
||||
android:theme="@style/BootTheme"
|
||||
android:largeHeap="true"
|
||||
android:supportsRtl="false"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
tools:replace="android:supportsRtl">
|
||||
|
||||
<receiver android:exported="false" android:name=".NoteWidget">
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<domain-config cleartextTrafficPermitted="true">
|
||||
<domain includeSubdomains="true">10.0.2.2</domain>
|
||||
<domain includeSubdomains="true">localhost</domain>
|
||||
</domain-config>
|
||||
</network-security-config>
|
||||
@@ -27,14 +27,3 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
// All of Detox' artifacts are provided via the npm module
|
||||
url "$rootDir/../../node_modules/detox/Detox-android"
|
||||
}
|
||||
|
||||
maven { url 'https://www.jitpack.io' }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,3 @@
|
||||
- Added support for custom themes
|
||||
- Syntax highlighting and rendered Math in exports
|
||||
- Improved copy/pasting to and from Notesnook
|
||||
- Support copying link & link text in directly from the Link toolbar
|
||||
- Many other bug fixes and performance improvements
|
||||
|
||||
Thank you for using Notesnook!
|
||||
- Bug fixes and performance improvements
|
||||
|
||||
Thank you for using Notesnook!
|
||||
@@ -1,19 +1,18 @@
|
||||
const env = process.env.BABEL_ENV || process.env.NODE_ENV;
|
||||
let env = process.env.BABEL_ENV;
|
||||
const configs = {
|
||||
env: {
|
||||
development: {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-named-capturing-groups-regex',
|
||||
'react-native-reanimated/plugin',
|
||||
'react-native-reanimated/plugin'
|
||||
]
|
||||
},
|
||||
test: {
|
||||
presets: ['module:metro-react-native-babel-preset'],
|
||||
plugins: [
|
||||
'@babel/plugin-transform-named-capturing-groups-regex',
|
||||
'react-native-reanimated/plugin',
|
||||
["@babel/plugin-transform-private-methods", { "loose": true }]
|
||||
'react-native-reanimated/plugin'
|
||||
]
|
||||
},
|
||||
production: {
|
||||
@@ -21,7 +20,7 @@ const configs = {
|
||||
plugins: [
|
||||
'transform-remove-console',
|
||||
'@babel/plugin-transform-named-capturing-groups-regex',
|
||||
'react-native-reanimated/plugin',
|
||||
'react-native-reanimated/plugin'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
import './globals.js';
|
||||
import React from 'react';
|
||||
import { AppRegistry, Platform } from 'react-native';
|
||||
import 'react-native-get-random-values';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
import "./globals"
|
||||
import '../app/common/logger/index';
|
||||
|
||||
|
||||
const ShareProvider = () => {
|
||||
NotesnookShare = require('../share/index').default;
|
||||
@@ -16,6 +16,5 @@ const ShareProvider = () => {
|
||||
<NotesnookShare quicknote={false} />
|
||||
);
|
||||
};
|
||||
|
||||
AppRegistry.registerComponent('NotesnookShare', () => ShareProvider);
|
||||
|
||||
|
||||
@@ -51,8 +51,6 @@ const ShareProvider = () => {
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
AppRegistry.registerComponent('NotesnookShare', () => ShareProvider);
|
||||
|
||||
const QuickNoteProvider = () => {
|
||||
|
||||
@@ -3,32 +3,26 @@
|
||||
#import <React/RCTBundleURLProvider.h>
|
||||
#import <React/RCTRootView.h>
|
||||
#import <React/RCTLog.h>
|
||||
#import <React/RCTEventEmitter.h>
|
||||
|
||||
@interface ShareViewController : ReactNativeShareExtension
|
||||
@end
|
||||
|
||||
@implementation ShareViewController
|
||||
|
||||
@synthesize bridge = _bridge;
|
||||
@synthesize callableJSModules = _callableJSModules;
|
||||
|
||||
+ (BOOL)requiresMainQueueSetup {
|
||||
return true;
|
||||
}
|
||||
|
||||
int rootViewTag = 0;
|
||||
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
- (UIView*) shareView {
|
||||
NSURL *jsCodeLocation;
|
||||
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
|
||||
|
||||
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
|
||||
moduleName:@"NotesnookShare"
|
||||
initialProperties:nil
|
||||
launchOptions:nil];
|
||||
rootViewTag = rootView.tag;
|
||||
rootView.window.backgroundColor =[UIColor clearColor];
|
||||
rootView.layer.shadowOpacity = 0;
|
||||
rootView.backgroundColor = [UIColor clearColor];
|
||||
@@ -39,5 +33,4 @@ RCT_EXPORT_MODULE();
|
||||
return rootView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -15,12 +15,16 @@
|
||||
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
2DCD954D1E0B4F2C00145EB5 /* NotesnookTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* NotesnookTests.m */; };
|
||||
6510626F27042891009661C3 /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012F27019F7700A43C51 /* OpenSans-Regular.ttf */; };
|
||||
6510627527042893009661C3 /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012F27019F7700A43C51 /* OpenSans-Regular.ttf */; };
|
||||
6510627627042895009661C3 /* OpenSans-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012E27019F6E00A43C51 /* OpenSans-SemiBold.ttf */; };
|
||||
6510627727042896009661C3 /* OpenSans-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012E27019F6E00A43C51 /* OpenSans-SemiBold.ttf */; };
|
||||
6510E6D72877215700DACAA9 /* build.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6510E6D62877215700DACAA9 /* build.bundle */; };
|
||||
6510E6D82877215700DACAA9 /* build.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6510E6D62877215700DACAA9 /* build.bundle */; };
|
||||
6515C42F2580AA3000E83E39 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6515C42E2580AA2F00E83E39 /* StoreKit.framework */; };
|
||||
6529A13E279BC4C70048D4A8 /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6529A13D279BC4C70048D4A8 /* BootSplash.storyboard */; };
|
||||
6593E4A3281C345400492C50 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6593E4A2281C345400492C50 /* AppDelegate.mm */; };
|
||||
659670B22A2754FD00C5D2AF /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 659670B12A2754FD00C5D2AF /* OpenSans-Bold.ttf */; };
|
||||
659670B32A2754FD00C5D2AF /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 659670B12A2754FD00C5D2AF /* OpenSans-Bold.ttf */; };
|
||||
659BE46725E11A5100E05671 /* notesnook-text.png in Resources */ = {isa = PBXBuildFile; fileRef = 659BE46625E11A5100E05671 /* notesnook-text.png */; };
|
||||
65AA857925E6DDEC00772A01 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65AA857825E6DDEC00772A01 /* WidgetKit.framework */; };
|
||||
65AA857B25E6DDEC00772A01 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65AA857A25E6DDEC00772A01 /* SwiftUI.framework */; };
|
||||
@@ -31,13 +35,12 @@
|
||||
65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 65B5014525A672B200E2D264 /* MainInterface.storyboard */; };
|
||||
65B5014B25A672B200E2D264 /* Make Note.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 65B5014025A672B200E2D264 /* Make Note.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
65B5020325A6756700E2D264 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65B5020225A6756700E2D264 /* File.swift */; };
|
||||
65C149872A61151B005C40F1 /* extension.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 65C149862A61151B005C40F1 /* extension.bundle */; };
|
||||
65C400DE2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65C400DD2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf */; };
|
||||
65C400DF2A80B6B600AA3DF5 /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65C400DD2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf */; };
|
||||
65D145C529DC30470056FE7D /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65D145C429DC30470056FE7D /* MaterialCommunityIcons.ttf */; };
|
||||
65D145C629DC30470056FE7D /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 65D145C429DC30470056FE7D /* MaterialCommunityIcons.ttf */; };
|
||||
65E0340B257B9FF100793428 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65E0340A257B9FF100793428 /* File.swift */; };
|
||||
7C72B5EA418785B334F3B5EB /* libPods-Notesnook-Make Note.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35547D7C07E83F889159A73D /* libPods-Notesnook-Make Note.a */; };
|
||||
87CE5B71DC72F3D95B7B1AA5 /* libPods-Notesnook-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A03E3F5851D27269540E147C /* libPods-Notesnook-tvOSTests.a */; };
|
||||
A79A93DC9D0CAE8703462151 /* libPods-Notesnook-NotesnookTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 068FA9BDFA207A50B0A9E597 /* libPods-Notesnook-NotesnookTests.a */; };
|
||||
C619D096A9DE2070DBEAC70F /* libPods-Make Note.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C4AF691C324D95337F2FB0A /* libPods-Make Note.a */; };
|
||||
F50BF8BC21F8B58EB2B5A31A /* libPods-Notesnook-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 16C0296DE7A2B4102817F5C1 /* libPods-Notesnook-tvOS.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -104,10 +107,10 @@
|
||||
279A4325E1D27BD3E720F35B /* Pods-Notesnook-Make Note.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Notesnook-Make Note.debug.xcconfig"; path = "Target Support Files/Pods-Notesnook-Make Note/Pods-Notesnook-Make Note.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
2D02E47B1E0B4A5D006451C7 /* Notesnook-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Notesnook-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2D02E4901E0B4A5D006451C7 /* Notesnook-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Notesnook-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
35547D7C07E83F889159A73D /* libPods-Notesnook-Make Note.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Notesnook-Make Note.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
41D57E9831C724F59F18FBAE /* libPods-Notesnook-Add to Notes.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Notesnook-Add to Notes.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
47AE097A087A651BD60CAD7B /* Pods-Notesnook-Make Note.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Notesnook-Make Note.release.xcconfig"; path = "Target Support Files/Pods-Notesnook-Make Note/Pods-Notesnook-Make Note.release.xcconfig"; sourceTree = "<group>"; };
|
||||
4BD34AE0C0FD2416E48803B8 /* libPods-Notesnook.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Notesnook.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
4C4AF691C324D95337F2FB0A /* libPods-Make Note.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Make Note.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6510E6D62877215700DACAA9 /* build.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = build.bundle; path = "../../../../packages/editor-mobile/build.bundle"; sourceTree = "<group>"; };
|
||||
6515C42E2580AA2F00E83E39 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
|
||||
6529A13D279BC4C70048D4A8 /* BootSplash.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = BootSplash.storyboard; path = Notesnook/BootSplash.storyboard; sourceTree = "<group>"; };
|
||||
@@ -131,8 +134,6 @@
|
||||
65B501AA25A6733400E2D264 /* Make Note.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Make Note.entitlements"; sourceTree = "<group>"; };
|
||||
65B5020125A6756700E2D264 /* Make Note-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Make Note-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
65B5020225A6756700E2D264 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
|
||||
65C149862A61151B005C40F1 /* extension.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = extension.bundle; sourceTree = "<group>"; };
|
||||
65C400DD2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = MaterialCommunityIcons.ttf; path = ../fonts/MaterialCommunityIcons.ttf; sourceTree = "<group>"; };
|
||||
65D145C429DC30470056FE7D /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = MaterialCommunityIcons.ttf; path = "../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = "<group>"; };
|
||||
65E03409257B9FF100793428 /* Notesnook-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Notesnook-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
65E0340A257B9FF100793428 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
|
||||
@@ -199,7 +200,7 @@
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C619D096A9DE2070DBEAC70F /* libPods-Make Note.a in Frameworks */,
|
||||
7C72B5EA418785B334F3B5EB /* libPods-Notesnook-Make Note.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -253,9 +254,9 @@
|
||||
16C0296DE7A2B4102817F5C1 /* libPods-Notesnook-tvOS.a */,
|
||||
A03E3F5851D27269540E147C /* libPods-Notesnook-tvOSTests.a */,
|
||||
41D57E9831C724F59F18FBAE /* libPods-Notesnook-Add to Notes.a */,
|
||||
35547D7C07E83F889159A73D /* libPods-Notesnook-Make Note.a */,
|
||||
65AA857825E6DDEC00772A01 /* WidgetKit.framework */,
|
||||
65AA857A25E6DDEC00772A01 /* SwiftUI.framework */,
|
||||
4C4AF691C324D95337F2FB0A /* libPods-Make Note.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -293,8 +294,6 @@
|
||||
83CBB9F61A601CBA00E9B192 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
65C400DD2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf */,
|
||||
65C149862A61151B005C40F1 /* extension.bundle */,
|
||||
6510E6D62877215700DACAA9 /* build.bundle */,
|
||||
65EC5B71272A7EE200FB3748 /* NotesWidgetExtensionDebug.entitlements */,
|
||||
6552012F27019F7700A43C51 /* OpenSans-Regular.ttf */,
|
||||
@@ -541,8 +540,8 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
65C400DE2A80B68D00AA3DF5 /* MaterialCommunityIcons.ttf in Resources */,
|
||||
6510626F27042891009661C3 /* OpenSans-Regular.ttf in Resources */,
|
||||
65D145C529DC30470056FE7D /* MaterialCommunityIcons.ttf in Resources */,
|
||||
659670B22A2754FD00C5D2AF /* OpenSans-Bold.ttf in Resources */,
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||
6529A13E279BC4C70048D4A8 /* BootSplash.storyboard in Resources */,
|
||||
@@ -579,8 +578,11 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
65C400DF2A80B6B600AA3DF5 /* MaterialCommunityIcons.ttf in Resources */,
|
||||
65C149872A61151B005C40F1 /* extension.bundle in Resources */,
|
||||
6510E6D82877215700DACAA9 /* build.bundle in Resources */,
|
||||
65D145C629DC30470056FE7D /* MaterialCommunityIcons.ttf in Resources */,
|
||||
659670B32A2754FD00C5D2AF /* OpenSans-Bold.ttf in Resources */,
|
||||
6510627727042896009661C3 /* OpenSans-SemiBold.ttf in Resources */,
|
||||
6510627527042893009661C3 /* OpenSans-Regular.ttf in Resources */,
|
||||
65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -774,7 +776,7 @@
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-Make Note-checkManifestLockResult.txt",
|
||||
"$(DERIVED_FILE_DIR)/Pods-Notesnook-Make Note-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
@@ -787,7 +789,7 @@
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Make Note/Pods-Make Note-resources.sh",
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Notesnook-Make Note/Pods-Notesnook-Make Note-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
@@ -796,7 +798,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Make Note/Pods-Make Note-resources.sh\"\n";
|
||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Notesnook-Make Note/Pods-Notesnook-Make Note-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
FD10A7F022414F080027D42C /* Start Packager */ = {
|
||||
@@ -997,7 +999,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
ENABLE_BITCODE = NO;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
@@ -1071,7 +1073,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-ObjC",
|
||||
@@ -1099,12 +1101,10 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Notesnook/Notesnook.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@@ -1176,7 +1176,7 @@
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
@@ -1185,8 +1185,7 @@
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook;
|
||||
PRODUCT_NAME = Notesnook;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook Distribution 2023";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "Notesnook Distribution 2023";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Notesnook-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
@@ -1335,7 +1334,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
@@ -1347,7 +1346,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget;
|
||||
@@ -1374,14 +1373,12 @@
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
INFOPLIST_FILE = NotesWidget/Info.plist;
|
||||
@@ -1391,12 +1388,11 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook Widget Distribution 2023";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "Notesnook Widget Distribution 2023";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||
@@ -1407,7 +1403,7 @@
|
||||
};
|
||||
65B5014D25A672B200E2D264 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 88211800FA8BF60638327ADE /* Pods-Make Note.debug.xcconfig */;
|
||||
baseConfigurationReference = 279A4325E1D27BD3E720F35B /* Pods-Notesnook-Make Note.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -1421,7 +1417,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "Make Note/Make Note.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
@@ -1495,7 +1491,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share;
|
||||
@@ -1510,7 +1506,7 @@
|
||||
};
|
||||
65B5014E25A672B200E2D264 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A84F3F0D50641D1CD4569B0E /* Pods-Make Note.release.xcconfig */;
|
||||
baseConfigurationReference = 47AE097A087A651BD60CAD7B /* Pods-Notesnook-Make Note.release.xcconfig */;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
@@ -1522,14 +1518,12 @@
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = "Make Note/Make Note.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 2050;
|
||||
CURRENT_PROJECT_VERSION = 2048;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_TEAM = "";
|
||||
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;
|
||||
DEVELOPMENT_TEAM = 53CWBG3QUC;
|
||||
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@@ -1601,12 +1595,11 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.6.1;
|
||||
MARKETING_VERSION = 2.5.6;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook Share Distrubution 2023";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "Notesnook Share Distrubution 2023";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Make Note/Make Note-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -57,45 +57,17 @@ target 'Notesnook' do
|
||||
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
||||
)
|
||||
|
||||
# for share extension
|
||||
target 'Make Note' do
|
||||
inherit! :complete
|
||||
end
|
||||
|
||||
target 'NotesnookTests' do
|
||||
|
||||
# Pods for testing
|
||||
end
|
||||
end
|
||||
|
||||
# for share extension
|
||||
target 'Make Note' do
|
||||
|
||||
use_react_native!(
|
||||
:path => "../../node_modules/react-native",
|
||||
# Hermes is now enabled by default. Disable by setting this flag to false.
|
||||
# Upcoming versions of React Native may rely on get_default_flags(), but
|
||||
# we make it explicit here to aid in the React Native upgrade process.
|
||||
:hermes_enabled => false,
|
||||
:fabric_enabled => false,
|
||||
# Enables Flipper.
|
||||
#
|
||||
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
||||
# you should disable the next line.
|
||||
# :flipper_configuration => flipper_config,
|
||||
# An absolute path to your application root.
|
||||
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
||||
)
|
||||
# Link only required libraries in share extension manually
|
||||
pod 'react-native-blob-util', :path => '../../node_modules/react-native-blob-util'
|
||||
pod 'react-native-share-extension', :path => '../../node_modules/@ammarahmed/react-native-share-extension'
|
||||
pod 'react-native-sodium', :path => '../../node_modules/@ammarahmed/react-native-sodium'
|
||||
pod 'react-native-gzip', :path => '../../node_modules/react-native-gzip'
|
||||
pod 'react-native-mmkv-storage', :path => '../../node_modules/react-native-mmkv-storage'
|
||||
pod 'react-native-webview', :path => '../../node_modules/react-native-webview'
|
||||
pod 'RNKeychain' , :path => '../../node_modules/react-native-keychain'
|
||||
pod 'react-native-netinfo', :path => '../../node_modules/@react-native-community/netinfo'
|
||||
pod 'react-native-safe-area-context', :path => '../../node_modules/react-native-safe-area-context'
|
||||
pod 'react-native-get-random-values', :path => '../../node_modules/react-native-get-random-values'
|
||||
pod 'callstack-repack', :path => '../../node_modules/@callstack/repack'
|
||||
pod 'RNSecureRandom', :path => '../../node_modules/react-native-securerandom'
|
||||
pod "RNCClipboard", :path => '../../node_modules/@react-native-clipboard/clipboard'
|
||||
end
|
||||
|
||||
|
||||
target 'Notesnook-tvOS' do
|
||||
|
||||
@@ -928,6 +928,6 @@ SPEC CHECKSUMS:
|
||||
toolbar-android: 2a73856e98b750d7e71ce4644d3f41cc98211719
|
||||
Yoga: 1d6727ed193122f6adaf435c3de1a768326ff83b
|
||||
|
||||
PODFILE CHECKSUM: b0cadd188aa428b98d1eaa0b84b3b6208e714119
|
||||
PODFILE CHECKSUM: ceb52748ea756b5ee99a76ac8a9d0323ded50075
|
||||
|
||||
COCOAPODS: 1.11.3
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8" />
|
||||
<title>Note Preview</title>
|
||||
<style>
|
||||
body {
|
||||
background-color: transparent !important;
|
||||
margin: 0px !important;
|
||||
padding: 12px;
|
||||
padding-top: 0px;
|
||||
font-size: 16px;
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
}
|
||||
|
||||
|
||||
iframe {
|
||||
max-width: 100% !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.editor {
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
min-height: 150px;
|
||||
outline: none !important;
|
||||
border-width: 0px !important;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
[contenteditable=true]:empty:before {
|
||||
content: attr(placeholder);
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
color: gray;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div aria-autocomplete="none" placeholder="Write something..." contenteditable="true" id="editor" class="editor double-spaced" >
|
||||
|
||||
</div>
|
||||
<script>
|
||||
function postMessage(type, value) {
|
||||
if (window.ReactNativeWebView) {
|
||||
window.ReactNativeWebView.postMessage(
|
||||
JSON.stringify({
|
||||
type: type,
|
||||
value: value
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
document.getElementById("editor").addEventListener("input", function (event) {
|
||||
postMessage('content', event.target.innerHTML);
|
||||
}, false);
|
||||
|
||||
|
||||
attachOnMessage()
|
||||
let styleElementDocument;
|
||||
let doubleSpacedLines = true;
|
||||
function attachOnMessage() {
|
||||
let isSafari = navigator.vendor.match(/apple/i);
|
||||
let listenerHandler = document;
|
||||
if (isSafari) {
|
||||
listenerHandler = window;
|
||||
}
|
||||
|
||||
listenerHandler.addEventListener('message', function (data) {
|
||||
console.log("message", data);
|
||||
let message = JSON.parse(data.data);
|
||||
let type = message.type;
|
||||
let value = message.value;
|
||||
switch (type) {
|
||||
case 'html':
|
||||
document.getElementById('editor').innerHTML = value;
|
||||
break;
|
||||
case 'theme':
|
||||
if (!styleElementDocument) {
|
||||
styleElementDocument = document.createElement('style');
|
||||
styleElementDocument.type = 'text/css';
|
||||
styleElementDocument.innerHTML = value;
|
||||
document.getElementsByTagName('head')[0].appendChild(styleElementDocument);
|
||||
} else {
|
||||
styleElementDocument.innerHTML = node;
|
||||
}
|
||||
break;
|
||||
case 'line-spacing': {
|
||||
doubleSpacedLines = JSON.parse(value);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
15
apps/mobile/native/jest.config.js
Normal file
15
apps/mobile/native/jest.config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
preset: 'react-native',
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.ts?$': 'ts-jest',
|
||||
'^.+\\.(js|jsx)$': 'babel-jest'
|
||||
},
|
||||
transformIgnorePatterns: ['<rootDir>/../node_modules/'],
|
||||
setupFiles: [
|
||||
'../node_modules/react-native-gesture-handler/jestSetup.js',
|
||||
'./jest.setup.js',
|
||||
'../node_modules/react-native-mmkv-storage/jest/mmkvJestSetup.js'
|
||||
],
|
||||
roots: ['../__tests__']
|
||||
};
|
||||
40
apps/mobile/native/jest.setup.js
Normal file
40
apps/mobile/native/jest.setup.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import mockRNCNetInfo from '@react-native-community/netinfo/jest/netinfo-mock.js';
|
||||
import 'react-native-get-random-values';
|
||||
import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock';
|
||||
import './globals.js';
|
||||
let mmkvMock = require('react-native-mmkv-storage/jest/dist/jest/memoryStore.js');
|
||||
jest.mock('react-native-keychain', () => ({
|
||||
ACCESSIBLE: {}
|
||||
}));
|
||||
mmkvMock.mock();
|
||||
|
||||
global.console = {
|
||||
log: () => null
|
||||
};
|
||||
|
||||
jest.mock('@react-native-community/netinfo', () => mockRNCNetInfo);
|
||||
jest.mock('react-native-safe-area-context', () => mockSafeAreaContext);
|
||||
jest.mock('rn-fetch-blob', () => {
|
||||
return {
|
||||
DocumentDir: () => {},
|
||||
polyfill: () => {},
|
||||
fs: {
|
||||
dirs: {
|
||||
CacheDir: '',
|
||||
DocumentDir: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter');
|
||||
|
||||
jest.mock('react-native-share', () => ({
|
||||
default: jest.fn()
|
||||
}));
|
||||
jest.mock('react-native-device-info', () => {
|
||||
return {
|
||||
supportedAbisSync: jest.fn(() => Promise.resolve('arm64-v8a')),
|
||||
getApplicationName: jest.fn(() => Promise.resolve('My App')),
|
||||
isTablet: jest.fn(() => Promise.resolve(false))
|
||||
};
|
||||
});
|
||||
@@ -1,5 +1,4 @@
|
||||
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
|
||||
|
||||
/**
|
||||
* Metro configuration for React Native
|
||||
* https://github.com/facebook/react-native
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
"react-native-date-picker": "4.2.6",
|
||||
"react-native-device-info": "^8.4.1",
|
||||
"react-native-document-picker": "^7.1.1",
|
||||
"@ammarahmed/react-native-eventsource": "1.1.0",
|
||||
"react-native-eventsource": "github:ammarahm-ed/react-native-eventsource",
|
||||
"react-native-exit-app": "https://github.com/ammarahm-ed/react-native-exit-app.git",
|
||||
"react-native-file-viewer": "^2.1.1",
|
||||
"react-native-fingerprint-scanner": "https://github.com/ammarahm-ed/react-native-fingerprint-scanner.git",
|
||||
@@ -82,21 +82,21 @@
|
||||
"@types/react-test-renderer": "^18.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
||||
"@typescript-eslint/parser": "^5.14.0",
|
||||
"babel-jest": "^29.6.2",
|
||||
"babel-jest": "^29.2.1",
|
||||
"babel-loader": "^8.2.5",
|
||||
"babel-plugin-module-resolver": "^4.1.0",
|
||||
"babel-plugin-transform-remove-console": "6.9.4",
|
||||
"detox": "^20.11.2",
|
||||
"detox": "^19.9.1",
|
||||
"eslint": "^8.19.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint-plugin-react": "^7.28.0",
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-unused-imports": "^2.0.0",
|
||||
"expect": "^29.6.2",
|
||||
"jest": "^29.6.2",
|
||||
"jest-circus": "^29.6.2",
|
||||
"jest-image-snapshot": "^6.2.0",
|
||||
"expect": "^28.1.3",
|
||||
"jest": "^29.2.1",
|
||||
"jest-circus": "^28.1.3",
|
||||
"jest-image-snapshot": "^5.1.0",
|
||||
"metro-react-native-babel-preset": "0.76.5",
|
||||
"pixelmatch": "^5.3.0",
|
||||
"prettier": "^2.4.1",
|
||||
@@ -106,9 +106,7 @@
|
||||
"react-refresh": "0.14.0",
|
||||
"react-test-renderer": "18.2.0",
|
||||
"terser-webpack-plugin": "^5.3.5",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "4.8.4",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack": "^5.88.2"
|
||||
"ts-jest": "^28.0.7",
|
||||
"webpack": "^5.74.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ const config = {
|
||||
};
|
||||
|
||||
if (!config.dependencies) config.dependencies = {};
|
||||
|
||||
config.dependencies['react-native-vector-icons'] = {
|
||||
platforms: {
|
||||
ios: null,
|
||||
|
||||
@@ -97,9 +97,7 @@ module.exports = (env) => {
|
||||
"deepmerge": path.join(__dirname, "../node_modules/deepmerge"),
|
||||
"@selderee/plugin-htmlparser2": path.join(__dirname, "../node_modules/@selderee/plugin-htmlparser2"),
|
||||
"peberminta": path.join(__dirname, "../node_modules/peberminta"),
|
||||
"react-native-blob-util": path.join(__dirname, "../node_modules/react-native-blob-util"),
|
||||
"@mdi/js": path.join(__dirname, "../node_modules/@mdi/js/mdi.js"),
|
||||
"katex": path.join(__dirname, "../node_modules/katex"),
|
||||
"react-native-blob-util": path.join(__dirname, "../node_modules/react-native-blob-util")
|
||||
},
|
||||
},
|
||||
/**
|
||||
@@ -184,7 +182,6 @@ module.exports = (env) => {
|
||||
/node_modules(.*[/\\])+@tanstack[/\\]query-core/,
|
||||
/node_modules(.*[/\\])+@tanstack[/\\]react-query/,
|
||||
/node_modules(.*[/\\])+@trpc[/\\]react-query/,
|
||||
/node_modules(.*[/\\])+katex/,
|
||||
],
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
@@ -232,7 +229,7 @@ module.exports = (env) => {
|
||||
: [
|
||||
"react-native-reanimated/plugin",
|
||||
`@babel/plugin-transform-named-capturing-groups-regex`,
|
||||
"transform-remove-console",
|
||||
//"transform-remove-console",
|
||||
],
|
||||
},
|
||||
},
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user