@scalemule/news-publication 0.0.7
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/LICENSE +21 -0
- package/README.md +74 -0
- package/cookie-consent.css +419 -0
- package/dist/chunk-C7JTEHTH.js +158 -0
- package/dist/chunk-GB36YM56.js +72 -0
- package/dist/chunk-PYCU2T5O.js +93 -0
- package/dist/chunk-R33MJWND.js +261 -0
- package/dist/chunk-TJ7RL3PV.js +252 -0
- package/dist/chunk-YQXS2KQI.js +112 -0
- package/dist/cookie-consent-banner.cjs +210 -0
- package/dist/cookie-consent-banner.d.cts +19 -0
- package/dist/cookie-consent-banner.d.ts +19 -0
- package/dist/cookie-consent-banner.js +3 -0
- package/dist/cookie-settings-view.cjs +470 -0
- package/dist/cookie-settings-view.d.cts +15 -0
- package/dist/cookie-settings-view.d.ts +15 -0
- package/dist/cookie-settings-view.js +3 -0
- package/dist/index.cjs +1460 -0
- package/dist/index.d.cts +317 -0
- package/dist/index.d.ts +317 -0
- package/dist/index.js +441 -0
- package/dist/marketplace-Ch7mdJZv.d.cts +123 -0
- package/dist/marketplace-Ch7mdJZv.d.ts +123 -0
- package/dist/marketplace-forms.cjs +134 -0
- package/dist/marketplace-forms.d.cts +10 -0
- package/dist/marketplace-forms.d.ts +10 -0
- package/dist/marketplace-forms.js +115 -0
- package/dist/marketplace-view.cjs +110 -0
- package/dist/marketplace-view.d.cts +21 -0
- package/dist/marketplace-view.d.ts +21 -0
- package/dist/marketplace-view.js +85 -0
- package/dist/meet-5Ym5bxfh.d.cts +79 -0
- package/dist/meet-5Ym5bxfh.d.ts +79 -0
- package/dist/meet-forms.cjs +188 -0
- package/dist/meet-forms.d.cts +13 -0
- package/dist/meet-forms.d.ts +13 -0
- package/dist/meet-forms.js +166 -0
- package/dist/meet-view.cjs +82 -0
- package/dist/meet-view.d.cts +23 -0
- package/dist/meet-view.d.ts +23 -0
- package/dist/meet-view.js +59 -0
- package/dist/snapshot-BS4hn1dk.d.cts +234 -0
- package/dist/snapshot-BS4hn1dk.d.ts +234 -0
- package/dist/snapshot-file.cjs +192 -0
- package/dist/snapshot-file.d.cts +21 -0
- package/dist/snapshot-file.d.ts +21 -0
- package/dist/snapshot-file.js +38 -0
- package/marketplace.css +61 -0
- package/package.json +103 -0
- package/tokens/broadsheet.css +61 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { parseSnapshot, acceptSnapshot, syncPublication } from './chunk-C7JTEHTH.js';
|
|
2
|
+
import { randomBytes } from 'crypto';
|
|
3
|
+
import { readFile, writeFile, rename, unlink } from 'fs/promises';
|
|
4
|
+
import { join, dirname } from 'path';
|
|
5
|
+
|
|
6
|
+
async function readSnapshotFile(file) {
|
|
7
|
+
try {
|
|
8
|
+
return parseSnapshot(await readFile(file, "utf8"));
|
|
9
|
+
} catch {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
async function writeSnapshotFile(file, snapshot) {
|
|
14
|
+
const accepted = acceptSnapshot(snapshot);
|
|
15
|
+
if (!accepted) throw new Error("Refusing to store an incomplete publication snapshot");
|
|
16
|
+
const temporary = join(dirname(file), `.publication-snapshot-${randomBytes(6).toString("hex")}.tmp`);
|
|
17
|
+
await writeFile(temporary, `${JSON.stringify(accepted)}
|
|
18
|
+
`, "utf8");
|
|
19
|
+
try {
|
|
20
|
+
await rename(temporary, file);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
await unlink(temporary).catch(() => void 0);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function syncPublicationFile(input) {
|
|
27
|
+
const previous = await readSnapshotFile(input.file);
|
|
28
|
+
const synced = await syncPublication({ ...input, previous });
|
|
29
|
+
if (synced.source === "fresh") {
|
|
30
|
+
try {
|
|
31
|
+
await writeSnapshotFile(input.file, synced.snapshot);
|
|
32
|
+
} catch {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return synced;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { readSnapshotFile, syncPublicationFile, writeSnapshotFile };
|
package/marketplace.css
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.np-market { max-width: 820px; }
|
|
2
|
+
.np-market h1 {
|
|
3
|
+
font: 600 clamp(36px, 4vw, 52px)/1.08 var(--pub-serif);
|
|
4
|
+
letter-spacing: -0.03em;
|
|
5
|
+
margin: 0 0 12px;
|
|
6
|
+
}
|
|
7
|
+
.np-market .lead { max-width: 62ch; font: 18px/1.65 var(--pub-serif); color: var(--pub-muted, #545c55); margin: 0 0 28px; }
|
|
8
|
+
.np-market .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 28px; }
|
|
9
|
+
.np-market .primary, .np-market .secondary {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
min-height: 44px;
|
|
13
|
+
padding: 10px 16px;
|
|
14
|
+
font: 700 13px/1.2 var(--pub-sans);
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
}
|
|
18
|
+
.np-market .primary { background: var(--pub-accent, #bb171d); color: #fff; border: 0; }
|
|
19
|
+
.np-market .secondary { background: #fff; color: var(--pub-ink, #171917); border: 1px solid var(--pub-ink, #171917); }
|
|
20
|
+
.np-market .primary:hover, .np-market .secondary:hover { color: var(--pub-accent, #bb171d); }
|
|
21
|
+
.np-market .primary:hover { background: #fff; border: 1px solid var(--pub-accent, #bb171d); }
|
|
22
|
+
.np-market .list { display: grid; }
|
|
23
|
+
.np-market .item {
|
|
24
|
+
display: block;
|
|
25
|
+
padding: 18px 0;
|
|
26
|
+
border-top: 1px solid var(--pub-rule, #d7dcd7);
|
|
27
|
+
text-decoration: none;
|
|
28
|
+
color: inherit;
|
|
29
|
+
}
|
|
30
|
+
.np-market .item h2 { font: 600 26px/1.2 var(--pub-serif); margin: 0 0 6px; }
|
|
31
|
+
.np-market .item:hover h2 { color: var(--pub-accent, #bb171d); text-decoration: underline; text-underline-offset: 4px; }
|
|
32
|
+
.np-market .meta { font: 13px/1.5 var(--pub-sans); color: var(--pub-muted, #545c55); }
|
|
33
|
+
.np-market .meta a:hover { color: var(--pub-accent, #bb171d); }
|
|
34
|
+
.np-market .body { white-space: pre-wrap; font: 18px/1.65 var(--pub-serif); }
|
|
35
|
+
.np-market .search { display: flex; gap: 8px; margin: 0 0 20px; }
|
|
36
|
+
.np-market .search input { flex: 1; min-height: 44px; border: 1px solid #8a918b; padding: 10px 12px; font: 16px/1.4 var(--pub-sans); }
|
|
37
|
+
.np-market .form { display: grid; gap: 14px; max-width: 560px; }
|
|
38
|
+
.np-market .form label { display: grid; gap: 6px; font: 700 13px/1.3 var(--pub-sans); }
|
|
39
|
+
.np-market .form input, .np-market .form select, .np-market .form textarea {
|
|
40
|
+
min-height: 44px;
|
|
41
|
+
border: 1px solid #8a918b;
|
|
42
|
+
padding: 10px 12px;
|
|
43
|
+
font: 16px/1.4 var(--pub-sans);
|
|
44
|
+
background: #fff;
|
|
45
|
+
color: inherit;
|
|
46
|
+
}
|
|
47
|
+
.np-market .form textarea { min-height: 140px; resize: vertical; }
|
|
48
|
+
.np-market .error { color: var(--pub-accent, #bb171d); font: 14px/1.4 var(--pub-sans); }
|
|
49
|
+
.np-market .empty { border-block: 1px solid var(--pub-rule, #d7dcd7); padding: 32px 0; max-width: 640px; }
|
|
50
|
+
.np-market .empty h2 { font: 600 28px/1.15 var(--pub-serif); }
|
|
51
|
+
.np-market .filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
|
|
52
|
+
.np-market .filter a {
|
|
53
|
+
min-height: 36px;
|
|
54
|
+
padding: 6px 10px;
|
|
55
|
+
border: 1px solid var(--pub-rule, #d7dcd7);
|
|
56
|
+
background: #fff;
|
|
57
|
+
font: 13px/1.4 var(--pub-sans);
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
color: inherit;
|
|
60
|
+
}
|
|
61
|
+
.np-market .filter a.on, .np-market .filter a:hover { border-color: var(--pub-ink, #171917); color: var(--pub-accent, #bb171d); }
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@scalemule/news-publication",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "Shared server framework for ScaleMule local news publications. Walnut Creek Times is the broadsheet default; each paper supplies its own identity and feature flags.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./tokens.css": "./tokens/broadsheet.css",
|
|
16
|
+
"./snapshot-file": {
|
|
17
|
+
"types": "./dist/snapshot-file.d.ts",
|
|
18
|
+
"import": "./dist/snapshot-file.js",
|
|
19
|
+
"require": "./dist/snapshot-file.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./marketplace": {
|
|
22
|
+
"types": "./dist/marketplace-view.d.ts",
|
|
23
|
+
"import": "./dist/marketplace-view.js",
|
|
24
|
+
"require": "./dist/marketplace-view.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./marketplace-forms": {
|
|
27
|
+
"types": "./dist/marketplace-forms.d.ts",
|
|
28
|
+
"import": "./dist/marketplace-forms.js",
|
|
29
|
+
"require": "./dist/marketplace-forms.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./marketplace.css": "./marketplace.css",
|
|
32
|
+
"./meet": {
|
|
33
|
+
"types": "./dist/meet-view.d.ts",
|
|
34
|
+
"import": "./dist/meet-view.js",
|
|
35
|
+
"require": "./dist/meet-view.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./meet-forms": {
|
|
38
|
+
"types": "./dist/meet-forms.d.ts",
|
|
39
|
+
"import": "./dist/meet-forms.js",
|
|
40
|
+
"require": "./dist/meet-forms.cjs"
|
|
41
|
+
},
|
|
42
|
+
"./cookie-consent-banner": {
|
|
43
|
+
"types": "./dist/cookie-consent-banner.d.ts",
|
|
44
|
+
"import": "./dist/cookie-consent-banner.js",
|
|
45
|
+
"require": "./dist/cookie-consent-banner.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./cookie-settings-view": {
|
|
48
|
+
"types": "./dist/cookie-settings-view.d.ts",
|
|
49
|
+
"import": "./dist/cookie-settings-view.js",
|
|
50
|
+
"require": "./dist/cookie-settings-view.cjs"
|
|
51
|
+
},
|
|
52
|
+
"./cookie-consent.css": "./cookie-consent.css"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"tokens",
|
|
57
|
+
"marketplace.css",
|
|
58
|
+
"cookie-consent.css",
|
|
59
|
+
"README.md",
|
|
60
|
+
"LICENSE"
|
|
61
|
+
],
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": ">=18.0.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"react": { "optional": true }
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"prepare": "npm run build",
|
|
70
|
+
"build": "tsup && node scripts/mark-client-forms.mjs",
|
|
71
|
+
"dev": "tsup --watch",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"lint": "tsc --noEmit",
|
|
74
|
+
"prepublishOnly": "node -e \"const v=require('./package.json').version; if(!/^0\\.(0|1)\\.\\d+$/.test(v)){console.error('ERR: SDK '+v+' violates patch-only policy (0.0.x or 0.1.x only). See CONTRIBUTING.md SDK versioning section.');process.exit(1)}\" && npm run lint && npm test && npm run build"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/node": "^22.15.0",
|
|
78
|
+
"@types/react": "^19.1.0",
|
|
79
|
+
"react": "^19.1.0",
|
|
80
|
+
"tsup": "^8.5.0",
|
|
81
|
+
"typescript": "^5.8.3",
|
|
82
|
+
"vitest": "^3.2.4"
|
|
83
|
+
},
|
|
84
|
+
"keywords": [
|
|
85
|
+
"scalemule",
|
|
86
|
+
"news",
|
|
87
|
+
"publication",
|
|
88
|
+
"napsite"
|
|
89
|
+
],
|
|
90
|
+
"license": "MIT",
|
|
91
|
+
"repository": {
|
|
92
|
+
"type": "git",
|
|
93
|
+
"url": "git+https://github.com/scalemule/news-publication.git"
|
|
94
|
+
},
|
|
95
|
+
"author": "ScaleMule Inc. <support@scalemule.com>",
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=18.0.0"
|
|
98
|
+
},
|
|
99
|
+
"publishConfig": {
|
|
100
|
+
"access": "public",
|
|
101
|
+
"registry": "https://registry.npmjs.org/"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Broadsheet type scale from Walnut Creek Times.
|
|
3
|
+
* Source Serif 4 (`--font-editorial`) and Inter (`--font-inter`) apply at every
|
|
4
|
+
* width. The site loads those faces in its root layout. Georgia and Arial are
|
|
5
|
+
* the fallback before the files arrive.
|
|
6
|
+
* A paper overrides --pub-accent and --pub-serif on `.publication`.
|
|
7
|
+
*/
|
|
8
|
+
.publication {
|
|
9
|
+
--pub-paper: #fff;
|
|
10
|
+
--pub-ink: #171917;
|
|
11
|
+
--pub-muted: #545c55;
|
|
12
|
+
--pub-accent: #bb171d;
|
|
13
|
+
--pub-rule: #d7dcd7;
|
|
14
|
+
--pub-soft: #f5f6f3;
|
|
15
|
+
--pub-sponsor: #173d32;
|
|
16
|
+
--pub-serif: var(--font-editorial), Georgia, "Times New Roman", serif;
|
|
17
|
+
--pub-editorial: var(--font-editorial), Georgia, "Times New Roman", serif;
|
|
18
|
+
--pub-sans: var(--font-inter), Arial, Helvetica, sans-serif;
|
|
19
|
+
--pub-width: 1240px;
|
|
20
|
+
--pub-reading: 720px;
|
|
21
|
+
--pub-gutter: clamp(16px, 3vw, 40px);
|
|
22
|
+
--pub-space-1: 8px;
|
|
23
|
+
--pub-space-2: 16px;
|
|
24
|
+
--pub-space-3: 24px;
|
|
25
|
+
--pub-space-4: 32px;
|
|
26
|
+
--pub-space-5: 48px;
|
|
27
|
+
--pub-space-6: 64px;
|
|
28
|
+
--pub-small: 0.75rem;
|
|
29
|
+
--pub-label: 0.8125rem;
|
|
30
|
+
--pub-navigation: 0.9375rem;
|
|
31
|
+
--pub-front-lead: clamp(2rem, 3.2vw, 2.75rem);
|
|
32
|
+
--pub-front-secondary: 1.625rem;
|
|
33
|
+
--pub-front-brief: 1.25rem;
|
|
34
|
+
--pub-body: 1.125rem;
|
|
35
|
+
--pub-deck: 1.25rem;
|
|
36
|
+
--pub-headline: clamp(1.5rem, 2.1vw, 1.875rem);
|
|
37
|
+
--pub-major: clamp(1.875rem, 3vw, 2.5rem);
|
|
38
|
+
--pub-lead: clamp(2rem, 4vw, 3.25rem);
|
|
39
|
+
background: var(--pub-paper);
|
|
40
|
+
color: var(--pub-ink);
|
|
41
|
+
font-family: var(--pub-sans);
|
|
42
|
+
font-size: var(--pub-body);
|
|
43
|
+
line-height: 1.5;
|
|
44
|
+
min-height: 100dvh;
|
|
45
|
+
overflow-wrap: break-word;
|
|
46
|
+
}
|
|
47
|
+
.publication *, .publication *::before, .publication *::after { box-sizing: border-box; }
|
|
48
|
+
.publication :focus-visible { outline: 3px solid #a95c00; outline-offset: 4px; }
|
|
49
|
+
.publication a, .publication button, .publication summary { touch-action: manipulation; }
|
|
50
|
+
.publication img { max-width: 100%; }
|
|
51
|
+
.publication h1, .publication h2, .publication h3 {
|
|
52
|
+
font-family: var(--pub-serif);
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
line-height: 1.15;
|
|
55
|
+
text-wrap: pretty;
|
|
56
|
+
}
|
|
57
|
+
.publication [id] { scroll-margin-top: 24px; }
|
|
58
|
+
.publication ::selection { background: #f6dcdd; color: var(--pub-ink); }
|
|
59
|
+
@media (min-width: 960px) {
|
|
60
|
+
.publication { --pub-width: 1280px; }
|
|
61
|
+
}
|