A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
monograph: use sharp for generating og images
Abdullah Atta2ff53d465001
diff --git a/apps/monograph/app/routes/$id.tsx b/apps/monograph/app/routes/$id.tsxindex ab54af03d..1dc99373b 100644--- a/apps/monograph/app/routes/$id.tsx+++ b/apps/monograph/app/routes/$id.tsx@@ -46,12 +46,12 @@ type Monograph = {type MonographResponse = Omit<Monograph, "content"> & { content: string };export const meta: MetaFunction<typeof loader> = ({ data }) => {+ if (!data) return [];const imageUrl = `${PUBLIC_URL}/api/og.png?${new URLSearchParams({title: data?.metadata?.title || "",- description: Buffer.from(- data?.metadata?.fullDescription || "",- "utf-8"- ).toString("base64"),+ description: data?.metadata?.fullDescription+ ? Buffer.from(data.metadata.fullDescription, "utf-8").toString("base64")+ : "",date: data?.metadata?.datePublished || ""}).toString()}`;diff --git a/apps/monograph/app/utils/env.ts b/apps/monograph/app/utils/env.tsindex 69ccf3873..6c19ec228 100644--- a/apps/monograph/app/utils/env.ts+++ b/apps/monograph/app/utils/env.ts@@ -17,13 +17,12 @@ You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/+const p = "process" in globalThis ? globalThis.process : ({ env: {} } as any);export const API_HOST =- import.meta.env.API_HOST ||- process.env.API_HOST ||- `https://api.notesnook.com`;+ import.meta.env.API_HOST || p.env.API_HOST || `https://api.notesnook.com`;export const PUBLIC_URL =import.meta.env.PUBLIC_URL ||- process.env.PUBLIC_URL ||- `http://localhost:${import.meta.env.PORT || process.env.PORT || 5017}`;+ p.env.PUBLIC_URL ||+ `http://localhost:${import.meta.env.PORT || p.env.PORT || 5173}`;export const COMPATIBILITY_VERSION = 1;-export const INSTANCE_NAME = process.env.INSTANCE_NAME || "default";+export const INSTANCE_NAME = p.env.INSTANCE_NAME || "default";diff --git a/apps/monograph/app/utils/generate-og-image.server.tsx b/apps/monograph/app/utils/generate-og-image.server.tsxindex de3c98069..e53f42ffe 100644--- a/apps/monograph/app/utils/generate-og-image.server.tsx+++ b/apps/monograph/app/utils/generate-og-image.server.tsx@@ -19,15 +19,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import satori from "satori";import { ThemeDark } from "@notesnook/theme";-import { svg2png, initialize } from "svg2png-wasm";-import svg2pngWasm from "svg2png-wasm/svg2png_wasm_bg.wasm?arraybuffer";+import sharp from "sharp";import fontRegular from "../assets/fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-regular.ttf?arraybuffer";import fontBold from "../assets/fonts/open-sans-v34-vietnamese_latin-ext_latin_hebrew_greek-ext_greek_cyrillic-ext_cyrillic-600.ttf?arraybuffer";+import { Readable } from "node:stream";export type OGMetadata = { title: string; description: string; date: string };-await initialize(svg2pngWasm);-export async function makeImage(metadata: OGMetadata) {const theme = ThemeDark.scopes.base;const svg = await satori(@@ -38,6 +36,7 @@ export async function makeImage(metadata: OGMetadata) {justifyContent: "space-between",height: "100%",borderBottom: "10px solid #008837",+ backgroundColor: theme.primary.background,width: "100%",padding: 50,margin: 0@@ -141,8 +140,5 @@ export async function makeImage(metadata: OGMetadata) {]});-- return await svg2png(svg, {- backgroundColor: "black"- });+ return Readable.toWeb(sharp(Buffer.from(svg)).png()) as ReadableStream;}diff --git a/apps/monograph/package-lock.json b/apps/monograph/package-lock.jsonindex f5456e8eb..e47233bef 100644--- a/apps/monograph/package-lock.json+++ b/apps/monograph/package-lock.json@@ -39,6 +39,7 @@"refractor": "^4.8.1","remix-utils": "^7.7.0","satori": "^0.11.1",+ "sharp": "^0.33.5","slugify": "^1.6.6","svg2png-wasm": "^1.4.1","zustand": "^4.5.5"@@ -988,6 +989,16 @@"@jridgewell/sourcemap-codec": "^1.4.10"}},+ "node_modules/@emnapi/runtime": {+ "version": "1.3.1",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz",+ "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==",+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },"node_modules/@emotion/babel-plugin": {"version": "11.12.0","resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.12.0.tgz",@@ -1574,6 +1585,367 @@"node": ">=14"}},+ "node_modules/@img/sharp-darwin-arm64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz",+ "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-arm64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-darwin-x64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz",+ "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-x64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-arm64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz",+ "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==",+ "cpu": [+ "arm64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-x64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz",+ "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==",+ "cpu": [+ "x64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz",+ "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==",+ "cpu": [+ "arm"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz",+ "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==",+ "cpu": [+ "arm64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-s390x": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz",+ "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==",+ "cpu": [+ "s390x"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-x64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz",+ "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==",+ "cpu": [+ "x64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz",+ "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==",+ "cpu": [+ "arm64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {+ "version": "1.0.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz",+ "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==",+ "cpu": [+ "x64"+ ],+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-linux-arm": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz",+ "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==",+ "cpu": [+ "arm"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm": "1.0.5"+ }+ },+ "node_modules/@img/sharp-linux-arm64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz",+ "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-linux-s390x": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz",+ "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==",+ "cpu": [+ "s390x"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-s390x": "1.0.4"+ }+ },+ "node_modules/@img/sharp-linux-x64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz",+ "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-x64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-arm64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz",+ "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==",+ "cpu": [+ "arm64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-arm64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-x64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz",+ "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-x64": "1.0.4"+ }+ },+ "node_modules/@img/sharp-wasm32": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz",+ "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==",+ "cpu": [+ "wasm32"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/runtime": "^1.2.0"+ },+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-ia32": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz",+ "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==",+ "cpu": [+ "ia32"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-x64": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz",+ "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==",+ "cpu": [+ "x64"+ ],+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },"node_modules/@isaacs/cliui": {"version": "8.0.2","resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",@@ -2623,6 +2995,22 @@"@styled-system/css": "^5.1.5"}},+ "node_modules/@theme-ui/color-modes": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/color-modes/-/color-modes-0.16.2.tgz",+ "integrity": "sha512-jWEWx53lxNgWCT38i/kwLV2rsvJz8lVZgi5oImnVwYba9VejXD23q1ckbNFJHosQ8KKXY87ht0KPC6BQFIiHtQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/core": "^0.16.2",+ "@theme-ui/css": "^0.16.2",+ "deepmerge": "^4.2.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },"node_modules/@theme-ui/components": {"version": "0.16.2","resolved": "https://registry.npmjs.org/@theme-ui/components/-/components-0.16.2.tgz",@@ -2668,6 +3056,22 @@"@emotion/react": "^11.11.1"}},+ "node_modules/@theme-ui/theme-provider": {+ "version": "0.16.2",+ "resolved": "https://registry.npmjs.org/@theme-ui/theme-provider/-/theme-provider-0.16.2.tgz",+ "integrity": "sha512-LRnVevODcGqO0JyLJ3wht+PV3ZoZcJ7XXLJAJWDoGeII4vZcPQKwVy4Lpz/juHsZppQxKcB3U+sQDGBnP25irQ==",+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "@theme-ui/color-modes": "^0.16.2",+ "@theme-ui/core": "^0.16.2",+ "@theme-ui/css": "^0.16.2"+ },+ "peerDependencies": {+ "@emotion/react": "^11.11.1",+ "react": ">=18"+ }+ },"node_modules/@types/acorn": {"version": "4.0.6","resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz",@@ -2797,14 +3201,14 @@"version": "15.7.13","resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz","integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==",- "dev": true,+ "devOptional": true,"license": "MIT"},"node_modules/@types/react": {"version": "18.3.10","resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.10.tgz","integrity": "sha512-02sAAlBnP39JgXwkAq3PeU9DVaaGpZyF3MGcC0MKgQVkZor5IiiDAipVaxQHtDJAmO4GIy/rVBy/LzVj76Cyqg==",- "dev": true,+ "devOptional": true,"license": "MIT","dependencies": {"@types/prop-types": "*",@@ -3765,6 +4169,19 @@"node": ">=0.8"}},+ "node_modules/color": {+ "version": "4.2.3",+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",+ "license": "MIT",+ "dependencies": {+ "color-convert": "^2.0.1",+ "color-string": "^1.9.0"+ },+ "engines": {+ "node": ">=12.5.0"+ }+ },"node_modules/color-convert": {"version": "1.9.3","resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",@@ -3780,6 +4197,34 @@"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==","license": "MIT"},+ "node_modules/color-string": {+ "version": "1.9.1",+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",+ "license": "MIT",+ "dependencies": {+ "color-name": "^1.0.0",+ "simple-swizzle": "^0.2.2"+ }+ },+ "node_modules/color/node_modules/color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "license": "MIT",+ "dependencies": {+ "color-name": "~1.1.4"+ },+ "engines": {+ "node": ">=7.0.0"+ }+ },+ "node_modules/color/node_modules/color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "license": "MIT"+ },"node_modules/comlink": {"version": "4.4.1","resolved": "https://registry.npmjs.org/comlink/-/comlink-4.4.1.tgz",@@ -4194,6 +4639,15 @@"npm": "1.2.8000 || >= 1.4.16"}},+ "node_modules/detect-libc": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",+ "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==",+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },"node_modules/diff": {"version": "5.2.0","resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz",@@ -9252,7 +9706,6 @@"version": "7.6.3","resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz","integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",- "dev": true,"license": "ISC","bin": {"semver": "bin/semver.js"@@ -9359,6 +9812,45 @@"dev": true,"license": "ISC"},+ "node_modules/sharp": {+ "version": "0.33.5",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz",+ "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==",+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "dependencies": {+ "color": "^4.2.3",+ "detect-libc": "^2.0.3",+ "semver": "^7.6.3"+ },+ "engines": {+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-darwin-arm64": "0.33.5",+ "@img/sharp-darwin-x64": "0.33.5",+ "@img/sharp-libvips-darwin-arm64": "1.0.4",+ "@img/sharp-libvips-darwin-x64": "1.0.4",+ "@img/sharp-libvips-linux-arm": "1.0.5",+ "@img/sharp-libvips-linux-arm64": "1.0.4",+ "@img/sharp-libvips-linux-s390x": "1.0.4",+ "@img/sharp-libvips-linux-x64": "1.0.4",+ "@img/sharp-libvips-linuxmusl-arm64": "1.0.4",+ "@img/sharp-libvips-linuxmusl-x64": "1.0.4",+ "@img/sharp-linux-arm": "0.33.5",+ "@img/sharp-linux-arm64": "0.33.5",+ "@img/sharp-linux-s390x": "0.33.5",+ "@img/sharp-linux-x64": "0.33.5",+ "@img/sharp-linuxmusl-arm64": "0.33.5",+ "@img/sharp-linuxmusl-x64": "0.33.5",+ "@img/sharp-wasm32": "0.33.5",+ "@img/sharp-win32-ia32": "0.33.5",+ "@img/sharp-win32-x64": "0.33.5"+ }+ },"node_modules/shebang-command": {"version": "2.0.0","resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",@@ -9408,6 +9900,21 @@"dev": true,"license": "ISC"},+ "node_modules/simple-swizzle": {+ "version": "0.2.2",+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",+ "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",+ "license": "MIT",+ "dependencies": {+ "is-arrayish": "^0.3.1"+ }+ },+ "node_modules/simple-swizzle/node_modules/is-arrayish": {+ "version": "0.3.2",+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",+ "license": "MIT"+ },"node_modules/slugify": {"version": "1.6.6","resolved": "https://registry.npmjs.org/slugify/-/slugify-1.6.6.tgz",@@ -10117,7 +10624,7 @@"version": "2.7.0","resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz","integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==",- "dev": true,+ "devOptional": true,"license": "0BSD"},"node_modules/turbo-stream": {@@ -11907,7 +12414,7 @@"version": "3.23.8","resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz","integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",- "dev": true,+ "devOptional": true,"license": "MIT","funding": {"url": "https://github.com/sponsors/colinhacks"diff --git a/apps/monograph/package.json b/apps/monograph/package.jsonindex 9a25792c1..6af267a07 100644--- a/apps/monograph/package.json+++ b/apps/monograph/package.json@@ -14,9 +14,9 @@"@emotion/cache": "11.11.0","@emotion/react": "11.11.1","@emotion/server": "11.11.0",- "@mdi/js": "^7.4.47","@lingui/core": "4.11.4","@lingui/react": "4.11.4",+ "@mdi/js": "^7.4.47","@notesnook/core": "file:../../packages/core","@notesnook/crypto": "file:../../packages/crypto","@notesnook/editor": "file:../../packages/editor",@@ -42,6 +42,7 @@"refractor": "^4.8.1","remix-utils": "^7.7.0","satori": "^0.11.1",+ "sharp": "^0.33.5","slugify": "^1.6.6","svg2png-wasm": "^1.4.1","zustand": "^4.5.5"diff --git a/apps/monograph/vite.config.ts b/apps/monograph/vite.config.tsindex 267090dec..11424bbea 100644--- a/apps/monograph/vite.config.ts+++ b/apps/monograph/vite.config.ts@@ -21,7 +21,7 @@ import { defineConfig } from "vite";import tsconfigPaths from "vite-tsconfig-paths";import arraybuffer from "vite-plugin-arraybuffer";import wasm from "vite-plugin-wasm";-import { ThemeDark } from "@notesnook/theme";+import ThemeDark from "@notesnook/theme/theme-engine/themes/default-dark.json" with { type: "json" };import type { Plugin, ResolvedConfig } from "vite";import { writeFile } from "fs/promises";import path from "path";@@ -50,7 +50,8 @@ export default defineConfig(({ isSsrBuild }) => ({type: "module",scripts: { start: pkg.scripts.start },dependencies: {- "@remix-run/serve": pkg.devDependencies["@remix-run/serve"]+ "@remix-run/serve": pkg.devDependencies["@remix-run/serve"],+ "sharp": pkg.dependencies.sharp}})}),@@ -79,9 +80,6 @@ export default defineConfig(({ isSsrBuild }) => ({},build: {target: isSsrBuild ? "node20" : undefined,- rollupOptions: {- external: ["svg2png-wasm/svg2png_wasm_bg.wasm"]- }},define: {[DEFAULT_THEME_KEY]: JSON.stringify(ThemeDark)diff --git a/packages/theme/package.json b/packages/theme/package.jsonindex b7a563c40..89ee0526d 100644--- a/packages/theme/package.json+++ b/packages/theme/package.json@@ -7,13 +7,25 @@"license": "GPL-3.0-or-later","sideEffects": false,"exports": {- "require": {- "types": "./dist/types/index.d.ts",- "default": "./dist/cjs/index.js"+ ".": {+ "require": {+ "types": "./dist/types/index.d.ts",+ "default": "./dist/cjs/index.js"+ },+ "import": {+ "types": "./dist/types/index.d.ts",+ "default": "./dist/esm/index.js"+ }},- "import": {- "types": "./dist/types/index.d.ts",- "default": "./dist/esm/index.js"+ "./*": {+ "require": {+ "types": "./dist/types/*",+ "default": "./dist/cjs/*"+ },+ "import": {+ "types": "./dist/types/*",+ "default": "./dist/esm/*"+ }}},"repository": {