@abraca/junis 2.82.0 → 2.84.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/README.md +19 -14
- package/dist/module.json +1 -1
- package/dist/module.mjs +21 -2
- package/dist/runtime/assets/css/jun.css +1 -1
- package/dist/runtime/components/JunCampfireChat.vue +7 -5
- package/dist/runtime/components/JunCampfireComposer.d.vue.ts +27 -0
- package/dist/runtime/components/JunCampfireComposer.vue +158 -0
- package/dist/runtime/components/JunCampfireComposer.vue.d.ts +27 -0
- package/dist/runtime/components/JunCampfirePanel.vue +18 -28
- package/dist/runtime/components/JunCampfirePresence.client.vue +109 -9
- package/dist/runtime/components/JunCampfireReactions.d.vue.ts +13 -0
- package/dist/runtime/components/JunCampfireReactions.vue +142 -0
- package/dist/runtime/components/JunCampfireReactions.vue.d.ts +13 -0
- package/dist/runtime/components/JunCampfireRoster.vue +92 -41
- package/dist/runtime/components/JunCampfireYou.vue +9 -9
- package/dist/runtime/components/JunGlobeEditor.client.vue +396 -183
- package/dist/runtime/components/JunGlobeMap.client.vue +1 -0
- package/dist/runtime/components/JunHorizontalTimeline.vue +41 -4
- package/dist/runtime/components/JunImagePopup.client.vue +1 -1
- package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +9 -0
- package/dist/runtime/components/JunMosaicPane.client.vue +63 -3
- package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +9 -0
- package/dist/runtime/components/JunStudioBar.client.vue +2 -1
- package/dist/runtime/components/renderers/JunAppsRenderer.vue +5 -5
- package/dist/runtime/components/renderers/JunCvRenderer.vue +1 -1
- package/dist/runtime/components/renderers/JunEntryRenderer.vue +1 -1
- package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +2 -0
- package/dist/runtime/components/renderers/JunHomeRenderer.vue +2 -2
- package/dist/runtime/components/renderers/JunJournalRenderer.vue +6 -6
- package/dist/runtime/components/renderers/JunLiveRenderer.vue +2 -1
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue +14 -12
- package/dist/runtime/components/renderers/JunMovieRenderer.vue +1 -1
- package/dist/runtime/components/renderers/JunNowRenderer.vue +39 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.vue +2 -2
- package/dist/runtime/components/renderers/JunStatsRenderer.vue +15 -2
- package/dist/runtime/components/renderers/JunTrackRenderer.vue +44 -0
- package/dist/runtime/components/renderers/JunWallRenderer.vue +1 -0
- package/dist/runtime/composables/useJunCampfire.d.ts +2 -0
- package/dist/runtime/composables/useJunCampfire.js +11 -1
- package/dist/runtime/composables/useJunChrome.js +11 -2
- package/dist/runtime/composables/useJunDocMenu.d.ts +16 -1
- package/dist/runtime/composables/useJunDocMenu.js +8 -0
- package/dist/runtime/composables/useJunTheme.js +9 -0
- package/dist/runtime/layouts/jun.vue +10 -0
- package/dist/runtime/plugins/jun-fresh-server.client.d.ts +2 -0
- package/dist/runtime/plugins/jun-fresh-server.client.js +42 -0
- package/dist/runtime/server/janitor/junJanitorChores.d.ts +23 -2
- package/dist/runtime/server/janitor/junJanitorChores.js +74 -8
- package/dist/runtime/server/janitor/junJanitorMachine.js +16 -2
- package/dist/runtime/server/janitor/junJanitorStore.d.ts +35 -1
- package/dist/runtime/server/janitor/junJanitorStore.js +62 -4
- package/dist/runtime/server/plugins/jun-bootstrap.js +88 -3
- package/dist/runtime/server/utils/junVisibility.js +2 -0
- package/dist/runtime/types.d.ts +26 -0
- package/dist/runtime/utils/junVisibility.js +2 -0
- package/package.json +10 -8
|
@@ -245,9 +245,12 @@ function defaultTree(typeIds) {
|
|
|
245
245
|
label: "Wall",
|
|
246
246
|
type: typeIds.wall,
|
|
247
247
|
icon: "i-lucide-images",
|
|
248
|
-
// No children
|
|
249
|
-
//
|
|
250
|
-
//
|
|
248
|
+
// No children. A REAL deployment's wall starts empty on purpose — its
|
|
249
|
+
// items are the owner's photographs, and inventing two would put stock
|
|
250
|
+
// images on somebody's site. The playground seeds a pair (via
|
|
251
|
+
// `seedWallPhoto`, see `seedWallPhotos`) because a demo that cannot show
|
|
252
|
+
// the type is the thing that left the lightbox and this page's presence
|
|
253
|
+
// anchoring unverifiable for a release.
|
|
251
254
|
meta: { excerpt: "Drop images here to pin them." }
|
|
252
255
|
});
|
|
253
256
|
}
|
|
@@ -563,6 +566,7 @@ async function bootstrap(ctx, seed) {
|
|
|
563
566
|
}
|
|
564
567
|
}
|
|
565
568
|
await writeBodies(ctx, flat);
|
|
569
|
+
await seedWallPhotos(ctx, flat, tree);
|
|
566
570
|
console.log(`[jun:bootstrap] seeded ${flat.length} documents \u2014 site is live`);
|
|
567
571
|
} finally {
|
|
568
572
|
try {
|
|
@@ -571,6 +575,87 @@ async function bootstrap(ctx, seed) {
|
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
577
|
}
|
|
578
|
+
function crc32(buf) {
|
|
579
|
+
let c = ~0;
|
|
580
|
+
for (let i = 0; i < buf.length; i++) {
|
|
581
|
+
c ^= buf[i];
|
|
582
|
+
for (let k = 0; k < 8; k++) c = c >>> 1 ^ 3988292384 & -(c & 1);
|
|
583
|
+
}
|
|
584
|
+
return ~c >>> 0;
|
|
585
|
+
}
|
|
586
|
+
function pngChunk(type, data) {
|
|
587
|
+
const typeBytes = new TextEncoder().encode(type);
|
|
588
|
+
const body = new Uint8Array(typeBytes.length + data.length);
|
|
589
|
+
body.set(typeBytes);
|
|
590
|
+
body.set(data, typeBytes.length);
|
|
591
|
+
const out = new Uint8Array(8 + data.length + 4);
|
|
592
|
+
const view = new DataView(out.buffer);
|
|
593
|
+
view.setUint32(0, data.length);
|
|
594
|
+
out.set(body, 4);
|
|
595
|
+
view.setUint32(4 + body.length, crc32(body));
|
|
596
|
+
return out;
|
|
597
|
+
}
|
|
598
|
+
async function makePng(width, height, hue) {
|
|
599
|
+
const { deflateSync } = await import("node:zlib");
|
|
600
|
+
const raw = new Uint8Array(height * (1 + width * 3));
|
|
601
|
+
let p = 0;
|
|
602
|
+
for (let y = 0; y < height; y++) {
|
|
603
|
+
raw[p++] = 0;
|
|
604
|
+
for (let x = 0; x < width; x++) {
|
|
605
|
+
const t = (x / width + y / height) / 2;
|
|
606
|
+
raw[p++] = Math.round(40 + 180 * t * Math.abs(Math.cos(hue)));
|
|
607
|
+
raw[p++] = Math.round(60 + 150 * (1 - t) * Math.abs(Math.sin(hue * 1.7)));
|
|
608
|
+
raw[p++] = Math.round(90 + 140 * t);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const ihdr = new Uint8Array(13);
|
|
612
|
+
const iv = new DataView(ihdr.buffer);
|
|
613
|
+
iv.setUint32(0, width);
|
|
614
|
+
iv.setUint32(4, height);
|
|
615
|
+
ihdr[8] = 8;
|
|
616
|
+
ihdr[9] = 2;
|
|
617
|
+
const idat = new Uint8Array(deflateSync(Buffer.from(raw)));
|
|
618
|
+
const parts = [
|
|
619
|
+
new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]),
|
|
620
|
+
pngChunk("IHDR", ihdr),
|
|
621
|
+
pngChunk("IDAT", idat),
|
|
622
|
+
pngChunk("IEND", new Uint8Array(0))
|
|
623
|
+
];
|
|
624
|
+
const total = parts.reduce((n, part) => n + part.length, 0);
|
|
625
|
+
const png = new Uint8Array(total);
|
|
626
|
+
let at = 0;
|
|
627
|
+
for (const part of parts) {
|
|
628
|
+
png.set(part, at);
|
|
629
|
+
at += part.length;
|
|
630
|
+
}
|
|
631
|
+
return png;
|
|
632
|
+
}
|
|
633
|
+
async function seedWallPhotos(ctx, flat, tree) {
|
|
634
|
+
const photos = flat.filter((n) => n.meta?.seedWallPhoto);
|
|
635
|
+
if (!photos.length) return;
|
|
636
|
+
let seeded = 0;
|
|
637
|
+
for (const [index, node] of photos.entries()) {
|
|
638
|
+
try {
|
|
639
|
+
const png = await makePng(1200, 800, 0.7 + index * 1.3);
|
|
640
|
+
const meta = await ctx.client.upload(node.id, new Blob([png], { type: "image/png" }), `${node.id}.png`);
|
|
641
|
+
const uploadId = meta?.id ?? meta?.upload_id;
|
|
642
|
+
if (!uploadId) throw new Error("upload returned no id");
|
|
643
|
+
const entry = tree.get(node.id);
|
|
644
|
+
if (!entry) throw new Error("tree entry vanished");
|
|
645
|
+
const entryMeta = { ...entry.meta ?? {} };
|
|
646
|
+
delete entryMeta.seedWallPhoto;
|
|
647
|
+
tree.set(node.id, {
|
|
648
|
+
...entry,
|
|
649
|
+
updatedAt: Date.now(),
|
|
650
|
+
meta: { ...entryMeta, coverUploadId: uploadId, coverMimeType: "image/png" }
|
|
651
|
+
});
|
|
652
|
+
seeded++;
|
|
653
|
+
} catch (err) {
|
|
654
|
+
console.warn(`[jun:bootstrap] wall photo "${node.label}" failed:`, err?.message ?? err);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
if (seeded) console.log(`[jun:bootstrap] uploaded ${seeded} wall photo(s)`);
|
|
658
|
+
}
|
|
574
659
|
function attachJsonNodes(target, nodes) {
|
|
575
660
|
for (const node of nodes) {
|
|
576
661
|
if (node.kind === "element") {
|
|
@@ -2,5 +2,7 @@ export function isJunOwnerOnlyDoc(entry) {
|
|
|
2
2
|
if (!entry) return false;
|
|
3
3
|
if (entry.type === "jun-config") return true;
|
|
4
4
|
if (entry.meta?.siteConfig === true) return true;
|
|
5
|
+
if (entry.meta?.ownerOnly === true) return true;
|
|
6
|
+
if (entry.meta?.janitorBaseline === true) return true;
|
|
5
7
|
return entry.meta?.campfire === true;
|
|
6
8
|
}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -60,6 +60,21 @@ export interface JunFeatures {
|
|
|
60
60
|
awareBlobs?: boolean;
|
|
61
61
|
/** Named site-wide cursors. Off by default — reads as surveillance, not company. */
|
|
62
62
|
peerCursors?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Paint the text selection of the traveller you are FOLLOWING.
|
|
65
|
+
*
|
|
66
|
+
* Only theirs, and only while you follow them: a visitor highlighting a
|
|
67
|
+
* sentence to copy it is not performing, and eight anonymous highlights
|
|
68
|
+
* moving at once is noise rather than presence. Following someone is the
|
|
69
|
+
* moment it becomes useful — you are reading over their shoulder, and what
|
|
70
|
+
* they have picked out is the point.
|
|
71
|
+
*
|
|
72
|
+
* The broadcast still runs for everyone, because it must: a leader who
|
|
73
|
+
* follows nobody would otherwise have nothing for their follower to mirror.
|
|
74
|
+
* It runs in `selectionOnly` mode, so it costs one `selectionchange`
|
|
75
|
+
* listener and nothing per pointer move.
|
|
76
|
+
*/
|
|
77
|
+
peerSelection?: boolean;
|
|
63
78
|
/** Dot stack + roster in the nav's right cluster. Off by default — reads as a "who's online" widget. */
|
|
64
79
|
travellersChip?: boolean;
|
|
65
80
|
/** Slide-up chat panel with emoji embers and follow-a-traveller. Off by default. */
|
|
@@ -445,6 +460,17 @@ export interface JunCampfireOptions {
|
|
|
445
460
|
identity?: boolean;
|
|
446
461
|
/** Emoji embers, rising in the corner whether or not the panel is open. */
|
|
447
462
|
reactions?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Speech bubbles beside a CLOSED hearth when somebody speaks.
|
|
465
|
+
*
|
|
466
|
+
* A collapsed user center only ever showed a number — you learned that
|
|
467
|
+
* somebody had said something, never what, and the only way to find out was
|
|
468
|
+
* to open the panel. A reaction already warms the corner while the panel is
|
|
469
|
+
* shut (that is what the embers are for); a sentence did not.
|
|
470
|
+
*
|
|
471
|
+
* Requires `chat`. Never shows your own words, and never replays history.
|
|
472
|
+
*/
|
|
473
|
+
bubbles?: boolean;
|
|
448
474
|
/** Tap a traveller to follow their journey through the site. */
|
|
449
475
|
follow?: boolean;
|
|
450
476
|
/** Show which page each traveller is on. Off is the more private choice. */
|
|
@@ -2,5 +2,7 @@ export function isJunOwnerOnlyDoc(entry) {
|
|
|
2
2
|
if (!entry) return false;
|
|
3
3
|
if (entry.type === "jun-config") return true;
|
|
4
4
|
if (entry.meta?.siteConfig === true) return true;
|
|
5
|
+
if (entry.meta?.ownerOnly === true) return true;
|
|
6
|
+
if (entry.meta?.janitorBaseline === true) return true;
|
|
5
7
|
return entry.meta?.campfire === true;
|
|
6
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abraca/junis",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.84.0",
|
|
4
4
|
"description": "Website-builder Nuxt module for the Abracadabra CRDT platform — page-type renderers, presence chrome, studio editing and SSR, all driven by documents",
|
|
5
5
|
"repository": "abracadabra/jun-is",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"//deps": "SINGLETONS ARE PEERS, NEVER DEPENDENCIES. @abraca/convert was a dependency until 2.79.0 and had to move: it peers on yjs, and a nested second copy of it means a Y.XmlElement built by one yjs crossing into a fragment owned by another — 'Unexpected content type in insert operation', which no bundler config fixes. Same reason @tiptap/core, vue and yjs are peers. Anything holding global identity or editor/CRDT state belongs here so the app resolves exactly one copy; wand.toml [pins] + `wand doctor` enforce the versions.",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@abraca/convert": "^2.
|
|
37
|
-
"@abraca/dabra": "^2.
|
|
38
|
-
"@abraca/nuxt": "^2.
|
|
36
|
+
"@abraca/convert": "^2.83.0",
|
|
37
|
+
"@abraca/dabra": "^2.83.0",
|
|
38
|
+
"@abraca/nuxt": "^2.83.0",
|
|
39
39
|
"@nuxt/fonts": "^0.14.0",
|
|
40
40
|
"@nuxt/icon": "^2.0.0",
|
|
41
41
|
"@nuxt/image": "^2.0.0",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@abraca/convert": "^2.
|
|
68
|
-
"@abraca/dabra": "^2.
|
|
69
|
-
"@abraca/nuxt": "^2.
|
|
67
|
+
"@abraca/convert": "^2.83.0",
|
|
68
|
+
"@abraca/dabra": "^2.83.0",
|
|
69
|
+
"@abraca/nuxt": "^2.83.0",
|
|
70
70
|
"@iconify-json/lucide": "^1.2.108",
|
|
71
71
|
"@iconify-json/simple-icons": "^1.2.83",
|
|
72
72
|
"@nuxt/eslint-config": "^1.15.2",
|
|
@@ -99,6 +99,7 @@
|
|
|
99
99
|
"dev:clean": "node scripts/dev-clean.mjs",
|
|
100
100
|
"lint": "eslint .",
|
|
101
101
|
"janitor:watch": "node scripts/janitor-watch.mjs",
|
|
102
|
+
"janitor:verify": "node scripts/janitor-verify.mjs",
|
|
102
103
|
"test": "node scripts/test.mjs",
|
|
103
104
|
"parity": "node scripts/parity-ssr.mjs",
|
|
104
105
|
"parity:nav": "node scripts/parity-nav.mjs",
|
|
@@ -107,6 +108,7 @@
|
|
|
107
108
|
"docker:up": "docker compose up -d --build",
|
|
108
109
|
"docker:down": "docker compose down",
|
|
109
110
|
"docker:logs": "docker compose logs -f",
|
|
110
|
-
"docker:reset": "node scripts/docker-reset.mjs"
|
|
111
|
+
"docker:reset": "node scripts/docker-reset.mjs",
|
|
112
|
+
"janitor:inspect": "node scripts/janitor-inspect.mjs"
|
|
111
113
|
}
|
|
112
114
|
}
|