openvibers/openvibe.shared files.js

files.js

main 13.5 KB · 156 lines · javascript

1'use strict';
2// ═══════════════════════════════════════════════════════════════
3// openvibe-shared/files — which files of this package are browser scripts.
4// Sites serve exactly these at /shared/<file> (openvibe-sw.js at /openvibe-sw.js,
5// same origin, scope "/"); everything else in the package is Node-only and must
6// not be served. The size report and the browser-bundle test read this list too.
7//
8// const shared = require('openvibe-shared/files');
9// app.get('/shared/:file', (req, res, next) => shared.isBrowserFile(req.params.file)
10// ? res.sendFile(shared.path(req.params.file)) : next());
11// ═══════════════════════════════════════════════════════════════
12
13const path = require('path');
14
15const BROWSER = Object.freeze([
16 'ov-ai-choice.js', // the model chip and its choice sheet (openvibe-shared/ov-ai-choice)
17 'navbar.js', // shared top bar (eager on every site)
18 'nav-icons.js', // navbar glyphs beyond its own, fetched by navbar.js after first paint
19 'theme-loader.js', // applies the theme before first paint
20 'footer.js', // shared footer (also required on the server by frame.js)
21 'shipped.js', // "Recently shipped" from the network changelog (openvibe.blog)
22 'notification-ui.js', // bell + notification panel
23 'notification-live.js', // the bell's realtime feed over OpenVibe.Events; notification-ui loads it on demand (realtime on)
24 'action-center.js', // the ✦ Action Center; notification-ui loads it on the first click
25 'dock.js', // the Dock and its pill; navbar.js loads it for a signed-in person
26 'dock-mount.js', // the Dock body inside another sheet; dock.js loads it on first mountInto
27 'dock-runs.js', // the Dock's content-aware Agents rows and overview, loaded with that tab
28 'ai-marks-client.js', // maker marks on a run receipt, loaded only in Agents
29 'presence.js', 'purse.js', 'machines.js', 'ov-drop.js', 'mini.js', 'ov-tip.js', 'overlay.js', 'nav-slots.js', // your online status: the dot, the heartbeat, the picker; navbar.js loads it for a signed-in person
30 'dock-vibe.js', // the Dock's Vibe tab (L48 V2); dock.js loads it the first time the tab opens
31 'dock-code.js', // the Dock's Code tab (4.201.0); dock.js loads it the first time the tab opens
32 'dock-timer.js', // the Dock's timer (L48 R2); dock.js loads it while a timer runs or its menu opens
33 'dock-share.js', // the Dock's Send to… (4.144.0); dock.js loads it the first time something is sent
34 'dock-card.js', // a known OpenVibe link's card under a Dock message (4.147.0); loaded the first time one shows
35 'dock-chat-edits.js', // live edits in an open Dock DM; loaded with that conversation
36 'ov-canvas.js', // an agent's live panel (actor.canvas@1, 4.145.0); a page that shows canvases loads it
37 'dock-actor.js', // the Dock's Actor block (Actor v3 A3); dock.js loads it the first time the Actor tab opens
38 'dock-agent.js', // the Dock's agent view (K-D3); dock.js loads it the first time the Agents tab opens
39 'dock-timeline.js', // the Dock's one timeline (A6); dock.js loads it with the Agent panel
40 'account-switcher.js',
41 'user-card.js',
42 'ov-user.js', // public user-card read and opt-in mention/avatar hook; plain kit markup
43 'ov-mark.js', // the OV brand mark drop-in
44 'ov-glyphs.js', // the network's own icons in place of Font Awesome's (built from glyphs.js; navbar.js loads it)
45 'brands.js', // brand logos (Simple Icons, CC0), fetched by ov-glyphs.js the first time a page shows one (4.72.0)
46 'ov-look.js', // the Look panel: themes, the season, more on openvibe.design (navbar.js loads it on first open)
47 'ov-fx.js', // the network's effects (data-fx): glint, glow, lift, press, ripple, tilt, reveal, count, confetti
48 'ov-labels.js', // content labels (L1): each viewer's show / blur / hide; navbar.js loads it when a page has [data-ov-labels]
49 'ov-forms.js', // OpenVibe's own select (a menu on a computer, a sheet on a phone); navbar.js loads it when a page has a form control
50 'ov-qr.js', // a QR code from a link, on the device: the Share sheet's QR code (ov-share.js loads it on first use)
51 'ov-arrange.js', // the Arrange editor (make your own controls, 2026-11-11): a person moves and resizes a surface's parts; a product loads it when Arrange is pressed
52 'ov-arrange-core.js', // openvibe-sdk/ui-layout for the browser, generated (scripts/build-arrange-core.js): the one validator
53 'ov-locker-core.js', // openvibe-sdk/locker for the browser, generated (scripts/build-locker-core.js): WebCrypto only, the SDK's own vectors
54 'ov-locker.js', // Locker in the browser (plan Q2): a locked item's card, making and unlocking your locker; crypto in ov-locker-core.js
55 'ov-wallet.js',
56 'ov-share.js', // the one Share sheet (plan track Q): who can open a thing, people by @name, transfer; navbar.js loads it on the first press of a [data-ov-share-sheet] button
57 'ov-upload.js', // shared file picker, upload queue and ov-progress
58 'messages.js', // Chat's two views: room lines and texting bubbles (openvibe-shared/messages)
59 'ov-thread.js', // one conversation UI (L55 C4): the drawer, search, composer, copy, streaming turns; markup from openvibe-shared/thread, drawn with thread.css
60 'ov-composer.js', // shared composer
61 'ov-run.js', // 4.224.0: the one run thread (OpenVibeRun), loaded beside the navbar
62 'ov-metrics.js', // 4.232.0: the one way to show numbers (tiles, sparklines, bars, percentiles, splits, tables)
63 'ov-capture.js', // OVCapture: camera, microphone, screen, photo and recording for Live, Cam and the composer (4.216.0)
64 'ov-combo.js', // shared field dropdown
65 'ov-searchbox.js', // the one search field (4.229.0): pill, suggestions, recent searches, ghost completion; its list is ov-combo
66 'ov-window.js', // shared dialog, sheet, and panel
67 'agent-sheet.js', // an agent's sheet in the one window (4.211.0)
68 'ov-float.js', // the move engine behind a PiP or a panel: dock/float, tuck, size, place (4.208.0)
69 'ov-icons.js', // ring icons (also required on the server as openvibe-shared/icons)
70 'ov-home.js', // the menu's home screen and wall (search.js loads it for You and Feed)
71 'history.js', // cross-site history
72 'sso-client.js', // link hand-off, FedCM
73 'panels.js', // one-open-at-a-time panel coordinator
74 'surfaces.js', // scroll locking and gestures for sheets; outside pointer for pop-overs
75 'ui.js', // toasts and page notices
76 'route-transition.js', // page-move bar, loading line and fade-in; web-runtime.js fetches it on the first move
77 'boost.js', // smooth same-site page moves for a server-rendered site (OVBoost; plan T11)
78 'soft.js', // speculation-rule prefetch and cross-document view transitions (soft pages, 2026-11-10)
79 'island.js', // activity island
80 'items.js', // what people wear (OpenVibe.Inventory name effects, plan T21); draw with items.css
81 'profile-panel.js', // a person's stuff on any site (worn items, badges, achievements), from the Network profile
82 'quest.js', // the daily quest card any site can show (OpenVibeQuest.mount); draw with quest.css
83 'guide.js', // the opaque quest step guide (OpenVibeQuestGuide.startFromLocation)
84 'tooltip.js',
85 'player.js', // the network's one video player look: enhances video[data-ov-player]; draw with player.css
86 'ov-sync.js', // one timeline for many players (seven domains B4): OVSync.attach(media, { room, socket }); no dependencies
87 'vibes-pay.js', // Vibes Pay: OpenVibe.vibes.pay() and <button data-ov-vibes-pay> (MONEY.md, D12); 4.111.0
88 'release-watch.js', // keeps open tabs on a supported release (ADR-016), loaded after first paint
89 'release-update.js', // plans a new release and applies style/content in place; release-watch loads it on demand
90 'web-runtime.js', // feature loader and route lifecycle (OVWebRuntime), from Live's ov-loader
91 'bottom.js', // the bottom of the screen measured once (plan 279): --ovb-lift for the app bar, the small player and the Dock
92 'appbar.js', // the phone app bar; navbar.js loads it only for a site that sets appBar
93 'kit.js', // the OpenVibe Kit's builders in the page (for pages that draw themselves; with kit-web.js)
94 'kit-web.js', // the OpenVibe Kit's behaviour (copy, menus, Enter to send, confirms, sheets): all a server-rendered site loads
95 'kit-data-web.js', // Kit 2's behaviour: chart readouts, scatter labels, drop zones (4.37.0; with kit-data.css)
96 'tokens.js', // OpenVibe Tokens: a theme as DTCG tokens, compiled to CSS, Tailwind, Compose, SwiftUI, Flutter, Figma (4.40.0)
97 'components.js', // the kit's components as a contract (anatomy, tokens, states, a11y), kit documents, native reference views (4.42.0)
98 'search.js', // search everything from the navbar's magnifier, / or Ctrl+K; navbar.js loads it on first use
99 'loading.js', // the one loading look: a poster-backed overlay with status and progress, and skeleton rows
100 'agent-session.js', // a coding agent's session as people read it: steps grouped, live output, diffs, helpers, hand-offs
101 'motion.js', // reveal on scroll, number ticker, typed hints (4.28.0; the server writes the end state)
102 'rooms.js', // the rooms' accents, lines and motifs (OpenVibeRooms; 4.28.0)
103 'openvibe-sw.js', // Web Push service worker
104]);
105
106// Stylesheets sites serve at /shared/<file> beside the scripts.
107const STYLES = Object.freeze([
108 'showcase.css', // openvibe-shared/showcase's sections + the ring icons (generated: scripts/build-styles.js)
109 'ov-parts.css', // a page's sections as tabs on a phone, alone (showcase.parts(); generated: scripts/build-styles.js; 4.228.0)
110 'items.css', // Live's name effects for items.js (live.name_effect.css@1)
111 'profile-panel.css', // the panel profile-panel.js draws
112 'player.css', // player.js's controls
113 'quest.css', // quest.js's card: the daily quest any site can show
114 'kit.css', // the OpenVibe Kit's look (kit.js / openvibe-shared/kit build the markup; docs/kit.md)
115 'ov-forms.css', // the look of ov-forms.js's select, the site-coloured checkboxes, switches and sliders, .ov-field (docs/forms.md)
116 'ov-locker.css', // ov-locker.js's look: the locked card, the locker sheets, the recovery kit (docs/locker.md)
117 'ov-wallet.css',
118 'ov-ai-choice.css', // the model chip and its choice sheet (ov-ai-choice.js)
119 'ov-share.css', // ov-share.js's look: the sheet, the recipient's offer banner, the not-on-the-list gate (docs/share.md)
120 'ov-upload.css', // picker, queue and ov-progress states
121 'messages.css', // the room and bubble views' look
122 'room.css', // kit.card, kit.rail and a room's accent (4.29.1; load after kit.css where cards, rails or sc.room() are)
123 'thread.css', // the conversation UI's look (openvibe-shared/thread, ov-thread.js; plan L55 C4)
124 'thread-inline.css', // the inline Community thread's look (openvibe-shared/thread renderThread; 4.215.0)
125 'kit-layout.css', // the fluid scale, the layout primitives (.ov-stack, .ov-switcher…) and the opt-in .ov-base (4.78.0; after kit.css)
126 'kit-data.css', // Kit 2's look: steps, tables, charts, rankings, meters, drop zones, receipts (4.37.0; after kit.css)
127 'agent-session.css', // agent-session.js's look (4.32.0; the script links it from beside itself unless the page does)
128 'ov-glyphs-font.css', // the glyphs as a font: <i class="ovi ovi-eye"> (4.62.0; built with the font, scripts/build-glyph-fonts.py)
129 'ov-glyphs-fa.css', // Font Awesome's class names on the glyph font, for a site that drops Font Awesome's own (4.62.0)
130]);
131// Fonts sites serve at /shared/<file>: the brand face the names are set in (navbar.js declares it from beside itself),
132// and the glyph font.
133const FONTS = Object.freeze([
134 'ov-brand.woff2', // Nunito (SIL OFL 1.1, OFL-Nunito.txt), Latin, weights 700-900: the OpenVibe names (4.59.0)
135 'ov-glyphs.woff2', // the OpenVibe glyphs as a font (4.62.0; TTF and OTF for desktop apps are in glyph-fonts/)
136 'ov-glyphs-thin.woff2', 'ov-glyphs-light.woff2', 'ov-glyphs-bold.woff2', 'ov-glyphs-solid.woff2',
137]);
138// Pictures sites serve at /shared/<file>.
139const IMAGES = Object.freeze([
140 'ov-glyphs.svg', // every glyph as a <symbol>: <svg><use href="/shared/ov-glyphs.svg#ovg-eye"/></svg> (4.62.0)
141]);
142const served = (name) => BROWSER.includes(String(name)) || STYLES.includes(String(name)) || FONTS.includes(String(name)) || IMAGES.includes(String(name));
143
144module.exports = {
145 dir: __dirname,
146 BROWSER,
147 STYLES,
148 FONTS,
149 IMAGES,
150 isBrowserFile: served,
151 path: (name) => {
152 if (!served(name)) throw new Error(`openvibe-shared: ${name} is not a browser file`);
153 return path.join(__dirname, name);
154 },
155};
156