@quartz-community/encrypted-pages 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.
@@ -0,0 +1,63 @@
1
+ export { BuildCtx, CSSResource, ChangeEvent, JSResource, PageGenerator, PageMatcher, ProcessedContent, QuartzEmitterPlugin, QuartzEmitterPluginInstance, QuartzFilterPlugin, QuartzFilterPluginInstance, QuartzPageTypePlugin, QuartzPageTypePluginInstance, QuartzPluginData, QuartzTransformerPlugin, QuartzTransformerPluginInstance, StaticResources, VirtualPage } from '@quartz-community/types';
2
+
3
+ interface EncryptedPagesOptions {
4
+ /**
5
+ * PBKDF2 iteration count for key derivation.
6
+ * Higher = slower brute-force attacks, but also slower page unlock.
7
+ *
8
+ * @default 600_000
9
+ */
10
+ iterations: number;
11
+ /**
12
+ * Frontmatter field name that holds the page password.
13
+ *
14
+ * @default "password"
15
+ */
16
+ passwordField: string;
17
+ /**
18
+ * When `true`, encrypted pages are marked `file.data.unlisted = true`,
19
+ * hiding them from every build-time listing surface that respects the
20
+ * `unlisted` convention (contentIndex, RSS, sitemap, backlinks,
21
+ * recent-notes, folder-page, tag-page, graph, explorer, search).
22
+ *
23
+ * The page HTML is still emitted, so the page remains accessible by
24
+ * its direct URL. After successful client-side decryption, the page is
25
+ * dynamically added back to client-side discovery surfaces (graph,
26
+ * explorer, search) via the shadow content index emitted by
27
+ * {@link EncryptedContentIndex}.
28
+ *
29
+ * Per-page frontmatter `unlisted: true | false` overrides this option.
30
+ *
31
+ * NOTE: When `true`, the `EncryptedContentIndex` emitter MUST also be
32
+ * registered in your Quartz configuration. Without it, unlisted encrypted
33
+ * pages cannot be dynamically revealed after decryption and will remain
34
+ * invisible to graph/explorer/search for the entire session. The
35
+ * transformer emits a console warning at build time if it detects the
36
+ * emitter is missing.
37
+ *
38
+ * @default false
39
+ */
40
+ unlistWhenEncrypted: boolean;
41
+ }
42
+ interface EncryptedContentIndexOptions {
43
+ /**
44
+ * Output path for the shadow content index, relative to the Quartz output
45
+ * directory. The file is a JSON document wrapping a flat array of opaque
46
+ * encrypted blobs; see the README for the format.
47
+ *
48
+ * @default "static/encryptedContentIndex.json"
49
+ */
50
+ outputPath: string;
51
+ /**
52
+ * Frontmatter field name that holds the page password. Must match the
53
+ * `passwordField` used by the companion {@link EncryptedPages} transformer.
54
+ * When both plugins are loaded from the same package entry in
55
+ * quartz.config.yaml, Quartz passes the same merged options to both,
56
+ * so this field is automatically kept in sync.
57
+ *
58
+ * @default "password"
59
+ */
60
+ passwordField: string;
61
+ }
62
+
63
+ export type { EncryptedContentIndexOptions, EncryptedPagesOptions };
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=types.js.map
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
package/package.json ADDED
@@ -0,0 +1,137 @@
1
+ {
2
+ "name": "@quartz-community/encrypted-pages",
3
+ "version": "0.1.0",
4
+ "description": "Password-protected encrypted pages for Quartz. Encrypts page content at build time with AES-256-GCM and decrypts client-side using the Web Crypto API.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Quartz Community",
8
+ "homepage": "https://quartz.jzhao.xyz",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/quartz-community/encrypted-pages"
12
+ },
13
+ "keywords": [
14
+ "quartz",
15
+ "quartz-plugin",
16
+ "encrypted-pages",
17
+ "password-protected",
18
+ "encryption",
19
+ "aes-gcm",
20
+ "rehype",
21
+ "hast"
22
+ ],
23
+ "files": [
24
+ "dist",
25
+ "README.md",
26
+ "LICENSE",
27
+ "CHANGELOG.md"
28
+ ],
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ },
34
+ "./types": {
35
+ "types": "./dist/types.d.ts",
36
+ "import": "./dist/types.js"
37
+ },
38
+ "./components": {
39
+ "types": "./dist/components/index.d.ts",
40
+ "import": "./dist/components/index.js"
41
+ },
42
+ "./package.json": "./package.json"
43
+ },
44
+ "main": "./dist/index.js",
45
+ "types": "./dist/index.d.ts",
46
+ "sideEffects": false,
47
+ "scripts": {
48
+ "build": "tsup",
49
+ "dev": "tsup --watch",
50
+ "lint": "eslint . --max-warnings=0",
51
+ "format": "prettier . --check",
52
+ "test": "vitest run",
53
+ "typecheck": "tsc --noEmit",
54
+ "check": "npm run typecheck && npm run lint && npm run format && npm run test",
55
+ "prepublishOnly": "npm run build"
56
+ },
57
+ "peerDependencies": {
58
+ "preact": "^10.0.0",
59
+ "vfile": "^6.0.3"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "preact": {
63
+ "optional": false
64
+ },
65
+ "vfile": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "dependencies": {
70
+ "@quartz-community/types": "^0.2.1",
71
+ "@quartz-community/utils": "^0.1.0"
72
+ },
73
+ "devDependencies": {
74
+ "@types/hast": "^3.0.4",
75
+ "@types/node": "^24.10.0",
76
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
77
+ "@typescript-eslint/parser": "^7.18.0",
78
+ "eslint": "^8.57.0",
79
+ "eslint-config-prettier": "^9.1.0",
80
+ "hast-util-to-html": "^9.0.4",
81
+ "preact": "^10.28.2",
82
+ "prettier": "^3.6.2",
83
+ "sass": "^1.97.3",
84
+ "tsup": "^8.5.0",
85
+ "typescript": "^5.9.3",
86
+ "unified": "^11.0.5",
87
+ "vfile": "^6.0.3",
88
+ "vitest": "^2.1.9"
89
+ },
90
+ "quartz": {
91
+ "name": "encrypted-pages",
92
+ "displayName": "Encrypted Pages",
93
+ "category": [
94
+ "transformer",
95
+ "emitter"
96
+ ],
97
+ "version": "1.0.0",
98
+ "quartzVersion": ">=5.0.0",
99
+ "dependencies": [],
100
+ "defaultOrder": 900,
101
+ "defaultEnabled": true,
102
+ "defaultOptions": {
103
+ "iterations": 600000,
104
+ "passwordField": "password",
105
+ "unlistWhenEncrypted": false,
106
+ "outputPath": "static/encryptedContentIndex.json"
107
+ },
108
+ "optionSchema": {
109
+ "iterations": {
110
+ "type": "number"
111
+ },
112
+ "passwordField": {
113
+ "type": "string"
114
+ },
115
+ "unlistWhenEncrypted": {
116
+ "type": "boolean"
117
+ },
118
+ "outputPath": {
119
+ "type": "string"
120
+ }
121
+ },
122
+ "components": {
123
+ "EncryptedPage": {
124
+ "displayName": "Encrypted Page",
125
+ "defaultPosition": "body",
126
+ "defaultPriority": 100
127
+ }
128
+ }
129
+ },
130
+ "engines": {
131
+ "node": ">=22",
132
+ "npm": ">=10.9.2"
133
+ },
134
+ "publishConfig": {
135
+ "access": "public"
136
+ }
137
+ }