openvibers/openvibe.vision Commits
openvibe-shared v4.228.0 (was v4.225.0) (#170)
Changes
@@@ -327,5 +327,5 @@ Offer discovery is configured by `VISION_DEALS_SEARCH_URL` and `VISION_SHOES_SEA<!-- versions:start -->- openvibe-contracts: v0.417.0- openvibe-sdk: v0.161.0--- openvibe-shared: v4.225.0++- openvibe-shared: v4.228.0<!-- versions:end -->@@@ -10,11 +10,11 @@"domain": "openvibe.vision","contracts": "openvibe-contracts v0.417.0","sdk": "openvibe-sdk v0.161.0",-- "shared": "openvibe-shared v4.225.0",++ "shared": "openvibe-shared v4.228.0","packages": ["openvibe-contracts v0.417.0","openvibe-sdk v0.161.0",-- "openvibe-shared v4.225.0"++ "openvibe-shared v4.228.0"],"capabilities": ["vision.image.ask",@@@ -20,7 +20,7 @@"onnxruntime-node": "^1.31.1","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0","pg": "^8.23.0","sharp": "^0.33.5"},@@@ -2750,9 +2750,9 @@}},"node_modules/openvibe-shared": {-- "version": "4.225.0",-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",-- "integrity": "sha512-zuZIgYODwJJ7UpDBTVnT+czEI5l6YFWqt1nbfbPeEsW6/NlmDZHJWPSGpBv223jRpvhJYH7Duea6nuRr8KZ3sg==",++ "version": "4.228.0",++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",++ "integrity": "sha512-HR0Hac/K+qKmwMf2QZWCFxW+uVja36nyAtxVbNFgPGUDFdmWhmb6RMoP/CkU0+GSCPsC50k6aTS+oPx2czDgGg==","license": "MIT","dependencies": {"clean-css": "^5.3.3",@@@ -30,7 +30,7 @@"onnxruntime-node": "^1.31.1","openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0","openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0","pg": "^8.23.0","sharp": "^0.33.5"},@@@ -1,4 +1,5 @@'use strict';++const { pick } = require('openvibe-shared/showcase');/*** The home on a phone (the owner's short-pages rule, 2026-10-30): one or two screens, app-like.*@@@ -19,13 +20,11 @@ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&').replace(/</** pickBlock({ key, label, head, panes }) panes: [{ id, label, html }]*/--function pickBlock({ key, label, head = '', panes }) {-- // A pane with nothing to show is left out, so the chips and the rules that show them match the page.-- panes = (panes || []).filter((p) => p.html);-- if (!panes.length) return '';-- const chips = panes.map((p) => '<a class="pick-chip" href="#' + esc(p.id) + '">' + esc(p.label) + '</a>').join('');-- const body = panes.map((p) => '<div class="pick-pane" id="' + esc(p.id) + '">' + p.html + '</div>').join('');-- return '<div class="pick" id="pick-' + esc(key) + '"><div class="pick-bar"><div class="pick-head"><h2>' + esc(head || label) + '</h2></div><nav class="pick-row" aria-label="' + esc(label) + '">' + chips + '</nav></div><div class="pick-body">' + body + '</div></div>';++// 4.228.0: Shared's showcase.pick() draws the block (tabs on a phone, every pane in the page, a link to a pane opens++// it); this copy only jumped to a pane with chips, so a phone showed them all (the owner, 11-12). The ids are this++// site's own, so its links keep working.++function pickBlock({ key, label, head = '', headId = '', bodyClass = '', panes, checked = '' }) {++ return pick({ key, label, head, headId, bodyClass, checked: checked ? checked : '', panes: (panes || []).map((p) => ({ id: p.id, label: p.label, html: p.html })) });}@@@ -11,10 +11,10 @@ const { boot, check, done } = require('./helpers/boot');const start = page.indexOf('<div class="pick" id="pick-scenes">');assert.ok(start > 0, 'the pick block is on the home');const block = page.slice(start, start + 8000);-- assert.match(block, /<nav class="pick-row" aria-label="What Vision does">/);-- const chips = [...block.matchAll(/<a class="pick-chip" href="#(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)<\/a>/g)];++ assert.match(block, /<div class=\"ov-parts ov-parts--front\" data-parts=\"\d+\">/, 'its parts are tabs on a phone');++ const chips = [...block.matchAll(/<label for="ovp-[a-z0-9]+-(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)(?: <span class="ov-parts-n">[^<]*<\/span>)?<\/label>/g)];assert.strictEqual(chips.length, 4, 'a chip per scene (' + chips.length + ')');-- assert.ok(!/type="radio"/.test(block), 'no chip is a radio: nothing is picked, every pane shows');++ assert.ok(/<input type=\"radio\" class=\"ov-parts-r\"[^>]* checked>/.test(block), 'the first part is open on a phone (Shared pick(): tabs, 11-12)');const scenes = [...block.matchAll(/<article class="sc-scene/g)];assert.strictEqual(scenes.length, chips.length, 'every scene is in the page');for (const m of chips) assert.ok(block.includes('id="' + m[1] + '"'), 'the pane of ' + m[1] + ' is in the page');@@@ -121,7 +121,7 @@ const PLANTED = '<style>body{background:#fff;color:#999}.wide{width:1600px}</styassert.strictEqual(hashed.headers.get('cache-control'), 'public, max-age=31536000, immutable');const wrong = await t.get('/css/vision.css?v=deadbeefdeadbeef');assert.strictEqual(wrong.status, 200);-- assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=86400');++ assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=300');const robots = await t.get('/robots.txt');assert.match(robots.text, /Disallow: \/api\//);assert.match(robots.text, /Disallow: \/a\//);
@@ -327,5 +327,5 @@ Offer discovery is configured by `VISION_DEALS_SEARCH_URL` and `VISION_SHOES_SEA
@@ -327,5 +327,5 @@ Offer discovery is configured by `VISION_DEALS_SEARCH_URL` and `VISION_SHOES_SEA
<!-- versions:start -->
<!-- versions:start -->
- openvibe-contracts: v0.417.0
- openvibe-contracts: v0.417.0
- openvibe-sdk: v0.161.0
- openvibe-sdk: v0.161.0
-- openvibe-shared: v4.225.0
+- openvibe-shared: v4.228.0
<!-- versions:end -->
<!-- versions:end -->
@@ -10,11 +10,11 @@
@@ -10,11 +10,11 @@
"domain": "openvibe.vision",
"domain": "openvibe.vision",
"contracts": "openvibe-contracts v0.417.0",
"contracts": "openvibe-contracts v0.417.0",
"sdk": "openvibe-sdk v0.161.0",
"sdk": "openvibe-sdk v0.161.0",
- "shared": "openvibe-shared v4.225.0",
+ "shared": "openvibe-shared v4.228.0",
"packages": [
"packages": [
"openvibe-contracts v0.417.0",
"openvibe-contracts v0.417.0",
"openvibe-sdk v0.161.0",
"openvibe-sdk v0.161.0",
- "openvibe-shared v4.225.0"
+ "openvibe-shared v4.228.0"
],
],
"capabilities": [
"capabilities": [
"vision.image.ask",
"vision.image.ask",
@@ -20,7 +20,7 @@
@@ -20,7 +20,7 @@
"onnxruntime-node": "^1.31.1",
"onnxruntime-node": "^1.31.1",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
"pg": "^8.23.0",
"pg": "^8.23.0",
"sharp": "^0.33.5"
"sharp": "^0.33.5"
},
},
@@ -2750,9 +2750,9 @@
@@ -2750,9 +2750,9 @@
}
}
},
},
"node_modules/openvibe-shared": {
"node_modules/openvibe-shared": {
- "version": "4.225.0",
- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
- "integrity": "sha512-zuZIgYODwJJ7UpDBTVnT+czEI5l6YFWqt1nbfbPeEsW6/NlmDZHJWPSGpBv223jRpvhJYH7Duea6nuRr8KZ3sg==",
+ "version": "4.228.0",
+ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
+ "integrity": "sha512-HR0Hac/K+qKmwMf2QZWCFxW+uVja36nyAtxVbNFgPGUDFdmWhmb6RMoP/CkU0+GSCPsC50k6aTS+oPx2czDgGg==",
"license": "MIT",
"license": "MIT",
"dependencies": {
"dependencies": {
"clean-css": "^5.3.3",
"clean-css": "^5.3.3",
@@ -30,7 +30,7 @@
@@ -30,7 +30,7 @@
"onnxruntime-node": "^1.31.1",
"onnxruntime-node": "^1.31.1",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.417.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.161.0",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.225.0",
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.228.0",
"pg": "^8.23.0",
"pg": "^8.23.0",
"sharp": "^0.33.5"
"sharp": "^0.33.5"
},
},
@@ -1,4 +1,5 @@
@@ -1,4 +1,5 @@
'use strict';
'use strict';
+const { pick } = require('openvibe-shared/showcase');
/**
/**
* The home on a phone (the owner's short-pages rule, 2026-10-30): one or two screens, app-like.
* The home on a phone (the owner's short-pages rule, 2026-10-30): one or two screens, app-like.
*
*
@@ -19,13 +20,11 @@ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&').replace(/</
@@ -19,13 +20,11 @@ const esc = (s) => String(s == null ? '' : s).replace(/&/g, '&').replace(/</
*
*
* pickBlock({ key, label, head, panes }) panes: [{ id, label, html }]
* pickBlock({ key, label, head, panes }) panes: [{ id, label, html }]
*/
*/
-function pickBlock({ key, label, head = '', panes }) {
- // A pane with nothing to show is left out, so the chips and the rules that show them match the page.
- panes = (panes || []).filter((p) => p.html);
- if (!panes.length) return '';
- const chips = panes.map((p) => '<a class="pick-chip" href="#' + esc(p.id) + '">' + esc(p.label) + '</a>').join('');
- const body = panes.map((p) => '<div class="pick-pane" id="' + esc(p.id) + '">' + p.html + '</div>').join('');
- return '<div class="pick" id="pick-' + esc(key) + '"><div class="pick-bar"><div class="pick-head"><h2>' + esc(head || label) + '</h2></div><nav class="pick-row" aria-label="' + esc(label) + '">' + chips + '</nav></div><div class="pick-body">' + body + '</div></div>';
+// 4.228.0: Shared's showcase.pick() draws the block (tabs on a phone, every pane in the page, a link to a pane opens
+// it); this copy only jumped to a pane with chips, so a phone showed them all (the owner, 11-12). The ids are this
+// site's own, so its links keep working.
+function pickBlock({ key, label, head = '', headId = '', bodyClass = '', panes, checked = '' }) {
+ return pick({ key, label, head, headId, bodyClass, checked: checked ? checked : '', panes: (panes || []).map((p) => ({ id: p.id, label: p.label, html: p.html })) });
}
}
@@ -11,10 +11,10 @@ const { boot, check, done } = require('./helpers/boot');
@@ -11,10 +11,10 @@ const { boot, check, done } = require('./helpers/boot');
const start = page.indexOf('<div class="pick" id="pick-scenes">');
const start = page.indexOf('<div class="pick" id="pick-scenes">');
assert.ok(start > 0, 'the pick block is on the home');
assert.ok(start > 0, 'the pick block is on the home');
const block = page.slice(start, start + 8000);
const block = page.slice(start, start + 8000);
- assert.match(block, /<nav class="pick-row" aria-label="What Vision does">/);
- const chips = [...block.matchAll(/<a class="pick-chip" href="#(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)<\/a>/g)];
+ assert.match(block, /<div class=\"ov-parts ov-parts--front\" data-parts=\"\d+\">/, 'its parts are tabs on a phone');
+ const chips = [...block.matchAll(/<label for="ovp-[a-z0-9]+-(?:pp-scenes-)?(vi-scene-\d+)">()()([^<]+)(?: <span class="ov-parts-n">[^<]*<\/span>)?<\/label>/g)];
assert.strictEqual(chips.length, 4, 'a chip per scene (' + chips.length + ')');
assert.strictEqual(chips.length, 4, 'a chip per scene (' + chips.length + ')');
- assert.ok(!/type="radio"/.test(block), 'no chip is a radio: nothing is picked, every pane shows');
+ assert.ok(/<input type=\"radio\" class=\"ov-parts-r\"[^>]* checked>/.test(block), 'the first part is open on a phone (Shared pick(): tabs, 11-12)');
const scenes = [...block.matchAll(/<article class="sc-scene/g)];
const scenes = [...block.matchAll(/<article class="sc-scene/g)];
assert.strictEqual(scenes.length, chips.length, 'every scene is in the page');
assert.strictEqual(scenes.length, chips.length, 'every scene is in the page');
for (const m of chips) assert.ok(block.includes('id="' + m[1] + '"'), 'the pane of ' + m[1] + ' is in the page');
for (const m of chips) assert.ok(block.includes('id="' + m[1] + '"'), 'the pane of ' + m[1] + ' is in the page');
@@ -121,7 +121,7 @@ const PLANTED = '<style>body{background:#fff;color:#999}.wide{width:1600px}</sty
@@ -121,7 +121,7 @@ const PLANTED = '<style>body{background:#fff;color:#999}.wide{width:1600px}</sty
assert.strictEqual(hashed.headers.get('cache-control'), 'public, max-age=31536000, immutable');
assert.strictEqual(hashed.headers.get('cache-control'), 'public, max-age=31536000, immutable');
const wrong = await t.get('/css/vision.css?v=deadbeefdeadbeef');
const wrong = await t.get('/css/vision.css?v=deadbeefdeadbeef');
assert.strictEqual(wrong.status, 200);
assert.strictEqual(wrong.status, 200);
- assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=86400');
+ assert.strictEqual(wrong.headers.get('cache-control'), 'public, max-age=300, stale-while-revalidate=300');
const robots = await t.get('/robots.txt');
const robots = await t.get('/robots.txt');
assert.match(robots.text, /Disallow: \/api\//);
assert.match(robots.text, /Disallow: \/api\//);
assert.match(robots.text, /Disallow: \/a\//);
assert.match(robots.text, /Disallow: \/a\//);