zreader 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +234 -2
- package/dist/blocks-DwR7l7pz.d.ts +20 -0
- package/dist/chunk-3WQBK6DE.js +47 -0
- package/dist/chunk-3WQBK6DE.js.map +1 -0
- package/dist/chunk-DYQNGV46.js +31 -0
- package/dist/chunk-DYQNGV46.js.map +1 -0
- package/dist/chunk-ISI35TCM.js +62 -0
- package/dist/chunk-ISI35TCM.js.map +1 -0
- package/dist/chunk-RNSAFDZ5.js +105 -0
- package/dist/chunk-RNSAFDZ5.js.map +1 -0
- package/dist/config/index.cjs +196 -0
- package/dist/config/index.cjs.map +1 -0
- package/dist/config/index.d.cts +159 -0
- package/dist/config/index.d.ts +159 -0
- package/dist/config/index.js +182 -0
- package/dist/config/index.js.map +1 -0
- package/dist/content/index.d.ts +143 -0
- package/dist/content/index.js +379 -0
- package/dist/content/index.js.map +1 -0
- package/dist/core/index.d.ts +262 -0
- package/dist/core/index.js +935 -0
- package/dist/core/index.js.map +1 -0
- package/dist/editor/index.d.ts +19 -0
- package/dist/editor/index.js +277 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/index-Bp5oIiZd.d.ts +61 -0
- package/dist/next/client/index.d.ts +8 -0
- package/dist/next/client/index.js +13 -0
- package/dist/next/client/index.js.map +1 -0
- package/dist/next/index.cjs +272 -0
- package/dist/next/index.cjs.map +1 -0
- package/dist/next/index.d.cts +47 -0
- package/dist/next/index.d.ts +47 -0
- package/dist/next/index.js +262 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/server/index.d.ts +58 -0
- package/dist/next/server/index.js +44 -0
- package/dist/next/server/index.js.map +1 -0
- package/dist/react/index.d.ts +376 -0
- package/dist/react/index.js +2793 -0
- package/dist/react/index.js.map +1 -0
- package/dist/reader.css +116 -0
- package/dist/rehype/index.d.ts +27 -0
- package/dist/rehype/index.js +4 -0
- package/dist/rehype/index.js.map +1 -0
- package/dist/stubs/empty-config.d.ts +9 -0
- package/dist/stubs/empty-config.js +7 -0
- package/dist/stubs/empty-config.js.map +1 -0
- package/dist/stubs/server-only.d.ts +2 -0
- package/dist/stubs/server-only.js +6 -0
- package/dist/stubs/server-only.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/tailwind.css +41 -0
- package/dist/types-xkdpkPxA.d.ts +147 -0
- package/dist/user-config/index.d.ts +17 -0
- package/dist/user-config/index.js +35 -0
- package/dist/user-config/index.js.map +1 -0
- package/dist/virtual-config/index.d.ts +6 -0
- package/dist/virtual-config/index.js +10 -0
- package/dist/virtual-config/index.js.map +1 -0
- package/package.json +225 -4
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/** Shared, framework-agnostic data model for zreader. */
|
|
2
|
+
type ISODate = string;
|
|
3
|
+
/** W3C Web Annotation-style anchor. Offsets are measured over the chapter root's text. */
|
|
4
|
+
interface Anchor {
|
|
5
|
+
/** `data-block-id` of the block containing the start of the selection. */
|
|
6
|
+
blockId: string;
|
|
7
|
+
/** Offsets relative to the start block's text (fast path). */
|
|
8
|
+
blockStart: number;
|
|
9
|
+
/** TextPositionSelector over the whole chapter text. */
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
/** TextQuoteSelector. */
|
|
13
|
+
exact: string;
|
|
14
|
+
prefix: string;
|
|
15
|
+
suffix: string;
|
|
16
|
+
/** Content hash of the chapter when the anchor was created. */
|
|
17
|
+
contentHash?: string;
|
|
18
|
+
}
|
|
19
|
+
interface Highlight {
|
|
20
|
+
id: string;
|
|
21
|
+
bookId: string;
|
|
22
|
+
chapterId: string;
|
|
23
|
+
anchor: Anchor;
|
|
24
|
+
color: string;
|
|
25
|
+
note?: string;
|
|
26
|
+
createdAt: ISODate;
|
|
27
|
+
updatedAt: ISODate;
|
|
28
|
+
}
|
|
29
|
+
interface Bookmark {
|
|
30
|
+
id: string;
|
|
31
|
+
bookId: string;
|
|
32
|
+
chapterId: string;
|
|
33
|
+
/** Absent for whole-chapter bookmarks. */
|
|
34
|
+
blockId?: string;
|
|
35
|
+
label?: string;
|
|
36
|
+
excerpt?: string;
|
|
37
|
+
createdAt: ISODate;
|
|
38
|
+
updatedAt: ISODate;
|
|
39
|
+
}
|
|
40
|
+
interface ChapterProgress {
|
|
41
|
+
chapterId: string;
|
|
42
|
+
blockId?: string;
|
|
43
|
+
/** 0..1 */
|
|
44
|
+
percent: number;
|
|
45
|
+
completed: boolean;
|
|
46
|
+
updatedAt: ISODate;
|
|
47
|
+
}
|
|
48
|
+
interface BookProgress {
|
|
49
|
+
bookId: string;
|
|
50
|
+
chapters: Record<string, ChapterProgress>;
|
|
51
|
+
last?: {
|
|
52
|
+
chapterId: string;
|
|
53
|
+
blockId?: string;
|
|
54
|
+
updatedAt: ISODate;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
type PadScope = {
|
|
58
|
+
kind: "global";
|
|
59
|
+
} | {
|
|
60
|
+
kind: "book";
|
|
61
|
+
bookId: string;
|
|
62
|
+
} | {
|
|
63
|
+
kind: "chapter";
|
|
64
|
+
bookId: string;
|
|
65
|
+
chapterId: string;
|
|
66
|
+
};
|
|
67
|
+
type PadScopeKind = PadScope["kind"];
|
|
68
|
+
interface Pad {
|
|
69
|
+
/** Markdown is the interchange/source format. */
|
|
70
|
+
markdown: string;
|
|
71
|
+
/** Lossless editor JSON cache. Cleared whenever `markdown` is changed outside the editor. */
|
|
72
|
+
json?: unknown;
|
|
73
|
+
updatedAt: ISODate;
|
|
74
|
+
}
|
|
75
|
+
type ThemeName = "system" | "light" | "sepia" | "dark";
|
|
76
|
+
type Measure = "narrow" | "normal" | "wide";
|
|
77
|
+
type FontFamily = "serif" | "sans" | "mono";
|
|
78
|
+
type TextSize = "sm" | "base" | "lg" | "xl" | "2xl";
|
|
79
|
+
type Leading = "tight" | "normal" | "relaxed";
|
|
80
|
+
declare const THEMES: readonly ["system", "light", "sepia", "dark"];
|
|
81
|
+
declare const TEXT_SIZES: readonly ["sm", "base", "lg", "xl", "2xl"];
|
|
82
|
+
declare const LEADINGS: readonly ["tight", "normal", "relaxed"];
|
|
83
|
+
declare const MEASURES: readonly ["narrow", "normal", "wide"];
|
|
84
|
+
declare const FONT_FAMILIES: readonly ["serif", "sans", "mono"];
|
|
85
|
+
/** The palette the UI ships styles for (`::highlight(zr-<color>)`). */
|
|
86
|
+
declare const HIGHLIGHT_COLORS: readonly ["yellow", "green", "blue", "pink", "purple", "orange"];
|
|
87
|
+
type HighlightColor = (typeof HIGHLIGHT_COLORS)[number];
|
|
88
|
+
interface ReaderSettings {
|
|
89
|
+
textSize: TextSize;
|
|
90
|
+
leading: Leading;
|
|
91
|
+
measure: Measure;
|
|
92
|
+
fontFamily: FontFamily;
|
|
93
|
+
/** Tap a sentence to highlight it with the default colour. */
|
|
94
|
+
highlightMode: boolean;
|
|
95
|
+
updatedAt: ISODate;
|
|
96
|
+
}
|
|
97
|
+
/** Serializable client options (the `reader` half of reader.config.ts). */
|
|
98
|
+
interface ReaderClientOptions {
|
|
99
|
+
storagePrefix: string;
|
|
100
|
+
highlightColors: HighlightColor[];
|
|
101
|
+
defaultHighlightColor: HighlightColor;
|
|
102
|
+
scratchpad: {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
scopes: PadScopeKind[];
|
|
105
|
+
};
|
|
106
|
+
/** Themes offered in the UI. Applied as a class on <html> via next-themes. */
|
|
107
|
+
themes: ThemeName[];
|
|
108
|
+
defaultTheme: ThemeName;
|
|
109
|
+
defaultSettings: Omit<ReaderSettings, "updatedAt">;
|
|
110
|
+
progress: {
|
|
111
|
+
completeAt: number;
|
|
112
|
+
saveIntervalMs: number;
|
|
113
|
+
};
|
|
114
|
+
/** Show a "your notes only live in this browser" reminder. */
|
|
115
|
+
backupReminder: boolean;
|
|
116
|
+
/** Base path used to build links back into the reader (e.g. quote-to-pad). */
|
|
117
|
+
basePath: string;
|
|
118
|
+
}
|
|
119
|
+
interface TocEntry {
|
|
120
|
+
id: string;
|
|
121
|
+
depth: number;
|
|
122
|
+
text: string;
|
|
123
|
+
}
|
|
124
|
+
interface ChapterMeta {
|
|
125
|
+
id: string;
|
|
126
|
+
title: string;
|
|
127
|
+
order: number;
|
|
128
|
+
description?: string;
|
|
129
|
+
/** Section the chapter belongs to, e.g. "Part I · For the Builders". Groups the contents list. */
|
|
130
|
+
part?: string;
|
|
131
|
+
/** Eyebrow shown above the title, e.g. "Chapter 5" or "Appendix A". */
|
|
132
|
+
label?: string;
|
|
133
|
+
/** Short marker for lists, e.g. "5" or "A". */
|
|
134
|
+
number?: string;
|
|
135
|
+
}
|
|
136
|
+
interface BookMeta {
|
|
137
|
+
id: string;
|
|
138
|
+
title: string;
|
|
139
|
+
subtitle?: string;
|
|
140
|
+
authors: string[];
|
|
141
|
+
description?: string;
|
|
142
|
+
cover?: string;
|
|
143
|
+
chapters: ChapterMeta[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { FONT_FAMILIES as F, LEADINGS as L, MEASURES as M, HIGHLIGHT_COLORS as g, TEXT_SIZES as l, THEMES as m };
|
|
147
|
+
export type { Anchor as A, BookMeta as B, ChapterMeta as C, Highlight as H, ISODate as I, Pad as P, ReaderClientOptions as R, TocEntry as T, ReaderSettings as a, BookProgress as b, Bookmark as c, PadScope as d, ChapterProgress as e, FontFamily as f, HighlightColor as h, Leading as i, Measure as j, PadScopeKind as k, TextSize as n, ThemeName as o };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { R as ReaderUserConfig } from '../index-Bp5oIiZd.js';
|
|
2
|
+
import 'zod/v4';
|
|
3
|
+
import '../types-xkdpkPxA.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Fallback for `zreader/user-config`.
|
|
7
|
+
*
|
|
8
|
+
* In Next.js, `withReader()` aliases this specifier straight to the project's
|
|
9
|
+
* reader.config.ts (or to `zreader/empty-config`), so this file is
|
|
10
|
+
* only used in plain Node: scripts, tests, other frameworks. It discovers
|
|
11
|
+
* reader.config.* from `process.cwd()` and loads it with jiti.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare const config: ReaderUserConfig;
|
|
15
|
+
declare const configFile: string | null;
|
|
16
|
+
|
|
17
|
+
export { ReaderUserConfig, configFile, config as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CONFIG_FILE_NAMES } from '../chunk-RNSAFDZ5.js';
|
|
2
|
+
import '../chunk-DYQNGV46.js';
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
import { resolve, join, dirname } from 'path';
|
|
5
|
+
|
|
6
|
+
function findConfigFile(from = process.cwd()) {
|
|
7
|
+
let dir = resolve(from);
|
|
8
|
+
for (; ; ) {
|
|
9
|
+
for (const name of CONFIG_FILE_NAMES) {
|
|
10
|
+
const p = join(dir, name);
|
|
11
|
+
if (existsSync(p)) return p;
|
|
12
|
+
}
|
|
13
|
+
if (existsSync(join(dir, "package.json")) || existsSync(join(dir, ".git"))) return null;
|
|
14
|
+
const parent = dirname(dir);
|
|
15
|
+
if (parent === dir) return null;
|
|
16
|
+
dir = parent;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function loadConfigFile(file2) {
|
|
20
|
+
const { createJiti } = await import('jiti');
|
|
21
|
+
const jiti = createJiti(file2, { interopDefault: true, moduleCache: false });
|
|
22
|
+
const mod = await jiti.import(file2);
|
|
23
|
+
const cfg = mod && typeof mod === "object" && "default" in mod ? mod.default : mod;
|
|
24
|
+
return cfg ?? {};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/user-config/index.ts
|
|
28
|
+
var file = findConfigFile(process.cwd());
|
|
29
|
+
var config = file ? await loadConfigFile(file) : {};
|
|
30
|
+
var configFile = file;
|
|
31
|
+
var user_config_default = config;
|
|
32
|
+
|
|
33
|
+
export { configFile, user_config_default as default };
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/config/load.ts","../../src/user-config/index.ts"],"names":["file"],"mappings":";;;;;AAMO,SAAS,cAAA,CAAe,IAAA,GAAe,OAAA,CAAQ,GAAA,EAAI,EAAkB;AAC1E,EAAA,IAAI,GAAA,GAAM,QAAQ,IAAI,CAAA;AACtB,EAAA,WAAS;AACP,IAAA,KAAA,MAAW,QAAQ,iBAAA,EAAmB;AACpC,MAAA,MAAM,CAAA,GAAI,IAAA,CAAK,GAAA,EAAK,IAAI,CAAA;AACxB,MAAA,IAAI,UAAA,CAAW,CAAC,CAAA,EAAG,OAAO,CAAA;AAAA,IAC5B;AACA,IAAA,IAAI,UAAA,CAAW,IAAA,CAAK,GAAA,EAAK,cAAc,CAAC,CAAA,IAAK,UAAA,CAAW,IAAA,CAAK,GAAA,EAAK,MAAM,CAAC,CAAA,EAAG,OAAO,IAAA;AACnF,IAAA,MAAM,MAAA,GAAS,QAAQ,GAAG,CAAA;AAC1B,IAAA,IAAI,MAAA,KAAW,KAAK,OAAO,IAAA;AAC3B,IAAA,GAAA,GAAM,MAAA;AAAA,EACR;AACF;AAEA,eAAsB,eAAeA,KAAAA,EAAyC;AAC5E,EAAA,MAAM,EAAE,UAAA,EAAW,GAAI,MAAM,OAAO,MAAM,CAAA;AAC1C,EAAA,MAAM,IAAA,GAAO,WAAWA,KAAAA,EAAM,EAAE,gBAAgB,IAAA,EAAM,WAAA,EAAa,OAAO,CAAA;AAC1E,EAAA,MAAM,GAAA,GAAO,MAAM,IAAA,CAAK,MAAA,CAAOA,KAAI,CAAA;AACnC,EAAA,MAAM,GAAA,GAAO,OAAO,OAAO,GAAA,KAAQ,YAAY,SAAA,IAAa,GAAA,GAAM,IAAI,OAAA,GAAU,GAAA;AAChF,EAAA,OAAO,OAAO,EAAC;AACjB;;;ACfA,IAAM,IAAA,GAAO,cAAA,CAAe,OAAA,CAAQ,GAAA,EAAK,CAAA;AACzC,IAAM,SAA2B,IAAA,GAAO,MAAM,cAAA,CAAe,IAAI,IAAI,EAAC;AAE/D,IAAM,UAAA,GAA4B;AACzC,IAAO,mBAAA,GAAQ","file":"index.js","sourcesContent":["/** Node-only helpers for locating and loading reader.config.* (via jiti). */\nimport { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { CONFIG_FILE_NAMES, type ReaderUserConfig } from \"./index\";\n\n/** Search `from` and its parents (up to the filesystem root or a `.git` dir) for reader.config.*. */\nexport function findConfigFile(from: string = process.cwd()): string | null {\n let dir = resolve(from);\n for (;;) {\n for (const name of CONFIG_FILE_NAMES) {\n const p = join(dir, name);\n if (existsSync(p)) return p;\n }\n if (existsSync(join(dir, \"package.json\")) || existsSync(join(dir, \".git\"))) return null;\n const parent = dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\nexport async function loadConfigFile(file: string): Promise<ReaderUserConfig> {\n const { createJiti } = await import(\"jiti\");\n const jiti = createJiti(file, { interopDefault: true, moduleCache: false });\n const mod = (await jiti.import(file)) as { default?: ReaderUserConfig } | ReaderUserConfig;\n const cfg = (mod && typeof mod === \"object\" && \"default\" in mod ? mod.default : mod) as ReaderUserConfig | undefined;\n return cfg ?? {};\n}\n","/**\n * Fallback for `zreader/user-config`.\n *\n * In Next.js, `withReader()` aliases this specifier straight to the project's\n * reader.config.ts (or to `zreader/empty-config`), so this file is\n * only used in plain Node: scripts, tests, other frameworks. It discovers\n * reader.config.* from `process.cwd()` and loads it with jiti.\n */\nimport type { ReaderUserConfig } from \"../config/index\";\nimport { findConfigFile, loadConfigFile } from \"../config/load\";\n\nconst file = findConfigFile(process.cwd());\nconst config: ReaderUserConfig = file ? await loadConfigFile(file) : {};\n\nexport const configFile: string | null = file;\nexport default config;\nexport type { ReaderUserConfig };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import userConfig from 'zreader/user-config';
|
|
2
|
+
import { resolveConfig } from 'zreader/config';
|
|
3
|
+
|
|
4
|
+
// src/virtual-config/index.ts
|
|
5
|
+
var config = resolveConfig(userConfig, null, { source: "reader.config" });
|
|
6
|
+
var virtual_config_default = config;
|
|
7
|
+
|
|
8
|
+
export { virtual_config_default as default };
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/virtual-config/index.ts"],"names":[],"mappings":";;;;AASA,IAAM,SAA+B,aAAA,CAAc,UAAA,EAAY,MAAM,EAAE,MAAA,EAAQ,iBAAiB,CAAA;AAEhG,IAAO,sBAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * `zreader/virtual-config` — the fully resolved, validated config.\n *\n * `zreader/user-config` is resolved by the *app's* bundler, which\n * `withReader()` points at the project's reader.config.ts. Server-only.\n */\nimport userConfig from \"zreader/user-config\";\nimport { resolveConfig, type ResolvedReaderConfig } from \"zreader/config\";\n\nconst config: ResolvedReaderConfig = resolveConfig(userConfig, null, { source: \"reader.config\" });\n\nexport default config;\nexport type { ResolvedReaderConfig };\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,227 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zreader",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A localStorage-first, mobile-first book reader: chapters, bookmarks, sentence highlights, notes, reading progress and a WYSIWYG markdown scratchpad.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Alchemyst AI",
|
|
7
|
+
"homepage": "https://github.com/alchemyst-ai/zreader#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/alchemyst-ai/zreader.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/alchemyst-ai/zreader/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"*.css"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"reader",
|
|
21
|
+
"ebook",
|
|
22
|
+
"lms",
|
|
23
|
+
"highlights",
|
|
24
|
+
"bookmarks",
|
|
25
|
+
"localStorage",
|
|
26
|
+
"markdown",
|
|
27
|
+
"mdx",
|
|
28
|
+
"tiptap",
|
|
29
|
+
"nextjs",
|
|
30
|
+
"book-reader",
|
|
31
|
+
"react",
|
|
32
|
+
"react-19",
|
|
33
|
+
"shadcn"
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"CHANGELOG.md"
|
|
40
|
+
],
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"types": "./dist/core/index.d.ts",
|
|
44
|
+
"default": "./dist/core/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./config": {
|
|
47
|
+
"import": {
|
|
48
|
+
"types": "./dist/config/index.d.ts",
|
|
49
|
+
"default": "./dist/config/index.js"
|
|
50
|
+
},
|
|
51
|
+
"require": {
|
|
52
|
+
"types": "./dist/config/index.d.cts",
|
|
53
|
+
"default": "./dist/config/index.cjs"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"./next": {
|
|
57
|
+
"import": {
|
|
58
|
+
"types": "./dist/next/index.d.ts",
|
|
59
|
+
"default": "./dist/next/index.js"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./dist/next/index.d.cts",
|
|
63
|
+
"default": "./dist/next/index.cjs"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"./next/client": {
|
|
67
|
+
"types": "./dist/next/client/index.d.ts",
|
|
68
|
+
"default": "./dist/next/client/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./next/server": {
|
|
71
|
+
"types": "./dist/next/server/index.d.ts",
|
|
72
|
+
"browser": "./dist/stubs/server-only.js",
|
|
73
|
+
"default": "./dist/next/server/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./content": {
|
|
76
|
+
"types": "./dist/content/index.d.ts",
|
|
77
|
+
"browser": "./dist/stubs/server-only.js",
|
|
78
|
+
"default": "./dist/content/index.js"
|
|
79
|
+
},
|
|
80
|
+
"./rehype": {
|
|
81
|
+
"types": "./dist/rehype/index.d.ts",
|
|
82
|
+
"default": "./dist/rehype/index.js"
|
|
83
|
+
},
|
|
84
|
+
"./virtual-config": {
|
|
85
|
+
"types": "./dist/virtual-config/index.d.ts",
|
|
86
|
+
"browser": "./dist/stubs/server-only.js",
|
|
87
|
+
"default": "./dist/virtual-config/index.js"
|
|
88
|
+
},
|
|
89
|
+
"./user-config": {
|
|
90
|
+
"types": "./dist/user-config/index.d.ts",
|
|
91
|
+
"browser": "./dist/stubs/server-only.js",
|
|
92
|
+
"default": "./dist/user-config/index.js"
|
|
93
|
+
},
|
|
94
|
+
"./empty-config": {
|
|
95
|
+
"types": "./dist/stubs/empty-config.d.ts",
|
|
96
|
+
"default": "./dist/stubs/empty-config.js"
|
|
97
|
+
},
|
|
98
|
+
"./react": {
|
|
99
|
+
"types": "./dist/react/index.d.ts",
|
|
100
|
+
"default": "./dist/react/index.js"
|
|
101
|
+
},
|
|
102
|
+
"./editor": {
|
|
103
|
+
"types": "./dist/editor/index.d.ts",
|
|
104
|
+
"default": "./dist/editor/index.js"
|
|
105
|
+
},
|
|
106
|
+
"./styles.css": "./dist/styles.css",
|
|
107
|
+
"./tailwind.css": "./dist/tailwind.css",
|
|
108
|
+
"./reader.css": "./dist/reader.css",
|
|
109
|
+
"./package.json": "./package.json"
|
|
110
|
+
},
|
|
111
|
+
"scripts": {
|
|
112
|
+
"build": "node scripts/clean.mjs && tsup && node scripts/use-client.mjs && node scripts/check-bundles.mjs && npm run build:css",
|
|
113
|
+
"dev": "tsup --watch",
|
|
114
|
+
"typecheck": "tsc --noEmit",
|
|
115
|
+
"test": "vitest run",
|
|
116
|
+
"test:watch": "vitest",
|
|
117
|
+
"lint:pkg": "publint && node scripts/attw.mjs",
|
|
118
|
+
"prepublishOnly": "npm run typecheck && npm run test && npm run build && npm run lint:pkg",
|
|
119
|
+
"build:css": "tailwindcss -i src/styles.css -o dist/styles.css --minify && node scripts/unlayer-css.mjs && node scripts/copy-css.mjs"
|
|
120
|
+
},
|
|
121
|
+
"engines": {
|
|
122
|
+
"node": ">=20.9.0"
|
|
123
|
+
},
|
|
124
|
+
"dependencies": {
|
|
125
|
+
"@mdx-js/mdx": "^3.1.1",
|
|
126
|
+
"@tailwindcss/typography": "^0.5.20",
|
|
127
|
+
"@types/hast": "^3.0.4",
|
|
128
|
+
"approx-string-match": "^2.0.1",
|
|
129
|
+
"class-variance-authority": "^0.7.1",
|
|
130
|
+
"cn": "^0.5.1",
|
|
131
|
+
"github-slugger": "^2.0.0",
|
|
132
|
+
"gray-matter": "^4.0.3",
|
|
133
|
+
"hast-util-to-string": "^3.0.1",
|
|
134
|
+
"isomorphic-dompurify": "^4.6.0",
|
|
135
|
+
"jiti": "^2.7.0",
|
|
136
|
+
"lucide-react": "^1.66.0",
|
|
137
|
+
"next-themes": "^0.4.6",
|
|
138
|
+
"radix-ui": "^1.8.1",
|
|
139
|
+
"react-resizable-panels": "^4.16.1",
|
|
140
|
+
"rehype-parse": "^9.0.1",
|
|
141
|
+
"rehype-raw": "^7.0.0",
|
|
142
|
+
"rehype-stringify": "^10.0.1",
|
|
143
|
+
"remark-gfm": "^4.0.1",
|
|
144
|
+
"remark-parse": "^11.0.0",
|
|
145
|
+
"remark-rehype": "^11.1.2",
|
|
146
|
+
"sonner": "^2.0.8",
|
|
147
|
+
"tinyglobby": "^0.2.17",
|
|
148
|
+
"unified": "^11.0.5",
|
|
149
|
+
"unist-util-visit": "^5.2.0",
|
|
150
|
+
"vaul": "^1.1.2",
|
|
151
|
+
"vfile": "^6.0.3",
|
|
152
|
+
"zod": "^3.25.0 || ^4.0.0"
|
|
153
|
+
},
|
|
154
|
+
"peerDependencies": {
|
|
155
|
+
"@tiptap/core": "^3.0.0",
|
|
156
|
+
"@tiptap/extension-list": "^3.0.0",
|
|
157
|
+
"@tiptap/extensions": "^3.0.0",
|
|
158
|
+
"@tiptap/markdown": "^3.0.0",
|
|
159
|
+
"@tiptap/pm": "^3.0.0",
|
|
160
|
+
"@tiptap/react": "^3.0.0",
|
|
161
|
+
"@tiptap/starter-kit": "^3.0.0",
|
|
162
|
+
"next": ">=15.3.0",
|
|
163
|
+
"react": ">=19.0.0",
|
|
164
|
+
"react-dom": ">=19.0.0"
|
|
165
|
+
},
|
|
166
|
+
"peerDependenciesMeta": {
|
|
167
|
+
"@tiptap/core": {
|
|
168
|
+
"optional": true
|
|
169
|
+
},
|
|
170
|
+
"@tiptap/extension-list": {
|
|
171
|
+
"optional": true
|
|
172
|
+
},
|
|
173
|
+
"@tiptap/extensions": {
|
|
174
|
+
"optional": true
|
|
175
|
+
},
|
|
176
|
+
"@tiptap/markdown": {
|
|
177
|
+
"optional": true
|
|
178
|
+
},
|
|
179
|
+
"@tiptap/pm": {
|
|
180
|
+
"optional": true
|
|
181
|
+
},
|
|
182
|
+
"@tiptap/react": {
|
|
183
|
+
"optional": true
|
|
184
|
+
},
|
|
185
|
+
"@tiptap/starter-kit": {
|
|
186
|
+
"optional": true
|
|
187
|
+
},
|
|
188
|
+
"next": {
|
|
189
|
+
"optional": true
|
|
190
|
+
},
|
|
191
|
+
"react": {
|
|
192
|
+
"optional": true
|
|
193
|
+
},
|
|
194
|
+
"react-dom": {
|
|
195
|
+
"optional": true
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"devDependencies": {
|
|
199
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
200
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
201
|
+
"@tiptap/core": "^3.32.2",
|
|
202
|
+
"@tiptap/extension-list": "^3.32.2",
|
|
203
|
+
"@tiptap/extensions": "^3.32.2",
|
|
204
|
+
"@tiptap/markdown": "^3.32.2",
|
|
205
|
+
"@tiptap/pm": "^3.32.2",
|
|
206
|
+
"@tiptap/react": "^3.32.2",
|
|
207
|
+
"@tiptap/starter-kit": "^3.32.2",
|
|
208
|
+
"@types/node": "^22.19.0",
|
|
209
|
+
"@types/react": "^19.3.0",
|
|
210
|
+
"@types/react-dom": "^19.3.0",
|
|
211
|
+
"happy-dom": "^21.0.4",
|
|
212
|
+
"next": "16.3.5",
|
|
213
|
+
"postcss": "^8.5.32",
|
|
214
|
+
"publint": "^0.3.25",
|
|
215
|
+
"react": "19.3.0",
|
|
216
|
+
"react-dom": "19.3.0",
|
|
217
|
+
"tailwindcss": "^4.3.3",
|
|
218
|
+
"tsup": "^9.0.0",
|
|
219
|
+
"tw-animate-css": "^1.4.0",
|
|
220
|
+
"typescript": "^5.9.3",
|
|
221
|
+
"vitest": "^5.0.5",
|
|
222
|
+
"zod": "^3.25.76"
|
|
223
|
+
},
|
|
224
|
+
"publishConfig": {
|
|
225
|
+
"access": "public"
|
|
226
|
+
}
|
|
227
|
+
}
|